From 21fe8c709fd23cfc774f3ed61338d6fc79799735 Mon Sep 17 00:00:00 2001 From: muhaidong Date: Mon, 1 Jun 2026 11:02:48 +0800 Subject: [PATCH] feat(wifi): support auto mode connect passive channel hidden ap --- components/esp_wifi/Kconfig | 7 +++++++ components/esp_wifi/include/esp_wifi.h | 12 ++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/components/esp_wifi/Kconfig b/components/esp_wifi/Kconfig index 3a7be1d85e0..f23903c00da 100644 --- a/components/esp_wifi/Kconfig +++ b/components/esp_wifi/Kconfig @@ -695,4 +695,11 @@ 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. + endmenu # Wi-Fi diff --git a/components/esp_wifi/include/esp_wifi.h b/components/esp_wifi/include/esp_wifi.h index 126e1fac9af..96be860376e 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 */ @@ -262,6 +262,12 @@ extern const wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs; #define WIFI_ENABLE_ENTERPRISE 0 #endif +#if CONFIG_ESP_WIFI_PASSIVE_HIDDEN_AP_SUPPORT +#define WIFI_ENABLE_PASSIVE_HIDDEN_AP (1<<8) +#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) @@ -270,6 +276,7 @@ extern const wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs; #define CONFIG_FEATURE_GMAC_BIT (1<<5) #define CONFIG_FEATURE_11R_BIT (1<<6) #define CONFIG_FEATURE_WIFI_ENT_BIT (1<<7) +#define CONFIG_FEATURE_WIFI_PASSIVE_HIDDEN_AP_BIT (1<<8) /* Set additional WiFi features and capabilities */ #define WIFI_FEATURE_CAPS (WIFI_ENABLE_WPA3_SAE | \ @@ -279,7 +286,8 @@ extern const wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs; WIFI_ENABLE_GCMP | \ WIFI_ENABLE_GMAC | \ WIFI_ENABLE_11R | \ - WIFI_ENABLE_ENTERPRISE) + WIFI_ENABLE_ENTERPRISE | \ + WIFI_ENABLE_PASSIVE_HIDDEN_AP) #define WIFI_INIT_CONFIG_DEFAULT() { \ .osi_funcs = &g_wifi_osi_funcs, \