feat(esp_wifi): support ps-none mode at coexist

This commit is contained in:
liuning 2023-06-16 17:02:57 +08:00 committed by alanmaxwell
parent 345accbe13
commit 728cd2489a
11 changed files with 20 additions and 55 deletions

View File

@ -1740,7 +1740,7 @@ pp_deattach = 0x40001ec8;
hal_set_sta_tsf = 0x40001ed0; hal_set_sta_tsf = 0x40001ed0;
ic_update_sta_tsf = 0x40001ed4; ic_update_sta_tsf = 0x40001ed4;
ic_tx_pkt = 0x40001ed8; ic_tx_pkt = 0x40001ed8;
pm_send_probe_stop = 0x40001edc; /* pm_send_probe_stop = 0x40001edc; */
pm_send_probe_start = 0x40001ee0; pm_send_probe_start = 0x40001ee0;
pm_on_coex_schm_process_restart = 0x40001ee4; pm_on_coex_schm_process_restart = 0x40001ee4;
hal_mac_set_rxq_policy = 0x40001ee8; hal_mac_set_rxq_policy = 0x40001ee8;

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@ -595,13 +595,6 @@ static IRAM_ATTR 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
@ -833,7 +826,6 @@ wifi_osi_funcs_t g_wifi_osi_funcs = {
._coex_enable = coex_enable_wrapper, ._coex_enable = coex_enable_wrapper,
._coex_disable = coex_disable_wrapper, ._coex_disable = coex_disable_wrapper,
._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,
._coex_wifi_channel_set = coex_wifi_channel_set_wrapper, ._coex_wifi_channel_set = coex_wifi_channel_set_wrapper,

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@ -517,13 +517,6 @@ static IRAM_ATTR 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 || CONFIG_EXTERNAL_COEX_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 || CONFIG_EXTERNAL_COEX_ENABLE #if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
@ -753,7 +746,6 @@ wifi_osi_funcs_t g_wifi_osi_funcs = {
._coex_enable = coex_enable_wrapper, ._coex_enable = coex_enable_wrapper,
._coex_disable = coex_disable_wrapper, ._coex_disable = coex_disable_wrapper,
._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,
._coex_wifi_channel_set = coex_wifi_channel_set_wrapper, ._coex_wifi_channel_set = coex_wifi_channel_set_wrapper,

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@ -525,13 +525,6 @@ static IRAM_ATTR 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 || CONFIG_EXTERNAL_COEX_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 || CONFIG_EXTERNAL_COEX_ENABLE #if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
@ -761,7 +754,6 @@ wifi_osi_funcs_t g_wifi_osi_funcs = {
._coex_enable = coex_enable_wrapper, ._coex_enable = coex_enable_wrapper,
._coex_disable = coex_disable_wrapper, ._coex_disable = coex_disable_wrapper,
._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,
._coex_wifi_channel_set = coex_wifi_channel_set_wrapper, ._coex_wifi_channel_set = coex_wifi_channel_set_wrapper,

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@ -592,13 +592,6 @@ static IRAM_ATTR uint32_t coex_status_get_wrapper(void)
#endif #endif
} }
static void coex_condition_set_wrapper(uint32_t type, bool dissatisfy)
{
#if CONFIG_EXTERNAL_COEX_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_EXTERNAL_COEX_ENABLE #if CONFIG_EXTERNAL_COEX_ENABLE
@ -835,7 +828,6 @@ wifi_osi_funcs_t g_wifi_osi_funcs = {
._coex_enable = coex_enable_wrapper, ._coex_enable = coex_enable_wrapper,
._coex_disable = coex_disable_wrapper, ._coex_disable = coex_disable_wrapper,
._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,
._coex_wifi_channel_set = coex_wifi_channel_set_wrapper, ._coex_wifi_channel_set = coex_wifi_channel_set_wrapper,

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@ -614,13 +614,6 @@ static IRAM_ATTR 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 || CONFIG_EXTERNAL_COEX_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 || CONFIG_EXTERNAL_COEX_ENABLE #if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
@ -855,7 +848,6 @@ wifi_osi_funcs_t g_wifi_osi_funcs = {
._coex_enable = coex_enable_wrapper, ._coex_enable = coex_enable_wrapper,
._coex_disable = coex_disable_wrapper, ._coex_disable = coex_disable_wrapper,
._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,
._coex_wifi_channel_set = coex_wifi_channel_set_wrapper, ._coex_wifi_channel_set = coex_wifi_channel_set_wrapper,

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2018-2022 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2018-2023 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@ -83,12 +83,6 @@ 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

@ -111,6 +111,8 @@ The RF resource allocation mechanism is based on priority. As shown below, both
} }
.. _coexist_policy:
Coexistence Policy Coexistence Policy
^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1665,7 +1665,11 @@ In maximum power-saving mode, station wakes up in every listen interval to recei
Call ``esp_wifi_set_ps(WIFI_PS_MIN_MODEM)`` to enable Modem-sleep minimum power-saving mode or ``esp_wifi_set_ps(WIFI_PS_MAX_MODEM)`` to enable Modem-sleep maximum power-saving mode after calling :cpp:func:`esp_wifi_init()`. When station connects to AP, Modem-sleep will start. When station disconnects from AP, Modem-sleep will stop. Call ``esp_wifi_set_ps(WIFI_PS_MIN_MODEM)`` to enable Modem-sleep minimum power-saving mode or ``esp_wifi_set_ps(WIFI_PS_MAX_MODEM)`` to enable Modem-sleep maximum power-saving mode after calling :cpp:func:`esp_wifi_init()`. When station connects to AP, Modem-sleep will start. When station disconnects from AP, Modem-sleep will stop.
Call ``esp_wifi_set_ps(WIFI_PS_NONE)`` to disable Modem-sleep entirely. This has much higher power consumption, but provides minimum latency for receiving Wi-Fi data in real time. When Modem-sleep is enabled, received Wi-Fi data can be delayed for as long as the DTIM period (minimum power-saving mode) or the listen interval (maximum power-saving mode). Disabling Modem-sleep entirely is not possible for Wi-Fi and Bluetooth coexist mode. Call ``esp_wifi_set_ps(WIFI_PS_NONE)`` to disable Modem-sleep entirely. This has much higher power consumption, but provides minimum latency for receiving Wi-Fi data in real time. When Modem-sleep is enabled, received Wi-Fi data can be delayed for as long as the DTIM period (minimum power-saving mode) or the listen interval (maximum power-saving mode).
.. only:: SOC_SUPPORT_COEXISTENCE
Notice that at coexist mode, Wi-Fi would still keep active state in Wi-Fi time slice and only keep sleep state in non Wi-Fi time slice even when calling "esp_wifi_set_ps(WIFI_PS_NONE)". Please refer to :ref:`coexist policy <coexist_policy>`.
The default Modem-sleep mode is WIFI_PS_MIN_MODEM. The default Modem-sleep mode is WIFI_PS_MIN_MODEM.

View File

@ -111,6 +111,7 @@ RF 共存
Coexistence -> RF; Coexistence -> RF;
} }
.. _coexist_policy-cn:
共存策略 共存策略
^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^

View File

@ -1657,7 +1657,11 @@ Modem-sleep 模式包括最小和最大节能模式。在最小节能模式下
调用 :cpp:func:`esp_wifi_init()` 后,调用 ``esp_wifi_set_ps(WIFI_PS_MIN_MODEM)`` 可使能 Modem-sleep 最小节能模式。调用 ``esp_wifi_set_ps(WIFI_PS_MAX_MODEM)`` 可使能 Modem-sleep 最大节能模式。station 连接到 AP 时Modem-sleep 模式将启动。station 与 AP 断开连接时Modem-sleep 模式将停止。 调用 :cpp:func:`esp_wifi_init()` 后,调用 ``esp_wifi_set_ps(WIFI_PS_MIN_MODEM)`` 可使能 Modem-sleep 最小节能模式。调用 ``esp_wifi_set_ps(WIFI_PS_MAX_MODEM)`` 可使能 Modem-sleep 最大节能模式。station 连接到 AP 时Modem-sleep 模式将启动。station 与 AP 断开连接时Modem-sleep 模式将停止。
调用 ``esp_wifi_set_ps(WIFI_PS_NONE)`` 可以完全禁用 Modem-sleep 模式。禁用会增大功耗,但可以最大限度减少实时接收 Wi-Fi 数据的延迟。使能 Modem-sleep 时,接收 Wi-Fi 数据的延迟时间可能与 DTIM 周期(最小节能模式)或监听间隔(最大节能模式)相同。在 Wi-Fi 与 Bluetooth LE 共存模式下,无法完全禁用 modem-sleep 模式。 调用 ``esp_wifi_set_ps(WIFI_PS_NONE)`` 可以完全禁用 Modem-sleep 模式。禁用会增大功耗,但可以最大限度减少实时接收 Wi-Fi 数据的延迟。使能 Modem-sleep 时,接收 Wi-Fi 数据的延迟时间可能与 DTIM 周期(最小节能模式)或监听间隔(最大节能模式)相同。
.. only:: SOC_SUPPORT_COEXISTENCE
注意在共存模式下, 即使调用 ``esp_wifi_set_ps(WIFI_PS_NONE)``, Wi-Fi 也仅会在 Wi-Fi 时间片内保持活动状态, 非 Wi-Fi 时间片内仍然睡眠。请参照 :ref:`共存策略 <coexist_policy-cn>`
默认的 Modem-sleep 模式是 WIFI_PS_MIN_MODEM。 默认的 Modem-sleep 模式是 WIFI_PS_MIN_MODEM。