From: Jouni Malinen Date: Mon, 15 Dec 2008 14:02:04 +0000 (+0200) Subject: ath9k: Remove MAC header pad before reporting TX status X-Git-Tag: firefly_0821_release~16481^2~105^2~27 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f7a276a625e0b980185d2eb8e8e3e9425a708bee;p=firefly-linux-kernel-4.4.55.git ath9k: Remove MAC header pad before reporting TX status Remove the possible MAC header pad before reporting TX status to mac80211. This pad is hardware specific operation and should not be exposed outside the driver. This fixes the frame body in monitor interfaces that could be used to check on TX status for transmitted frames. Signed-off-by: Jouni Malinen Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/ath9k/xmit.c b/drivers/net/wireless/ath9k/xmit.c index d6d402c18934..3bfc3b90f256 100644 --- a/drivers/net/wireless/ath9k/xmit.c +++ b/drivers/net/wireless/ath9k/xmit.c @@ -106,6 +106,7 @@ static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb, struct ieee80211_hw *hw = sc->hw; struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); struct ath_tx_info_priv *tx_info_priv = ATH_TX_INFO_PRIV(tx_info); + int hdrlen, padsize; DPRINTF(sc, ATH_DBG_XMIT, "TX complete: skb: %p\n", skb); @@ -135,6 +136,17 @@ static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb, rate_table->info[idx].ratecode & 0x7f; } + hdrlen = ieee80211_get_hdrlen_from_skb(skb); + padsize = hdrlen & 3; + if (padsize && hdrlen >= 24) { + /* + * Remove MAC header padding before giving the frame back to + * mac80211. + */ + memmove(skb->data + padsize, skb->data, hdrlen); + skb_pull(skb, padsize); + } + ieee80211_tx_status(hw, skb); }