1 From: John Crispin <john@phrozen.org>
2 Date: Tue, 29 Oct 2019 10:13:02 +0100
3 Subject: [PATCH] mac80211: move store skb ack code to its own function
5 This patch moves the code handling SKBTX_WIFI_STATUS inside the TX path
6 into an extra function. This allows us to reuse it inside the 802.11 encap
9 Signed-off-by: John Crispin <john@phrozen.org>
10 Link: https://lore.kernel.org/r/20191029091304.7330-2-john@phrozen.org
11 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
14 --- a/net/mac80211/tx.c
15 +++ b/net/mac80211/tx.c
16 @@ -2445,6 +2445,33 @@ static int ieee80211_lookup_ra_sta(struc
20 +static int ieee80211_store_ack_skb(struct ieee80211_local *local,
21 + struct sk_buff *skb,
24 + struct sk_buff *ack_skb = skb_clone_sk(skb);
28 + unsigned long flags;
31 + spin_lock_irqsave(&local->ack_status_lock, flags);
32 + id = idr_alloc(&local->ack_status_frames, ack_skb,
33 + 1, 0x10000, GFP_ATOMIC);
34 + spin_unlock_irqrestore(&local->ack_status_lock, flags);
38 + *info_flags |= IEEE80211_TX_CTL_REQ_TX_STATUS;
48 * ieee80211_build_hdr - build 802.11 header in the given frame
49 * @sdata: virtual interface to build the header for
50 @@ -2738,26 +2765,8 @@ static struct sk_buff *ieee80211_build_h
53 if (unlikely(!multicast && skb->sk &&
54 - skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS)) {
55 - struct sk_buff *ack_skb = skb_clone_sk(skb);
58 - unsigned long flags;
61 - spin_lock_irqsave(&local->ack_status_lock, flags);
62 - id = idr_alloc(&local->ack_status_frames, ack_skb,
63 - 1, 0x10000, GFP_ATOMIC);
64 - spin_unlock_irqrestore(&local->ack_status_lock, flags);
68 - info_flags |= IEEE80211_TX_CTL_REQ_TX_STATUS;
74 + skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS))
75 + info_id = ieee80211_store_ack_skb(local, skb, &info_flags);
78 * If the skb is shared we need to obtain our own copy.