1 /* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
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.
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.
16 struct rmnet_map_control_command {
26 u16 flow_control_seq_num;
33 enum rmnet_map_results {
36 RMNET_MAP_GENERAL_FAILURE,
37 RMNET_MAP_NOT_ENABLED,
38 RMNET_MAP_FAILED_AGGREGATION,
42 enum rmnet_map_commands {
43 RMNET_MAP_COMMAND_NONE,
44 RMNET_MAP_COMMAND_FLOW_DISABLE,
45 RMNET_MAP_COMMAND_FLOW_ENABLE,
46 /* These should always be the last 2 elements */
47 RMNET_MAP_COMMAND_UNKNOWN,
48 RMNET_MAP_COMMAND_ENUM_LENGTH
51 struct rmnet_map_header {
59 #define RMNET_MAP_GET_MUX_ID(Y) (((struct rmnet_map_header *) \
61 #define RMNET_MAP_GET_CD_BIT(Y) (((struct rmnet_map_header *) \
63 #define RMNET_MAP_GET_PAD(Y) (((struct rmnet_map_header *) \
65 #define RMNET_MAP_GET_CMD_START(Y) ((struct rmnet_map_control_command *) \
67 sizeof(struct rmnet_map_header)))
68 #define RMNET_MAP_GET_LENGTH(Y) (ntohs(((struct rmnet_map_header *) \
71 #define RMNET_MAP_COMMAND_REQUEST 0
72 #define RMNET_MAP_COMMAND_ACK 1
73 #define RMNET_MAP_COMMAND_UNSUPPORTED 2
74 #define RMNET_MAP_COMMAND_INVALID 3
76 #define RMNET_MAP_NO_PAD_BYTES 0
77 #define RMNET_MAP_ADD_PAD_BYTES 1
79 u8 rmnet_map_demultiplex(struct sk_buff *skb);
80 struct sk_buff *rmnet_map_deaggregate(struct sk_buff *skb);
81 struct rmnet_map_header *rmnet_map_add_map_header(struct sk_buff *skb,
83 rx_handler_result_t rmnet_map_command(struct sk_buff *skb,
84 struct rmnet_port *port);
86 #endif /* _RMNET_MAP_H_ */