diff mbox

[v2] ath5k: fix injection in monitor mode

Message ID 20100302025158.9527.43764.stgit@void (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Bruno Randolf March 2, 2010, 2:51 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index a078f1e..ced13fd 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1285,6 +1285,7 @@  ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf,
 	u16 cts_rate = 0;
 	u16 duration = 0;
 	u8 rc_flags;
+	enum ath5k_pkt_type pkt_type;
 
 	flags = AR5K_TXDESC_INTREQ | AR5K_TXDESC_CLRDMASK;
 
@@ -1322,9 +1323,17 @@  ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf,
 		duration = le16_to_cpu(ieee80211_ctstoself_duration(sc->hw,
 			sc->vif, pktlen, info));
 	}
+
+	/* we don't want the hardware to mess with injected frames in monitor
+	 * mode (e.g. update TSF in beacons) */
+	if (info->flags & IEEE80211_TX_CTL_INJECTED)
+		pkt_type = AR5K_PKT_TYPE_NORMAL;
+	else
+		pkt_type = get_hw_packet_type(skb);
+
 	ret = ah->ah_setup_tx_desc(ah, ds, pktlen,
 		ieee80211_get_hdrlen_from_skb(skb),
-		get_hw_packet_type(skb),
+		pkt_type,
 		(sc->power_level * 2),
 		hw_rate,
 		info->control.rates[0].count, keyidx, ah->ah_tx_ant, flags,