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>
This commit is contained in:
Maochen Wang 2025-04-17 16:17:10 +08:00 committed by Dan Kalowsky
commit 02b5edd7d6

View file

@ -564,7 +564,11 @@ static int nxp_wifi_start_ap(const struct device *dev, struct wifi_connect_req_p
case WIFI_FREQ_BANDWIDTH_20MHZ:
case WIFI_FREQ_BANDWIDTH_40MHZ:
case WIFI_FREQ_BANDWIDTH_80MHZ:
wlan_uap_set_bandwidth(params->bandwidth);
ret = wlan_uap_set_bandwidth(params->bandwidth);
if (ret != WM_SUCCESS) {
LOG_ERR("Bandwidth is not supported");
return -EAGAIN;
}
break;
default:
LOG_ERR("Invalid bandwidth");
@ -670,7 +674,7 @@ static int nxp_wifi_ap_config_params(const struct device *dev, struct wifi_ap_co
ret = wlan_uap_set_bandwidth(params->bandwidth);
if (ret != WM_SUCCESS) {
status = NXP_WIFI_RET_FAIL;
LOG_ERR("Failed to set Wi-Fi AP bandwidth");
LOG_ERR("Bandwidth is not supported");
} else {
LOG_INF("Set Wi-Fi AP bandwidth: %d", params->bandwidth);
}