summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/ar5523/ar5523.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2015-03-10 15:25:39 +0100
committerKalle Valo <kvalo@codeaurora.org>2015-03-13 16:07:00 +0200
commit6faf22d9cabeec6f8f623d58a2e88ca9edf4c946 (patch)
tree04a0f5013d70b84ae2572a4e0238facab4742240 /drivers/net/wireless/ath/ar5523/ar5523.c
parentdd2951124838843809f75117d17c32d053ee3262 (diff)
ar5523: use container_of
If we want to shrink skb->cb then we'd have to see about reducing struct ieee80211_tx_info, which gets embedded inside skb->cb[]. It provides a scratch space to be used by wireless drivers. ar5523 uses the maximum space available today (40 bytes), but it seems we don't need this -- data->skb pointer seems to always point back to the skb whose cb buffer the data structure resides, iow, given a pointer to the embedded control buffer we can infer the skb address. Tested-by: Pontus Fuchs <pontus.fuchs@gmail.com> Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ath/ar5523/ar5523.c')
-rw-r--r--drivers/net/wireless/ath/ar5523/ar5523.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/ar5523/ar5523.c b/drivers/net/wireless/ath/ar5523/ar5523.c
index f92050617ae6..5147ebe4cd05 100644
--- a/drivers/net/wireless/ath/ar5523/ar5523.c
+++ b/drivers/net/wireless/ath/ar5523/ar5523.c
@@ -779,8 +779,6 @@ static void ar5523_tx(struct ieee80211_hw *hw,
ieee80211_stop_queues(hw);
}
- data->skb = skb;
-
spin_lock_irqsave(&ar->tx_data_list_lock, flags);
list_add_tail(&data->list, &ar->tx_queue_pending);
spin_unlock_irqrestore(&ar->tx_data_list_lock, flags);
@@ -817,10 +815,13 @@ static void ar5523_tx_work_locked(struct ar5523 *ar)
if (!data)
break;
- skb = data->skb;
+ txi = container_of((void *)data, struct ieee80211_tx_info,
+ driver_data);
txqid = 0;
- txi = IEEE80211_SKB_CB(skb);
+
+ skb = container_of((void *)txi, struct sk_buff, cb);
paylen = skb->len;
+
urb = usb_alloc_urb(0, GFP_KERNEL);
if (!urb) {
ar5523_err(ar, "Failed to allocate TX urb\n");