Skip to content

Create dedicated heap for supplicant #92438

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions modules/hostap/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,33 @@ config WIFI_NM_WPA_SUPPLICANT

if WIFI_NM_WPA_SUPPLICANT

config WIFI_NM_WPA_SUPPLICANT_GLOBAL_HEAP
bool "Use Zephyr kernel heap for Wi-Fi driver"
default y
help
Enable this option to use K_HEAP for memory allocations in supplicant.

if !WIFI_NM_WPA_SUPPLICANT_GLOBAL_HEAP
config WIFI_NM_WPA_SUPPLICANT_HEAP
int "Dedicated memory pool for wpa_supplicant"
def_int 66560 if WIFI_NM_HOSTAPD_AP
def_int 55000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE && WIFI_CREDENTIALS
def_int 48000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE
def_int 41808 if WIFI_NM_WPA_SUPPLICANT_AP
# 30K is mandatory, but might need more for long duration use cases
def_int 30000
endif # !WIFI_NM_WPA_SUPPLICANT_GLOBAL_HEAP

if WIFI_NM_WPA_SUPPLICANT_GLOBAL_HEAP
config HEAP_MEM_POOL_ADD_SIZE_HOSTAP
def_int 66560 if WIFI_NM_HOSTAPD_AP
def_int 55000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE && WIFI_CREDENTIALS
def_int 48000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE
def_int 41808 if WIFI_NM_WPA_SUPPLICANT_AP
# 30K is mandatory, but might need more for long duration use cases
def_int 30000
endif # WIFI_NM_WPA_SUPPLICANT_GLOBAL_HEAP

Comment on lines +27 to +53
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can de-duplicate this by something like:

+config WIFI_NM_WPA_SUPPLICANT_HEAP_SIZE
+       int
+       default 66560 if WIFI_NM_HOSTAPD_AP
+       default 55000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE && WIFI_CREDENTIALS
+       default 48000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE
+       default 41808 if WIFI_NM_WPA_SUPPLICANT_AP
+       # 30K is mandatory, but might need more for long duration use cases
+       default 30000
+
 if !WIFI_NM_WPA_SUPPLICANT_GLOBAL_HEAP
 config WIFI_NM_WPA_SUPPLICANT_HEAP
        int "Dedicated memory pool for wpa_supplicant"
-       def_int 66560 if WIFI_NM_HOSTAPD_AP
-       def_int 55000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE && WIFI_CREDENTIALS
-       def_int 48000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE
-       def_int 41808 if WIFI_NM_WPA_SUPPLICANT_AP
-       # 30K is mandatory, but might need more for long duration use cases
-       def_int 30000
+       default WIFI_NM_WPA_SUPPLICANT_HEAP_SIZE
+       help
+         Dedicated memory pool size for wpa_supplicant.
 endif # !WIFI_NM_WPA_SUPPLICANT_GLOBAL_HEAP
 
 if WIFI_NM_WPA_SUPPLICANT_GLOBAL_HEAP
 config HEAP_MEM_POOL_ADD_SIZE_HOSTAP
-       def_int 66560 if WIFI_NM_HOSTAPD_AP
-       def_int 55000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE && WIFI_CREDENTIALS
-       def_int 48000 if WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE
-       def_int 41808 if WIFI_NM_WPA_SUPPLICANT_AP
-       # 30K is mandatory, but might need more for long duration use cases
-       def_int 30000
+       int
+       default WIFI_NM_WPA_SUPPLICANT_HEAP_SIZE
+       help
+         Additional heap size for wpa_supplicant when using global heap.
 endif # WIFI_NM_WPA_SUPPLICANT_GLOBAL_HEAP


config WIFI_NM_WPA_SUPPLICANT_THREAD_STACK_SIZE
int "Stack size for wpa_supplicant thread"
Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ manifest:
- hal
- name: hostap
path: modules/lib/hostap
revision: bc5d22f5838d017b889d1452a5854f9a32895414
revision: pull/74/head
- name: liblc3
revision: 48bbd3eacd36e99a57317a0a4867002e0b09e183
path: modules/lib/liblc3
Expand Down
Loading