blob: 0b08b6c7497c2344026420f37371dd6f85f83ee8 [file] [log] [blame]
Catherine Sullivan00949162012-08-10 01:59:10 +00001/*******************************************************************************
2
3 Intel 10 Gigabit PCI Express Linux driver
4 Copyright(c) 1999 - 2012 Intel Corporation.
5
6 This program is free software; you can redistribute it and/or modify it
7 under the terms and conditions of the GNU General Public License,
8 version 2, as published by the Free Software Foundation.
9
10 This program is distributed in the hope it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 more details.
14
15 You should have received a copy of the GNU General Public License along with
16 this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
18
19 The full GNU General Public License is included in this distribution in
20 the file called "COPYING".
21
22 Contact Information:
23 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
24 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
25
26*******************************************************************************/
27
28#ifdef CONFIG_DEBUG_FS
29
30#include <linux/debugfs.h>
31#include <linux/module.h>
32
33#include "ixgbe.h"
34
35static struct dentry *ixgbe_dbg_root;
36
37/**
38 * ixgbe_dbg_adapter_init - setup the debugfs directory for the adapter
39 * @adapter: the adapter that is starting up
40 **/
41void ixgbe_dbg_adapter_init(struct ixgbe_adapter *adapter)
42{
43 const char *name = pci_name(adapter->pdev);
44
45 adapter->ixgbe_dbg_adapter = debugfs_create_dir(name, ixgbe_dbg_root);
46 if (!adapter->ixgbe_dbg_adapter)
47 e_dev_err("debugfs entry for %s failed\n", name);
48}
49
50/**
51 * ixgbe_dbg_adapter_exit - clear out the adapter's debugfs entries
52 * @pf: the pf that is stopping
53 **/
54void ixgbe_dbg_adapter_exit(struct ixgbe_adapter *adapter)
55{
56 if (adapter->ixgbe_dbg_adapter)
57 debugfs_remove_recursive(adapter->ixgbe_dbg_adapter);
58 adapter->ixgbe_dbg_adapter = NULL;
59}
60
61/**
62 * ixgbe_dbg_init - start up debugfs for the driver
63 **/
64void ixgbe_dbg_init(void)
65{
66 ixgbe_dbg_root = debugfs_create_dir(ixgbe_driver_name, NULL);
67 if (ixgbe_dbg_root == NULL)
68 pr_err("init of debugfs failed\n");
69}
70
71/**
72 * ixgbe_dbg_exit - clean out the driver's debugfs entries
73 **/
74void ixgbe_dbg_exit(void)
75{
76 debugfs_remove_recursive(ixgbe_dbg_root);
77}
78
79#endif /* CONFIG_DEBUG_FS */