diff --git a/components/bt/controller/esp32/Kconfig.in b/components/bt/controller/esp32/Kconfig.in index 4e4363f6b6..f09945dc87 100644 --- a/components/bt/controller/esp32/Kconfig.in +++ b/components/bt/controller/esp32/Kconfig.in @@ -23,6 +23,14 @@ config BTDM_CTRL_BLE_MAX_CONN BLE maximum connections of bluetooth controller. Each connection uses 1KB static DRAM whenever the BT controller is enabled. +config BTDM_CTRL_BR_EDR_MIN_ENC_KEY_SZ_DFT + int "BR/EDR default minimum size of encryption key" + depends on BTDM_CTRL_MODE_BR_EDR_ONLY || BTDM_CTRL_MODE_BTDM + default 7 + range 7 16 + help + BR/EDR default minimum size of encryption key when start encryption. + config BTDM_CTRL_BR_EDR_MAX_ACL_CONN int "BR/EDR ACL Max Connections" depends on BTDM_CTRL_MODE_BR_EDR_ONLY || BTDM_CTRL_MODE_BTDM @@ -177,6 +185,11 @@ config BTDM_CTRL_BLE_MAX_CONN_EFF default BTDM_CTRL_BLE_MAX_CONN if BTDM_CTRL_MODE_BLE_ONLY || BTDM_CTRL_MODE_BTDM default 0 +config BTDM_CTRL_BR_EDR_MIN_ENC_KEY_SZ_DFT_EFF + int + default BTDM_CTRL_BR_EDR_MIN_ENC_KEY_SZ_DFT if BTDM_CTRL_MODE_BR_EDR_ONLY || BTDM_CTRL_MODE_BTDM + default 0 + config BTDM_CTRL_BR_EDR_MAX_ACL_CONN_EFF int default BTDM_CTRL_BR_EDR_MAX_ACL_CONN if BTDM_CTRL_MODE_BR_EDR_ONLY || BTDM_CTRL_MODE_BTDM @@ -521,13 +534,6 @@ config BTDM_BLE_PING_EN If this option is disabled, The Controller will not start the LE authenticated payload timer. This option is used for some compatibility problems related to LE ping procedure. -config BTDM_BLE_VS_QA_SUPPORT - bool "BLE vendor HCI QA support" - depends on (BTDM_CTRL_MODE_BTDM || BTDM_CTRL_MODE_BLE_ONLY) - default n - help - This enables BLE vendor HCI command and event for QA. - config BTDM_CTRL_CONTROLLER_DEBUG_MODE_1 bool "Enable Bluetooth controller debugging mode 1 (for internal use only)" default n diff --git a/components/bt/controller/esp32/bt.c b/components/bt/controller/esp32/bt.c index b66b5d152e..abf5c3d4d3 100644 --- a/components/bt/controller/esp32/bt.c +++ b/components/bt/controller/esp32/bt.c @@ -252,7 +252,16 @@ extern uint32_t _bt_controller_data_end; extern void config_bt_funcs_reset(void); extern void config_ble_funcs_reset(void); extern void config_btdm_funcs_reset(void); -extern void config_ble_vs_qa_funcs_reset(void); + +#ifdef CONFIG_BT_BLUEDROID_ENABLED +extern void bt_stack_enableSecCtrlVsCmd(bool en); +#endif // CONFIG_BT_BLUEDROID_ENABLED +#if defined(CONFIG_BT_NIMBLE_ENABLED) || defined(CONFIG_BT_BLUEDROID_ENABLED) +extern void bt_stack_enableCoexVsCmd(bool en); +extern void scan_stack_enableAdvFlowCtrlVsCmd(bool en); +extern void adv_stack_enableClearLegacyAdvVsCmd(bool en); +extern void advFilter_stack_enableDupExcListVsCmd(bool en); +#endif // (CONFIG_BT_NIMBLE_ENABLED) || (CONFIG_BT_BLUEDROID_ENABLED) /* Local Function Declare ********************************************************************* @@ -1706,6 +1715,16 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg) goto error; } +#ifdef CONFIG_BT_BLUEDROID_ENABLED + bt_stack_enableSecCtrlVsCmd(true); +#endif // CONFIG_BT_BLUEDROID_ENABLED +#if defined(CONFIG_BT_NIMBLE_ENABLED) || defined(CONFIG_BT_BLUEDROID_ENABLED) + bt_stack_enableCoexVsCmd(true); + scan_stack_enableAdvFlowCtrlVsCmd(true); + adv_stack_enableClearLegacyAdvVsCmd(true); + advFilter_stack_enableDupExcListVsCmd(true); +#endif // (CONFIG_BT_NIMBLE_ENABLED) || (CONFIG_BT_BLUEDROID_ENABLED) + btdm_controller_status = ESP_BT_CONTROLLER_STATUS_INITED; return ESP_OK; @@ -1735,6 +1754,16 @@ esp_err_t esp_bt_controller_deinit(void) bt_controller_deinit_internal(); +#ifdef CONFIG_BT_BLUEDROID_ENABLED + bt_stack_enableSecCtrlVsCmd(false); +#endif // CONFIG_BT_BLUEDROID_ENABLED +#if defined(CONFIG_BT_NIMBLE_ENABLED) || defined(CONFIG_BT_BLUEDROID_ENABLED) + bt_stack_enableCoexVsCmd(false); + scan_stack_enableAdvFlowCtrlVsCmd(false); + adv_stack_enableClearLegacyAdvVsCmd(false); + advFilter_stack_enableDupExcListVsCmd(false); +#endif // (CONFIG_BT_NIMBLE_ENABLED) || (CONFIG_BT_BLUEDROID_ENABLED) + return ESP_OK; } @@ -1819,10 +1848,6 @@ static void patch_apply(void) #ifndef CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY config_ble_funcs_reset(); #endif - -#ifdef CONFIG_BTDM_BLE_VS_QA_SUPPORT - config_ble_vs_qa_funcs_reset(); -#endif } esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode) diff --git a/components/bt/controller/lib_esp32 b/components/bt/controller/lib_esp32 index 78dc8fd3ac..921944f336 160000 --- a/components/bt/controller/lib_esp32 +++ b/components/bt/controller/lib_esp32 @@ -1 +1 @@ -Subproject commit 78dc8fd3ac61cf29b7bbde0b3f814436eb500882 +Subproject commit 921944f3363a9697872a0c7d04e776b4ae5257fc diff --git a/components/bt/include/esp32/include/esp_bt.h b/components/bt/include/esp32/include/esp_bt.h index 1885eaf681..0e9b5fd1a2 100644 --- a/components/bt/include/esp32/include/esp_bt.h +++ b/components/bt/include/esp32/include/esp_bt.h @@ -55,7 +55,7 @@ extern "C" { * * @note Please do not modify this value */ -#define ESP_BT_CONTROLLER_CONFIG_MAGIC_VAL 0x20241024 +#define ESP_BT_CONTROLLER_CONFIG_MAGIC_VAL 0x20250318 /** * @brief Bluetooth Controller mode @@ -247,6 +247,7 @@ the advertising packet will be discarded until the memory is restored. */ .pcm_polar = CONFIG_BTDM_CTRL_PCM_POLAR_EFF, \ .pcm_fsyncshp = CONFIG_BTDM_CTRL_PCM_FSYNCSHP_EFF, \ .hli = BTDM_CTRL_HLI, \ + .enc_key_sz_min = CONFIG_BTDM_CTRL_BR_EDR_MIN_ENC_KEY_SZ_DFT_EFF, \ .dup_list_refresh_period = SCAN_DUPL_CACHE_REFRESH_PERIOD, \ .ble_scan_backoff = BTDM_CTRL_SCAN_BACKOFF_UPPERLIMITMAX, \ .ble_llcp_disc_flag = BTDM_BLE_LLCP_DISC_FLAG, \ @@ -326,6 +327,9 @@ typedef struct { - 1 - Mono Mode 1 - 2 - Mono Mode 2 */ bool hli; /*!< True if using high-level (level 4) interrupt (default); false otherwise. Configurable in menuconfig */ + uint8_t enc_key_sz_min; /*!< Minimum size of the encryption key + - Range: 7 - 16 + - Default: 7 */ uint16_t dup_list_refresh_period; /*!< Scan duplicate filtering list refresh period in seconds. Configurable in menuconfig - Range: 0 - 100 seconds - Default: 0 second */