diff options
author | Thomas Pedersen <thomas@cozybit.com> | 2011-10-26 17:47:27 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-11-08 15:54:33 -0500 |
commit | 176f36086e8a00bdf701dc6e4c5a8784ef6529df (patch) | |
tree | 808f70cf8db3eff72f66941516a3d39594ad6992 | |
parent | 42e7aa771196d8129d9deaee950b3177a443b8cf (diff) |
mac80211: add HT IEs to mesh frames
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: Ashok Nagarajan <anagar6@uic.edu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | net/mac80211/mesh.c | 43 | ||||
-rw-r--r-- | net/mac80211/mesh.h | 4 | ||||
-rw-r--r-- | net/mac80211/mesh_plink.c | 9 | ||||
-rw-r--r-- | net/mac80211/tx.c | 4 |
4 files changed, 60 insertions, 0 deletions
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index a7078fdba8ca..2dc76a962930 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c | |||
@@ -341,6 +341,49 @@ int mesh_add_ds_params_ie(struct sk_buff *skb, | |||
341 | return 0; | 341 | return 0; |
342 | } | 342 | } |
343 | 343 | ||
344 | int mesh_add_ht_cap_ie(struct sk_buff *skb, | ||
345 | struct ieee80211_sub_if_data *sdata) | ||
346 | { | ||
347 | struct ieee80211_local *local = sdata->local; | ||
348 | struct ieee80211_supported_band *sband; | ||
349 | u8 *pos; | ||
350 | |||
351 | sband = local->hw.wiphy->bands[local->oper_channel->band]; | ||
352 | if (!sband->ht_cap.ht_supported || | ||
353 | local->_oper_channel_type == NL80211_CHAN_NO_HT) | ||
354 | return 0; | ||
355 | |||
356 | if (skb_tailroom(skb) < 2 + sizeof(struct ieee80211_ht_cap)) | ||
357 | return -ENOMEM; | ||
358 | |||
359 | pos = skb_put(skb, 2 + sizeof(struct ieee80211_ht_cap)); | ||
360 | ieee80211_ie_build_ht_cap(pos, sband, sband->ht_cap.cap); | ||
361 | |||
362 | return 0; | ||
363 | } | ||
364 | |||
365 | int mesh_add_ht_info_ie(struct sk_buff *skb, | ||
366 | struct ieee80211_sub_if_data *sdata) | ||
367 | { | ||
368 | struct ieee80211_local *local = sdata->local; | ||
369 | struct ieee80211_channel *channel = local->oper_channel; | ||
370 | enum nl80211_channel_type channel_type = local->_oper_channel_type; | ||
371 | struct ieee80211_supported_band *sband = | ||
372 | local->hw.wiphy->bands[channel->band]; | ||
373 | struct ieee80211_sta_ht_cap *ht_cap = &sband->ht_cap; | ||
374 | u8 *pos; | ||
375 | |||
376 | if (!ht_cap->ht_supported || channel_type == NL80211_CHAN_NO_HT) | ||
377 | return 0; | ||
378 | |||
379 | if (skb_tailroom(skb) < 2 + sizeof(struct ieee80211_ht_info)) | ||
380 | return -ENOMEM; | ||
381 | |||
382 | pos = skb_put(skb, 2 + sizeof(struct ieee80211_ht_info)); | ||
383 | ieee80211_ie_build_ht_info(pos, ht_cap, channel, channel_type); | ||
384 | |||
385 | return 0; | ||
386 | } | ||
344 | static void ieee80211_mesh_path_timer(unsigned long data) | 387 | static void ieee80211_mesh_path_timer(unsigned long data) |
345 | { | 388 | { |
346 | struct ieee80211_sub_if_data *sdata = | 389 | struct ieee80211_sub_if_data *sdata = |
diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h index 8c00e2d1d636..0f2c4e69e217 100644 --- a/net/mac80211/mesh.h +++ b/net/mac80211/mesh.h | |||
@@ -212,6 +212,10 @@ int mesh_add_vendor_ies(struct sk_buff *skb, | |||
212 | struct ieee80211_sub_if_data *sdata); | 212 | struct ieee80211_sub_if_data *sdata); |
213 | int mesh_add_ds_params_ie(struct sk_buff *skb, | 213 | int mesh_add_ds_params_ie(struct sk_buff *skb, |
214 | struct ieee80211_sub_if_data *sdata); | 214 | struct ieee80211_sub_if_data *sdata); |
215 | int mesh_add_ht_cap_ie(struct sk_buff *skb, | ||
216 | struct ieee80211_sub_if_data *sdata); | ||
217 | int mesh_add_ht_info_ie(struct sk_buff *skb, | ||
218 | struct ieee80211_sub_if_data *sdata); | ||
215 | void mesh_rmc_free(struct ieee80211_sub_if_data *sdata); | 219 | void mesh_rmc_free(struct ieee80211_sub_if_data *sdata); |
216 | int mesh_rmc_init(struct ieee80211_sub_if_data *sdata); | 220 | int mesh_rmc_init(struct ieee80211_sub_if_data *sdata); |
217 | void ieee80211s_init(void); | 221 | void ieee80211s_init(void); |
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c index 351e48c9710c..986af8acc49e 100644 --- a/net/mac80211/mesh_plink.c +++ b/net/mac80211/mesh_plink.c | |||
@@ -169,6 +169,8 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata, | |||
169 | 2 + (IEEE80211_MAX_SUPP_RATES - 8) + | 169 | 2 + (IEEE80211_MAX_SUPP_RATES - 8) + |
170 | 2 + sdata->u.mesh.mesh_id_len + | 170 | 2 + sdata->u.mesh.mesh_id_len + |
171 | 2 + sizeof(struct ieee80211_meshconf_ie) + | 171 | 2 + sizeof(struct ieee80211_meshconf_ie) + |
172 | 2 + sizeof(struct ieee80211_ht_cap) + | ||
173 | 2 + sizeof(struct ieee80211_ht_info) + | ||
172 | 2 + 8 + /* peering IE */ | 174 | 2 + 8 + /* peering IE */ |
173 | sdata->u.mesh.ie_len); | 175 | sdata->u.mesh.ie_len); |
174 | if (!skb) | 176 | if (!skb) |
@@ -241,6 +243,13 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata, | |||
241 | memcpy(pos, &reason, 2); | 243 | memcpy(pos, &reason, 2); |
242 | pos += 2; | 244 | pos += 2; |
243 | } | 245 | } |
246 | |||
247 | if (action != WLAN_SP_MESH_PEERING_CLOSE) { | ||
248 | if (mesh_add_ht_cap_ie(skb, sdata) || | ||
249 | mesh_add_ht_info_ie(skb, sdata)) | ||
250 | return -1; | ||
251 | } | ||
252 | |||
244 | if (mesh_add_vendor_ies(skb, sdata)) | 253 | if (mesh_add_vendor_ies(skb, sdata)) |
245 | return -1; | 254 | return -1; |
246 | 255 | ||
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index f4dd339e7cdd..a543d26058db 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -2292,6 +2292,8 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw, | |||
2292 | 2 + 8 + /* supported rates */ | 2292 | 2 + 8 + /* supported rates */ |
2293 | 2 + 3 + /* DS params */ | 2293 | 2 + 3 + /* DS params */ |
2294 | 2 + (IEEE80211_MAX_SUPP_RATES - 8) + | 2294 | 2 + (IEEE80211_MAX_SUPP_RATES - 8) + |
2295 | 2 + sizeof(struct ieee80211_ht_cap) + | ||
2296 | 2 + sizeof(struct ieee80211_ht_info) + | ||
2295 | 2 + sdata->u.mesh.mesh_id_len + | 2297 | 2 + sdata->u.mesh.mesh_id_len + |
2296 | 2 + sizeof(struct ieee80211_meshconf_ie) + | 2298 | 2 + sizeof(struct ieee80211_meshconf_ie) + |
2297 | sdata->u.mesh.ie_len); | 2299 | sdata->u.mesh.ie_len); |
@@ -2319,6 +2321,8 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw, | |||
2319 | mesh_add_ds_params_ie(skb, sdata) || | 2321 | mesh_add_ds_params_ie(skb, sdata) || |
2320 | ieee80211_add_ext_srates_ie(&sdata->vif, skb) || | 2322 | ieee80211_add_ext_srates_ie(&sdata->vif, skb) || |
2321 | mesh_add_rsn_ie(skb, sdata) || | 2323 | mesh_add_rsn_ie(skb, sdata) || |
2324 | mesh_add_ht_cap_ie(skb, sdata) || | ||
2325 | mesh_add_ht_info_ie(skb, sdata) || | ||
2322 | mesh_add_meshid_ie(skb, sdata) || | 2326 | mesh_add_meshid_ie(skb, sdata) || |
2323 | mesh_add_meshconf_ie(skb, sdata) || | 2327 | mesh_add_meshconf_ie(skb, sdata) || |
2324 | mesh_add_vendor_ies(skb, sdata)) { | 2328 | mesh_add_vendor_ies(skb, sdata)) { |