From: Johannes Berg Date: Fri, 4 Nov 2011 10:18:10 +0000 (+0100) Subject: mac80211: add helper to free TX skb X-Git-Tag: v3.3-rc1~182^2~545^2~112 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=6096de7fd4eeda305e114e7d74e6f47404590425;p=~emulex%2Finfiniband.git mac80211: add helper to free TX skb Drivers that need to drop a frame before it can be transmitted will usually simply free that frame. This is currently fine, but in the future it'll be needed to tell mac80211 about this case, so add a new routine that frees a TX skb. Signed-off-by: Johannes Berg Signed-off-by: John W. Linville --- diff --git a/include/net/mac80211.h b/include/net/mac80211.h index eddf49202c5..b9b9c945213 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -1308,6 +1308,16 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw, return &hw->wiphy->bands[c->band]->bitrates[c->control.rates[idx + 1].idx]; } +/** + * ieee80211_free_txskb - free TX skb + * @hw: the hardware + * @skb: the skb + * + * Free a transmit skb. Use this funtion when some failure + * to transmit happened and thus status cannot be reported. + */ +void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb); + /** * DOC: Hardware crypto acceleration * diff --git a/net/mac80211/status.c b/net/mac80211/status.c index df643cedf9b..e1f69545974 100644 --- a/net/mac80211/status.c +++ b/net/mac80211/status.c @@ -609,3 +609,9 @@ void ieee80211_report_low_ack(struct ieee80211_sta *pubsta, u32 num_packets) num_packets, GFP_ATOMIC); } EXPORT_SYMBOL(ieee80211_report_low_ack); + +void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb) +{ + dev_kfree_skb_any(skb); +} +EXPORT_SYMBOL(ieee80211_free_txskb);