mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
brcmfmac: create debugfs files for bus-specific layer
[ Upstream commitaaf6a5e86e] 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:856d5a011c("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
7b6bc967cc
commit
f27808ed8c
@@ -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_bus *bus, const char *ext,
|
||||
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
|
||||
*/
|
||||
|
||||
@@ -1105,6 +1105,7 @@ static int brcmf_bus_started(struct brcmf_pub *drvr, struct cfg80211_ops *ops)
|
||||
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;
|
||||
|
||||
|
||||
@@ -3131,9 +3131,12 @@ static int brcmf_debugfs_sdio_count_read(struct seq_file *seq, void *data)
|
||||
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))
|
||||
@@ -3153,7 +3156,7 @@ static int brcmf_sdio_checkdied(struct brcmf_sdio *bus)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void brcmf_sdio_debugfs_create(struct brcmf_sdio *bus)
|
||||
static void brcmf_sdio_debugfs_create(struct device *dev)
|
||||
{
|
||||
}
|
||||
#endif /* DEBUG */
|
||||
@@ -3438,8 +3441,6 @@ static int brcmf_sdio_bus_preinit(struct device *dev)
|
||||
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.
|
||||
@@ -4050,6 +4051,7 @@ static const struct brcmf_bus_ops brcmf_sdio_bus_ops = {
|
||||
.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
|
||||
|
||||
Reference in New Issue
Block a user