aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vasanth@atheros.com>2010-12-15 07:30:53 -0800
committerJohn W. Linville <linville@tuxdriver.com>2010-12-16 15:22:31 -0500
commit45ef6a0bcc9cd8f13004789ec6decb52e1d3045c (patch)
tree6191d717a17f9570658852a41b2f8694c1e6d147 /drivers/net/wireless/ath/ath9k/ar9003_paprd.c
parentath9k_hw: Disable PAPRD for rates with low Tx power (diff)
downloadlinux-dev-45ef6a0bcc9cd8f13004789ec6decb52e1d3045c.tar.xz
linux-dev-45ef6a0bcc9cd8f13004789ec6decb52e1d3045c.zip
ath9k_hw: Configure appropriate Tx power when PAPRD fails
Target Tx power available in eeprom is for PAPRD. If PAPRD fails, paprd scale factor needs to be detected from this target tx power. Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/ar9003_paprd.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_paprd.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
index 26cf31cca3ac..79554c524b68 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
@@ -19,6 +19,20 @@
void ar9003_paprd_enable(struct ath_hw *ah, bool val)
{
+ struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
+ struct ath9k_channel *chan = ah->curchan;
+
+ if (val) {
+ ah->paprd_table_write_done = true;
+
+ ah->eep_ops->set_txpower(ah, chan,
+ ath9k_regd_get_ctl(regulatory, chan),
+ chan->chan->max_antenna_gain * 2,
+ chan->chan->max_power * 2,
+ min((u32) MAX_RATE_POWER,
+ (u32) regulatory->power_limit), false);
+ }
+
REG_RMW_FIELD(ah, AR_PHY_PAPRD_CTRL0_B0,
AR_PHY_PAPRD_CTRL0_PAPRD_ENABLE, !!val);
if (ah->caps.tx_chainmask & BIT(1))