Skip to content

Commit efd9519

Browse files
nipandey-01kartben
authored andcommitted
drivers: wifi: siwx91x: Fix MFP bug in wifi status
- Extracting MFP from security mode instead of join feature bitmap Signed-off-by: Nitin Pandey <[email protected]>
1 parent 67ff90d commit efd9519

File tree

1 file changed

+22
-15
lines changed

1 file changed

+22
-15
lines changed

drivers/wifi/siwx91x/siwx91x_wifi.c

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -504,20 +504,6 @@ static int siwx91x_status(const struct device *dev, struct wifi_iface_status *st
504504
memcpy(status->bssid, wlan_info.bssid, WIFI_MAC_ADDR_LEN);
505505
status->wpa3_ent_type = WIFI_WPA3_ENTERPRISE_NA;
506506

507-
ret = sl_si91x_get_join_configuration(interface, &join_config);
508-
if (ret != SL_STATUS_OK) {
509-
LOG_ERR("Failed to get join configuration: 0x%x", ret);
510-
return -EINVAL;
511-
}
512-
513-
if (join_config & SL_SI91X_JOIN_FEAT_MFP_CAPABLE_REQUIRED) {
514-
status->mfp = WIFI_MFP_REQUIRED;
515-
} else if (join_config & SL_SI91X_JOIN_FEAT_MFP_CAPABLE_ONLY) {
516-
status->mfp = WIFI_MFP_OPTIONAL;
517-
} else {
518-
status->mfp = WIFI_MFP_DISABLE;
519-
}
520-
521507
if (interface & SL_WIFI_2_4GHZ_INTERFACE) {
522508
status->band = WIFI_FREQ_BAND_2_4_GHZ;
523509
}
@@ -529,6 +515,27 @@ static int siwx91x_status(const struct device *dev, struct wifi_iface_status *st
529515
status->iface_mode = WIFI_MODE_INFRA;
530516
status->channel = wlan_info.channel_number;
531517
status->twt_capable = true;
518+
519+
ret = sl_si91x_get_join_configuration(interface, &join_config);
520+
if (ret != SL_STATUS_OK) {
521+
LOG_ERR("Failed to get join configuration: 0x%x", ret);
522+
return -EINVAL;
523+
}
524+
525+
if (wlan_info.sec_type == SL_WIFI_WPA3) {
526+
status->mfp = WIFI_MFP_REQUIRED;
527+
} else if (wlan_info.sec_type == SL_WIFI_WPA3_TRANSITION) {
528+
status->mfp = WIFI_MFP_OPTIONAL;
529+
} else if (wlan_info.sec_type == SL_WIFI_WPA2) {
530+
if (join_config & SL_SI91X_JOIN_FEAT_MFP_CAPABLE_REQUIRED) {
531+
status->mfp = WIFI_MFP_REQUIRED;
532+
} else {
533+
status->mfp = WIFI_MFP_OPTIONAL;
534+
}
535+
} else {
536+
status->mfp = WIFI_MFP_DISABLE;
537+
}
538+
532539
ret = sl_wifi_get_signal_strength(SL_WIFI_CLIENT_INTERFACE, &rssi);
533540
if (ret) {
534541
LOG_ERR("Failed to get signal strength: 0x%x", ret);
@@ -553,10 +560,10 @@ static int siwx91x_status(const struct device *dev, struct wifi_iface_status *st
553560
LOG_ERR("Failed to get the AP configuration: 0x%x", ret);
554561
return -EINVAL;
555562
}
556-
557563
status->twt_capable = false;
558564
status->link_mode = WIFI_4;
559565
status->iface_mode = WIFI_MODE_AP;
566+
status->mfp = WIFI_MFP_DISABLE;
560567
status->channel = sl_ap_cfg.channel.channel;
561568
status->beacon_interval = sl_ap_cfg.beacon_interval;
562569
status->dtim_period = sl_ap_cfg.dtim_beacon_count;

0 commit comments

Comments
 (0)