diff mbox series

hostapd: force ht config option

Message ID 20181115185845.26183-1-jared.bents@rockwellcollins.com
State Rejected
Headers show
Series hostapd: force ht config option | expand

Commit Message

Jared Bents Nov. 15, 2018, 6:58 p.m. UTC
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@rockwellcollins.com>
---
 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(-)

Comments

Jouni Malinen Nov. 20, 2018, 1:42 p.m. UTC | #1
On Thu, Nov 15, 2018 at 12:58:45PM -0600, Jared Bents wrote:
> Update to add ability to force ht via a hostapd config option
> and thus bypass the result of the HT_SCAN.

What is the use case for this? IEEE 802.11 standard mandates certain
20/40 MHz co-existence requirements and this patch seems to be providing
a mechanism to not comply with those requirements. I'm not planning on
applying changes to be non-compliant with those rules. Furthermore, this
description is not really accurate since HT can be enabled on a 20 MHz
channel. I'd assume this was supposed to say force HT40 while ignoring
what is operating on neighboring channels.
Jared Bents Nov. 26, 2018, 4:49 p.m. UTC | #2
On Tue, Nov 20, 2018 at 7:42 AM Jouni Malinen <j@w1.fi> wrote:
>
> On Thu, Nov 15, 2018 at 12:58:45PM -0600, Jared Bents wrote:
> > Update to add ability to force ht via a hostapd config option
> > and thus bypass the result of the HT_SCAN.
>
> What is the use case for this? IEEE 802.11 standard mandates certain
> 20/40 MHz co-existence requirements and this patch seems to be providing
> a mechanism to not comply with those requirements. I'm not planning on
> applying changes to be non-compliant with those rules. Furthermore, this
> description is not really accurate since HT can be enabled on a 20 MHz
> channel. I'd assume this was supposed to say force HT40 while ignoring
> what is operating on neighboring channels.
>
> --
> Jouni Malinen                                            PGP id EFC895FA

Hi Jouni,

The use case was for a test environment where it was impossible to
have the HT_SCAN pass while needing to test with 40 MHz bandwidth.
Which is why I was adding it as an option that is off by default so
that if the user really needs to use it but can't get a clean enough
environment, they can without having to patch hostapd to bypass the
results of the HT_SCAN.

Thank you,
Jared
diff mbox series

Patch

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) {