~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/net/wimax/debugfs.c

Version: ~ [ linux-5.4 ] ~ [ linux-5.3.13 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.86 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.156 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.203 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.202 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.78 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Linux WiMAX
  3  * Debugfs support
  4  *
  5  *
  6  * Copyright (C) 2005-2006 Intel Corporation <linux-wimax@intel.com>
  7  * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
  8  *
  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.
 12  *
 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.
 17  *
 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
 21  * 02110-1301, USA.
 22  */
 23 #include <linux/debugfs.h>
 24 #include <linux/wimax.h>
 25 #include "wimax-internal.h"
 26 
 27 #define D_SUBMODULE debugfs
 28 #include "debug-levels.h"
 29 
 30 
 31 #define __debugfs_register(prefix, name, parent)                        \
 32 do {                                                                    \
 33         result = d_level_register_debugfs(prefix, name, parent);        \
 34         if (result < 0)                                                 \
 35                 goto error;                                             \
 36 } while (0)
 37 
 38 
 39 int wimax_debugfs_add(struct wimax_dev *wimax_dev)
 40 {
 41         int result;
 42         struct net_device *net_dev = wimax_dev->net_dev;
 43         struct device *dev = net_dev->dev.parent;
 44         struct dentry *dentry;
 45         char buf[128];
 46 
 47         snprintf(buf, sizeof(buf), "wimax:%s", net_dev->name);
 48         dentry = debugfs_create_dir(buf, NULL);
 49         result = PTR_ERR(dentry);
 50         if (IS_ERR(dentry)) {
 51                 if (result == -ENODEV)
 52                         result = 0;     /* No debugfs support */
 53                 else
 54                         dev_err(dev, "Can't create debugfs dentry: %d\n",
 55                                 result);
 56                 goto out;
 57         }
 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_", op_state_get, dentry);
 65         __debugfs_register("wimax_dl_", stack, dentry);
 66         result = 0;
 67 out:
 68         return result;
 69 
 70 error:
 71         debugfs_remove_recursive(wimax_dev->debugfs_dentry);
 72         return result;
 73 }
 74 
 75 void wimax_debugfs_rm(struct wimax_dev *wimax_dev)
 76 {
 77         debugfs_remove_recursive(wimax_dev->debugfs_dentry);
 78 }
 79 
 80 
 81 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp