diff options
author | Subash Abhinov Kasiviswanathan <subashab@codeaurora.org> | 2019-05-22 23:21:07 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-05-23 19:48:07 +0300 |
commit | 9395da4efbd46661f0049d24d54d1cea63241fc9 (patch) | |
tree | 1a3fbf27d7130a4bf2d587d6e413096d9171fbac /include/linux/if_rmnet.h | |
parent | 16fa1cf1ed2a652a483cf8f1ea65c703693292e8 (diff) | |
download | linux-9395da4efbd46661f0049d24d54d1cea63241fc9.tar.xz |
net: qualcomm: rmnet: Move common struct definitions to include
Create if_rmnet.h and move the rmnet MAP packet structs to this
common include file. To account for portablity, add little and
big endian bitfield definitions similar to the ip & tcp headers.
The definitions in the headers can now be re-used by the
upcoming ipa driver series as well as qmi_wwan.
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/if_rmnet.h')
-rw-r--r-- | include/linux/if_rmnet.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/include/linux/if_rmnet.h b/include/linux/if_rmnet.h new file mode 100644 index 000000000000..b4f5403383fc --- /dev/null +++ b/include/linux/if_rmnet.h @@ -0,0 +1,55 @@ +/* SPDX-License-Identifier: GPL-2.0-only + * Copyright (c) 2013-2019, The Linux Foundation. All rights reserved. + */ + +#ifndef _LINUX_IF_RMNET_H_ +#define _LINUX_IF_RMNET_H_ + +struct rmnet_map_header { +#if defined(__LITTLE_ENDIAN_BITFIELD) + u8 pad_len:6; + u8 reserved_bit:1; + u8 cd_bit:1; +#elif defined (__BIG_ENDIAN_BITFIELD) + u8 cd_bit:1; + u8 reserved_bit:1; + u8 pad_len:6; +#else +#error "Please fix <asm/byteorder.h>" +#endif + u8 mux_id; + __be16 pkt_len; +} __aligned(1); + +struct rmnet_map_dl_csum_trailer { + u8 reserved1; +#if defined(__LITTLE_ENDIAN_BITFIELD) + u8 valid:1; + u8 reserved2:7; +#elif defined (__BIG_ENDIAN_BITFIELD) + u8 reserved2:7; + u8 valid:1; +#else +#error "Please fix <asm/byteorder.h>" +#endif + u16 csum_start_offset; + u16 csum_length; + __be16 csum_value; +} __aligned(1); + +struct rmnet_map_ul_csum_header { + __be16 csum_start_offset; +#if defined(__LITTLE_ENDIAN_BITFIELD) + u16 csum_insert_offset:14; + u16 udp_ip4_ind:1; + u16 csum_enabled:1; +#elif defined (__BIG_ENDIAN_BITFIELD) + u16 csum_enabled:1; + u16 udp_ip4_ind:1; + u16 csum_insert_offset:14; +#else +#error "Please fix <asm/byteorder.h>" +#endif +} __aligned(1); + +#endif /* !(_LINUX_IF_RMNET_H_) */ |