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