hostap: Fix supported channels for unknown band

By default Wi-Fi works on all bands, so, the band will be unknown, in
which case no need to configure a specific frequency list to WPA
supplicant.

Only when a use provides a specific band then this is needed.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This commit is contained in:
Chaitanya Tata 2023-11-03 00:00:18 +05:30 committed by Alberto Escolar
parent 99e472b79e
commit 5c24db3b1f

View file

@ -205,6 +205,7 @@ static int wpa_supp_supported_channels(struct wpa_supplicant *wpa_s, uint8_t ban
mode = get_mode_by_band(wpa_s, band);
if (!mode) {
wpa_printf(MSG_ERROR, "Unsupported or invalid band: %d", band);
return -EINVAL;
}
@ -339,7 +340,7 @@ int supplicant_connect(const struct device *dev, struct wifi_connect_req_params
if (!wpa_cli_cmd_v("set_network %d ieee80211w 0", resp.network_id)) {
goto out;
if (params->band) {
if (params->band != WIFI_FREQ_BAND_UNKNOWN) {
ret = wpa_supp_supported_channels(wpa_s, params->band, &chan_list);
if (ret < 0) {
if (!wpa_cli_cmd_v("remove_network %d", resp.network_id)) {