[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190512012508.10608-3-elder@linaro.org>
Date: Sat, 11 May 2019 20:24:52 -0500
From: Alex Elder <elder@...aro.org>
To: davem@...emloft.net, arnd@...db.de, bjorn.andersson@...aro.org,
ilias.apalodimas@...aro.org, subashab@...eaurora.org,
stranche@...eaurora.org, yuehaibing@...wei.com, joe@...ches.com
Cc: syadagir@...eaurora.org, mjavid@...eaurora.org,
evgreen@...omium.org, benchan@...gle.com, ejcaruso@...gle.com,
abhishek.esse@...il.com, linux-kernel@...r.kernel.org,
Alex Elder <elder@...aro.org>
Subject: [PATCH 02/18] soc: qcom: create "include/soc/qcom/rmnet.h"
The IPA driver requires some (but not all) symbols defined in
"drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h". Create a new
public header file "include/soc/qcom/rmnet.h" and move the needed
definitions there.
Signed-off-by: Alex Elder <elder@...aro.org>
---
.../ethernet/qualcomm/rmnet/rmnet_handlers.c | 1 +
.../net/ethernet/qualcomm/rmnet/rmnet_map.h | 24 ------------
.../qualcomm/rmnet/rmnet_map_command.c | 1 +
.../ethernet/qualcomm/rmnet/rmnet_map_data.c | 1 +
.../net/ethernet/qualcomm/rmnet/rmnet_vnd.c | 1 +
include/soc/qcom/rmnet.h | 38 +++++++++++++++++++
6 files changed, 42 insertions(+), 24 deletions(-)
create mode 100644 include/soc/qcom/rmnet.h
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
index 11167abe5934..3aa79b7ed539 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
@@ -17,6 +17,7 @@
#include <linux/netdev_features.h>
#include <linux/if_arp.h>
#include <net/sock.h>
+#include <soc/qcom/rmnet.h>
#include "rmnet_private.h"
#include "rmnet_config.h"
#include "rmnet_vnd.h"
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h
index 884f1f52dcc2..39d0be99a771 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h
@@ -39,30 +39,6 @@ enum rmnet_map_commands {
RMNET_MAP_COMMAND_ENUM_LENGTH
};
-struct rmnet_map_header {
- u8 pad_len:6;
- u8 reserved_bit:1;
- u8 cd_bit:1;
- u8 mux_id;
- __be16 pkt_len;
-} __aligned(1);
-
-struct rmnet_map_dl_csum_trailer {
- u8 reserved1;
- u8 valid:1;
- u8 reserved2:7;
- u16 csum_start_offset;
- u16 csum_length;
- __be16 csum_value;
-} __aligned(1);
-
-struct rmnet_map_ul_csum_header {
- __be16 csum_start_offset;
- u16 csum_insert_offset:14;
- u16 udp_ip4_ind:1;
- u16 csum_enabled:1;
-} __aligned(1);
-
#define RMNET_MAP_GET_MUX_ID(Y) (((struct rmnet_map_header *) \
(Y)->data)->mux_id)
#define RMNET_MAP_GET_CD_BIT(Y) (((struct rmnet_map_header *) \
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_command.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_command.c
index f6cf59aee212..54b86a8be570 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_command.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_command.c
@@ -11,6 +11,7 @@
*/
#include <linux/netdevice.h>
+#include <soc/qcom/rmnet.h>
#include "rmnet_config.h"
#include "rmnet_map.h"
#include "rmnet_private.h"
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c
index 57a9c314a665..e3fb4035820c 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c
@@ -17,6 +17,7 @@
#include <linux/ip.h>
#include <linux/ipv6.h>
#include <net/ip6_checksum.h>
+#include <soc/qcom/rmnet.h>
#include "rmnet_config.h"
#include "rmnet_map.h"
#include "rmnet_private.h"
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c
index d11c16aeb19a..b8df36e827d4 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c
@@ -17,6 +17,7 @@
#include <linux/etherdevice.h>
#include <linux/if_arp.h>
#include <net/pkt_sched.h>
+#include <soc/qcom/rmnet.h>
#include "rmnet_config.h"
#include "rmnet_handlers.h"
#include "rmnet_private.h"
diff --git a/include/soc/qcom/rmnet.h b/include/soc/qcom/rmnet.h
new file mode 100644
index 000000000000..80dcd6e68c3d
--- /dev/null
+++ b/include/soc/qcom/rmnet.h
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+/* Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
+ * Copyright (C) 2018-2019 Linaro Ltd.
+ */
+#ifndef _SOC_QCOM_RMNET_H_
+#define _SOC_QCOM_RMNET_H_
+
+#include <linux/types.h>
+
+/* Header structure that precedes packets in ETH_P_MAP protocol */
+struct rmnet_map_header {
+ u8 pad_len : 6;
+ u8 reserved_bit : 1;
+ u8 cd_bit : 1;
+ u8 mux_id;
+ __be16 pkt_len;
+} __aligned(1);
+
+/* Checksum offload metadata header for outbound packets*/
+struct rmnet_map_ul_csum_header {
+ __be16 csum_start_offset;
+ u16 csum_insert_offset : 14;
+ u16 udp_ip4_ind : 1;
+ u16 csum_enabled : 1;
+} __aligned(1);
+
+/* Checksum offload metadata trailer for inbound packets */
+struct rmnet_map_dl_csum_trailer {
+ u8 reserved1;
+ u8 valid : 1;
+ u8 reserved2 : 7;
+ u16 csum_start_offset;
+ u16 csum_length;
+ __be16 csum_value;
+} __aligned(1);
+
+#endif /* _SOC_QCOM_RMNET_H_ */
--
2.20.1
Powered by blists - more mailing lists