aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/ath10k-ct/patches
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2019-06-11 14:53:12 +0200
committerChristian Lamparter <chunkeey@gmail.com>2019-06-15 00:40:25 +0200
commit5913543190ce2d459eda9a134698f7c3ee472ec2 (patch)
tree90394e1b84d87f64bb7c35bcd8115b50d298ac44 /package/kernel/ath10k-ct/patches
parentf1d4da30297424d2674de172d52a5384779fc0ea (diff)
downloadupstream-5913543190ce2d459eda9a134698f7c3ee472ec2.tar.gz
upstream-5913543190ce2d459eda9a134698f7c3ee472ec2.tar.bz2
upstream-5913543190ce2d459eda9a134698f7c3ee472ec2.zip
ath10k-ct: adjust tx power reduction for US regulatory domain
FCC allows maximum antenna gain of 6 dBi. 15.247(b)(4): > (4) The conducted output power limit > specified in paragraph (b) of this section > is based on the use of antennas > with directional gains that do not exceed > 6 dBi. Except as shown in paragraph > (c) of this section, if transmitting > antennas of directional gain greater > than 6 dBi are used, the conducted > output power from the intentional radiator > shall be reduced below the stated > values in paragraphs (b)(1), (b)(2), > and (b)(3) of this section, as appropriate, > by the amount in dB that the > directional gain of the antenna exceeds > 6 dBi. https://www.gpo.gov/fdsys/pkg/CFR-2013-title47-vol1/pdf/CFR-2013-title47-vol1-sec15-247.pdf Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'package/kernel/ath10k-ct/patches')
-rw-r--r--package/kernel/ath10k-ct/patches/205-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch101
1 files changed, 101 insertions, 0 deletions
diff --git a/package/kernel/ath10k-ct/patches/205-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch b/package/kernel/ath10k-ct/patches/205-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch
new file mode 100644
index 0000000000..ff8631e207
--- /dev/null
+++ b/package/kernel/ath10k-ct/patches/205-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch
@@ -0,0 +1,101 @@
+From: Sven Eckelmann <seckelmann@datto.com>
+Date: Wed, 28 Nov 2018 16:16:27 +0100
+Subject: ath10k: adjust tx power reduction for US regulatory domain
+
+FCC allows maximum antenna gain of 6 dBi. 15.247(b)(4):
+
+> (4) The conducted output power limit
+> specified in paragraph (b) of this section
+> is based on the use of antennas
+> with directional gains that do not exceed
+> 6 dBi. Except as shown in paragraph
+> (c) of this section, if transmitting
+> antennas of directional gain greater
+> than 6 dBi are used, the conducted
+> output power from the intentional radiator
+> shall be reduced below the stated
+> values in paragraphs (b)(1), (b)(2),
+> and (b)(3) of this section, as appropriate,
+> by the amount in dB that the
+> directional gain of the antenna exceeds
+> 6 dBi.
+
+https://www.gpo.gov/fdsys/pkg/CFR-2013-title47-vol1/pdf/CFR-2013-title47-vol1-sec15-247.pdf
+
+Signed-off-by: Sven Eckelmann <seckelmann@datto.com>
+
+Forwarded: no
+
+--- a/ath10k-4.19/mac.c
++++ b/ath10k-4.19/mac.c
+@@ -1153,6 +1153,40 @@ static inline int ath10k_vdev_setup_sync
+ return ar->last_wmi_vdev_start_status;
+ }
+
++static u32 ath10k_get_max_antenna_gain(struct ath10k *ar,
++ u32 ch_max_antenna_gain)
++{
++ u32 max_antenna_gain;
++
++ if (ar->dfs_detector && ar->dfs_detector->region == NL80211_DFS_FCC) {
++ /* FCC allows maximum antenna gain of 6 dBi. 15.247(b)(4):
++ *
++ * > (4) The conducted output power limit
++ * > specified in paragraph (b) of this section
++ * > is based on the use of antennas
++ * > with directional gains that do not exceed
++ * > 6 dBi. Except as shown in paragraph
++ * > (c) of this section, if transmitting
++ * > antennas of directional gain greater
++ * > than 6 dBi are used, the conducted
++ * > output power from the intentional radiator
++ * > shall be reduced below the stated
++ * > values in paragraphs (b)(1), (b)(2),
++ * > and (b)(3) of this section, as appropriate,
++ * > by the amount in dB that the
++ * > directional gain of the antenna exceeds
++ * > 6 dBi.
++ *
++ * https://www.gpo.gov/fdsys/pkg/CFR-2013-title47-vol1/pdf/CFR-2013-title47-vol1-sec15-247.pdf
++ */
++ max_antenna_gain = 6;
++ } else {
++ max_antenna_gain = 0;
++ }
++
++ return max(ch_max_antenna_gain, max_antenna_gain);
++}
++
+ static int ath10k_monitor_vdev_start(struct ath10k *ar, int vdev_id)
+ {
+ struct cfg80211_chan_def *chandef = NULL;
+@@ -1185,7 +1219,8 @@ static int ath10k_monitor_vdev_start(str
+ arg.channel.min_power = 0;
+ arg.channel.max_power = channel->max_power * 2;
+ arg.channel.max_reg_power = channel->max_reg_power * 2;
+- arg.channel.max_antenna_gain = channel->max_antenna_gain;
++ arg.channel.max_antenna_gain = ath10k_get_max_antenna_gain(ar,
++ channel->max_antenna_gain);
+
+ reinit_completion(&ar->vdev_setup_done);
+
+@@ -1627,7 +1662,8 @@ static int ath10k_vdev_start_restart(str
+ arg.channel.min_power = 0;
+ arg.channel.max_power = chandef->chan->max_power * 2;
+ arg.channel.max_reg_power = chandef->chan->max_reg_power * 2;
+- arg.channel.max_antenna_gain = chandef->chan->max_antenna_gain;
++ arg.channel.max_antenna_gain = ath10k_get_max_antenna_gain(ar,
++ chandef->chan->max_antenna_gain);
+
+ /* CT Firmware can support 32+ VDEVS, but can only support
+ * beacon-ing devs with dev ids 0 - 31 due to firmware limitations.
+@@ -3799,7 +3835,8 @@ static int ath10k_update_channel_list(st
+ ch->min_power = 0;
+ ch->max_power = channel->max_power * 2;
+ ch->max_reg_power = channel->max_reg_power * 2;
+- ch->max_antenna_gain = channel->max_antenna_gain;
++ ch->max_antenna_gain = ath10k_get_max_antenna_gain(ar,
++ channel->max_antenna_gain);
+ ch->reg_class_id = 0; /* FIXME */
+
+ /* FIXME: why use only legacy modes, why not any