mirror of
https://github.com/hanwckf/immortalwrt-mt798x.git
synced 2025-01-09 02:43:53 +08:00
mac80211: backport more brcmfmac changes queued for the 5.1
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
This commit is contained in:
parent
81adb132da
commit
2d139450a3
@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
|
||||
PKG_NAME:=mac80211
|
||||
|
||||
PKG_VERSION:=4.19.23-1
|
||||
PKG_RELEASE:=2
|
||||
PKG_RELEASE:=3
|
||||
PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v4.19.23/
|
||||
PKG_HASH:=703e940b542eb56067fcd847a7c69398dcc9829f34472647eea4211cb2ab3b83
|
||||
|
||||
|
@ -0,0 +1,28 @@
|
||||
From 1b5e2423164b3670e8bc9174e4762d297990deff Mon Sep 17 00:00:00 2001
|
||||
From: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Date: Thu, 14 Feb 2019 13:43:47 +0100
|
||||
Subject: [PATCH] brcmfmac: assure SSID length from firmware is limited
|
||||
|
||||
The SSID length as received from firmware should not exceed
|
||||
IEEE80211_MAX_SSID_LEN as that would result in heap overflow.
|
||||
|
||||
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>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
@@ -3499,6 +3499,8 @@ brcmf_wowl_nd_results(struct brcmf_if *i
|
||||
}
|
||||
|
||||
netinfo = brcmf_get_netinfo_array(pfn_result);
|
||||
+ if (netinfo->SSID_len > IEEE80211_MAX_SSID_LEN)
|
||||
+ netinfo->SSID_len = IEEE80211_MAX_SSID_LEN;
|
||||
memcpy(cfg->wowl.nd->ssid.ssid, netinfo->SSID, netinfo->SSID_len);
|
||||
cfg->wowl.nd->ssid.ssid_len = netinfo->SSID_len;
|
||||
cfg->wowl.nd->n_channels = 1;
|
@ -0,0 +1,96 @@
|
||||
From a4176ec356c73a46c07c181c6d04039fafa34a9f Mon Sep 17 00:00:00 2001
|
||||
From: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Date: Thu, 14 Feb 2019 13:43:48 +0100
|
||||
Subject: [PATCH] brcmfmac: add subtype check for event handling in data path
|
||||
|
||||
For USB there is no separate channel being used to pass events
|
||||
from firmware to the host driver and as such are passed over the
|
||||
data path. In order to detect mock event messages an additional
|
||||
check is needed on event subtype. This check is added conditionally
|
||||
using unlikely() keyword.
|
||||
|
||||
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>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
.../wireless/broadcom/brcm80211/brcmfmac/core.c | 5 +++--
|
||||
.../wireless/broadcom/brcm80211/brcmfmac/fweh.h | 16 ++++++++++++----
|
||||
.../broadcom/brcm80211/brcmfmac/msgbuf.c | 2 +-
|
||||
3 files changed, 16 insertions(+), 7 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
@@ -519,7 +519,8 @@ void brcmf_rx_frame(struct device *dev,
|
||||
} else {
|
||||
/* Process special event packets */
|
||||
if (handle_event)
|
||||
- brcmf_fweh_process_skb(ifp->drvr, skb);
|
||||
+ brcmf_fweh_process_skb(ifp->drvr, skb,
|
||||
+ BCMILCP_SUBTYPE_VENDOR_LONG);
|
||||
|
||||
brcmf_netif_rx(ifp, skb);
|
||||
}
|
||||
@@ -536,7 +537,7 @@ void brcmf_rx_event(struct device *dev,
|
||||
if (brcmf_rx_hdrpull(drvr, skb, &ifp))
|
||||
return;
|
||||
|
||||
- brcmf_fweh_process_skb(ifp->drvr, skb);
|
||||
+ brcmf_fweh_process_skb(ifp->drvr, skb, 0);
|
||||
brcmu_pkt_buf_free_skb(skb);
|
||||
}
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.h
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.h
|
||||
@@ -211,7 +211,7 @@ enum brcmf_fweh_event_code {
|
||||
*/
|
||||
#define BRCM_OUI "\x00\x10\x18"
|
||||
#define BCMILCP_BCM_SUBTYPE_EVENT 1
|
||||
-
|
||||
+#define BCMILCP_SUBTYPE_VENDOR_LONG 32769
|
||||
|
||||
/**
|
||||
* struct brcm_ethhdr - broadcom specific ether header.
|
||||
@@ -334,10 +334,10 @@ void brcmf_fweh_process_event(struct brc
|
||||
void brcmf_fweh_p2pdev_setup(struct brcmf_if *ifp, bool ongoing);
|
||||
|
||||
static inline void brcmf_fweh_process_skb(struct brcmf_pub *drvr,
|
||||
- struct sk_buff *skb)
|
||||
+ struct sk_buff *skb, u16 stype)
|
||||
{
|
||||
struct brcmf_event *event_packet;
|
||||
- u16 usr_stype;
|
||||
+ u16 subtype, usr_stype;
|
||||
|
||||
/* only process events when protocol matches */
|
||||
if (skb->protocol != cpu_to_be16(ETH_P_LINK_CTL))
|
||||
@@ -346,8 +346,16 @@ static inline void brcmf_fweh_process_sk
|
||||
if ((skb->len + ETH_HLEN) < sizeof(*event_packet))
|
||||
return;
|
||||
|
||||
- /* check for BRCM oui match */
|
||||
event_packet = (struct brcmf_event *)skb_mac_header(skb);
|
||||
+
|
||||
+ /* check subtype if needed */
|
||||
+ if (unlikely(stype)) {
|
||||
+ subtype = get_unaligned_be16(&event_packet->hdr.subtype);
|
||||
+ if (subtype != stype)
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ /* check for BRCM oui match */
|
||||
if (memcmp(BRCM_OUI, &event_packet->hdr.oui[0],
|
||||
sizeof(event_packet->hdr.oui)))
|
||||
return;
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
|
||||
@@ -1116,7 +1116,7 @@ static void brcmf_msgbuf_process_event(s
|
||||
|
||||
skb->protocol = eth_type_trans(skb, ifp->ndev);
|
||||
|
||||
- brcmf_fweh_process_skb(ifp->drvr, skb);
|
||||
+ brcmf_fweh_process_skb(ifp->drvr, skb, 0);
|
||||
|
||||
exit:
|
||||
brcmu_pkt_buf_free_skb(skb);
|
@ -0,0 +1,101 @@
|
||||
From aaf6a5e86e36766abbeedf220462bde8031f9a72 Mon Sep 17 00:00:00 2001
|
||||
From: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Date: Thu, 14 Feb 2019 13:43:49 +0100
|
||||
Subject: [PATCH] brcmfmac: create debugfs files for bus-specific layer
|
||||
|
||||
Since we moved the drivers debugfs directory under ieee80211 debugfs the
|
||||
debugfs entries need to be added after wiphy_register() has been called.
|
||||
For most part that has been done accordingly, but for the debugfs entries
|
||||
added by SDIO it was not and failed silently. This patch fixes that by
|
||||
adding a bus-layer callback for it.
|
||||
|
||||
Fixes: 856d5a011c86 ("brcmfmac: allocate struct brcmf_pub instance using wiphy_new()")
|
||||
Reported-by: Russel King <linux@armlinux.org.uk>
|
||||
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
|
||||
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
.../net/wireless/broadcom/brcm80211/brcmfmac/bus.h | 10 ++++++++++
|
||||
.../net/wireless/broadcom/brcm80211/brcmfmac/core.c | 1 +
|
||||
.../net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 12 +++++++-----
|
||||
3 files changed, 18 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
|
||||
@@ -90,6 +90,7 @@ struct brcmf_bus_ops {
|
||||
int (*get_memdump)(struct device *dev, void *data, size_t len);
|
||||
int (*get_fwname)(struct device *dev, const char *ext,
|
||||
unsigned char *fw_name);
|
||||
+ void (*debugfs_create)(struct device *dev);
|
||||
};
|
||||
|
||||
|
||||
@@ -235,6 +236,15 @@ int brcmf_bus_get_fwname(struct brcmf_bu
|
||||
return bus->ops->get_fwname(bus->dev, ext, fw_name);
|
||||
}
|
||||
|
||||
+static inline
|
||||
+void brcmf_bus_debugfs_create(struct brcmf_bus *bus)
|
||||
+{
|
||||
+ if (!bus->ops->debugfs_create)
|
||||
+ return;
|
||||
+
|
||||
+ return bus->ops->debugfs_create(bus->dev);
|
||||
+}
|
||||
+
|
||||
/*
|
||||
* interface functions from common layer
|
||||
*/
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
@@ -1177,6 +1177,7 @@ static int brcmf_bus_started(struct brcm
|
||||
brcmf_debugfs_add_entry(drvr, "revinfo", brcmf_revinfo_read);
|
||||
brcmf_feat_debugfs_create(drvr);
|
||||
brcmf_proto_debugfs_create(drvr);
|
||||
+ brcmf_bus_debugfs_create(bus_if);
|
||||
|
||||
return 0;
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
|
||||
@@ -3143,9 +3143,12 @@ static int brcmf_debugfs_sdio_count_read
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static void brcmf_sdio_debugfs_create(struct brcmf_sdio *bus)
|
||||
+static void brcmf_sdio_debugfs_create(struct device *dev)
|
||||
{
|
||||
- struct brcmf_pub *drvr = bus->sdiodev->bus_if->drvr;
|
||||
+ struct brcmf_bus *bus_if = dev_get_drvdata(dev);
|
||||
+ struct brcmf_pub *drvr = bus_if->drvr;
|
||||
+ struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio;
|
||||
+ struct brcmf_sdio *bus = sdiodev->bus;
|
||||
struct dentry *dentry = brcmf_debugfs_get_devdir(drvr);
|
||||
|
||||
if (IS_ERR_OR_NULL(dentry))
|
||||
@@ -3165,7 +3168,7 @@ static int brcmf_sdio_checkdied(struct b
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static void brcmf_sdio_debugfs_create(struct brcmf_sdio *bus)
|
||||
+static void brcmf_sdio_debugfs_create(struct device *dev)
|
||||
{
|
||||
}
|
||||
#endif /* DEBUG */
|
||||
@@ -3477,8 +3480,6 @@ static int brcmf_sdio_bus_preinit(struct
|
||||
if (bus->rxbuf)
|
||||
bus->rxblen = value;
|
||||
|
||||
- brcmf_sdio_debugfs_create(bus);
|
||||
-
|
||||
/* the commands below use the terms tx and rx from
|
||||
* a device perspective, ie. bus:txglom affects the
|
||||
* bus transfers from device to host.
|
||||
@@ -4088,6 +4089,7 @@ static const struct brcmf_bus_ops brcmf_
|
||||
.get_ramsize = brcmf_sdio_bus_get_ramsize,
|
||||
.get_memdump = brcmf_sdio_bus_get_memdump,
|
||||
.get_fwname = brcmf_sdio_get_fwname,
|
||||
+ .debugfs_create = brcmf_sdio_debugfs_create
|
||||
};
|
||||
|
||||
#define BRCMF_SDIO_FW_CODE 0
|
@ -0,0 +1,41 @@
|
||||
From 92d3b88b1029c46f9bf27302c502dc0e3541805b Mon Sep 17 00:00:00 2001
|
||||
From: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Date: Thu, 14 Feb 2019 13:43:50 +0100
|
||||
Subject: [PATCH] brcmfmac: disable MBSS feature for bcm4330 device
|
||||
|
||||
The MBSS feature was already disabled for bcm43362 as it resulted in a
|
||||
beacon with BRCM_TEST_SSID regardless user configuration in hostapd. Now
|
||||
the same has been reported for bcm4330 so disable the feature for this
|
||||
device as well.
|
||||
|
||||
Reported-by: Russell King <linux@armlinux.org.uk>
|
||||
Tested-by: Christopher Martin <chrsmrtn@gmail.com>
|
||||
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>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
.../net/wireless/broadcom/brcm80211/brcmfmac/feature.c | 10 ++++++++--
|
||||
1 file changed, 8 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
|
||||
@@ -272,9 +272,15 @@ void brcmf_feat_attach(struct brcmf_pub
|
||||
BIT(BRCMF_FEAT_WOWL_GTK);
|
||||
}
|
||||
}
|
||||
- /* MBSS does not work for 43362 */
|
||||
- if (drvr->bus_if->chip == BRCM_CC_43362_CHIP_ID)
|
||||
+ /* MBSS does not work for all chips */
|
||||
+ switch (drvr->bus_if->chip) {
|
||||
+ case BRCM_CC_4330_CHIP_ID:
|
||||
+ case BRCM_CC_43362_CHIP_ID:
|
||||
ifp->drvr->feat_flags &= ~BIT(BRCMF_FEAT_MBSS);
|
||||
+ break;
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_RSDB, "rsdb_mode");
|
||||
brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_TDLS, "tdls_enable");
|
||||
brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_MFP, "mfp");
|
@ -0,0 +1,121 @@
|
||||
From 4ab2cf03da91785f2c34d79a302e53da06928bc1 Mon Sep 17 00:00:00 2001
|
||||
From: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Date: Thu, 14 Feb 2019 13:43:51 +0100
|
||||
Subject: [PATCH] brcmfmac: check and dump trap info during sdio probe
|
||||
|
||||
When the firmware crashes during the probe sequence we provide little
|
||||
information on what really failed. This patch checks the sdpcm shared
|
||||
location and show the trap information if a firmware trap has happened.
|
||||
|
||||
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>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
.../broadcom/brcm80211/brcmfmac/sdio.c | 59 +++++++++++++------
|
||||
1 file changed, 40 insertions(+), 19 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
|
||||
@@ -2999,21 +2999,35 @@ static int brcmf_sdio_trap_info(struct s
|
||||
if (error < 0)
|
||||
return error;
|
||||
|
||||
- seq_printf(seq,
|
||||
- "dongle trap info: type 0x%x @ epc 0x%08x\n"
|
||||
- " cpsr 0x%08x spsr 0x%08x sp 0x%08x\n"
|
||||
- " lr 0x%08x pc 0x%08x offset 0x%x\n"
|
||||
- " r0 0x%08x r1 0x%08x r2 0x%08x r3 0x%08x\n"
|
||||
- " r4 0x%08x r5 0x%08x r6 0x%08x r7 0x%08x\n",
|
||||
- le32_to_cpu(tr.type), le32_to_cpu(tr.epc),
|
||||
- le32_to_cpu(tr.cpsr), le32_to_cpu(tr.spsr),
|
||||
- le32_to_cpu(tr.r13), le32_to_cpu(tr.r14),
|
||||
- le32_to_cpu(tr.pc), sh->trap_addr,
|
||||
- le32_to_cpu(tr.r0), le32_to_cpu(tr.r1),
|
||||
- le32_to_cpu(tr.r2), le32_to_cpu(tr.r3),
|
||||
- le32_to_cpu(tr.r4), le32_to_cpu(tr.r5),
|
||||
- le32_to_cpu(tr.r6), le32_to_cpu(tr.r7));
|
||||
-
|
||||
+ if (seq)
|
||||
+ seq_printf(seq,
|
||||
+ "dongle trap info: type 0x%x @ epc 0x%08x\n"
|
||||
+ " cpsr 0x%08x spsr 0x%08x sp 0x%08x\n"
|
||||
+ " lr 0x%08x pc 0x%08x offset 0x%x\n"
|
||||
+ " r0 0x%08x r1 0x%08x r2 0x%08x r3 0x%08x\n"
|
||||
+ " r4 0x%08x r5 0x%08x r6 0x%08x r7 0x%08x\n",
|
||||
+ le32_to_cpu(tr.type), le32_to_cpu(tr.epc),
|
||||
+ le32_to_cpu(tr.cpsr), le32_to_cpu(tr.spsr),
|
||||
+ le32_to_cpu(tr.r13), le32_to_cpu(tr.r14),
|
||||
+ le32_to_cpu(tr.pc), sh->trap_addr,
|
||||
+ le32_to_cpu(tr.r0), le32_to_cpu(tr.r1),
|
||||
+ le32_to_cpu(tr.r2), le32_to_cpu(tr.r3),
|
||||
+ le32_to_cpu(tr.r4), le32_to_cpu(tr.r5),
|
||||
+ le32_to_cpu(tr.r6), le32_to_cpu(tr.r7));
|
||||
+ else
|
||||
+ pr_debug("dongle trap info: type 0x%x @ epc 0x%08x\n"
|
||||
+ " cpsr 0x%08x spsr 0x%08x sp 0x%08x\n"
|
||||
+ " lr 0x%08x pc 0x%08x offset 0x%x\n"
|
||||
+ " r0 0x%08x r1 0x%08x r2 0x%08x r3 0x%08x\n"
|
||||
+ " r4 0x%08x r5 0x%08x r6 0x%08x r7 0x%08x\n",
|
||||
+ le32_to_cpu(tr.type), le32_to_cpu(tr.epc),
|
||||
+ le32_to_cpu(tr.cpsr), le32_to_cpu(tr.spsr),
|
||||
+ le32_to_cpu(tr.r13), le32_to_cpu(tr.r14),
|
||||
+ le32_to_cpu(tr.pc), sh->trap_addr,
|
||||
+ le32_to_cpu(tr.r0), le32_to_cpu(tr.r1),
|
||||
+ le32_to_cpu(tr.r2), le32_to_cpu(tr.r3),
|
||||
+ le32_to_cpu(tr.r4), le32_to_cpu(tr.r5),
|
||||
+ le32_to_cpu(tr.r6), le32_to_cpu(tr.r7));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3067,8 +3081,10 @@ static int brcmf_sdio_checkdied(struct b
|
||||
else if (sh.flags & SDPCM_SHARED_ASSERT)
|
||||
brcmf_err("assertion in dongle\n");
|
||||
|
||||
- if (sh.flags & SDPCM_SHARED_TRAP)
|
||||
+ if (sh.flags & SDPCM_SHARED_TRAP) {
|
||||
brcmf_err("firmware trap in dongle\n");
|
||||
+ brcmf_sdio_trap_info(NULL, bus, &sh);
|
||||
+ }
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -4199,7 +4215,7 @@ static void brcmf_sdio_firmware_callback
|
||||
} else {
|
||||
/* Disable F2 again */
|
||||
sdio_disable_func(sdiod->func2);
|
||||
- goto release;
|
||||
+ goto checkdied;
|
||||
}
|
||||
|
||||
if (brcmf_chip_sr_capable(bus->ci)) {
|
||||
@@ -4220,8 +4236,10 @@ static void brcmf_sdio_firmware_callback
|
||||
}
|
||||
|
||||
/* If we didn't come up, turn off backplane clock */
|
||||
- if (err != 0)
|
||||
+ if (err != 0) {
|
||||
brcmf_sdio_clkctl(bus, CLK_NONE, false);
|
||||
+ goto checkdied;
|
||||
+ }
|
||||
|
||||
sdio_release_host(sdiod->func1);
|
||||
|
||||
@@ -4235,12 +4253,15 @@ static void brcmf_sdio_firmware_callback
|
||||
err = brcmf_attach(sdiod->dev, sdiod->settings);
|
||||
if (err != 0) {
|
||||
brcmf_err("brcmf_attach failed\n");
|
||||
- goto fail;
|
||||
+ sdio_claim_host(sdiod->func1);
|
||||
+ goto checkdied;
|
||||
}
|
||||
|
||||
/* ready */
|
||||
return;
|
||||
|
||||
+checkdied:
|
||||
+ brcmf_sdio_checkdied(bus);
|
||||
release:
|
||||
sdio_release_host(sdiod->func1);
|
||||
fail:
|
@ -0,0 +1,42 @@
|
||||
From a250c91c1762e85c736e67cb4a9a95ebae72e62d Mon Sep 17 00:00:00 2001
|
||||
From: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Date: Thu, 14 Feb 2019 13:43:52 +0100
|
||||
Subject: [PATCH] brcmfmac: use chipname in brcmf_fw_alloc_request() for error
|
||||
path as well
|
||||
|
||||
The local variable chipname is string representation of chip id and revision
|
||||
which is printed in the good flow of brcmf_fw_alloc_request(). Also use it
|
||||
for the error path, ie. for unknown/unsupported devices.
|
||||
|
||||
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>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
|
||||
@@ -719,8 +719,10 @@ brcmf_fw_alloc_request(u32 chip, u32 chi
|
||||
break;
|
||||
}
|
||||
|
||||
+ brcmf_chip_name(chip, chiprev, chipname, sizeof(chipname));
|
||||
+
|
||||
if (i == table_size) {
|
||||
- brcmf_err("Unknown chipid %d [%d]\n", chip, chiprev);
|
||||
+ brcmf_err("Unknown chip %s\n", chipname);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -729,8 +731,6 @@ brcmf_fw_alloc_request(u32 chip, u32 chi
|
||||
if (!fwreq)
|
||||
return NULL;
|
||||
|
||||
- brcmf_chip_name(chip, chiprev, chipname, sizeof(chipname));
|
||||
-
|
||||
brcmf_info("using %s for chip %s\n",
|
||||
mapping_table[i].fw_base, chipname);
|
||||
|
@ -0,0 +1,67 @@
|
||||
From c988b78244df8216902e20de536434e2f474a37e Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Fri, 8 Feb 2019 15:24:39 +0100
|
||||
Subject: [PATCH] brcmfmac: print firmware reported ring status errors
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Firmware is capable of reporting ring status. It's used e.g. to signal
|
||||
some problem with a specific ring setup. This patch adds support for
|
||||
printing ring & error number which may be useful for debugging setup
|
||||
issues.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
.../broadcom/brcm80211/brcmfmac/msgbuf.c | 25 +++++++++++++++++++
|
||||
1 file changed, 25 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
|
||||
@@ -134,6 +134,14 @@ struct msgbuf_completion_hdr {
|
||||
__le16 flow_ring_id;
|
||||
};
|
||||
|
||||
+/* Data struct for the MSGBUF_TYPE_RING_STATUS */
|
||||
+struct msgbuf_ring_status {
|
||||
+ struct msgbuf_common_hdr msg;
|
||||
+ struct msgbuf_completion_hdr compl_hdr;
|
||||
+ __le16 write_idx;
|
||||
+ __le32 rsvd0[5];
|
||||
+};
|
||||
+
|
||||
struct msgbuf_rx_event {
|
||||
struct msgbuf_common_hdr msg;
|
||||
struct msgbuf_completion_hdr compl_hdr;
|
||||
@@ -1180,6 +1188,19 @@ brcmf_msgbuf_process_rx_complete(struct
|
||||
brcmf_netif_rx(ifp, skb);
|
||||
}
|
||||
|
||||
+static void brcmf_msgbuf_process_ring_status(struct brcmf_msgbuf *msgbuf,
|
||||
+ void *buf)
|
||||
+{
|
||||
+ struct msgbuf_ring_status *ring_status = buf;
|
||||
+ int err;
|
||||
+
|
||||
+ err = le16_to_cpu(ring_status->compl_hdr.status);
|
||||
+ if (err) {
|
||||
+ int ring = le16_to_cpu(ring_status->compl_hdr.flow_ring_id);
|
||||
+
|
||||
+ brcmf_err("Firmware reported ring %d error: %d\n", ring, err);
|
||||
+ }
|
||||
+}
|
||||
|
||||
static void
|
||||
brcmf_msgbuf_process_flow_ring_create_response(struct brcmf_msgbuf *msgbuf,
|
||||
@@ -1241,6 +1262,10 @@ static void brcmf_msgbuf_process_msgtype
|
||||
|
||||
msg = (struct msgbuf_common_hdr *)buf;
|
||||
switch (msg->msgtype) {
|
||||
+ case MSGBUF_TYPE_RING_STATUS:
|
||||
+ brcmf_dbg(MSGBUF, "MSGBUF_TYPE_RING_STATUS\n");
|
||||
+ brcmf_msgbuf_process_ring_status(msgbuf, buf);
|
||||
+ break;
|
||||
case MSGBUF_TYPE_FLOW_RING_CREATE_CMPLT:
|
||||
brcmf_dbg(MSGBUF, "MSGBUF_TYPE_FLOW_RING_CREATE_CMPLT\n");
|
||||
brcmf_msgbuf_process_flow_ring_create_response(msgbuf, buf);
|
@ -0,0 +1,42 @@
|
||||
From f4e183293b871c96c0220dcc549d5ca4c72628ad Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Mon, 11 Feb 2019 23:04:53 +0100
|
||||
Subject: [PATCH] brcmfmac: improve code handling bandwidth of firmware
|
||||
reported channels
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
1) Use switch to simplify/improve the code & avoid some duplication
|
||||
2) Add warning for unsupported values
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
.../wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 13 ++++++++++---
|
||||
1 file changed, 10 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
@@ -6043,11 +6043,18 @@ static int brcmf_construct_chaninfo(stru
|
||||
/* assuming the chanspecs order is HT20,
|
||||
* HT40 upper, HT40 lower, and VHT80.
|
||||
*/
|
||||
- if (ch.bw == BRCMU_CHAN_BW_80) {
|
||||
+ switch (ch.bw) {
|
||||
+ case BRCMU_CHAN_BW_80:
|
||||
channel->flags &= ~IEEE80211_CHAN_NO_80MHZ;
|
||||
- } else if (ch.bw == BRCMU_CHAN_BW_40) {
|
||||
+ break;
|
||||
+ case BRCMU_CHAN_BW_40:
|
||||
brcmf_update_bw40_channel_flag(channel, &ch);
|
||||
- } else {
|
||||
+ break;
|
||||
+ default:
|
||||
+ wiphy_warn(wiphy, "Firmware reported unsupported bandwidth %d\n",
|
||||
+ ch.bw);
|
||||
+ /* fall through */
|
||||
+ case BRCMU_CHAN_BW_20:
|
||||
/* enable the channel and disable other bandwidths
|
||||
* for now as mentioned order assure they are enabled
|
||||
* for subsequent chanspecs.
|
@ -0,0 +1,30 @@
|
||||
From 30519cbe339a45bd11a57ca8ece07f4f6a1cda2e Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Mon, 11 Feb 2019 23:04:54 +0100
|
||||
Subject: [PATCH] brcmfmac: support firmware reporting 160 MHz channels
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
So far 160 MHz channels were treated as 20 MHz ones which was breaking
|
||||
support for 40/80 MHz due to the brcmf_construct_chaninfo() logic and
|
||||
its assumptions.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
@@ -6044,6 +6044,9 @@ static int brcmf_construct_chaninfo(stru
|
||||
* HT40 upper, HT40 lower, and VHT80.
|
||||
*/
|
||||
switch (ch.bw) {
|
||||
+ case BRCMU_CHAN_BW_160:
|
||||
+ channel->flags &= ~IEEE80211_CHAN_NO_160MHZ;
|
||||
+ break;
|
||||
case BRCMU_CHAN_BW_80:
|
||||
channel->flags &= ~IEEE80211_CHAN_NO_80MHZ;
|
||||
break;
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,38 @@
|
||||
From e4d1b2716b8859199c28f2ac5f984bd05a146a6b Mon Sep 17 00:00:00 2001
|
||||
From: YueHaibing <yuehaibing@huawei.com>
|
||||
Date: Mon, 18 Feb 2019 08:08:46 +0000
|
||||
Subject: [PATCH] brcmfmac: remove set but not used variable 'old_state'
|
||||
|
||||
Fixes gcc '-Wunused-but-set-variable' warning:
|
||||
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c: In function 'brcmf_usb_state_change':
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c:578:6: warning:
|
||||
variable 'old_state' set but not used [-Wunused-but-set-variable]
|
||||
|
||||
It's never used and can be removed.
|
||||
|
||||
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
|
||||
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
|
||||
@@ -575,7 +575,6 @@ static void
|
||||
brcmf_usb_state_change(struct brcmf_usbdev_info *devinfo, int state)
|
||||
{
|
||||
struct brcmf_bus *bcmf_bus = devinfo->bus_pub.bus;
|
||||
- int old_state;
|
||||
|
||||
brcmf_dbg(USB, "Enter, current state=%d, new state=%d\n",
|
||||
devinfo->bus_pub.state, state);
|
||||
@@ -583,7 +582,6 @@ brcmf_usb_state_change(struct brcmf_usbd
|
||||
if (devinfo->bus_pub.state == state)
|
||||
return;
|
||||
|
||||
- old_state = devinfo->bus_pub.state;
|
||||
devinfo->bus_pub.state = state;
|
||||
|
||||
/* update state of upper layer */
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,38 @@
|
||||
From e0a8ef4d7b4315bc4c1641fb3f3a7dfdfa6627b8 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Wed, 20 Feb 2019 11:30:47 +0100
|
||||
Subject: [PATCH] brcmfmac: add basic validation of shared RAM address
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
While experimenting with firmware loading I ended up in a state of
|
||||
firmware reporting shared RAM address 0x04000001. It was causing:
|
||||
[ 94.448015] Unable to handle kernel paging request at virtual address cd680001
|
||||
due to reading out of the mapped memory.
|
||||
|
||||
This patch adds some basic validation to avoid kernel crashes due to the
|
||||
unexpected firmware behavior.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
@@ -1560,6 +1560,12 @@ static int brcmf_pcie_download_fw_nvram(
|
||||
brcmf_err(bus, "FW failed to initialize\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
+ if (sharedram_addr < devinfo->ci->rambase ||
|
||||
+ sharedram_addr >= devinfo->ci->rambase + devinfo->ci->ramsize) {
|
||||
+ brcmf_err(bus, "Invalid shared RAM address 0x%08x\n",
|
||||
+ sharedram_addr);
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
brcmf_dbg(PCIE, "Shared RAM addr: 0x%08x\n", sharedram_addr);
|
||||
|
||||
return (brcmf_pcie_init_share_ram_info(devinfo, sharedram_addr));
|
@ -13,7 +13,7 @@ Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
@@ -1402,6 +1402,7 @@ int __init brcmf_core_init(void)
|
||||
@@ -1408,6 +1408,7 @@ int __init brcmf_core_init(void)
|
||||
{
|
||||
if (!schedule_work(&brcmf_driver_work))
|
||||
return -EBUSY;
|
||||
|
@ -10,12 +10,11 @@ Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
@@ -616,9 +616,37 @@ static struct wireless_dev *brcmf_cfg802
|
||||
enum nl80211_iftype type,
|
||||
struct vif_params *params)
|
||||
{
|
||||
+ struct net_device *dev;
|
||||
@@ -620,8 +620,36 @@ static struct wireless_dev *brcmf_cfg802
|
||||
struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
|
||||
struct brcmf_pub *drvr = cfg->pub;
|
||||
struct wireless_dev *wdev;
|
||||
+ struct net_device *dev;
|
||||
int err;
|
||||
|
||||
+ /*
|
||||
|
@ -14,7 +14,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
@@ -2752,6 +2752,10 @@ brcmf_cfg80211_set_power_mgmt(struct wip
|
||||
@@ -2774,6 +2774,10 @@ brcmf_cfg80211_set_power_mgmt(struct wip
|
||||
* preference in cfg struct to apply this to
|
||||
* FW later while initializing the dongle
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user