modules: hostap: Add new configs in Kconfig for hostap cleanup interval

Both wpa_supplicant and hostapd register cleanup interval to eloop and
the intervals are all 10 seconds by default and this can cause device to
be woken up twice from sleep every 10 seconds. In order to reduce power
consumption, add below new items in Kconfig so that users can update the
cleanup intervals based on their requirements.
CONFIG_WIFI_NM_WPA_SUPPLICANT_CLEANUP_INTERVAL
CONFIG_WIFI_NM_HOSTAPD_CLEANUP_INTERVAL

Signed-off-by: Hui Bai <hui.bai@nxp.com>
This commit is contained in:
Hui Bai
2025-12-24 15:15:31 +08:00
committed by Fabio Baltieri
parent 178acc0007
commit 826872d179
2 changed files with 21 additions and 0 deletions

View File

@@ -737,6 +737,12 @@ zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_TEST
)
endif()
zephyr_compile_definitions(WPA_SUPPLICANT_CLEANUP_INTERVAL=${CONFIG_WIFI_NM_WPA_SUPPLICANT_CLEANUP_INTERVAL})
zephyr_compile_definitions_ifdef(CONFIG_WIFI_NM_HOSTAPD_AP
HOSTAPD_CLEANUP_INTERVAL=${CONFIG_WIFI_NM_HOSTAPD_CLEANUP_INTERVAL}
)
zephyr_library_link_libraries_ifndef(CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_NONE
mbedTLS)

View File

@@ -481,6 +481,21 @@ config WIFI_NM_WPA_SUPPLICANT_BGSCAN_LEARN
endif # WIFI_NM_WPA_SUPPLICANT_BGSCAN
config WIFI_NM_WPA_SUPPLICANT_CLEANUP_INTERVAL
int "WPA supplicant cleanup interval (seconds)"
default 10
help
WPA supplicant cleanup interval. Increase this interval to avoid constant wakeup
and save power when device in low power mode.
config WIFI_NM_HOSTAPD_CLEANUP_INTERVAL
int "Hostapd cleanup interval (seconds)"
default 10
depends on WIFI_NM_HOSTAPD_AP
help
Hostapd cleanup interval. Increase this interval to avoid constant wakeup
and save power when device in low power mode.
# Create hidden config options that are used in hostap. This way we do not need
# to mark them as allowed for CI checks, and also someone else cannot use the
# same name options.