ACS: Channel selection based freqlist

When doing ACS, check freqlist also if it is specified.

Signed-off-by: neojou <neojou@gmail.com>
This commit is contained in:
neo_jou 2020-05-11 15:42:49 +08:00 committed by Jouni Malinen
parent 34ac7d871a
commit 025ab330b4

View file

@ -512,6 +512,17 @@ static int is_in_chanlist(struct hostapd_iface *iface,
}
static int is_in_freqlist(struct hostapd_iface *iface,
struct hostapd_channel_data *chan)
{
if (!iface->conf->acs_freq_list.num)
return 1;
return freq_range_list_includes(&iface->conf->acs_freq_list,
chan->freq);
}
static void acs_survey_mode_interference_factor(
struct hostapd_iface *iface, struct hostapd_hw_modes *mode)
{
@ -527,6 +538,9 @@ static void acs_survey_mode_interference_factor(
if (!is_in_chanlist(iface, chan))
continue;
if (!is_in_freqlist(iface, chan))
continue;
wpa_printf(MSG_DEBUG, "ACS: Survey analysis for channel %d (%d MHz)",
chan->chan, chan->freq);
@ -651,6 +665,9 @@ acs_find_ideal_chan_mode(struct hostapd_iface *iface,
if (!is_in_chanlist(iface, chan))
continue;
if (!is_in_freqlist(iface, chan))
continue;
if (!chan_bw_allowed(chan, bw, 1, 1)) {
wpa_printf(MSG_DEBUG,
"ACS: Channel %d: BW %u is not supported",
@ -1013,6 +1030,9 @@ static int * acs_request_scan_add_freqs(struct hostapd_iface *iface,
if (!is_in_chanlist(iface, chan))
continue;
if (!is_in_freqlist(iface, chan))
continue;
*freq++ = chan->freq;
}