365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch 756 B

123456789101112131415161718192021222324
  1. From: Felix Fietkau <[email protected]>
  2. Date: Wed, 19 Jul 2017 08:49:31 +0200
  3. Subject: [PATCH] ath9k: adjust tx power reduction for US regulatory
  4. domain
  5. FCC regulatory rules allow for up to 3 dBi antenna gain. Account for
  6. this in the EEPROM based tx power reduction code.
  7. Signed-off-by: Felix Fietkau <[email protected]>
  8. ---
  9. --- a/drivers/net/wireless/ath/ath9k/hw.c
  10. +++ b/drivers/net/wireless/ath/ath9k/hw.c
  11. @@ -2954,6 +2954,10 @@ void ath9k_hw_apply_txpower(struct ath_h
  12. if (ant_gain > max_gain)
  13. ant_reduction = ant_gain - max_gain;
  14. + /* FCC allows maximum antenna gain of 3 dBi */
  15. + if (reg->region == NL80211_DFS_FCC)
  16. + ant_reduction = max_t(int, ant_reduction - 6, 0);
  17. +
  18. ah->eep_ops->set_txpower(ah, chan, ctl, ant_reduction, new_pwr, test);
  19. }