aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorNick Kossifidis <mickflemm@gmail.com>2012-08-05 15:35:33 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-08-10 15:26:55 -0400
commitd12c5c53ce4c8c65c694d1103673182ef5afdc65 (patch)
treeb2fad80498e5542de304395fd0ed86be55a41d85 /drivers/net
parent94f3457f4da43a44f17789f3e0bc8fb2ee9593ca (diff)
ath5k: Use correct value for min_pwr and cur_pwr
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> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/ath5k/phy.c19
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 8b71a2d947e0..aa1a77d4cd90 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,
3562 for (i = 8; i <= 15; i++) 3562 for (i = 8; i <= 15; i++)
3563 rates[i] -= ah->ah_txpower.txp_cck_ofdm_gainf_delta; 3563 rates[i] -= ah->ah_txpower.txp_cck_ofdm_gainf_delta;
3564 3564
3565 /* Save min/max and current tx power for this channel
3566 * in 0.25dB units.
3567 *
3568 * Note: We use rates[0] for current tx power because
3569 * it covers most of the rates, in most cases. It's our
3570 * tx power limit and what the user expects to see. */
3571 ah->ah_txpower.txp_min_pwr = 2 * rates[7];
3572 ah->ah_txpower.txp_cur_pwr = 2 * rates[0];
3573
3574 /* Set max txpower for correct OFDM operation on all rates
3575 * -that is the txpower for 54Mbit-, it's used for the PAPD
3576 * gain probe and it's in 0.5dB units */
3577 ah->ah_txpower.txp_ofdm = rates[7];
3578
3565 /* Now that we have all rates setup use table offset to 3579 /* Now that we have all rates setup use table offset to
3566 * match the power range set by user with the power indices 3580 * match the power range set by user with the power indices
3567 * on PCDAC/PDADC table */ 3581 * on PCDAC/PDADC table */
@@ -3571,11 +3585,6 @@ ath5k_setup_rate_powertable(struct ath5k_hw *ah, u16 max_pwr,
3571 if (rates[i] > 63) 3585 if (rates[i] > 63)
3572 rates[i] = 63; 3586 rates[i] = 63;
3573 } 3587 }
3574
3575 /* Min/max in 0.25dB units */
3576 ah->ah_txpower.txp_min_pwr = 2 * rates[7];
3577 ah->ah_txpower.txp_cur_pwr = 2 * rates[0];
3578 ah->ah_txpower.txp_ofdm = rates[7];
3579} 3588}
3580 3589
3581 3590