From 24fb81762ed1aeee57064deaeedee03f5d57da06 Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Fri, 15 Jan 2021 12:04:11 +0100 Subject: patches: drivers: net: ath EEPROM reg domain QCA6174 EEPROM might contain broken regulatory domain information, which leads to `iw reg set ` not being honoured. Instead, when trying to create a wireless access point, the world (0x00) regulatory domain is used, not allowing any emissions in 5GHz bands, hence breaking 802.11a support. Change-Id: I1c65ee6b3f077116d73e777dad1ff5a3aff52a6d Signed-off-by: Alexandru Avadanii --- ...support-for-special-0x0-regulatory-domain.patch | 52 ++++++++++++++++++++++ .../drivers/net/ath-eeprom-regulatory-domain.scc | 2 + 2 files changed, 54 insertions(+) create mode 100644 patches/drivers/net/0001-ath-add-support-for-special-0x0-regulatory-domain.patch create mode 100644 patches/drivers/net/ath-eeprom-regulatory-domain.scc diff --git a/patches/drivers/net/0001-ath-add-support-for-special-0x0-regulatory-domain.patch b/patches/drivers/net/0001-ath-add-support-for-special-0x0-regulatory-domain.patch new file mode 100644 index 0000000..edd2e43 --- /dev/null +++ b/patches/drivers/net/0001-ath-add-support-for-special-0x0-regulatory-domain.patch @@ -0,0 +1,52 @@ +From 2dc016599cfa9672a147528ca26d70c3654a5423 Mon Sep 17 00:00:00 2001 +From: Wen Gong +Date: Fri, 29 Nov 2019 07:34:09 +0000 +Subject: [PATCH] ath: add support for special 0x0 regulatory domain + +Some sdio chips of rome QCA6174's regulatory domain code of EEPROM is +empty, then ath_is_world_regd will return false for this case, and +it will lead function __ath_reg_dyn_country not work, thus the regdomain +will not update for NL80211_REGDOM_SET_BY_COUNTRY_IE type, it result +ath10k set the same regdomain/reg_5ghz_ctl/reg_2ghz_ctl to firmware, +then the tx power will not changed with different regdomain's AP. The +regulatory domain code of EEPROM of some QCA6174 PCIE chip is 0x6c, it +means world wide regdomain, for this chip, it does not have the issue. + +For empty reulatory domain code chip, set it to world regulatory domain +in functio ath_regd_sanitize, then it will fix the issue. + +Tested with QCA6174 SDIO with firmware +WLAN.RMH.4.4.1-00029. + +Upstream-Status: Backport [2dc016599cfa9672a147528ca26d70c3654a5423] + +Signed-off-by: Wen Gong +Signed-off-by: Kalle Valo +--- + drivers/net/wireless/ath/regd.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c +index 20f4f8ea9f894..bee9110b91f38 100644 +--- a/drivers/net/wireless/ath/regd.c ++++ b/drivers/net/wireless/ath/regd.c +@@ -666,14 +666,14 @@ ath_regd_init_wiphy(struct ath_regulatory *reg, + + /* + * Some users have reported their EEPROM programmed with +- * 0x8000 set, this is not a supported regulatory domain +- * but since we have more than one user with it we need +- * a solution for them. We default to 0x64, which is the +- * default Atheros world regulatory domain. ++ * 0x8000 or 0x0 set, this is not a supported regulatory ++ * domain but since we have more than one user with it we ++ * need a solution for them. We default to 0x64, which is ++ * the default Atheros world regulatory domain. + */ + static void ath_regd_sanitize(struct ath_regulatory *reg) + { +- if (reg->current_rd != COUNTRY_ERD_FLAG) ++ if (reg->current_rd != COUNTRY_ERD_FLAG && reg->current_rd != 0) + return; + printk(KERN_DEBUG "ath: EEPROM regdomain sanitized\n"); + reg->current_rd = 0x64; diff --git a/patches/drivers/net/ath-eeprom-regulatory-domain.scc b/patches/drivers/net/ath-eeprom-regulatory-domain.scc new file mode 100644 index 0000000..6b02932 --- /dev/null +++ b/patches/drivers/net/ath-eeprom-regulatory-domain.scc @@ -0,0 +1,2 @@ +# Upstream in kernel v5.6-rc1 and newer +patch 0001-ath-add-support-for-special-0x0-regulatory-domain.patch -- cgit v1.2.3-54-g00ecf