diff --git a/components/esp_wifi/esp32s2/esp_adapter.c b/components/esp_wifi/esp32s2/esp_adapter.c index 19d5f39b8a..21bba777d5 100644 --- a/components/esp_wifi/esp32s2/esp_adapter.c +++ b/components/esp_wifi/esp32s2/esp_adapter.c @@ -459,6 +459,22 @@ static void * IRAM_ATTR zalloc_internal_wrapper(size_t size) return ptr; } +static int coex_init_wrapper(void) +{ +#if CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE + return coex_init(); +#else + return 0; +#endif +} + +static void coex_deinit_wrapper(void) +{ +#if CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE + coex_deinit(); +#endif +} + static uint32_t coex_status_get_wrapper(void) { #if CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE @@ -623,8 +639,8 @@ wifi_osi_funcs_t g_wifi_osi_funcs = { ._rand = esp_random, ._dport_access_stall_other_cpu_start_wrap = esp_empty_wrapper, ._dport_access_stall_other_cpu_end_wrap = esp_empty_wrapper, - ._phy_rf_deinit = esp_phy_rf_deinit, - ._phy_load_cal_and_init = esp_phy_load_cal_and_init, + ._phy_disable = esp_phy_disable, + ._phy_enable = esp_phy_enable, ._phy_update_country_info = esp_phy_update_country_info, ._read_mac = esp_read_mac, ._timer_arm = timer_arm_wrapper, @@ -667,10 +683,8 @@ wifi_osi_funcs_t g_wifi_osi_funcs = { ._wifi_zalloc = wifi_zalloc_wrapper, ._wifi_create_queue = wifi_create_queue_wrapper, ._wifi_delete_queue = wifi_delete_queue_wrapper, - ._modem_sleep_enter = esp_modem_sleep_enter, - ._modem_sleep_exit = esp_modem_sleep_exit, - ._modem_sleep_register = esp_modem_sleep_register, - ._modem_sleep_deregister = esp_modem_sleep_deregister, + ._coex_init = coex_init_wrapper, + ._coex_deinit = coex_deinit_wrapper, ._coex_status_get = coex_status_get_wrapper, ._coex_condition_set = coex_condition_set_wrapper, ._coex_wifi_request = coex_wifi_request_wrapper, diff --git a/components/esp_wifi/include/phy.h b/components/esp_wifi/include/phy.h index 5087803129..a1ae8fedbc 100644 --- a/components/esp_wifi/include/phy.h +++ b/components/esp_wifi/include/phy.h @@ -59,12 +59,10 @@ void phy_set_wifi_mode_only(bool wifi_only); */ void coex_bt_high_prio(void); -#if CONFIG_IDF_TARGET_ESP32S2 /** * @brief Open PHY and RF. */ void phy_wakeup_init(void); -#endif /** * @brief Shutdown PHY and RF. diff --git a/components/esp_wifi/src/phy_init.c b/components/esp_wifi/src/phy_init.c index 5ba4a858ee..24659b02d8 100644 --- a/components/esp_wifi/src/phy_init.c +++ b/components/esp_wifi/src/phy_init.c @@ -229,11 +229,7 @@ void esp_phy_enable(void) s_is_phy_calibrated = true; } else { -#if CONFIG_IDF_TARGET_ESP32S2 phy_wakeup_init(); -#elif CONFIG_IDF_TARGET_ESP32 - register_chipv7_phy(NULL, NULL, PHY_RF_CAL_NONE); -#endif } #if CONFIG_IDF_TARGET_ESP32