Merge branch 'feat/backport_some_feature_and_bugfix_v53' into 'release/v5.3'

Feat/backport some feature and bugfix v53

See merge request espressif/esp-idf!35925
This commit is contained in:
Jiang Jiang Jian
2025-01-02 20:31:03 +08:00
8 changed files with 27 additions and 31 deletions

View File

@@ -17,16 +17,12 @@ config SPIRAM_IGNORE_NOTFOUND
help
Normally, if psram initialization is enabled during compile time but not found at runtime, it
is seen as an error making the CPU panic. If this is enabled, booting will complete
but no PSRAM will be available. If PSRAM failed to initialize, the following configs may be affected
and may need to be corrected manually. SPIRAM_TRY_ALLOCATE_WIFI_LWIP will affect some LWIP and WiFi buffer
default values and range values. Enable SPIRAM_TRY_ALLOCATE_WIFI_LWIP, ESP_WIFI_AMSDU_TX_ENABLED,
ESP_WIFI_CACHE_TX_BUFFER_NUM and use static WiFi Tx buffer may cause potential memory exhaustion issues.
Suggest disable SPIRAM_TRY_ALLOCATE_WIFI_LWIP.
Suggest disable ESP_WIFI_AMSDU_TX_ENABLED.
Suggest disable ESP_WIFI_CACHE_TX_BUFFER_NUM,
need clear CONFIG_FEATURE_CACHE_TX_BUF_BIT of config->feature_caps.
Suggest change ESP_WIFI_TX_BUFFER from static to dynamic. Also suggest to adjust some buffer numbers to the
values used without PSRAM case. Such as, ESP_WIFI_STATIC_TX_BUFFER_NUM, ESP_WIFI_DYNAMIC_TX_BUFFER_NUM.
but no PSRAM will be available. In particular, it is important to note that when SPIRAM_IGNORE_NOTFOUND
is enabled, some WIFI related configs will be set to the default value used when SPIRAM is disabled.
It can be assumed that by enabling this config, WIFI and LWIP will assume that the current chip does not
have SPIRAM. SPIRAM_TRY_ALLOCATE_WIFI_LWIP will not work, buffers in WIFI and LWIP will be set to smaller
ranges and default values. WIFI_CACHE_TX_BUFFER_NUM and ESP_WIFI_AMSDU_TX_ENABLED will be disabled,
ESP_WIFI_TX_BUFFER will be set to ESP_WIFI_DYNAMIC_TX_BUFFER.
choice SPIRAM_USE
prompt "SPI RAM access method"

View File

@@ -111,7 +111,7 @@ ieee80211_send_nulldata = 0x40002110;
//ieee80211_mgmt_output = 0x40002118;
//ieee80211_send_deauth_no_bss = 0x40002120;
//ieee80211_tx_mgt_cb = 0x4000212c;
sta_rx_csa = 0x40002134;
//sta_rx_csa = 0x40002134;
sta_send_sa_query_req = 0x40002138;
sta_send_sa_query_resp = 0x4000213c;
sta_recv_sa_query_req = 0x40002140;

View File

@@ -28,8 +28,8 @@ menu "Wi-Fi"
int "Max number of WiFi static RX buffers"
range 2 25 if !SOC_WIFI_HE_SUPPORT
range 2 128 if SOC_WIFI_HE_SUPPORT
default 10 if !SPIRAM_TRY_ALLOCATE_WIFI_LWIP
default 16 if SPIRAM_TRY_ALLOCATE_WIFI_LWIP
default 10 if !(SPIRAM_TRY_ALLOCATE_WIFI_LWIP && !SPIRAM_IGNORE_NOTFOUND)
default 16 if (SPIRAM_TRY_ALLOCATE_WIFI_LWIP && !SPIRAM_IGNORE_NOTFOUND)
help
Set the number of WiFi static RX buffers. Each buffer takes approximately 1.6KB of RAM.
The static rx buffers are allocated when esp_wifi_init is called, they are not freed
@@ -80,7 +80,7 @@ menu "Wi-Fi"
bool "Static"
config ESP_WIFI_DYNAMIC_TX_BUFFER
bool "Dynamic"
depends on !SPIRAM_USE_MALLOC
depends on !(SPIRAM_TRY_ALLOCATE_WIFI_LWIP && !SPIRAM_IGNORE_NOTFOUND)
endchoice
config ESP_WIFI_TX_BUFFER_TYPE
@@ -105,8 +105,8 @@ menu "Wi-Fi"
config ESP_WIFI_CACHE_TX_BUFFER_NUM
int "Max number of WiFi cache TX buffers"
depends on SPIRAM
range 16 128
depends on (SPIRAM_TRY_ALLOCATE_WIFI_LWIP && !SPIRAM_IGNORE_NOTFOUND)
range 0 128
default 32
help
Set the number of WiFi cache TX buffer number.
@@ -203,8 +203,8 @@ menu "Wi-Fi"
depends on ESP_WIFI_AMPDU_RX_ENABLED
range 2 32 if !SOC_WIFI_HE_SUPPORT
range 2 64 if SOC_WIFI_HE_SUPPORT
default 6 if !SPIRAM_TRY_ALLOCATE_WIFI_LWIP
default 16 if SPIRAM_TRY_ALLOCATE_WIFI_LWIP
default 6 if !(SPIRAM_TRY_ALLOCATE_WIFI_LWIP && !SPIRAM_IGNORE_NOTFOUND)
default 16 if (SPIRAM_TRY_ALLOCATE_WIFI_LWIP && !SPIRAM_IGNORE_NOTFOUND)
help
Set the size of WiFi Block Ack RX window. Generally a bigger value means higher throughput and better
compatibility but more memory. Most of time we should NOT change the default value unless special
@@ -215,7 +215,7 @@ menu "Wi-Fi"
config ESP_WIFI_AMSDU_TX_ENABLED
bool "WiFi AMSDU TX"
depends on SPIRAM
depends on (ESP_WIFI_CACHE_TX_BUFFER_NUM >= 2)
default n
help
Select this option to enable AMSDU TX feature

View File

@@ -129,7 +129,7 @@ typedef struct {
#define WIFI_STATIC_TX_BUFFER_NUM 0
#endif
#if CONFIG_SPIRAM
#ifdef CONFIG_ESP_WIFI_CACHE_TX_BUFFER_NUM
#define WIFI_CACHE_TX_BUFFER_NUM CONFIG_ESP_WIFI_CACHE_TX_BUFFER_NUM
#else
#define WIFI_CACHE_TX_BUFFER_NUM 0
@@ -224,10 +224,10 @@ extern wifi_osi_funcs_t g_wifi_osi_funcs;
#define WIFI_ENABLE_WPA3_SAE 0
#endif
#if CONFIG_SPIRAM
#define WIFI_ENABLE_SPIRAM (1<<1)
#if WIFI_CACHE_TX_BUFFER_NUM > 0
#define WIFI_ENABLE_CACHE_TX_BUFFER (1<<1)
#else
#define WIFI_ENABLE_SPIRAM 0
#define WIFI_ENABLE_CACHE_TX_BUFFER 0
#endif
#if CONFIG_ESP_WIFI_FTM_INITIATOR_SUPPORT
@@ -289,7 +289,7 @@ extern wifi_osi_funcs_t g_wifi_osi_funcs;
/* Set additional WiFi features and capabilities */
#define WIFI_FEATURE_CAPS (WIFI_ENABLE_WPA3_SAE | \
WIFI_ENABLE_SPIRAM | \
WIFI_ENABLE_CACHE_TX_BUFFER | \
WIFI_FTM_INITIATOR | \
WIFI_FTM_RESPONDER | \
WIFI_ENABLE_GCMP | \

View File

@@ -407,8 +407,8 @@ typedef struct {
uint8_t ssid_hidden; /**< Broadcast SSID or not, default 0, broadcast the SSID */
uint8_t max_connection; /**< Max number of stations allowed to connect in */
uint16_t beacon_interval; /**< Beacon interval which should be multiples of 100. Unit: TU(time unit, 1 TU = 1024 us). Range: 100 ~ 60000. Default value: 100 */
uint8_t csa_count; /**< Channel Switch Announcement Count. Notify the station that the channel will switch after the csa_count beacon intervals. Default value: 3 */
uint8_t dtim_period; /**< Dtim period of soft-AP. Default value: 2 */
uint8_t csa_count; /**< Channel Switch Announcement Count. Notify the station that the channel will switch after the csa_count beacon intervals. Range: 1 ~ 30. Default value: 3 */
uint8_t dtim_period; /**< Dtim period of soft-AP. Range: 1 ~ 10. Default value: 1 */
wifi_cipher_type_t pairwise_cipher; /**< Pairwise cipher of SoftAP, group cipher will be derived using this. Cipher values are valid starting from WIFI_CIPHER_TYPE_TKIP, enum values before that will be considered as invalid and default cipher suites(TKIP+CCMP) will be used. Valid cipher suites in softAP mode are WIFI_CIPHER_TYPE_TKIP, WIFI_CIPHER_TYPE_CCMP and WIFI_CIPHER_TYPE_TKIP_CCMP. */
bool ftm_responder; /**< Enable FTM Responder mode */
wifi_pmf_config_t pmf_cfg; /**< Configuration for Protected Management Frame */

View File

@@ -69,7 +69,7 @@ static esp_err_t wifi_transmit(void *h, void *buffer, size_t len)
static esp_err_t wifi_transmit_wrap(void *h, void *buffer, size_t len, void *netstack_buf)
{
wifi_netif_driver_t driver = h;
#if CONFIG_SPIRAM
#if CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP && !CONFIG_SPIRAM_IGNORE_NOTFOUND
return esp_wifi_internal_tx_by_ref(driver->wifi_if, buffer, len, netstack_buf);
#else
return esp_wifi_internal_tx(driver->wifi_if, buffer, len);

View File

@@ -714,8 +714,8 @@ menu "LWIP"
int "The maximum number of pbufs queued on OOSEQ per pcb"
depends on LWIP_TCP_QUEUE_OOSEQ
range 0 12
default 4 if !SPIRAM_TRY_ALLOCATE_WIFI_LWIP
default 0 if SPIRAM_TRY_ALLOCATE_WIFI_LWIP
default 4 if !(SPIRAM_TRY_ALLOCATE_WIFI_LWIP && !SPIRAM_IGNORE_NOTFOUND)
default 0 if (SPIRAM_TRY_ALLOCATE_WIFI_LWIP && !SPIRAM_IGNORE_NOTFOUND)
help
If LWIP_TCP_OOSEQ_MAX_PBUFS = 0, TCP will not control the number of OOSEQ pbufs.
@@ -771,7 +771,7 @@ menu "LWIP"
config LWIP_WND_SCALE
bool "Support TCP window scale"
depends on SPIRAM_TRY_ALLOCATE_WIFI_LWIP
depends on (SPIRAM_TRY_ALLOCATE_WIFI_LWIP && !SPIRAM_IGNORE_NOTFOUND)
default n
help
Enable this feature to support TCP window scaling.