[PATCH] add the possibility to define a subset of channels used by the ACS engine when not operating on DFS channels
Adrien Decostre
ad.decostre
Wed Jan 7 04:03:04 PST 2015
---
src/ap/acs.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/src/ap/acs.c b/src/ap/acs.c
index 97cf26f..21d932e 100644
--- a/src/ap/acs.c
+++ b/src/ap/acs.c
@@ -454,6 +454,20 @@ static int acs_usable_chan(struct
hostapd_channel_data *chan)
return 1;
}
+static int is_in_chanlist(struct hostapd_iface *iface,
+ struct hostapd_channel_data *chan)
+{
+ int *entry;
+
+ if (!iface->conf->chanlist)
+ return 1;
+
+ for (entry = iface->conf->chanlist; *entry != -1; entry++) {
+ if (*entry == chan->chan)
+ return 1;
+ }
+ return 0;
+}
static void acs_survey_all_chans_intereference_factor(
struct hostapd_iface *iface)
@@ -467,6 +481,9 @@ static void acs_survey_all_chans_intereference_factor(
if (!acs_usable_chan(chan))
continue;
+ if (!is_in_chanlist(iface, chan))
+ continue;
+
wpa_printf(MSG_DEBUG, "ACS: Survey analysis for
channel %d (%d MHz)",
chan->chan, chan->freq);
@@ -542,7 +559,9 @@ acs_find_ideal_chan(struct hostapd_iface *iface)
if (chan->flag & HOSTAPD_CHAN_DISABLED)
continue;
-
+
+ if (!is_in_chanlist(iface, chan))
+ continue;
/* HT40 on 5 GHz has a limited set of primary channels as per
* 11n Annex J */
--
1.7.9.5
More information about the Hostap
mailing list