From patchwork Wed Jan 16 14:25:04 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: 1025972 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="OUvfMAjw"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43fqLy6ZlRz9sBQ for ; Thu, 17 Jan 2019 01:28:26 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393509AbfAPO2Z (ORCPT ); Wed, 16 Jan 2019 09:28:25 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:36379 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729244AbfAPO2Y (ORCPT ); Wed, 16 Jan 2019 09:28:24 -0500 Received: by mail-pg1-f196.google.com with SMTP id n2so2909794pgm.3 for ; Wed, 16 Jan 2019 06: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=LkwCmAk0ZYfNjDokT65iazGLRf5oA0hVKPOU2YZw5hE=; b=OUvfMAjw+gXUX1ovtPr6jxjaZKa+q72zTZgpHNTIpCqwe7XUcjxGiz9RS7azzMaC9L 3JS3KEnlvndXJl07N/N/UawF8FYI284ArlkDlz2wUrLf8gmDUk+dVUyJlpmZEzWnnL+X e4yRWs/1WldCvXte5CCISDo+cLgUdLH+f8Xfs= 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=LkwCmAk0ZYfNjDokT65iazGLRf5oA0hVKPOU2YZw5hE=; b=VZ/2dzdys0eeqhI0swZ1o2GsNJ30DoW+N8wFBeJBhFDENs75v3yb2o68FQg+ZRGi0K 2E7m6a+eqPDgUOqjoaUI+GPdBD6cxmFBh5rzuAr5bCapen+ExYyT6nljlX31V+MGPWtW LQhN3ctGgBEzTccGaNHN6CZwl/DfXYk/jwg3xM+xCBqZdwRgEB042Fwr8Zj9i2xN0AHz /4Y2epGQHOgx7LecjJtY5Jk4117NRNFYW61N25dLg29n74YxzITgNRdxD0MiN1pP7gi/ fEBF5zIJnGzAlBQv5nzse44enU6KpAFbqWuriAy8IrfZYrPPcbpXg4tm39zyrQJvC46S IDEg== X-Gm-Message-State: AJcUukcWvEop6P2M/AAuES97CU2xZ+PHEwMbT7KQYGQLVgq4QAOIeBFO w2jnCzZnZYcoLRnYYRsfQtU9xg== X-Google-Smtp-Source: ALg8bN7Eh2t2CDGkqmpnX2Fv2TnJOXoWkmEqfsZ1kD4WHzXYK89387Ds7c3wswe2aq2I10jVmVizOg== X-Received: by 2002:a65:5bc4:: with SMTP id o4mr9187756pgr.426.1547648903805; Wed, 16 Jan 2019 06:28:23 -0800 (PST) Received: from starnight.local ([150.116.255.181]) by smtp.gmail.com with ESMTPSA id a17sm9211783pgm.26.2019.01.16.06.28.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Jan 2019 06:28:23 -0800 (PST) From: Jian-Hong Pan To: =?utf-8?q?Andreas_F=C3=A4rber?= Cc: Ben Whitten , linux-lpwan@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jian-Hong Pan Subject: [RFC PATCH 5/5] net: lorawan: Split skb definitions into another header Date: Wed, 16 Jan 2019 22:25:04 +0800 Message-Id: <20190116142458.19542-6-starnight@g.ncu.edu.tw> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190116142048.19446-1-starnight@g.ncu.edu.tw> References: <20190116142048.19446-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 --- 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 + */ + +#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/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 #include #include +#include #include #include #include /* For TIOCOUTQ/INQ */