From 4d6ec5cecc3517bfd834d9ec042d585deca280c1 Mon Sep 17 00:00:00 2001 From: Harout Hedeshian Date: Tue, 17 Jun 2014 08:10:43 -0600 Subject: net: rmnet_data: Move MAP header definition to UAPI Expose the MAP header to the rest of the kernel and user space. Useful for making various parts of the kernel MAP aware. Keeping consistency with other networking procols by exposing protocol headers to user space with a header file in UAPI. CRs-Fixed: 681280 Change-Id: Ic7f414f926f68531418725f971ab2b44459f5ea1 Signed-off-by: Harout Hedeshian [subashab@codeaurora.org: resolve trivial merge conflicts] Signed-off-by: Subash Abhinov Kasiviswanathan --- include/uapi/linux/net_map.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 include/uapi/linux/net_map.h (limited to 'include/uapi/linux/net_map.h') diff --git a/include/uapi/linux/net_map.h b/include/uapi/linux/net_map.h new file mode 100644 index 000000000000..879a854cb1da --- /dev/null +++ b/include/uapi/linux/net_map.h @@ -0,0 +1,27 @@ +#ifndef _NET_MAP_H_ +#define _NET_MAP_H_ + +struct rmnet_map_header_s { +#ifndef RMNET_USE_BIG_ENDIAN_STRUCTS + uint8_t pad_len:6; + uint8_t reserved_bit:1; + uint8_t cd_bit:1; +#else + uint8_t cd_bit:1; + uint8_t reserved_bit:1; + uint8_t pad_len:6; +#endif /* RMNET_USE_BIG_ENDIAN_STRUCTS */ + uint8_t mux_id; + uint16_t pkt_len; +} __aligned(1); + +#define RMNET_MAP_GET_MUX_ID(Y) (((struct rmnet_map_header_s *)Y->data)->mux_id) +#define RMNET_MAP_GET_CD_BIT(Y) (((struct rmnet_map_header_s *)Y->data)->cd_bit) +#define RMNET_MAP_GET_PAD(Y) (((struct rmnet_map_header_s *)Y->data)->pad_len) +#define RMNET_MAP_GET_CMD_START(Y) ((struct rmnet_map_control_command_s *) \ + (Y->data + sizeof(struct rmnet_map_header_s))) +#define RMNET_MAP_GET_LENGTH(Y) (ntohs( \ + ((struct rmnet_map_header_s *)Y->data)->pkt_len)) + + +#endif /* _NET_MAP_H_ */ -- cgit v1.2.3