summaryrefslogtreecommitdiffstats
path: root/net/6lowpan
diff options
context:
space:
mode:
authorAlexander Aring <aar@pengutronix.de>2016-04-11 11:04:23 +0200
committerMarcel Holtmann <marcel@holtmann.org>2016-04-13 10:41:10 +0200
commit2732363181766533af65e9ced3dc04a30502c5d1 (patch)
tree17abe73f09eca0722d63d3cc4fc9bd57d3759c91 /net/6lowpan
parenta5862f2aba4ba53d461450685a67ae252935ab94 (diff)
downloadlinux-2732363181766533af65e9ced3dc04a30502c5d1.tar.gz
linux-2732363181766533af65e9ced3dc04a30502c5d1.tar.bz2
linux-2732363181766533af65e9ced3dc04a30502c5d1.zip
6lowpan: add lowpan_is_ll function
This patch adds the lowpan_is_ll function, which can be used to make a special 6lowpan linklayer handling for a specific 6lowpan linklayer type. Signed-off-by: Alexander Aring <aar@pengutronix.de> Reviewed-by: Stefan Schmidt<stefan@osg.samsung.com> Acked-by: Jukka Rissanen <jukka.rissanen@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/6lowpan')
-rw-r--r--net/6lowpan/6lowpan_i.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/6lowpan/6lowpan_i.h b/net/6lowpan/6lowpan_i.h
index d16bb4b14aa1..97ecc27aeca6 100644
--- a/net/6lowpan/6lowpan_i.h
+++ b/net/6lowpan/6lowpan_i.h
@@ -3,6 +3,15 @@
#include <linux/netdevice.h>
+#include <net/6lowpan.h>
+
+/* caller need to be sure it's dev->type is ARPHRD_6LOWPAN */
+static inline bool lowpan_is_ll(const struct net_device *dev,
+ enum lowpan_lltypes lltype)
+{
+ return lowpan_dev(dev)->lltype == lltype;
+}
+
#ifdef CONFIG_6LOWPAN_DEBUGFS
int lowpan_dev_debugfs_init(struct net_device *dev);
void lowpan_dev_debugfs_exit(struct net_device *dev);