ACS: Add channels from all modes matching with configured hw mode
The 5 GHz channels are stored in one hw_features set with mode HOSTAPD_MODE_IEEE80211A while the 6 GHz channels will need to stored in a separate hw_features set (but with same mode HOSTAPD_MODE_IEEE80211A) due to possibility of different HE capabilities being available between the 5 GHz and 6 GHz bands. Iterate through all hw_features sets and populate channels from all hw_features sets whose hardware mode is matching the configured hardware mode while preparing the channel list for ACS. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
parent
996662250d
commit
15d3568739
1 changed files with 13 additions and 23 deletions
|
@ -886,6 +886,7 @@ int hostapd_drv_do_acs(struct hostapd_data *hapd)
|
||||||
int ret, i, acs_ch_list_all = 0;
|
int ret, i, acs_ch_list_all = 0;
|
||||||
struct hostapd_hw_modes *mode;
|
struct hostapd_hw_modes *mode;
|
||||||
int *freq_list = NULL;
|
int *freq_list = NULL;
|
||||||
|
enum hostapd_hw_mode selected_mode;
|
||||||
|
|
||||||
if (hapd->driver == NULL || hapd->driver->do_acs == NULL)
|
if (hapd->driver == NULL || hapd->driver->do_acs == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -900,30 +901,19 @@ int hostapd_drv_do_acs(struct hostapd_data *hapd)
|
||||||
if (!hapd->iface->conf->acs_ch_list.num)
|
if (!hapd->iface->conf->acs_ch_list.num)
|
||||||
acs_ch_list_all = 1;
|
acs_ch_list_all = 1;
|
||||||
|
|
||||||
mode = hapd->iface->current_mode;
|
if (hapd->iface->current_mode)
|
||||||
if (mode) {
|
selected_mode = hapd->iface->current_mode->mode;
|
||||||
for (i = 0; i < mode->num_channels; i++) {
|
else
|
||||||
struct hostapd_channel_data *chan = &mode->channels[i];
|
selected_mode = HOSTAPD_MODE_IEEE80211ANY;
|
||||||
if (!acs_ch_list_all &&
|
|
||||||
!freq_range_list_includes(
|
|
||||||
&hapd->iface->conf->acs_ch_list,
|
|
||||||
chan->chan))
|
|
||||||
continue;
|
|
||||||
if (hapd->iface->conf->acs_exclude_dfs &&
|
|
||||||
(chan->flag & HOSTAPD_CHAN_RADAR))
|
|
||||||
continue;
|
|
||||||
if (!(chan->flag & HOSTAPD_CHAN_DISABLED)) {
|
|
||||||
int_array_add_unique(&freq_list, chan->freq);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (i = 0; i < hapd->iface->num_hw_features; i++) {
|
for (i = 0; i < hapd->iface->num_hw_features; i++) {
|
||||||
mode = &hapd->iface->hw_features[i];
|
mode = &hapd->iface->hw_features[i];
|
||||||
hostapd_get_hw_mode_any_channels(hapd, mode,
|
if (selected_mode != HOSTAPD_MODE_IEEE80211ANY &&
|
||||||
acs_ch_list_all,
|
selected_mode != mode->mode)
|
||||||
|
continue;
|
||||||
|
hostapd_get_hw_mode_any_channels(hapd, mode, acs_ch_list_all,
|
||||||
&freq_list);
|
&freq_list);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
params.freq_list = freq_list;
|
params.freq_list = freq_list;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue