diff options
author | Rafał Miłecki <rafal@milecki.pl> | 2019-02-20 23:05:48 +0100 |
---|---|---|
committer | Rafał Miłecki <rafal@milecki.pl> | 2019-02-20 23:06:16 +0100 |
commit | 2d139450a3be401e11c2a2b6f817bdf6c421d6db (patch) | |
tree | 5df9414fa89ba053bda529ab9c3b2baccfe35b41 /package/kernel/mac80211/patches/brcm/349-v5.1-0003-brcmfmac-create-debugfs-files-for-bus-specific-layer.patch | |
parent | 81adb132daa529167cc4df9849882ca144e7cba7 (diff) | |
download | upstream-2d139450a3be401e11c2a2b6f817bdf6c421d6db.tar.gz upstream-2d139450a3be401e11c2a2b6f817bdf6c421d6db.tar.bz2 upstream-2d139450a3be401e11c2a2b6f817bdf6c421d6db.zip |
mac80211: backport more brcmfmac changes queued for the 5.1
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'package/kernel/mac80211/patches/brcm/349-v5.1-0003-brcmfmac-create-debugfs-files-for-bus-specific-layer.patch')
-rw-r--r-- | package/kernel/mac80211/patches/brcm/349-v5.1-0003-brcmfmac-create-debugfs-files-for-bus-specific-layer.patch | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/brcm/349-v5.1-0003-brcmfmac-create-debugfs-files-for-bus-specific-layer.patch b/package/kernel/mac80211/patches/brcm/349-v5.1-0003-brcmfmac-create-debugfs-files-for-bus-specific-layer.patch new file mode 100644 index 0000000000..b58ec4b7e9 --- /dev/null +++ b/package/kernel/mac80211/patches/brcm/349-v5.1-0003-brcmfmac-create-debugfs-files-for-bus-specific-layer.patch @@ -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 |