Commit | Line | Data |
---|---|---|
8c0ea102 LC |
1 | /* |
2 | * This file is part of wl18xx | |
3 | * | |
4 | * Copyright (C) 2009 Nokia Corporation | |
5 | * Copyright (C) 2011-2012 Texas Instruments | |
6 | * | |
7 | * This program is free software; you can redistribute it and/or | |
8 | * modify it under the terms of the GNU General Public License | |
9 | * version 2 as published by the Free Software Foundation. | |
10 | * | |
11 | * This program is distributed in the hope that it will be useful, but | |
12 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | * General Public License for more details. | |
15 | * | |
16 | * You should have received a copy of the GNU General Public License | |
17 | * along with this program; if not, write to the Free Software | |
18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
19 | * 02110-1301 USA | |
20 | * | |
21 | */ | |
22 | ||
23 | #include "../wlcore/debugfs.h" | |
24 | #include "../wlcore/wlcore.h" | |
25 | ||
26 | #include "wl18xx.h" | |
27 | #include "acx.h" | |
28 | #include "debugfs.h" | |
29 | ||
30 | #define WL18XX_DEBUGFS_FWSTATS_FILE(a, b, c) \ | |
31 | DEBUGFS_FWSTATS_FILE(a, b, c, wl18xx_acx_statistics) | |
32 | #define WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(a, b, c) \ | |
33 | DEBUGFS_FWSTATS_FILE_ARRAY(a, b, c, wl18xx_acx_statistics) | |
34 | ||
c5d94169 | 35 | |
8c0ea102 LC |
36 | WL18XX_DEBUGFS_FWSTATS_FILE(debug, debug1, "%u"); |
37 | WL18XX_DEBUGFS_FWSTATS_FILE(debug, debug2, "%u"); | |
38 | WL18XX_DEBUGFS_FWSTATS_FILE(debug, debug3, "%u"); | |
39 | WL18XX_DEBUGFS_FWSTATS_FILE(debug, debug4, "%u"); | |
40 | WL18XX_DEBUGFS_FWSTATS_FILE(debug, debug5, "%u"); | |
41 | WL18XX_DEBUGFS_FWSTATS_FILE(debug, debug6, "%u"); | |
42 | ||
8c0ea102 | 43 | WL18XX_DEBUGFS_FWSTATS_FILE(ring, prepared_descs, "%u"); |
8c0ea102 | 44 | WL18XX_DEBUGFS_FWSTATS_FILE(ring, tx_cmplt, "%u"); |
8c0ea102 LC |
45 | |
46 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_template_prepared, "%u"); | |
47 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_data_prepared, "%u"); | |
48 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_template_programmed, "%u"); | |
49 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_data_programmed, "%u"); | |
50 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_burst_programmed, "%u"); | |
51 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_starts, "%u"); | |
52 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_imm_resp, "%u"); | |
53 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_start_templates, "%u"); | |
54 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_start_int_templates, "%u"); | |
55 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_start_fw_gen, "%u"); | |
56 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_start_data, "%u"); | |
57 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_start_null_frame, "%u"); | |
58 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_exch, "%u"); | |
59 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_retry_template, "%u"); | |
60 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_retry_data, "%u"); | |
61 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_exch_pending, "%u"); | |
62 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_exch_expiry, "%u"); | |
8c0ea102 LC |
63 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_done_template, "%u"); |
64 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_done_data, "%u"); | |
65 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_done_int_template, "%u"); | |
c5d94169 LC |
66 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_frame_checksum, "%u"); |
67 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_checksum_result, "%u"); | |
68 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_called, "%u"); | |
69 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_mpdu_alloc_failed, "%u"); | |
70 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_init_called, "%u"); | |
71 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_in_process_called, "%u"); | |
72 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_tkip_called, "%u"); | |
73 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_key_not_found, "%u"); | |
74 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_need_fragmentation, "%u"); | |
75 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_bad_mblk_num, "%u"); | |
76 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_failed, "%u"); | |
77 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_cache_hit, "%u"); | |
78 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_cache_miss, "%u"); | |
8c0ea102 LC |
79 | |
80 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_out_of_mem, "%u"); | |
81 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_hdr_overflow, "%u"); | |
8c0ea102 | 82 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_dropped_frame, "%u"); |
8c0ea102 LC |
83 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_done, "%u"); |
84 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_defrag, "%u"); | |
85 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_defrag_end, "%u"); | |
8c0ea102 LC |
86 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_cmplt, "%u"); |
87 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_pre_complt, "%u"); | |
88 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_cmplt_task, "%u"); | |
89 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_phy_hdr, "%u"); | |
90 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_timeout, "%u"); | |
c5d94169 LC |
91 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_frame_checksum, "%u"); |
92 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_checksum_result, "%u"); | |
93 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, defrag_called, "%u"); | |
94 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, defrag_init_called, "%u"); | |
95 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, defrag_in_process_called, "%u"); | |
96 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, defrag_tkip_called, "%u"); | |
97 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, defrag_need_defrag, "%u"); | |
98 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, defrag_decrypt_failed, "%u"); | |
99 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, decrypt_key_not_found, "%u"); | |
100 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, defrag_need_decrypt, "%u"); | |
8c0ea102 LC |
101 | |
102 | WL18XX_DEBUGFS_FWSTATS_FILE(isr, irqs, "%u"); | |
103 | ||
8c0ea102 LC |
104 | WL18XX_DEBUGFS_FWSTATS_FILE(pwr, missing_bcns_cnt, "%u"); |
105 | WL18XX_DEBUGFS_FWSTATS_FILE(pwr, rcvd_bcns_cnt, "%u"); | |
106 | WL18XX_DEBUGFS_FWSTATS_FILE(pwr, connection_out_of_sync, "%u"); | |
107 | WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(pwr, cont_miss_bcns_spread, | |
108 | PWR_STAT_MAX_CONT_MISSED_BCNS_SPREAD); | |
109 | WL18XX_DEBUGFS_FWSTATS_FILE(pwr, rcvd_awake_bcns_cnt, "%u"); | |
110 | ||
8c0ea102 LC |
111 | |
112 | WL18XX_DEBUGFS_FWSTATS_FILE(event, calibration, "%u"); | |
113 | WL18XX_DEBUGFS_FWSTATS_FILE(event, rx_mismatch, "%u"); | |
114 | WL18XX_DEBUGFS_FWSTATS_FILE(event, rx_mem_empty, "%u"); | |
115 | ||
116 | WL18XX_DEBUGFS_FWSTATS_FILE(ps_poll, ps_poll_timeouts, "%u"); | |
117 | WL18XX_DEBUGFS_FWSTATS_FILE(ps_poll, upsd_timeouts, "%u"); | |
118 | WL18XX_DEBUGFS_FWSTATS_FILE(ps_poll, upsd_max_ap_turn, "%u"); | |
119 | WL18XX_DEBUGFS_FWSTATS_FILE(ps_poll, ps_poll_max_ap_turn, "%u"); | |
120 | WL18XX_DEBUGFS_FWSTATS_FILE(ps_poll, ps_poll_utilization, "%u"); | |
121 | WL18XX_DEBUGFS_FWSTATS_FILE(ps_poll, upsd_utilization, "%u"); | |
122 | ||
123 | WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, beacon_filter, "%u"); | |
124 | WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, arp_filter, "%u"); | |
125 | WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, mc_filter, "%u"); | |
126 | WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, dup_filter, "%u"); | |
127 | WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, data_filter, "%u"); | |
128 | WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, ibss_filter, "%u"); | |
129 | WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, protection_filter, "%u"); | |
130 | ||
c5d94169 LC |
131 | WL18XX_DEBUGFS_FWSTATS_FILE(rx_rate, rx_frames_per_rates, "%u"); |
132 | ||
133 | WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(aggr_size, tx_size, | |
134 | AGGR_STATS_TX_SIZE_LEN); | |
135 | WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(aggr_size, rx_size, | |
136 | AGGR_STATS_RX_SIZE_LEN); | |
137 | ||
138 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, hs_tx_stat_fifo_int, "%u"); | |
139 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, tcp_tx_stat_fifo_int, "%u"); | |
140 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, tcp_rx_stat_fifo_int, "%u"); | |
141 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, enc_tx_stat_fifo_int, "%u"); | |
142 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, enc_rx_stat_fifo_int, "%u"); | |
143 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, rx_complete_stat_fifo_int, "%u"); | |
144 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, pre_proc_swi, "%u"); | |
145 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, post_proc_swi, "%u"); | |
146 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, sec_frag_swi, "%u"); | |
147 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, pre_to_defrag_swi, "%u"); | |
148 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, defrag_to_csum_swi, "%u"); | |
149 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, csum_to_rx_xfer_swi, "%u"); | |
150 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, dec_packet_in, "%u"); | |
151 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, dec_packet_in_fifo_full, "%u"); | |
152 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, dec_packet_out, "%u"); | |
153 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, cs_rx_packet_in, "%u"); | |
154 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, cs_rx_packet_out, "%u"); | |
155 | ||
156 | WL18XX_DEBUGFS_FWSTATS_FILE(mem, rx_free_mem_blks, "%u"); | |
157 | WL18XX_DEBUGFS_FWSTATS_FILE(mem, tx_free_mem_blks, "%u"); | |
158 | WL18XX_DEBUGFS_FWSTATS_FILE(mem, fwlog_free_mem_blks, "%u"); | |
159 | WL18XX_DEBUGFS_FWSTATS_FILE(mem, fw_gen_free_mem_blks, "%u"); | |
8c0ea102 | 160 | |
18b70ac9 LC |
161 | static ssize_t conf_read(struct file *file, char __user *user_buf, |
162 | size_t count, loff_t *ppos) | |
163 | { | |
164 | struct wl1271 *wl = file->private_data; | |
165 | struct wl18xx_priv *priv = wl->priv; | |
166 | struct wlcore_conf_header header; | |
167 | char *buf, *pos; | |
168 | size_t len; | |
169 | int ret; | |
170 | ||
171 | len = WL18XX_CONF_SIZE; | |
172 | buf = kmalloc(len, GFP_KERNEL); | |
173 | if (!buf) | |
174 | return -ENOMEM; | |
175 | ||
176 | header.magic = cpu_to_le32(WL18XX_CONF_MAGIC); | |
177 | header.version = cpu_to_le32(WL18XX_CONF_VERSION); | |
178 | header.checksum = 0; | |
179 | ||
180 | mutex_lock(&wl->mutex); | |
181 | ||
182 | pos = buf; | |
183 | memcpy(pos, &header, sizeof(header)); | |
184 | pos += sizeof(header); | |
185 | memcpy(pos, &wl->conf, sizeof(wl->conf)); | |
186 | pos += sizeof(wl->conf); | |
187 | memcpy(pos, &priv->conf, sizeof(priv->conf)); | |
188 | ||
189 | mutex_unlock(&wl->mutex); | |
190 | ||
191 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, len); | |
192 | ||
193 | kfree(buf); | |
194 | return ret; | |
195 | } | |
196 | ||
197 | static const struct file_operations conf_ops = { | |
198 | .read = conf_read, | |
199 | .open = simple_open, | |
200 | .llseek = default_llseek, | |
201 | }; | |
202 | ||
f74ea74b LC |
203 | static ssize_t clear_fw_stats_write(struct file *file, |
204 | const char __user *user_buf, | |
205 | size_t count, loff_t *ppos) | |
206 | { | |
207 | struct wl1271 *wl = file->private_data; | |
208 | int ret; | |
209 | ||
210 | mutex_lock(&wl->mutex); | |
211 | ||
212 | if (wl->state == WL1271_STATE_OFF) | |
213 | goto out; | |
214 | ||
215 | ret = wl18xx_acx_clear_statistics(wl); | |
216 | if (ret < 0) { | |
217 | count = ret; | |
218 | goto out; | |
219 | } | |
220 | out: | |
221 | mutex_unlock(&wl->mutex); | |
222 | return count; | |
223 | } | |
224 | ||
225 | static const struct file_operations clear_fw_stats_ops = { | |
226 | .write = clear_fw_stats_write, | |
227 | .open = simple_open, | |
228 | .llseek = default_llseek, | |
229 | }; | |
230 | ||
8c0ea102 LC |
231 | int wl18xx_debugfs_add_files(struct wl1271 *wl, |
232 | struct dentry *rootdir) | |
233 | { | |
234 | int ret = 0; | |
ad62d81a | 235 | struct dentry *entry, *stats, *moddir; |
8c0ea102 | 236 | |
ad62d81a LC |
237 | moddir = debugfs_create_dir(KBUILD_MODNAME, rootdir); |
238 | if (!moddir || IS_ERR(moddir)) { | |
239 | entry = moddir; | |
240 | goto err; | |
241 | } | |
242 | ||
243 | stats = debugfs_create_dir("fw_stats", moddir); | |
8c0ea102 LC |
244 | if (!stats || IS_ERR(stats)) { |
245 | entry = stats; | |
246 | goto err; | |
247 | } | |
248 | ||
f74ea74b LC |
249 | DEBUGFS_ADD(clear_fw_stats, stats); |
250 | ||
8c0ea102 LC |
251 | DEBUGFS_FWSTATS_ADD(debug, debug1); |
252 | DEBUGFS_FWSTATS_ADD(debug, debug2); | |
253 | DEBUGFS_FWSTATS_ADD(debug, debug3); | |
254 | DEBUGFS_FWSTATS_ADD(debug, debug4); | |
255 | DEBUGFS_FWSTATS_ADD(debug, debug5); | |
256 | DEBUGFS_FWSTATS_ADD(debug, debug6); | |
257 | ||
8c0ea102 | 258 | DEBUGFS_FWSTATS_ADD(ring, prepared_descs); |
8c0ea102 | 259 | DEBUGFS_FWSTATS_ADD(ring, tx_cmplt); |
8c0ea102 LC |
260 | |
261 | DEBUGFS_FWSTATS_ADD(tx, tx_template_prepared); | |
262 | DEBUGFS_FWSTATS_ADD(tx, tx_data_prepared); | |
263 | DEBUGFS_FWSTATS_ADD(tx, tx_template_programmed); | |
264 | DEBUGFS_FWSTATS_ADD(tx, tx_data_programmed); | |
265 | DEBUGFS_FWSTATS_ADD(tx, tx_burst_programmed); | |
266 | DEBUGFS_FWSTATS_ADD(tx, tx_starts); | |
267 | DEBUGFS_FWSTATS_ADD(tx, tx_imm_resp); | |
268 | DEBUGFS_FWSTATS_ADD(tx, tx_start_templates); | |
269 | DEBUGFS_FWSTATS_ADD(tx, tx_start_int_templates); | |
270 | DEBUGFS_FWSTATS_ADD(tx, tx_start_fw_gen); | |
271 | DEBUGFS_FWSTATS_ADD(tx, tx_start_data); | |
272 | DEBUGFS_FWSTATS_ADD(tx, tx_start_null_frame); | |
273 | DEBUGFS_FWSTATS_ADD(tx, tx_exch); | |
274 | DEBUGFS_FWSTATS_ADD(tx, tx_retry_template); | |
275 | DEBUGFS_FWSTATS_ADD(tx, tx_retry_data); | |
276 | DEBUGFS_FWSTATS_ADD(tx, tx_exch_pending); | |
277 | DEBUGFS_FWSTATS_ADD(tx, tx_exch_expiry); | |
8c0ea102 LC |
278 | DEBUGFS_FWSTATS_ADD(tx, tx_done_template); |
279 | DEBUGFS_FWSTATS_ADD(tx, tx_done_data); | |
280 | DEBUGFS_FWSTATS_ADD(tx, tx_done_int_template); | |
c5d94169 LC |
281 | DEBUGFS_FWSTATS_ADD(tx, tx_frame_checksum); |
282 | DEBUGFS_FWSTATS_ADD(tx, tx_checksum_result); | |
283 | DEBUGFS_FWSTATS_ADD(tx, frag_called); | |
284 | DEBUGFS_FWSTATS_ADD(tx, frag_mpdu_alloc_failed); | |
285 | DEBUGFS_FWSTATS_ADD(tx, frag_init_called); | |
286 | DEBUGFS_FWSTATS_ADD(tx, frag_in_process_called); | |
287 | DEBUGFS_FWSTATS_ADD(tx, frag_tkip_called); | |
288 | DEBUGFS_FWSTATS_ADD(tx, frag_key_not_found); | |
289 | DEBUGFS_FWSTATS_ADD(tx, frag_need_fragmentation); | |
290 | DEBUGFS_FWSTATS_ADD(tx, frag_bad_mblk_num); | |
291 | DEBUGFS_FWSTATS_ADD(tx, frag_failed); | |
292 | DEBUGFS_FWSTATS_ADD(tx, frag_cache_hit); | |
293 | DEBUGFS_FWSTATS_ADD(tx, frag_cache_miss); | |
8c0ea102 LC |
294 | |
295 | DEBUGFS_FWSTATS_ADD(rx, rx_out_of_mem); | |
296 | DEBUGFS_FWSTATS_ADD(rx, rx_hdr_overflow); | |
8c0ea102 | 297 | DEBUGFS_FWSTATS_ADD(rx, rx_dropped_frame); |
8c0ea102 LC |
298 | DEBUGFS_FWSTATS_ADD(rx, rx_done); |
299 | DEBUGFS_FWSTATS_ADD(rx, rx_defrag); | |
300 | DEBUGFS_FWSTATS_ADD(rx, rx_defrag_end); | |
8c0ea102 LC |
301 | DEBUGFS_FWSTATS_ADD(rx, rx_cmplt); |
302 | DEBUGFS_FWSTATS_ADD(rx, rx_pre_complt); | |
303 | DEBUGFS_FWSTATS_ADD(rx, rx_cmplt_task); | |
304 | DEBUGFS_FWSTATS_ADD(rx, rx_phy_hdr); | |
305 | DEBUGFS_FWSTATS_ADD(rx, rx_timeout); | |
c5d94169 LC |
306 | DEBUGFS_FWSTATS_ADD(rx, rx_frame_checksum); |
307 | DEBUGFS_FWSTATS_ADD(rx, rx_checksum_result); | |
308 | DEBUGFS_FWSTATS_ADD(rx, defrag_called); | |
309 | DEBUGFS_FWSTATS_ADD(rx, defrag_init_called); | |
310 | DEBUGFS_FWSTATS_ADD(rx, defrag_in_process_called); | |
311 | DEBUGFS_FWSTATS_ADD(rx, defrag_tkip_called); | |
312 | DEBUGFS_FWSTATS_ADD(rx, defrag_need_defrag); | |
313 | DEBUGFS_FWSTATS_ADD(rx, defrag_decrypt_failed); | |
314 | DEBUGFS_FWSTATS_ADD(rx, decrypt_key_not_found); | |
315 | DEBUGFS_FWSTATS_ADD(rx, defrag_need_decrypt); | |
8c0ea102 LC |
316 | |
317 | DEBUGFS_FWSTATS_ADD(isr, irqs); | |
318 | ||
8c0ea102 LC |
319 | DEBUGFS_FWSTATS_ADD(pwr, missing_bcns_cnt); |
320 | DEBUGFS_FWSTATS_ADD(pwr, rcvd_bcns_cnt); | |
321 | DEBUGFS_FWSTATS_ADD(pwr, connection_out_of_sync); | |
322 | DEBUGFS_FWSTATS_ADD(pwr, cont_miss_bcns_spread); | |
323 | DEBUGFS_FWSTATS_ADD(pwr, rcvd_awake_bcns_cnt); | |
324 | ||
8c0ea102 LC |
325 | DEBUGFS_FWSTATS_ADD(event, calibration); |
326 | DEBUGFS_FWSTATS_ADD(event, rx_mismatch); | |
327 | DEBUGFS_FWSTATS_ADD(event, rx_mem_empty); | |
328 | ||
329 | DEBUGFS_FWSTATS_ADD(ps_poll, ps_poll_timeouts); | |
330 | DEBUGFS_FWSTATS_ADD(ps_poll, upsd_timeouts); | |
331 | DEBUGFS_FWSTATS_ADD(ps_poll, upsd_max_ap_turn); | |
332 | DEBUGFS_FWSTATS_ADD(ps_poll, ps_poll_max_ap_turn); | |
333 | DEBUGFS_FWSTATS_ADD(ps_poll, ps_poll_utilization); | |
334 | DEBUGFS_FWSTATS_ADD(ps_poll, upsd_utilization); | |
335 | ||
336 | DEBUGFS_FWSTATS_ADD(rx_filter, beacon_filter); | |
337 | DEBUGFS_FWSTATS_ADD(rx_filter, arp_filter); | |
338 | DEBUGFS_FWSTATS_ADD(rx_filter, mc_filter); | |
339 | DEBUGFS_FWSTATS_ADD(rx_filter, dup_filter); | |
340 | DEBUGFS_FWSTATS_ADD(rx_filter, data_filter); | |
341 | DEBUGFS_FWSTATS_ADD(rx_filter, ibss_filter); | |
342 | DEBUGFS_FWSTATS_ADD(rx_filter, protection_filter); | |
343 | ||
c5d94169 LC |
344 | DEBUGFS_FWSTATS_ADD(rx_rate, rx_frames_per_rates); |
345 | ||
346 | DEBUGFS_FWSTATS_ADD(aggr_size, tx_size); | |
347 | DEBUGFS_FWSTATS_ADD(aggr_size, rx_size); | |
348 | ||
349 | DEBUGFS_FWSTATS_ADD(pipeline, hs_tx_stat_fifo_int); | |
350 | DEBUGFS_FWSTATS_ADD(pipeline, tcp_tx_stat_fifo_int); | |
351 | DEBUGFS_FWSTATS_ADD(pipeline, tcp_rx_stat_fifo_int); | |
352 | DEBUGFS_FWSTATS_ADD(pipeline, enc_tx_stat_fifo_int); | |
353 | DEBUGFS_FWSTATS_ADD(pipeline, enc_rx_stat_fifo_int); | |
354 | DEBUGFS_FWSTATS_ADD(pipeline, rx_complete_stat_fifo_int); | |
355 | DEBUGFS_FWSTATS_ADD(pipeline, pre_proc_swi); | |
356 | DEBUGFS_FWSTATS_ADD(pipeline, post_proc_swi); | |
357 | DEBUGFS_FWSTATS_ADD(pipeline, sec_frag_swi); | |
358 | DEBUGFS_FWSTATS_ADD(pipeline, pre_to_defrag_swi); | |
359 | DEBUGFS_FWSTATS_ADD(pipeline, defrag_to_csum_swi); | |
360 | DEBUGFS_FWSTATS_ADD(pipeline, csum_to_rx_xfer_swi); | |
361 | DEBUGFS_FWSTATS_ADD(pipeline, dec_packet_in); | |
362 | DEBUGFS_FWSTATS_ADD(pipeline, dec_packet_in_fifo_full); | |
363 | DEBUGFS_FWSTATS_ADD(pipeline, dec_packet_out); | |
364 | DEBUGFS_FWSTATS_ADD(pipeline, cs_rx_packet_in); | |
365 | DEBUGFS_FWSTATS_ADD(pipeline, cs_rx_packet_out); | |
366 | ||
367 | DEBUGFS_FWSTATS_ADD(mem, rx_free_mem_blks); | |
368 | DEBUGFS_FWSTATS_ADD(mem, tx_free_mem_blks); | |
369 | DEBUGFS_FWSTATS_ADD(mem, fwlog_free_mem_blks); | |
370 | DEBUGFS_FWSTATS_ADD(mem, fw_gen_free_mem_blks); | |
8c0ea102 | 371 | |
18b70ac9 LC |
372 | DEBUGFS_ADD(conf, moddir); |
373 | ||
8c0ea102 LC |
374 | return 0; |
375 | ||
376 | err: | |
377 | if (IS_ERR(entry)) | |
378 | ret = PTR_ERR(entry); | |
379 | else | |
380 | ret = -ENOMEM; | |
381 | ||
382 | return ret; | |
383 | } |