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 35 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 43 WL18XX_DEBUGFS_FWSTATS_FILE(error, error_frame, "%u"); 44 WL18XX_DEBUGFS_FWSTATS_FILE(error, error_null_Frame_tx_start, "%u"); 45 WL18XX_DEBUGFS_FWSTATS_FILE(error, error_numll_frame_cts_start, "%u"); 46 WL18XX_DEBUGFS_FWSTATS_FILE(error, error_bar_retry, "%u"); 47 WL18XX_DEBUGFS_FWSTATS_FILE(error, error_frame_cts_nul_flid, "%u"); 48 49 WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_prepared_descs, "%u"); 50 WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_cmplt, "%u"); 51 WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_template_prepared, "%u"); 52 WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_data_prepared, "%u"); 53 WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_template_programmed, "%u"); 54 WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_data_programmed, "%u"); 55 WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_burst_programmed, "%u"); 56 WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_starts, "%u"); 57 WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_imm_resp, "%u"); 58 WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_start_templates, "%u"); 59 WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_start_int_templates, "%u"); 60 WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_start_fw_gen, "%u"); 61 WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_start_data, "%u"); 62 WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_start_null_frame, "%u"); 63 WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_exch, "%u"); 64 WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_retry_template, "%u"); 65 WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_retry_data, "%u"); 66 WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_exch_pending, "%u"); 67 WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_exch_expiry, "%u"); 68 WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_done_template, "%u"); 69 WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_done_data, "%u"); 70 WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_done_int_template, "%u"); 71 WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_frame_checksum, "%u"); 72 WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_checksum_result, "%u"); 73 WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_called, "%u"); 74 WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_mpdu_alloc_failed, "%u"); 75 WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_init_called, "%u"); 76 WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_in_process_called, "%u"); 77 WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_tkip_called, "%u"); 78 WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_key_not_found, "%u"); 79 WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_need_fragmentation, "%u"); 80 WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_bad_mblk_num, "%u"); 81 WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_failed, "%u"); 82 WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_cache_hit, "%u"); 83 WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_cache_miss, "%u"); 84 85 WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_beacon_early_term, "%u"); 86 WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_out_of_mpdu_nodes, "%u"); 87 WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_hdr_overflow, "%u"); 88 WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_dropped_frame, "%u"); 89 WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_done, "%u"); 90 WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_defrag, "%u"); 91 WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_defrag_end, "%u"); 92 WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_cmplt, "%u"); 93 WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_pre_complt, "%u"); 94 WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_cmplt_task, "%u"); 95 WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_phy_hdr, "%u"); 96 WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_timeout, "%u"); 97 WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_timeout_wa, "%u"); 98 WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_wa_density_dropped_frame, "%u"); 99 WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_wa_ba_not_expected, "%u"); 100 WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_frame_checksum, "%u"); 101 WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_checksum_result, "%u"); 102 WL18XX_DEBUGFS_FWSTATS_FILE(rx, defrag_called, "%u"); 103 WL18XX_DEBUGFS_FWSTATS_FILE(rx, defrag_init_called, "%u"); 104 WL18XX_DEBUGFS_FWSTATS_FILE(rx, defrag_in_process_called, "%u"); 105 WL18XX_DEBUGFS_FWSTATS_FILE(rx, defrag_tkip_called, "%u"); 106 WL18XX_DEBUGFS_FWSTATS_FILE(rx, defrag_need_defrag, "%u"); 107 WL18XX_DEBUGFS_FWSTATS_FILE(rx, defrag_decrypt_failed, "%u"); 108 WL18XX_DEBUGFS_FWSTATS_FILE(rx, decrypt_key_not_found, "%u"); 109 WL18XX_DEBUGFS_FWSTATS_FILE(rx, defrag_need_decrypt, "%u"); 110 WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_tkip_replays, "%u"); 111 112 WL18XX_DEBUGFS_FWSTATS_FILE(isr, irqs, "%u"); 113 114 WL18XX_DEBUGFS_FWSTATS_FILE(pwr, missing_bcns_cnt, "%u"); 115 WL18XX_DEBUGFS_FWSTATS_FILE(pwr, rcvd_bcns_cnt, "%u"); 116 WL18XX_DEBUGFS_FWSTATS_FILE(pwr, connection_out_of_sync, "%u"); 117 WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(pwr, cont_miss_bcns_spread, 118 PWR_STAT_MAX_CONT_MISSED_BCNS_SPREAD); 119 WL18XX_DEBUGFS_FWSTATS_FILE(pwr, rcvd_awake_bcns_cnt, "%u"); 120 121 122 WL18XX_DEBUGFS_FWSTATS_FILE(ps_poll, ps_poll_timeouts, "%u"); 123 WL18XX_DEBUGFS_FWSTATS_FILE(ps_poll, upsd_timeouts, "%u"); 124 WL18XX_DEBUGFS_FWSTATS_FILE(ps_poll, upsd_max_ap_turn, "%u"); 125 WL18XX_DEBUGFS_FWSTATS_FILE(ps_poll, ps_poll_max_ap_turn, "%u"); 126 WL18XX_DEBUGFS_FWSTATS_FILE(ps_poll, ps_poll_utilization, "%u"); 127 WL18XX_DEBUGFS_FWSTATS_FILE(ps_poll, upsd_utilization, "%u"); 128 129 WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, beacon_filter, "%u"); 130 WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, arp_filter, "%u"); 131 WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, mc_filter, "%u"); 132 WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, dup_filter, "%u"); 133 WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, data_filter, "%u"); 134 WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, ibss_filter, "%u"); 135 WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, protection_filter, "%u"); 136 WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, accum_arp_pend_requests, "%u"); 137 WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, max_arp_queue_dep, "%u"); 138 139 WL18XX_DEBUGFS_FWSTATS_FILE(rx_rate, rx_frames_per_rates, "%u"); 140 141 WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(aggr_size, tx_agg_vs_rate, 142 AGGR_STATS_TX_AGG*AGGR_STATS_TX_RATE); 143 WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(aggr_size, rx_size, 144 AGGR_STATS_RX_SIZE_LEN); 145 146 WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, hs_tx_stat_fifo_int, "%u"); 147 WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, tcp_tx_stat_fifo_int, "%u"); 148 WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, tcp_rx_stat_fifo_int, "%u"); 149 WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, enc_tx_stat_fifo_int, "%u"); 150 WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, enc_rx_stat_fifo_int, "%u"); 151 WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, rx_complete_stat_fifo_int, "%u"); 152 WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, pre_proc_swi, "%u"); 153 WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, post_proc_swi, "%u"); 154 WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, sec_frag_swi, "%u"); 155 WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, pre_to_defrag_swi, "%u"); 156 WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, defrag_to_csum_swi, "%u"); 157 WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, csum_to_rx_xfer_swi, "%u"); 158 WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, dec_packet_in, "%u"); 159 WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, dec_packet_in_fifo_full, "%u"); 160 WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, dec_packet_out, "%u"); 161 WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, cs_rx_packet_in, "%u"); 162 WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, cs_rx_packet_out, "%u"); 163 164 WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(pipeline, pipeline_fifo_full, 165 PIPE_STATS_HW_FIFO); 166 167 WL18XX_DEBUGFS_FWSTATS_FILE(mem, rx_free_mem_blks, "%u"); 168 WL18XX_DEBUGFS_FWSTATS_FILE(mem, tx_free_mem_blks, "%u"); 169 WL18XX_DEBUGFS_FWSTATS_FILE(mem, fwlog_free_mem_blks, "%u"); 170 WL18XX_DEBUGFS_FWSTATS_FILE(mem, fw_gen_free_mem_blks, "%u"); 171 172 static ssize_t conf_read(struct file *file, char __user *user_buf, 173 size_t count, loff_t *ppos) 174 { 175 struct wl1271 *wl = file->private_data; 176 struct wl18xx_priv *priv = wl->priv; 177 struct wlcore_conf_header header; 178 char *buf, *pos; 179 size_t len; 180 int ret; 181 182 len = WL18XX_CONF_SIZE; 183 buf = kmalloc(len, GFP_KERNEL); 184 if (!buf) 185 return -ENOMEM; 186 187 header.magic = cpu_to_le32(WL18XX_CONF_MAGIC); 188 header.version = cpu_to_le32(WL18XX_CONF_VERSION); 189 header.checksum = 0; 190 191 mutex_lock(&wl->mutex); 192 193 pos = buf; 194 memcpy(pos, &header, sizeof(header)); 195 pos += sizeof(header); 196 memcpy(pos, &wl->conf, sizeof(wl->conf)); 197 pos += sizeof(wl->conf); 198 memcpy(pos, &priv->conf, sizeof(priv->conf)); 199 200 mutex_unlock(&wl->mutex); 201 202 ret = simple_read_from_buffer(user_buf, count, ppos, buf, len); 203 204 kfree(buf); 205 return ret; 206 } 207 208 static const struct file_operations conf_ops = { 209 .read = conf_read, 210 .open = simple_open, 211 .llseek = default_llseek, 212 }; 213 214 static ssize_t clear_fw_stats_write(struct file *file, 215 const char __user *user_buf, 216 size_t count, loff_t *ppos) 217 { 218 struct wl1271 *wl = file->private_data; 219 int ret; 220 221 mutex_lock(&wl->mutex); 222 223 if (unlikely(wl->state != WLCORE_STATE_ON)) 224 goto out; 225 226 ret = wl18xx_acx_clear_statistics(wl); 227 if (ret < 0) { 228 count = ret; 229 goto out; 230 } 231 out: 232 mutex_unlock(&wl->mutex); 233 return count; 234 } 235 236 static const struct file_operations clear_fw_stats_ops = { 237 .write = clear_fw_stats_write, 238 .open = simple_open, 239 .llseek = default_llseek, 240 }; 241 242 int wl18xx_debugfs_add_files(struct wl1271 *wl, 243 struct dentry *rootdir) 244 { 245 int ret = 0; 246 struct dentry *entry, *stats, *moddir; 247 248 moddir = debugfs_create_dir(KBUILD_MODNAME, rootdir); 249 if (!moddir || IS_ERR(moddir)) { 250 entry = moddir; 251 goto err; 252 } 253 254 stats = debugfs_create_dir("fw_stats", moddir); 255 if (!stats || IS_ERR(stats)) { 256 entry = stats; 257 goto err; 258 } 259 260 DEBUGFS_ADD(clear_fw_stats, stats); 261 262 DEBUGFS_FWSTATS_ADD(debug, debug1); 263 DEBUGFS_FWSTATS_ADD(debug, debug2); 264 DEBUGFS_FWSTATS_ADD(debug, debug3); 265 DEBUGFS_FWSTATS_ADD(debug, debug4); 266 DEBUGFS_FWSTATS_ADD(debug, debug5); 267 DEBUGFS_FWSTATS_ADD(debug, debug6); 268 269 DEBUGFS_FWSTATS_ADD(error, error_frame); 270 DEBUGFS_FWSTATS_ADD(error, error_null_Frame_tx_start); 271 DEBUGFS_FWSTATS_ADD(error, error_numll_frame_cts_start); 272 DEBUGFS_FWSTATS_ADD(error, error_bar_retry); 273 DEBUGFS_FWSTATS_ADD(error, error_frame_cts_nul_flid); 274 275 DEBUGFS_FWSTATS_ADD(tx, tx_prepared_descs); 276 DEBUGFS_FWSTATS_ADD(tx, tx_cmplt); 277 DEBUGFS_FWSTATS_ADD(tx, tx_template_prepared); 278 DEBUGFS_FWSTATS_ADD(tx, tx_data_prepared); 279 DEBUGFS_FWSTATS_ADD(tx, tx_template_programmed); 280 DEBUGFS_FWSTATS_ADD(tx, tx_data_programmed); 281 DEBUGFS_FWSTATS_ADD(tx, tx_burst_programmed); 282 DEBUGFS_FWSTATS_ADD(tx, tx_starts); 283 DEBUGFS_FWSTATS_ADD(tx, tx_imm_resp); 284 DEBUGFS_FWSTATS_ADD(tx, tx_start_templates); 285 DEBUGFS_FWSTATS_ADD(tx, tx_start_int_templates); 286 DEBUGFS_FWSTATS_ADD(tx, tx_start_fw_gen); 287 DEBUGFS_FWSTATS_ADD(tx, tx_start_data); 288 DEBUGFS_FWSTATS_ADD(tx, tx_start_null_frame); 289 DEBUGFS_FWSTATS_ADD(tx, tx_exch); 290 DEBUGFS_FWSTATS_ADD(tx, tx_retry_template); 291 DEBUGFS_FWSTATS_ADD(tx, tx_retry_data); 292 DEBUGFS_FWSTATS_ADD(tx, tx_exch_pending); 293 DEBUGFS_FWSTATS_ADD(tx, tx_exch_expiry); 294 DEBUGFS_FWSTATS_ADD(tx, tx_done_template); 295 DEBUGFS_FWSTATS_ADD(tx, tx_done_data); 296 DEBUGFS_FWSTATS_ADD(tx, tx_done_int_template); 297 DEBUGFS_FWSTATS_ADD(tx, tx_frame_checksum); 298 DEBUGFS_FWSTATS_ADD(tx, tx_checksum_result); 299 DEBUGFS_FWSTATS_ADD(tx, frag_called); 300 DEBUGFS_FWSTATS_ADD(tx, frag_mpdu_alloc_failed); 301 DEBUGFS_FWSTATS_ADD(tx, frag_init_called); 302 DEBUGFS_FWSTATS_ADD(tx, frag_in_process_called); 303 DEBUGFS_FWSTATS_ADD(tx, frag_tkip_called); 304 DEBUGFS_FWSTATS_ADD(tx, frag_key_not_found); 305 DEBUGFS_FWSTATS_ADD(tx, frag_need_fragmentation); 306 DEBUGFS_FWSTATS_ADD(tx, frag_bad_mblk_num); 307 DEBUGFS_FWSTATS_ADD(tx, frag_failed); 308 DEBUGFS_FWSTATS_ADD(tx, frag_cache_hit); 309 DEBUGFS_FWSTATS_ADD(tx, frag_cache_miss); 310 311 DEBUGFS_FWSTATS_ADD(rx, rx_beacon_early_term); 312 DEBUGFS_FWSTATS_ADD(rx, rx_out_of_mpdu_nodes); 313 DEBUGFS_FWSTATS_ADD(rx, rx_hdr_overflow); 314 DEBUGFS_FWSTATS_ADD(rx, rx_dropped_frame); 315 DEBUGFS_FWSTATS_ADD(rx, rx_done); 316 DEBUGFS_FWSTATS_ADD(rx, rx_defrag); 317 DEBUGFS_FWSTATS_ADD(rx, rx_defrag_end); 318 DEBUGFS_FWSTATS_ADD(rx, rx_cmplt); 319 DEBUGFS_FWSTATS_ADD(rx, rx_pre_complt); 320 DEBUGFS_FWSTATS_ADD(rx, rx_cmplt_task); 321 DEBUGFS_FWSTATS_ADD(rx, rx_phy_hdr); 322 DEBUGFS_FWSTATS_ADD(rx, rx_timeout); 323 DEBUGFS_FWSTATS_ADD(rx, rx_timeout_wa); 324 DEBUGFS_FWSTATS_ADD(rx, rx_wa_density_dropped_frame); 325 DEBUGFS_FWSTATS_ADD(rx, rx_wa_ba_not_expected); 326 DEBUGFS_FWSTATS_ADD(rx, rx_frame_checksum); 327 DEBUGFS_FWSTATS_ADD(rx, rx_checksum_result); 328 DEBUGFS_FWSTATS_ADD(rx, defrag_called); 329 DEBUGFS_FWSTATS_ADD(rx, defrag_init_called); 330 DEBUGFS_FWSTATS_ADD(rx, defrag_in_process_called); 331 DEBUGFS_FWSTATS_ADD(rx, defrag_tkip_called); 332 DEBUGFS_FWSTATS_ADD(rx, defrag_need_defrag); 333 DEBUGFS_FWSTATS_ADD(rx, defrag_decrypt_failed); 334 DEBUGFS_FWSTATS_ADD(rx, decrypt_key_not_found); 335 DEBUGFS_FWSTATS_ADD(rx, defrag_need_decrypt); 336 DEBUGFS_FWSTATS_ADD(rx, rx_tkip_replays); 337 338 DEBUGFS_FWSTATS_ADD(isr, irqs); 339 340 DEBUGFS_FWSTATS_ADD(pwr, missing_bcns_cnt); 341 DEBUGFS_FWSTATS_ADD(pwr, rcvd_bcns_cnt); 342 DEBUGFS_FWSTATS_ADD(pwr, connection_out_of_sync); 343 DEBUGFS_FWSTATS_ADD(pwr, cont_miss_bcns_spread); 344 DEBUGFS_FWSTATS_ADD(pwr, rcvd_awake_bcns_cnt); 345 346 DEBUGFS_FWSTATS_ADD(ps_poll, ps_poll_timeouts); 347 DEBUGFS_FWSTATS_ADD(ps_poll, upsd_timeouts); 348 DEBUGFS_FWSTATS_ADD(ps_poll, upsd_max_ap_turn); 349 DEBUGFS_FWSTATS_ADD(ps_poll, ps_poll_max_ap_turn); 350 DEBUGFS_FWSTATS_ADD(ps_poll, ps_poll_utilization); 351 DEBUGFS_FWSTATS_ADD(ps_poll, upsd_utilization); 352 353 DEBUGFS_FWSTATS_ADD(rx_filter, beacon_filter); 354 DEBUGFS_FWSTATS_ADD(rx_filter, arp_filter); 355 DEBUGFS_FWSTATS_ADD(rx_filter, mc_filter); 356 DEBUGFS_FWSTATS_ADD(rx_filter, dup_filter); 357 DEBUGFS_FWSTATS_ADD(rx_filter, data_filter); 358 DEBUGFS_FWSTATS_ADD(rx_filter, ibss_filter); 359 DEBUGFS_FWSTATS_ADD(rx_filter, protection_filter); 360 DEBUGFS_FWSTATS_ADD(rx_filter, accum_arp_pend_requests); 361 DEBUGFS_FWSTATS_ADD(rx_filter, max_arp_queue_dep); 362 363 DEBUGFS_FWSTATS_ADD(rx_rate, rx_frames_per_rates); 364 365 DEBUGFS_FWSTATS_ADD(aggr_size, tx_agg_vs_rate); 366 DEBUGFS_FWSTATS_ADD(aggr_size, rx_size); 367 368 DEBUGFS_FWSTATS_ADD(pipeline, hs_tx_stat_fifo_int); 369 DEBUGFS_FWSTATS_ADD(pipeline, tcp_tx_stat_fifo_int); 370 DEBUGFS_FWSTATS_ADD(pipeline, tcp_rx_stat_fifo_int); 371 DEBUGFS_FWSTATS_ADD(pipeline, enc_tx_stat_fifo_int); 372 DEBUGFS_FWSTATS_ADD(pipeline, enc_rx_stat_fifo_int); 373 DEBUGFS_FWSTATS_ADD(pipeline, rx_complete_stat_fifo_int); 374 DEBUGFS_FWSTATS_ADD(pipeline, pre_proc_swi); 375 DEBUGFS_FWSTATS_ADD(pipeline, post_proc_swi); 376 DEBUGFS_FWSTATS_ADD(pipeline, sec_frag_swi); 377 DEBUGFS_FWSTATS_ADD(pipeline, pre_to_defrag_swi); 378 DEBUGFS_FWSTATS_ADD(pipeline, defrag_to_csum_swi); 379 DEBUGFS_FWSTATS_ADD(pipeline, csum_to_rx_xfer_swi); 380 DEBUGFS_FWSTATS_ADD(pipeline, dec_packet_in); 381 DEBUGFS_FWSTATS_ADD(pipeline, dec_packet_in_fifo_full); 382 DEBUGFS_FWSTATS_ADD(pipeline, dec_packet_out); 383 DEBUGFS_FWSTATS_ADD(pipeline, cs_rx_packet_in); 384 DEBUGFS_FWSTATS_ADD(pipeline, cs_rx_packet_out); 385 DEBUGFS_FWSTATS_ADD(pipeline, pipeline_fifo_full); 386 387 DEBUGFS_FWSTATS_ADD(mem, rx_free_mem_blks); 388 DEBUGFS_FWSTATS_ADD(mem, tx_free_mem_blks); 389 DEBUGFS_FWSTATS_ADD(mem, fwlog_free_mem_blks); 390 DEBUGFS_FWSTATS_ADD(mem, fw_gen_free_mem_blks); 391 392 DEBUGFS_ADD(conf, moddir); 393 394 return 0; 395 396 err: 397 if (IS_ERR(entry)) 398 ret = PTR_ERR(entry); 399 else 400 ret = -ENOMEM; 401 402 return ret; 403 } 404