feat(wifi): add sleep retention attach/detach in hw start/stop

This commit is contained in:
sibeibei
2026-05-21 11:46:16 +08:00
committed by BOT
parent 7b541be9d5
commit 68c9de209b
13 changed files with 341 additions and 28 deletions
@@ -854,6 +854,26 @@ void esp_wifi_power_domain_off(void);
void * esp_wifi_internal_mac_retention_context_get(int *config_size);
#endif
#if CONFIG_MAC_BB_PD && SOC_PM_MODEM_RETENTION_BY_REGDMA
/**
* @brief Attach Wi-Fi MAC sleep retention (REGDMA) linked list after allocation.
*
* @return
* - ESP_OK on success
* - error code from sleep retention otherwise
*/
esp_err_t esp_wifi_internal_mac_sleep_retention_attach(void);
/**
* @brief Detach Wi-Fi MAC sleep retention (REGDMA) linked list before free.
*
* @return
* - ESP_OK on success
* - error code from sleep retention otherwise
*/
esp_err_t esp_wifi_internal_mac_sleep_retention_detach(void);
#endif
#if CONFIG_MAC_BB_PD
/**
* @brief Enable or disable powering down MAC and baseband when Wi-Fi is sleeping.
@@ -17,7 +17,7 @@
extern "C" {
#endif
#define ESP_WIFI_OS_ADAPTER_VERSION 0x00000008
#define ESP_WIFI_OS_ADAPTER_VERSION 0x00000009
#define ESP_WIFI_OS_ADAPTER_MAGIC 0xDEADBEAF
#define OSI_FUNCS_TIME_BLOCKING 0xffffffff
@@ -161,6 +161,12 @@ typedef struct wifi_osi_funcs_t {
#endif
#if CONFIG_SOC_WIFI_HE_SUPPORT
bool (*_wifi_disable_ac_ax)(void);
#endif
#if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32C5 || CONFIG_IDF_TARGET_ESP32C61 || CONFIG_IDF_TARGET_ESP32S31
int32_t (* _wifi_bb_sleep_retention_attach)(void);
int32_t (* _wifi_bb_sleep_retention_detach)(void);
int32_t (* _wifi_mac_sleep_retention_attach)(void);
int32_t (* _wifi_mac_sleep_retention_detach)(void);
#endif
int32_t _magic;
} wifi_osi_funcs_t;