6 * Copyright (C) 2005-2006 Intel Corporation <linux-wimax@intel.com>
7 * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License version
11 * 2 as published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 #include <linux/debugfs.h>
24 #include <linux/wimax.h>
25 #include "wimax-internal.h"
27 #define D_SUBMODULE debugfs
28 #include "debug-levels.h"
31 #define __debugfs_register(prefix, name, parent) \
33 result = d_level_register_debugfs(prefix, name, parent); \
39 int wimax_debugfs_add(struct wimax_dev
*wimax_dev
)
42 struct net_device
*net_dev
= wimax_dev
->net_dev
;
43 struct device
*dev
= net_dev
->dev
.parent
;
44 struct dentry
*dentry
;
47 snprintf(buf
, sizeof(buf
), "wimax:%s", net_dev
->name
);
48 dentry
= debugfs_create_dir(buf
, NULL
);
49 result
= PTR_ERR(dentry
);
51 if (result
== -ENODEV
)
52 result
= 0; /* No debugfs support */
54 dev_err(dev
, "Can't create debugfs dentry: %d\n",
58 wimax_dev
->debugfs_dentry
= dentry
;
59 __debugfs_register("wimax_dl_", debugfs
, dentry
);
60 __debugfs_register("wimax_dl_", id_table
, dentry
);
61 __debugfs_register("wimax_dl_", op_msg
, dentry
);
62 __debugfs_register("wimax_dl_", op_reset
, dentry
);
63 __debugfs_register("wimax_dl_", op_rfkill
, dentry
);
64 __debugfs_register("wimax_dl_", stack
, dentry
);
70 debugfs_remove_recursive(wimax_dev
->debugfs_dentry
);
74 void wimax_debugfs_rm(struct wimax_dev
*wimax_dev
)
76 debugfs_remove_recursive(wimax_dev
->debugfs_dentry
);