1 #include <linux/kernel.h>
2 #include <linux/module.h>
3 #include <linux/device.h>
4 #include <linux/netdevice.h>
10 #include <linux/debugfs.h>
11 #include <linux/seq_file.h>
13 static struct dentry *bonding_debug_root;
15 void bond_debug_register(struct bonding *bond)
17 if (!bonding_debug_root)
21 debugfs_create_dir(bond->dev->name, bonding_debug_root);
23 if (!bond->debug_dir) {
24 pr_warning("%s: Warning: failed to register to debugfs\n",
30 void bond_debug_unregister(struct bonding *bond)
32 if (!bonding_debug_root)
35 debugfs_remove_recursive(bond->debug_dir);
38 void bond_debug_reregister(struct bonding *bond)
42 if (!bonding_debug_root)
45 d = debugfs_rename(bonding_debug_root, bond->debug_dir,
46 bonding_debug_root, bond->dev->name);
50 pr_warning("%s: Warning: failed to reregister, "
51 "so just unregister old one\n",
53 bond_debug_unregister(bond);
57 void bond_create_debugfs(void)
59 bonding_debug_root = debugfs_create_dir("bonding", NULL);
61 if (!bonding_debug_root) {
62 pr_warning("Warning: Cannot create bonding directory"
67 void bond_destroy_debugfs(void)
69 debugfs_remove_recursive(bonding_debug_root);
70 bonding_debug_root = NULL;
74 #else /* !CONFIG_DEBUG_FS */
76 void bond_debug_register(struct bonding *bond)
80 void bond_debug_unregister(struct bonding *bond)
84 void bond_debug_reregister(struct bonding *bond)
88 void bond_create_debugfs(void)
92 void bond_destroy_debugfs(void)
96 #endif /* CONFIG_DEBUG_FS */