[PATCH] hostap: Allow disabling pri-sec channel switch.

greearb at candelatech.com greearb
Mon Oct 12 08:51:33 PDT 2015


From: Ben Greear <greearb at candelatech.com>

This is helpful when running multiple different vAP on the
same radio, in different modes.  If a vap0 starts in /a mode on channel
149, then a second vap1 in / mode cannot be switching around the primary
channel as it normally might try to do.

Signed-off-by: Ben Greear <greearb at candelatech.com>
---
 hostapd/config_file.c | 8 ++++++++
 hostapd/hostapd.conf  | 7 +++++++
 2 files changed, 15 insertions(+)

diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index 82ac61d..42d3497 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -2667,6 +2667,14 @@ static int hostapd_config_fill(struct hostapd_config *conf,
 			return 1;
 		}
 		conf->send_probe_response = val;
+	} else if (os_strcmp(buf, "no_pri_sec_switch") == 0) {
+		int val = atoi(pos);
+		if (val != 0 && val != 1) {
+			wpa_printf(MSG_ERROR, "Line %d: invalid no_pri_sec_switch %d (expected 0 or 1)",
+				   line, val);
+			return 1;
+		}
+		conf->no_pri_sec_switch = val;
 	} else if (os_strcmp(buf, "supported_rates") == 0) {
 		if (hostapd_parse_intlist(&conf->supported_rates, pos)) {
 			wpa_printf(MSG_ERROR, "Line %d: invalid rate list",
diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
index a0071f7..e683673 100644
--- a/hostapd/hostapd.conf
+++ b/hostapd/hostapd.conf
@@ -507,6 +507,13 @@ wmm_ac_vo_acm=0
 # L-SIG TXOP protection support: [LSIG-TXOP-PROT] (disabled if not set)
 #ht_capab=[HT40-][SHORT-GI-20][SHORT-GI-40]
 
+# Disable the automatic logic that may switch primary and secondary channel.
+# This is useful if running multiple virtual AP on the same radio with different
+# encodings (say, vap0 is /a mode, vap1 is /n mode).  If vap1 tries to switch,
+# it will not work because vap0 is already using the one and only channel it can
+# use.
+#no_pri_sec_switch=0|1
+
 # Require stations to support HT PHY (reject association if they do not)
 #require_ht=1
 
-- 
2.1.0




More information about the Hostap mailing list