]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
ACS: Clear all modes in acs_cleanup()
authorNeo Jou <neojou@gmail.com>
Mon, 13 Jan 2020 08:31:28 +0000 (16:31 +0800)
committerJouni Malinen <j@w1.fi>
Sat, 29 Feb 2020 09:23:03 +0000 (11:23 +0200)
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 <neojou@gmail.com>
src/ap/acs.c

index 52e8f2cc4ce58b27ee242d49fe54ce8ad789e5b7..ab3f17ea2046d049573c0244ee0519efb86ec3b3 100644 (file)
@@ -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;