288d4e478c790fb8923e6deecb2fb65f12f2e0f9
[openwrt/staging/hauke.git] /
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
4 domain
5
6 FCC regulatory rules allow for up to 6 dBi antenna gain. Account for
7 this in the EEPROM based tx power reduction code.
8
9 Signed-off-by: Felix Fietkau <nbd@nbd.name>
10 ---
11
12 --- a/drivers/net/wireless/ath/ath9k/hw.c
13 +++ b/drivers/net/wireless/ath/ath9k/hw.c
14 @@ -2995,6 +2995,10 @@ void ath9k_hw_apply_txpower(struct ath_h
15 if (ant_gain > max_gain)
16 ant_reduction = ant_gain - max_gain;
17
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);
21 +
22 ah->eep_ops->set_txpower(ah, chan, ctl,
23 ant_reduction, new_pwr, test);
24 }