@@ -18,6 +18,7 @@
#include <linux/netdev_features.h>
#include <linux/if_arp.h>
#include <net/sock.h>
+#include <linux/if_rmnet.h>
#include "rmnet_private.h"
#include "rmnet_config.h"
#include "rmnet_vnd.h"
@@ -39,37 +39,6 @@ enum rmnet_map_commands {
RMNET_MAP_COMMAND_ENUM_LENGTH
};
-struct rmnet_map_header {
- u8 cmd_pad_len; /* RMNET_MAP_* */
- u8 mux_id;
- __be16 pkt_len;
-} __aligned(1);
-
-#define RMNET_MAP_CMD_FMASK GENMASK(0, 0) /* 0: data; 1: cmd */
-#define RMNET_MAP_RESERVED_FMASK GENMASK(1, 1)
-#define RMNET_MAP_PAD_LEN_FMASK GENMASK(7, 2)
-
-struct rmnet_map_dl_csum_trailer {
- u8 reserved1;
- u8 flags; /* RMNET_MAP_DL_* */
- __be16 csum_start_offset;
- __be16 csum_length;
- __be16 csum_value;
-} __aligned(1);
-
-#define RMNET_MAP_DL_CSUM_VALID_FMASK GENMASK(0, 0)
-#define RMNET_MAP_DL_RESERVED_FMASK GENMASK(7, 1)
-
-struct rmnet_map_ul_csum_header {
- __be16 csum_start_offset;
- __be16 csum_info; /* RMNET_MAP_UL_* */
-} __aligned(1);
-
-/* NOTE: These field masks are defined in CPU byte order */
-#define RMNET_MAP_UL_CSUM_INSERT_FMASK GENMASK(13, 0)
-#define RMNET_MAP_UL_CSUM_UDP_FMASK GENMASK(14, 14) /* 0: IP; 1: UDP */
-#define RMNET_MAP_UL_CSUM_ENABLED_FMASK GENMASK(15, 15)
-
#define RMNET_MAP_COMMAND_REQUEST 0
#define RMNET_MAP_COMMAND_ACK 1
#define RMNET_MAP_COMMAND_UNSUPPORTED 2
@@ -11,6 +11,7 @@
*/
#include <linux/netdevice.h>
+#include <linux/if_rmnet.h>
#include "rmnet_config.h"
#include "rmnet_map.h"
#include "rmnet_private.h"
@@ -18,6 +18,7 @@
#include <linux/ip.h>
#include <linux/ipv6.h>
#include <net/ip6_checksum.h>
+#include <linux/if_rmnet.h>
#include "rmnet_config.h"
#include "rmnet_map.h"
#include "rmnet_private.h"
@@ -17,6 +17,7 @@
#include <linux/etherdevice.h>
#include <linux/if_arp.h>
#include <net/pkt_sched.h>
+#include <linux/if_rmnet.h>
#include "rmnet_config.h"
#include "rmnet_handlers.h"
#include "rmnet_private.h"
new file mode 100644
@@ -0,0 +1,45 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+/* Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
+ * Copyright (C) 2019 Linaro Ltd.
+ */
+#ifndef _LINUX_IF_RMNET_H_
+#define _LINUX_IF_RMNET_H_
+
+#include <linux/types.h>
+
+/* Header structure that precedes packets in ETH_P_MAP protocol */
+struct rmnet_map_header {
+ u8 cmd_pad_len; /* RMNET_MAP_* */
+ u8 mux_id;
+ __be16 pkt_len;
+} __aligned(1);
+
+#define RMNET_MAP_CMD_FMASK GENMASK(0, 0) /* 0: data; 1: cmd */
+#define RMNET_MAP_RESERVED_FMASK GENMASK(1, 1)
+#define RMNET_MAP_PAD_LEN_FMASK GENMASK(7, 2)
+
+/* Checksum offload metadata header for outbound packets*/
+struct rmnet_map_ul_csum_header {
+ __be16 csum_start_offset;
+ __be16 csum_info; /* RMNET_MAP_UL_* */
+} __aligned(1);
+
+/* NOTE: These field masks are defined in CPU byte order */
+#define RMNET_MAP_UL_CSUM_INSERT_FMASK GENMASK(13, 0)
+#define RMNET_MAP_UL_CSUM_UDP_FMASK GENMASK(14, 14) /* 0: IP; 1: UDP */
+#define RMNET_MAP_UL_CSUM_ENABLED_FMASK GENMASK(15, 15)
+
+/* Checksum offload metadata trailer for inbound packets */
+struct rmnet_map_dl_csum_trailer {
+ u8 reserved1;
+ u8 flags; /* RMNET_MAP_DL_* */
+ __be16 csum_start_offset;
+ __be16 csum_length;
+ __be16 csum_value;
+} __aligned(1);
+
+#define RMNET_MAP_DL_CSUM_VALID_FMASK GENMASK(0, 0)
+#define RMNET_MAP_DL_RESERVED_FMASK GENMASK(7, 1)
+
+#endif /* _LINUX_IF_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/linux/if_rmnet.h" and move the needed definitions there. Signed-off-by: Alex Elder <elder@linaro.org> --- .../ethernet/qualcomm/rmnet/rmnet_handlers.c | 1 + .../net/ethernet/qualcomm/rmnet/rmnet_map.h | 31 ------------- .../qualcomm/rmnet/rmnet_map_command.c | 1 + .../ethernet/qualcomm/rmnet/rmnet_map_data.c | 1 + .../net/ethernet/qualcomm/rmnet/rmnet_vnd.c | 1 + include/linux/if_rmnet.h | 45 +++++++++++++++++++ 6 files changed, 49 insertions(+), 31 deletions(-) create mode 100644 include/linux/if_rmnet.h -- 2.20.1