2 * Marvell Wireless LAN device driver: debugfs
4 * Copyright (C) 2011-2014, Marvell International Ltd.
6 * This software file (the "File") is distributed by Marvell International
7 * Ltd. under the terms of the GNU General Public License Version 2, June 1991
8 * (the "License"). You may use, redistribute and/or modify this File in
9 * accordance with the terms and conditions of the License, a copy of which
10 * is available by writing to the Free Software Foundation, Inc.,
11 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
12 * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
14 * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
16 * ARE EXPRESSLY DISCLAIMED. The License provides additional details about
17 * this warranty disclaimer.
20 #include <linux/debugfs.h>
26 static struct dentry
*mwifiex_dfs_dir
;
28 static char *bss_modes
[] = {
43 * Proc info file read handler.
45 * This function is called when the 'info' file is opened for reading.
46 * It prints the following driver related information -
49 * - Driver extended version
52 * - Media state (connected or disconnected)
54 * - Total number of Tx bytes
55 * - Total number of Rx bytes
56 * - Total number of Tx packets
57 * - Total number of Rx packets
58 * - Total number of dropped Tx packets
59 * - Total number of dropped Rx packets
60 * - Total number of corrupted Tx packets
61 * - Total number of corrupted Rx packets
62 * - Carrier status (on or off)
63 * - Tx queue status (started or stopped)
65 * For STA mode drivers, it also prints the following extra -
71 * - Multicast addresses
74 mwifiex_info_read(struct file
*file
, char __user
*ubuf
,
75 size_t count
, loff_t
*ppos
)
77 struct mwifiex_private
*priv
=
78 (struct mwifiex_private
*) file
->private_data
;
79 struct net_device
*netdev
= priv
->netdev
;
80 struct netdev_hw_addr
*ha
;
81 struct netdev_queue
*txq
;
82 unsigned long page
= get_zeroed_page(GFP_KERNEL
);
83 char *p
= (char *) page
, fmt
[64];
84 struct mwifiex_bss_info info
;
91 memset(&info
, 0, sizeof(info
));
92 ret
= mwifiex_get_bss_info(priv
, &info
);
96 mwifiex_drv_get_driver_version(priv
->adapter
, fmt
, sizeof(fmt
) - 1);
98 if (!priv
->version_str
[0])
99 mwifiex_get_ver_ext(priv
);
101 p
+= sprintf(p
, "driver_name = " "\"mwifiex\"\n");
102 p
+= sprintf(p
, "driver_version = %s", fmt
);
103 p
+= sprintf(p
, "\nverext = %s", priv
->version_str
);
104 p
+= sprintf(p
, "\ninterface_name=\"%s\"\n", netdev
->name
);
106 if (info
.bss_mode
>= ARRAY_SIZE(bss_modes
))
107 p
+= sprintf(p
, "bss_mode=\"%d\"\n", info
.bss_mode
);
109 p
+= sprintf(p
, "bss_mode=\"%s\"\n", bss_modes
[info
.bss_mode
]);
111 p
+= sprintf(p
, "media_state=\"%s\"\n",
112 (!priv
->media_connected
? "Disconnected" : "Connected"));
113 p
+= sprintf(p
, "mac_address=\"%pM\"\n", netdev
->dev_addr
);
115 if (GET_BSS_ROLE(priv
) == MWIFIEX_BSS_ROLE_STA
) {
116 p
+= sprintf(p
, "multicast_count=\"%d\"\n",
117 netdev_mc_count(netdev
));
118 p
+= sprintf(p
, "essid=\"%s\"\n", info
.ssid
.ssid
);
119 p
+= sprintf(p
, "bssid=\"%pM\"\n", info
.bssid
);
120 p
+= sprintf(p
, "channel=\"%d\"\n", (int) info
.bss_chan
);
121 p
+= sprintf(p
, "country_code = \"%s\"\n", info
.country_code
);
123 netdev_for_each_mc_addr(ha
, netdev
)
124 p
+= sprintf(p
, "multicast_address[%d]=\"%pM\"\n",
128 p
+= sprintf(p
, "num_tx_bytes = %lu\n", priv
->stats
.tx_bytes
);
129 p
+= sprintf(p
, "num_rx_bytes = %lu\n", priv
->stats
.rx_bytes
);
130 p
+= sprintf(p
, "num_tx_pkts = %lu\n", priv
->stats
.tx_packets
);
131 p
+= sprintf(p
, "num_rx_pkts = %lu\n", priv
->stats
.rx_packets
);
132 p
+= sprintf(p
, "num_tx_pkts_dropped = %lu\n", priv
->stats
.tx_dropped
);
133 p
+= sprintf(p
, "num_rx_pkts_dropped = %lu\n", priv
->stats
.rx_dropped
);
134 p
+= sprintf(p
, "num_tx_pkts_err = %lu\n", priv
->stats
.tx_errors
);
135 p
+= sprintf(p
, "num_rx_pkts_err = %lu\n", priv
->stats
.rx_errors
);
136 p
+= sprintf(p
, "carrier %s\n", ((netif_carrier_ok(priv
->netdev
))
138 p
+= sprintf(p
, "tx queue");
139 for (i
= 0; i
< netdev
->num_tx_queues
; i
++) {
140 txq
= netdev_get_tx_queue(netdev
, i
);
141 p
+= sprintf(p
, " %d:%s", i
, netif_tx_queue_stopped(txq
) ?
142 "stopped" : "started");
144 p
+= sprintf(p
, "\n");
146 ret
= simple_read_from_buffer(ubuf
, count
, ppos
, (char *) page
,
147 (unsigned long) p
- page
);
155 * Proc firmware dump read handler.
157 * This function is called when the 'fw_dump' file is opened for
159 * This function dumps firmware memory in different files
160 * (ex. DTCM, ITCM, SQRAM etc.) based on the the segments for
164 mwifiex_fw_dump_read(struct file
*file
, char __user
*ubuf
,
165 size_t count
, loff_t
*ppos
)
167 struct mwifiex_private
*priv
= file
->private_data
;
169 if (!priv
->adapter
->if_ops
.fw_dump
)
172 priv
->adapter
->if_ops
.fw_dump(priv
->adapter
);
178 * Proc getlog file read handler.
180 * This function is called when the 'getlog' file is opened for reading
181 * It prints the following log information -
182 * - Number of multicast Tx frames
183 * - Number of failed packets
184 * - Number of Tx retries
185 * - Number of multicast Tx retries
186 * - Number of duplicate frames
187 * - Number of RTS successes
188 * - Number of RTS failures
189 * - Number of ACK failures
190 * - Number of fragmented Rx frames
191 * - Number of multicast Rx frames
192 * - Number of FCS errors
193 * - Number of Tx frames
194 * - WEP ICV error counts
195 * - Number of received beacons
196 * - Number of missed beacons
199 mwifiex_getlog_read(struct file
*file
, char __user
*ubuf
,
200 size_t count
, loff_t
*ppos
)
202 struct mwifiex_private
*priv
=
203 (struct mwifiex_private
*) file
->private_data
;
204 unsigned long page
= get_zeroed_page(GFP_KERNEL
);
205 char *p
= (char *) page
;
207 struct mwifiex_ds_get_stats stats
;
212 memset(&stats
, 0, sizeof(stats
));
213 ret
= mwifiex_get_stats_info(priv
, &stats
);
230 "wepicverrcnt-1 %u\n"
231 "wepicverrcnt-2 %u\n"
232 "wepicverrcnt-3 %u\n"
233 "wepicverrcnt-4 %u\n"
236 stats
.mcast_tx_frame
,
245 stats
.mcast_rx_frame
,
248 stats
.wep_icv_error
[0],
249 stats
.wep_icv_error
[1],
250 stats
.wep_icv_error
[2],
251 stats
.wep_icv_error
[3],
256 ret
= simple_read_from_buffer(ubuf
, count
, ppos
, (char *) page
,
257 (unsigned long) p
- page
);
264 /* Sysfs histogram file read handler.
266 * This function is called when the 'histogram' file is opened for reading
267 * It prints the following histogram information -
268 * - Number of histogram samples
269 * - Receive packet number of each rx_rate
270 * - Receive packet number of each snr
271 * - Receive packet number of each nosie_flr
272 * - Receive packet number of each signal streath
275 mwifiex_histogram_read(struct file
*file
, char __user
*ubuf
,
276 size_t count
, loff_t
*ppos
)
278 struct mwifiex_private
*priv
=
279 (struct mwifiex_private
*)file
->private_data
;
281 struct mwifiex_histogram_data
*phist_data
;
283 unsigned long page
= get_zeroed_page(GFP_KERNEL
);
284 char *p
= (char *)page
;
289 if (!priv
|| !priv
->hist_data
)
291 phist_data
= priv
->hist_data
;
294 "total samples = %d\n",
295 atomic_read(&phist_data
->num_samples
));
297 p
+= sprintf(p
, "rx rates (in Mbps): 0=1M 1=2M");
298 p
+= sprintf(p
, "2=5.5M 3=11M 4=6M 5=9M 6=12M\n");
299 p
+= sprintf(p
, "7=18M 8=24M 9=36M 10=48M 11=54M");
300 p
+= sprintf(p
, "12-27=MCS0-15(BW20) 28-43=MCS0-15(BW40)\n");
302 if (ISSUPP_11ACENABLED(priv
->adapter
->fw_cap_info
)) {
303 p
+= sprintf(p
, "44-53=MCS0-9(VHT:BW20)");
304 p
+= sprintf(p
, "54-63=MCS0-9(VHT:BW40)");
305 p
+= sprintf(p
, "64-73=MCS0-9(VHT:BW80)\n\n");
307 p
+= sprintf(p
, "\n");
310 for (i
= 0; i
< MWIFIEX_MAX_RX_RATES
; i
++) {
311 value
= atomic_read(&phist_data
->rx_rate
[i
]);
313 p
+= sprintf(p
, "rx_rate[%02d] = %d\n", i
, value
);
316 if (ISSUPP_11ACENABLED(priv
->adapter
->fw_cap_info
)) {
317 for (i
= MWIFIEX_MAX_RX_RATES
; i
< MWIFIEX_MAX_AC_RX_RATES
;
319 value
= atomic_read(&phist_data
->rx_rate
[i
]);
321 p
+= sprintf(p
, "rx_rate[%02d] = %d\n",
326 for (i
= 0; i
< MWIFIEX_MAX_SNR
; i
++) {
327 value
= atomic_read(&phist_data
->snr
[i
]);
329 p
+= sprintf(p
, "snr[%02ddB] = %d\n", i
, value
);
331 for (i
= 0; i
< MWIFIEX_MAX_NOISE_FLR
; i
++) {
332 value
= atomic_read(&phist_data
->noise_flr
[i
]);
334 p
+= sprintf(p
, "noise_flr[-%02ddBm] = %d\n",
335 (int)(i
-128), value
);
337 for (i
= 0; i
< MWIFIEX_MAX_SIG_STRENGTH
; i
++) {
338 value
= atomic_read(&phist_data
->sig_str
[i
]);
340 p
+= sprintf(p
, "sig_strength[-%02ddBm] = %d\n",
344 ret
= simple_read_from_buffer(ubuf
, count
, ppos
, (char *)page
,
345 (unsigned long)p
- page
);
351 mwifiex_histogram_write(struct file
*file
, const char __user
*ubuf
,
352 size_t count
, loff_t
*ppos
)
354 struct mwifiex_private
*priv
= (void *)file
->private_data
;
356 if (priv
&& priv
->hist_data
)
357 mwifiex_hist_data_reset(priv
);
361 static struct mwifiex_debug_info info
;
364 * Proc debug file read handler.
366 * This function is called when the 'debug' file is opened for reading
367 * It prints the following log information -
369 * - WMM AC VO packets count
370 * - WMM AC VI packets count
371 * - WMM AC BE packets count
372 * - WMM AC BK packets count
373 * - Maximum Tx buffer size
375 * - Current Tx buffer size
378 * - Deep Sleep status
379 * - Device wakeup required status
380 * - Number of wakeup tries
381 * - Host Sleep configured status
382 * - Host Sleep activated status
383 * - Number of Tx timeouts
384 * - Number of command timeouts
385 * - Last timed out command ID
386 * - Last timed out command action
388 * - Last command action
389 * - Last command index
390 * - Last command response ID
391 * - Last command response index
394 * - Number of host to card command failures
395 * - Number of sleep confirm command failures
396 * - Number of host to card data failure
397 * - Number of deauthentication events
398 * - Number of disassociation events
399 * - Number of link lost events
400 * - Number of deauthentication commands
401 * - Number of association success commands
402 * - Number of association failure commands
403 * - Number of commands sent
404 * - Number of data packets sent
405 * - Number of command responses received
406 * - Number of events received
407 * - Tx BA stream table (TID, RA)
408 * - Rx reorder table (TID, TA, Start window, Window size, Buffer)
411 mwifiex_debug_read(struct file
*file
, char __user
*ubuf
,
412 size_t count
, loff_t
*ppos
)
414 struct mwifiex_private
*priv
=
415 (struct mwifiex_private
*) file
->private_data
;
416 unsigned long page
= get_zeroed_page(GFP_KERNEL
);
417 char *p
= (char *) page
;
423 ret
= mwifiex_get_debug_info(priv
, &info
);
427 p
+= mwifiex_debug_info_to_buffer(priv
, p
, &info
);
429 ret
= simple_read_from_buffer(ubuf
, count
, ppos
, (char *) page
,
430 (unsigned long) p
- page
);
437 static u32 saved_reg_type
, saved_reg_offset
, saved_reg_value
;
440 * Proc regrdwr file write handler.
442 * This function is called when the 'regrdwr' file is opened for writing
444 * This function can be used to write to a register.
447 mwifiex_regrdwr_write(struct file
*file
,
448 const char __user
*ubuf
, size_t count
, loff_t
*ppos
)
450 unsigned long addr
= get_zeroed_page(GFP_KERNEL
);
451 char *buf
= (char *) addr
;
452 size_t buf_size
= min_t(size_t, count
, PAGE_SIZE
- 1);
454 u32 reg_type
= 0, reg_offset
= 0, reg_value
= UINT_MAX
;
460 if (copy_from_user(buf
, ubuf
, buf_size
)) {
465 sscanf(buf
, "%u %x %x", ®_type
, ®_offset
, ®_value
);
467 if (reg_type
== 0 || reg_offset
== 0) {
471 saved_reg_type
= reg_type
;
472 saved_reg_offset
= reg_offset
;
473 saved_reg_value
= reg_value
;
482 * Proc regrdwr file read handler.
484 * This function is called when the 'regrdwr' file is opened for reading
486 * This function can be used to read from a register.
489 mwifiex_regrdwr_read(struct file
*file
, char __user
*ubuf
,
490 size_t count
, loff_t
*ppos
)
492 struct mwifiex_private
*priv
=
493 (struct mwifiex_private
*) file
->private_data
;
494 unsigned long addr
= get_zeroed_page(GFP_KERNEL
);
495 char *buf
= (char *) addr
;
496 int pos
= 0, ret
= 0;
502 if (!saved_reg_type
) {
503 /* No command has been given */
504 pos
+= snprintf(buf
, PAGE_SIZE
, "0");
507 /* Set command has been given */
508 if (saved_reg_value
!= UINT_MAX
) {
509 ret
= mwifiex_reg_write(priv
, saved_reg_type
, saved_reg_offset
,
512 pos
+= snprintf(buf
, PAGE_SIZE
, "%u 0x%x 0x%x\n",
513 saved_reg_type
, saved_reg_offset
,
516 ret
= simple_read_from_buffer(ubuf
, count
, ppos
, buf
, pos
);
520 /* Get command has been given */
521 ret
= mwifiex_reg_read(priv
, saved_reg_type
,
522 saved_reg_offset
, ®_value
);
528 pos
+= snprintf(buf
, PAGE_SIZE
, "%u 0x%x 0x%x\n", saved_reg_type
,
529 saved_reg_offset
, reg_value
);
531 ret
= simple_read_from_buffer(ubuf
, count
, ppos
, buf
, pos
);
538 /* Proc memrw file write handler.
539 * This function is called when the 'memrw' file is opened for writing
540 * This function can be used to write to a memory location.
543 mwifiex_memrw_write(struct file
*file
, const char __user
*ubuf
, size_t count
,
548 struct mwifiex_ds_mem_rw mem_rw
;
550 struct mwifiex_private
*priv
= (void *)file
->private_data
;
551 unsigned long addr
= get_zeroed_page(GFP_KERNEL
);
552 char *buf
= (void *)addr
;
553 size_t buf_size
= min(count
, (size_t)(PAGE_SIZE
- 1));
558 if (copy_from_user(buf
, ubuf
, buf_size
)) {
563 ret
= sscanf(buf
, "%c %x %x", &cmd
, &mem_rw
.addr
, &mem_rw
.value
);
569 if ((cmd
== 'r') || (cmd
== 'R')) {
570 cmd_action
= HostCmd_ACT_GEN_GET
;
572 } else if ((cmd
== 'w') || (cmd
== 'W')) {
573 cmd_action
= HostCmd_ACT_GEN_SET
;
579 memcpy(&priv
->mem_rw
, &mem_rw
, sizeof(mem_rw
));
580 if (mwifiex_send_cmd(priv
, HostCmd_CMD_MEM_ACCESS
, cmd_action
, 0,
591 /* Proc memrw file read handler.
592 * This function is called when the 'memrw' file is opened for reading
593 * This function can be used to read from a memory location.
596 mwifiex_memrw_read(struct file
*file
, char __user
*ubuf
,
597 size_t count
, loff_t
*ppos
)
599 struct mwifiex_private
*priv
= (void *)file
->private_data
;
600 unsigned long addr
= get_zeroed_page(GFP_KERNEL
);
601 char *buf
= (char *)addr
;
607 pos
+= snprintf(buf
, PAGE_SIZE
, "0x%x 0x%x\n", priv
->mem_rw
.addr
,
609 ret
= simple_read_from_buffer(ubuf
, count
, ppos
, buf
, pos
);
615 static u32 saved_offset
= -1, saved_bytes
= -1;
618 * Proc rdeeprom file write handler.
620 * This function is called when the 'rdeeprom' file is opened for writing
622 * This function can be used to write to a RDEEPROM location.
625 mwifiex_rdeeprom_write(struct file
*file
,
626 const char __user
*ubuf
, size_t count
, loff_t
*ppos
)
628 unsigned long addr
= get_zeroed_page(GFP_KERNEL
);
629 char *buf
= (char *) addr
;
630 size_t buf_size
= min_t(size_t, count
, PAGE_SIZE
- 1);
632 int offset
= -1, bytes
= -1;
638 if (copy_from_user(buf
, ubuf
, buf_size
)) {
643 sscanf(buf
, "%d %d", &offset
, &bytes
);
645 if (offset
== -1 || bytes
== -1) {
649 saved_offset
= offset
;
659 * Proc rdeeprom read write handler.
661 * This function is called when the 'rdeeprom' file is opened for reading
663 * This function can be used to read from a RDEEPROM location.
666 mwifiex_rdeeprom_read(struct file
*file
, char __user
*ubuf
,
667 size_t count
, loff_t
*ppos
)
669 struct mwifiex_private
*priv
=
670 (struct mwifiex_private
*) file
->private_data
;
671 unsigned long addr
= get_zeroed_page(GFP_KERNEL
);
672 char *buf
= (char *) addr
;
673 int pos
= 0, ret
= 0, i
;
674 u8 value
[MAX_EEPROM_DATA
];
679 if (saved_offset
== -1) {
680 /* No command has been given */
681 pos
+= snprintf(buf
, PAGE_SIZE
, "0");
685 /* Get command has been given */
686 ret
= mwifiex_eeprom_read(priv
, (u16
) saved_offset
,
687 (u16
) saved_bytes
, value
);
693 pos
+= snprintf(buf
, PAGE_SIZE
, "%d %d ", saved_offset
, saved_bytes
);
695 for (i
= 0; i
< saved_bytes
; i
++)
696 pos
+= snprintf(buf
+ strlen(buf
), PAGE_SIZE
, "%d ", value
[i
]);
698 ret
= simple_read_from_buffer(ubuf
, count
, ppos
, buf
, pos
);
705 /* Proc hscfg file write handler
706 * This function can be used to configure the host sleep parameters.
709 mwifiex_hscfg_write(struct file
*file
, const char __user
*ubuf
,
710 size_t count
, loff_t
*ppos
)
712 struct mwifiex_private
*priv
= (void *)file
->private_data
;
713 unsigned long addr
= get_zeroed_page(GFP_KERNEL
);
714 char *buf
= (char *)addr
;
715 size_t buf_size
= min_t(size_t, count
, PAGE_SIZE
- 1);
717 struct mwifiex_ds_hs_cfg hscfg
;
718 int conditions
= HS_CFG_COND_DEF
;
719 u32 gpio
= HS_CFG_GPIO_DEF
, gap
= HS_CFG_GAP_DEF
;
724 if (copy_from_user(buf
, ubuf
, buf_size
)) {
729 arg_num
= sscanf(buf
, "%d %x %x", &conditions
, &gpio
, &gap
);
731 memset(&hscfg
, 0, sizeof(struct mwifiex_ds_hs_cfg
));
734 dev_err(priv
->adapter
->dev
, "Too many arguments\n");
739 if (arg_num
>= 1 && arg_num
< 3)
740 mwifiex_set_hs_params(priv
, HostCmd_ACT_GEN_GET
,
741 MWIFIEX_SYNC_CMD
, &hscfg
);
744 if (conditions
== HS_CFG_CANCEL
) {
745 mwifiex_cancel_hs(priv
, MWIFIEX_ASYNC_CMD
);
749 hscfg
.conditions
= conditions
;
756 hscfg
.is_invoke_hostcmd
= false;
757 mwifiex_set_hs_params(priv
, HostCmd_ACT_GEN_SET
,
758 MWIFIEX_SYNC_CMD
, &hscfg
);
760 mwifiex_enable_hs(priv
->adapter
);
761 priv
->adapter
->hs_enabling
= false;
768 /* Proc hscfg file read handler
769 * This function can be used to read host sleep configuration
770 * parameters from driver.
773 mwifiex_hscfg_read(struct file
*file
, char __user
*ubuf
,
774 size_t count
, loff_t
*ppos
)
776 struct mwifiex_private
*priv
= (void *)file
->private_data
;
777 unsigned long addr
= get_zeroed_page(GFP_KERNEL
);
778 char *buf
= (char *)addr
;
780 struct mwifiex_ds_hs_cfg hscfg
;
785 mwifiex_set_hs_params(priv
, HostCmd_ACT_GEN_GET
,
786 MWIFIEX_SYNC_CMD
, &hscfg
);
788 pos
= snprintf(buf
, PAGE_SIZE
, "%u 0x%x 0x%x\n", hscfg
.conditions
,
789 hscfg
.gpio
, hscfg
.gap
);
791 ret
= simple_read_from_buffer(ubuf
, count
, ppos
, buf
, pos
);
797 #define MWIFIEX_DFS_ADD_FILE(name) do { \
798 if (!debugfs_create_file(#name, 0644, priv->dfs_dev_dir, \
799 priv, &mwifiex_dfs_##name##_fops)) \
803 #define MWIFIEX_DFS_FILE_OPS(name) \
804 static const struct file_operations mwifiex_dfs_##name##_fops = { \
805 .read = mwifiex_##name##_read, \
806 .write = mwifiex_##name##_write, \
807 .open = simple_open, \
810 #define MWIFIEX_DFS_FILE_READ_OPS(name) \
811 static const struct file_operations mwifiex_dfs_##name##_fops = { \
812 .read = mwifiex_##name##_read, \
813 .open = simple_open, \
816 #define MWIFIEX_DFS_FILE_WRITE_OPS(name) \
817 static const struct file_operations mwifiex_dfs_##name##_fops = { \
818 .write = mwifiex_##name##_write, \
819 .open = simple_open, \
823 MWIFIEX_DFS_FILE_READ_OPS(info
);
824 MWIFIEX_DFS_FILE_READ_OPS(debug
);
825 MWIFIEX_DFS_FILE_READ_OPS(getlog
);
826 MWIFIEX_DFS_FILE_READ_OPS(fw_dump
);
827 MWIFIEX_DFS_FILE_OPS(regrdwr
);
828 MWIFIEX_DFS_FILE_OPS(rdeeprom
);
829 MWIFIEX_DFS_FILE_OPS(memrw
);
830 MWIFIEX_DFS_FILE_OPS(hscfg
);
831 MWIFIEX_DFS_FILE_OPS(histogram
);
834 * This function creates the debug FS directory structure and the files.
837 mwifiex_dev_debugfs_init(struct mwifiex_private
*priv
)
839 if (!mwifiex_dfs_dir
|| !priv
)
842 priv
->dfs_dev_dir
= debugfs_create_dir(priv
->netdev
->name
,
845 if (!priv
->dfs_dev_dir
)
848 MWIFIEX_DFS_ADD_FILE(info
);
849 MWIFIEX_DFS_ADD_FILE(debug
);
850 MWIFIEX_DFS_ADD_FILE(getlog
);
851 MWIFIEX_DFS_ADD_FILE(regrdwr
);
852 MWIFIEX_DFS_ADD_FILE(rdeeprom
);
853 MWIFIEX_DFS_ADD_FILE(fw_dump
);
854 MWIFIEX_DFS_ADD_FILE(memrw
);
855 MWIFIEX_DFS_ADD_FILE(hscfg
);
856 MWIFIEX_DFS_ADD_FILE(histogram
);
860 * This function removes the debug FS directory structure and the files.
863 mwifiex_dev_debugfs_remove(struct mwifiex_private
*priv
)
868 debugfs_remove_recursive(priv
->dfs_dev_dir
);
872 * This function creates the top level proc directory.
875 mwifiex_debugfs_init(void)
877 if (!mwifiex_dfs_dir
)
878 mwifiex_dfs_dir
= debugfs_create_dir("mwifiex", NULL
);
882 * This function removes the top level proc directory.
885 mwifiex_debugfs_remove(void)
888 debugfs_remove(mwifiex_dfs_dir
);