xref: /OK3568_Linux_fs/kernel/net/wimax/debugfs.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun // SPDX-License-Identifier: GPL-2.0-only
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * Linux WiMAX
4*4882a593Smuzhiyun  * Debugfs support
5*4882a593Smuzhiyun  *
6*4882a593Smuzhiyun  * Copyright (C) 2005-2006 Intel Corporation <linux-wimax@intel.com>
7*4882a593Smuzhiyun  * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
8*4882a593Smuzhiyun  */
9*4882a593Smuzhiyun #include <linux/debugfs.h>
10*4882a593Smuzhiyun #include <linux/wimax.h>
11*4882a593Smuzhiyun #include "wimax-internal.h"
12*4882a593Smuzhiyun 
13*4882a593Smuzhiyun #define D_SUBMODULE debugfs
14*4882a593Smuzhiyun #include "debug-levels.h"
15*4882a593Smuzhiyun 
wimax_debugfs_add(struct wimax_dev * wimax_dev)16*4882a593Smuzhiyun void wimax_debugfs_add(struct wimax_dev *wimax_dev)
17*4882a593Smuzhiyun {
18*4882a593Smuzhiyun 	struct net_device *net_dev = wimax_dev->net_dev;
19*4882a593Smuzhiyun 	struct dentry *dentry;
20*4882a593Smuzhiyun 	char buf[128];
21*4882a593Smuzhiyun 
22*4882a593Smuzhiyun 	snprintf(buf, sizeof(buf), "wimax:%s", net_dev->name);
23*4882a593Smuzhiyun 	dentry = debugfs_create_dir(buf, NULL);
24*4882a593Smuzhiyun 	wimax_dev->debugfs_dentry = dentry;
25*4882a593Smuzhiyun 
26*4882a593Smuzhiyun 	d_level_register_debugfs("wimax_dl_", debugfs, dentry);
27*4882a593Smuzhiyun 	d_level_register_debugfs("wimax_dl_", id_table, dentry);
28*4882a593Smuzhiyun 	d_level_register_debugfs("wimax_dl_", op_msg, dentry);
29*4882a593Smuzhiyun 	d_level_register_debugfs("wimax_dl_", op_reset, dentry);
30*4882a593Smuzhiyun 	d_level_register_debugfs("wimax_dl_", op_rfkill, dentry);
31*4882a593Smuzhiyun 	d_level_register_debugfs("wimax_dl_", op_state_get, dentry);
32*4882a593Smuzhiyun 	d_level_register_debugfs("wimax_dl_", stack, dentry);
33*4882a593Smuzhiyun }
34*4882a593Smuzhiyun 
wimax_debugfs_rm(struct wimax_dev * wimax_dev)35*4882a593Smuzhiyun void wimax_debugfs_rm(struct wimax_dev *wimax_dev)
36*4882a593Smuzhiyun {
37*4882a593Smuzhiyun 	debugfs_remove_recursive(wimax_dev->debugfs_dentry);
38*4882a593Smuzhiyun }
39