blob: 5f5685aac360dac75bb52f610b835ffded2f4554 [file] [log] [blame]
Subash Abhinov Kasiviswanathan2139ce8a2016-10-14 11:01:48 -06001/* Copyright (c) 2016, The Linux Foundation. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * RMNET Data config definition
13 */
14
15#ifndef _RMNET_CONFIG_H_
16#define _RMNET_CONFIG_H_
17
18#include <linux/skbuff.h>
19
20struct rmnet_phys_ep_conf_s {
21 void (*recycle)(struct sk_buff *); /* Destruct function */
22 void *config;
23};
24
25struct rmnet_map_header_s {
26#ifndef RMNET_USE_BIG_ENDIAN_STRUCTS
27 uint8_t pad_len:6;
28 uint8_t reserved_bit:1;
29 uint8_t cd_bit:1;
30#else
31 uint8_t cd_bit:1;
32 uint8_t reserved_bit:1;
33 uint8_t pad_len:6;
34#endif /* RMNET_USE_BIG_ENDIAN_STRUCTS */
35 uint8_t mux_id;
36 uint16_t pkt_len;
37} __aligned(1);
38
39#define RMNET_MAP_GET_MUX_ID(Y) (((struct rmnet_map_header_s *)Y->data)->mux_id)
40#define RMNET_MAP_GET_CD_BIT(Y) (((struct rmnet_map_header_s *)Y->data)->cd_bit)
41#define RMNET_MAP_GET_PAD(Y) (((struct rmnet_map_header_s *)Y->data)->pad_len)
42#define RMNET_MAP_GET_CMD_START(Y) ((struct rmnet_map_control_command_s *) \
43 (Y->data + sizeof(struct rmnet_map_header_s)))
44#define RMNET_MAP_GET_LENGTH(Y) (ntohs( \
45 ((struct rmnet_map_header_s *)Y->data)->pkt_len))
46
47#endif /* _RMNET_CONFIG_H_ */