Sean Tranchetti | fd2e695 | 2018-10-29 14:02:00 -0600 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | /* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. |
| 3 | * |
| 4 | * Legacy RMNET Data MAP header definitions |
| 5 | */ |
| 6 | |
| 7 | #ifndef _RMNET_CONFIG_H_ |
| 8 | #define _RMNET_CONFIG_H_ |
| 9 | |
| 10 | struct rmnet_map_header_s { |
| 11 | #ifndef RMNET_USE_BIG_ENDIAN_STRUCTS |
| 12 | uint8_t pad_len:6; |
| 13 | uint8_t reserved_bit:1; |
| 14 | uint8_t cd_bit:1; |
| 15 | #else |
| 16 | uint8_t cd_bit:1; |
| 17 | uint8_t reserved_bit:1; |
| 18 | uint8_t pad_len:6; |
| 19 | #endif /* RMNET_USE_BIG_ENDIAN_STRUCTS */ |
| 20 | uint8_t mux_id; |
| 21 | uint16_t pkt_len; |
| 22 | } __aligned(1); |
| 23 | |
| 24 | #define RMNET_MAP_GET_MUX_ID(Y) (((struct rmnet_map_header_s *)Y->data)->mux_id) |
| 25 | #define RMNET_MAP_GET_CD_BIT(Y) (((struct rmnet_map_header_s *)Y->data)->cd_bit) |
| 26 | #define RMNET_MAP_GET_PAD(Y) (((struct rmnet_map_header_s *)Y->data)->pad_len) |
| 27 | #define RMNET_MAP_GET_CMD_START(Y) ((struct rmnet_map_control_command_s *) \ |
| 28 | (Y->data + sizeof(struct rmnet_map_header_s))) |
| 29 | #define RMNET_MAP_GET_LENGTH(Y) (ntohs( \ |
| 30 | ((struct rmnet_map_header_s *)Y->data)->pkt_len)) |
| 31 | |
| 32 | #endif /* _RMNET_CONFIG_H_ */ |