Signed-off-by: Rafał Miłecki <rafal@milecki.pl>master
parent
0994e65c6a
commit
9485ea721e
@ -0,0 +1,51 @@ |
|||||||
|
From 4d95f99c59b8b814bcf09ba86020d937ec7caa86 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Hans de Goede <hdegoede@redhat.com>
|
||||||
|
Date: Thu, 20 Dec 2018 17:40:58 +0100
|
||||||
|
Subject: [PATCH] brcmfmac: Add DMI nvram filename quirk for PoV TAB-P1006W-232
|
||||||
|
tablet
|
||||||
|
|
||||||
|
The Point of View TAB-P1006W-232 tablet contains quite generic names in
|
||||||
|
the sys_vendor and product_name DMI strings, without this patch brcmfmac
|
||||||
|
will try to load: brcmfmac43340-sdio.Insyde-BayTrail.txt as nvram file
|
||||||
|
which is a bit too generic.
|
||||||
|
|
||||||
|
Add a DMI quirk so that a unique and clearly identifiable nvram file
|
||||||
|
name is used on the PoV TAB-P1006W-232 tablet.
|
||||||
|
|
||||||
|
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||||
|
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||||
|
---
|
||||||
|
.../wireless/broadcom/brcm80211/brcmfmac/dmi.c | 15 +++++++++++++++
|
||||||
|
1 file changed, 15 insertions(+)
|
||||||
|
|
||||||
|
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/dmi.c
|
||||||
|
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/dmi.c
|
||||||
|
@@ -43,6 +43,10 @@ static const struct brcmf_dmi_data meego
|
||||||
|
BRCM_CC_43340_CHIP_ID, 2, "meegopad-t08"
|
||||||
|
};
|
||||||
|
|
||||||
|
+static const struct brcmf_dmi_data pov_tab_p1006w_data = {
|
||||||
|
+ BRCM_CC_43340_CHIP_ID, 2, "pov-tab-p1006w-data"
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
static const struct dmi_system_id dmi_platform_data[] = {
|
||||||
|
{
|
||||||
|
/* Match for the GPDwin which unfortunately uses somewhat
|
||||||
|
@@ -81,6 +85,17 @@ static const struct dmi_system_id dmi_pl
|
||||||
|
},
|
||||||
|
.driver_data = (void *)&meegopad_t08_data,
|
||||||
|
},
|
||||||
|
+ {
|
||||||
|
+ /* Point of View TAB-P1006W-232 */
|
||||||
|
+ .matches = {
|
||||||
|
+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Insyde"),
|
||||||
|
+ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "BayTrail"),
|
||||||
|
+ /* Note 105b is Foxcon's USB/PCI vendor id */
|
||||||
|
+ DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "105B"),
|
||||||
|
+ DMI_EXACT_MATCH(DMI_BOARD_NAME, "0E57"),
|
||||||
|
+ },
|
||||||
|
+ .driver_data = (void *)&pov_tab_p1006w_data,
|
||||||
|
+ },
|
||||||
|
{}
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,28 @@ |
|||||||
|
From 42daad3343be4a4e1ee03e30a5f5cc731dadfef5 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Kangjie Lu <kjlu@umn.edu>
|
||||||
|
Date: Tue, 25 Dec 2018 19:22:24 -0600
|
||||||
|
Subject: [PATCH] brcmfmac: add a check for the status of usb_register
|
||||||
|
|
||||||
|
usb_register() may fail, so let's check its status and issue an error
|
||||||
|
message if it fails.
|
||||||
|
|
||||||
|
Signed-off-by: Kangjie Lu <kjlu@umn.edu>
|
||||||
|
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||||
|
---
|
||||||
|
drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 6 +++++-
|
||||||
|
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
|
||||||
|
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
|
||||||
|
@@ -1552,6 +1552,10 @@ void brcmf_usb_exit(void)
|
||||||
|
|
||||||
|
void brcmf_usb_register(void)
|
||||||
|
{
|
||||||
|
+ int ret;
|
||||||
|
+
|
||||||
|
brcmf_dbg(USB, "Enter\n");
|
||||||
|
- usb_register(&brcmf_usbdrvr);
|
||||||
|
+ ret = usb_register(&brcmf_usbdrvr);
|
||||||
|
+ if (ret)
|
||||||
|
+ brcmf_err("usb_register failed %d\n", ret);
|
||||||
|
}
|
@ -0,0 +1,33 @@ |
|||||||
|
From 3a33bd840523aaa06f4429fbfd38922bf0dc2e8d Mon Sep 17 00:00:00 2001
|
||||||
|
From: Lo-Hsiang Lo <double.lo@cypress.com>
|
||||||
|
Date: Mon, 7 Jan 2019 08:46:16 +0000
|
||||||
|
Subject: [PATCH] brcmfmac: fix system warning message during wowl suspend
|
||||||
|
|
||||||
|
There is a system warning message, warn_slowpath-fmt, during suspend
|
||||||
|
while using supplicant join AP and enable wowl feature by IW command.
|
||||||
|
It's caused by brcmf_pno_remove_request path can't find the reqid.
|
||||||
|
This fix will not go to remove pno request function if there is no
|
||||||
|
pno scan.
|
||||||
|
|
||||||
|
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||||
|
Signed-off-by: Lo-Hsiang Lo <double.lo@cypress.com>
|
||||||
|
Signed-off-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
|
||||||
|
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||||
|
---
|
||||||
|
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c | 5 +++++
|
||||||
|
1 file changed, 5 insertions(+)
|
||||||
|
|
||||||
|
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c
|
||||||
|
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c
|
||||||
|
@@ -496,6 +496,11 @@ int brcmf_pno_stop_sched_scan(struct brc
|
||||||
|
brcmf_dbg(TRACE, "reqid=%llu\n", reqid);
|
||||||
|
|
||||||
|
pi = ifp_to_pno(ifp);
|
||||||
|
+
|
||||||
|
+ /* No PNO request */
|
||||||
|
+ if (!pi->n_reqs)
|
||||||
|
+ return 0;
|
||||||
|
+
|
||||||
|
err = brcmf_pno_remove_request(pi, reqid);
|
||||||
|
if (err)
|
||||||
|
return err;
|
@ -0,0 +1,104 @@ |
|||||||
|
From 5cc898fbcb352b764f8d51c16e10e2eb0056173d Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||||
|
Date: Wed, 6 Feb 2019 12:28:15 +0100
|
||||||
|
Subject: [PATCH] brcmfmac: modify __brcmf_err() to take bus as a parameter
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
So far __brcmf_err() was using pr_err() which didn't allow identifying
|
||||||
|
device that was affected by an error. It's crucial for systems with more
|
||||||
|
than 1 device supported by brcmfmac (a common case for home routers).
|
||||||
|
|
||||||
|
This change allows passing struct brcmf_bus to the __brcmf_err(). That
|
||||||
|
struct has been agreed to be the most common one. It allows accessing
|
||||||
|
struct device easily & using dev_err() printing helper.
|
||||||
|
|
||||||
|
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>
|
||||||
|
---
|
||||||
|
.../net/wireless/broadcom/brcm80211/brcmfmac/common.c | 7 +++++--
|
||||||
|
drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h | 8 +++++---
|
||||||
|
.../wireless/broadcom/brcm80211/brcmfmac/tracepoint.c | 9 +++++++--
|
||||||
|
3 files changed, 17 insertions(+), 7 deletions(-)
|
||||||
|
|
||||||
|
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
|
||||||
|
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
|
||||||
|
@@ -350,7 +350,7 @@ done:
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef CPTCFG_BRCM_TRACING
|
||||||
|
-void __brcmf_err(const char *func, const char *fmt, ...)
|
||||||
|
+void __brcmf_err(struct brcmf_bus *bus, const char *func, const char *fmt, ...)
|
||||||
|
{
|
||||||
|
struct va_format vaf;
|
||||||
|
va_list args;
|
||||||
|
@@ -359,7 +359,10 @@ void __brcmf_err(const char *func, const
|
||||||
|
|
||||||
|
vaf.fmt = fmt;
|
||||||
|
vaf.va = &args;
|
||||||
|
- pr_err("%s: %pV", func, &vaf);
|
||||||
|
+ if (bus)
|
||||||
|
+ dev_err(bus->dev, "%s: %pV", func, &vaf);
|
||||||
|
+ else
|
||||||
|
+ pr_err("%s: %pV", func, &vaf);
|
||||||
|
|
||||||
|
va_end(args);
|
||||||
|
}
|
||||||
|
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h
|
||||||
|
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h
|
||||||
|
@@ -45,8 +45,10 @@
|
||||||
|
#undef pr_fmt
|
||||||
|
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||||
|
|
||||||
|
-__printf(2, 3)
|
||||||
|
-void __brcmf_err(const char *func, const char *fmt, ...);
|
||||||
|
+struct brcmf_bus;
|
||||||
|
+
|
||||||
|
+__printf(3, 4)
|
||||||
|
+void __brcmf_err(struct brcmf_bus *bus, const char *func, const char *fmt, ...);
|
||||||
|
/* Macro for error messages. When debugging / tracing the driver all error
|
||||||
|
* messages are important to us.
|
||||||
|
*/
|
||||||
|
@@ -55,7 +57,7 @@ void __brcmf_err(const char *func, const
|
||||||
|
if (IS_ENABLED(CPTCFG_BRCMDBG) || \
|
||||||
|
IS_ENABLED(CPTCFG_BRCM_TRACING) || \
|
||||||
|
net_ratelimit()) \
|
||||||
|
- __brcmf_err(__func__, fmt, ##__VA_ARGS__); \
|
||||||
|
+ __brcmf_err(NULL, __func__, fmt, ##__VA_ARGS__);\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#if defined(DEBUG) || defined(CPTCFG_BRCM_TRACING)
|
||||||
|
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.c
|
||||||
|
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.c
|
||||||
|
@@ -14,14 +14,16 @@
|
||||||
|
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
+#include <linux/device.h>
|
||||||
|
#include <linux/module.h> /* bug in tracepoint.h, it should include this */
|
||||||
|
|
||||||
|
#ifndef __CHECKER__
|
||||||
|
#define CREATE_TRACE_POINTS
|
||||||
|
+#include "bus.h"
|
||||||
|
#include "tracepoint.h"
|
||||||
|
#include "debug.h"
|
||||||
|
|
||||||
|
-void __brcmf_err(const char *func, const char *fmt, ...)
|
||||||
|
+void __brcmf_err(struct brcmf_bus *bus, const char *func, const char *fmt, ...)
|
||||||
|
{
|
||||||
|
struct va_format vaf = {
|
||||||
|
.fmt = fmt,
|
||||||
|
@@ -30,7 +32,10 @@ void __brcmf_err(const char *func, const
|
||||||
|
|
||||||
|
va_start(args, fmt);
|
||||||
|
vaf.va = &args;
|
||||||
|
- pr_err("%s: %pV", func, &vaf);
|
||||||
|
+ if (bus)
|
||||||
|
+ dev_err(bus->dev, "%s: %pV", func, &vaf);
|
||||||
|
+ else
|
||||||
|
+ pr_err("%s: %pV", func, &vaf);
|
||||||
|
trace_brcmf_err(func, &vaf);
|
||||||
|
va_end(args);
|
||||||
|
}
|
@ -0,0 +1,266 @@ |
|||||||
|
From 8602e62441aba276cafd68034b72162fbc5ca0a6 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||||
|
Date: Wed, 6 Feb 2019 12:28:16 +0100
|
||||||
|
Subject: [PATCH] brcmfmac: pass bus to the __brcmf_err() in pcie.c
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
This enables dev_err() usage (instead of pr_err()) in the __brcmf_err().
|
||||||
|
It makes error messages more meaningful and is important for debugging
|
||||||
|
errors/bugs on systems with multiple brcmfmac supported devices.
|
||||||
|
|
||||||
|
All bus files should follow & get updated similarly (soon).
|
||||||
|
|
||||||
|
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||||
|
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||||
|
---
|
||||||
|
.../broadcom/brcm80211/brcmfmac/debug.h | 2 +
|
||||||
|
.../broadcom/brcm80211/brcmfmac/pcie.c | 59 +++++++++++--------
|
||||||
|
2 files changed, 38 insertions(+), 23 deletions(-)
|
||||||
|
|
||||||
|
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h
|
||||||
|
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h
|
||||||
|
@@ -52,6 +52,7 @@ void __brcmf_err(struct brcmf_bus *bus,
|
||||||
|
/* Macro for error messages. When debugging / tracing the driver all error
|
||||||
|
* messages are important to us.
|
||||||
|
*/
|
||||||
|
+#ifndef brcmf_err
|
||||||
|
#define brcmf_err(fmt, ...) \
|
||||||
|
do { \
|
||||||
|
if (IS_ENABLED(CPTCFG_BRCMDBG) || \
|
||||||
|
@@ -59,6 +60,7 @@ void __brcmf_err(struct brcmf_bus *bus,
|
||||||
|
net_ratelimit()) \
|
||||||
|
__brcmf_err(NULL, __func__, fmt, ##__VA_ARGS__);\
|
||||||
|
} while (0)
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
#if defined(DEBUG) || defined(CPTCFG_BRCM_TRACING)
|
||||||
|
|
||||||
|
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||||
|
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||||
|
@@ -30,6 +30,15 @@
|
||||||
|
#include <brcmu_wifi.h>
|
||||||
|
#include <brcm_hw_ids.h>
|
||||||
|
|
||||||
|
+/* Custom brcmf_err() that takes bus arg and passes it further */
|
||||||
|
+#define brcmf_err(bus, fmt, ...) \
|
||||||
|
+ do { \
|
||||||
|
+ if (IS_ENABLED(CPTCFG_BRCMDBG) || \
|
||||||
|
+ IS_ENABLED(CPTCFG_BRCM_TRACING) || \
|
||||||
|
+ net_ratelimit()) \
|
||||||
|
+ __brcmf_err(bus, __func__, fmt, ##__VA_ARGS__); \
|
||||||
|
+ } while (0)
|
||||||
|
+
|
||||||
|
#include "debug.h"
|
||||||
|
#include "bus.h"
|
||||||
|
#include "commonring.h"
|
||||||
|
@@ -531,6 +540,7 @@ static void
|
||||||
|
brcmf_pcie_select_core(struct brcmf_pciedev_info *devinfo, u16 coreid)
|
||||||
|
{
|
||||||
|
const struct pci_dev *pdev = devinfo->pdev;
|
||||||
|
+ struct brcmf_bus *bus = dev_get_drvdata(&pdev->dev);
|
||||||
|
struct brcmf_core *core;
|
||||||
|
u32 bar0_win;
|
||||||
|
|
||||||
|
@@ -548,7 +558,7 @@ brcmf_pcie_select_core(struct brcmf_pcie
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
- brcmf_err("Unsupported core selected %x\n", coreid);
|
||||||
|
+ brcmf_err(bus, "Unsupported core selected %x\n", coreid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -848,9 +858,8 @@ static irqreturn_t brcmf_pcie_isr_thread
|
||||||
|
|
||||||
|
static int brcmf_pcie_request_irq(struct brcmf_pciedev_info *devinfo)
|
||||||
|
{
|
||||||
|
- struct pci_dev *pdev;
|
||||||
|
-
|
||||||
|
- pdev = devinfo->pdev;
|
||||||
|
+ struct pci_dev *pdev = devinfo->pdev;
|
||||||
|
+ struct brcmf_bus *bus = dev_get_drvdata(&pdev->dev);
|
||||||
|
|
||||||
|
brcmf_pcie_intr_disable(devinfo);
|
||||||
|
|
||||||
|
@@ -861,7 +870,7 @@ static int brcmf_pcie_request_irq(struct
|
||||||
|
brcmf_pcie_isr_thread, IRQF_SHARED,
|
||||||
|
"brcmf_pcie_intr", devinfo)) {
|
||||||
|
pci_disable_msi(pdev);
|
||||||
|
- brcmf_err("Failed to request IRQ %d\n", pdev->irq);
|
||||||
|
+ brcmf_err(bus, "Failed to request IRQ %d\n", pdev->irq);
|
||||||
|
return -EIO;
|
||||||
|
}
|
||||||
|
devinfo->irq_allocated = true;
|
||||||
|
@@ -871,15 +880,14 @@ static int brcmf_pcie_request_irq(struct
|
||||||
|
|
||||||
|
static void brcmf_pcie_release_irq(struct brcmf_pciedev_info *devinfo)
|
||||||
|
{
|
||||||
|
- struct pci_dev *pdev;
|
||||||
|
+ struct pci_dev *pdev = devinfo->pdev;
|
||||||
|
+ struct brcmf_bus *bus = dev_get_drvdata(&pdev->dev);
|
||||||
|
u32 status;
|
||||||
|
u32 count;
|
||||||
|
|
||||||
|
if (!devinfo->irq_allocated)
|
||||||
|
return;
|
||||||
|
|
||||||
|
- pdev = devinfo->pdev;
|
||||||
|
-
|
||||||
|
brcmf_pcie_intr_disable(devinfo);
|
||||||
|
free_irq(pdev->irq, devinfo);
|
||||||
|
pci_disable_msi(pdev);
|
||||||
|
@@ -891,7 +899,7 @@ static void brcmf_pcie_release_irq(struc
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
if (devinfo->in_irq)
|
||||||
|
- brcmf_err("Still in IRQ (processing) !!!\n");
|
||||||
|
+ brcmf_err(bus, "Still in IRQ (processing) !!!\n");
|
||||||
|
|
||||||
|
status = brcmf_pcie_read_reg32(devinfo, BRCMF_PCIE_PCIE2REG_MAILBOXINT);
|
||||||
|
brcmf_pcie_write_reg32(devinfo, BRCMF_PCIE_PCIE2REG_MAILBOXINT, status);
|
||||||
|
@@ -1102,6 +1110,7 @@ static void brcmf_pcie_release_ringbuffe
|
||||||
|
|
||||||
|
static int brcmf_pcie_init_ringbuffers(struct brcmf_pciedev_info *devinfo)
|
||||||
|
{
|
||||||
|
+ struct brcmf_bus *bus = dev_get_drvdata(&devinfo->pdev->dev);
|
||||||
|
struct brcmf_pcie_ringbuf *ring;
|
||||||
|
struct brcmf_pcie_ringbuf *rings;
|
||||||
|
u32 d2h_w_idx_ptr;
|
||||||
|
@@ -1254,7 +1263,7 @@ static int brcmf_pcie_init_ringbuffers(s
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
fail:
|
||||||
|
- brcmf_err("Allocating ring buffers failed\n");
|
||||||
|
+ brcmf_err(bus, "Allocating ring buffers failed\n");
|
||||||
|
brcmf_pcie_release_ringbuffers(devinfo);
|
||||||
|
return -ENOMEM;
|
||||||
|
}
|
||||||
|
@@ -1277,6 +1286,7 @@ brcmf_pcie_release_scratchbuffers(struct
|
||||||
|
|
||||||
|
static int brcmf_pcie_init_scratchbuffers(struct brcmf_pciedev_info *devinfo)
|
||||||
|
{
|
||||||
|
+ struct brcmf_bus *bus = dev_get_drvdata(&devinfo->pdev->dev);
|
||||||
|
u64 address;
|
||||||
|
u32 addr;
|
||||||
|
|
||||||
|
@@ -1316,7 +1326,7 @@ static int brcmf_pcie_init_scratchbuffer
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
fail:
|
||||||
|
- brcmf_err("Allocating scratch buffers failed\n");
|
||||||
|
+ brcmf_err(bus, "Allocating scratch buffers failed\n");
|
||||||
|
brcmf_pcie_release_scratchbuffers(devinfo);
|
||||||
|
return -ENOMEM;
|
||||||
|
}
|
||||||
|
@@ -1437,6 +1447,7 @@ static int
|
||||||
|
brcmf_pcie_init_share_ram_info(struct brcmf_pciedev_info *devinfo,
|
||||||
|
u32 sharedram_addr)
|
||||||
|
{
|
||||||
|
+ struct brcmf_bus *bus = dev_get_drvdata(&devinfo->pdev->dev);
|
||||||
|
struct brcmf_pcie_shared_info *shared;
|
||||||
|
u32 addr;
|
||||||
|
|
||||||
|
@@ -1448,7 +1459,8 @@ brcmf_pcie_init_share_ram_info(struct br
|
||||||
|
brcmf_dbg(PCIE, "PCIe protocol version %d\n", shared->version);
|
||||||
|
if ((shared->version > BRCMF_PCIE_MAX_SHARED_VERSION) ||
|
||||||
|
(shared->version < BRCMF_PCIE_MIN_SHARED_VERSION)) {
|
||||||
|
- brcmf_err("Unsupported PCIE version %d\n", shared->version);
|
||||||
|
+ brcmf_err(bus, "Unsupported PCIE version %d\n",
|
||||||
|
+ shared->version);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -1490,6 +1502,7 @@ static int brcmf_pcie_download_fw_nvram(
|
||||||
|
const struct firmware *fw, void *nvram,
|
||||||
|
u32 nvram_len)
|
||||||
|
{
|
||||||
|
+ struct brcmf_bus *bus = dev_get_drvdata(&devinfo->pdev->dev);
|
||||||
|
u32 sharedram_addr;
|
||||||
|
u32 sharedram_addr_written;
|
||||||
|
u32 loop_counter;
|
||||||
|
@@ -1544,7 +1557,7 @@ static int brcmf_pcie_download_fw_nvram(
|
||||||
|
loop_counter--;
|
||||||
|
}
|
||||||
|
if (sharedram_addr == sharedram_addr_written) {
|
||||||
|
- brcmf_err("FW failed to initialize\n");
|
||||||
|
+ brcmf_err(bus, "FW failed to initialize\n");
|
||||||
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
brcmf_dbg(PCIE, "Shared RAM addr: 0x%08x\n", sharedram_addr);
|
||||||
|
@@ -1555,16 +1568,15 @@ static int brcmf_pcie_download_fw_nvram(
|
||||||
|
|
||||||
|
static int brcmf_pcie_get_resource(struct brcmf_pciedev_info *devinfo)
|
||||||
|
{
|
||||||
|
- struct pci_dev *pdev;
|
||||||
|
+ struct pci_dev *pdev = devinfo->pdev;
|
||||||
|
+ struct brcmf_bus *bus = dev_get_drvdata(&pdev->dev);
|
||||||
|
int err;
|
||||||
|
phys_addr_t bar0_addr, bar1_addr;
|
||||||
|
ulong bar1_size;
|
||||||
|
|
||||||
|
- pdev = devinfo->pdev;
|
||||||
|
-
|
||||||
|
err = pci_enable_device(pdev);
|
||||||
|
if (err) {
|
||||||
|
- brcmf_err("pci_enable_device failed err=%d\n", err);
|
||||||
|
+ brcmf_err(bus, "pci_enable_device failed err=%d\n", err);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -1577,7 +1589,7 @@ static int brcmf_pcie_get_resource(struc
|
||||||
|
/* read Bar-1 mapped memory range */
|
||||||
|
bar1_size = pci_resource_len(pdev, 2);
|
||||||
|
if ((bar1_size == 0) || (bar1_addr == 0)) {
|
||||||
|
- brcmf_err("BAR1 Not enabled, device size=%ld, addr=%#016llx\n",
|
||||||
|
+ brcmf_err(bus, "BAR1 Not enabled, device size=%ld, addr=%#016llx\n",
|
||||||
|
bar1_size, (unsigned long long)bar1_addr);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
@@ -1586,7 +1598,7 @@ static int brcmf_pcie_get_resource(struc
|
||||||
|
devinfo->tcm = ioremap_nocache(bar1_addr, bar1_size);
|
||||||
|
|
||||||
|
if (!devinfo->regs || !devinfo->tcm) {
|
||||||
|
- brcmf_err("ioremap() failed (%p,%p)\n", devinfo->regs,
|
||||||
|
+ brcmf_err(bus, "ioremap() failed (%p,%p)\n", devinfo->regs,
|
||||||
|
devinfo->tcm);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
@@ -1873,7 +1885,7 @@ fail_bus:
|
||||||
|
kfree(bus->msgbuf);
|
||||||
|
kfree(bus);
|
||||||
|
fail:
|
||||||
|
- brcmf_err("failed %x:%x\n", pdev->vendor, pdev->device);
|
||||||
|
+ brcmf_err(NULL, "failed %x:%x\n", pdev->vendor, pdev->device);
|
||||||
|
brcmf_pcie_release_resource(devinfo);
|
||||||
|
if (devinfo->ci)
|
||||||
|
brcmf_chip_detach(devinfo->ci);
|
||||||
|
@@ -1947,7 +1959,7 @@ static int brcmf_pcie_pm_enter_D3(struct
|
||||||
|
wait_event_timeout(devinfo->mbdata_resp_wait, devinfo->mbdata_completed,
|
||||||
|
BRCMF_PCIE_MBDATA_TIMEOUT);
|
||||||
|
if (!devinfo->mbdata_completed) {
|
||||||
|
- brcmf_err("Timeout on response for entering D3 substate\n");
|
||||||
|
+ brcmf_err(bus, "Timeout on response for entering D3 substate\n");
|
||||||
|
brcmf_bus_change_state(bus, BRCMF_BUS_UP);
|
||||||
|
return -EIO;
|
||||||
|
}
|
||||||
|
@@ -1993,7 +2005,7 @@ cleanup:
|
||||||
|
|
||||||
|
err = brcmf_pcie_probe(pdev, NULL);
|
||||||
|
if (err)
|
||||||
|
- brcmf_err("probe after resume failed, err=%d\n", err);
|
||||||
|
+ brcmf_err(bus, "probe after resume failed, err=%d\n", err);
|
||||||
|
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
@@ -2066,7 +2078,8 @@ void brcmf_pcie_register(void)
|
||||||
|
brcmf_dbg(PCIE, "Enter\n");
|
||||||
|
err = pci_register_driver(&brcmf_pciedrvr);
|
||||||
|
if (err)
|
||||||
|
- brcmf_err("PCIE driver registration failed, err=%d\n", err);
|
||||||
|
+ brcmf_err(NULL, "PCIE driver registration failed, err=%d\n",
|
||||||
|
+ err);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,62 @@ |
|||||||
|
From 2359dd09f9819c7d57d81e05173541f0f9f820c7 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Matteo Croce <mcroce@redhat.com>
|
||||||
|
Date: Tue, 29 Jan 2019 18:47:17 +0100
|
||||||
|
Subject: [PATCH] brcmfmac: fix typos
|
||||||
|
|
||||||
|
Fix spelling mistakes in brcmfmac: "lenght" -> "length".
|
||||||
|
The typos are also in the special comment blocks which
|
||||||
|
translates to documentation.
|
||||||
|
|
||||||
|
Signed-off-by: Matteo Croce <mcroce@redhat.com>
|
||||||
|
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||||
|
---
|
||||||
|
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h | 2 +-
|
||||||
|
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c | 2 +-
|
||||||
|
drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.h | 2 +-
|
||||||
|
drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 2 +-
|
||||||
|
4 files changed, 4 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
|
||||||
|
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
|
||||||
|
@@ -36,7 +36,7 @@
|
||||||
|
#define BRCMF_DCMD_MEDLEN 1536
|
||||||
|
#define BRCMF_DCMD_MAXLEN 8192
|
||||||
|
|
||||||
|
-/* IOCTL from host to device are limited in lenght. A device can only handle
|
||||||
|
+/* IOCTL from host to device are limited in length. A device can only handle
|
||||||
|
* ethernet frame size. This limitation is to be applied by protocol layer.
|
||||||
|
*/
|
||||||
|
#define BRCMF_TX_IOCTL_MAX_MSG_SIZE (ETH_FRAME_LEN+ETH_FCS_LEN)
|
||||||
|
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
|
||||||
|
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
|
||||||
|
@@ -47,7 +47,7 @@ enum nvram_parser_state {
|
||||||
|
* @state: current parser state.
|
||||||
|
* @data: input buffer being parsed.
|
||||||
|
* @nvram: output buffer with parse result.
|
||||||
|
- * @nvram_len: lenght of parse result.
|
||||||
|
+ * @nvram_len: length of parse result.
|
||||||
|
* @line: current line.
|
||||||
|
* @column: current column in line.
|
||||||
|
* @pos: byte offset in input buffer.
|
||||||
|
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.h
|
||||||
|
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.h
|
||||||
|
@@ -266,7 +266,7 @@ struct brcmf_event {
|
||||||
|
* @status: status information.
|
||||||
|
* @reason: reason code.
|
||||||
|
* @auth_type: authentication type.
|
||||||
|
- * @datalen: lenght of event data buffer.
|
||||||
|
+ * @datalen: length of event data buffer.
|
||||||
|
* @addr: ether address.
|
||||||
|
* @ifname: interface name.
|
||||||
|
* @ifidx: interface index.
|
||||||
|
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
|
||||||
|
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
|
||||||
|
@@ -508,7 +508,7 @@ static void brcmf_usb_rx_complete(struct
|
||||||
|
skb = req->skb;
|
||||||
|
req->skb = NULL;
|
||||||
|
|
||||||
|
- /* zero lenght packets indicate usb "failure". Do not refill */
|
||||||
|
+ /* zero length packets indicate usb "failure". Do not refill */
|
||||||
|
if (urb->status != 0 || !urb->actual_length) {
|
||||||
|
brcmu_pkt_buf_free_skb(skb);
|
||||||
|
brcmf_usb_enq(devinfo, &devinfo->rx_freeq, req, NULL);
|
@ -0,0 +1,143 @@ |
|||||||
|
From e665988be29ccea3584528967b432a5cfd801ca4 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 07:42:30 +0100
|
||||||
|
Subject: [PATCH] brcmfmac: support monitor frames with the hardware/ucode
|
||||||
|
header
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
So far there were two monitor frame formats:
|
||||||
|
1) 802.11 frames (with frame (sub)type & all addresses)
|
||||||
|
2) 802.11 frames with the radiotap header
|
||||||
|
|
||||||
|
Testing the latest FullMAC firmwares for 4366b1/4366c0 resulted in
|
||||||
|
discovering a new format being used. It seems (almost?) identical to the
|
||||||
|
one known from ucode used in SoftMAC devices which is most likely the
|
||||||
|
same codebase anyway.
|
||||||
|
|
||||||
|
While new firmwares will /announce/ radiotap header support using the
|
||||||
|
"rtap" fw capability string it seems no string was added for the new
|
||||||
|
ucode header format.
|
||||||
|
|
||||||
|
All above means that:
|
||||||
|
1) We need new format support when dealing with a received frame
|
||||||
|
2) A new feature bit & mapping quirks have to be added manually
|
||||||
|
|
||||||
|
As for now only an empty radiotap is being created. Adding support for
|
||||||
|
extracting some info (band, channel, signal, etc.) is planned for the
|
||||||
|
future.
|
||||||
|
|
||||||
|
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>
|
||||||
|
---
|
||||||
|
.../broadcom/brcm80211/brcmfmac/core.c | 55 +++++++++++++++++++
|
||||||
|
.../broadcom/brcm80211/brcmfmac/feature.c | 4 ++
|
||||||
|
.../broadcom/brcm80211/brcmfmac/feature.h | 4 +-
|
||||||
|
3 files changed, 62 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||||
|
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||||
|
@@ -43,6 +43,36 @@
|
||||||
|
|
||||||
|
#define BRCMF_BSSIDX_INVALID -1
|
||||||
|
|
||||||
|
+#define RXS_PBPRES BIT(2)
|
||||||
|
+
|
||||||
|
+#define D11_PHY_HDR_LEN 6
|
||||||
|
+
|
||||||
|
+struct d11rxhdr_le {
|
||||||
|
+ __le16 RxFrameSize;
|
||||||
|
+ u16 PAD;
|
||||||
|
+ __le16 PhyRxStatus_0;
|
||||||
|
+ __le16 PhyRxStatus_1;
|
||||||
|
+ __le16 PhyRxStatus_2;
|
||||||
|
+ __le16 PhyRxStatus_3;
|
||||||
|
+ __le16 PhyRxStatus_4;
|
||||||
|
+ __le16 PhyRxStatus_5;
|
||||||
|
+ __le16 RxStatus1;
|
||||||
|
+ __le16 RxStatus2;
|
||||||
|
+ __le16 RxTSFTime;
|
||||||
|
+ __le16 RxChan;
|
||||||
|
+ u8 unknown[12];
|
||||||
|
+} __packed;
|
||||||
|
+
|
||||||
|
+struct wlc_d11rxhdr {
|
||||||
|
+ struct d11rxhdr_le rxhdr;
|
||||||
|
+ __le32 tsf_l;
|
||||||
|
+ s8 rssi;
|
||||||
|
+ s8 rxpwr0;
|
||||||
|
+ s8 rxpwr1;
|
||||||
|
+ s8 do_rssi_ma;
|
||||||
|
+ s8 rxpwr[4];
|
||||||
|
+} __packed;
|
||||||
|
+
|
||||||
|
char *brcmf_ifname(struct brcmf_if *ifp)
|
||||||
|
{
|
||||||
|
if (!ifp)
|
||||||
|
@@ -409,6 +439,31 @@ void brcmf_netif_mon_rx(struct brcmf_if
|
||||||
|
{
|
||||||
|
if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MONITOR_FMT_RADIOTAP)) {
|
||||||
|
/* Do nothing */
|
||||||
|
+ } else if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MONITOR_FMT_HW_RX_HDR)) {
|
||||||
|
+ struct wlc_d11rxhdr *wlc_rxhdr = (struct wlc_d11rxhdr *)skb->data;
|
||||||
|
+ struct ieee80211_radiotap_header *radiotap;
|
||||||
|
+ unsigned int offset;
|
||||||
|
+ u16 RxStatus1;
|
||||||
|
+
|
||||||
|
+ RxStatus1 = le16_to_cpu(wlc_rxhdr->rxhdr.RxStatus1);
|
||||||
|
+
|
||||||
|
+ offset = sizeof(struct wlc_d11rxhdr);
|
||||||
|
+ /* MAC inserts 2 pad bytes for a4 headers or QoS or A-MSDU
|
||||||
|
+ * subframes
|
||||||
|
+ */
|
||||||
|
+ if (RxStatus1 & RXS_PBPRES)
|
||||||
|
+ offset += 2;
|
||||||
|
+ offset += D11_PHY_HDR_LEN;
|
||||||
|
+
|
||||||
|
+ skb_pull(skb, offset);
|
||||||
|
+
|
||||||
|
+ /* TODO: use RX header to fill some radiotap data */
|
||||||
|
+ radiotap = skb_push(skb, sizeof(*radiotap));
|
||||||
|
+ memset(radiotap, 0, sizeof(*radiotap));
|
||||||
|
+ radiotap->it_len = cpu_to_le16(sizeof(*radiotap));
|
||||||
|
+
|
||||||
|
+ /* TODO: 4 bytes with receive status? */
|
||||||
|
+ skb->len -= 4;
|
||||||
|
} else {
|
||||||
|
struct ieee80211_radiotap_header *radiotap;
|
||||||
|
|
||||||
|
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
|
||||||
|
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
|
||||||
|
@@ -103,6 +103,10 @@ static const struct brcmf_feat_fwfeat br
|
||||||
|
{ "01-6cb8e269", BIT(BRCMF_FEAT_MONITOR) },
|
||||||
|
/* brcmfmac4366b-pcie.bin from linux-firmware.git commit 52442afee990 */
|
||||||
|
{ "01-c47a91a4", BIT(BRCMF_FEAT_MONITOR) },
|
||||||
|
+ /* brcmfmac4366b-pcie.bin from linux-firmware.git commit 211de1679a68 */
|
||||||
|
+ { "01-801fb449", BIT(BRCMF_FEAT_MONITOR_FMT_HW_RX_HDR) },
|
||||||
|
+ /* brcmfmac4366c-pcie.bin from linux-firmware.git commit 211de1679a68 */
|
||||||
|
+ { "01-d2cbb8fd", BIT(BRCMF_FEAT_MONITOR_FMT_HW_RX_HDR) },
|
||||||
|
};
|
||||||
|
|
||||||
|
static void brcmf_feat_firmware_overrides(struct brcmf_pub *drv)
|
||||||
|
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h
|
||||||
|
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h
|
||||||
|
@@ -35,6 +35,7 @@
|
||||||
|
* FWSUP: Firmware supplicant.
|
||||||
|
* MONITOR: firmware can pass monitor packets to host.
|
||||||
|
* MONITOR_FMT_RADIOTAP: firmware provides monitor packets with radiotap header
|
||||||
|
+ * MONITOR_FMT_HW_RX_HDR: firmware provides monitor packets with hw/ucode header
|
||||||
|
*/
|
||||||
|
#define BRCMF_FEAT_LIST \
|
||||||
|
BRCMF_FEAT_DEF(MBSS) \
|
||||||
|
@@ -52,7 +53,8 @@
|
||||||
|
BRCMF_FEAT_DEF(GSCAN) \
|
||||||
|
BRCMF_FEAT_DEF(FWSUP) \
|
||||||
|
BRCMF_FEAT_DEF(MONITOR) \
|
||||||
|
- BRCMF_FEAT_DEF(MONITOR_FMT_RADIOTAP)
|
||||||
|
+ BRCMF_FEAT_DEF(MONITOR_FMT_RADIOTAP) \
|
||||||
|
+ BRCMF_FEAT_DEF(MONITOR_FMT_HW_RX_HDR)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Quirks:
|
Loading…
Reference in new issue