Split LoRaWAN related skb definitions from lora/lorawan_netdev.h into another header lora/lorawan_skb.h.
Signed-off-by: Jian-Hong Pan <starni...@g.ncu.edu.tw> --- include/linux/lora/lorawan_netdev.h | 20 ----------------- include/linux/lora/lorawan_skb.h | 33 +++++++++++++++++++++++++++++ net/lorawan/socket.c | 1 + 3 files changed, 34 insertions(+), 20 deletions(-) create mode 100644 include/linux/lora/lorawan_skb.h diff --git a/include/linux/lora/lorawan_netdev.h b/include/linux/lora/lorawan_netdev.h index a6c94cb96bf4..e515ba1ab508 100644 --- a/include/linux/lora/lorawan_netdev.h +++ b/include/linux/lora/lorawan_netdev.h @@ -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 diff --git a/include/linux/lora/lorawan_skb.h b/include/linux/lora/lorawan_skb.h new file mode 100644 index 000000000000..ea4f900b37be --- /dev/null +++ b/include/linux/lora/lorawan_skb.h @@ -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 <starni...@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 diff --git a/net/lorawan/socket.c b/net/lorawan/socket.c index 7139fab63159..50559ba0c538 100644 --- a/net/lorawan/socket.c +++ b/net/lorawan/socket.c @@ -13,6 +13,7 @@ #include <linux/init.h> #include <linux/list.h> #include <linux/lora/lorawan_netdev.h> +#include <linux/lora/lorawan_skb.h> #include <linux/module.h> #include <linux/net.h> #include <linux/termios.h> /* For TIOCOUTQ/INQ */ -- 2.20.1