On Mon, 2024-08-19 at 14:58 +0800, Ping-Ke Shih wrote: > Drivers need to purge TX SKB when stopping. Use skb_queue_purge() can't "Using"? > report TX status to mac80211, causing ieee80211_free_ack_frame() warns > "Have pending ack frames!". Should say what you do - i.e. "Export ... to not have to reimplement it" or so? > +/** > + * 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. > + */ > +void ieee80211_purge_tx_queue(struct ieee80211_hw *hw, > + struct sk_buff_head *skbs); Unlike skb_queue_purge()/skb_queue_purge_reason(), this doesn't take the lock, that seems important to note here? > +++ b/net/mac80211/status.c > @@ -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); see the context here. johannes