mirror of
https://github.com/espressif/esp-idf.git
synced 2026-08-18 06:35:35 +03:00
fix(ble/bluedroid): fix ISO HCI layer and update Kconfig
- Fix ISO HCI functions and remove unused code - Fix spelling: BROCASTER to BROADCASTER in Kconfig and headers - Update common config headers for consistency
This commit is contained in:
@@ -1443,11 +1443,11 @@ config BT_BLE_FEAT_ISO_60_EN
|
||||
Enable iso 6.0 feature
|
||||
|
||||
config BT_BLE_FEAT_ISO_BIG_BROCASTER
|
||||
bool "Enable BLE iso BIG brocaster"
|
||||
bool "Enable BLE iso BIG broadcaster"
|
||||
depends on BT_BLE_FEAT_ISO_EN
|
||||
default y
|
||||
help
|
||||
Enable BLE 5.2 BIG brocaster
|
||||
Enable BLE 5.2 BIG broadcaster
|
||||
|
||||
config BT_BLE_FEAT_ISO_BIG_SYNCER
|
||||
bool "Enable BLE iso BIG syncer"
|
||||
|
||||
@@ -303,9 +303,9 @@
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_BLE_FEAT_ISO_BIG_BROCASTER
|
||||
#define UC_BT_BLE_FEAT_ISO_BIG_BROCASTER CONFIG_BT_BLE_FEAT_ISO_BIG_BROCASTER
|
||||
#define UC_BT_BLE_FEAT_ISO_BIG_BROADCASTER CONFIG_BT_BLE_FEAT_ISO_BIG_BROCASTER
|
||||
#else
|
||||
#define UC_BT_BLE_FEAT_ISO_BIG_BROCASTER FALSE
|
||||
#define UC_BT_BLE_FEAT_ISO_BIG_BROADCASTER FALSE
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_BLE_FEAT_ISO_CIG_CENTRAL
|
||||
|
||||
@@ -337,10 +337,10 @@
|
||||
#define BLE_FEAT_ISO_60_EN FALSE
|
||||
#endif
|
||||
|
||||
#if (UC_BT_BLE_FEAT_ISO_BIG_BROCASTER == TRUE)
|
||||
#define BLE_FEAT_ISO_BIG_BROCASTER_EN TRUE
|
||||
#if (UC_BT_BLE_FEAT_ISO_BIG_BROADCASTER == TRUE)
|
||||
#define BLE_FEAT_ISO_BIG_BROADCASTER_EN TRUE
|
||||
#else
|
||||
#define BLE_FEAT_ISO_BIG_BROCASTER_EN FALSE
|
||||
#define BLE_FEAT_ISO_BIG_BROADCASTER_EN FALSE
|
||||
#endif
|
||||
|
||||
#if (UC_BT_BLE_FEAT_ISO_BIG_SYNCER == TRUE)
|
||||
|
||||
@@ -79,33 +79,6 @@ ble_hci_set_iso_buf_sz(uint16_t pktlen, uint8_t max_pkts)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
ble_hci_get_iso_buf_size(uint16_t *pktlen, uint8_t *max_pkts)
|
||||
{
|
||||
assert(pktlen && max_pkts);
|
||||
|
||||
*pktlen = ble_hs_iso_buf_sz;
|
||||
*max_pkts = ble_hs_iso_max_pkts;
|
||||
}
|
||||
|
||||
#if (BLE_ISO_STD_FLOW_CTRL == TRUE)
|
||||
void
|
||||
ble_hci_add_iso_avail_pkts(uint16_t delta)
|
||||
{
|
||||
osi_mutex_global_lock();
|
||||
|
||||
if (ble_hs_iso_avail_pkts + delta > ble_hs_iso_max_pkts) {
|
||||
HCI_TRACE_ERROR("ISO_HS_RESET %u %u %u\n", ble_hs_iso_avail_pkts, delta, ble_hs_iso_max_pkts);
|
||||
// ble_hs_sched_reset(BLE_HS_ECONTROLLER);
|
||||
assert(0);
|
||||
} else {
|
||||
ble_hs_iso_avail_pkts += delta;
|
||||
}
|
||||
|
||||
osi_mutex_global_unlock();
|
||||
}
|
||||
#endif /* (BLE_ISO_STD_FLOW_CTRL) */
|
||||
|
||||
#define BLE_ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))
|
||||
|
||||
struct ble_hci_iso_conn *
|
||||
@@ -156,39 +129,6 @@ ble_hci_iso_alloc_conn(uint16_t conn_handle)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if (BLE_ISO_STD_FLOW_CTRL == TRUE)
|
||||
static uint8_t
|
||||
ble_hci_iso_buf_needed(struct ble_hs_iso_conn *conn)
|
||||
{
|
||||
uint16_t sdu_offset;
|
||||
uint16_t dl_len;
|
||||
uint8_t dlh_len;
|
||||
uint8_t count;
|
||||
|
||||
dlh_len = (conn->ts_flag ? BLE_HCI_ISO_DATA_LOAD_TS_SZ : 0) + BLE_HCI_ISO_DATA_LOAD_HDR_SZ;
|
||||
sdu_offset = 0;
|
||||
count = 1; /* 1 extra since framed pdu may be used */
|
||||
|
||||
while (1) {
|
||||
dl_len = min(dlh_len + conn->sdu_len - sdu_offset, ble_hs_iso_buf_sz);
|
||||
|
||||
count += 1;
|
||||
|
||||
sdu_offset += dl_len - dlh_len;
|
||||
assert(sdu_offset <= conn->sdu_len);
|
||||
|
||||
if (sdu_offset == conn->sdu_len) {
|
||||
break;
|
||||
}
|
||||
|
||||
/* No data load header for continuation/last segment */
|
||||
dlh_len = 0;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
#endif /* (BLE_ISO_STD_FLOW_CTRL) */
|
||||
|
||||
static void
|
||||
ble_hci_iso_hdr_append(struct ble_hci_iso_conn *conn,
|
||||
uint8_t *frag,
|
||||
|
||||
@@ -357,7 +357,8 @@ int hci_adv_credits_prep_to_release(uint16_t num)
|
||||
|
||||
osi_mutex_lock(&hci_hal_env.adv_flow_lock, OSI_MUTEX_MAX_TIMEOUT);
|
||||
int credits_to_release = hci_hal_env.adv_credits_to_release + num;
|
||||
assert(hci_hal_env.adv_credits_to_release <= BLE_ADV_REPORT_FLOW_CONTROL_NUM);
|
||||
assert(num <= BLE_ADV_REPORT_FLOW_CONTROL_NUM);
|
||||
assert(credits_to_release >= 0 && credits_to_release <= BLE_ADV_REPORT_FLOW_CONTROL_NUM);
|
||||
hci_hal_env.adv_credits_to_release = credits_to_release;
|
||||
osi_mutex_unlock(&hci_hal_env.adv_flow_lock);
|
||||
|
||||
|
||||
@@ -69,10 +69,6 @@ struct ble_hci_iso_conn {
|
||||
|
||||
int ble_hci_set_iso_buf_sz(uint16_t pktlen, uint8_t max_pkts);
|
||||
|
||||
void ble_hci_get_iso_buf_size(uint16_t *pktlen, uint8_t *max_pkts);
|
||||
|
||||
void ble_hci_add_iso_avail_pkts(uint16_t delta);
|
||||
|
||||
struct ble_hci_iso_conn *ble_hci_iso_conn_find(uint16_t conn_handle);
|
||||
|
||||
int esp_ble_hci_iso_tx(uint16_t conn_handle, const uint8_t *sdu, uint16_t sdu_len,
|
||||
|
||||
Reference in New Issue
Block a user