Skip to content

Commit 02b5edd

Browse files
MaochenWang1dkalowsk
authored andcommitted
drivers: wifi: nxp: return error for unsupported AP bandwidth
Starting SAP should return failure, if the bandwidth is not supported by the Wi-Fi chip. Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
1 parent 9b27a47 commit 02b5edd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/wifi/nxp/nxp_wifi_drv.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,11 @@ static int nxp_wifi_start_ap(const struct device *dev, struct wifi_connect_req_p
564564
case WIFI_FREQ_BANDWIDTH_20MHZ:
565565
case WIFI_FREQ_BANDWIDTH_40MHZ:
566566
case WIFI_FREQ_BANDWIDTH_80MHZ:
567-
wlan_uap_set_bandwidth(params->bandwidth);
567+
ret = wlan_uap_set_bandwidth(params->bandwidth);
568+
if (ret != WM_SUCCESS) {
569+
LOG_ERR("Bandwidth is not supported");
570+
return -EAGAIN;
571+
}
568572
break;
569573
default:
570574
LOG_ERR("Invalid bandwidth");
@@ -670,7 +674,7 @@ static int nxp_wifi_ap_config_params(const struct device *dev, struct wifi_ap_co
670674
ret = wlan_uap_set_bandwidth(params->bandwidth);
671675
if (ret != WM_SUCCESS) {
672676
status = NXP_WIFI_RET_FAIL;
673-
LOG_ERR("Failed to set Wi-Fi AP bandwidth");
677+
LOG_ERR("Bandwidth is not supported");
674678
} else {
675679
LOG_INF("Set Wi-Fi AP bandwidth: %d", params->bandwidth);
676680
}

0 commit comments

Comments
 (0)