Return-Path: From: Lukasz Duda To: CC: , , Glenn Ruben Bakke Subject: [RFC v2 1/4] 6lowpan: Introduce debugfs entry for 6lowpan module Date: Mon, 13 Jul 2015 13:50:30 +0200 Message-ID: <1436788233-13960-2-git-send-email-lukasz.duda@nordicsemi.no> In-Reply-To: <1436788233-13960-1-git-send-email-lukasz.duda@nordicsemi.no> References: <1436788233-13960-1-git-send-email-lukasz.duda@nordicsemi.no> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-wpan-owner@vger.kernel.org List-ID: Creating "6lowpan" debugfs entry (/sys/kernel/debugfs/6lowpan) for usage by 6lowpan module. Signed-off-by: Lukasz Duda Signed-off-by: Glenn Ruben Bakke --- include/net/6lowpan.h | 2 ++ net/6lowpan/iphc.c | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/include/net/6lowpan.h b/include/net/6lowpan.h index dc03d77..37ddbdf 100644 --- a/include/net/6lowpan.h +++ b/include/net/6lowpan.h @@ -197,6 +197,8 @@ #define LOWPAN_NHC_UDP_CS_P_11 0xF3 /* source & dest = 0xF0B + 4bit inline */ #define LOWPAN_NHC_UDP_CS_C 0x04 /* checksum elided */ +extern struct dentry *lowpan_debugfs; + #ifdef DEBUG /* print data in line */ static inline void raw_dump_inline(const char *caller, char *msg, diff --git a/net/6lowpan/iphc.c b/net/6lowpan/iphc.c index 9055d7b..c845a8a 100644 --- a/net/6lowpan/iphc.c +++ b/net/6lowpan/iphc.c @@ -50,12 +50,16 @@ #include #include #include +#include #include #include #include #include "nhc.h" +struct dentry *lowpan_debugfs; +EXPORT_SYMBOL_GPL(lowpan_debugfs); + /* Uncompress address function for source and * destination address(non-multicast). * @@ -613,6 +617,8 @@ EXPORT_SYMBOL_GPL(lowpan_header_compress); static int __init lowpan_module_init(void) { + lowpan_debugfs = debugfs_create_dir("6lowpan", NULL); + request_module_nowait("ipv6"); request_module_nowait("nhc_dest"); @@ -625,6 +631,13 @@ static int __init lowpan_module_init(void) return 0; } + +static void __exit lowpan_module_exit(void) +{ + debugfs_remove(lowpan_debugfs); +} + module_init(lowpan_module_init); +module_exit(lowpan_module_exit); MODULE_LICENSE("GPL"); -- 2.1.4