aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/work.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/work.c')
-rw-r--r--net/mac80211/work.c46
1 files changed, 4 insertions, 42 deletions
diff --git a/net/mac80211/work.c b/net/mac80211/work.c
index 6c53b6d1002..3dd5a89e99a 100644
--- a/net/mac80211/work.c
+++ b/net/mac80211/work.c
@@ -103,7 +103,6 @@ static void ieee80211_add_ht_ie(struct sk_buff *skb, const u8 *ht_info_ie,
103 u8 *pos; 103 u8 *pos;
104 u32 flags = channel->flags; 104 u32 flags = channel->flags;
105 u16 cap = sband->ht_cap.cap; 105 u16 cap = sband->ht_cap.cap;
106 __le16 tmp;
107 106
108 if (!sband->ht_cap.ht_supported) 107 if (!sband->ht_cap.ht_supported)
109 return; 108 return;
@@ -154,34 +153,8 @@ static void ieee80211_add_ht_ie(struct sk_buff *skb, const u8 *ht_info_ie,
154 } 153 }
155 154
156 /* reserve and fill IE */ 155 /* reserve and fill IE */
157
158 pos = skb_put(skb, sizeof(struct ieee80211_ht_cap) + 2); 156 pos = skb_put(skb, sizeof(struct ieee80211_ht_cap) + 2);
159 *pos++ = WLAN_EID_HT_CAPABILITY; 157 ieee80211_ie_build_ht_cap(pos, sband, cap);
160 *pos++ = sizeof(struct ieee80211_ht_cap);
161 memset(pos, 0, sizeof(struct ieee80211_ht_cap));
162
163 /* capability flags */
164 tmp = cpu_to_le16(cap);
165 memcpy(pos, &tmp, sizeof(u16));
166 pos += sizeof(u16);
167
168 /* AMPDU parameters */
169 *pos++ = sband->ht_cap.ampdu_factor |
170 (sband->ht_cap.ampdu_density <<
171 IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT);
172
173 /* MCS set */
174 memcpy(pos, &sband->ht_cap.mcs, sizeof(sband->ht_cap.mcs));
175 pos += sizeof(sband->ht_cap.mcs);
176
177 /* extended capabilities */
178 pos += sizeof(__le16);
179
180 /* BF capabilities */
181 pos += sizeof(__le32);
182
183 /* antenna selection */
184 pos += sizeof(u8);
185} 158}
186 159
187static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata, 160static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata,
@@ -969,10 +942,9 @@ static void ieee80211_work_work(struct work_struct *work)
969 } 942 }
970 943
971 if (!started && !local->tmp_channel) { 944 if (!started && !local->tmp_channel) {
972 bool on_oper_chan; 945 bool on_oper_chan, on_oper_chan2;
973 bool tmp_chan_changed = false;
974 bool on_oper_chan2;
975 enum nl80211_channel_type wk_ct; 946 enum nl80211_channel_type wk_ct;
947
976 on_oper_chan = ieee80211_cfg_on_oper_channel(local); 948 on_oper_chan = ieee80211_cfg_on_oper_channel(local);
977 949
978 /* Work with existing channel type if possible. */ 950 /* Work with existing channel type if possible. */
@@ -981,11 +953,6 @@ static void ieee80211_work_work(struct work_struct *work)
981 wk_ct = ieee80211_calc_ct(wk->chan_type, 953 wk_ct = ieee80211_calc_ct(wk->chan_type,
982 local->hw.conf.channel_type); 954 local->hw.conf.channel_type);
983 955
984 if (local->tmp_channel)
985 if ((local->tmp_channel != wk->chan) ||
986 (local->tmp_channel_type != wk_ct))
987 tmp_chan_changed = true;
988
989 local->tmp_channel = wk->chan; 956 local->tmp_channel = wk->chan;
990 local->tmp_channel_type = wk_ct; 957 local->tmp_channel_type = wk_ct;
991 /* 958 /*
@@ -1008,12 +975,7 @@ static void ieee80211_work_work(struct work_struct *work)
1008 true, 975 true,
1009 false); 976 false);
1010 } 977 }
1011 } else if (tmp_chan_changed) 978 }
1012 /* Still off-channel, but on some other
1013 * channel, so update hardware.
1014 * PS should already be off-channel.
1015 */
1016 ieee80211_hw_config(local, 0);
1017 979
1018 started = true; 980 started = true;
1019 wk->timeout = jiffies; 981 wk->timeout = jiffies;