summaryrefslogtreecommitdiffstats
path: root/net/mac80211/tx.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-03-07 14:54:29 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-03-25 09:42:41 -0400
commitc3ffeab4345830aadfc78444933754330f1339e7 (patch)
treea7939d86dfd0e4fb4519fa6b15b7f6a6325becb3 /net/mac80211/tx.c
parent1852d40eaba36fe1e97e0e497ffce291c99f5886 (diff)
mac80211: ibss: use beacon_data struct for beacon and probe response
Instead of having an SKB all the time, use a beacon_data struct with just the information required. This also allows removing a synchronize_rcu() and using kfree_rcu() instead. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/tx.c')
-rw-r--r--net/mac80211/tx.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 2a6ae8030bd9..4a83d8dea840 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2442,14 +2442,17 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
2442 } else if (sdata->vif.type == NL80211_IFTYPE_ADHOC) { 2442 } else if (sdata->vif.type == NL80211_IFTYPE_ADHOC) {
2443 struct ieee80211_if_ibss *ifibss = &sdata->u.ibss; 2443 struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
2444 struct ieee80211_hdr *hdr; 2444 struct ieee80211_hdr *hdr;
2445 struct sk_buff *presp = rcu_dereference(ifibss->presp); 2445 struct beacon_data *presp = rcu_dereference(ifibss->presp);
2446 2446
2447 if (!presp) 2447 if (!presp)
2448 goto out; 2448 goto out;
2449 2449
2450 skb = skb_copy(presp, GFP_ATOMIC); 2450 skb = dev_alloc_skb(local->tx_headroom + presp->head_len);
2451 if (!skb) 2451 if (!skb)
2452 goto out; 2452 goto out;
2453 skb_reserve(skb, local->tx_headroom);
2454 memcpy(skb_put(skb, presp->head_len), presp->head,
2455 presp->head_len);
2453 2456
2454 hdr = (struct ieee80211_hdr *) skb->data; 2457 hdr = (struct ieee80211_hdr *) skb->data;
2455 hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | 2458 hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |