From 37aa555611cf19e227cc75cce8e8a3a6ee4076a3 Mon Sep 17 00:00:00 2001 From: xiongweichao Date: Tue, 4 Apr 2023 19:50:56 +0800 Subject: [PATCH 1/3] bt:Fixed esp32 controller bug 1. Fixed crash after controller disable and re-enable 2. Fixed the crash caused by processing the HCI_Read_Remote_Extented_Features command in the non-connected state 3. Fixed disconnection due to not handling lmp_unsniff_req in LC_WAIT_SNIFF_SUB_RSP state 4. Fixed crash caused by supervision timeout greater than sniff interval Closes https://github.com/espressif/esp-idf/issues/11164 Closes https://github.com/espressif/esp-idf/issues/10835 --- components/bt/controller/lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/controller/lib b/components/bt/controller/lib index d4a224c5d6..e329860b88 160000 --- a/components/bt/controller/lib +++ b/components/bt/controller/lib @@ -1 +1 @@ -Subproject commit d4a224c5d682d6b5a76542c6918b6a59dd0b2f8c +Subproject commit e329860b88d9d7f0befafd7fc8c61e0a4dce81de From 873856fdf3f9925c4a1504ec032c3c52150822fd Mon Sep 17 00:00:00 2001 From: xiongweichao Date: Thu, 13 Apr 2023 10:37:19 +0800 Subject: [PATCH 2/3] bt: added coex adapter operation to get version of coexist module to ESP32 Bluetooth Controller --- components/bt/controller/bt.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/components/bt/controller/bt.c b/components/bt/controller/bt.c index 20f279efe9..8f75b24b70 100644 --- a/components/bt/controller/bt.c +++ b/components/bt/controller/bt.c @@ -42,6 +42,7 @@ #include "soc/rtc.h" #include "soc/soc_memory_layout.h" #include "esp32/clk.h" +#include "esp_coexist.h" #include "esp_coexist_internal.h" #if !CONFIG_FREERTOS_UNICORE #include "esp_ipc.h" @@ -91,7 +92,7 @@ do{\ } while(0) #define OSI_FUNCS_TIME_BLOCKING 0xffffffff -#define OSI_VERSION 0x00010003 +#define OSI_VERSION 0x00010004 #define OSI_MAGIC_VALUE 0xFADEBEAD /* Types definition @@ -178,6 +179,7 @@ struct osi_funcs_t { void (*_interrupt_l3_disable)(void); void (*_interrupt_l3_restore)(void); void *(* _customer_queue_create)(uint32_t queue_len, uint32_t item_size); + int (* _coex_version_get)(unsigned int *major, unsigned int *minor, unsigned int *patch); uint32_t _magic; }; @@ -310,6 +312,7 @@ static uint8_t coex_schm_curr_period_get_wrapper(void); static void * coex_schm_curr_phase_get_wrapper(void); static int coex_wifi_channel_get_wrapper(uint8_t *primary, uint8_t *secondary); static int coex_register_wifi_channel_change_callback_wrapper(void *cb); +static int coex_version_get_wrapper(unsigned int *major, unsigned int *minor, unsigned int *patch); static void bt_controller_deinit_internal(void); /* Local variable definition @@ -377,6 +380,7 @@ static const struct osi_funcs_t osi_funcs_ro = { ._interrupt_l3_disable = interrupt_disable, ._interrupt_l3_restore = interrupt_restore, ._customer_queue_create = NULL, + ._coex_version_get = coex_version_get_wrapper, ._magic = OSI_MAGIC_VALUE, }; @@ -990,6 +994,30 @@ static int coex_register_wifi_channel_change_callback_wrapper(void *cb) #endif } +static int coex_version_get_wrapper(unsigned int *major, unsigned int *minor, unsigned int *patch) +{ +#if CONFIG_SW_COEXIST_ENABLE + const char *ver_str = esp_coex_version_get(); + if (ver_str != NULL) { + unsigned int _major = 0, _minor = 0, _patch = 0; + if (sscanf(ver_str, "%u.%u.%u", &_major, &_minor, &_patch) != 3) { + return -1; + } + if (major != NULL) { + *major = _major; + } + if (minor != NULL) { + *minor = _minor; + } + if (patch != NULL) { + *patch = _patch; + } + return 0; + } +#endif + return -1; +} + bool esp_vhci_host_check_send_available(void) { return API_vhci_host_check_send_available(); From 45a3c35d659ef65f15b981b575e4cd94ea3daed4 Mon Sep 17 00:00:00 2001 From: zwj Date: Fri, 7 Apr 2023 17:58:57 +0800 Subject: [PATCH 3/3] Fixed duplicate scan refresh cycle is not accurate after restarting scan on ESP32 --- components/bt/controller/lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/controller/lib b/components/bt/controller/lib index e329860b88..8ce6d27e09 160000 --- a/components/bt/controller/lib +++ b/components/bt/controller/lib @@ -1 +1 @@ -Subproject commit e329860b88d9d7f0befafd7fc8c61e0a4dce81de +Subproject commit 8ce6d27e0981c09e1c5a982976f182d0a37662f6