]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add a config parameter to exclude DFS channels from ACS
authorSunil Dutt <usdutt@qti.qualcomm.com>
Tue, 16 May 2017 10:42:38 +0000 (16:12 +0530)
committerJouni Malinen <j@w1.fi>
Sat, 27 May 2017 08:50:21 +0000 (11:50 +0300)
The new acs_exclude_dfs=1 parameter can be used to request hostapd to
exclude all DFS channels from ACS consideration. This is mainly of use
for cases where the driver supports DFS channels, but for some reason a
non-DFS channel is desired when using automatic channel selection.
Previously, the chanlist parameter could have been used for this, but
that required listing all the acceptable channels. The new parameter
allows this to be done without such a list.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
hostapd/config_file.c
hostapd/hostapd.conf
src/ap/ap_config.h
src/ap/ap_drv_ops.c

index 900d81131ea630afb71693dc6cceb67d4f96f898..3946589853d6ebfb0883b4b8d143f5ea134fe5fc 100644 (file)
@@ -2745,6 +2745,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
                                   line, pos);
                        return 1;
                }
+       } else if (os_strcmp(buf, "acs_exclude_dfs") == 0) {
+               conf->acs_exclude_dfs = atoi(pos);
        } else if (os_strcmp(buf, "channel") == 0) {
                if (os_strcmp(pos, "acs_survey") == 0) {
 #ifndef CONFIG_ACS
index 135715eb4a0153096e625916ee5d11115398a5e0..9b9ab10bcc5a6ba83f2f5a50dc2dc9434d6969fd 100644 (file)
@@ -199,6 +199,11 @@ channel=1
 #chanlist=100 104 108 112 116
 #chanlist=1 6 11-13
 
+# Exclude DFS channels from ACS
+# This option can be used to exclude all DFS channels from the ACS channel list
+# in cases where the driver supports DFS channels.
+#acs_exclude_dfs=1
+
 # Beacon interval in kus (1.024 ms) (default: 100; range 15..65535)
 beacon_int=100
 
index 849c69d92af4a488aaeeed7e2322c94da428e004..9fb0a003c2179db9337e7dcbf0daab62c5d2fc46 100644 (file)
@@ -660,6 +660,7 @@ struct hostapd_config {
        u8 channel;
        u8 acs;
        struct wpa_freq_range_list acs_ch_list;
+       int acs_exclude_dfs;
        enum hostapd_hw_mode hw_mode; /* HOSTAPD_MODE_IEEE80211A, .. */
        enum {
                LONG_PREAMBLE = 0,
index ecf60e2479faafb6f01724ae0d54655adaea60f6..b3d4f03241810acdd72c46bbe317c2f7ea73fb0d 100644 (file)
@@ -816,7 +816,9 @@ static void hostapd_get_hw_mode_any_channels(struct hostapd_data *hapd,
                if ((acs_ch_list_all ||
                     freq_range_list_includes(&hapd->iface->conf->acs_ch_list,
                                              chan->chan)) &&
-                   !(chan->flag & HOSTAPD_CHAN_DISABLED))
+                   !(chan->flag & HOSTAPD_CHAN_DISABLED) &&
+                   !(hapd->iface->conf->acs_exclude_dfs &&
+                     (chan->flag & HOSTAPD_CHAN_RADAR)))
                        int_array_add_unique(freq_list, chan->freq);
        }
 }
@@ -871,6 +873,9 @@ int hostapd_drv_do_acs(struct hostapd_data *hapd)
                                    &hapd->iface->conf->acs_ch_list,
                                    chan->chan))
                                continue;
+                       if (hapd->iface->conf->acs_exclude_dfs &&
+                           (chan->flag & HOSTAPD_CHAN_RADAR))
+                               continue;
                        if (!(chan->flag & HOSTAPD_CHAN_DISABLED)) {
                                channels[num_channels++] = chan->chan;
                                int_array_add_unique(&freq_list, chan->freq);