cfg80211: add missing constraint for user-supplied VHT mask
authorSergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Fri, 19 Oct 2018 15:40:13 +0000 (15:40 +0000)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 9 Nov 2018 07:55:32 +0000 (08:55 +0100)
Do a logical vht_capa &= vht_capa_mask of user-supplied VHT mask with
the driver-supplied mask of modifiable VHT capabilities.
Fix whitespaces and comment typos.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/mlme.c
net/wireless/sme.c

index 12b3edf70a7b91966d4ee524fe10aa9a31bcc26b..1615e503f8e3919ac1eb33cab98445acc00957f9 100644 (file)
@@ -272,11 +272,11 @@ void cfg80211_oper_and_ht_capa(struct ieee80211_ht_cap *ht_capa,
 
        p1 = (u8*)(ht_capa);
        p2 = (u8*)(ht_capa_mask);
-       for (i = 0; i<sizeof(*ht_capa); i++)
+       for (i = 0; i < sizeof(*ht_capa); i++)
                p1[i] &= p2[i];
 }
 
-/*  Do a logical ht_capa &= ht_capa_mask.  */
+/*  Do a logical vht_capa &= vht_capa_mask.  */
 void cfg80211_oper_and_vht_capa(struct ieee80211_vht_cap *vht_capa,
                                const struct ieee80211_vht_cap *vht_capa_mask)
 {
index d536b07582f8c90e9dce435c5e569dfb8d406fe9..1c93412038dc729253c9afab6e8ecca76f5b7ca3 100644 (file)
@@ -1171,6 +1171,8 @@ int cfg80211_connect(struct cfg80211_registered_device *rdev,
 
        cfg80211_oper_and_ht_capa(&connect->ht_capa_mask,
                                  rdev->wiphy.ht_capa_mod_mask);
+       cfg80211_oper_and_vht_capa(&connect->vht_capa_mask,
+                                  rdev->wiphy.vht_capa_mod_mask);
 
        if (connkeys && connkeys->def >= 0) {
                int idx;