Skip to content

Commit f23ad96

Browse files
committed
mac80211: brcm: update RPi brcmfmac patches
- Reorganize brcmfmac patches. - Drop outdated RPi brcmfmac patches. - Add RPi 6.12 brcmfmac patches with "rpi-6.12" name tag (excluding SAE). Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
1 parent 8dbbca0 commit f23ad96

12 files changed

+1063
-54
lines changed

package/kernel/mac80211/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
1111
PKG_NAME:=mac80211
1212

1313
PKG_VERSION:=6.12.6
14-
PKG_RELEASE:=1
14+
PKG_RELEASE:=2
1515
PKG_LICENSE:=GPL-2.0-only
1616
PKG_LICENSE_FILES:=COPYING
1717

package/kernel/mac80211/patches/brcm/861-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch renamed to package/kernel/mac80211/patches/brcm/860-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch

File renamed without changes.

package/kernel/mac80211/patches/brcm/863-brcmfmac-add-in-driver-tables-with-country-codes.patch renamed to package/kernel/mac80211/patches/brcm/861-brcmfmac-add-in-driver-tables-with-country-codes.patch

File renamed without changes.

package/kernel/mac80211/patches/brcm/862-brcmfmac-Disable-power-management.patch

Lines changed: 0 additions & 27 deletions
This file was deleted.

package/kernel/mac80211/patches/brcm/864-brcmfmac-do-not-use-internal-roaming-engine-by-default.patch

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
From 88759af56f126e6e151f07fa9efc7447079fca9d Mon Sep 17 00:00:00 2001
2+
From: Cheong2K <cheong@redbear.cc>
3+
Date: Fri, 26 Feb 2016 18:20:10 +0800
4+
Subject: [PATCH] brcmfmac: adds support for BCM43341 wifi
5+
6+
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
7+
---
8+
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 3 ++-
9+
3 files changed, 4 insertions(+), 3 deletions(-)
10+
11+
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
12+
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
13+
@@ -609,6 +609,7 @@ BRCMF_FW_DEF(4329, "brcmfmac4329-sdio");
14+
BRCMF_FW_DEF(4330, "brcmfmac4330-sdio");
15+
BRCMF_FW_DEF(4334, "brcmfmac4334-sdio");
16+
BRCMF_FW_DEF(43340, "brcmfmac43340-sdio");
17+
+BRCMF_FW_DEF(43341, "brcmfmac43341-sdio");
18+
BRCMF_FW_DEF(4335, "brcmfmac4335-sdio");
19+
BRCMF_FW_DEF(43362, "brcmfmac43362-sdio");
20+
BRCMF_FW_DEF(4339, "brcmfmac4339-sdio");
21+
@@ -641,7 +642,7 @@ static const struct brcmf_firmware_mappi
22+
BRCMF_FW_ENTRY(BRCM_CC_4330_CHIP_ID, 0xFFFFFFFF, 4330),
23+
BRCMF_FW_ENTRY(BRCM_CC_4334_CHIP_ID, 0xFFFFFFFF, 4334),
24+
BRCMF_FW_ENTRY(BRCM_CC_43340_CHIP_ID, 0xFFFFFFFF, 43340),
25+
- BRCMF_FW_ENTRY(BRCM_CC_43341_CHIP_ID, 0xFFFFFFFF, 43340),
26+
+ BRCMF_FW_ENTRY(BRCM_CC_43341_CHIP_ID, 0xFFFFFFFF, 43341),
27+
BRCMF_FW_ENTRY(BRCM_CC_4335_CHIP_ID, 0xFFFFFFFF, 4335),
28+
BRCMF_FW_ENTRY(BRCM_CC_43362_CHIP_ID, 0xFFFFFFFE, 43362),
29+
BRCMF_FW_ENTRY(BRCM_CC_4339_CHIP_ID, 0xFFFFFFFF, 4339),
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
From 3ac592da09acb47b728ef320e9fecde55c8e0824 Mon Sep 17 00:00:00 2001
2+
From: Phil Elwell <phil@raspberrypi.com>
3+
Date: Fri, 26 Jun 2020 11:51:05 +0100
4+
Subject: [PATCH] brcmfmac: Prefer a ccode from OTP over nvram file
5+
6+
Allow the nvram file to set a default ccode (regulatory domain) without
7+
overriding one set in OTP.
8+
9+
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
10+
---
11+
.../broadcom/brcm80211/brcmfmac/cfg80211.c | 39 +++++++++++++------
12+
.../broadcom/brcm80211/brcmfmac/firmware.c | 21 +++++++++-
13+
2 files changed, 47 insertions(+), 13 deletions(-)
14+
15+
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
16+
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
17+
@@ -9,6 +9,7 @@
18+
#include <linux/etherdevice.h>
19+
#include <linux/module.h>
20+
#include <linux/vmalloc.h>
21+
+#include <linux/ctype.h>
22+
#include <net/cfg80211.h>
23+
#include <net/netlink.h>
24+
#include <uapi/linux/if_arp.h>
25+
@@ -8212,31 +8213,45 @@ static void brcmf_cfg80211_reg_notifier(
26+
struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
27+
struct brcmf_pub *drvr = cfg->pub;
28+
struct brcmf_fil_country_le ccreq;
29+
+ char *alpha2;
30+
s32 err;
31+
int i;
32+
33+
- /* The country code gets set to "00" by default at boot, ignore */
34+
- if (req->alpha2[0] == '0' && req->alpha2[1] == '0')
35+
+ err = brcmf_fil_iovar_data_get(ifp, "country", &ccreq, sizeof(ccreq));
36+
+ if (err) {
37+
+ bphy_err(drvr, "Country code iovar returned err = %d\n", err);
38+
return;
39+
+ }
40+
+
41+
+ /* The country code gets set to "00" by default at boot - substitute
42+
+ * any saved ccode from the nvram file unless there is a valid code
43+
+ * already set.
44+
+ */
45+
+ alpha2 = req->alpha2;
46+
+ if (alpha2[0] == '0' && alpha2[1] == '0') {
47+
+ extern char saved_ccode[2];
48+
+
49+
+ if ((isupper(ccreq.country_abbrev[0]) &&
50+
+ isupper(ccreq.country_abbrev[1])) ||
51+
+ !saved_ccode[0])
52+
+ return;
53+
+ alpha2 = saved_ccode;
54+
+ pr_debug("brcmfmac: substituting saved ccode %c%c\n",
55+
+ alpha2[0], alpha2[1]);
56+
+ }
57+
58+
/* ignore non-ISO3166 country codes */
59+
for (i = 0; i < 2; i++)
60+
- if (req->alpha2[i] < 'A' || req->alpha2[i] > 'Z') {
61+
+ if (alpha2[i] < 'A' || alpha2[i] > 'Z') {
62+
bphy_err(drvr, "not an ISO3166 code (0x%02x 0x%02x)\n",
63+
- req->alpha2[0], req->alpha2[1]);
64+
+ alpha2[0], alpha2[1]);
65+
return;
66+
}
67+
68+
brcmf_dbg(TRACE, "Enter: initiator=%d, alpha=%c%c\n", req->initiator,
69+
- req->alpha2[0], req->alpha2[1]);
70+
-
71+
- err = brcmf_fil_iovar_data_get(ifp, "country", &ccreq, sizeof(ccreq));
72+
- if (err) {
73+
- bphy_err(drvr, "Country code iovar returned err = %d\n", err);
74+
- return;
75+
- }
76+
+ alpha2[0], alpha2[1]);
77+
78+
- err = brcmf_translate_country_code(ifp->drvr, req->alpha2, &ccreq);
79+
+ err = brcmf_translate_country_code(ifp->drvr, alpha2, &ccreq);
80+
if (err)
81+
return;
82+
83+
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
84+
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
85+
@@ -10,6 +10,7 @@
86+
#include <linux/firmware.h>
87+
#include <linux/module.h>
88+
#include <linux/bcm47xx_nvram.h>
89+
+#include <linux/ctype.h>
90+
91+
#include "debug.h"
92+
#include "firmware.h"
93+
@@ -32,6 +33,8 @@ enum nvram_parser_state {
94+
END
95+
};
96+
97+
+char saved_ccode[2] = {};
98+
+
99+
/**
100+
* struct nvram_parser - internal info for parser.
101+
*
102+
@@ -562,11 +565,27 @@ static int brcmf_fw_request_nvram_done(c
103+
goto fail;
104+
}
105+
106+
- if (data)
107+
+ if (data) {
108+
+ char *ccode = strnstr((char *)data, "ccode=", data_len);
109+
+ /* Ensure this is a whole token */
110+
+ if (ccode && ((void *)ccode == (void *)data || isspace(ccode[-1]))) {
111+
+ /* Comment out the line */
112+
+ ccode[0] = '#';
113+
+ ccode += 6;
114+
+ if (isupper(ccode[0]) && isupper(ccode[1]) &&
115+
+ isspace(ccode[2])) {
116+
+ pr_debug("brcmfmac: intercepting ccode=%c%c\n",
117+
+ ccode[0], ccode[1]);
118+
+ saved_ccode[0] = ccode[0];
119+
+ saved_ccode[1] = ccode[1];
120+
+ }
121+
+ };
122+
+
123+
nvram = brcmf_fw_nvram_strip(data, data_len, &nvram_length,
124+
fwctx->req->domain_nr,
125+
fwctx->req->bus_nr,
126+
fwctx->dev);
127+
+ }
128+
129+
if (free_bcm47xx_nvram)
130+
bcm47xx_nvram_release_contents(data);
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
From 12722e472a963598a88011dd4b6805ed0a0e318f Mon Sep 17 00:00:00 2001
2+
From: Phil Elwell <phil@raspberrypi.com>
3+
Date: Mon, 3 Feb 2020 09:32:22 +0000
4+
Subject: [PATCH] brcmfmac: Increase power saving delay to 2s
5+
6+
Increase the delay before entering the lower power state to 2 seconds
7+
(the maximum allowed) in order to reduce the packet latencies,
8+
particularly for inbound packets.
9+
10+
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
11+
---
12+
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 3 ++-
13+
1 file changed, 2 insertions(+), 1 deletion(-)
14+
15+
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
16+
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
17+
@@ -3338,6 +3338,7 @@ brcmf_cfg80211_set_power_mgmt(struct wip
18+
bphy_err(drvr, "error (%d)\n", err);
19+
}
20+
21+
+ timeout = 2000; /* 2000ms - the maximum */
22+
err = brcmf_fil_iovar_int_set(ifp, "pm2_sleep_ret",
23+
min_t(u32, timeout, BRCMF_PS_MAX_TIMEOUT_MS));
24+
if (err)

0 commit comments

Comments
 (0)