mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-11-01 19:07:47 +00:00
mac80211-ax: update regdb patches
Fixes: WIFI-5795 Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
From: Sven Eckelmann <sven@narfation.org>
|
||||
Date: Tue, 22 Sep 2020 11:05:12 +0200
|
||||
Subject: ath11k: Disable intersection of regd from BDF/firmware
|
||||
|
||||
We definitely don't want to use an arbitrary default domain which is
|
||||
intersected with each other. Instead, the each reported regulary domain
|
||||
from the device should be handled independently.
|
||||
|
||||
Signed-off-by: Sven Eckelmann <sven@narfation.org>
|
||||
|
||||
diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
index 54617c0e5484700939417abaa6652524dda29c36..ad31e709fc78978376178a38ef4ca51d6b6c8ebe 100644
|
||||
--- a/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
@@ -7207,16 +7207,6 @@ static int ath11k_reg_chan_list_event(struct ath11k_base *ab, struct sk_buff *sk
|
||||
(char *)reg_info->alpha2, 2))
|
||||
goto mem_free;
|
||||
|
||||
- /* Intersect new rules with default regd if a new country setting was
|
||||
- * requested, i.e a default regd was already set during initialization
|
||||
- * and the regd coming from this event has a valid country info.
|
||||
- */
|
||||
- if (ab->default_regd[pdev_idx] &&
|
||||
- !ath11k_reg_is_world_alpha((char *)
|
||||
- ab->default_regd[pdev_idx]->alpha2) &&
|
||||
- !ath11k_reg_is_world_alpha((char *)reg_info->alpha2))
|
||||
- intersect = true;
|
||||
-
|
||||
regd = ath11k_reg_build_regd(ab, reg_info, intersect);
|
||||
if (!regd) {
|
||||
ath11k_warn(ab, "failed to build regd from reg_info\n");
|
||||
@@ -0,0 +1,85 @@
|
||||
From: Sven Eckelmann <sven@narfation.org>
|
||||
Date: Fri, 30 Oct 2020 12:02:21 +0100
|
||||
Subject: ath11k: Accept new regdomain during initialization
|
||||
|
||||
The driver is registering as iee80211_hw with its OPs and is then able to
|
||||
be called by the upper layer. This for example happens early in the phase
|
||||
when the correct regulary domain should be set. But the regulary domain
|
||||
will only be accepted when the ATH11K_FLAG_REGISTERED flag was set after
|
||||
the ATH11K_QMI_EVENT_FW_READY was processed. So it can easily happen that
|
||||
the regularly domain is not correctly processed when
|
||||
ATH11K_QMI_EVENT_FW_READY isn't handled immediately:
|
||||
|
||||
$ iw reg set CA
|
||||
$ iw reg get|grep country
|
||||
country CA: DFS-FCC
|
||||
country CA: DFS-FCC
|
||||
country CA: DFS-FCC
|
||||
|
||||
$ echo "c000000.wifi1" > /sys/bus/platform/drivers/ath11k/unbind
|
||||
$ echo "c000000.wifi1" > /sys/bus/platform/drivers/ath11k/bind
|
||||
$ iw reg get|grep country
|
||||
country CA: DFS-FCC
|
||||
country US: DFS-FCC
|
||||
country US: DFS-FCC
|
||||
|
||||
It is therefore essential to accept the regulatory changes without having
|
||||
seen the ATH11K_QMI_EVENT_FW_READY. And since there are also potentially
|
||||
more problems in ath11k_debug_pdev_create, ath11k_mac_register and
|
||||
ath11k_mac_allocate with their use of ATH11K_FLAG_REGISTERED, it is better
|
||||
to move the ATH11K_QMI_EVENT_FW_READY. to a new flag.
|
||||
|
||||
Tested with WLAN.HK.2.4.0.1.r1-00019-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
|
||||
Signed-off-by: Sven Eckelmann <sven@narfation.org>
|
||||
Forwarded: https://lore.kernel.org/all/1829665.1PRlr7bOQj@ripper/
|
||||
|
||||
diff --git a/drivers/net/wireless/ath/ath11k/core.h b/drivers/net/wireless/ath/ath11k/core.h
|
||||
index 63a9f47146fe6dec0942176c04437e7900b05efe..2585518cb1a853bbae3b59af93a3bd3e1310f646 100644
|
||||
--- a/drivers/net/wireless/ath/ath11k/core.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/core.h
|
||||
@@ -208,7 +208,7 @@ enum ath11k_scan_state {
|
||||
|
||||
enum ath11k_dev_flags {
|
||||
ATH11K_CAC_RUNNING,
|
||||
- ATH11K_FLAG_CORE_REGISTERED,
|
||||
+ ATH11K_FLAG_FW_READY,
|
||||
ATH11K_FLAG_CRASH_FLUSH,
|
||||
ATH11K_FLAG_RAW_MODE,
|
||||
ATH11K_FLAG_HW_CRYPTO_DISABLED,
|
||||
diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
|
||||
index 9beda3b94da5d28af53eb25c287a24c41bc6285c..6f0d830dc7c946351b642af9444b12ed82bec558 100644
|
||||
--- a/drivers/net/wireless/ath/ath11k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/mac.c
|
||||
@@ -9385,6 +9385,8 @@ static int __ath11k_mac_register(struct ath11k *ar)
|
||||
goto err_free_if_combs;
|
||||
}
|
||||
|
||||
+ set_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags);
|
||||
+
|
||||
if (!ab->hw_params.supports_monitor)
|
||||
/* There's a race between calling ieee80211_register_hw()
|
||||
* and here where the monitor mode is enabled for a little
|
||||
diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c
|
||||
index f9a8f96e7d31b404d6b47d12cc37a885fb55f764..f3dd4604db2e4c834238e306ad20194f253fe432 100644
|
||||
--- a/drivers/net/wireless/ath/ath11k/qmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
|
||||
@@ -4465,7 +4465,7 @@ static void ath11k_qmi_driver_event_work(struct work_struct *work)
|
||||
break;
|
||||
case ATH11K_QMI_EVENT_FW_READY:
|
||||
clear_bit(ATH11K_FLAG_QMI_FAIL, &ab->dev_flags);
|
||||
- if (test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) {
|
||||
+ if (test_bit(ATH11K_FLAG_FW_READY, &ab->dev_flags)) {
|
||||
ath11k_hal_dump_srng_stats(ab);
|
||||
queue_work(ab->workqueue, &ab->restart_work);
|
||||
break;
|
||||
@@ -4487,7 +4487,7 @@ static void ath11k_qmi_driver_event_work(struct work_struct *work)
|
||||
}
|
||||
|
||||
ath11k_core_qmi_firmware_ready(ab);
|
||||
- set_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags);
|
||||
+ set_bit(ATH11K_FLAG_FW_READY, &ab->dev_flags);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -0,0 +1,60 @@
|
||||
From: Joe Stefek <jstefek@datto.com>
|
||||
Date: Tue, 15 Sep 2020 08:44:21 -0700
|
||||
Subject: Drop regd patch which prevents changing reg domain on system with vdevs.
|
||||
|
||||
diff --git a/drivers/net/wireless/ath/ath11k/reg.c b/drivers/net/wireless/ath/ath11k/reg.c
|
||||
index 03e2a5ca60dcde2173f1abf10d10d1648f0ba29d..b83d89c1af33073c25e2877557d947895ef9537d 100644
|
||||
--- a/drivers/net/wireless/ath/ath11k/reg.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/reg.c
|
||||
@@ -41,37 +41,6 @@ static bool ath11k_regdom_changes(struct ath11k *ar, char *alpha2)
|
||||
return memcmp(regd->alpha2, alpha2, 2) != 0;
|
||||
}
|
||||
|
||||
-static bool ath11k_reg_validate_pdev_state(struct ath11k* ar)
|
||||
-{
|
||||
- struct ath11k_base *ab = ar->ab;
|
||||
- struct ath11k_pdev *pdev;
|
||||
- struct ath11k* tmp_ar;
|
||||
- int i;
|
||||
-
|
||||
- rcu_read_lock();
|
||||
- for (i = 0; i < ab->num_radios; i++) {
|
||||
- pdev = rcu_dereference(ab->pdevs_active[i]);
|
||||
- if (!pdev)
|
||||
- continue;
|
||||
-
|
||||
- tmp_ar = pdev->ar;
|
||||
- if (tmp_ar) {
|
||||
- mutex_lock(&tmp_ar->conf_mutex);
|
||||
- if (tmp_ar->num_started_vdevs) {
|
||||
- if (tmp_ar == ar)
|
||||
- ath11k_warn(ab, "%s has active interface, please bring down to set country code",
|
||||
- wiphy_name(ar->hw->wiphy));
|
||||
- mutex_unlock(&tmp_ar->conf_mutex);
|
||||
- rcu_read_unlock();
|
||||
- return false;
|
||||
- }
|
||||
- mutex_unlock(&tmp_ar->conf_mutex);
|
||||
- }
|
||||
- }
|
||||
- rcu_read_unlock();
|
||||
- return true;
|
||||
-}
|
||||
-
|
||||
static void
|
||||
ath11k_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request)
|
||||
{
|
||||
@@ -105,13 +74,6 @@ ath11k_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request)
|
||||
return;
|
||||
}
|
||||
|
||||
- /* The SET_INIT_COUNTRY command should not be sent to firmware while any vdev is active.
|
||||
- * Also it does not make sense to give the command for certain pdev's alone.
|
||||
- * Hence check all the pdev's if any have an active vdev before sending the command.
|
||||
- */
|
||||
- if (!ath11k_reg_validate_pdev_state(ar))
|
||||
- return;
|
||||
-
|
||||
/* Set the country code to the firmware and wait for
|
||||
* the WMI_REG_CHAN_LIST_CC EVENT for updating the
|
||||
* reg info
|
||||
278
feeds/wifi-ax/mac80211/patches/pending/0009-regdb.patch
Normal file
278
feeds/wifi-ax/mac80211/patches/pending/0009-regdb.patch
Normal file
@@ -0,0 +1,278 @@
|
||||
From patchwork Fri Nov 12 15:31:16 2021
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Sven Eckelmann <sven@narfation.org>
|
||||
X-Patchwork-Id: 12616993
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
|
||||
aws-us-west-2-korg-lkml-1.web.codeaurora.org
|
||||
Received: from mail.kernel.org (mail.kernel.org [198.145.29.99])
|
||||
by smtp.lore.kernel.org (Postfix) with ESMTP id 721EAC433F5
|
||||
for <linux-wireless@archiver.kernel.org>;
|
||||
Fri, 12 Nov 2021 15:32:26 +0000 (UTC)
|
||||
Received: from vger.kernel.org (vger.kernel.org [23.128.96.18])
|
||||
by mail.kernel.org (Postfix) with ESMTP id 4E73F60C40
|
||||
for <linux-wireless@archiver.kernel.org>;
|
||||
Fri, 12 Nov 2021 15:32:26 +0000 (UTC)
|
||||
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
|
||||
id S230182AbhKLPfQ (ORCPT
|
||||
<rfc822;linux-wireless@archiver.kernel.org>);
|
||||
Fri, 12 Nov 2021 10:35:16 -0500
|
||||
Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56078 "EHLO
|
||||
lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
|
||||
with ESMTP id S229509AbhKLPfP (ORCPT
|
||||
<rfc822;linux-wireless@vger.kernel.org>);
|
||||
Fri, 12 Nov 2021 10:35:15 -0500
|
||||
Received: from dvalin.narfation.org (dvalin.narfation.org
|
||||
[IPv6:2a00:17d8:100::8b1])
|
||||
by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3035C061766
|
||||
for <linux-wireless@vger.kernel.org>;
|
||||
Fri, 12 Nov 2021 07:32:24 -0800 (PST)
|
||||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org;
|
||||
s=20121; t=1636731141;
|
||||
h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
|
||||
to:to:cc:cc:mime-version:mime-version:
|
||||
content-transfer-encoding:content-transfer-encoding;
|
||||
bh=oHqfDu/AzlIIJ7kJWRvWS79eoKm0cbRICNb1jk+xitA=;
|
||||
b=QcxgTgtUlyXNy5WQL+HLDH08b/xtVIevhpQATuhOx1ydUSKdszhvhpZwXwoQO6YajcE44M
|
||||
ZxrForTEDSbDg0ewdn/v6X0/tUqzAFbLruW76huN+w/XEO2/egNP0LiAxknVbhFwgf0rX8
|
||||
s4RipvwxFT/ecJd/iL80lK1oLkTVeSg=
|
||||
From: Sven Eckelmann <sven@narfation.org>
|
||||
To: ath11k@lists.infradead.org
|
||||
Cc: linux-wireless@vger.kernel.org, Sven Eckelmann <sven@narfation.org>
|
||||
Subject: [PATCH] ath11k: Fix ETSI regd with weather radar overlap
|
||||
Date: Fri, 12 Nov 2021 16:31:16 +0100
|
||||
Message-Id: <20211112153116.1214421-1-sven@narfation.org>
|
||||
X-Mailer: git-send-email 2.30.2
|
||||
MIME-Version: 1.0
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
Some ETSI countries have a small overlap in the wireless-regdb with an ETSI
|
||||
channel (5590-5650). A good example is Australia:
|
||||
|
||||
country AU: DFS-ETSI
|
||||
(2400 - 2483.5 @ 40), (36)
|
||||
(5150 - 5250 @ 80), (23), NO-OUTDOOR, AUTO-BW
|
||||
(5250 - 5350 @ 80), (20), NO-OUTDOOR, AUTO-BW, DFS
|
||||
(5470 - 5600 @ 80), (27), DFS
|
||||
(5650 - 5730 @ 80), (27), DFS
|
||||
(5730 - 5850 @ 80), (36)
|
||||
(57000 - 66000 @ 2160), (43), NO-OUTDOOR
|
||||
|
||||
If the firmware (or the BDF) is shipped with these rules then there is only
|
||||
a 10 MHz overlap with the weather radar:
|
||||
|
||||
* below: 5470 - 5590
|
||||
* weather radar: 5590 - 5600
|
||||
* above: (none for the rule "5470 - 5600 @ 80")
|
||||
|
||||
There are several wrong assumption in the ath11k code:
|
||||
|
||||
* there is always a valid range below the weather radar
|
||||
(actually: there could be no range below the weather radar range OR range
|
||||
could be smaller than 20 MHz)
|
||||
* intersected range in the weather radar range is valid
|
||||
(actually: the range could be smaller than 20 MHz)
|
||||
* range above weather radar is either empty or valid
|
||||
(actually: the range could be smaller than 20 MHz)
|
||||
|
||||
These wrong assumption will lead in this example to a rule
|
||||
|
||||
(5590 - 5600 @ 20), (N/A, 27), (600000 ms), DFS, AUTO-BW
|
||||
|
||||
which is invalid according to is_valid_reg_rule() because the freq_diff is
|
||||
only 10 MHz but the max_bandwidth is set to 20 MHz. Which results in a
|
||||
rejection like:
|
||||
|
||||
WARNING: at backports-20210222_001-4.4.60-b157d2276/net/wireless/reg.c:3984
|
||||
[...]
|
||||
Call trace:
|
||||
[<ffffffbffc3d2e50>] reg_get_max_bandwidth+0x300/0x3a8 [cfg80211]
|
||||
[<ffffffbffc3d3d0c>] regulatory_set_wiphy_regd_sync+0x3c/0x98 [cfg80211]
|
||||
[<ffffffbffc651598>] ath11k_regd_update+0x1a8/0x210 [ath11k]
|
||||
[<ffffffbffc652108>] ath11k_regd_update_work+0x18/0x20 [ath11k]
|
||||
[<ffffffc0000a93e0>] process_one_work+0x1f8/0x340
|
||||
[<ffffffc0000a9784>] worker_thread+0x25c/0x448
|
||||
[<ffffffc0000aedc8>] kthread+0xd0/0xd8
|
||||
[<ffffffc000085550>] ret_from_fork+0x10/0x40
|
||||
ath11k c000000.wifi: failed to perform regd update : -22
|
||||
Invalid regulatory domain detected
|
||||
|
||||
To avoid this, the algorithm has to be changed slightly. Instead of
|
||||
splitting a rule which overlaps with the weather radar range into 3 pieces
|
||||
and accepting the first two parts blindly, it must actually be checked for
|
||||
each piece whether it is a valid range. And only if it is valid, add it to
|
||||
the output array.
|
||||
|
||||
When these checks are in place, the processed rules for AU would end up as
|
||||
|
||||
country AU: DFS-ETSI
|
||||
(2400 - 2483 @ 40), (N/A, 36), (N/A)
|
||||
(5150 - 5250 @ 80), (6, 23), (N/A), NO-OUTDOOR, AUTO-BW
|
||||
(5250 - 5350 @ 80), (6, 20), (0 ms), NO-OUTDOOR, DFS, AUTO-BW
|
||||
(5470 - 5590 @ 80), (6, 27), (0 ms), DFS, AUTO-BW
|
||||
(5650 - 5730 @ 80), (6, 27), (0 ms), DFS, AUTO-BW
|
||||
(5730 - 5850 @ 80), (6, 36), (N/A), AUTO-BW
|
||||
|
||||
and will be accepted by the wireless regulatory code.
|
||||
|
||||
Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
|
||||
Signed-off-by: Sven Eckelmann <sven@narfation.org>
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/reg.c | 103 ++++++++++++++------------
|
||||
1 file changed, 56 insertions(+), 47 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/wireless/ath/ath11k/reg.c b/drivers/net/wireless/ath/ath11k/reg.c
|
||||
index a66b5bdd2167..8606170ba80d 100644
|
||||
--- a/drivers/net/wireless/ath/ath11k/reg.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/reg.c
|
||||
@@ -456,6 +456,9 @@ ath11k_reg_adjust_bw(u16 start_freq, u16 end_freq, u16 max_bw)
|
||||
{
|
||||
u16 bw;
|
||||
|
||||
+ if (end_freq <= start_freq)
|
||||
+ return 0;
|
||||
+
|
||||
bw = end_freq - start_freq;
|
||||
bw = min_t(u16, bw, max_bw);
|
||||
|
||||
@@ -463,8 +466,10 @@ ath11k_reg_adjust_bw(u16 start_freq, u16 end_freq, u16 max_bw)
|
||||
bw = 80;
|
||||
else if (bw >= 40 && bw < 80)
|
||||
bw = 40;
|
||||
- else if (bw < 40)
|
||||
+ else if (bw >= 20 && bw < 40)
|
||||
bw = 20;
|
||||
+ else
|
||||
+ bw = 0;
|
||||
|
||||
return bw;
|
||||
}
|
||||
@@ -488,73 +493,77 @@ ath11k_reg_update_weather_radar_band(struct ath11k_base *ab,
|
||||
struct cur_reg_rule *reg_rule,
|
||||
u8 *rule_idx, u32 flags, u16 max_bw)
|
||||
{
|
||||
+ u32 start_freq;
|
||||
u32 end_freq;
|
||||
u16 bw;
|
||||
u8 i;
|
||||
|
||||
i = *rule_idx;
|
||||
|
||||
+ /* there might be situations when even the input rule must be dropped */
|
||||
+ i--;
|
||||
+
|
||||
+ /* frequencies below weather radar */
|
||||
bw = ath11k_reg_adjust_bw(reg_rule->start_freq,
|
||||
ETSI_WEATHER_RADAR_BAND_LOW, max_bw);
|
||||
+ if (bw > 0) {
|
||||
+ i++;
|
||||
|
||||
- ath11k_reg_update_rule(regd->reg_rules + i, reg_rule->start_freq,
|
||||
- ETSI_WEATHER_RADAR_BAND_LOW, bw,
|
||||
- reg_rule->ant_gain, reg_rule->reg_power,
|
||||
- flags);
|
||||
+ ath11k_reg_update_rule(regd->reg_rules + i,
|
||||
+ reg_rule->start_freq,
|
||||
+ ETSI_WEATHER_RADAR_BAND_LOW, bw,
|
||||
+ reg_rule->ant_gain, reg_rule->reg_power,
|
||||
+ flags);
|
||||
|
||||
- ath11k_dbg(ab, ATH11K_DBG_REG,
|
||||
- "\t%d. (%d - %d @ %d) (%d, %d) (%d ms) (FLAGS %d)\n",
|
||||
- i + 1, reg_rule->start_freq, ETSI_WEATHER_RADAR_BAND_LOW,
|
||||
- bw, reg_rule->ant_gain, reg_rule->reg_power,
|
||||
- regd->reg_rules[i].dfs_cac_ms,
|
||||
- flags);
|
||||
-
|
||||
- if (reg_rule->end_freq > ETSI_WEATHER_RADAR_BAND_HIGH)
|
||||
- end_freq = ETSI_WEATHER_RADAR_BAND_HIGH;
|
||||
- else
|
||||
- end_freq = reg_rule->end_freq;
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_REG,
|
||||
+ "\t%d. (%d - %d @ %d) (%d, %d) (%d ms) (FLAGS %d)\n",
|
||||
+ i + 1, reg_rule->start_freq,
|
||||
+ ETSI_WEATHER_RADAR_BAND_LOW, bw, reg_rule->ant_gain,
|
||||
+ reg_rule->reg_power, regd->reg_rules[i].dfs_cac_ms,
|
||||
+ flags);
|
||||
+ }
|
||||
|
||||
- bw = ath11k_reg_adjust_bw(ETSI_WEATHER_RADAR_BAND_LOW, end_freq,
|
||||
- max_bw);
|
||||
+ /* weather radar frequencies */
|
||||
+ start_freq = max_t(u32, reg_rule->start_freq,
|
||||
+ ETSI_WEATHER_RADAR_BAND_LOW);
|
||||
+ end_freq = min_t(u32, reg_rule->end_freq, ETSI_WEATHER_RADAR_BAND_HIGH);
|
||||
|
||||
- i++;
|
||||
+ bw = ath11k_reg_adjust_bw(start_freq, end_freq, max_bw);
|
||||
+ if (bw > 0) {
|
||||
+ i++;
|
||||
|
||||
- ath11k_reg_update_rule(regd->reg_rules + i,
|
||||
- ETSI_WEATHER_RADAR_BAND_LOW, end_freq, bw,
|
||||
- reg_rule->ant_gain, reg_rule->reg_power,
|
||||
- flags);
|
||||
+ ath11k_reg_update_rule(regd->reg_rules + i, start_freq,
|
||||
+ end_freq, bw, reg_rule->ant_gain,
|
||||
+ reg_rule->reg_power, flags);
|
||||
|
||||
- regd->reg_rules[i].dfs_cac_ms = ETSI_WEATHER_RADAR_BAND_CAC_TIMEOUT;
|
||||
+ regd->reg_rules[i].dfs_cac_ms = ETSI_WEATHER_RADAR_BAND_CAC_TIMEOUT;
|
||||
|
||||
- ath11k_dbg(ab, ATH11K_DBG_REG,
|
||||
- "\t%d. (%d - %d @ %d) (%d, %d) (%d ms) (FLAGS %d)\n",
|
||||
- i + 1, ETSI_WEATHER_RADAR_BAND_LOW, end_freq,
|
||||
- bw, reg_rule->ant_gain, reg_rule->reg_power,
|
||||
- regd->reg_rules[i].dfs_cac_ms,
|
||||
- flags);
|
||||
-
|
||||
- if (end_freq == reg_rule->end_freq) {
|
||||
- regd->n_reg_rules--;
|
||||
- *rule_idx = i;
|
||||
- return;
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_REG,
|
||||
+ "\t%d. (%d - %d @ %d) (%d, %d) (%d ms) (FLAGS %d)\n",
|
||||
+ i + 1, start_freq, end_freq, bw,
|
||||
+ reg_rule->ant_gain, reg_rule->reg_power,
|
||||
+ regd->reg_rules[i].dfs_cac_ms, flags);
|
||||
}
|
||||
|
||||
+ /* frequencies above weather radar */
|
||||
bw = ath11k_reg_adjust_bw(ETSI_WEATHER_RADAR_BAND_HIGH,
|
||||
reg_rule->end_freq, max_bw);
|
||||
+ if (bw > 0) {
|
||||
+ i++;
|
||||
|
||||
- i++;
|
||||
-
|
||||
- ath11k_reg_update_rule(regd->reg_rules + i, ETSI_WEATHER_RADAR_BAND_HIGH,
|
||||
- reg_rule->end_freq, bw,
|
||||
- reg_rule->ant_gain, reg_rule->reg_power,
|
||||
- flags);
|
||||
+ ath11k_reg_update_rule(regd->reg_rules + i,
|
||||
+ ETSI_WEATHER_RADAR_BAND_HIGH,
|
||||
+ reg_rule->end_freq, bw,
|
||||
+ reg_rule->ant_gain, reg_rule->reg_power,
|
||||
+ flags);
|
||||
|
||||
- ath11k_dbg(ab, ATH11K_DBG_REG,
|
||||
- "\t%d. (%d - %d @ %d) (%d, %d) (%d ms) (FLAGS %d)\n",
|
||||
- i + 1, ETSI_WEATHER_RADAR_BAND_HIGH, reg_rule->end_freq,
|
||||
- bw, reg_rule->ant_gain, reg_rule->reg_power,
|
||||
- regd->reg_rules[i].dfs_cac_ms,
|
||||
- flags);
|
||||
+ ath11k_dbg(ab, ATH11K_DBG_REG,
|
||||
+ "\t%d. (%d - %d @ %d) (%d, %d) (%d ms) (FLAGS %d)\n",
|
||||
+ i + 1, ETSI_WEATHER_RADAR_BAND_HIGH,
|
||||
+ reg_rule->end_freq, bw, reg_rule->ant_gain,
|
||||
+ reg_rule->reg_power, regd->reg_rules[i].dfs_cac_ms,
|
||||
+ flags);
|
||||
+ }
|
||||
|
||||
*rule_idx = i;
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
Index: backports-20210222_001-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/reg.c
|
||||
===================================================================
|
||||
--- backports-20210222_001-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/reg.c
|
||||
+++ backports-20210222_001-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/reg.c
|
||||
@@ -170,6 +170,9 @@ int ath11k_regd_update(struct ath11k *ar
|
||||
}
|
||||
} else {
|
||||
regd = ab->new_regd[pdev_id];
|
||||
+ /* force update custom regdm to cfg80211 */
|
||||
+ ar->hw->wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG;
|
||||
+ wiphy_apply_custom_regulatory(ar->hw->wiphy, regd);
|
||||
}
|
||||
|
||||
if (!regd) {
|
||||
Index: backports-20210222_001-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
===================================================================
|
||||
--- backports-20210222_001-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
+++ backports-20210222_001-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
@@ -7212,12 +7212,12 @@ static int ath11k_reg_chan_list_event(st
|
||||
* requested, i.e a default regd was already set during initialization
|
||||
* and the regd coming from this event has a valid country info.
|
||||
*/
|
||||
- if (ab->default_regd[pdev_idx] &&
|
||||
+/* if (ab->default_regd[pdev_idx] &&
|
||||
!ath11k_reg_is_world_alpha((char *)
|
||||
ab->default_regd[pdev_idx]->alpha2) &&
|
||||
!ath11k_reg_is_world_alpha((char *)reg_info->alpha2))
|
||||
intersect = true;
|
||||
-
|
||||
+*/
|
||||
regd = ath11k_reg_build_regd(ab, reg_info, intersect);
|
||||
if (!regd) {
|
||||
ath11k_warn(ab, "failed to build regd from reg_info\n");
|
||||
Reference in New Issue
Block a user