All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] brcmfmac: firmware: Treat EFI nvram ccode=XT the same as ccode=XV
@ 2021-10-03 16:03 Hans de Goede
  2021-10-05  5:36 ` Kalle Valo
  0 siblings, 1 reply; 6+ messages in thread
From: Hans de Goede @ 2021-10-03 16:03 UTC (permalink / raw)
  To: Arend van Spriel, Franky Lin, Hante Meuleman, Kalle Valo,
	Chi-Hsien Lin, Chung-hsien Hsu, Wright Feng
  Cc: Hans de Goede, linux-wireless, brcm80211-dev-list.pdl,
	SHA-cyfmac-dev-list

In some cases the EFI-var stored nvram contains "ccode=ALL", "ccode=XV"
or "ccode=XT", to specify "worldwide" compatible settings, but these
ccode-s do not work properly. "ccode=ALL" causes channels 12 and 13 to
not be available, "ccode=XV" / "ccode=XT" may cause all 5GHz channels
to not be available.

ccode="ALL" and ccode="XV" where already being replaced with ccode="X2"
with a bit of special handling for nvram settings coming from an EFI
variable. Extend this handling to also deal with nvram settings from
EFI variables which contain "ccode=XT", which has similar issues to
"ccode=XV".

This fixes 5GHz wifi not working on the HP ElitePad 1000 G2.

This was also tested on a Lenovo Thinkpad 8 tablet which also uses
"ccode=XT" and this causes no adverse effects there.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 .../wireless/broadcom/brcm80211/brcmfmac/firmware.c    | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
index 0eb13e5df517..f150af8ede21 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
@@ -432,10 +432,10 @@ struct brcmf_fw {
 };
 
 #ifdef CONFIG_EFI
-/* In some cases the EFI-var stored nvram contains "ccode=ALL" or "ccode=XV"
- * to specify "worldwide" compatible settings, but these 2 ccode-s do not work
- * properly. "ccode=ALL" causes channels 12 and 13 to not be available,
- * "ccode=XV" causes all 5GHz channels to not be available. So we replace both
+/* In some cases the EFI-var stored nvram contains "ccode=ALL", "ccode=XV" or "ccode=XT",
+ * to specify "worldwide" compatible settings, but these ccode-s do not work properly.
+ * "ccode=ALL" causes channels 12 and 13 to not be available, "ccode=XV" / "ccode=XT"
+ * may cause all 5GHz channels to not be available. So we replace these
  * with "ccode=X2" which allows channels 12+13 and 5Ghz channels in
  * no-Initiate-Radiation mode. This means that we will never send on these
  * channels without first having received valid wifi traffic on the channel.
@@ -447,6 +447,8 @@ static void brcmf_fw_fix_efi_nvram_ccode(char *data, unsigned long data_len)
 	ccode = strnstr((char *)data, "ccode=ALL", data_len);
 	if (!ccode)
 		ccode = strnstr((char *)data, "ccode=XV\r", data_len);
+	if (!ccode)
+		ccode = strnstr((char *)data, "ccode=XT\r", data_len);
 	if (!ccode)
 		return;
 
-- 
2.31.1


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

end of thread, other threads:[~2021-10-23 11:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-03 16:03 [PATCH] brcmfmac: firmware: Treat EFI nvram ccode=XT the same as ccode=XV Hans de Goede
2021-10-05  5:36 ` Kalle Valo
2021-10-05  8:02   ` Hans de Goede
2021-10-05  8:37     ` Arend van Spriel
2021-10-11  6:08       ` Kalle Valo
2021-10-23 11:12       ` Hans de Goede

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.