[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
Sun Jan 11 23:57:17 PST 2015


Signed-off-by: Adrien Decostre <ad.decostre at gmail.com>
---
 hostapd/hostapd.conf |    5 +----
 src/ap/acs.c         |   21 ++++++++++++++++++++-
 2 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
index 2f6126c..bf59303 100644
--- a/hostapd/hostapd.conf
+++ b/hostapd/hostapd.conf
@@ -158,10 +158,7 @@ channel=1
 #acs_num_scans=5

 # Channel list restriction. This option allows hostapd to select one of the
-# provided channels when a channel should be automatically selected. This
-# is currently only used for DFS when the current channels becomes unavailable
-# due to radar interference, and is currently only useful when ieee80211h=1 is
-# set.
+# provided channels when a channel should be automatically selected.
 # Default: not set (allow any enabled channel to be selected)
 #chanlist=100 104 108 112 116

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

On Sat, Jan 10, 2015 at 12:19 PM, Jouni Malinen <j at w1.fi> wrote:
> On Wed, Jan 07, 2015 at 01:18:20PM +0100, Adrien Decostre wrote:
>> The patch below extend the possibility to define channel list
>> restriction for automatic channel selection (ACS) to the case DFS
>> support is not enabled.
>
> This seems reasonable. Could you please also update hostapd/hostapd.conf
> documentation for chanlist to indicate that it is used for ACS even
> without DFS? Please also read the top level CONTRIBUTIONS file and
> re-send the patch with Signed-off-by: line added to the commit message
> as described there so that I can apply this to the repository.
>
> --
> Jouni Malinen                                            PGP id EFC895FA
> _______________________________________________
> HostAP mailing list
> HostAP at lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap



More information about the Hostap mailing list