Home Home > GIT Browse > openSUSE-15.1
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Brugger <mbrugger@suse.com>2019-01-10 19:12:26 +0100
committerMatthias Brugger <mbrugger@suse.com>2019-01-11 11:40:41 +0100
commitbfb238273d35ff2f2ab82413f99745cdcf589b1c (patch)
tree0f8a482827d00c427bc302c8c6bdc34625b721fa
parent0c1d5d047c5f6b5fc8081e3c7bd6754cda3ba2d8 (diff)
brcmfmac: Set board_type used for nvram file selection to
machine-compatible (fate#326215).
-rw-r--r--patches.drivers/0004-brcmfmac-Set-board_type-used-for-nvram-file-selectio.patch91
-rw-r--r--series.conf1
2 files changed, 92 insertions, 0 deletions
diff --git a/patches.drivers/0004-brcmfmac-Set-board_type-used-for-nvram-file-selectio.patch b/patches.drivers/0004-brcmfmac-Set-board_type-used-for-nvram-file-selectio.patch
new file mode 100644
index 0000000000..ff42c5694e
--- /dev/null
+++ b/patches.drivers/0004-brcmfmac-Set-board_type-used-for-nvram-file-selectio.patch
@@ -0,0 +1,91 @@
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Wed, 10 Oct 2018 13:01:01 +0200
+Subject: brcmfmac: Set board_type used for nvram file selection to
+ machine-compatible
+Git-commit: 0ad4b55b2f29784f93875e6231bf57cd233624a2
+Patch-mainline: v5.0-rc1
+References: fate#326215
+
+For of/devicetree using machines, set the board_type used for nvram file
+selection to the first string listed in the top-level's node compatible
+string, aka the machine-compatible as used by of_machine_is_compatible().
+
+The board_type setting is used to load the board-specific nvram file with
+a board-specific name so that we can ship files for each supported board
+in linux-firmware.
+
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
+Signed-off-by: Matthias Brugger <mbrugger@suse.com>
+---
+ .../net/wireless/broadcom/brcm80211/brcmfmac/common.h | 1 +
+ drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c | 11 ++++++++++-
+ .../net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 1 +
+ .../net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 1 +
+ 4 files changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
+index a34642cb4d2f..e63a273642e9 100644
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
+@@ -59,6 +59,7 @@ struct brcmf_mp_device {
+ bool iapp;
+ bool ignore_probe_fail;
+ struct brcmfmac_pd_cc *country_codes;
++ const char *board_type;
+ union {
+ struct brcmfmac_sdio_pd sdio;
+ } bus;
+diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
+index aee6e5937c41..84e3373289eb 100644
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
+@@ -27,11 +27,20 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
+ struct brcmf_mp_device *settings)
+ {
+ struct brcmfmac_sdio_pd *sdio = &settings->bus.sdio;
+- struct device_node *np = dev->of_node;
++ struct device_node *root, *np = dev->of_node;
++ struct property *prop;
+ int irq;
+ u32 irqf;
+ u32 val;
+
++ /* Set board-type to the first string of the machine compatible prop */
++ root = of_find_node_by_path("/");
++ if (root) {
++ prop = of_find_property(root, "compatible", NULL);
++ settings->board_type = of_prop_next_string(prop, NULL);
++ of_node_put(root);
++ }
++
+ if (!np || bus_type != BRCMF_BUSTYPE_SDIO ||
+ !of_device_is_compatible(np, "brcm,bcm4329-fmac"))
+ return;
+diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
+index 5dea569d63ed..956a8b236836 100644
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
+@@ -1785,6 +1785,7 @@ brcmf_pcie_prepare_fw_request(struct brcmf_pciedev_info *devinfo)
+ fwreq->items[BRCMF_PCIE_FW_CODE].type = BRCMF_FW_TYPE_BINARY;
+ fwreq->items[BRCMF_PCIE_FW_NVRAM].type = BRCMF_FW_TYPE_NVRAM;
+ fwreq->items[BRCMF_PCIE_FW_NVRAM].flags = BRCMF_FW_REQF_OPTIONAL;
++ fwreq->board_type = devinfo->settings->board_type;
+ /* NVRAM reserves PCI domain 0 for Broadcom's SDK faked bus */
+ fwreq->domain_nr = pci_domain_nr(devinfo->pdev->bus) + 1;
+ fwreq->bus_nr = devinfo->pdev->bus->number;
+diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
+index b2e1ab5adb64..22646a3b911e 100644
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
+@@ -4174,6 +4174,7 @@ brcmf_sdio_prepare_fw_request(struct brcmf_sdio *bus)
+
+ fwreq->items[BRCMF_SDIO_FW_CODE].type = BRCMF_FW_TYPE_BINARY;
+ fwreq->items[BRCMF_SDIO_FW_NVRAM].type = BRCMF_FW_TYPE_NVRAM;
++ fwreq->board_type = bus->sdiodev->settings->board_type;
+
+ return fwreq;
+ }
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index a4f1f15470..c446d5e286 100644
--- a/series.conf
+++ b/series.conf
@@ -41794,6 +41794,7 @@
patches.drivers/0001-brcmfmac-Remove-firmware-loading-code-duplication.patch
patches.drivers/0002-brcmfmac-Remove-recursion-from-firmware-load-error-h.patch
patches.drivers/0003-brcmfmac-Add-support-for-first-trying-to-get-a-board.patch
+ patches.drivers/0004-brcmfmac-Set-board_type-used-for-nvram-file-selectio.patch
patches.drivers/wlcore-Fix-the-return-value-in-case-of-error-in-wlco.patch
patches.drivers/rtl8xxxu-Fix-missing-break-in-switch.patch
patches.drivers/wireless-airo-potential-buffer-overflow-in-sprintf.patch