Skip to content

Commit 24b5898

Browse files
Ping-Ke Shihgregkh
authored andcommitted
wifi: mac80211: export ieee80211_purge_tx_queue() for drivers
[ 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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Johannes Berg <[email protected]> Stable-dep-of: 3e5e4a8 ("wifi: rtw88: use ieee80211_purge_tx_queue() to purge TX skb") Signed-off-by: Sasha Levin <[email protected]>
1 parent ed01e57 commit 24b5898

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
@@ -3039,6 +3039,19 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
30393039
*/
30403040
void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb);
30413041

3042+
/**
3043+
* ieee80211_purge_tx_queue - purge TX skb queue
3044+
* @hw: the hardware
3045+
* @skbs: the skbs
3046+
*
3047+
* Free a set of transmit skbs. Use this function when device is going to stop
3048+
* but some transmit skbs without TX status are still queued.
3049+
* This function does not take the list lock and the caller must hold the
3050+
* relevant locks to use it.
3051+
*/
3052+
void ieee80211_purge_tx_queue(struct ieee80211_hw *hw,
3053+
struct sk_buff_head *skbs);
3054+
30423055
/**
30433056
* DOC: Hardware crypto acceleration
30443057
*

net/mac80211/ieee80211_i.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2057,8 +2057,6 @@ void __ieee80211_subif_start_xmit(struct sk_buff *skb,
20572057
u32 info_flags,
20582058
u32 ctrl_flags,
20592059
u64 *cookie);
2060-
void ieee80211_purge_tx_queue(struct ieee80211_hw *hw,
2061-
struct sk_buff_head *skbs);
20622060
struct sk_buff *
20632061
ieee80211_build_data_template(struct ieee80211_sub_if_data *sdata,
20642062
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
@@ -1270,3 +1270,4 @@ void ieee80211_purge_tx_queue(struct ieee80211_hw *hw,
12701270
while ((skb = __skb_dequeue(skbs)))
12711271
ieee80211_free_txskb(hw, skb);
12721272
}
1273+
EXPORT_SYMBOL(ieee80211_purge_tx_queue);

0 commit comments

Comments
 (0)