From 09db1cfeeac4cb9d01362ef44c38b50487c368ca Mon Sep 17 00:00:00 2001 From: Rex Chen Date: Thu, 30 Oct 2025 11:45:47 +0900 Subject: [PATCH] mcux: wifi_nxp: Add scan limit configure item Add NXP_WIFI_MAX_RECONNECT_LIMIT and NXP_WIFI_MAX_RESCAN_LIMIT macros, the configuration used to set reconnect times after deauth, and expose this configuration to customer, then customer can set it according to application requirment. Signed-off-by: Rex Chen --- mcux/middleware/wifi_nxp/incl/nxp_wifi.h | 8 ++++++++ mcux/middleware/wifi_nxp/incl/wlcmgr/wlan.h | 20 ++++---------------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/mcux/middleware/wifi_nxp/incl/nxp_wifi.h b/mcux/middleware/wifi_nxp/incl/nxp_wifi.h index 9fb75fffeb..6f082a3c0c 100644 --- a/mcux/middleware/wifi_nxp/incl/nxp_wifi.h +++ b/mcux/middleware/wifi_nxp/incl/nxp_wifi.h @@ -46,6 +46,14 @@ extern "C" { #define CONFIG_MAX_AP_ENTRIES CONFIG_NXP_WIFI_MAX_AP_ENTRIES #endif +#if CONFIG_NXP_WIFI_MAX_RESCAN_LIMIT +#define CONFIG_MAX_RESCAN_LIMIT CONFIG_NXP_WIFI_MAX_RESCAN_LIMIT +#endif + +#if CONFIG_NXP_WIFI_MAX_RECONNECT_LIMIT +#define CONFIG_MAX_RECONNECT_LIMIT CONFIG_NXP_WIFI_MAX_RECONNECT_LIMIT +#endif + #if CONFIG_NXP_WIFI_WLAN_KNOWN_NETWORKS #define CONFIG_WLAN_KNOWN_NETWORKS CONFIG_NXP_WIFI_WLAN_KNOWN_NETWORKS #endif diff --git a/mcux/middleware/wifi_nxp/incl/wlcmgr/wlan.h b/mcux/middleware/wifi_nxp/incl/wlcmgr/wlan.h index 55d027323b..9c80041864 100644 --- a/mcux/middleware/wifi_nxp/incl/wlcmgr/wlan.h +++ b/mcux/middleware/wifi_nxp/incl/wlcmgr/wlan.h @@ -85,24 +85,12 @@ typedef enum /** The number of times that the Wi-Fi connection manager look for a * network before giving up. */ -#if CONFIG_MAX_RESCAN_LIMIT -#define WLAN_RESCAN_LIMIT CONFIG_MAX_RESCAN_LIMIT -#else -#if CONFIG_WPA_SUPP -#define WLAN_RESCAN_LIMIT 30U -#else -#if CONFIG_P2P -#define WLAN_RESCAN_LIMIT 10U -#else -#define WLAN_RESCAN_LIMIT 5U -#endif /* CONFIG_P2P */ -#endif /* CONFIG_WPA_SUPP */ -#endif /* CONFIG_MAX_RESCAN_LIMIT */ +#define WLAN_RESCAN_LIMIT CONFIG_MAX_RESCAN_LIMIT +/** The number of times that the Wi-Fi connection manager attempts a +* reconnection with the network before giving up. */ +#define WLAN_RECONNECT_LIMIT CONFIG_MAX_RECONNECT_LIMIT #define WLAN_11D_SCAN_LIMIT 3U -/** The number of times that the Wi-Fi connection manager attempts a - * reconnection with the network before giving up. */ -#define WLAN_RECONNECT_LIMIT 5U /** Minimum length for network names, see \ref wlan_network. */ #define WLAN_NETWORK_NAME_MIN_LENGTH 1U /** Maximum length for network names, see \ref wlan_network */