aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mesh.c
diff options
context:
space:
mode:
authorThomas Pedersen <thomas@cozybit.com>2011-10-26 17:47:27 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-11-08 15:54:33 -0500
commit176f36086e8a00bdf701dc6e4c5a8784ef6529df (patch)
tree808f70cf8db3eff72f66941516a3d39594ad6992 /net/mac80211/mesh.c
parent42e7aa771196d8129d9deaee950b3177a443b8cf (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>
Diffstat (limited to 'net/mac80211/mesh.c')
-rw-r--r--net/mac80211/mesh.c43
1 files changed, 43 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
344int 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
365int 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}
344static void ieee80211_mesh_path_timer(unsigned long data) 387static void ieee80211_mesh_path_timer(unsigned long data)
345{ 388{
346 struct ieee80211_sub_if_data *sdata = 389 struct ieee80211_sub_if_data *sdata =