Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1/* SPDX-License-Identifier: GPL-2.0-only
2 * Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
3 */
4
5#ifndef _LINUX_IF_RMNET_H_
6#define _LINUX_IF_RMNET_H_
7
8struct rmnet_map_header {
9 u8 flags; /* MAP_CMD_FLAG, MAP_PAD_LEN_MASK */
10 u8 mux_id;
11 __be16 pkt_len; /* Length of packet, including pad */
12} __aligned(1);
13
14/* rmnet_map_header flags field:
15 * PAD_LEN: number of pad bytes following packet data
16 * CMD: 1 = packet contains a MAP command; 0 = packet contains data
17 */
18#define MAP_PAD_LEN_MASK GENMASK(5, 0)
19#define MAP_CMD_FLAG BIT(7)
20
21struct rmnet_map_dl_csum_trailer {
22 u8 reserved1;
23 u8 flags; /* MAP_CSUM_DL_VALID_FLAG */
24 __be16 csum_start_offset;
25 __be16 csum_length;
26 __be16 csum_value;
27} __aligned(1);
28
29/* rmnet_map_dl_csum_trailer flags field:
30 * VALID: 1 = checksum and length valid; 0 = ignore them
31 */
32#define MAP_CSUM_DL_VALID_FLAG BIT(0)
33
34struct rmnet_map_ul_csum_header {
35 __be16 csum_start_offset;
36 __be16 csum_info; /* MAP_CSUM_UL_* */
37} __aligned(1);
38
39/* csum_info field:
40 * OFFSET: where (offset in bytes) to insert computed checksum
41 * UDP: 1 = UDP checksum (zero checkum means no checksum)
42 * ENABLED: 1 = checksum computation requested
43 */
44#define MAP_CSUM_UL_OFFSET_MASK GENMASK(13, 0)
45#define MAP_CSUM_UL_UDP_FLAG BIT(14)
46#define MAP_CSUM_UL_ENABLED_FLAG BIT(15)
47
48#endif /* !(_LINUX_IF_RMNET_H_) */