mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
Merge branch 'bugfix/fix_bredr_kconfig' into 'master'
fix(bt): Fixed not show config for broadcast encryption and PCA Closes BTQABR2023-674 See merge request espressif/esp-idf!48311
This commit is contained in:
Submodule components/bt/controller/lib_esp32s31/esp32s31-bt-lib updated: e03d132448...fd26aa4fc7
@@ -130,6 +130,31 @@ config BT_CTRL_BR_EDR_APB_EN
|
||||
help
|
||||
Enable BR/EDR Active Peripheral Broadcast
|
||||
|
||||
config BT_CTRL_BR_EDR_APB_EXT_EN
|
||||
bool "Enable BR/EDR Broadcast Encryption or Piconet Clock Adjustment"
|
||||
select BT_CTRL_BR_EDR_APB_EN
|
||||
default n
|
||||
help
|
||||
Enable BR/EDR Broadcast Encryption or Piconet Clock Adjustment
|
||||
|
||||
choice BT_CTRL_BR_EDR_APB_EXT
|
||||
prompt "Choice BR/EDR Broadcast Encryption or Piconet Clock Adjustment"
|
||||
depends on BT_CTRL_BR_EDR_APB_EXT_EN
|
||||
default BT_CTRL_BR_EDR_APB_EXT_PCA_EN
|
||||
help
|
||||
Enable BR/EDR Broadcast Encryption or Piconet Clock Adjustment
|
||||
|
||||
config BT_CTRL_BR_EDR_APB_EXT_BCST_ENC_EN
|
||||
bool "Broadcast Encryption"
|
||||
help
|
||||
Enable BR/EDR Broadcast Encryption
|
||||
|
||||
config BT_CTRL_BR_EDR_APB_EXT_PCA_EN
|
||||
bool "Piconet Clock Adjustment"
|
||||
help
|
||||
Enable BR/EDR Piconet Clock Adjustment
|
||||
endchoice
|
||||
|
||||
config BT_CTRL_BR_EDR_CPB_TX_EN
|
||||
bool "Enable BR/EDR Connectionless Peripheral Broadcast Transimit"
|
||||
default n
|
||||
@@ -148,6 +173,12 @@ config BT_CTRL_BR_EDR_LK_STORE_EN
|
||||
help
|
||||
Enable BR/EDR controller link key storage, only support store link key in RAM for now.
|
||||
|
||||
config BT_CTRL_BR_EDR_DTM_EN
|
||||
bool "Enable BR/EDR controller direct test mode"
|
||||
default n
|
||||
help
|
||||
Enable BR/EDR controller direct test mode
|
||||
|
||||
config BT_CTRL_BR_EDR_TX_CCA_ENABLED
|
||||
bool "Enable BR/EDR TX CCA feature"
|
||||
default n
|
||||
|
||||
@@ -65,6 +65,12 @@ extern "C" {
|
||||
#define UC_BR_EDR_LK_STORE_EN 0
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_BT_CTRL_BR_EDR_DTM_EN) && CONFIG_BT_CTRL_BR_EDR_DTM_EN
|
||||
#define UC_BR_EDR_DTM_EN 1
|
||||
#else
|
||||
#define UC_BR_EDR_DTM_EN 0
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_BT_CTRL_BR_EDR_TX_CCA_ENABLED)
|
||||
#define UC_BR_EDR_TX_CCA_EN (CONFIG_BT_CTRL_BR_EDR_TX_CCA_ENABLED)
|
||||
#else
|
||||
|
||||
@@ -112,8 +112,7 @@ extern int bredr_ctrl_feat_bcst_enc_en(void);
|
||||
extern int bredr_ctrl_feat_pca_en(void);
|
||||
extern int bredr_ctrl_feat_cpb_rx_en(void);
|
||||
extern int bredr_ctrl_feat_cpb_tx_en(void);
|
||||
extern int bredr_ctrl_feat_vs_basic_en(void);
|
||||
extern int bredr_ctrl_feat_vs_sec_ctrl_en(void);
|
||||
extern int bredr_ctrl_feat_dtm_en(void);
|
||||
extern int bredr_ctrl_feat_test_en(void);
|
||||
extern int bredr_ctrl_feat_lk_store_en(void);
|
||||
extern int bredr_ctrl_feat_coex_en(void);
|
||||
@@ -130,22 +129,7 @@ extern const sleep_retention_entries_config_t *r_bredr_mac_retention_link_get(ui
|
||||
|
||||
static uint32_t esp_random_wrapper(void)
|
||||
{
|
||||
// TODO: use esp_random
|
||||
// return (int)esp_random();
|
||||
|
||||
static bool first = true;
|
||||
|
||||
if (first) {
|
||||
uint8_t mac[6];
|
||||
uint32_t seed;
|
||||
|
||||
first = false;
|
||||
btdm_osal_read_efuse_mac(mac);
|
||||
seed = (mac[2] << 24) | (mac[3] << 16) | (mac[4] << 8) | mac[5];
|
||||
srand(seed);
|
||||
}
|
||||
|
||||
return rand();
|
||||
return esp_random();
|
||||
}
|
||||
typedef struct bredr_ecc_ops {
|
||||
int (*ecc256_gen_key_pair)(uint8_t *public, uint8_t *priv);
|
||||
@@ -658,22 +642,6 @@ static int bredr_ctrl_setup_callback(void)
|
||||
}
|
||||
#endif /* UC_BR_EDR_CPB_TX_LINK_NB */
|
||||
|
||||
#if UC_BR_EDR_BASIC_VENDOR
|
||||
ret = bredr_ctrl_feat_vs_basic_en();
|
||||
if (ret != 0) {
|
||||
ESP_LOGE(BREDR_LOG_TAG, "bredr_ctrl_feat_vs_basic_en failed, ret:%d", ret);
|
||||
break;
|
||||
}
|
||||
#endif /* UC_BR_EDR_BASIC_VENDOR */
|
||||
|
||||
#if UC_BR_EDR_LEGACY_AUTH_VENDOR_EVT
|
||||
ret = bredr_ctrl_feat_vs_sec_ctrl_en();
|
||||
if (ret != 0) {
|
||||
ESP_LOGE(BREDR_LOG_TAG, "bredr_ctrl_feat_vs_clk_ctrl_en failed, ret:%d", ret);
|
||||
break;
|
||||
}
|
||||
#endif /* UC_BR_EDR_LEGACY_AUTH_VENDOR_EVT */
|
||||
|
||||
#if UC_BR_EDR_TEST_MODE_EN
|
||||
ret = bredr_ctrl_feat_test_en();
|
||||
if (ret != 0) {
|
||||
@@ -690,6 +658,14 @@ static int bredr_ctrl_setup_callback(void)
|
||||
}
|
||||
#endif /* UC_BR_EDR_LK_STORE_EN */
|
||||
|
||||
#if UC_BR_EDR_DTM_EN
|
||||
ret = bredr_ctrl_feat_dtm_en();
|
||||
if (ret != 0) {
|
||||
ESP_LOGE(BREDR_LOG_TAG, "bredr_ctrl_feat_dtm_en failed, ret:%d", ret);
|
||||
break;
|
||||
}
|
||||
#endif /* UC_BR_EDR_DTM_EN */
|
||||
|
||||
#if CONFIG_SW_COEXIST_ENABLE
|
||||
ret = bredr_ctrl_feat_coex_en();
|
||||
if (ret != 0) {
|
||||
|
||||
@@ -59,6 +59,9 @@ hci_h4_frame_start(struct hci_h4_sm *rxs, uint8_t pkt_type)
|
||||
|
||||
switch (rxs->pkt_type) {
|
||||
case HCI_H4_CMD:
|
||||
#if UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
case HCI_H4_SYNC:
|
||||
#endif // UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
rxs->min_len = 3;
|
||||
break;
|
||||
case HCI_H4_ACL:
|
||||
@@ -227,6 +230,9 @@ hci_h4_sm_w4_payload(struct hci_h4_sm *h4sm,
|
||||
len = min(ib->len, h4sm->exp_len - h4sm->len);
|
||||
switch (h4sm->pkt_type) {
|
||||
case HCI_H4_CMD:
|
||||
#if UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
case HCI_H4_SYNC:
|
||||
#endif // UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
if (h4sm->pkt) {
|
||||
memcpy(&h4sm->pkt->data[h4sm->len], ib->buf, len);
|
||||
}
|
||||
@@ -304,12 +310,20 @@ hci_h4_sm_completed(struct hci_h4_sm *h4sm)
|
||||
#endif // UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
break;
|
||||
case HCI_H4_CMD:
|
||||
#if UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
case HCI_H4_SYNC:
|
||||
#endif // UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
case HCI_H4_ISO:
|
||||
if (h4sm->buf) {
|
||||
switch(h4sm->pkt_type) {
|
||||
case HCI_H4_CMD:
|
||||
data_source = HCI_DRIVER_CMD;
|
||||
break;
|
||||
#if UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
case HCI_H4_SYNC:
|
||||
data_source = HCI_DRIVER_BREDR_SYNC;
|
||||
break;
|
||||
#endif // UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
case HCI_H4_ISO:
|
||||
data_source = HCI_DRIVER_LE_ISO;
|
||||
break;
|
||||
|
||||
@@ -84,7 +84,6 @@ void
|
||||
hci_driver_mem_bredr_acl_free(void *ptr)
|
||||
{
|
||||
hci_driver_packet_t *pkt = (hci_driver_packet_t *) ptr;
|
||||
bredr_hci_trans_acl_tx_done(pkt);
|
||||
bredr_hci_trans_acl_free(pkt);
|
||||
}
|
||||
|
||||
@@ -98,7 +97,6 @@ void
|
||||
hci_driver_mem_sync_free(void *ptr)
|
||||
{
|
||||
hci_driver_packet_t *pkt = (hci_driver_packet_t *) ptr;
|
||||
bredr_hci_trans_sync_tx_done(pkt);
|
||||
bredr_hci_trans_sync_free(pkt);
|
||||
}
|
||||
#endif // UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
|
||||
Reference in New Issue
Block a user