1 // SPDX-License-Identifier: ISC
3 * Copyright (c) 2012 Broadcom Corporation
5 #include <linux/debugfs.h>
6 #include <linux/netdevice.h>
7 #include <linux/module.h>
8 #include <linux/devcoredump.h>
10 #include <brcmu_wifi.h>
11 #include <brcmu_utils.h>
17 int brcmf_debug_create_memdump(struct brcmf_bus
*bus
, const void *data
,
24 ramsize
= brcmf_bus_get_ramsize(bus
);
28 dump
= vzalloc(len
+ ramsize
);
33 memcpy(dump
, data
, len
);
34 err
= brcmf_bus_get_memdump(bus
, dump
+ len
, ramsize
);
40 dev_coredumpv(bus
->dev
, dump
, len
+ ramsize
, GFP_KERNEL
);
45 struct dentry
*brcmf_debugfs_get_devdir(struct brcmf_pub
*drvr
)
47 return drvr
->wiphy
->debugfsdir
;
50 void brcmf_debugfs_add_entry(struct brcmf_pub
*drvr
, const char *fn
,
51 int (*read_fn
)(struct seq_file
*seq
, void *data
))
53 WARN(!drvr
->wiphy
->debugfsdir
, "wiphy not (yet) registered\n");
54 debugfs_create_devm_seqfile(drvr
->bus_if
->dev
, fn
,
55 drvr
->wiphy
->debugfsdir
, read_fn
);