Skip to content

Commit 91ec46e

Browse files
nxf58150aescolar
authored andcommitted
modules: hostap: add IEEE80211R support
Add 80211R support in hostap. Add cmd wifi connect option '-R' to enable 80211R. Signed-off-by: Hui Bai <[email protected]>
1 parent 7c167c6 commit 91ec46e

File tree

5 files changed

+30
-6
lines changed

5 files changed

+30
-6
lines changed

include/zephyr/net/wifi_mgmt.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,8 @@ struct wifi_connect_req_params {
512512
const uint8_t *eap_password;
513513
/** eap passwd length, max 128 */
514514
uint8_t eap_passwd_length;
515+
/** Fast BSS Transition used */
516+
bool ft_used;
515517
};
516518

517519
/** @brief Wi-Fi connect result codes. To be overlaid on top of \ref wifi_status

modules/hostap/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,11 @@ zephyr_library_sources_ifdef(CONFIG_WPA_CLI
161161
src/wpa_cli.c
162162
)
163163

164+
zephyr_library_sources_ifdef(CONFIG_IEEE80211R
165+
${HOSTAP_SRC_BASE}/rsn_supp/wpa_ft.c
166+
${HOSTAP_SRC_BASE}/ap/wpa_auth_ft.c
167+
)
168+
164169
zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_AP
165170
${WIFI_NM_WPA_SUPPLICANT_BASE}/ap.c
166171
${HOSTAP_SRC_BASE}/ap/ap_config.c

modules/hostap/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,10 @@ config ACS
508508
config IEEE80211AC
509509
bool
510510

511+
config IEEE80211R
512+
bool
513+
depends on !WIFI_NM_WPA_SUPPLICANT_CRYPTO_NONE
514+
511515
config NW_SEL_RELIABILITY
512516
bool
513517
default y

modules/hostap/src/supp_api.c

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -480,13 +480,21 @@ int process_cipher_config(struct wifi_connect_req_params *params,
480480
} else if (params->suiteb_type == WIFI_SUITEB_192) {
481481
cipher_capa = WPA_CAPA_ENC_GCMP_256;
482482
gropu_mgmt_cipher_capa = WPA_CAPA_ENC_BIP_GMAC_256;
483-
cipher_config->key_mgmt = "WPA-EAP-SUITE-B-192";
483+
if (params->ft_used) {
484+
cipher_config->key_mgmt = "WPA-EAP-SUITE-B-192 FT-EAP-SHA384";
485+
} else {
486+
cipher_config->key_mgmt = "WPA-EAP-SUITE-B-192";
487+
}
484488
cipher_config->openssl_ciphers = "SUITEB192";
485489
cipher_config->tls_flags = "[SUITEB]";
486490
} else {
487491
cipher_capa = WPA_CAPA_ENC_CCMP;
488492
gropu_mgmt_cipher_capa = WPA_CAPA_ENC_BIP;
489-
cipher_config->key_mgmt = "WPA-EAP";
493+
if (params->ft_used) {
494+
cipher_config->key_mgmt = "WPA-EAP FT-EAP";
495+
} else {
496+
cipher_config->key_mgmt = "WPA-EAP";
497+
}
490498
}
491499

492500
if (params->security == WIFI_SECURITY_TYPE_EAP_TLS_SHA256) {
@@ -678,7 +686,8 @@ static int wpas_add_and_config_network(struct wpa_supplicant *wpa_s,
678686
}
679687
}
680688

681-
if (!wpa_cli_cmd_v("set_network %d key_mgmt SAE", resp.network_id)) {
689+
if (!wpa_cli_cmd_v("set_network %d key_mgmt SAE%s", resp.network_id,
690+
params->ft_used ? " FT-SAE" : "")) {
682691
goto out;
683692
}
684693
} else if (params->security == WIFI_SECURITY_TYPE_PSK_SHA256) {
@@ -698,8 +707,8 @@ static int wpas_add_and_config_network(struct wpa_supplicant *wpa_s,
698707
goto out;
699708
}
700709

701-
if (!wpa_cli_cmd_v("set_network %d key_mgmt WPA-PSK",
702-
resp.network_id)) {
710+
if (!wpa_cli_cmd_v("set_network %d key_mgmt WPA-PSK%s",
711+
resp.network_id, params->ft_used ? " FT-PSK" : "")) {
703712
goto out;
704713
}
705714

subsys/net/l2/wifi/wifi_shell.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,7 @@ static int __wifi_args_to_params(const struct shell *sh, size_t argc, char *argv
541541
{"eap-pwd6", required_argument, 0, 'P'},
542542
{"eap-pwd7", required_argument, 0, 'P'},
543543
{"eap-pwd8", required_argument, 0, 'P'},
544+
{"ieee-80211r", no_argument, 0, 'R'},
544545
{"help", no_argument, 0, 'h'},
545546
{0, 0, 0, 0}};
546547
char *endptr;
@@ -565,7 +566,7 @@ static int __wifi_args_to_params(const struct shell *sh, size_t argc, char *argv
565566
params->mfp = WIFI_MFP_OPTIONAL;
566567
params->eap_ver = 1;
567568

568-
while ((opt = getopt_long(argc, argv, "s:p:k:e:w:b:c:m:t:a:K:S:V:I:P:h",
569+
while ((opt = getopt_long(argc, argv, "s:p:k:e:w:b:c:m:t:a:K:S:V:I:P:Rh",
569570
long_options, &opt_index)) != -1) {
570571
state = getopt_state_get();
571572
switch (opt) {
@@ -731,6 +732,9 @@ static int __wifi_args_to_params(const struct shell *sh, size_t argc, char *argv
731732
return -EINVAL;
732733
}
733734
break;
735+
case 'R':
736+
params->ft_used = true;
737+
break;
734738
case 'h':
735739
return -ENOEXEC;
736740
default:

0 commit comments

Comments
 (0)