summaryrefslogtreecommitdiff
path: root/net/6lowpan/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/6lowpan/core.c')
-rw-r--r--net/6lowpan/core.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/net/6lowpan/core.c b/net/6lowpan/core.c
index 80fc50987cf3..c7f06f5c0121 100644
--- a/net/6lowpan/core.c
+++ b/net/6lowpan/core.c
@@ -15,9 +15,13 @@
#include <net/6lowpan.h>
+#include "6lowpan_i.h"
+
int lowpan_register_netdevice(struct net_device *dev,
enum lowpan_lltypes lltype)
{
+ int ret;
+
dev->addr_len = EUI64_ADDR_LEN;
dev->type = ARPHRD_6LOWPAN;
dev->mtu = IPV6_MIN_MTU;
@@ -25,7 +29,15 @@ int lowpan_register_netdevice(struct net_device *dev,
lowpan_priv(dev)->lltype = lltype;
- return register_netdevice(dev);
+ ret = lowpan_dev_debugfs_init(dev);
+ if (ret < 0)
+ return ret;
+
+ ret = register_netdevice(dev);
+ if (ret < 0)
+ lowpan_dev_debugfs_exit(dev);
+
+ return ret;
}
EXPORT_SYMBOL(lowpan_register_netdevice);
@@ -44,6 +56,7 @@ EXPORT_SYMBOL(lowpan_register_netdev);
void lowpan_unregister_netdevice(struct net_device *dev)
{
unregister_netdevice(dev);
+ lowpan_dev_debugfs_exit(dev);
}
EXPORT_SYMBOL(lowpan_unregister_netdevice);
@@ -57,6 +70,12 @@ EXPORT_SYMBOL(lowpan_unregister_netdev);
static int __init lowpan_module_init(void)
{
+ int ret;
+
+ ret = lowpan_debugfs_init();
+ if (ret < 0)
+ return ret;
+
request_module_nowait("ipv6");
request_module_nowait("nhc_dest");
@@ -69,6 +88,13 @@ static int __init lowpan_module_init(void)
return 0;
}
+
+static void __exit lowpan_module_exit(void)
+{
+ lowpan_debugfs_exit();
+}
+
module_init(lowpan_module_init);
+module_exit(lowpan_module_exit);
MODULE_LICENSE("GPL");