Skip to content

Commit 54a714a

Browse files
Ping-Ke Shihsmb49
authored andcommitted
wifi: mac80211: export ieee80211_purge_tx_queue() for drivers
BugLink: https://bugs.launchpad.net/bugs/2102118 [ Upstream commit 53bc1b7 ] Drivers need to purge TX SKB when stopping. Using skb_queue_purge() can't report TX status to mac80211, causing ieee80211_free_ack_frame() warns "Have pending ack frames!". Export ieee80211_purge_tx_queue() for drivers to not have to reimplement it. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20240822014255.10211-1-pkshih@realtek.com Signed-off-by: Johannes Berg <johannes.berg@intel.com> Stable-dep-of: 3e5e4a8 ("wifi: rtw88: use ieee80211_purge_tx_queue() to purge TX skb") Signed-off-by: Sasha Levin <sashal@kernel.org> (cherry picked from commit 24b5898a8c73126c7ada3f1e5235a33af5b67460 linux-6.6.y) [koichiroden: from v6.6.70, prerequisite for the next commit] Signed-off-by: Koichiro Den <koichiro.den@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent 233a419 commit 54a714a

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

include/net/mac80211.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3050,6 +3050,19 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
30503050
*/
30513051
void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb);
30523052

3053+
/**
3054+
* ieee80211_purge_tx_queue - purge TX skb queue
3055+
* @hw: the hardware
3056+
* @skbs: the skbs
3057+
*
3058+
* Free a set of transmit skbs. Use this function when device is going to stop
3059+
* but some transmit skbs without TX status are still queued.
3060+
* This function does not take the list lock and the caller must hold the
3061+
* relevant locks to use it.
3062+
*/
3063+
void ieee80211_purge_tx_queue(struct ieee80211_hw *hw,
3064+
struct sk_buff_head *skbs);
3065+
30533066
/**
30543067
* DOC: Hardware crypto acceleration
30553068
*

net/mac80211/ieee80211_i.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2026,8 +2026,6 @@ void __ieee80211_subif_start_xmit(struct sk_buff *skb,
20262026
u32 info_flags,
20272027
u32 ctrl_flags,
20282028
u64 *cookie);
2029-
void ieee80211_purge_tx_queue(struct ieee80211_hw *hw,
2030-
struct sk_buff_head *skbs);
20312029
struct sk_buff *
20322030
ieee80211_build_data_template(struct ieee80211_sub_if_data *sdata,
20332031
struct sk_buff *skb, u32 info_flags);

net/mac80211/status.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,3 +1281,4 @@ void ieee80211_purge_tx_queue(struct ieee80211_hw *hw,
12811281
while ((skb = __skb_dequeue(skbs)))
12821282
ieee80211_free_txskb(hw, skb);
12831283
}
1284+
EXPORT_SYMBOL(ieee80211_purge_tx_queue);

0 commit comments

Comments
 (0)