From patchwork Thu Jan 31 16:28:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jian-Hong Pan X-Patchwork-Id: 1034374 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=g.ncu.edu.tw Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=g.ncu.edu.tw header.i=@g.ncu.edu.tw header.b="Folmeqz/"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43r5JV0MGbz9sBb for ; Fri, 1 Feb 2019 03:28:26 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388490AbfAaQ2Z (ORCPT ); Thu, 31 Jan 2019 11:28:25 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:39814 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727189AbfAaQ2Y (ORCPT ); Thu, 31 Jan 2019 11:28:24 -0500 Received: by mail-pf1-f194.google.com with SMTP id r136so1696438pfc.6 for ; Thu, 31 Jan 2019 08:28:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=g.ncu.edu.tw; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=O6p9UWrTh45kbCo55mauKUTMYmtB6r8EexQRcevjVTY=; b=Folmeqz/bTKj84Qvq+8zgzwUoDinxB/aEk8MRGFfyIMCmqxsGWXe4cR0oqNanXzqng /SnpGj58EnZ4vqyaCzH+u4HfReltyKtJkEw4k8dA2GfmMyLpINxi2aBVTo6PGAFp2MKo q6IHhQLQpKON/GWO6SCVgTzuBAOuQ0ZyR5/kM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=O6p9UWrTh45kbCo55mauKUTMYmtB6r8EexQRcevjVTY=; b=nuUdKFu+2mrDBOHvNW7Q6Bk0zVL/E/tSlCYvoTFb7KyW/L33pNEonlJKgJWQlS+zPC Fvjo9ch/WlHoezNVUoDQ+F9/x4leBfnXm9YC/1z0sxO1G2bov7Roq1/UnGUJQvwIHl10 roqBMcTIzUXiXXZrDX13oJ/ZxaqFm89dvedh53VGwF5Zv/zYtBpZzKD7490fnUBCW3F/ si7cDkdFNrI4TIB6BmuTQWi0f4dFx+tZDtyNL/KdIFO0FcOHxUmyMku9tb96hnKpUwM8 kLXKw8GbD0Jp1RTrXUWqSmvco0KQRCdoyH79c3AkJfusVIsjBqyR8H8Sk0jNlbGW7UMZ eHxg== X-Gm-Message-State: AJcUukd/SVpUQCxsDgc9VKpoahCu/92werCS0WpO5mKNMIWQq7Rf4+N+ Ri8PT4ie7VL9clREX6GNljLjVQ== X-Google-Smtp-Source: ALg8bN7gPHlwf0t8afiyl5xlCS4N3S710IdAqJoqtW/HuT8jiO+0AR9bYNuoQ19DcpVsIrNzES2w0g== X-Received: by 2002:a65:500c:: with SMTP id f12mr31730764pgo.226.1548952103975; Thu, 31 Jan 2019 08:28:23 -0800 (PST) Received: from starnight.local ([150.116.255.181]) by smtp.gmail.com with ESMTPSA id r66sm9629638pfk.157.2019.01.31.08.28.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Jan 2019 08:28:23 -0800 (PST) From: Jian-Hong Pan To: =?utf-8?q?Andreas_F=C3=A4rber?= Cc: netdev@vger.kernel.org, linux-lpwan@lists.infradead.org, Ben Whitten , Jian-Hong Pan Subject: [RFC PATCH v2 5/5] net: lorawan: Split skb definitions into another header Date: Fri, 1 Feb 2019 00:28:40 +0800 Message-Id: <20190131162840.18676-1-starnight@g.ncu.edu.tw> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190131162101.18386-1-starnight@g.ncu.edu.tw> References: <20190131162101.18386-1-starnight@g.ncu.edu.tw> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Split LoRaWAN related skb definitions from lora/lorawan_netdev.h into another header lora/lorawan/skb.h. Signed-off-by: Jian-Hong Pan --- 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 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 + */ + +#ifndef __LORAWAN_SKB_H__ +#define __LORAWAN_SKB_H__ + +#include + +/** + * 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_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/net/lorawan/socket.c b/net/lorawan/socket.c index c94dc0f3cf82..e7cb45bd93d0 100644 --- a/net/lorawan/socket.c +++ b/net/lorawan/socket.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include