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: 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>
This commit is contained in:
parent
a4176ec356
commit
aaf6a5e86e
3 changed files with 18 additions and 5 deletions
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -1156,6 +1156,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;
|
||||
|
||||
|
|
|
@ -3143,9 +3143,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))
|
||||
|
@ -3165,7 +3168,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 */
|
||||
|
@ -3477,8 +3480,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.
|
||||
|
@ -4088,6 +4089,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
|
||||
|
|
Loading…
Reference in a new issue