aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/patches/brcm/103-v5.4-0001-brcmfmac-add-160MHz-in-chandef_to_chanspec.patch
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2019-07-21 11:23:32 +0200
committerRafał Miłecki <rafal@milecki.pl>2019-07-21 11:26:06 +0200
commitdb8e08a5a4469f98ed5d9b0ff3189e356f53d924 (patch)
treeed77c3914ebf100e23da982c7a334a695d902616 /package/kernel/mac80211/patches/brcm/103-v5.4-0001-brcmfmac-add-160MHz-in-chandef_to_chanspec.patch
parent3f1e8c01316a5ea0162197cd8eb6dbbabe396176 (diff)
downloadupstream-db8e08a5a4469f98ed5d9b0ff3189e356f53d924.tar.gz
upstream-db8e08a5a4469f98ed5d9b0ff3189e356f53d924.tar.bz2
upstream-db8e08a5a4469f98ed5d9b0ff3189e356f53d924.zip
mac80211: brcm: backport first set of 5.4 brcmfmac changes
This doesn't include 9ff8614a3dbe ("brcmfmac: use separate Kconfig file for brcmfmac") due to a few conflicts with backports changes. An important change is: [PATCH 2/7] brcmfmac: change the order of things in brcmf_detach() which fixes a rmmod crash in the brcmf_txfinalize(). Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'package/kernel/mac80211/patches/brcm/103-v5.4-0001-brcmfmac-add-160MHz-in-chandef_to_chanspec.patch')
-rw-r--r--package/kernel/mac80211/patches/brcm/103-v5.4-0001-brcmfmac-add-160MHz-in-chandef_to_chanspec.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/brcm/103-v5.4-0001-brcmfmac-add-160MHz-in-chandef_to_chanspec.patch b/package/kernel/mac80211/patches/brcm/103-v5.4-0001-brcmfmac-add-160MHz-in-chandef_to_chanspec.patch
new file mode 100644
index 0000000000..341a3b85e1
--- /dev/null
+++ b/package/kernel/mac80211/patches/brcm/103-v5.4-0001-brcmfmac-add-160MHz-in-chandef_to_chanspec.patch
@@ -0,0 +1,55 @@
+From 46f24cd5980de4302982d38ebb6620560ead10b3 Mon Sep 17 00:00:00 2001
+From: Arend van Spriel <arend.vanspriel@broadcom.com>
+Date: Thu, 11 Jul 2019 10:45:30 +0200
+Subject: [PATCH 1/3] brcmfmac: add 160MHz in chandef_to_chanspec()
+
+The function chandef_to_chanspec() was not handling 160MHz bandwidth
+resulting in wrong encoding of the channel. That resulting in firmware
+rejecting the provided channel specification.
+
+Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
+Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
+Reviewed-by: Franky Lin <franky.lin@broadcom.com>
+Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
+---
+ .../broadcom/brcm80211/brcmfmac/cfg80211.c | 21 ++++++++++++++++++-
+ 1 file changed, 20 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+@@ -276,8 +276,26 @@ static u16 chandef_to_chanspec(struct br
+ else
+ ch_inf.sb = BRCMU_CHAN_SB_UU;
+ break;
+- case NL80211_CHAN_WIDTH_80P80:
+ case NL80211_CHAN_WIDTH_160:
++ ch_inf.bw = BRCMU_CHAN_BW_160;
++ if (primary_offset == -70)
++ ch_inf.sb = BRCMU_CHAN_SB_LLL;
++ else if (primary_offset == -50)
++ ch_inf.sb = BRCMU_CHAN_SB_LLU;
++ else if (primary_offset == -30)
++ ch_inf.sb = BRCMU_CHAN_SB_LUL;
++ else if (primary_offset == -10)
++ ch_inf.sb = BRCMU_CHAN_SB_LUU;
++ else if (primary_offset == 10)
++ ch_inf.sb = BRCMU_CHAN_SB_ULL;
++ else if (primary_offset == 30)
++ ch_inf.sb = BRCMU_CHAN_SB_ULU;
++ else if (primary_offset == 50)
++ ch_inf.sb = BRCMU_CHAN_SB_UUL;
++ else
++ ch_inf.sb = BRCMU_CHAN_SB_UUU;
++ break;
++ case NL80211_CHAN_WIDTH_80P80:
+ case NL80211_CHAN_WIDTH_5:
+ case NL80211_CHAN_WIDTH_10:
+ default:
+@@ -296,6 +314,7 @@ static u16 chandef_to_chanspec(struct br
+ }
+ d11inf->encchspec(&ch_inf);
+
++ brcmf_dbg(TRACE, "chanspec: 0x%x\n", ch_inf.chspec);
+ return ch_inf.chspec;
+ }
+