@@ -506,6 +506,11 @@ static int nxp_wifi_start_ap(const struct device *dev, struct wifi_connect_req_p
506
506
nxp_wlan_uap_network .security .type = WLAN_SECURITY_WPA2 ;
507
507
nxp_wlan_uap_network .security .psk_len = params -> psk_length ;
508
508
strncpy (nxp_wlan_uap_network .security .psk , params -> psk , params -> psk_length );
509
+ } else if (params -> security == WIFI_SECURITY_TYPE_PSK_SHA256 ) {
510
+ nxp_wlan_uap_network .security .type = WLAN_SECURITY_WPA2 ;
511
+ nxp_wlan_uap_network .security .key_mgmt = WLAN_KEY_MGMT_PSK_SHA256 ;
512
+ nxp_wlan_uap_network .security .psk_len = params -> psk_length ;
513
+ strncpy (nxp_wlan_uap_network .security .psk , params -> psk , params -> psk_length );
509
514
} else if (params -> security == WIFI_SECURITY_TYPE_SAE ) {
510
515
nxp_wlan_uap_network .security .type = WLAN_SECURITY_WPA3_SAE ;
511
516
nxp_wlan_uap_network .security .password_len = params -> psk_length ;
@@ -702,11 +707,9 @@ static int nxp_wifi_process_results(unsigned int count)
702
707
if (scan_result .wpa2 ) {
703
708
res .security = WIFI_SECURITY_TYPE_PSK ;
704
709
}
705
- #ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT
706
710
if (scan_result .wpa2_sha256 ) {
707
711
res .security = WIFI_SECURITY_TYPE_PSK_SHA256 ;
708
712
}
709
- #endif
710
713
if (scan_result .wpa3_sae ) {
711
714
res .security = WIFI_SECURITY_TYPE_SAE ;
712
715
}
@@ -923,6 +926,11 @@ static int nxp_wifi_connect(const struct device *dev, struct wifi_connect_req_pa
923
926
nxp_wlan_network .security .type = WLAN_SECURITY_WPA2 ;
924
927
nxp_wlan_network .security .psk_len = params -> psk_length ;
925
928
strncpy (nxp_wlan_network .security .psk , params -> psk , params -> psk_length );
929
+ } else if (params -> security == WIFI_SECURITY_TYPE_PSK_SHA256 ) {
930
+ nxp_wlan_network .security .type = WLAN_SECURITY_WPA2 ;
931
+ nxp_wlan_network .security .key_mgmt = WLAN_KEY_MGMT_PSK_SHA256 ;
932
+ nxp_wlan_network .security .psk_len = params -> psk_length ;
933
+ strncpy (nxp_wlan_network .security .psk , params -> psk , params -> psk_length );
926
934
} else if (params -> security == WIFI_SECURITY_TYPE_SAE ) {
927
935
nxp_wlan_network .security .type = WLAN_SECURITY_WPA3_SAE ;
928
936
nxp_wlan_network .security .password_len = params -> psk_length ;
@@ -1011,15 +1019,26 @@ static int nxp_wifi_disconnect(const struct device *dev)
1011
1019
return 0 ;
1012
1020
}
1013
1021
1014
- static inline enum wifi_security_type nxp_wifi_security_type ( enum wlan_security_type type )
1022
+ static inline enum wifi_security_type nxp_wifi_key_mgmt_to_zephyr ( int key_mgmt , int pwe )
1015
1023
{
1016
- switch (type ) {
1017
- case WLAN_SECURITY_NONE :
1024
+ switch (key_mgmt ) {
1025
+ case WLAN_KEY_MGMT_NONE :
1018
1026
return WIFI_SECURITY_TYPE_NONE ;
1019
- case WLAN_SECURITY_WPA2 :
1027
+ case WLAN_KEY_MGMT_PSK :
1020
1028
return WIFI_SECURITY_TYPE_PSK ;
1021
- case WLAN_SECURITY_WPA3_SAE :
1029
+ case WLAN_KEY_MGMT_PSK_SHA256 :
1030
+ return WIFI_SECURITY_TYPE_PSK_SHA256 ;
1031
+ case WLAN_KEY_MGMT_SAE :
1032
+ if (pwe == 1 ) {
1033
+ return WIFI_SECURITY_TYPE_SAE_H2E ;
1034
+ } else if (pwe == 2 ) {
1035
+ return WIFI_SECURITY_TYPE_SAE_AUTO ;
1036
+ } else {
1037
+ return WIFI_SECURITY_TYPE_SAE_HNP ;
1038
+ }
1022
1039
return WIFI_SECURITY_TYPE_SAE ;
1040
+ case WLAN_KEY_MGMT_SAE | WLAN_KEY_MGMT_PSK :
1041
+ return WIFI_SECURITY_TYPE_WPA_AUTO_PERSONAL ;
1023
1042
default :
1024
1043
return WIFI_SECURITY_TYPE_UNKNOWN ;
1025
1044
}
@@ -1086,8 +1105,9 @@ static int nxp_wifi_uap_status(const struct device *dev, struct wifi_iface_statu
1086
1105
1087
1106
status -> band = nxp_wlan_uap_network .channel > 14 ? WIFI_FREQ_BAND_5_GHZ
1088
1107
: WIFI_FREQ_BAND_2_4_GHZ ;
1089
- status -> security =
1090
- nxp_wifi_security_type (nxp_wlan_uap_network .security .type );
1108
+ status -> security = nxp_wifi_key_mgmt_to_zephyr (
1109
+ nxp_wlan_uap_network .security .key_mgmt ,
1110
+ nxp_wlan_uap_network .security .pwe_derivation );
1091
1111
status -> mfp =
1092
1112
nxp_wlan_uap_network .security .mfpr
1093
1113
? WIFI_MFP_REQUIRED
@@ -1167,7 +1187,9 @@ static int nxp_wifi_status(const struct device *dev, struct wifi_iface_status *s
1167
1187
1168
1188
status -> band = nxp_wlan_network .channel > 14 ? WIFI_FREQ_BAND_5_GHZ
1169
1189
: WIFI_FREQ_BAND_2_4_GHZ ;
1170
- status -> security = nxp_wifi_security_type (nxp_wlan_network .security .type );
1190
+ status -> security = nxp_wifi_key_mgmt_to_zephyr (
1191
+ nxp_wlan_network .security .key_mgmt ,
1192
+ nxp_wlan_network .security .pwe_derivation );
1171
1193
status -> mfp = nxp_wlan_network .security .mfpr ? WIFI_MFP_REQUIRED :
1172
1194
(nxp_wlan_network .security .mfpc ? WIFI_MFP_OPTIONAL : 0 );
1173
1195
}
0 commit comments