Merge branch 'bugfix/coex_fix_some_bugs_v3.3' into 'release/v3.3'

Coexist: fix some coexist bugs (backportv3.3)

See merge request espressif/esp-idf!6435
This commit is contained in:
Jiang Jiang Jian 2019-10-30 16:39:20 +08:00
commit 0d1c490a7c
7 changed files with 40 additions and 3 deletions

View file

@ -315,6 +315,21 @@ menu Bluetooth
If you set `BLE_ADV_REPORT_DISCARD_THRSHOLD` to a small value or printf every adv lost event, it If you set `BLE_ADV_REPORT_DISCARD_THRSHOLD` to a small value or printf every adv lost event, it
may cause adv packets lost more. may cause adv packets lost more.
menuconfig BTDM_COEX_BT_OPTIONS
bool "Coexistence Bluetooth Side Options"
depends on SW_COEXIST_ENABLE
default n
help
Options of Bluetooth Side of WiFi and bluetooth coexistence.
config BTDM_COEX_BLE_ADV_HIGH_PRIORITY
bool "Improve BLE ADV priority for WiFi & BLE coexistence"
depends on BTDM_COEX_BT_OPTIONS
default n
help
Improve BLE ADV coexistence priority to make it better performance.
For example, BLE mesh need to enable this option to improve BLE adv performance.
endmenu endmenu
menuconfig BLUEDROID_ENABLED menuconfig BLUEDROID_ENABLED

View file

@ -218,6 +218,7 @@ extern int coex_bt_release_wrapper(uint32_t event);
extern int coex_register_bt_cb_wrapper(coex_func_cb_t cb); extern int coex_register_bt_cb_wrapper(coex_func_cb_t cb);
extern uint32_t coex_bb_reset_lock_wrapper(void); extern uint32_t coex_bb_reset_lock_wrapper(void);
extern void coex_bb_reset_unlock_wrapper(uint32_t restore); extern void coex_bb_reset_unlock_wrapper(uint32_t restore);
extern void coex_ble_adv_priority_high_set(bool high);
extern char _bss_start_btdm; extern char _bss_start_btdm;
extern char _bss_end_btdm; extern char _bss_end_btdm;
@ -1161,6 +1162,12 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
goto error; goto error;
} }
#ifdef CONFIG_BTDM_COEX_BLE_ADV_HIGH_PRIORITY
coex_ble_adv_priority_high_set(true);
#else
coex_ble_adv_priority_high_set(false);
#endif
btdm_controller_status = ESP_BT_CONTROLLER_STATUS_INITED; btdm_controller_status = ESP_BT_CONTROLLER_STATUS_INITED;
return ESP_OK; return ESP_OK;

@ -1 +1 @@
Subproject commit 8e73c8d616da202265c76719ee9e37f40c7ad161 Subproject commit 494fd0322ab7ab325ede4274757332fc78b0e9e0

View file

@ -441,6 +441,13 @@ static uint32_t coex_status_get_wrapper(void)
#endif #endif
} }
static void coex_condition_set_wrapper(uint32_t type, bool dissatisfy)
{
#if CONFIG_SW_COEXIST_ENABLE
coex_condition_set(type, dissatisfy);
#endif
}
static int coex_wifi_request_wrapper(uint32_t event, uint32_t latency, uint32_t duration) static int coex_wifi_request_wrapper(uint32_t event, uint32_t latency, uint32_t duration)
{ {
#if CONFIG_SW_COEXIST_ENABLE #if CONFIG_SW_COEXIST_ENABLE
@ -598,6 +605,7 @@ wifi_osi_funcs_t g_wifi_osi_funcs = {
._sc_ack_send = sc_ack_send_wrapper, ._sc_ack_send = sc_ack_send_wrapper,
._sc_ack_send_stop = sc_ack_send_stop, ._sc_ack_send_stop = sc_ack_send_stop,
._coex_status_get = coex_status_get_wrapper, ._coex_status_get = coex_status_get_wrapper,
._coex_condition_set = coex_condition_set_wrapper,
._coex_wifi_request = coex_wifi_request_wrapper, ._coex_wifi_request = coex_wifi_request_wrapper,
._coex_wifi_release = coex_wifi_release_wrapper, ._coex_wifi_release = coex_wifi_release_wrapper,
._magic = ESP_WIFI_OS_ADAPTER_MAGIC, ._magic = ESP_WIFI_OS_ADAPTER_MAGIC,

View file

@ -79,6 +79,12 @@ esp_err_t coex_preference_set(coex_prefer_t prefer);
*/ */
uint32_t coex_status_get(void); uint32_t coex_status_get(void);
/**
* @brief Set software coexist condition.
* @return : software coexist condition
*/
void coex_condition_set(uint32_t type, bool dissatisfy);
/** /**
* @brief WiFi requests coexistence. * @brief WiFi requests coexistence.
* *

View file

@ -21,7 +21,7 @@
extern "C" { extern "C" {
#endif #endif
#define ESP_WIFI_OS_ADAPTER_VERSION 0x00000002 #define ESP_WIFI_OS_ADAPTER_VERSION 0x00000004
#define ESP_WIFI_OS_ADAPTER_MAGIC 0xDEADBEAF #define ESP_WIFI_OS_ADAPTER_MAGIC 0xDEADBEAF
#define OSI_FUNCS_TIME_BLOCKING 0xffffffff #define OSI_FUNCS_TIME_BLOCKING 0xffffffff
@ -121,6 +121,7 @@ typedef struct {
void (* _sc_ack_send)(void *param); void (* _sc_ack_send)(void *param);
void (* _sc_ack_send_stop)(void); void (* _sc_ack_send_stop)(void);
uint32_t (* _coex_status_get)(void); uint32_t (* _coex_status_get)(void);
void (* _coex_condition_set)(uint32_t type, bool dissatisfy);
int32_t (* _coex_wifi_request)(uint32_t event, uint32_t latency, uint32_t duration); int32_t (* _coex_wifi_request)(uint32_t event, uint32_t latency, uint32_t duration);
int32_t (* _coex_wifi_release)(uint32_t event); int32_t (* _coex_wifi_release)(uint32_t event);
int32_t _magic; int32_t _magic;

@ -1 +1 @@
Subproject commit d8ed35901f604ce5f3087336bb1b41b8c3b887c8 Subproject commit fd85a826728dc41dc357263ca38e3341abd6949f