diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-07-27 09:01:05 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-08-08 16:04:17 -0400 |
commit | 9c204b46c7af93e334114bea1f5eeaa6fea9ba07 (patch) | |
tree | 0de1dd9a9fa0644b141087e4e525c7d40af2e559 /drivers/net/wireless/ath/ath9k/hw.c | |
parent | 071bfefd6849e9acc12ca26f4f897cd907e81d1b (diff) |
ath9k_hw: do not limit initial tx power to 20 dbm
When testing for tx power, bypass the default limits.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/hw.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 8dcefe74f4c..cb0b6aab711 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -2439,15 +2439,18 @@ void ath9k_hw_set_txpowerlimit(struct ath_hw *ah, u32 limit, bool test) | |||
2439 | struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah); | 2439 | struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah); |
2440 | struct ath9k_channel *chan = ah->curchan; | 2440 | struct ath9k_channel *chan = ah->curchan; |
2441 | struct ieee80211_channel *channel = chan->chan; | 2441 | struct ieee80211_channel *channel = chan->chan; |
2442 | int reg_pwr = min_t(int, MAX_RATE_POWER, regulatory->power_limit); | ||
2443 | int chan_pwr = channel->max_power * 2; | ||
2444 | |||
2445 | if (test) | ||
2446 | reg_pwr = chan_pwr = MAX_RATE_POWER; | ||
2442 | 2447 | ||
2443 | regulatory->power_limit = min(limit, (u32) MAX_RATE_POWER); | 2448 | regulatory->power_limit = min(limit, (u32) MAX_RATE_POWER); |
2444 | 2449 | ||
2445 | ah->eep_ops->set_txpower(ah, chan, | 2450 | ah->eep_ops->set_txpower(ah, chan, |
2446 | ath9k_regd_get_ctl(regulatory, chan), | 2451 | ath9k_regd_get_ctl(regulatory, chan), |
2447 | channel->max_antenna_gain * 2, | 2452 | channel->max_antenna_gain * 2, |
2448 | channel->max_power * 2, | 2453 | chan_pwr, reg_pwr, test); |
2449 | min((u32) MAX_RATE_POWER, | ||
2450 | (u32) regulatory->power_limit), test); | ||
2451 | } | 2454 | } |
2452 | EXPORT_SYMBOL(ath9k_hw_set_txpowerlimit); | 2455 | EXPORT_SYMBOL(ath9k_hw_set_txpowerlimit); |
2453 | 2456 | ||