1 /* SPDX-License-Identifier: GPL-2.0-only 1 /* SPDX-License-Identifier: GPL-2.0-only 2 * Copyright (c) 2013-2019, 2021 The Linux Fou !! 2 * Copyright (c) 2013-2019, The Linux Foundation. All rights reserved. 3 */ 3 */ 4 4 5 #ifndef _LINUX_IF_RMNET_H_ 5 #ifndef _LINUX_IF_RMNET_H_ 6 #define _LINUX_IF_RMNET_H_ 6 #define _LINUX_IF_RMNET_H_ 7 7 8 #include <linux/types.h> << 9 << 10 struct rmnet_map_header { 8 struct rmnet_map_header { 11 u8 flags; /* MAP !! 9 #if defined(__LITTLE_ENDIAN_BITFIELD) 12 u8 mux_id; !! 10 u8 pad_len:6; 13 __be16 pkt_len; /* Len !! 11 u8 reserved_bit:1; >> 12 u8 cd_bit:1; >> 13 #elif defined (__BIG_ENDIAN_BITFIELD) >> 14 u8 cd_bit:1; >> 15 u8 reserved_bit:1; >> 16 u8 pad_len:6; >> 17 #else >> 18 #error "Please fix <asm/byteorder.h>" >> 19 #endif >> 20 u8 mux_id; >> 21 __be16 pkt_len; 14 } __aligned(1); 22 } __aligned(1); 15 23 16 /* rmnet_map_header flags field: << 17 * PAD_LEN: number of pad bytes followin << 18 * CMD: 1 = packet contains a MAP co << 19 * NEXT_HEADER: 1 = packet contains V5 CSUM h << 20 */ << 21 #define MAP_PAD_LEN_MASK GENMAS << 22 #define MAP_NEXT_HEADER_FLAG BIT(6) << 23 #define MAP_CMD_FLAG BIT(7) << 24 << 25 struct rmnet_map_dl_csum_trailer { 24 struct rmnet_map_dl_csum_trailer { 26 u8 reserved1; !! 25 u8 reserved1; 27 u8 flags; /* MAP !! 26 #if defined(__LITTLE_ENDIAN_BITFIELD) 28 __be16 csum_start_offset; !! 27 u8 valid:1; 29 __be16 csum_length; !! 28 u8 reserved2:7; 30 __sum16 csum_value; !! 29 #elif defined (__BIG_ENDIAN_BITFIELD) >> 30 u8 reserved2:7; >> 31 u8 valid:1; >> 32 #else >> 33 #error "Please fix <asm/byteorder.h>" >> 34 #endif >> 35 u16 csum_start_offset; >> 36 u16 csum_length; >> 37 __be16 csum_value; 31 } __aligned(1); 38 } __aligned(1); 32 39 33 /* rmnet_map_dl_csum_trailer flags field: << 34 * VALID: 1 = checksum and length valid; << 35 */ << 36 #define MAP_CSUM_DL_VALID_FLAG BIT(0) << 37 << 38 struct rmnet_map_ul_csum_header { 40 struct rmnet_map_ul_csum_header { 39 __be16 csum_start_offset; 41 __be16 csum_start_offset; 40 __be16 csum_info; /* MAP !! 42 #if defined(__LITTLE_ENDIAN_BITFIELD) >> 43 u16 csum_insert_offset:14; >> 44 u16 udp_ind:1; >> 45 u16 csum_enabled:1; >> 46 #elif defined (__BIG_ENDIAN_BITFIELD) >> 47 u16 csum_enabled:1; >> 48 u16 udp_ind:1; >> 49 u16 csum_insert_offset:14; >> 50 #else >> 51 #error "Please fix <asm/byteorder.h>" >> 52 #endif 41 } __aligned(1); 53 } __aligned(1); 42 54 43 /* csum_info field: << 44 * OFFSET: where (offset in bytes) to ins << 45 * UDP: 1 = UDP checksum (zero checksu << 46 * ENABLED: 1 = checksum computation reque << 47 */ << 48 #define MAP_CSUM_UL_OFFSET_MASK GENMAS << 49 #define MAP_CSUM_UL_UDP_FLAG BIT(14 << 50 #define MAP_CSUM_UL_ENABLED_FLAG BIT(15 << 51 << 52 /* MAP CSUM headers */ << 53 struct rmnet_map_v5_csum_header { << 54 u8 header_info; << 55 u8 csum_info; << 56 __be16 reserved; << 57 } __aligned(1); << 58 << 59 /* v5 header_info field << 60 * NEXT_HEADER: represents whether there is an << 61 * HEADER_TYPE: represents the type of this he << 62 * << 63 * csum_info field << 64 * CSUM_VALID_OR_REQ: << 65 * 1 = for UL, checksum computation is request << 66 * 1 = for DL, validated the checksum and has << 67 */ << 68 << 69 #define MAPV5_HDRINFO_NXT_HDR_FLAG BIT(0) << 70 #define MAPV5_HDRINFO_HDR_TYPE_FMASK GENMAS << 71 #define MAPV5_CSUMINFO_VALID_FLAG BIT(7) << 72 << 73 #define RMNET_MAP_HEADER_TYPE_CSUM_OFFLOAD 2 << 74 #endif /* !(_LINUX_IF_RMNET_H_) */ 55 #endif /* !(_LINUX_IF_RMNET_H_) */ 75 56
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.