1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* Copyright (c) 2013-2018, The Linux Foundation. All rights reserved. 3 */ 4 5 #ifndef _RMNET_MAP_H_ 6 #define _RMNET_MAP_H_ 7 #include <linux/if_rmnet.h> 8 9 struct rmnet_map_control_command { 10 u8 command_name; 11 u8 cmd_type:2; 12 u8 reserved:6; 13 u16 reserved2; 14 u32 transaction_id; 15 union { 16 struct { 17 u16 ip_family:2; 18 u16 reserved:14; 19 __be16 flow_control_seq_num; 20 __be32 qos_id; 21 } flow_control; 22 u8 data[0]; 23 }; 24 } __aligned(1); 25 26 enum rmnet_map_commands { 27 RMNET_MAP_COMMAND_NONE, 28 RMNET_MAP_COMMAND_FLOW_DISABLE, 29 RMNET_MAP_COMMAND_FLOW_ENABLE, 30 /* These should always be the last 2 elements */ 31 RMNET_MAP_COMMAND_UNKNOWN, 32 RMNET_MAP_COMMAND_ENUM_LENGTH 33 }; 34 35 #define RMNET_MAP_COMMAND_REQUEST 0 36 #define RMNET_MAP_COMMAND_ACK 1 37 #define RMNET_MAP_COMMAND_UNSUPPORTED 2 38 #define RMNET_MAP_COMMAND_INVALID 3 39 40 #define RMNET_MAP_NO_PAD_BYTES 0 41 #define RMNET_MAP_ADD_PAD_BYTES 1 42 43 struct sk_buff *rmnet_map_deaggregate(struct sk_buff *skb, 44 struct rmnet_port *port); 45 struct rmnet_map_header *rmnet_map_add_map_header(struct sk_buff *skb, 46 int hdrlen, int pad); 47 void rmnet_map_command(struct sk_buff *skb, struct rmnet_port *port); 48 int rmnet_map_checksum_downlink_packet(struct sk_buff *skb, u16 len); 49 void rmnet_map_checksum_uplink_packet(struct sk_buff *skb, 50 struct net_device *orig_dev); 51 52 #endif /* _RMNET_MAP_H_ */ 53