Skip to contentSkip to conversation

ath5k: Extend rate_duration

PATCH In review Nick Kossifidis 1 participant 1 message Nov 23, 2010 Atheros ATH5K wireless driver

lore
Share & tools
lore

Nick Kossifidis

author maintainer
#0 lore raw

PATCH 15/30 ath5k: Extend rate_duration

* Extend ieee80211_generic_frame_duration to support the various bwmodes.

* Better document what's going on with ack bitrates and update write_rate_duration to support the standard ack bitrates (when we don't set the high bit).

* Get rid of set_ack_bitrate_high and introduce a flag on ath5k_hw for this (we only called the function on init anyway so there is no difference).

---
 drivers/net/wireless/ath/ath5k/ath5k.h |   12 ++-
 drivers/net/wireless/ath/ath5k/base.c  |    4 +-
 drivers/net/wireless/ath/ath5k/pcu.c   |  159 +++++++++++++++++++++++---------
 3 files changed, 129 insertions(+), 46 deletions(-)
drivers/net/wireless/ath/ath5k/ath5k.h +10 -2
index e11fc8f..7df5b46 100644
@@ -267,6 +267,15 @@
 #define	AR5K_INIT_SIFS_HALF_RATE		32
 #define AR5K_INIT_SIFS_QUARTER_RATE		64
 
+/* Used to calculate tx time for non 5/10/40MHz
+ * operation */
+/* It's preamble time + signal time (16 + 4) */
+#define	AR5K_INIT_OFDM_PREAMPLE_TIME		20
+/* Preamble time for 40MHz (turbo) operation (min ?) */
+#define	AR5K_INIT_OFDM_PREAMBLE_TIME_MIN	14
+#define	AR5K_INIT_OFDM_SYMBOL_TIME		4
+#define	AR5K_INIT_OFDM_PLCP_BITS		22
+
 /* Rx latency for 5 and 10MHz operation (max ?) */
 #define AR5K_INIT_RX_LAT_MAX			63
 /* Tx latencies from initvals (5212 only but no problem
@@ -1083,6 +1092,7 @@ struct ath5k_hw {
 
 	u32			ah_limit_tx_retries;
 	u8			ah_coverage_class;
+	bool			ah_ack_bitrate_high;
 	u8			ah_bwmode;
 
 	/* Antenna Control */
@@ -1248,8 +1258,6 @@ void ath5k_hw_set_tsf64(struct ath5k_hw *ah, u64 tsf64);
 void ath5k_hw_reset_tsf(struct ath5k_hw *ah);
 void ath5k_hw_init_beacon(struct ath5k_hw *ah, u32 next_beacon, u32 interval);
 bool ath5k_hw_check_beacon_timers(struct ath5k_hw *ah, int intval);
-/* ACK bit rate */
-void ath5k_hw_set_ack_bitrate_high(struct ath5k_hw *ah, bool high);
 /* Init function */
 void ath5k_hw_pcu_init(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
 								u8 mode);
drivers/net/wireless/ath/ath5k/base.c +3 -1
index 9af7e46..526d8bc 100644
@@ -2420,7 +2420,9 @@ ath5k_init(struct ath5k_softc *sc)
 	for (i = 0; i < common->keymax; i++)
 		ath_hw_keyreset(common, (u16) i);
 
-	ath5k_hw_set_ack_bitrate_high(ah, true);
+	/* Use higher rates for acks instead of base
+	 * rate */
+	ah->ah_ack_bitrate_high = true;
 
 	for (i = 0; i < ARRAY_SIZE(sc->bslot); i++)
 		sc->bslot[i] = NULL;
drivers/net/wireless/ath/ath5k/pcu.c +116 -43

220 lines not on this page · raw message