Skip to content

Commit

Permalink
drivers: wifi: nxp: fixed bandwidth setting error
Browse files Browse the repository at this point in the history
Bandwidth should be set when starting the AP.

Signed-off-by: Gang Li <[email protected]>
  • Loading branch information
gangli02 authored and kartben committed Dec 16, 2024
1 parent 91c4482 commit 3974260
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions drivers/wifi/nxp/nxp_wifi_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,17 @@ static int nxp_wifi_start_ap(const struct device *dev, struct wifi_connect_req_p
wlan_uap_set_hidden_ssid(params->ignore_broadcast_ssid);
}

switch (params->bandwidth) {
case WIFI_FREQ_BANDWIDTH_20MHZ:
case WIFI_FREQ_BANDWIDTH_40MHZ:
case WIFI_FREQ_BANDWIDTH_80MHZ:
wlan_uap_set_bandwidth(params->bandwidth);
break;
default:
LOG_ERR("Invalid bandwidth");
return -EAGAIN;
}

if (net_addr_pton(AF_INET, CONFIG_NXP_WIFI_SOFTAP_IP_ADDRESS, &ap_addr4->address) < 0) {
LOG_ERR("Invalid CONFIG_NXP_WIFI_SOFTAP_IP_ADDRESS");
return -ENOENT;
Expand Down Expand Up @@ -902,17 +913,6 @@ static int nxp_wifi_connect(const struct device *dev, struct wifi_connect_req_pa
return -EAGAIN;
}

switch (params->bandwidth) {
case WIFI_FREQ_BANDWIDTH_20MHZ:
case WIFI_FREQ_BANDWIDTH_40MHZ:
case WIFI_FREQ_BANDWIDTH_80MHZ:
wlan_uap_set_bandwidth(params->bandwidth);
break;
default:
LOG_ERR("Invalid bandwidth");
return -EAGAIN;
}

ret = wlan_add_network(&nxp_wlan_network);
if (ret != WM_SUCCESS) {
status = NXP_WIFI_RET_FAIL;
Expand Down

0 comments on commit 3974260

Please sign in to comment.