]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hw_features: Fix check of supported 802.11ac channel width
authorSven Eckelmann <sven.eckelmann@openmesh.com>
Fri, 9 Jun 2017 09:39:51 +0000 (11:39 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 18 Jul 2017 10:39:46 +0000 (13:39 +0300)
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>
src/common/hw_features_common.c
src/common/ieee802_11_defs.h

index 7a96f96da2e53a1134f03a3a86b41f56dfb0ffac..fdd5e738c6bf15ac199d81dbaf4d210de1a787ca 100644 (file)
@@ -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);
index 393d496cf30a5b41f65ffefba44466479df68ce6..be8ebaf5e8ae6c7c205803b44c60f2fc34132099 100644 (file)
@@ -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))