From faf8c4f1c336ca95b059e8bb4571b58701f5d616 Mon Sep 17 00:00:00 2001 From: muhaidong Date: Thu, 3 Apr 2025 20:24:31 +0800 Subject: [PATCH 1/3] feat(wifi): support auto mode connect passive channel hidden ap --- components/esp_wifi/Kconfig | 7 +++++++ components/esp_wifi/include/esp_wifi.h | 12 ++++++++++-- components/esp_wifi/lib | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/components/esp_wifi/Kconfig b/components/esp_wifi/Kconfig index acdbff6c45..bdc71d49d9 100644 --- a/components/esp_wifi/Kconfig +++ b/components/esp_wifi/Kconfig @@ -881,6 +881,13 @@ menu "Wi-Fi" This option enables assert checks to verify that modem RF power state is correctly cleared before pmu sleep. + config ESP_WIFI_PASSIVE_HIDDEN_AP_SUPPORT + bool "Support station connection to hidden APs using passive scan when country policy is auto" + default n + help + Select this option to enable/disable support for station connections + to hidden APs using passive scan when the country policy is set to auto. + endif # wifi enabled endmenu # Wi-Fi diff --git a/components/esp_wifi/include/esp_wifi.h b/components/esp_wifi/include/esp_wifi.h index ee2713fc3a..d479b3663a 100644 --- a/components/esp_wifi/include/esp_wifi.h +++ b/components/esp_wifi/include/esp_wifi.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -284,6 +284,12 @@ extern wifi_osi_funcs_t g_wifi_osi_funcs; #define WIFI_ENABLE_BSS_MAX_IDLE 0 #endif +#if CONFIG_ESP_WIFI_PASSIVE_HIDDEN_AP_SUPPORT +#define WIFI_ENABLE_PASSIVE_HIDDEN_AP (1<<9) +#else +#define WIFI_ENABLE_PASSIVE_HIDDEN_AP 0 +#endif + #define CONFIG_FEATURE_WPA3_SAE_BIT (1<<0) #define CONFIG_FEATURE_CACHE_TX_BUF_BIT (1<<1) #define CONFIG_FEATURE_FTM_INITIATOR_BIT (1<<2) @@ -293,6 +299,7 @@ extern wifi_osi_funcs_t g_wifi_osi_funcs; #define CONFIG_FEATURE_11R_BIT (1<<6) #define CONFIG_FEATURE_WIFI_ENT_BIT (1<<7) #define CONFIG_FEATURE_BSS_MAX_IDLE_BIT (1<<8) +#define CONFIG_FEATURE_WIFI_PASSIVE_HIDDEN_AP_BIT (1<<9) /* Set additional WiFi features and capabilities */ #define WIFI_FEATURE_CAPS (WIFI_ENABLE_WPA3_SAE | \ @@ -303,7 +310,8 @@ extern wifi_osi_funcs_t g_wifi_osi_funcs; WIFI_ENABLE_GMAC | \ WIFI_ENABLE_11R | \ WIFI_ENABLE_ENTERPRISE | \ - WIFI_ENABLE_BSS_MAX_IDLE) + WIFI_ENABLE_BSS_MAX_IDLE | \ + WIFI_ENABLE_PASSIVE_HIDDEN_AP) #define WIFI_INIT_CONFIG_DEFAULT() { \ .osi_funcs = &g_wifi_osi_funcs, \ diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index afcedfaba1..66f601bdb2 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit afcedfaba19b07c01ee71d02139c7d0b40ea572f +Subproject commit 66f601bdb2c22f5387dd59eabae9572c4e7711b6 From 23d8c66ec3562595e283f43281b56635e39d63f4 Mon Sep 17 00:00:00 2001 From: muhaidong Date: Thu, 19 Mar 2026 14:21:17 +0800 Subject: [PATCH 2/3] fix(wifi): fix check wifi remote api fail issue --- components/esp_wifi/remote/Kconfig.wifi.in | 7 +++++++ components/esp_wifi/remote/Kconfig.wifi_is_remote.in | 6 ++++++ .../esp_wifi/remote/include/injected/esp_wifi.h | 12 ++++++++++-- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/components/esp_wifi/remote/Kconfig.wifi.in b/components/esp_wifi/remote/Kconfig.wifi.in index 85cc5dcdca..eeaacd6261 100644 --- a/components/esp_wifi/remote/Kconfig.wifi.in +++ b/components/esp_wifi/remote/Kconfig.wifi.in @@ -860,6 +860,13 @@ config WIFI_RMT_MODEM_RF_FLAG_UPDATE_DEBUG This option enables assert checks to verify that modem RF power state is correctly cleared before pmu sleep. +config WIFI_RMT_PASSIVE_HIDDEN_AP_SUPPORT + bool "Support station connection to hidden APs using passive scan when country policy is auto" + default n + help + Select this option to enable/disable support for station connections + to hidden APs using passive scan when the country policy is set to auto. + if !ESP_WIFI_ENABLED rsource "Kconfig.wifi_is_remote.in" endif # ESP_WIFI_ENABLED diff --git a/components/esp_wifi/remote/Kconfig.wifi_is_remote.in b/components/esp_wifi/remote/Kconfig.wifi_is_remote.in index 61c4c8d91f..e82fe9ecac 100644 --- a/components/esp_wifi/remote/Kconfig.wifi_is_remote.in +++ b/components/esp_wifi/remote/Kconfig.wifi_is_remote.in @@ -480,3 +480,9 @@ if WIFI_RMT_MODEM_RF_FLAG_UPDATE_DEBUG depends on WIFI_RMT_ENHANCED_LIGHT_SLEEP default WIFI_RMT_MODEM_RF_FLAG_UPDATE_DEBUG endif + +if WIFI_RMT_PASSIVE_HIDDEN_AP_SUPPORT + config ESP_WIFI_PASSIVE_HIDDEN_AP_SUPPORT # ignore: multiple-definition + bool + default WIFI_RMT_PASSIVE_HIDDEN_AP_SUPPORT +endif diff --git a/components/esp_wifi/remote/include/injected/esp_wifi.h b/components/esp_wifi/remote/include/injected/esp_wifi.h index c6f602de34..54e82412a7 100644 --- a/components/esp_wifi/remote/include/injected/esp_wifi.h +++ b/components/esp_wifi/remote/include/injected/esp_wifi.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -284,6 +284,12 @@ extern wifi_osi_funcs_t g_wifi_osi_funcs; #define WIFI_ENABLE_BSS_MAX_IDLE 0 #endif +#if CONFIG_WIFI_RMT_PASSIVE_HIDDEN_AP_SUPPORT +#define WIFI_ENABLE_PASSIVE_HIDDEN_AP (1<<9) +#else +#define WIFI_ENABLE_PASSIVE_HIDDEN_AP 0 +#endif + #define CONFIG_FEATURE_WPA3_SAE_BIT (1<<0) #define CONFIG_FEATURE_CACHE_TX_BUF_BIT (1<<1) #define CONFIG_FEATURE_FTM_INITIATOR_BIT (1<<2) @@ -293,6 +299,7 @@ extern wifi_osi_funcs_t g_wifi_osi_funcs; #define CONFIG_FEATURE_11R_BIT (1<<6) #define CONFIG_FEATURE_WIFI_ENT_BIT (1<<7) #define CONFIG_FEATURE_BSS_MAX_IDLE_BIT (1<<8) +#define CONFIG_FEATURE_WIFI_PASSIVE_HIDDEN_AP_BIT (1<<9) /* Set additional WiFi features and capabilities */ #define WIFI_FEATURE_CAPS (WIFI_ENABLE_WPA3_SAE | \ @@ -303,7 +310,8 @@ extern wifi_osi_funcs_t g_wifi_osi_funcs; WIFI_ENABLE_GMAC | \ WIFI_ENABLE_11R | \ WIFI_ENABLE_ENTERPRISE | \ - WIFI_ENABLE_BSS_MAX_IDLE) + WIFI_ENABLE_BSS_MAX_IDLE | \ + WIFI_ENABLE_PASSIVE_HIDDEN_AP) #define WIFI_INIT_CONFIG_DEFAULT() { \ .osi_funcs = &g_wifi_osi_funcs, \ From 4ee8353234c2d287059d80d7011e14e65dd9e74c Mon Sep 17 00:00:00 2001 From: muhaidong Date: Sat, 21 Mar 2026 16:16:20 +0800 Subject: [PATCH 3/3] fix(wifi): fix fail case connection with bss max idle enabled --- .../esp_wifi/test_apps/wifi_connect/main/test_bss_max_idle.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/esp_wifi/test_apps/wifi_connect/main/test_bss_max_idle.c b/components/esp_wifi/test_apps/wifi_connect/main/test_bss_max_idle.c index 7cd19b5c99..2cde199e7d 100644 --- a/components/esp_wifi/test_apps/wifi_connect/main/test_bss_max_idle.c +++ b/components/esp_wifi/test_apps/wifi_connect/main/test_bss_max_idle.c @@ -62,7 +62,8 @@ typedef u16 __bitwise be16; #define WIFI_FAIL (1<<3) #define EMPH_STR(s) "****** "s" ******" -#define MAX_IDLE_PERIOD (5) +//For station, max idle period is default 10 (1000TUs) +#define MAX_IDLE_PERIOD (10) #define ETHTYPE_IP 0x0800 static const char* TAG = "test_bss_max_idle";