aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/tdls.c
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2015-03-18 02:46:08 -0400
committerJohannes Berg <johannes.berg@intel.com>2015-03-30 04:26:36 -0400
commita38700dd486f3def34cef47d00e2d360a04a7bc8 (patch)
tree8f2deebf8c3c4b9079f844249f3c5201e989ae74 /net/mac80211/tdls.c
parent3a323d4e17dd5a84f6ad036e6f985d263ca973ed (diff)
cfg/mac80211: add regulatory classes IE during TDLS setup
Seems Broadcom TDLS peers (Nexus 5, Xperia Z3) refuse to allow TDLS connection when channel-switching is supported but the regulatory classes IE is missing from the setup request. Add a chandef to reg-class translation function to cfg80211 and use it to add the required IE during setup. For now add only the current regulatory class as supported - it is enough to resolve the compatibility issue. Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/tdls.c')
-rw-r--r--net/mac80211/tdls.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c
index bc7e4049896f..79ed59acf0d4 100644
--- a/net/mac80211/tdls.c
+++ b/net/mac80211/tdls.c
@@ -136,6 +136,24 @@ ieee80211_tdls_add_supp_channels(struct ieee80211_sub_if_data *sdata,
136 *pos = 2 * subband_cnt; 136 *pos = 2 * subband_cnt;
137} 137}
138 138
139static void ieee80211_tdls_add_oper_classes(struct ieee80211_sub_if_data *sdata,
140 struct sk_buff *skb)
141{
142 u8 *pos;
143 u8 op_class;
144
145 if (!ieee80211_chandef_to_operating_class(&sdata->vif.bss_conf.chandef,
146 &op_class))
147 return;
148
149 pos = skb_put(skb, 4);
150 *pos++ = WLAN_EID_SUPPORTED_REGULATORY_CLASSES;
151 *pos++ = 2; /* len */
152
153 *pos++ = op_class;
154 *pos++ = op_class; /* give current operating class as alternate too */
155}
156
139static void ieee80211_tdls_add_bss_coex_ie(struct sk_buff *skb) 157static void ieee80211_tdls_add_bss_coex_ie(struct sk_buff *skb)
140{ 158{
141 u8 *pos = (void *)skb_put(skb, 3); 159 u8 *pos = (void *)skb_put(skb, 3);
@@ -350,6 +368,8 @@ ieee80211_tdls_add_setup_start_ies(struct ieee80211_sub_if_data *sdata,
350 } 368 }
351 } 369 }
352 370
371 ieee80211_tdls_add_oper_classes(sdata, skb);
372
353 /* 373 /*
354 * with TDLS we can switch channels, and HT-caps are not necessarily 374 * with TDLS we can switch channels, and HT-caps are not necessarily
355 * the same on all bands. The specification limits the setup to a 375 * the same on all bands. The specification limits the setup to a
@@ -786,6 +806,7 @@ ieee80211_tdls_build_mgmt_packet_data(struct ieee80211_sub_if_data *sdata,
786 50 + /* supported channels */ 806 50 + /* supported channels */
787 3 + /* 40/20 BSS coex */ 807 3 + /* 40/20 BSS coex */
788 4 + /* AID */ 808 4 + /* AID */
809 4 + /* oper classes */
789 extra_ies_len + 810 extra_ies_len +
790 sizeof(struct ieee80211_tdls_lnkie)); 811 sizeof(struct ieee80211_tdls_lnkie));
791 if (!skb) 812 if (!skb)