From d7f1c0ad5f43c0fa20470a34bd9f5c7ddbc6e56e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Pouiller?= Date: Wed, 21 May 2025 14:59:15 +0200 Subject: [PATCH] drivers: wifi: siwx91x: Add support for Enhanced Legacy Power Save MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Siwx91x support a specific mode slightly better than the old legacy PS mode. This mode has to be set on the NWP boot, so it is not easy to configure it during the runtime. Hence, this patch only provide a compile time option to enable it. Co-authored-by: Arunmani Alagarsamy Signed-off-by: Arunmani Alagarsamy Signed-off-by: Jérôme Pouiller --- drivers/wifi/siwx91x/Kconfig.siwx91x | 18 ++++++++++++++++++ soc/silabs/silabs_siwx91x/siwg917/nwp.c | 4 +++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/drivers/wifi/siwx91x/Kconfig.siwx91x b/drivers/wifi/siwx91x/Kconfig.siwx91x index 9b6ed992ad4..b7bf8a6d9fa 100644 --- a/drivers/wifi/siwx91x/Kconfig.siwx91x +++ b/drivers/wifi/siwx91x/Kconfig.siwx91x @@ -14,6 +14,24 @@ config WIFI_SILABS_SIWX91X if WIFI_SILABS_SIWX91X +config WIFI_SILABS_SIWX91X_ENHANCED_MAX_PSP + bool "Enhanced Max PSP Support" + default y + help + Enable this option to allow the device to configure + Enhanced Maximum Power Save (PSP) support during + device initialization. + + **Advantages:** + - Reduces power consumption during low traffic periods. + - Automatically transitions to Fast PSP for improved responsiveness + when traffic is high. + + **Limitations:** + - Initially uses PS-Poll frames for power management, even if the + user configures NULL frame-based. + - Switches to NULL frame-based only when traffic increases. + choice prompt "Network stack" default WIFI_SILABS_SIWX91X_NET_STACK_NATIVE diff --git a/soc/silabs/silabs_siwx91x/siwg917/nwp.c b/soc/silabs/silabs_siwx91x/siwg917/nwp.c index ccbdc4b2a31..4f4d4ed6f4a 100644 --- a/soc/silabs/silabs_siwx91x/siwg917/nwp.c +++ b/soc/silabs/silabs_siwx91x/siwg917/nwp.c @@ -69,9 +69,11 @@ static void siwx91x_configure_sta_mode(sl_si91x_boot_configuration_t *boot_confi #ifdef CONFIG_WIFI_SILABS_SIWX91X boot_config->ext_tcp_ip_feature_bit_map = SL_SI91X_CONFIG_FEAT_EXTENSION_VALID; - boot_config->config_feature_bit_map = SL_SI91X_ENABLE_ENHANCED_MAX_PSP; boot_config->ext_custom_feature_bit_map |= SL_SI91X_EXT_FEAT_IEEE_80211W | SL_SI91X_EXT_FEAT_FRONT_END_SWITCH_PINS_ULP_GPIO_4_5_0; + if (IS_ENABLED(CONFIG_WIFI_SILABS_SIWX91X_ENHANCED_MAX_PSP)) { + boot_config->config_feature_bit_map = SL_SI91X_ENABLE_ENHANCED_MAX_PSP; + } #endif #ifdef CONFIG_BT_SILABS_SIWX91X