openwrtv3/package/kernel/mac80211/patches/ath/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch
Hauke Mehrtens db90c243a0 mac80211: update to version based on 4.19-rc4
This updates mac80211 to backports based on kernel 4.19-rc4.

I plan to integrate all the patches which are in this tar into upstream
backports soon.

I used the backports generated from this code:
https://github.com/hauke/backports/commits/wip2

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2018-09-26 16:39:44 +02:00

24 lines
760 B
Diff

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