linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] ath5k: Use correct value for min_pwr and cur_pwr
@ 2012-07-28 14:32 Nick Kossifidis
  2012-07-28 14:32 ` [PATCH 2/4] ath5k: Fix range scaling when setting rate power table Nick Kossifidis
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Nick Kossifidis @ 2012-07-28 14:32 UTC (permalink / raw)
  To: ath5k-devel, linux-wireless
  Cc: linville, mcgrof, jirislaby, thomas, nbd, Nick Kossifidis

Make sure we don't store the table offsets for min and cur power levels,
store the 0.25dB values instead. This way we don't clamp the tx power level
to max (because now cur_pwr holds the 0.25dB value, not the table offset) after
re-using cur_pwr on reset.

Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
---
 drivers/net/wireless/ath/ath5k/phy.c |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c
index 8b71a2d..aa1a77d 100644
--- a/drivers/net/wireless/ath/ath5k/phy.c
+++ b/drivers/net/wireless/ath/ath5k/phy.c
@@ -3562,6 +3562,20 @@ ath5k_setup_rate_powertable(struct ath5k_hw *ah, u16 max_pwr,
 		for (i = 8; i <= 15; i++)
 			rates[i] -= ah->ah_txpower.txp_cck_ofdm_gainf_delta;
 
+	/* Save min/max and current tx power for this channel
+	 * in 0.25dB units.
+	 *
+	 * Note: We use rates[0] for current tx power because
+	 * it covers most of the rates, in most cases. It's our
+	 * tx power limit and what the user expects to see. */
+	ah->ah_txpower.txp_min_pwr = 2 * rates[7];
+	ah->ah_txpower.txp_cur_pwr = 2 * rates[0];
+
+	/* Set max txpower for correct OFDM operation on all rates
+	 * -that is the txpower for 54Mbit-, it's used for the PAPD
+	 * gain probe and it's in 0.5dB units */
+	ah->ah_txpower.txp_ofdm = rates[7];
+
 	/* Now that we have all rates setup use table offset to
 	 * match the power range set by user with the power indices
 	 * on PCDAC/PDADC table */
@@ -3571,11 +3585,6 @@ ath5k_setup_rate_powertable(struct ath5k_hw *ah, u16 max_pwr,
 		if (rates[i] > 63)
 			rates[i] = 63;
 	}
-
-	/* Min/max in 0.25dB units */
-	ah->ah_txpower.txp_min_pwr = 2 * rates[7];
-	ah->ah_txpower.txp_cur_pwr = 2 * rates[0];
-	ah->ah_txpower.txp_ofdm = rates[7];
 }
 
 
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-07-30 11:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-28 14:32 [PATCH 1/4] ath5k: Use correct value for min_pwr and cur_pwr Nick Kossifidis
2012-07-28 14:32 ` [PATCH 2/4] ath5k: Fix range scaling when setting rate power table Nick Kossifidis
2012-07-28 14:32 ` [PATCH 3/4] ath5k: Preserve tx power level requested from above on phy_init Nick Kossifidis
2012-07-28 15:26   ` Thomas Huehn
2012-07-28 15:33     ` Thomas Huehn
2012-07-28 20:47       ` Nick Kossifidis
2012-07-29 11:11         ` [ath5k-devel] " Thomas Huehn
2012-07-29 20:51           ` Nick Kossifidis
2012-07-30 11:45             ` Thomas Huehn
2012-07-28 14:32 ` [PATCH 4/4] ath5k: Put power_level where it belongs and rename it Nick Kossifidis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).