Skip to contentSkip to conversation

ath5k: compute rts/cts duration after computing full pktlen

PATCH New Bob Copeland 1 participant 1 message Feb 15, 2009 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 4/4 ath5k: compute rts/cts duration after computing full pktlen

RTS and CTS-to-self duration needs to go after ICV len is considered.

Changes-licensed-under: 3-Clause-BSD

---
 drivers/net/wireless/ath5k/base.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
drivers/net/wireless/ath5k/base.c +4 -5
index fa6a216..bce825b 100644
@@ -1220,6 +1220,10 @@ ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf)
 
 	pktlen = skb->len;
 
+	if (info->control.hw_key) {
+		keyidx = info->control.hw_key->hw_key_idx;
+		pktlen += info->control.hw_key->icv_len;
+	}
 	if (rc_flags & IEEE80211_TX_RC_USE_RTS_CTS) {
 		flags |= AR5K_TXDESC_RTSENA;
 		cts_rate = ieee80211_get_rts_cts_rate(sc->hw, info)->hw_value;
@@ -1232,11 +1236,6 @@ ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf)
 		duration = le16_to_cpu(ieee80211_ctstoself_duration(sc->hw,
 			sc->vif, pktlen, info));
 	}
-
-	if (info->control.hw_key) {
-		keyidx = info->control.hw_key->hw_key_idx;
-		pktlen += info->control.hw_key->icv_len;
-	}
 	ret = ah->ah_setup_tx_desc(ah, ds, pktlen,
 		ieee80211_get_hdrlen_from_skb(skb), AR5K_PKT_TYPE_NORMAL,
 		(sc->power_level * 2),
Signature · 1 line
1.6.0.6