6lowpan: add debugfs support
This patch will introduce a 6lowpan entry into the debugfs if enabled. Inside this 6lowpan directory we create a subdirectories of all 6lowpan interfaces to offer a per interface debugfs support. Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com> Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
committed by
Marcel Holtmann
parent
00f5931411
commit
b1815fd949
+27
-1
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user