[PATCH] hostapd: force ht config option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Update to add ability to force ht via a hostapd config option
and thus bypass the result of the HT_SCAN.

Signed-off-by: Jared Bents <jared.bents@xxxxxxxxxxxxxxxxxxx>
---
 hostapd/config_file.c | 2 ++
 hostapd/hostapd.conf  | 1 +
 src/ap/ap_config.h    | 1 +
 src/ap/hw_features.c  | 9 ++++++++-
 4 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index 5079f69e3..7758c5c5e 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -1123,6 +1123,8 @@ static int hostapd_config_ht_capab(struct hostapd_config *conf,
 		conf->ht_capab |= HT_CAP_INFO_40MHZ_INTOLERANT;
 	if (os_strstr(capab, "[LSIG-TXOP-PROT]"))
 		conf->ht_capab |= HT_CAP_INFO_LSIG_TXOP_PROTECT_SUPPORT;
+	if (os_strstr(capab, "[FORCE]"))
+		conf->force_ht = 1;
 
 	return 0;
 }
diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
index fa9a855a6..e0f9385fe 100644
--- a/hostapd/hostapd.conf
+++ b/hostapd/hostapd.conf
@@ -524,6 +524,7 @@ wmm_ac_vo_acm=0
 # DSSS/CCK Mode in 40 MHz: [DSSS_CCK-40] = allowed (not allowed if not set)
 # 40 MHz intolerant [40-INTOLERANT] (not advertised if not set)
 # L-SIG TXOP protection support: [LSIG-TXOP-PROT] (disabled if not set)
+# Force HT regardless of scan: [FORCE] (disabled if not set)
 #ht_capab=[HT40-][SHORT-GI-20][SHORT-GI-40]
 
 # Require stations to support HT PHY (reject association if they do not)
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
index 8c8f7e286..1b2eb7552 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -666,6 +666,7 @@ struct hostapd_config {
 	u16 ht_capab;
 	int ieee80211n;
 	int secondary_channel;
+	int force_ht;
 	int no_pri_sec_switch;
 	int require_ht;
 	int obss_interval;
diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
index 16887acdf..64ba42bf6 100644
--- a/src/ap/hw_features.c
+++ b/src/ap/hw_features.c
@@ -310,7 +310,7 @@ static void ieee80211n_check_scan(struct hostapd_iface *iface)
 	wpa_scan_results_free(scan_res);
 
 	iface->secondary_ch = iface->conf->secondary_channel;
-	if (!oper40) {
+	if (!oper40 && iface->conf->force_ht != 1) {
 		wpa_printf(MSG_INFO, "20/40 MHz operation not permitted on "
 			   "channel pri=%d sec=%d based on overlapping BSSes",
 			   iface->conf->channel,
@@ -325,6 +325,13 @@ static void ieee80211n_check_scan(struct hostapd_iface *iface)
 			 */
 		}
 	}
+	if (iface->conf->force_ht == 1) {
+		wpa_printf(MSG_INFO, "Force 20/40 MHz operation on "
+				"channel pri=%d sec=%d even if there are overlapping BSSes",
+				iface->conf->channel,
+				iface->conf->channel +
+				iface->conf->secondary_channel * 4);
+	}
 
 	res = ieee80211n_allowed_ht40_channel_pair(iface);
 	if (!res) {
-- 
2.18.0


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux