1 /******************************************************************************
5 * Copyright(c) 2008 - 2009 Intel Corporation. All rights reserved.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of version 2 of the GNU General Public License as
9 * published by the Free Software Foundation.
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.
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 Street, Fifth Floor, Boston, MA 02110,
21 * The full GNU General Public License is included in this distribution
22 * in the file called LICENSE.GPL.
24 * Contact Information:
25 * Intel Linux Wireless <ilw@linux.intel.com>
26 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
27 *****************************************************************************/
29 #include <linux/kernel.h>
30 #include <linux/module.h>
31 #include <linux/debugfs.h>
33 #include <linux/ieee80211.h>
34 #include <net/mac80211.h>
38 #include "iwl-debug.h"
43 /* create and remove of files */
44 #define DEBUGFS_ADD_DIR(name, parent) do { \
45 dbgfs->dir_##name = debugfs_create_dir(#name, parent); \
46 if (!(dbgfs->dir_##name)) \
50 #define DEBUGFS_ADD_FILE(name, parent) do { \
51 dbgfs->dbgfs_##parent##_files.file_##name = \
52 debugfs_create_file(#name, 0644, dbgfs->dir_##parent, priv, \
53 &iwl_dbgfs_##name##_ops); \
54 if (!(dbgfs->dbgfs_##parent##_files.file_##name)) \
58 #define DEBUGFS_ADD_BOOL(name, parent, ptr) do { \
59 dbgfs->dbgfs_##parent##_files.file_##name = \
60 debugfs_create_bool(#name, 0644, dbgfs->dir_##parent, ptr); \
61 if (IS_ERR(dbgfs->dbgfs_##parent##_files.file_##name) \
62 || !dbgfs->dbgfs_##parent##_files.file_##name) \
66 #define DEBUGFS_ADD_X32(name, parent, ptr) do { \
67 dbgfs->dbgfs_##parent##_files.file_##name = \
68 debugfs_create_x32(#name, 0444, dbgfs->dir_##parent, ptr); \
69 if (IS_ERR(dbgfs->dbgfs_##parent##_files.file_##name) \
70 || !dbgfs->dbgfs_##parent##_files.file_##name) \
74 #define DEBUGFS_REMOVE(name) do { \
75 debugfs_remove(name); \
80 #define DEBUGFS_READ_FUNC(name) \
81 static ssize_t iwl_dbgfs_##name##_read(struct file *file, \
82 char __user *user_buf, \
83 size_t count, loff_t *ppos);
85 #define DEBUGFS_WRITE_FUNC(name) \
86 static ssize_t iwl_dbgfs_##name##_write(struct file *file, \
87 const char __user *user_buf, \
88 size_t count, loff_t *ppos);
91 static int iwl_dbgfs_open_file_generic(struct inode
*inode
, struct file
*file
)
93 file
->private_data
= inode
->i_private
;
97 #define DEBUGFS_READ_FILE_OPS(name) \
98 DEBUGFS_READ_FUNC(name); \
99 static const struct file_operations iwl_dbgfs_##name##_ops = { \
100 .read = iwl_dbgfs_##name##_read, \
101 .open = iwl_dbgfs_open_file_generic, \
104 #define DEBUGFS_WRITE_FILE_OPS(name) \
105 DEBUGFS_WRITE_FUNC(name); \
106 static const struct file_operations iwl_dbgfs_##name##_ops = { \
107 .write = iwl_dbgfs_##name##_write, \
108 .open = iwl_dbgfs_open_file_generic, \
112 #define DEBUGFS_READ_WRITE_FILE_OPS(name) \
113 DEBUGFS_READ_FUNC(name); \
114 DEBUGFS_WRITE_FUNC(name); \
115 static const struct file_operations iwl_dbgfs_##name##_ops = { \
116 .write = iwl_dbgfs_##name##_write, \
117 .read = iwl_dbgfs_##name##_read, \
118 .open = iwl_dbgfs_open_file_generic, \
122 static ssize_t
iwl_dbgfs_tx_statistics_read(struct file
*file
,
123 char __user
*user_buf
,
124 size_t count
, loff_t
*ppos
) {
126 struct iwl_priv
*priv
= (struct iwl_priv
*)file
->private_data
;
129 const size_t bufsz
= sizeof(buf
);
131 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "mgmt: %u\n",
132 priv
->tx_stats
[0].cnt
);
133 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "ctrl: %u\n",
134 priv
->tx_stats
[1].cnt
);
135 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "data: %u\n",
136 priv
->tx_stats
[2].cnt
);
138 return simple_read_from_buffer(user_buf
, count
, ppos
, buf
, pos
);
141 static ssize_t
iwl_dbgfs_rx_statistics_read(struct file
*file
,
142 char __user
*user_buf
,
143 size_t count
, loff_t
*ppos
) {
145 struct iwl_priv
*priv
= (struct iwl_priv
*)file
->private_data
;
148 const size_t bufsz
= sizeof(buf
);
150 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "mgmt: %u\n",
151 priv
->rx_stats
[0].cnt
);
152 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "ctrl: %u\n",
153 priv
->rx_stats
[1].cnt
);
154 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "data: %u\n",
155 priv
->rx_stats
[2].cnt
);
157 return simple_read_from_buffer(user_buf
, count
, ppos
, buf
, pos
);
160 #define BYTE1_MASK 0x000000ff;
161 #define BYTE2_MASK 0x0000ffff;
162 #define BYTE3_MASK 0x00ffffff;
163 static ssize_t
iwl_dbgfs_sram_read(struct file
*file
,
164 char __user
*user_buf
,
165 size_t count
, loff_t
*ppos
)
172 struct iwl_priv
*priv
= (struct iwl_priv
*)file
->private_data
;
173 const size_t bufsz
= sizeof(buf
);
175 for (i
= priv
->dbgfs
->sram_len
; i
> 0; i
-= 4) {
176 val
= iwl_read_targ_mem(priv
, priv
->dbgfs
->sram_offset
+ \
177 priv
->dbgfs
->sram_len
- i
);
191 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "0x%08x ", val
);
193 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "\n");
195 ret
= simple_read_from_buffer(user_buf
, count
, ppos
, buf
, pos
);
199 static ssize_t
iwl_dbgfs_sram_write(struct file
*file
,
200 const char __user
*user_buf
,
201 size_t count
, loff_t
*ppos
)
203 struct iwl_priv
*priv
= file
->private_data
;
208 memset(buf
, 0, sizeof(buf
));
209 buf_size
= min(count
, sizeof(buf
) - 1);
210 if (copy_from_user(buf
, user_buf
, buf_size
))
213 if (sscanf(buf
, "%x,%x", &offset
, &len
) == 2) {
214 priv
->dbgfs
->sram_offset
= offset
;
215 priv
->dbgfs
->sram_len
= len
;
217 priv
->dbgfs
->sram_offset
= 0;
218 priv
->dbgfs
->sram_len
= 0;
224 static ssize_t
iwl_dbgfs_stations_read(struct file
*file
, char __user
*user_buf
,
225 size_t count
, loff_t
*ppos
)
227 struct iwl_priv
*priv
= (struct iwl_priv
*)file
->private_data
;
228 struct iwl_station_entry
*station
;
229 int max_sta
= priv
->hw_params
.max_stations
;
233 /* Add 30 for initial string */
234 const size_t bufsz
= 30 + sizeof(char) * 500 * (priv
->num_stations
);
236 buf
= kmalloc(bufsz
, GFP_KERNEL
);
240 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "num of stations: %d\n\n",
243 for (i
= 0; i
< max_sta
; i
++) {
244 station
= &priv
->stations
[i
];
246 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
,
247 "station %d:\ngeneral data:\n", i
+1);
248 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "id: %u\n",
249 station
->sta
.sta
.sta_id
);
250 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "mode: %u\n",
252 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
,
254 station
->sta
.station_flags_msk
);
255 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
,
256 "ps_status: %u\n", station
->ps_status
);
257 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "tid data:\n");
258 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
,
259 "seq_num\t\ttxq_id");
260 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
,
261 "\tframe_count\twait_for_ba\t");
262 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
,
263 "start_idx\tbitmap0\t");
264 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
,
265 "bitmap1\trate_n_flags");
266 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "\n");
268 for (j
= 0; j
< MAX_TID_COUNT
; j
++) {
269 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
,
271 station
->tid
[j
].seq_number
);
272 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
,
273 "\t%u\t\t%u\t\t%u\t\t",
274 station
->tid
[j
].agg
.txq_id
,
275 station
->tid
[j
].agg
.frame_count
,
276 station
->tid
[j
].agg
.wait_for_ba
);
277 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
,
279 station
->tid
[j
].agg
.start_idx
,
280 (unsigned long long)station
->tid
[j
].agg
.bitmap
,
281 station
->tid
[j
].agg
.rate_n_flags
);
282 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "\n");
284 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "\n");
288 ret
= simple_read_from_buffer(user_buf
, count
, ppos
, buf
, pos
);
293 static ssize_t
iwl_dbgfs_nvm_read(struct file
*file
,
294 char __user
*user_buf
,
299 struct iwl_priv
*priv
= (struct iwl_priv
*)file
->private_data
;
300 int pos
= 0, ofs
= 0, buf_size
= 0;
303 size_t eeprom_len
= priv
->cfg
->eeprom_size
;
304 buf_size
= 4 * eeprom_len
+ 256;
306 if (eeprom_len
% 16) {
307 IWL_ERR(priv
, "NVM size is not multiple of 16.\n");
311 /* 4 characters for byte 0xYY */
312 buf
= kzalloc(buf_size
, GFP_KERNEL
);
314 IWL_ERR(priv
, "Can not allocate Buffer\n");
320 IWL_ERR(priv
, "Invalid EEPROM/OTP memory\n");
323 pos
+= scnprintf(buf
+ pos
, buf_size
- pos
, "NVM Type: %s\n",
324 (priv
->nvm_device_type
== NVM_DEVICE_TYPE_OTP
)
326 for (ofs
= 0 ; ofs
< eeprom_len
; ofs
+= 16) {
327 pos
+= scnprintf(buf
+ pos
, buf_size
- pos
, "0x%.4x ", ofs
);
328 hex_dump_to_buffer(ptr
+ ofs
, 16 , 16, 2, buf
+ pos
,
331 if (buf_size
- pos
> 0)
335 ret
= simple_read_from_buffer(user_buf
, count
, ppos
, buf
, pos
);
340 static ssize_t
iwl_dbgfs_log_event_write(struct file
*file
,
341 const char __user
*user_buf
,
342 size_t count
, loff_t
*ppos
)
344 struct iwl_priv
*priv
= file
->private_data
;
349 memset(buf
, 0, sizeof(buf
));
350 buf_size
= min(count
, sizeof(buf
) - 1);
351 if (copy_from_user(buf
, user_buf
, buf_size
))
353 if (sscanf(buf
, "%d", &event_log_flag
) != 1)
355 if (event_log_flag
== 1)
356 iwl_dump_nic_event_log(priv
);
363 static ssize_t
iwl_dbgfs_channels_read(struct file
*file
, char __user
*user_buf
,
364 size_t count
, loff_t
*ppos
)
366 struct iwl_priv
*priv
= (struct iwl_priv
*)file
->private_data
;
367 struct ieee80211_channel
*channels
= NULL
;
368 const struct ieee80211_supported_band
*supp_band
= NULL
;
369 int pos
= 0, i
, bufsz
= PAGE_SIZE
;
373 if (!test_bit(STATUS_GEO_CONFIGURED
, &priv
->status
))
376 buf
= kzalloc(bufsz
, GFP_KERNEL
);
378 IWL_ERR(priv
, "Can not allocate Buffer\n");
382 supp_band
= iwl_get_hw_mode(priv
, IEEE80211_BAND_2GHZ
);
384 channels
= supp_band
->channels
;
386 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
,
387 "Displaying %d channels in 2.4GHz band 802.11bg):\n",
388 supp_band
->n_channels
);
390 for (i
= 0; i
< supp_band
->n_channels
; i
++)
391 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
,
392 "%d: %ddBm: BSS%s%s, %s.\n",
393 ieee80211_frequency_to_channel(
394 channels
[i
].center_freq
),
395 channels
[i
].max_power
,
396 channels
[i
].flags
& IEEE80211_CHAN_RADAR
?
397 " (IEEE 802.11h required)" : "",
398 ((channels
[i
].flags
& IEEE80211_CHAN_NO_IBSS
)
399 || (channels
[i
].flags
&
400 IEEE80211_CHAN_RADAR
)) ? "" :
403 IEEE80211_CHAN_PASSIVE_SCAN
?
404 "passive only" : "active/passive");
406 supp_band
= iwl_get_hw_mode(priv
, IEEE80211_BAND_5GHZ
);
408 channels
= supp_band
->channels
;
410 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
,
411 "Displaying %d channels in 5.2GHz band (802.11a)\n",
412 supp_band
->n_channels
);
414 for (i
= 0; i
< supp_band
->n_channels
; i
++)
415 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
,
416 "%d: %ddBm: BSS%s%s, %s.\n",
417 ieee80211_frequency_to_channel(
418 channels
[i
].center_freq
),
419 channels
[i
].max_power
,
420 channels
[i
].flags
& IEEE80211_CHAN_RADAR
?
421 " (IEEE 802.11h required)" : "",
422 ((channels
[i
].flags
& IEEE80211_CHAN_NO_IBSS
)
423 || (channels
[i
].flags
&
424 IEEE80211_CHAN_RADAR
)) ? "" :
427 IEEE80211_CHAN_PASSIVE_SCAN
?
428 "passive only" : "active/passive");
430 ret
= simple_read_from_buffer(user_buf
, count
, ppos
, buf
, pos
);
435 static ssize_t
iwl_dbgfs_status_read(struct file
*file
,
436 char __user
*user_buf
,
437 size_t count
, loff_t
*ppos
) {
439 struct iwl_priv
*priv
= (struct iwl_priv
*)file
->private_data
;
442 const size_t bufsz
= sizeof(buf
);
444 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "STATUS_HCMD_ACTIVE:\t %d\n",
445 test_bit(STATUS_HCMD_ACTIVE
, &priv
->status
));
446 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "STATUS_HCMD_SYNC_ACTIVE: %d\n",
447 test_bit(STATUS_HCMD_SYNC_ACTIVE
, &priv
->status
));
448 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "STATUS_INT_ENABLED:\t %d\n",
449 test_bit(STATUS_INT_ENABLED
, &priv
->status
));
450 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "STATUS_RF_KILL_HW:\t %d\n",
451 test_bit(STATUS_RF_KILL_HW
, &priv
->status
));
452 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "STATUS_INIT:\t\t %d\n",
453 test_bit(STATUS_INIT
, &priv
->status
));
454 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "STATUS_ALIVE:\t\t %d\n",
455 test_bit(STATUS_ALIVE
, &priv
->status
));
456 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "STATUS_READY:\t\t %d\n",
457 test_bit(STATUS_READY
, &priv
->status
));
458 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "STATUS_TEMPERATURE:\t %d\n",
459 test_bit(STATUS_TEMPERATURE
, &priv
->status
));
460 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "STATUS_GEO_CONFIGURED:\t %d\n",
461 test_bit(STATUS_GEO_CONFIGURED
, &priv
->status
));
462 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "STATUS_EXIT_PENDING:\t %d\n",
463 test_bit(STATUS_EXIT_PENDING
, &priv
->status
));
464 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "STATUS_STATISTICS:\t %d\n",
465 test_bit(STATUS_STATISTICS
, &priv
->status
));
466 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "STATUS_SCANNING:\t %d\n",
467 test_bit(STATUS_SCANNING
, &priv
->status
));
468 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "STATUS_SCAN_ABORTING:\t %d\n",
469 test_bit(STATUS_SCAN_ABORTING
, &priv
->status
));
470 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "STATUS_SCAN_HW:\t\t %d\n",
471 test_bit(STATUS_SCAN_HW
, &priv
->status
));
472 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "STATUS_POWER_PMI:\t %d\n",
473 test_bit(STATUS_POWER_PMI
, &priv
->status
));
474 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "STATUS_FW_ERROR:\t %d\n",
475 test_bit(STATUS_FW_ERROR
, &priv
->status
));
476 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "STATUS_MODE_PENDING:\t %d\n",
477 test_bit(STATUS_MODE_PENDING
, &priv
->status
));
478 return simple_read_from_buffer(user_buf
, count
, ppos
, buf
, pos
);
481 static ssize_t
iwl_dbgfs_interrupt_read(struct file
*file
,
482 char __user
*user_buf
,
483 size_t count
, loff_t
*ppos
) {
485 struct iwl_priv
*priv
= (struct iwl_priv
*)file
->private_data
;
489 int bufsz
= 24 * 64; /* 24 items * 64 char per item */
492 buf
= kzalloc(bufsz
, GFP_KERNEL
);
494 IWL_ERR(priv
, "Can not allocate Buffer\n");
498 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
,
499 "Interrupt Statistics Report:\n");
501 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "HW Error:\t\t\t %u\n",
503 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "SW Error:\t\t\t %u\n",
505 if (priv
->isr_stats
.sw
> 0) {
506 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
,
507 "\tLast Restarting Code: 0x%X\n",
508 priv
->isr_stats
.sw_err
);
510 #ifdef CONFIG_IWLWIFI_DEBUG
511 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "Frame transmitted:\t\t %u\n",
512 priv
->isr_stats
.sch
);
513 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "Alive interrupt:\t\t %u\n",
514 priv
->isr_stats
.alive
);
516 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
,
517 "HW RF KILL switch toggled:\t %u\n",
518 priv
->isr_stats
.rfkill
);
520 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "CT KILL:\t\t\t %u\n",
521 priv
->isr_stats
.ctkill
);
523 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "Wakeup Interrupt:\t\t %u\n",
524 priv
->isr_stats
.wakeup
);
526 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
,
527 "Rx command responses:\t\t %u\n",
529 for (cnt
= 0; cnt
< REPLY_MAX
; cnt
++) {
530 if (priv
->isr_stats
.rx_handlers
[cnt
] > 0)
531 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
,
532 "\tRx handler[%36s]:\t\t %u\n",
534 priv
->isr_stats
.rx_handlers
[cnt
]);
537 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "Tx/FH interrupt:\t\t %u\n",
540 pos
+= scnprintf(buf
+ pos
, bufsz
- pos
, "Unexpected INTA:\t\t %u\n",
541 priv
->isr_stats
.unhandled
);
543 ret
= simple_read_from_buffer(user_buf
, count
, ppos
, buf
, pos
);
548 static ssize_t
iwl_dbgfs_interrupt_write(struct file
*file
,
549 const char __user
*user_buf
,
550 size_t count
, loff_t
*ppos
)
552 struct iwl_priv
*priv
= file
->private_data
;
557 memset(buf
, 0, sizeof(buf
));
558 buf_size
= min(count
, sizeof(buf
) - 1);
559 if (copy_from_user(buf
, user_buf
, buf_size
))
561 if (sscanf(buf
, "%x", &reset_flag
) != 1)
564 iwl_clear_isr_stats(priv
);
570 DEBUGFS_READ_WRITE_FILE_OPS(sram
);
571 DEBUGFS_WRITE_FILE_OPS(log_event
);
572 DEBUGFS_READ_FILE_OPS(nvm
);
573 DEBUGFS_READ_FILE_OPS(stations
);
574 DEBUGFS_READ_FILE_OPS(rx_statistics
);
575 DEBUGFS_READ_FILE_OPS(tx_statistics
);
576 DEBUGFS_READ_FILE_OPS(channels
);
577 DEBUGFS_READ_FILE_OPS(status
);
578 DEBUGFS_READ_WRITE_FILE_OPS(interrupt
);
581 * Create the debugfs files and directories
584 int iwl_dbgfs_register(struct iwl_priv
*priv
, const char *name
)
586 struct iwl_debugfs
*dbgfs
;
587 struct dentry
*phyd
= priv
->hw
->wiphy
->debugfsdir
;
590 dbgfs
= kzalloc(sizeof(struct iwl_debugfs
), GFP_KERNEL
);
598 dbgfs
->dir_drv
= debugfs_create_dir(name
, phyd
);
599 if (!dbgfs
->dir_drv
|| IS_ERR(dbgfs
->dir_drv
)) {
604 DEBUGFS_ADD_DIR(data
, dbgfs
->dir_drv
);
605 DEBUGFS_ADD_DIR(rf
, dbgfs
->dir_drv
);
606 DEBUGFS_ADD_FILE(nvm
, data
);
607 DEBUGFS_ADD_FILE(sram
, data
);
608 DEBUGFS_ADD_FILE(log_event
, data
);
609 DEBUGFS_ADD_FILE(stations
, data
);
610 DEBUGFS_ADD_FILE(rx_statistics
, data
);
611 DEBUGFS_ADD_FILE(tx_statistics
, data
);
612 DEBUGFS_ADD_FILE(channels
, data
);
613 DEBUGFS_ADD_FILE(status
, data
);
614 DEBUGFS_ADD_FILE(interrupt
, data
);
615 DEBUGFS_ADD_BOOL(disable_sensitivity
, rf
, &priv
->disable_sens_cal
);
616 DEBUGFS_ADD_BOOL(disable_chain_noise
, rf
,
617 &priv
->disable_chain_noise_cal
);
618 DEBUGFS_ADD_BOOL(disable_tx_power
, rf
, &priv
->disable_tx_power_cal
);
622 IWL_ERR(priv
, "Can't open the debugfs directory\n");
623 iwl_dbgfs_unregister(priv
);
626 EXPORT_SYMBOL(iwl_dbgfs_register
);
629 * Remove the debugfs files and directories
632 void iwl_dbgfs_unregister(struct iwl_priv
*priv
)
637 DEBUGFS_REMOVE(priv
->dbgfs
->dbgfs_data_files
.file_nvm
);
638 DEBUGFS_REMOVE(priv
->dbgfs
->dbgfs_data_files
.file_rx_statistics
);
639 DEBUGFS_REMOVE(priv
->dbgfs
->dbgfs_data_files
.file_tx_statistics
);
640 DEBUGFS_REMOVE(priv
->dbgfs
->dbgfs_data_files
.file_sram
);
641 DEBUGFS_REMOVE(priv
->dbgfs
->dbgfs_data_files
.file_log_event
);
642 DEBUGFS_REMOVE(priv
->dbgfs
->dbgfs_data_files
.file_stations
);
643 DEBUGFS_REMOVE(priv
->dbgfs
->dbgfs_data_files
.file_channels
);
644 DEBUGFS_REMOVE(priv
->dbgfs
->dbgfs_data_files
.file_status
);
645 DEBUGFS_REMOVE(priv
->dbgfs
->dbgfs_data_files
.file_interrupt
);
646 DEBUGFS_REMOVE(priv
->dbgfs
->dir_data
);
647 DEBUGFS_REMOVE(priv
->dbgfs
->dbgfs_rf_files
.file_disable_sensitivity
);
648 DEBUGFS_REMOVE(priv
->dbgfs
->dbgfs_rf_files
.file_disable_chain_noise
);
649 DEBUGFS_REMOVE(priv
->dbgfs
->dbgfs_rf_files
.file_disable_tx_power
);
650 DEBUGFS_REMOVE(priv
->dbgfs
->dir_rf
);
651 DEBUGFS_REMOVE(priv
->dbgfs
->dir_drv
);
655 EXPORT_SYMBOL(iwl_dbgfs_unregister
);