Skip to content

Commit

Permalink
mac80211: add BSS coex IE to TDLS setup frames
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arik Nemtsov authored and Johannes Berg committed Nov 19, 2014
1 parent f0d29cb commit 2cedd87
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/linux/ieee80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -2037,6 +2037,9 @@ enum ieee80211_tdls_actioncode {
/* TDLS specific payload type in the LLC/SNAP header */
#define WLAN_TDLS_SNAP_RFTYPE 0x2

/* BSS Coex IE information field bits */
#define WLAN_BSS_COEX_INFORMATION_REQUEST BIT(0)

/**
* enum - mesh synchronization method identifier
*
Expand Down
15 changes: 15 additions & 0 deletions net/mac80211/tdls.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,16 @@ ieee80211_tdls_add_supp_channels(struct ieee80211_sub_if_data *sdata,
*pos = 2 * subband_cnt;
}

static void ieee80211_tdls_add_bss_coex_ie(struct sk_buff *skb)
{
u8 *pos = (void *)skb_put(skb, 3);

*pos++ = WLAN_EID_BSS_COEX_2040;
*pos++ = 1; /* len */

*pos++ = WLAN_BSS_COEX_INFORMATION_REQUEST;
}

static u16 ieee80211_get_tdls_sta_capab(struct ieee80211_sub_if_data *sdata,
u16 status_code)
{
Expand Down Expand Up @@ -341,6 +351,10 @@ ieee80211_tdls_add_setup_start_ies(struct ieee80211_sub_if_data *sdata,

rcu_read_unlock();

if (ht_cap.ht_supported &&
(ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40))
ieee80211_tdls_add_bss_coex_ie(skb);

/* add any remaining IEs */
if (extra_ies_len) {
noffset = extra_ies_len;
Expand Down Expand Up @@ -597,6 +611,7 @@ ieee80211_tdls_prep_mgmt_packet(struct wiphy *wiphy, struct net_device *dev,
2 + max(sizeof(struct ieee80211_ht_cap),
sizeof(struct ieee80211_ht_operation)) +
50 + /* supported channels */
3 + /* 40/20 BSS coex */
extra_ies_len +
sizeof(struct ieee80211_tdls_lnkie));
if (!skb)
Expand Down

0 comments on commit 2cedd87

Please sign in to comment.