[PATCH] hw_features: Fix check of supported 802.11ac channel width

Sven Eckelmann sven.eckelmann at openmesh.com
Fri Jun 9 02:39:51 PDT 2017


The two channel width bits in the VHT capability field can be decoded in
following values (IEEE 802.11ac-2013 8.4.2.160.2 VHT Capabilities Info
field):

 * 0: no 160 or 80+80 MHz support
 * 1: 160 MHz support
 * 2: 160 and 80+80 MHz support
 * 3: (reserved)

The check must therefore not be done bitwise but instead it must checked
whether the capabilities announced by the driver are at least the ones
requested by the user.

Fixes: c781eb842852 ("hostapd: Verify VHT capabilities are supported by driver")
Signed-off-by: Sven Eckelmann <sven.eckelmann at openmesh.com>
---
 src/common/hw_features_common.c | 3 +--
 src/common/ieee802_11_defs.h    | 1 +
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/common/hw_features_common.c b/src/common/hw_features_common.c
index 7a96f96da..fdd5e738c 100644
--- a/src/common/hw_features_common.c
+++ b/src/common/hw_features_common.c
@@ -526,8 +526,7 @@ int ieee80211ac_cap_check(u32 hw, u32 conf)
 	} while (0)
 
 	VHT_CAP_CHECK_MAX(VHT_CAP_MAX_MPDU_LENGTH_MASK);
-	VHT_CAP_CHECK(VHT_CAP_SUPP_CHAN_WIDTH_160MHZ);
-	VHT_CAP_CHECK(VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ);
+	VHT_CAP_CHECK_MAX(VHT_CAP_SUPP_CHAN_WIDTH_MASK);
 	VHT_CAP_CHECK(VHT_CAP_RXLDPC);
 	VHT_CAP_CHECK(VHT_CAP_SHORT_GI_80);
 	VHT_CAP_CHECK(VHT_CAP_SHORT_GI_160);
diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h
index d57bb0c99..d7571d5e7 100644
--- a/src/common/ieee802_11_defs.h
+++ b/src/common/ieee802_11_defs.h
@@ -1127,6 +1127,7 @@ struct ieee80211_ampe_ie {
 #define VHT_CAP_SUPP_CHAN_WIDTH_160MHZ              ((u32) BIT(2))
 #define VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ     ((u32) BIT(3))
 #define VHT_CAP_SUPP_CHAN_WIDTH_MASK                ((u32) BIT(2) | BIT(3))
+#define VHT_CAP_SUPP_CHAN_WIDTH_MASK_SHIFT          2
 #define VHT_CAP_RXLDPC                              ((u32) BIT(4))
 #define VHT_CAP_SHORT_GI_80                         ((u32) BIT(5))
 #define VHT_CAP_SHORT_GI_160                        ((u32) BIT(6))
-- 
2.11.0




More information about the Hostap mailing list