Patchwork hostapd: don't change HT40 capability due to OBSS scan

login
register
mail settings
Submitter Johannes Berg
Date Feb. 9, 2013, 12:11 a.m.
Message ID <1360368665-27404-1-git-send-email-johannes@sipsolutions.net>
Download mbox | patch
Permalink /patch/219349/
State Accepted
Commit 3aea5fbe3b4428afefe8fd2a28264c56a43aab6a
Headers show

Comments

Johannes Berg - Feb. 9, 2013, 12:11 a.m.
From: Johannes Berg <johannes.berg@intel.com>

The capability itself isn't really affected by an OBSS
scan, only the HT operation must then be restricted to
20 MHz. Change this, and therefore use the secondary
channel configuration to determine the setting of the
OP_MODE_20MHZ_HT_STA_ASSOCED flag.

This shouldn't really change anything functionally,
it just makes the code a little less confusing and
is also needed to implement more dynamic bandwidth
changes if ever desired.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
---
 src/ap/hw_features.c   | 1 -
 src/ap/ieee802_11_ht.c | 3 +--
 2 files changed, 1 insertion(+), 3 deletions(-)
Jouni Malinen - Feb. 9, 2013, 10:18 a.m.
On Sat, Feb 09, 2013 at 01:11:05AM +0100, Johannes Berg wrote:
> The capability itself isn't really affected by an OBSS
> scan, only the HT operation must then be restricted to
> 20 MHz. Change this, and therefore use the secondary
> channel configuration to determine the setting of the
> OP_MODE_20MHZ_HT_STA_ASSOCED flag.
> 
> This shouldn't really change anything functionally,
> it just makes the code a little less confusing and
> is also needed to implement more dynamic bandwidth
> changes if ever desired.

Thanks, applied.

Patch

diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
index 923b698..37112bd 100644
--- a/src/ap/hw_features.c
+++ b/src/ap/hw_features.c
@@ -443,7 +443,6 @@  static void ieee80211n_check_scan(struct hostapd_iface *iface)
 			   iface->conf->channel +
 			   iface->conf->secondary_channel * 4);
 		iface->conf->secondary_channel = 0;
-		iface->conf->ht_capab &= ~HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET;
 	}
 
 	res = ieee80211n_allowed_ht40_channel_pair(iface);
diff --git a/src/ap/ieee802_11_ht.c b/src/ap/ieee802_11_ht.c
index 6c3696f..6483e1c 100644
--- a/src/ap/ieee802_11_ht.c
+++ b/src/ap/ieee802_11_ht.c
@@ -133,8 +133,7 @@  int hostapd_ht_operation_update(struct hostapd_iface *iface)
 	new_op_mode = 0;
 	if (iface->num_sta_no_ht)
 		new_op_mode = OP_MODE_MIXED;
-	else if ((iface->conf->ht_capab & HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET)
-		 && iface->num_sta_ht_20mhz)
+	else if (iface->conf->secondary_channel && iface->num_sta_ht_20mhz)
 		new_op_mode = OP_MODE_20MHZ_HT_STA_ASSOCED;
 	else if (iface->olbc_ht)
 		new_op_mode = OP_MODE_MAY_BE_LEGACY_STAS;