Skip to contentSkip to conversation

ath9k: Remove MAC header pad before reporting TX status

PATCH New Jouni Malinen 1 participant 1 message Dec 15, 2008 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/net/wireless/ath9k/xmit.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

(the context in the patch depends on the previous ath9k: Fix TX status reporting for retries and MCS index patch, but other than that, this is an independent change)

drivers/net/wireless/ath9k/xmit.c +12 -0
@@ -106,6 +106,7 @@ static void ath_tx_complete(struct ath_s
 	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_s
 				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);
 }
 
Signature · 1 line
Jouni Malinen                                            PGP id EFC895FA