]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: mac80211: export ieee80211_purge_tx_queue() for drivers
authorPing-Ke Shih <pkshih@realtek.com>
Thu, 22 Aug 2024 01:42:54 +0000 (09:42 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 27 Aug 2024 08:28:55 +0000 (10:28 +0200)
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>
include/net/mac80211.h
net/mac80211/ieee80211_i.h
net/mac80211/status.c

index cfd64acdc0397eea8e3dbfc570b95381a3bfa50d..adfec877f392ad9473371f257adb722143610cc8 100644 (file)
@@ -3181,6 +3181,19 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
  */
 void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb);
 
+/**
+ * ieee80211_purge_tx_queue - purge TX skb queue
+ * @hw: the hardware
+ * @skbs: the skbs
+ *
+ * Free a set of transmit skbs. Use this function when device is going to stop
+ * but some transmit skbs without TX status are still queued.
+ * This function does not take the list lock and the caller must hold the
+ * relevant locks to use it.
+ */
+void ieee80211_purge_tx_queue(struct ieee80211_hw *hw,
+                             struct sk_buff_head *skbs);
+
 /**
  * DOC: Hardware crypto acceleration
  *
index fdd2bad15076db1d18ebebbdc52f6c5f60176990..6305c4e9cca176118e60539ce78c471112807162 100644 (file)
@@ -2072,8 +2072,6 @@ void __ieee80211_subif_start_xmit(struct sk_buff *skb,
                                  u32 info_flags,
                                  u32 ctrl_flags,
                                  u64 *cookie);
-void ieee80211_purge_tx_queue(struct ieee80211_hw *hw,
-                             struct sk_buff_head *skbs);
 struct sk_buff *
 ieee80211_build_data_template(struct ieee80211_sub_if_data *sdata,
                              struct sk_buff *skb, u32 info_flags);
index dd8f857a1fbcde8fe3d02e5cc23b3b49a5132dd2..d1cf987de13bb016f202c4f88b91a0140f9fc158 100644 (file)
@@ -1301,3 +1301,4 @@ void ieee80211_purge_tx_queue(struct ieee80211_hw *hw,
        while ((skb = __skb_dequeue(skbs)))
                ieee80211_free_txskb(hw, skb);
 }
+EXPORT_SYMBOL(ieee80211_purge_tx_queue);