linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath: add support for special 0x0 regulatory domain
@ 2019-11-29  7:34 Wen Gong
  2019-12-02 10:08 ` Kalle Valo
       [not found] ` <20191202100833.0C1B9C433CB@smtp.codeaurora.org>
  0 siblings, 2 replies; 4+ messages in thread
From: Wen Gong @ 2019-11-29  7:34 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless

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.

Signed-off-by: Wen Gong <wgong@codeaurora.org>
---
 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 20f4f8ea9f89..bee9110b91f3 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;
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ath: add support for special 0x0 regulatory domain
  2019-11-29  7:34 [PATCH] ath: add support for special 0x0 regulatory domain Wen Gong
@ 2019-12-02 10:08 ` Kalle Valo
       [not found] ` <20191202100833.0C1B9C433CB@smtp.codeaurora.org>
  1 sibling, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2019-12-02 10:08 UTC (permalink / raw)
  To: Wen Gong; +Cc: ath10k, linux-wireless

Wen Gong <wgong@codeaurora.org> wrote:

> 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.
> 
> Signed-off-by: Wen Gong <wgong@codeaurora.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

2dc016599cfa ath: add support for special 0x0 regulatory domain

-- 
https://patchwork.kernel.org/patch/11266721/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ath: add support for special 0x0 regulatory domain
       [not found] ` <20191202100833.0C1B9C433CB@smtp.codeaurora.org>
@ 2019-12-02 10:14   ` wgong
       [not found]   ` <82cf5270f491b1e40640eab23a3b9fb7@codeaurora.org>
  1 sibling, 0 replies; 4+ messages in thread
From: wgong @ 2019-12-02 10:14 UTC (permalink / raw)
  To: Kalle Valo; +Cc: ath10k, linux-wireless

On 2019-12-02 18:08, Kalle Valo wrote:
> Wen Gong <wgong@codeaurora.org> wrote:
> 
>> 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.
>> 
>> Signed-off-by: Wen Gong <wgong@codeaurora.org>
>> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
> 
> Patch applied to ath-next branch of ath.git, thanks.
> 
> 2dc016599cfa ath: add support for special 0x0 regulatory domain
But I did not see it in ath-next now.
https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/log/drivers/net/wireless/ath?h=ath-next
is it has some delay?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ath: add support for special 0x0 regulatory domain
       [not found]   ` <82cf5270f491b1e40640eab23a3b9fb7@codeaurora.org>
@ 2019-12-02 10:24     ` Kalle Valo
  0 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2019-12-02 10:24 UTC (permalink / raw)
  To: wgong; +Cc: ath10k, linux-wireless

wgong@codeaurora.org writes:

> On 2019-12-02 18:08, Kalle Valo wrote:
>> Wen Gong <wgong@codeaurora.org> wrote:
>>
>>> 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.
>>>
>>> Signed-off-by: Wen Gong <wgong@codeaurora.org>
>>> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
>>
>> Patch applied to ath-next branch of ath.git, thanks.
>>
>> 2dc016599cfa ath: add support for special 0x0 regulatory domain
> But I did not see it in ath-next now.
> https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/log/drivers/net/wireless/ath?h=ath-next
> is it has some delay?

Yes, it takes some time for me to apply other patches, merge branches,
servers sync etc. If you don't see the commit in the repository in 2
hours from me sending the "applied" mail, then do let me know as
something might be wrong. But before that just wait patiently :)

But now the commit is there:

https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=ath-next&id=2dc016599cfa9672a147528ca26d70c3654a5423

-- 
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-12-02 10:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-29  7:34 [PATCH] ath: add support for special 0x0 regulatory domain Wen Gong
2019-12-02 10:08 ` Kalle Valo
     [not found] ` <20191202100833.0C1B9C433CB@smtp.codeaurora.org>
2019-12-02 10:14   ` wgong
     [not found]   ` <82cf5270f491b1e40640eab23a3b9fb7@codeaurora.org>
2019-12-02 10:24     ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).