modules: hostap: fix hostap compile error and support enterprise

Fix compile error when enable enterprise security mode.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
This commit is contained in:
Maochen Wang
2024-05-22 12:11:34 +08:00
parent 0b70524444
commit 3fc932c5cd
5 changed files with 47 additions and 38 deletions

View File

@@ -92,6 +92,9 @@ struct net_eth_addr {
#if !defined(ETH_P_ECAT)
#define ETH_P_ECAT NET_ETH_PTYPE_ECAT
#endif
#if !defined(ETH_P_EAPOL)
#define ETH_P_EAPOL NET_ETH_PTYPE_EAPOL
#endif
#if !defined(ETH_P_IEEE802154)
#define ETH_P_IEEE802154 NET_ETH_PTYPE_IEEE802154
#endif

View File

@@ -940,7 +940,7 @@ struct net_wifi_mgmt_offload {
#if defined(CONFIG_WIFI_NM_WPA_SUPPLICANT) || defined(__DOXYGEN__)
/** Wi-Fi supplicant driver API */
void *wifi_drv_ops;
const void *wifi_drv_ops;
#endif
};

View File

@@ -16,19 +16,30 @@ set(CMAKE_EXE_LINKER_FLAGS "--specs=nosys.specs -lnosys")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMISSING_SYSCALL_NAMES")
zephyr_include_directories(
src/
${HOSTAP_BASE}/
${WIFI_NM_WPA_SUPPLICANT_BASE}/
${HOSTAP_SRC_BASE}/
${HOSTAP_SRC_BASE}/utils/
${HOSTAP_SRC_BASE}/common/
${HOSTAP_SRC_BASE}/eap_common
${HOSTAP_SRC_BASE}/eap_server
${HOSTAP_SRC_BASE}/radius
${HOSTAP_SRC_BASE}/crypto/
${HOSTAP_SRC_BASE}/ap/
${HOSTAP_SRC_BASE}/drivers/
${HOSTAP_SRC_BASE}/rsn_supp
)
zephyr_library_compile_definitions(
TLS_DEFAULT_CIPHERS=\""DEFAULT:!EXP:!LOW"\"
CONFIG_SME
CONFIG_NO_CONFIG_WRITE
CONFIG_NO_CONFIG_BLOBS
CONFIG_CTRL_IFACE
CONFIG_NO_RANDOM_POOL
CONFIG_SHA256
CONFIG_SHA384
CONFIG_SHA512
CONFIG_CTRL_IFACE_ZEPHYR
CONFIG_SUITEB192
)
@@ -93,6 +104,7 @@ zephyr_library_sources(
${HOSTAP_SRC_BASE}/drivers/driver_common.c
${HOSTAP_SRC_BASE}/drivers/drivers.c
${HOSTAP_SRC_BASE}/utils/crc32.c
${HOSTAP_SRC_BASE}/utils/base64.c
${HOSTAP_SRC_BASE}/utils/common.c
${HOSTAP_SRC_BASE}/utils/wpabuf.c
@@ -159,6 +171,7 @@ zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_AP
${HOSTAP_SRC_BASE}/ap/bss_load.c
${HOSTAP_SRC_BASE}/ap/dfs.c
${HOSTAP_SRC_BASE}/ap/drv_callbacks.c
${HOSTAP_SRC_BASE}/ap/ctrl_iface_ap.c
${HOSTAP_SRC_BASE}/ap/eap_user_db.c
${HOSTAP_SRC_BASE}/ap/hostapd.c
${HOSTAP_SRC_BASE}/ap/hw_features.c
@@ -305,24 +318,6 @@ zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_WPS
EAP_WSC
)
zephyr_library_sources_ifndef(CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_NONE
${HOSTAP_SRC_BASE}/common/wpa_common.c
${HOSTAP_SRC_BASE}/rsn_supp/wpa.c
${HOSTAP_SRC_BASE}/rsn_supp/preauth.c
${HOSTAP_SRC_BASE}/rsn_supp/wpa_ie.c
${HOSTAP_SRC_BASE}/crypto/crypto_mbedtls-bignum.c
${HOSTAP_SRC_BASE}/crypto/crypto_mbedtls-ec.c
${HOSTAP_SRC_BASE}/crypto/crypto_mbedtls.c
${HOSTAP_SRC_BASE}/crypto/aes-wrap.c
${HOSTAP_SRC_BASE}/crypto/aes-unwrap.c
${HOSTAP_SRC_BASE}/crypto/rc4.c
${HOSTAP_SRC_BASE}/crypto/sha1-prf.c
${HOSTAP_SRC_BASE}/crypto/sha256-prf.c
${HOSTAP_SRC_BASE}/crypto/sha256-prf.c
${HOSTAP_SRC_BASE}/crypto/sha384-prf.c
)
zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE
${HOSTAP_SRC_BASE}/crypto/tls_mbedtls.c
${HOSTAP_SRC_BASE}/eap_peer/eap_tls.c
@@ -378,21 +373,25 @@ zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE
)
zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE
CONFIG_EAP_TLS
CONFIG_IEEE8021X_EAPOL
CONFIG_EAP_PEAP
CONFIG_EAP_TTLS
CONFIG_EAP_MD5
CONFIG_EAP_MSCHAPv2
CONFIG_EAP_LEAP
CONFIG_EAP_PSK
CONFIG_EAP_FAST
CONFIG_EAP_PAX
CONFIG_EAP_SAKE
CONFIG_EAP_GPSK
CONFIG_EAP_PWD
CONFIG_EAP_EKE
CONFIG_EAP_IKEv2
EAP_TLS
IEEE8021X_EAPOL
EAP_PEAP
EAP_TTLS
EAP_MD5
EAP_MSCHAPv2
EAP_LEAP
EAP_PSK
EAP_FAST
EAP_PAX
EAP_SAKE
EAP_GPSK
EAP_PWD
EAP_EKE
EAP_IKEv2
)
zephyr_library_compile_definitions_ifndef(CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE
CONFIG_NO_CONFIG_BLOBS
)
zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_EAPOL
@@ -404,7 +403,7 @@ zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_EAPOL
)
zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_EAPOL
CONFIG_IEEE8021X_EAPOL
IEEE8021X_EAPOL
)
zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_NW_SEL_RELIABILITY

View File

@@ -10,6 +10,7 @@ config WIFI_NM_WPA_SUPPLICANT
select POSIX_CLOCK
select POSIX_SIGNAL
select POSIX_API
select FILE_SYSTEM
select NET_SOCKETS
select NET_SOCKETS_PACKET
select NET_SOCKETPAIR
@@ -211,7 +212,7 @@ config NO_WPA
config NO_PBKDF2
bool
default y
default y if WIFI_NM_WPA_SUPPLICANT_CRYPTO_NONE
config SAE_PK
bool
@@ -329,6 +330,12 @@ config SAE
config SHA256
bool
config SHA384
bool
config SHA512
bool
config SUITEB192
bool

View File

@@ -29,7 +29,7 @@ static int cmd_wpa_cli(const struct shell *sh,
argc++;
/* Remove wpa_cli from the argument list */
return z_wpa_ctrl_zephyr_cmd(argc - 1, &argv[1]);
return zephyr_wpa_ctrl_zephyr_cmd(argc - 1, &argv[1]);
}
/* Persisting with "wpa_cli" naming for compatibility with Wi-Fi