wlan-ap-Telecominfraproject/feeds/wifi-ax/mac80211/patches/pending/0008-Drop-regd-patch-which-prevents-changing-reg-domain-o.patch
John Crispin 43d7ca31d6 wifi-ax/mac80211: make the 11.4 ath11k work inside the v5.4 kernel
Fixes: WIFI-7570
Signed-off-by: John Crispin <john@phrozen.org>
2022-05-27 10:05:52 +02:00

61 lines
1.9 KiB
Diff

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