341-ath9k_common-always-update-value-in-ath9k_cmn_update.patch 998 B

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