aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/mac80211/tdls.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c
index 159ebf1304b2..917088dfd696 100644
--- a/net/mac80211/tdls.c
+++ b/net/mac80211/tdls.c
@@ -68,17 +68,24 @@ ieee80211_tdls_add_subband(struct ieee80211_sub_if_data *sdata,
68 ch = ieee80211_get_channel(sdata->local->hw.wiphy, i); 68 ch = ieee80211_get_channel(sdata->local->hw.wiphy, i);
69 if (ch) { 69 if (ch) {
70 /* we will be active on the channel */ 70 /* we will be active on the channel */
71 u32 flags = IEEE80211_CHAN_DISABLED |
72 IEEE80211_CHAN_NO_IR;
73 cfg80211_chandef_create(&chandef, ch, 71 cfg80211_chandef_create(&chandef, ch,
74 NL80211_CHAN_HT20); 72 NL80211_CHAN_NO_HT);
75 if (cfg80211_chandef_usable(sdata->local->hw.wiphy, 73 if (cfg80211_reg_can_beacon(sdata->local->hw.wiphy,
76 &chandef, flags)) { 74 &chandef,
75 sdata->wdev.iftype)) {
77 ch_cnt++; 76 ch_cnt++;
77 /*
78 * check if the next channel is also part of
79 * this allowed range
80 */
78 continue; 81 continue;
79 } 82 }
80 } 83 }
81 84
85 /*
86 * we've reached the end of a range, with allowed channels
87 * found
88 */
82 if (ch_cnt) { 89 if (ch_cnt) {
83 u8 *pos = skb_put(skb, 2); 90 u8 *pos = skb_put(skb, 2);
84 *pos++ = ieee80211_frequency_to_channel(subband_start); 91 *pos++ = ieee80211_frequency_to_channel(subband_start);
@@ -89,6 +96,15 @@ ieee80211_tdls_add_subband(struct ieee80211_sub_if_data *sdata,
89 } 96 }
90 } 97 }
91 98
99 /* all channels in the requested range are allowed - add them here */
100 if (ch_cnt) {
101 u8 *pos = skb_put(skb, 2);
102 *pos++ = ieee80211_frequency_to_channel(subband_start);
103 *pos++ = ch_cnt;
104
105 subband_cnt++;
106 }
107
92 return subband_cnt; 108 return subband_cnt;
93} 109}
94 110