From 7dbd36a2221be928e4f78afc24aefde0e3ffba58 Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Wed, 22 Jan 2025 10:43:06 +1000 Subject: [PATCH] drivers: wifi: options for application usage of Wi-Fi The `CONFIG_WIFI` symbol currently covers a number of different use-cases of Wi-Fi, primarily: * Wi-Fi AP (Broadcasting a network others can connect to) * Wi-Fi Station (Connecting to an AP + SSID scanning) * Wi-Fi AP + Station (Both the above) * Wi-Fi SSID scanning (SSID scanning only) Each of these application usages of Wi-Fi requires a different set of supporting options to operate correctly (`WPA_SUPP`, `NET_CONNECTION_MANAGER`, etc), and different opportunities for resource optimisation (System heap, buffer counts, etc). Currently, optimizing the Wi-Fi drivers depends on driver specific options, which can be challenging to find and are obviously not portable across different drivers. The addition of this choice allows applications to specify in a single Kconfig option which features of Wi-Fi they use, and enable individual Wi-Fi drivers to choose defaults based on those features. Signed-off-by: Jordan Yates --- drivers/wifi/Kconfig | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/wifi/Kconfig b/drivers/wifi/Kconfig index 77db02fa9c8..38bd7a4825f 100644 --- a/drivers/wifi/Kconfig +++ b/drivers/wifi/Kconfig @@ -46,4 +46,27 @@ source "drivers/wifi/infineon/Kconfig.airoc" source "drivers/wifi/nrf_wifi/Kconfig.nrfwifi" source "drivers/wifi/siwx91x/Kconfig.siwx91x" +# Choice is after individual drivers to enable driver specific defaults +choice WIFI_USAGE_MODE + prompt "Application usage of the Wi-Fi driver" + default WIFI_USAGE_MODE_STA + help + Inform the Wi-Fi driver of which Wi-Fi features the application + will be using. Drivers can use this choice to default appropriate + driver-specific options. + +config WIFI_USAGE_MODE_STA + bool "Wi-Fi interface(s) acts as a Station" + +config WIFI_USAGE_MODE_AP + bool "Wi-Fi interface(s) acts as an Access Point" + +config WIFI_USAGE_MODE_STA_AP + bool "Wi-Fi interface(s) acts as an Access Point and Station" + +config WIFI_USAGE_MODE_SCAN_ONLY + bool "Wi-Fi interface(s) used for SSID scanning only" + +endchoice + endif # WIFI