diff --git a/components/bt/controller/esp32/bt.c b/components/bt/controller/esp32/bt.c index c7dd4dbb12..ba6265378a 100644 --- a/components/bt/controller/esp32/bt.c +++ b/components/bt/controller/esp32/bt.c @@ -225,7 +225,7 @@ extern int coex_bt_release(uint32_t event); extern int coex_register_bt_cb(coex_func_cb_t cb); extern uint32_t coex_bb_reset_lock(void); extern void coex_bb_reset_unlock(uint32_t restore); -extern int coex_schm_register_callback(int type, void *callback); +extern int coex_schm_register_callback(coex_schm_callback_type_t type, void *callback); extern void coex_schm_status_bit_clear(uint32_t type, uint32_t status); extern void coex_schm_status_bit_set(uint32_t type, uint32_t status); extern uint32_t coex_schm_interval_get(void); @@ -1168,7 +1168,6 @@ static void IRAM_ATTR coex_bb_reset_unlock_wrapper(uint32_t restore) static int coex_schm_register_btdm_callback_wrapper(void *callback) { #if CONFIG_SW_COEXIST_ENABLE -#define COEX_SCHM_CALLBACK_TYPE_BT 0x1 return coex_schm_register_callback(COEX_SCHM_CALLBACK_TYPE_BT, callback); #else return 0; diff --git a/components/esp_coex/include/esp_coexist_internal.h b/components/esp_coex/include/esp_coexist_internal.h index fadb38c939..9de4f37a5c 100644 --- a/components/esp_coex/include/esp_coexist_internal.h +++ b/components/esp_coex/include/esp_coexist_internal.h @@ -22,6 +22,12 @@ typedef enum { COEX_PREFER_NUM, } coex_prefer_t; +typedef enum { + COEX_SCHM_CALLBACK_TYPE_WIFI = 0, + COEX_SCHM_CALLBACK_TYPE_BT, + COEX_SCHM_CALLBACK_TYPE_I154, +} coex_schm_callback_type_t; + typedef void (* coex_func_cb_t)(uint32_t event, int sched_cnt); typedef esp_err_t (* coex_set_lpclk_source_callback_t)(void); @@ -230,7 +236,7 @@ int coex_schm_process_restart(void); * @param callback : callback * @return : 0 - success, other - failed */ -int coex_schm_register_callback(int type, void *callback); +int coex_schm_register_callback(coex_schm_callback_type_t type, void *callback); /** * @brief Register coexistence adapter functions. diff --git a/components/esp_wifi/esp32/esp_adapter.c b/components/esp_wifi/esp32/esp_adapter.c index b2ab1f0674..2e0cba008a 100644 --- a/components/esp_wifi/esp32/esp_adapter.c +++ b/components/esp_wifi/esp32/esp_adapter.c @@ -573,7 +573,7 @@ static int coex_schm_process_restart_wrapper(void) #endif } -static int coex_schm_register_cb_wrapper(int type, void(*cb)(int)) +static int coex_schm_register_cb_wrapper(int type, int(*cb)(int)) { #if CONFIG_SW_COEXIST_ENABLE return coex_schm_register_callback(type, cb); diff --git a/components/esp_wifi/esp32c2/esp_adapter.c b/components/esp_wifi/esp32c2/esp_adapter.c index 3906026e56..3bd74dcc57 100644 --- a/components/esp_wifi/esp32c2/esp_adapter.c +++ b/components/esp_wifi/esp32c2/esp_adapter.c @@ -556,7 +556,7 @@ static int coex_schm_process_restart_wrapper(void) #endif } -static int coex_schm_register_cb_wrapper(int type, void(*cb)(int)) +static int coex_schm_register_cb_wrapper(int type, int(*cb)(int)) { #if CONFIG_SW_COEXIST_ENABLE return coex_schm_register_callback(type, cb); diff --git a/components/esp_wifi/esp32c3/esp_adapter.c b/components/esp_wifi/esp32c3/esp_adapter.c index 04e8b57359..ff94d9c37d 100644 --- a/components/esp_wifi/esp32c3/esp_adapter.c +++ b/components/esp_wifi/esp32c3/esp_adapter.c @@ -581,7 +581,7 @@ static int coex_schm_process_restart_wrapper(void) #endif } -static int coex_schm_register_cb_wrapper(int type, void(*cb)(int)) +static int coex_schm_register_cb_wrapper(int type, int(*cb)(int)) { #if CONFIG_SW_COEXIST_ENABLE return coex_schm_register_callback(type, cb); diff --git a/components/esp_wifi/esp32c6/esp_adapter.c b/components/esp_wifi/esp32c6/esp_adapter.c index 2b2da560f9..78c1e39574 100644 --- a/components/esp_wifi/esp32c6/esp_adapter.c +++ b/components/esp_wifi/esp32c6/esp_adapter.c @@ -554,7 +554,7 @@ static int coex_schm_process_restart_wrapper(void) #endif } -static int coex_schm_register_cb_wrapper(int type, void(*cb)(int)) +static int coex_schm_register_cb_wrapper(int type, int(*cb)(int)) { #if CONFIG_SW_COEXIST_ENABLE return coex_schm_register_callback(type, cb); diff --git a/components/esp_wifi/esp32s2/esp_adapter.c b/components/esp_wifi/esp32s2/esp_adapter.c index 71bc971240..698dd144f4 100644 --- a/components/esp_wifi/esp32s2/esp_adapter.c +++ b/components/esp_wifi/esp32s2/esp_adapter.c @@ -608,7 +608,7 @@ static int coex_schm_process_restart_wrapper(void) #endif } -static int coex_schm_register_cb_wrapper(int type, void(*cb)(int)) +static int coex_schm_register_cb_wrapper(int type, int(*cb)(int)) { #if CONFIG_SW_COEXIST_ENABLE return coex_schm_register_callback(type, cb); diff --git a/components/esp_wifi/esp32s3/esp_adapter.c b/components/esp_wifi/esp32s3/esp_adapter.c index 0c7162a12d..95ab748163 100644 --- a/components/esp_wifi/esp32s3/esp_adapter.c +++ b/components/esp_wifi/esp32s3/esp_adapter.c @@ -630,7 +630,7 @@ static int coex_schm_process_restart_wrapper(void) #endif } -static int coex_schm_register_cb_wrapper(int type, void(*cb)(int)) +static int coex_schm_register_cb_wrapper(int type, int(*cb)(int)) { #if CONFIG_SW_COEXIST_ENABLE return coex_schm_register_callback(type, cb); diff --git a/components/esp_wifi/include/esp_private/wifi_os_adapter.h b/components/esp_wifi/include/esp_private/wifi_os_adapter.h index da19d48321..d23cbdeacb 100644 --- a/components/esp_wifi/include/esp_private/wifi_os_adapter.h +++ b/components/esp_wifi/include/esp_private/wifi_os_adapter.h @@ -150,7 +150,7 @@ typedef struct { void (* _sleep_retention_entries_destroy)(int); #endif int (* _coex_schm_process_restart)(void); - int (* _coex_schm_register_cb)(int, void (* cb)(int)); + int (* _coex_schm_register_cb)(int, int (* cb)(int)); int32_t _magic; } wifi_osi_funcs_t;