From: Neo Jou Date: Mon, 13 Jan 2020 08:31:28 +0000 (+0800) Subject: ACS: Clear all modes in acs_cleanup() X-Git-Tag: hostap_2_10~1727 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3d09be41a893e185e6aff7577e646310a7988a68;p=thirdparty%2Fhostap.git ACS: Clear all modes in acs_cleanup() This is preparation for being able to support hw_mode=any to select the best channel from any supported mode. Signed-off-by: Neo Jou --- diff --git a/src/ap/acs.c b/src/ap/acs.c index 52e8f2cc4..ab3f17ea2 100644 --- a/src/ap/acs.c +++ b/src/ap/acs.c @@ -261,13 +261,13 @@ static void acs_clean_chan_surveys(struct hostapd_channel_data *chan) } -void acs_cleanup(struct hostapd_iface *iface) +static void acs_cleanup_mode(struct hostapd_hw_modes *mode) { int i; struct hostapd_channel_data *chan; - for (i = 0; i < iface->current_mode->num_channels; i++) { - chan = &iface->current_mode->channels[i]; + for (i = 0; i < mode->num_channels; i++) { + chan = &mode->channels[i]; if (chan->flag & HOSTAPD_CHAN_SURVEY_LIST_INITIALIZED) acs_clean_chan_surveys(chan); @@ -276,6 +276,15 @@ void acs_cleanup(struct hostapd_iface *iface) chan->flag |= HOSTAPD_CHAN_SURVEY_LIST_INITIALIZED; chan->min_nf = 0; } +} + + +void acs_cleanup(struct hostapd_iface *iface) +{ + int i; + + for (i = 0; i < iface->num_hw_features; i++) + acs_cleanup_mode(&iface->hw_features[i]); iface->chans_surveyed = 0; iface->acs_num_completed_scans = 0;