diff options
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.c')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.c index 57671eddf79d..ac792499b46a 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include "dhd.h" | 22 | #include "dhd.h" |
23 | #include "dhd_bus.h" | 23 | #include "dhd_bus.h" |
24 | #include "dhd_dbg.h" | 24 | #include "dhd_dbg.h" |
25 | #include "tracepoint.h" | ||
25 | 26 | ||
26 | static struct dentry *root_folder; | 27 | static struct dentry *root_folder; |
27 | 28 | ||
@@ -123,3 +124,44 @@ void brcmf_debugfs_create_sdio_count(struct brcmf_pub *drvr, | |||
123 | debugfs_create_file("counters", S_IRUGO, dentry, | 124 | debugfs_create_file("counters", S_IRUGO, dentry, |
124 | sdcnt, &brcmf_debugfs_sdio_counter_ops); | 125 | sdcnt, &brcmf_debugfs_sdio_counter_ops); |
125 | } | 126 | } |
127 | |||
128 | static | ||
129 | ssize_t brcmf_debugfs_fws_stats_read(struct file *f, char __user *data, | ||
130 | size_t count, loff_t *ppos) | ||
131 | { | ||
132 | struct brcmf_fws_stats *fwstats = f->private_data; | ||
133 | char buf[100]; | ||
134 | int res; | ||
135 | |||
136 | /* only allow read from start */ | ||
137 | if (*ppos > 0) | ||
138 | return 0; | ||
139 | |||
140 | res = scnprintf(buf, sizeof(buf), | ||
141 | "header_pulls: %u\n" | ||
142 | "header_only_pkt: %u\n" | ||
143 | "tlv_parse_failed: %u\n" | ||
144 | "tlv_invalid_type: %u\n", | ||
145 | fwstats->header_pulls, | ||
146 | fwstats->header_only_pkt, | ||
147 | fwstats->tlv_parse_failed, | ||
148 | fwstats->tlv_invalid_type); | ||
149 | |||
150 | return simple_read_from_buffer(data, count, ppos, buf, res); | ||
151 | } | ||
152 | |||
153 | static const struct file_operations brcmf_debugfs_fws_stats_ops = { | ||
154 | .owner = THIS_MODULE, | ||
155 | .open = simple_open, | ||
156 | .read = brcmf_debugfs_fws_stats_read | ||
157 | }; | ||
158 | |||
159 | void brcmf_debugfs_create_fws_stats(struct brcmf_pub *drvr, | ||
160 | struct brcmf_fws_stats *stats) | ||
161 | { | ||
162 | struct dentry *dentry = drvr->dbgfs_dir; | ||
163 | |||
164 | if (!IS_ERR_OR_NULL(dentry)) | ||
165 | debugfs_create_file("fws_stats", S_IRUGO, dentry, | ||
166 | stats, &brcmf_debugfs_fws_stats_ops); | ||
167 | } | ||