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" | |
e7d32324 EP |
25 | #include "../wlcore/debug.h" |
26 | #include "../wlcore/ps.h" | |
8c0ea102 LC |
27 | |
28 | #include "wl18xx.h" | |
29 | #include "acx.h" | |
e7d32324 | 30 | #include "cmd.h" |
8c0ea102 LC |
31 | #include "debugfs.h" |
32 | ||
33 | #define WL18XX_DEBUGFS_FWSTATS_FILE(a, b, c) \ | |
34 | DEBUGFS_FWSTATS_FILE(a, b, c, wl18xx_acx_statistics) | |
35 | #define WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(a, b, c) \ | |
36 | DEBUGFS_FWSTATS_FILE_ARRAY(a, b, c, wl18xx_acx_statistics) | |
37 | ||
c5d94169 | 38 | |
8c0ea102 LC |
39 | WL18XX_DEBUGFS_FWSTATS_FILE(debug, debug1, "%u"); |
40 | WL18XX_DEBUGFS_FWSTATS_FILE(debug, debug2, "%u"); | |
41 | WL18XX_DEBUGFS_FWSTATS_FILE(debug, debug3, "%u"); | |
42 | WL18XX_DEBUGFS_FWSTATS_FILE(debug, debug4, "%u"); | |
43 | WL18XX_DEBUGFS_FWSTATS_FILE(debug, debug5, "%u"); | |
44 | WL18XX_DEBUGFS_FWSTATS_FILE(debug, debug6, "%u"); | |
45 | ||
8dd8e53c IR |
46 | WL18XX_DEBUGFS_FWSTATS_FILE(error, error_frame, "%u"); |
47 | WL18XX_DEBUGFS_FWSTATS_FILE(error, error_null_Frame_tx_start, "%u"); | |
48 | WL18XX_DEBUGFS_FWSTATS_FILE(error, error_numll_frame_cts_start, "%u"); | |
49 | WL18XX_DEBUGFS_FWSTATS_FILE(error, error_bar_retry, "%u"); | |
50 | WL18XX_DEBUGFS_FWSTATS_FILE(error, error_frame_cts_nul_flid, "%u"); | |
51 | ||
52 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_prepared_descs, "%u"); | |
53 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_cmplt, "%u"); | |
8c0ea102 LC |
54 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_template_prepared, "%u"); |
55 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_data_prepared, "%u"); | |
56 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_template_programmed, "%u"); | |
57 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_data_programmed, "%u"); | |
58 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_burst_programmed, "%u"); | |
59 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_starts, "%u"); | |
60 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_imm_resp, "%u"); | |
61 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_start_templates, "%u"); | |
62 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_start_int_templates, "%u"); | |
63 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_start_fw_gen, "%u"); | |
64 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_start_data, "%u"); | |
65 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_start_null_frame, "%u"); | |
66 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_exch, "%u"); | |
67 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_retry_template, "%u"); | |
68 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_retry_data, "%u"); | |
69 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_exch_pending, "%u"); | |
70 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_exch_expiry, "%u"); | |
8c0ea102 LC |
71 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_done_template, "%u"); |
72 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_done_data, "%u"); | |
73 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_done_int_template, "%u"); | |
c5d94169 LC |
74 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_frame_checksum, "%u"); |
75 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_checksum_result, "%u"); | |
76 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_called, "%u"); | |
77 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_mpdu_alloc_failed, "%u"); | |
78 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_init_called, "%u"); | |
79 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_in_process_called, "%u"); | |
80 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_tkip_called, "%u"); | |
81 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_key_not_found, "%u"); | |
82 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_need_fragmentation, "%u"); | |
83 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_bad_mblk_num, "%u"); | |
84 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_failed, "%u"); | |
85 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_cache_hit, "%u"); | |
86 | WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_cache_miss, "%u"); | |
8c0ea102 | 87 | |
8dd8e53c IR |
88 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_beacon_early_term, "%u"); |
89 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_out_of_mpdu_nodes, "%u"); | |
8c0ea102 | 90 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_hdr_overflow, "%u"); |
8c0ea102 | 91 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_dropped_frame, "%u"); |
8c0ea102 LC |
92 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_done, "%u"); |
93 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_defrag, "%u"); | |
94 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_defrag_end, "%u"); | |
8c0ea102 LC |
95 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_cmplt, "%u"); |
96 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_pre_complt, "%u"); | |
97 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_cmplt_task, "%u"); | |
98 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_phy_hdr, "%u"); | |
99 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_timeout, "%u"); | |
8dd8e53c IR |
100 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_timeout_wa, "%u"); |
101 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_wa_density_dropped_frame, "%u"); | |
102 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_wa_ba_not_expected, "%u"); | |
c5d94169 LC |
103 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_frame_checksum, "%u"); |
104 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_checksum_result, "%u"); | |
105 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, defrag_called, "%u"); | |
106 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, defrag_init_called, "%u"); | |
107 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, defrag_in_process_called, "%u"); | |
108 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, defrag_tkip_called, "%u"); | |
109 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, defrag_need_defrag, "%u"); | |
110 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, defrag_decrypt_failed, "%u"); | |
111 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, decrypt_key_not_found, "%u"); | |
112 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, defrag_need_decrypt, "%u"); | |
8dd8e53c | 113 | WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_tkip_replays, "%u"); |
8c0ea102 LC |
114 | |
115 | WL18XX_DEBUGFS_FWSTATS_FILE(isr, irqs, "%u"); | |
116 | ||
8c0ea102 LC |
117 | WL18XX_DEBUGFS_FWSTATS_FILE(pwr, missing_bcns_cnt, "%u"); |
118 | WL18XX_DEBUGFS_FWSTATS_FILE(pwr, rcvd_bcns_cnt, "%u"); | |
119 | WL18XX_DEBUGFS_FWSTATS_FILE(pwr, connection_out_of_sync, "%u"); | |
120 | WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(pwr, cont_miss_bcns_spread, | |
121 | PWR_STAT_MAX_CONT_MISSED_BCNS_SPREAD); | |
122 | WL18XX_DEBUGFS_FWSTATS_FILE(pwr, rcvd_awake_bcns_cnt, "%u"); | |
123 | ||
8c0ea102 | 124 | |
8c0ea102 LC |
125 | WL18XX_DEBUGFS_FWSTATS_FILE(ps_poll, ps_poll_timeouts, "%u"); |
126 | WL18XX_DEBUGFS_FWSTATS_FILE(ps_poll, upsd_timeouts, "%u"); | |
127 | WL18XX_DEBUGFS_FWSTATS_FILE(ps_poll, upsd_max_ap_turn, "%u"); | |
128 | WL18XX_DEBUGFS_FWSTATS_FILE(ps_poll, ps_poll_max_ap_turn, "%u"); | |
129 | WL18XX_DEBUGFS_FWSTATS_FILE(ps_poll, ps_poll_utilization, "%u"); | |
130 | WL18XX_DEBUGFS_FWSTATS_FILE(ps_poll, upsd_utilization, "%u"); | |
131 | ||
132 | WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, beacon_filter, "%u"); | |
133 | WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, arp_filter, "%u"); | |
134 | WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, mc_filter, "%u"); | |
135 | WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, dup_filter, "%u"); | |
136 | WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, data_filter, "%u"); | |
137 | WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, ibss_filter, "%u"); | |
138 | WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, protection_filter, "%u"); | |
8dd8e53c IR |
139 | WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, accum_arp_pend_requests, "%u"); |
140 | WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, max_arp_queue_dep, "%u"); | |
8c0ea102 | 141 | |
a3fa71c4 | 142 | WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(rx_rate, rx_frames_per_rates, 50); |
c5d94169 | 143 | |
8dd8e53c IR |
144 | WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(aggr_size, tx_agg_vs_rate, |
145 | AGGR_STATS_TX_AGG*AGGR_STATS_TX_RATE); | |
c5d94169 LC |
146 | WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(aggr_size, rx_size, |
147 | AGGR_STATS_RX_SIZE_LEN); | |
148 | ||
149 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, hs_tx_stat_fifo_int, "%u"); | |
150 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, tcp_tx_stat_fifo_int, "%u"); | |
151 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, tcp_rx_stat_fifo_int, "%u"); | |
152 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, enc_tx_stat_fifo_int, "%u"); | |
153 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, enc_rx_stat_fifo_int, "%u"); | |
154 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, rx_complete_stat_fifo_int, "%u"); | |
155 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, pre_proc_swi, "%u"); | |
156 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, post_proc_swi, "%u"); | |
157 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, sec_frag_swi, "%u"); | |
158 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, pre_to_defrag_swi, "%u"); | |
159 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, defrag_to_csum_swi, "%u"); | |
160 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, csum_to_rx_xfer_swi, "%u"); | |
161 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, dec_packet_in, "%u"); | |
162 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, dec_packet_in_fifo_full, "%u"); | |
163 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, dec_packet_out, "%u"); | |
164 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, cs_rx_packet_in, "%u"); | |
165 | WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, cs_rx_packet_out, "%u"); | |
166 | ||
8dd8e53c IR |
167 | WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(pipeline, pipeline_fifo_full, |
168 | PIPE_STATS_HW_FIFO); | |
169 | ||
c5d94169 LC |
170 | WL18XX_DEBUGFS_FWSTATS_FILE(mem, rx_free_mem_blks, "%u"); |
171 | WL18XX_DEBUGFS_FWSTATS_FILE(mem, tx_free_mem_blks, "%u"); | |
172 | WL18XX_DEBUGFS_FWSTATS_FILE(mem, fwlog_free_mem_blks, "%u"); | |
173 | WL18XX_DEBUGFS_FWSTATS_FILE(mem, fw_gen_free_mem_blks, "%u"); | |
8c0ea102 | 174 | |
18b70ac9 LC |
175 | static ssize_t conf_read(struct file *file, char __user *user_buf, |
176 | size_t count, loff_t *ppos) | |
177 | { | |
178 | struct wl1271 *wl = file->private_data; | |
179 | struct wl18xx_priv *priv = wl->priv; | |
180 | struct wlcore_conf_header header; | |
181 | char *buf, *pos; | |
182 | size_t len; | |
183 | int ret; | |
184 | ||
185 | len = WL18XX_CONF_SIZE; | |
186 | buf = kmalloc(len, GFP_KERNEL); | |
187 | if (!buf) | |
188 | return -ENOMEM; | |
189 | ||
190 | header.magic = cpu_to_le32(WL18XX_CONF_MAGIC); | |
191 | header.version = cpu_to_le32(WL18XX_CONF_VERSION); | |
192 | header.checksum = 0; | |
193 | ||
194 | mutex_lock(&wl->mutex); | |
195 | ||
196 | pos = buf; | |
197 | memcpy(pos, &header, sizeof(header)); | |
198 | pos += sizeof(header); | |
199 | memcpy(pos, &wl->conf, sizeof(wl->conf)); | |
200 | pos += sizeof(wl->conf); | |
201 | memcpy(pos, &priv->conf, sizeof(priv->conf)); | |
202 | ||
203 | mutex_unlock(&wl->mutex); | |
204 | ||
205 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, len); | |
206 | ||
207 | kfree(buf); | |
208 | return ret; | |
209 | } | |
210 | ||
211 | static const struct file_operations conf_ops = { | |
212 | .read = conf_read, | |
213 | .open = simple_open, | |
214 | .llseek = default_llseek, | |
215 | }; | |
216 | ||
f74ea74b LC |
217 | static ssize_t clear_fw_stats_write(struct file *file, |
218 | const char __user *user_buf, | |
219 | size_t count, loff_t *ppos) | |
220 | { | |
221 | struct wl1271 *wl = file->private_data; | |
222 | int ret; | |
223 | ||
224 | mutex_lock(&wl->mutex); | |
225 | ||
4cc53383 | 226 | if (unlikely(wl->state != WLCORE_STATE_ON)) |
f74ea74b LC |
227 | goto out; |
228 | ||
229 | ret = wl18xx_acx_clear_statistics(wl); | |
230 | if (ret < 0) { | |
231 | count = ret; | |
232 | goto out; | |
233 | } | |
234 | out: | |
235 | mutex_unlock(&wl->mutex); | |
236 | return count; | |
237 | } | |
238 | ||
239 | static const struct file_operations clear_fw_stats_ops = { | |
240 | .write = clear_fw_stats_write, | |
241 | .open = simple_open, | |
242 | .llseek = default_llseek, | |
243 | }; | |
244 | ||
e7d32324 EP |
245 | static ssize_t radar_detection_write(struct file *file, |
246 | const char __user *user_buf, | |
247 | size_t count, loff_t *ppos) | |
248 | { | |
249 | struct wl1271 *wl = file->private_data; | |
250 | int ret; | |
251 | u8 channel; | |
252 | ||
253 | ret = kstrtou8_from_user(user_buf, count, 10, &channel); | |
254 | if (ret < 0) { | |
255 | wl1271_warning("illegal channel"); | |
256 | return -EINVAL; | |
257 | } | |
258 | ||
259 | mutex_lock(&wl->mutex); | |
260 | ||
261 | if (unlikely(wl->state != WLCORE_STATE_ON)) | |
262 | goto out; | |
263 | ||
264 | ret = wl1271_ps_elp_wakeup(wl); | |
265 | if (ret < 0) | |
266 | goto out; | |
267 | ||
268 | ret = wl18xx_cmd_radar_detection_debug(wl, channel); | |
269 | if (ret < 0) | |
270 | count = ret; | |
271 | ||
272 | wl1271_ps_elp_sleep(wl); | |
273 | out: | |
274 | mutex_unlock(&wl->mutex); | |
275 | return count; | |
276 | } | |
277 | ||
278 | static const struct file_operations radar_detection_ops = { | |
279 | .write = radar_detection_write, | |
280 | .open = simple_open, | |
281 | .llseek = default_llseek, | |
282 | }; | |
283 | ||
d1c54096 GM |
284 | static ssize_t dynamic_fw_traces_write(struct file *file, |
285 | const char __user *user_buf, | |
286 | size_t count, loff_t *ppos) | |
287 | { | |
288 | struct wl1271 *wl = file->private_data; | |
289 | unsigned long value; | |
290 | int ret; | |
291 | ||
292 | ret = kstrtoul_from_user(user_buf, count, 0, &value); | |
293 | if (ret < 0) | |
294 | return ret; | |
295 | ||
296 | mutex_lock(&wl->mutex); | |
297 | ||
298 | wl->dynamic_fw_traces = value; | |
299 | ||
300 | if (unlikely(wl->state != WLCORE_STATE_ON)) | |
301 | goto out; | |
302 | ||
303 | ret = wl1271_ps_elp_wakeup(wl); | |
304 | if (ret < 0) | |
305 | goto out; | |
306 | ||
307 | ret = wl18xx_acx_dynamic_fw_traces(wl); | |
308 | if (ret < 0) | |
309 | count = ret; | |
310 | ||
311 | wl1271_ps_elp_sleep(wl); | |
312 | out: | |
313 | mutex_unlock(&wl->mutex); | |
314 | return count; | |
315 | } | |
316 | ||
317 | static ssize_t dynamic_fw_traces_read(struct file *file, | |
318 | char __user *userbuf, | |
319 | size_t count, loff_t *ppos) | |
320 | { | |
321 | struct wl1271 *wl = file->private_data; | |
322 | return wl1271_format_buffer(userbuf, count, ppos, | |
323 | "%d\n", wl->dynamic_fw_traces); | |
324 | } | |
325 | ||
326 | static const struct file_operations dynamic_fw_traces_ops = { | |
327 | .read = dynamic_fw_traces_read, | |
328 | .write = dynamic_fw_traces_write, | |
329 | .open = simple_open, | |
330 | .llseek = default_llseek, | |
331 | }; | |
332 | ||
8c0ea102 LC |
333 | int wl18xx_debugfs_add_files(struct wl1271 *wl, |
334 | struct dentry *rootdir) | |
335 | { | |
336 | int ret = 0; | |
ad62d81a | 337 | struct dentry *entry, *stats, *moddir; |
8c0ea102 | 338 | |
ad62d81a LC |
339 | moddir = debugfs_create_dir(KBUILD_MODNAME, rootdir); |
340 | if (!moddir || IS_ERR(moddir)) { | |
341 | entry = moddir; | |
342 | goto err; | |
343 | } | |
344 | ||
345 | stats = debugfs_create_dir("fw_stats", moddir); | |
8c0ea102 LC |
346 | if (!stats || IS_ERR(stats)) { |
347 | entry = stats; | |
348 | goto err; | |
349 | } | |
350 | ||
f74ea74b LC |
351 | DEBUGFS_ADD(clear_fw_stats, stats); |
352 | ||
8c0ea102 LC |
353 | DEBUGFS_FWSTATS_ADD(debug, debug1); |
354 | DEBUGFS_FWSTATS_ADD(debug, debug2); | |
355 | DEBUGFS_FWSTATS_ADD(debug, debug3); | |
356 | DEBUGFS_FWSTATS_ADD(debug, debug4); | |
357 | DEBUGFS_FWSTATS_ADD(debug, debug5); | |
358 | DEBUGFS_FWSTATS_ADD(debug, debug6); | |
359 | ||
8dd8e53c IR |
360 | DEBUGFS_FWSTATS_ADD(error, error_frame); |
361 | DEBUGFS_FWSTATS_ADD(error, error_null_Frame_tx_start); | |
362 | DEBUGFS_FWSTATS_ADD(error, error_numll_frame_cts_start); | |
363 | DEBUGFS_FWSTATS_ADD(error, error_bar_retry); | |
364 | DEBUGFS_FWSTATS_ADD(error, error_frame_cts_nul_flid); | |
8c0ea102 | 365 | |
8dd8e53c IR |
366 | DEBUGFS_FWSTATS_ADD(tx, tx_prepared_descs); |
367 | DEBUGFS_FWSTATS_ADD(tx, tx_cmplt); | |
8c0ea102 LC |
368 | DEBUGFS_FWSTATS_ADD(tx, tx_template_prepared); |
369 | DEBUGFS_FWSTATS_ADD(tx, tx_data_prepared); | |
370 | DEBUGFS_FWSTATS_ADD(tx, tx_template_programmed); | |
371 | DEBUGFS_FWSTATS_ADD(tx, tx_data_programmed); | |
372 | DEBUGFS_FWSTATS_ADD(tx, tx_burst_programmed); | |
373 | DEBUGFS_FWSTATS_ADD(tx, tx_starts); | |
374 | DEBUGFS_FWSTATS_ADD(tx, tx_imm_resp); | |
375 | DEBUGFS_FWSTATS_ADD(tx, tx_start_templates); | |
376 | DEBUGFS_FWSTATS_ADD(tx, tx_start_int_templates); | |
377 | DEBUGFS_FWSTATS_ADD(tx, tx_start_fw_gen); | |
378 | DEBUGFS_FWSTATS_ADD(tx, tx_start_data); | |
379 | DEBUGFS_FWSTATS_ADD(tx, tx_start_null_frame); | |
380 | DEBUGFS_FWSTATS_ADD(tx, tx_exch); | |
381 | DEBUGFS_FWSTATS_ADD(tx, tx_retry_template); | |
382 | DEBUGFS_FWSTATS_ADD(tx, tx_retry_data); | |
383 | DEBUGFS_FWSTATS_ADD(tx, tx_exch_pending); | |
384 | DEBUGFS_FWSTATS_ADD(tx, tx_exch_expiry); | |
8c0ea102 LC |
385 | DEBUGFS_FWSTATS_ADD(tx, tx_done_template); |
386 | DEBUGFS_FWSTATS_ADD(tx, tx_done_data); | |
387 | DEBUGFS_FWSTATS_ADD(tx, tx_done_int_template); | |
c5d94169 LC |
388 | DEBUGFS_FWSTATS_ADD(tx, tx_frame_checksum); |
389 | DEBUGFS_FWSTATS_ADD(tx, tx_checksum_result); | |
390 | DEBUGFS_FWSTATS_ADD(tx, frag_called); | |
391 | DEBUGFS_FWSTATS_ADD(tx, frag_mpdu_alloc_failed); | |
392 | DEBUGFS_FWSTATS_ADD(tx, frag_init_called); | |
393 | DEBUGFS_FWSTATS_ADD(tx, frag_in_process_called); | |
394 | DEBUGFS_FWSTATS_ADD(tx, frag_tkip_called); | |
395 | DEBUGFS_FWSTATS_ADD(tx, frag_key_not_found); | |
396 | DEBUGFS_FWSTATS_ADD(tx, frag_need_fragmentation); | |
397 | DEBUGFS_FWSTATS_ADD(tx, frag_bad_mblk_num); | |
398 | DEBUGFS_FWSTATS_ADD(tx, frag_failed); | |
399 | DEBUGFS_FWSTATS_ADD(tx, frag_cache_hit); | |
400 | DEBUGFS_FWSTATS_ADD(tx, frag_cache_miss); | |
8c0ea102 | 401 | |
8dd8e53c IR |
402 | DEBUGFS_FWSTATS_ADD(rx, rx_beacon_early_term); |
403 | DEBUGFS_FWSTATS_ADD(rx, rx_out_of_mpdu_nodes); | |
8c0ea102 | 404 | DEBUGFS_FWSTATS_ADD(rx, rx_hdr_overflow); |
8c0ea102 | 405 | DEBUGFS_FWSTATS_ADD(rx, rx_dropped_frame); |
8c0ea102 LC |
406 | DEBUGFS_FWSTATS_ADD(rx, rx_done); |
407 | DEBUGFS_FWSTATS_ADD(rx, rx_defrag); | |
408 | DEBUGFS_FWSTATS_ADD(rx, rx_defrag_end); | |
8c0ea102 LC |
409 | DEBUGFS_FWSTATS_ADD(rx, rx_cmplt); |
410 | DEBUGFS_FWSTATS_ADD(rx, rx_pre_complt); | |
411 | DEBUGFS_FWSTATS_ADD(rx, rx_cmplt_task); | |
412 | DEBUGFS_FWSTATS_ADD(rx, rx_phy_hdr); | |
413 | DEBUGFS_FWSTATS_ADD(rx, rx_timeout); | |
8dd8e53c IR |
414 | DEBUGFS_FWSTATS_ADD(rx, rx_timeout_wa); |
415 | DEBUGFS_FWSTATS_ADD(rx, rx_wa_density_dropped_frame); | |
416 | DEBUGFS_FWSTATS_ADD(rx, rx_wa_ba_not_expected); | |
c5d94169 LC |
417 | DEBUGFS_FWSTATS_ADD(rx, rx_frame_checksum); |
418 | DEBUGFS_FWSTATS_ADD(rx, rx_checksum_result); | |
419 | DEBUGFS_FWSTATS_ADD(rx, defrag_called); | |
420 | DEBUGFS_FWSTATS_ADD(rx, defrag_init_called); | |
421 | DEBUGFS_FWSTATS_ADD(rx, defrag_in_process_called); | |
422 | DEBUGFS_FWSTATS_ADD(rx, defrag_tkip_called); | |
423 | DEBUGFS_FWSTATS_ADD(rx, defrag_need_defrag); | |
424 | DEBUGFS_FWSTATS_ADD(rx, defrag_decrypt_failed); | |
425 | DEBUGFS_FWSTATS_ADD(rx, decrypt_key_not_found); | |
426 | DEBUGFS_FWSTATS_ADD(rx, defrag_need_decrypt); | |
8dd8e53c | 427 | DEBUGFS_FWSTATS_ADD(rx, rx_tkip_replays); |
8c0ea102 LC |
428 | |
429 | DEBUGFS_FWSTATS_ADD(isr, irqs); | |
430 | ||
8c0ea102 LC |
431 | DEBUGFS_FWSTATS_ADD(pwr, missing_bcns_cnt); |
432 | DEBUGFS_FWSTATS_ADD(pwr, rcvd_bcns_cnt); | |
433 | DEBUGFS_FWSTATS_ADD(pwr, connection_out_of_sync); | |
434 | DEBUGFS_FWSTATS_ADD(pwr, cont_miss_bcns_spread); | |
435 | DEBUGFS_FWSTATS_ADD(pwr, rcvd_awake_bcns_cnt); | |
436 | ||
8c0ea102 LC |
437 | DEBUGFS_FWSTATS_ADD(ps_poll, ps_poll_timeouts); |
438 | DEBUGFS_FWSTATS_ADD(ps_poll, upsd_timeouts); | |
439 | DEBUGFS_FWSTATS_ADD(ps_poll, upsd_max_ap_turn); | |
440 | DEBUGFS_FWSTATS_ADD(ps_poll, ps_poll_max_ap_turn); | |
441 | DEBUGFS_FWSTATS_ADD(ps_poll, ps_poll_utilization); | |
442 | DEBUGFS_FWSTATS_ADD(ps_poll, upsd_utilization); | |
443 | ||
444 | DEBUGFS_FWSTATS_ADD(rx_filter, beacon_filter); | |
445 | DEBUGFS_FWSTATS_ADD(rx_filter, arp_filter); | |
446 | DEBUGFS_FWSTATS_ADD(rx_filter, mc_filter); | |
447 | DEBUGFS_FWSTATS_ADD(rx_filter, dup_filter); | |
448 | DEBUGFS_FWSTATS_ADD(rx_filter, data_filter); | |
449 | DEBUGFS_FWSTATS_ADD(rx_filter, ibss_filter); | |
450 | DEBUGFS_FWSTATS_ADD(rx_filter, protection_filter); | |
8dd8e53c IR |
451 | DEBUGFS_FWSTATS_ADD(rx_filter, accum_arp_pend_requests); |
452 | DEBUGFS_FWSTATS_ADD(rx_filter, max_arp_queue_dep); | |
8c0ea102 | 453 | |
c5d94169 LC |
454 | DEBUGFS_FWSTATS_ADD(rx_rate, rx_frames_per_rates); |
455 | ||
8dd8e53c | 456 | DEBUGFS_FWSTATS_ADD(aggr_size, tx_agg_vs_rate); |
c5d94169 LC |
457 | DEBUGFS_FWSTATS_ADD(aggr_size, rx_size); |
458 | ||
459 | DEBUGFS_FWSTATS_ADD(pipeline, hs_tx_stat_fifo_int); | |
460 | DEBUGFS_FWSTATS_ADD(pipeline, tcp_tx_stat_fifo_int); | |
461 | DEBUGFS_FWSTATS_ADD(pipeline, tcp_rx_stat_fifo_int); | |
462 | DEBUGFS_FWSTATS_ADD(pipeline, enc_tx_stat_fifo_int); | |
463 | DEBUGFS_FWSTATS_ADD(pipeline, enc_rx_stat_fifo_int); | |
464 | DEBUGFS_FWSTATS_ADD(pipeline, rx_complete_stat_fifo_int); | |
465 | DEBUGFS_FWSTATS_ADD(pipeline, pre_proc_swi); | |
466 | DEBUGFS_FWSTATS_ADD(pipeline, post_proc_swi); | |
467 | DEBUGFS_FWSTATS_ADD(pipeline, sec_frag_swi); | |
468 | DEBUGFS_FWSTATS_ADD(pipeline, pre_to_defrag_swi); | |
469 | DEBUGFS_FWSTATS_ADD(pipeline, defrag_to_csum_swi); | |
470 | DEBUGFS_FWSTATS_ADD(pipeline, csum_to_rx_xfer_swi); | |
471 | DEBUGFS_FWSTATS_ADD(pipeline, dec_packet_in); | |
472 | DEBUGFS_FWSTATS_ADD(pipeline, dec_packet_in_fifo_full); | |
473 | DEBUGFS_FWSTATS_ADD(pipeline, dec_packet_out); | |
474 | DEBUGFS_FWSTATS_ADD(pipeline, cs_rx_packet_in); | |
475 | DEBUGFS_FWSTATS_ADD(pipeline, cs_rx_packet_out); | |
8dd8e53c | 476 | DEBUGFS_FWSTATS_ADD(pipeline, pipeline_fifo_full); |
c5d94169 LC |
477 | |
478 | DEBUGFS_FWSTATS_ADD(mem, rx_free_mem_blks); | |
479 | DEBUGFS_FWSTATS_ADD(mem, tx_free_mem_blks); | |
480 | DEBUGFS_FWSTATS_ADD(mem, fwlog_free_mem_blks); | |
481 | DEBUGFS_FWSTATS_ADD(mem, fw_gen_free_mem_blks); | |
8c0ea102 | 482 | |
18b70ac9 | 483 | DEBUGFS_ADD(conf, moddir); |
e7d32324 | 484 | DEBUGFS_ADD(radar_detection, moddir); |
d1c54096 | 485 | DEBUGFS_ADD(dynamic_fw_traces, moddir); |
18b70ac9 | 486 | |
8c0ea102 LC |
487 | return 0; |
488 | ||
489 | err: | |
490 | if (IS_ERR(entry)) | |
491 | ret = PTR_ERR(entry); | |
492 | else | |
493 | ret = -ENOMEM; | |
494 | ||
495 | return ret; | |
496 | } |