new file mode 100644
@@ -0,0 +1,33 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later OR BSD-3-Clause */
+/*
+ * LoRaWAN socket buffer related definitions
+ *
+ * Copyright (c) 2018 Jian-Hong Pan <starnight@g.ncu.edu.tw>
+ */
+
+#ifndef __LORAWAN_SKB_H__
+#define __LORAWAN_SKB_H__
+
+#include <linux/skbuff.h>
+
+/**
+ * lrw_mac_cb - This structure holds the control buffer (cb) of sk_buff
+ *
+ * @devaddr: the LoRaWAN device address of this LoRaWAN hardware
+ */
+struct lrw_mac_cb {
+ u32 devaddr;
+};
+
+/**
+ * lrw_get_mac_cb - Get the LoRaWAN MAC control buffer of the sk_buff
+ * @skb: the exchanging sk_buff
+ *
+ * Return: the pointer of LoRaWAN MAC control buffer
+ */
+static inline struct lrw_mac_cb *lrw_get_mac_cb(struct sk_buff *skb)
+{
+ return (struct lrw_mac_cb *)skb->cb;
+}
+
+#endif
@@ -28,24 +28,4 @@ struct sockaddr_lorawan {
struct lrw_addr_in addr_in;
};
-/**
- * lrw_mac_cb - This structure holds the control buffer (cb) of sk_buff
- *
- * @devaddr: the LoRaWAN device address of this LoRaWAN hardware
- */
-struct lrw_mac_cb {
- u32 devaddr;
-};
-
-/**
- * lrw_get_mac_cb - Get the LoRaWAN MAC control buffer of the sk_buff
- * @skb: the exchanging sk_buff
- *
- * Return: the pointer of LoRaWAN MAC control buffer
- */
-static inline struct lrw_mac_cb *lrw_get_mac_cb(struct sk_buff *skb)
-{
- return (struct lrw_mac_cb *)skb->cb;
-}
-
#endif
@@ -12,6 +12,7 @@
#include <linux/if_arp.h>
#include <linux/init.h>
#include <linux/list.h>
+#include <linux/lora/lorawan/skb.h>
#include <linux/lora/lorawan_netdev.h>
#include <linux/module.h>
#include <linux/net.h>
Split LoRaWAN related skb definitions from lora/lorawan_netdev.h into another header lora/lorawan/skb.h. Signed-off-by: Jian-Hong Pan <starnight@g.ncu.edu.tw> --- v2: - Modify the commit message - Move lora/lorawan_netdev.h to lora/lorawan/skb.h include/linux/lora/lorawan/skb.h | 33 +++++++++++++++++++++++++++++ include/linux/lora/lorawan_netdev.h | 20 ----------------- net/lorawan/socket.c | 1 + 3 files changed, 34 insertions(+), 20 deletions(-) create mode 100644 include/linux/lora/lorawan/skb.h