diff options
author | Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> | 2018-10-19 11:40:13 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2018-11-09 02:55:32 -0500 |
commit | 81c5dce2cd0bb0ecb61b6212410da5eb78cd8f79 (patch) | |
tree | 90b28242c0b9b0d01265a8c7c30cb579cabe1b0d | |
parent | a1881c9b8a1edef0a5ae1d5c1b61406fe3402114 (diff) |
cfg80211: add missing constraint for user-supplied VHT mask
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>
-rw-r--r-- | net/wireless/mlme.c | 4 | ||||
-rw-r--r-- | net/wireless/sme.c | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c index 12b3edf70a7b..1615e503f8e3 100644 --- a/net/wireless/mlme.c +++ b/net/wireless/mlme.c | |||
@@ -272,11 +272,11 @@ void cfg80211_oper_and_ht_capa(struct ieee80211_ht_cap *ht_capa, | |||
272 | 272 | ||
273 | p1 = (u8*)(ht_capa); | 273 | p1 = (u8*)(ht_capa); |
274 | p2 = (u8*)(ht_capa_mask); | 274 | p2 = (u8*)(ht_capa_mask); |
275 | for (i = 0; i<sizeof(*ht_capa); i++) | 275 | for (i = 0; i < sizeof(*ht_capa); i++) |
276 | p1[i] &= p2[i]; | 276 | p1[i] &= p2[i]; |
277 | } | 277 | } |
278 | 278 | ||
279 | /* Do a logical ht_capa &= ht_capa_mask. */ | 279 | /* Do a logical vht_capa &= vht_capa_mask. */ |
280 | void cfg80211_oper_and_vht_capa(struct ieee80211_vht_cap *vht_capa, | 280 | void cfg80211_oper_and_vht_capa(struct ieee80211_vht_cap *vht_capa, |
281 | const struct ieee80211_vht_cap *vht_capa_mask) | 281 | const struct ieee80211_vht_cap *vht_capa_mask) |
282 | { | 282 | { |
diff --git a/net/wireless/sme.c b/net/wireless/sme.c index d536b07582f8..1c93412038dc 100644 --- a/net/wireless/sme.c +++ b/net/wireless/sme.c | |||
@@ -1171,6 +1171,8 @@ int cfg80211_connect(struct cfg80211_registered_device *rdev, | |||
1171 | 1171 | ||
1172 | cfg80211_oper_and_ht_capa(&connect->ht_capa_mask, | 1172 | cfg80211_oper_and_ht_capa(&connect->ht_capa_mask, |
1173 | rdev->wiphy.ht_capa_mod_mask); | 1173 | rdev->wiphy.ht_capa_mod_mask); |
1174 | cfg80211_oper_and_vht_capa(&connect->vht_capa_mask, | ||
1175 | rdev->wiphy.vht_capa_mod_mask); | ||
1174 | 1176 | ||
1175 | if (connkeys && connkeys->def >= 0) { | 1177 | if (connkeys && connkeys->def >= 0) { |
1176 | int idx; | 1178 | int idx; |