Browse Source

hw_features: Fix check of supported 802.11ac channel width

The two channel width bits in the VHT capability field can be decoded in
following values (IEEE Std 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@openmesh.com>
Sven Eckelmann 7 years ago
parent
commit
b0fc2ef3a3
2 changed files with 2 additions and 2 deletions
  1. 1 2
      src/common/hw_features_common.c
  2. 1 0
      src/common/ieee802_11_defs.h

+ 1 - 2
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);

+ 1 - 0
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))