diff options
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.c')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.c | 80 |
1 files changed, 80 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..202869cd0932 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,82 @@ 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[650]; | ||
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 | "mac_update_fails: %u\n" | ||
146 | "ps_update_fails: %u\n" | ||
147 | "if_update_fails: %u\n" | ||
148 | "pkt2bus: %u\n" | ||
149 | "generic_error: %u\n" | ||
150 | "rollback_success: %u\n" | ||
151 | "rollback_failed: %u\n" | ||
152 | "delayq_full: %u\n" | ||
153 | "supprq_full: %u\n" | ||
154 | "txs_indicate: %u\n" | ||
155 | "txs_discard: %u\n" | ||
156 | "txs_suppr_core: %u\n" | ||
157 | "txs_suppr_ps: %u\n" | ||
158 | "txs_tossed: %u\n" | ||
159 | "send_pkts: BK:%u BE:%u VO:%u VI:%u BCMC:%u\n" | ||
160 | "fifo_credits_sent: BK:%u BE:%u VO:%u VI:%u BCMC:%u\n", | ||
161 | fwstats->header_pulls, | ||
162 | fwstats->header_only_pkt, | ||
163 | fwstats->tlv_parse_failed, | ||
164 | fwstats->tlv_invalid_type, | ||
165 | fwstats->mac_update_failed, | ||
166 | fwstats->mac_ps_update_failed, | ||
167 | fwstats->if_update_failed, | ||
168 | fwstats->pkt2bus, | ||
169 | fwstats->generic_error, | ||
170 | fwstats->rollback_success, | ||
171 | fwstats->rollback_failed, | ||
172 | fwstats->delayq_full_error, | ||
173 | fwstats->supprq_full_error, | ||
174 | fwstats->txs_indicate, | ||
175 | fwstats->txs_discard, | ||
176 | fwstats->txs_supp_core, | ||
177 | fwstats->txs_supp_ps, | ||
178 | fwstats->txs_tossed, | ||
179 | fwstats->send_pkts[0], fwstats->send_pkts[1], | ||
180 | fwstats->send_pkts[2], fwstats->send_pkts[3], | ||
181 | fwstats->send_pkts[4], | ||
182 | fwstats->fifo_credits_sent[0], | ||
183 | fwstats->fifo_credits_sent[1], | ||
184 | fwstats->fifo_credits_sent[2], | ||
185 | fwstats->fifo_credits_sent[3], | ||
186 | fwstats->fifo_credits_sent[4]); | ||
187 | |||
188 | return simple_read_from_buffer(data, count, ppos, buf, res); | ||
189 | } | ||
190 | |||
191 | static const struct file_operations brcmf_debugfs_fws_stats_ops = { | ||
192 | .owner = THIS_MODULE, | ||
193 | .open = simple_open, | ||
194 | .read = brcmf_debugfs_fws_stats_read | ||
195 | }; | ||
196 | |||
197 | void brcmf_debugfs_create_fws_stats(struct brcmf_pub *drvr, | ||
198 | struct brcmf_fws_stats *stats) | ||
199 | { | ||
200 | struct dentry *dentry = drvr->dbgfs_dir; | ||
201 | |||
202 | if (!IS_ERR_OR_NULL(dentry)) | ||
203 | debugfs_create_file("fws_stats", S_IRUGO, dentry, | ||
204 | stats, &brcmf_debugfs_fws_stats_ops); | ||
205 | } | ||