summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorEyal Shapira <eyal@wizery.com>2014-01-08 15:49:08 +0200
committerJohannes Berg <johannes.berg@intel.com>2014-02-04 21:48:20 +0100
commitc1cf6d4e6f17406c4fd7b0f4fae779fa61666cc3 (patch)
treead4a6e001e3115b8b46bb19e99263d5afe546833 /net
parentc4d2ffac330fd013944654f11cdfc06ff5ca9bf4 (diff)
mac80211: advertise BF STS according to AP support
Restrict our published beamformee STS capability according to the AP value. Some AP show bad behaviour in interoperability testing when our capabilities are better. Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/mlme.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index fc1d82465b3c..cadf05905e5a 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -508,6 +508,7 @@ static void ieee80211_add_vht_ie(struct ieee80211_sub_if_data *sdata,
u8 *pos;
u32 cap;
struct ieee80211_sta_vht_cap vht_cap;
+ u32 mask, ap_bf_sts, our_bf_sts;
BUILD_BUG_ON(sizeof(vht_cap) != sizeof(sband->vht_cap));
@@ -535,6 +536,16 @@ static void ieee80211_add_vht_ie(struct ieee80211_sub_if_data *sdata,
cpu_to_le32(IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE)))
cap &= ~IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE;
+ mask = IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK;
+
+ ap_bf_sts = le32_to_cpu(ap_vht_cap->vht_cap_info) & mask;
+ our_bf_sts = cap & mask;
+
+ if (ap_bf_sts < our_bf_sts) {
+ cap &= ~mask;
+ cap |= ap_bf_sts;
+ }
+
/* reserve and fill IE */
pos = skb_put(skb, sizeof(struct ieee80211_vht_cap) + 2);
ieee80211_ie_build_vht_cap(pos, &vht_cap, cap);