Skip to content

Commit 2cc55bf

Browse files
nxf58150nashif
authored andcommitted
modules: hostap: Add support of setting up softAP with hostapd
Added new flag CONFIG_WIFI_NM_HOSTAPD_AP for hostapd support. Once this flag is enabled, softAP will be setup by hostapd. Both wpa_supplicant and hostapd uses same task and eloop. Included necessary hostapd files when compiling wifi samples if CONFIG_WIFI_NM_HOSTAPD_AP is enabled. Added hostapd support for all softAP command of L2 wifi shell commands. Signed-off-by: Hui Bai <[email protected]>
1 parent 981fb7b commit 2cc55bf

File tree

10 files changed

+930
-8
lines changed

10 files changed

+930
-8
lines changed

modules/hostap/CMakeLists.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ zephyr_library()
1111
set(HOSTAP_BASE ${ZEPHYR_HOSTAP_MODULE_DIR})
1212
set(WIFI_NM_WPA_SUPPLICANT_BASE ${HOSTAP_BASE}/wpa_supplicant)
1313
set(HOSTAP_SRC_BASE ${HOSTAP_BASE}/src)
14+
set(WIFI_NM_HOSTAPD_BASE ${HOSTAP_BASE}/hostapd)
1415

1516
set(CMAKE_EXE_LINKER_FLAGS "--specs=nosys.specs -lnosys")
1617
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMISSING_SYSCALL_NAMES")
@@ -214,6 +215,25 @@ zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_AP
214215
CONFIG_EAP_SERVER_IDENTITY
215216
)
216217

218+
zephyr_include_directories_ifdef(CONFIG_WIFI_NM_HOSTAPD_AP
219+
${WIFI_NM_HOSTAPD_BASE}/
220+
)
221+
222+
zephyr_library_sources_ifdef(CONFIG_WIFI_NM_HOSTAPD_AP
223+
${HOSTAP_SRC_BASE}/ap/acs.c
224+
${HOSTAP_SRC_BASE}/utils/ip_addr.c
225+
${WIFI_NM_HOSTAPD_BASE}/config_file.c
226+
${WIFI_NM_HOSTAPD_BASE}/ctrl_iface.c
227+
${WIFI_NM_HOSTAPD_BASE}/ctrl_iface_zephyr.c
228+
${WIFI_NM_HOSTAPD_BASE}/eap_register.c
229+
${WIFI_NM_HOSTAPD_BASE}/hostapd_cli_cmds.c
230+
${WIFI_NM_HOSTAPD_BASE}/hostapd_cli_zephyr.c
231+
)
232+
233+
zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_HOSTAPD_AP
234+
HOSTAPD
235+
CONFIG_ACS
236+
)
217237

218238
zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_NONE
219239
${HOSTAP_SRC_BASE}/crypto/crypto_none.c

modules/hostap/Kconfig

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ config WIFI_NM_WPA_SUPPLICANT_WQ_PRIO
4343
int "Thread priority of wpa_supplicant iface workqueue"
4444
default 7
4545

46+
config WIFI_NM_WPA_SUPPLICANT_PRIO
47+
int "Thread priority of wpa_supplicant"
48+
default 0
49+
4650
# Currently we default ZVFS_OPEN_MAX to 16 in lib/posix/Kconfig
4751
# l2_packet - 1
4852
# ctrl_iface - 2 * socketpairs = 4(local and global)
@@ -179,7 +183,7 @@ config WIFI_NM_WPA_SUPPLICANT_WPA3
179183
default y
180184

181185
config WIFI_NM_WPA_SUPPLICANT_AP
182-
bool "AP mode support"
186+
bool "SoftAP mode support based on WPA supplicant"
183187

184188
config WIFI_NM_WPA_SUPPLICANT_WPS
185189
bool "WPS support"
@@ -202,6 +206,10 @@ config WIFI_NM_WPA_SUPPLICANT_INF_MON
202206
bool "Monitor the net mgmt event to add/del interface"
203207
default y
204208

209+
config WIFI_NM_HOSTAPD_AP
210+
bool "FullAP mode support based on Hostapd"
211+
depends on !WIFI_NM_WPA_SUPPLICANT_INF_MON
212+
205213
config WIFI_NM_WPA_SUPPLICANT_BSS_MAX_IDLE_TIME
206214
int "BSS max idle timeout in seconds"
207215
range 0 64000
@@ -439,6 +447,12 @@ config DPP2
439447
config DPP3
440448
bool
441449

450+
config ACS
451+
bool
452+
453+
config IEEE80211AC
454+
bool
455+
442456
config NW_SEL_RELIABILITY
443457
bool
444458
default y

0 commit comments

Comments
 (0)