ath10k-ct: activate user space firmware loading again
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / 330-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch
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 domain
4
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
8 Signed-off-by: Felix Fietkau <nbd@nbd.name>
9 ---
10
11 --- a/drivers/net/wireless/ath/ath9k/hw.c
12 +++ b/drivers/net/wireless/ath/ath9k/hw.c
13 @@ -2954,6 +2954,10 @@ void ath9k_hw_apply_txpower(struct ath_h
14 if (ant_gain > max_gain)
15 ant_reduction = ant_gain - max_gain;
16
17 + /* FCC allows maximum antenna gain of 3 dBi */
18 + if (reg->region == NL80211_DFS_FCC)
19 + ant_reduction = max_t(int, ant_reduction - 6, 0);
20 +
21 ah->eep_ops->set_txpower(ah, chan, ctl, ant_reduction, new_pwr, test);
22 }
23