1 From: Felix Fietkau <nbd@openwrt.org>
2 Date: Wed, 22 Oct 2014 18:16:14 +0200
3 Subject: [PATCH] ath9k_common: always update value in
6 In some cases the limit may be the same as reg->power_limit, but the
7 actual value that the hardware uses is not up to date. In that case, a
8 wrong value for current tx power is tracked internally.
9 Fix this by unconditionally updating it.
11 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
14 --- a/drivers/net/wireless/ath/ath9k/common.c
15 +++ b/drivers/net/wireless/ath/ath9k/common.c
16 @@ -368,11 +368,11 @@ void ath9k_cmn_update_txpow(struct ath_h
18 struct ath_regulatory *reg = ath9k_hw_regulatory(ah);
20 - if (reg->power_limit != new_txpow) {
21 + if (reg->power_limit != new_txpow)
22 ath9k_hw_set_txpowerlimit(ah, new_txpow, false);
23 - /* read back in case value is clamped */
24 - *txpower = reg->max_power_level;
27 + /* read back in case value is clamped */
28 + *txpower = reg->max_power_level;
30 EXPORT_SYMBOL(ath9k_cmn_update_txpow);