aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2014-11-09 11:50:13 -0500
committerJohannes Berg <johannes.berg@intel.com>2014-11-19 12:44:52 -0500
commit2cedd87960a809dd9bf683f72123b7dce6736f07 (patch)
treebe5b9d6c585b0ebd0e4fabfe78f1267bf77f8b8f /net/mac80211
parentf0d29cb979567f13c8db371940c5911a9025f081 (diff)
mac80211: add BSS coex IE to TDLS setup frames
Add the BSS coex IE in case we support HT40 channels, as mandated by section 8.5.13 in IEEE802.11 2012. Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/tdls.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c
index 8fb314b182e2..30a4c1004010 100644
--- a/net/mac80211/tdls.c
+++ b/net/mac80211/tdls.c
@@ -117,6 +117,16 @@ ieee80211_tdls_add_supp_channels(struct ieee80211_sub_if_data *sdata,
117 *pos = 2 * subband_cnt; 117 *pos = 2 * subband_cnt;
118} 118}
119 119
120static void ieee80211_tdls_add_bss_coex_ie(struct sk_buff *skb)
121{
122 u8 *pos = (void *)skb_put(skb, 3);
123
124 *pos++ = WLAN_EID_BSS_COEX_2040;
125 *pos++ = 1; /* len */
126
127 *pos++ = WLAN_BSS_COEX_INFORMATION_REQUEST;
128}
129
120static u16 ieee80211_get_tdls_sta_capab(struct ieee80211_sub_if_data *sdata, 130static u16 ieee80211_get_tdls_sta_capab(struct ieee80211_sub_if_data *sdata,
121 u16 status_code) 131 u16 status_code)
122{ 132{
@@ -341,6 +351,10 @@ ieee80211_tdls_add_setup_start_ies(struct ieee80211_sub_if_data *sdata,
341 351
342 rcu_read_unlock(); 352 rcu_read_unlock();
343 353
354 if (ht_cap.ht_supported &&
355 (ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40))
356 ieee80211_tdls_add_bss_coex_ie(skb);
357
344 /* add any remaining IEs */ 358 /* add any remaining IEs */
345 if (extra_ies_len) { 359 if (extra_ies_len) {
346 noffset = extra_ies_len; 360 noffset = extra_ies_len;
@@ -597,6 +611,7 @@ ieee80211_tdls_prep_mgmt_packet(struct wiphy *wiphy, struct net_device *dev,
597 2 + max(sizeof(struct ieee80211_ht_cap), 611 2 + max(sizeof(struct ieee80211_ht_cap),
598 sizeof(struct ieee80211_ht_operation)) + 612 sizeof(struct ieee80211_ht_operation)) +
599 50 + /* supported channels */ 613 50 + /* supported channels */
614 3 + /* 40/20 BSS coex */
600 extra_ies_len + 615 extra_ies_len +
601 sizeof(struct ieee80211_tdls_lnkie)); 616 sizeof(struct ieee80211_tdls_lnkie));
602 if (!skb) 617 if (!skb)