1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef _MSM_IPA_H_
20 #define _MSM_IPA_H_
21 #include <stdint.h>
22 #include <stddef.h>
23 #include <sys/stat.h>
24 #include <linux/ioctl.h>
25 #include <linux/types.h>
26 #include <linux/if_ether.h>
27 #define IPA_IOC_MAGIC 0xCF
28 #define IPA_DEV_NAME "/dev/ipa"
29 #define IPA_NAT_DEV_NAME "ipaNatTable"
30 #define IPA_IPV6CT_DEV_NAME "ipaIpv6CTTable"
31 #define IPA_DFLT_RT_TBL_NAME "ipa_dflt_rt"
32 #define IPA_IOCTL_ADD_HDR 0
33 #define IPA_IOCTL_DEL_HDR 1
34 #define IPA_IOCTL_ADD_RT_RULE 2
35 #define IPA_IOCTL_DEL_RT_RULE 3
36 #define IPA_IOCTL_ADD_FLT_RULE 4
37 #define IPA_IOCTL_DEL_FLT_RULE 5
38 #define IPA_IOCTL_COMMIT_HDR 6
39 #define IPA_IOCTL_RESET_HDR 7
40 #define IPA_IOCTL_COMMIT_RT 8
41 #define IPA_IOCTL_RESET_RT 9
42 #define IPA_IOCTL_COMMIT_FLT 10
43 #define IPA_IOCTL_RESET_FLT 11
44 #define IPA_IOCTL_DUMP 12
45 #define IPA_IOCTL_GET_RT_TBL 13
46 #define IPA_IOCTL_PUT_RT_TBL 14
47 #define IPA_IOCTL_COPY_HDR 15
48 #define IPA_IOCTL_QUERY_INTF 16
49 #define IPA_IOCTL_QUERY_INTF_TX_PROPS 17
50 #define IPA_IOCTL_QUERY_INTF_RX_PROPS 18
51 #define IPA_IOCTL_GET_HDR 19
52 #define IPA_IOCTL_PUT_HDR 20
53 #define IPA_IOCTL_SET_FLT 21
54 #define IPA_IOCTL_ALLOC_NAT_MEM 22
55 #define IPA_IOCTL_V4_INIT_NAT 23
56 #define IPA_IOCTL_TABLE_DMA_CMD 24
57 #define IPA_IOCTL_NAT_DMA IPA_IOCTL_TABLE_DMA_CMD
58 #define IPA_IOCTL_INIT_IPV6CT_TABLE 25
59 #define IPA_IOCTL_V4_DEL_NAT 26
60 #define IPA_IOCTL_PULL_MSG 27
61 #define IPA_IOCTL_GET_NAT_OFFSET 28
62 #define IPA_IOCTL_RM_ADD_DEPENDENCY 29
63 #define IPA_IOCTL_RM_DEL_DEPENDENCY 30
64 #define IPA_IOCTL_GENERATE_FLT_EQ 31
65 #define IPA_IOCTL_QUERY_INTF_EXT_PROPS 32
66 #define IPA_IOCTL_QUERY_EP_MAPPING 33
67 #define IPA_IOCTL_QUERY_RT_TBL_INDEX 34
68 #define IPA_IOCTL_WRITE_QMAPID 35
69 #define IPA_IOCTL_MDFY_FLT_RULE 36
70 #define IPA_IOCTL_NOTIFY_WAN_UPSTREAM_ROUTE_ADD 37
71 #define IPA_IOCTL_NOTIFY_WAN_UPSTREAM_ROUTE_DEL 38
72 #define IPA_IOCTL_NOTIFY_WAN_EMBMS_CONNECTED 39
73 #define IPA_IOCTL_ADD_HDR_PROC_CTX 40
74 #define IPA_IOCTL_DEL_HDR_PROC_CTX 41
75 #define IPA_IOCTL_MDFY_RT_RULE 42
76 #define IPA_IOCTL_ADD_RT_RULE_AFTER 43
77 #define IPA_IOCTL_ADD_FLT_RULE_AFTER 44
78 #define IPA_IOCTL_GET_HW_VERSION 45
79 #define IPA_IOCTL_ADD_RT_RULE_EXT 46
80 #define IPA_IOCTL_ADD_VLAN_IFACE 47
81 #define IPA_IOCTL_DEL_VLAN_IFACE 48
82 #define IPA_IOCTL_ADD_L2TP_VLAN_MAPPING 49
83 #define IPA_IOCTL_DEL_L2TP_VLAN_MAPPING 50
84 #define IPA_IOCTL_NAT_MODIFY_PDN 51
85 #define IPA_IOCTL_ALLOC_NAT_TABLE 52
86 #define IPA_IOCTL_ALLOC_IPV6CT_TABLE 53
87 #define IPA_IOCTL_DEL_NAT_TABLE 54
88 #define IPA_IOCTL_DEL_IPV6CT_TABLE 55
89 #define IPA_IOCTL_CLEANUP 56
90 #define IPA_IOCTL_QUERY_WLAN_CLIENT 57
91 #define IPA_IOCTL_GET_VLAN_MODE 58
92 #define IPA_HDR_MAX_SIZE 64
93 #define IPA_RESOURCE_NAME_MAX 32
94 #define IPA_NUM_PROPS_MAX 35
95 #define IPA_MAC_ADDR_SIZE 6
96 #define IPA_MBIM_MAX_STREAM_NUM 8
97 #define IPA_WAN_MSG_IPv6_ADDR_GW_LEN 4
98 #define IPA_MAX_NUM_HW_PATH_CLIENTS 16
99 #define QMI_IPA_MAX_CLIENT_DST_PIPES 4
100 #define IPA_FLT_TOS (1ul << 0)
101 #define IPA_FLT_PROTOCOL (1ul << 1)
102 #define IPA_FLT_SRC_ADDR (1ul << 2)
103 #define IPA_FLT_DST_ADDR (1ul << 3)
104 #define IPA_FLT_SRC_PORT_RANGE (1ul << 4)
105 #define IPA_FLT_DST_PORT_RANGE (1ul << 5)
106 #define IPA_FLT_TYPE (1ul << 6)
107 #define IPA_FLT_CODE (1ul << 7)
108 #define IPA_FLT_SPI (1ul << 8)
109 #define IPA_FLT_SRC_PORT (1ul << 9)
110 #define IPA_FLT_DST_PORT (1ul << 10)
111 #define IPA_FLT_TC (1ul << 11)
112 #define IPA_FLT_FLOW_LABEL (1ul << 12)
113 #define IPA_FLT_NEXT_HDR (1ul << 13)
114 #define IPA_FLT_META_DATA (1ul << 14)
115 #define IPA_FLT_FRAGMENT (1ul << 15)
116 #define IPA_FLT_TOS_MASKED (1ul << 16)
117 #define IPA_FLT_MAC_SRC_ADDR_ETHER_II (1ul << 17)
118 #define IPA_FLT_MAC_DST_ADDR_ETHER_II (1ul << 18)
119 #define IPA_FLT_MAC_SRC_ADDR_802_3 (1ul << 19)
120 #define IPA_FLT_MAC_DST_ADDR_802_3 (1ul << 20)
121 #define IPA_FLT_MAC_ETHER_TYPE (1ul << 21)
122 #define IPA_FLT_MAC_DST_ADDR_L2TP (1ul << 22)
123 #define IPA_FLT_TCP_SYN (1ul << 23)
124 #define IPA_FLT_TCP_SYN_L2TP (1ul << 24)
125 #define IPA_FLT_L2TP_INNER_IP_TYPE (1ul << 25)
126 #define IPA_FLT_L2TP_INNER_IPV4_DST_ADDR (1ul << 26)
127 #define IPA_MAX_PDN_NUM 5
128 enum ipa_client_type {
129   IPA_CLIENT_HSIC1_PROD = 0,
130   IPA_CLIENT_HSIC1_CONS = 1,
131   IPA_CLIENT_HSIC2_PROD = 2,
132   IPA_CLIENT_HSIC2_CONS = 3,
133   IPA_CLIENT_HSIC3_PROD = 4,
134   IPA_CLIENT_HSIC3_CONS = 5,
135   IPA_CLIENT_HSIC4_PROD = 6,
136   IPA_CLIENT_HSIC4_CONS = 7,
137   IPA_CLIENT_HSIC5_PROD = 8,
138   IPA_CLIENT_HSIC5_CONS = 9,
139   IPA_CLIENT_WLAN1_PROD = 10,
140   IPA_CLIENT_WLAN1_CONS = 11,
141   IPA_CLIENT_A5_WLAN_AMPDU_PROD = 12,
142   IPA_CLIENT_WLAN2_CONS = 13,
143   IPA_CLIENT_WLAN3_CONS = 15,
144   IPA_CLIENT_WLAN4_CONS = 17,
145   IPA_CLIENT_USB_PROD = 18,
146   IPA_CLIENT_USB_CONS = 19,
147   IPA_CLIENT_USB2_PROD = 20,
148   IPA_CLIENT_USB2_CONS = 21,
149   IPA_CLIENT_USB3_PROD = 22,
150   IPA_CLIENT_USB3_CONS = 23,
151   IPA_CLIENT_USB4_PROD = 24,
152   IPA_CLIENT_USB4_CONS = 25,
153   IPA_CLIENT_UC_USB_PROD = 26,
154   IPA_CLIENT_USB_DPL_CONS = 27,
155   IPA_CLIENT_A2_EMBEDDED_PROD = 28,
156   IPA_CLIENT_A2_EMBEDDED_CONS = 29,
157   IPA_CLIENT_A2_TETHERED_PROD = 30,
158   IPA_CLIENT_A2_TETHERED_CONS = 31,
159   IPA_CLIENT_APPS_LAN_PROD = 32,
160   IPA_CLIENT_APPS_LAN_CONS = 33,
161   IPA_CLIENT_APPS_WAN_PROD = 34,
162   IPA_CLIENT_APPS_LAN_WAN_PROD = IPA_CLIENT_APPS_WAN_PROD,
163   IPA_CLIENT_APPS_WAN_CONS = 35,
164   IPA_CLIENT_APPS_CMD_PROD = 36,
165   IPA_CLIENT_A5_LAN_WAN_CONS = 37,
166   IPA_CLIENT_ODU_PROD = 38,
167   IPA_CLIENT_ODU_EMB_CONS = 39,
168   IPA_CLIENT_ODU_TETH_CONS = 41,
169   IPA_CLIENT_MHI_PROD = 42,
170   IPA_CLIENT_MHI_CONS = 43,
171   IPA_CLIENT_MEMCPY_DMA_SYNC_PROD = 44,
172   IPA_CLIENT_MEMCPY_DMA_SYNC_CONS = 45,
173   IPA_CLIENT_MEMCPY_DMA_ASYNC_PROD = 46,
174   IPA_CLIENT_MEMCPY_DMA_ASYNC_CONS = 47,
175   IPA_CLIENT_ETHERNET_PROD = 48,
176   IPA_CLIENT_ETHERNET_CONS = 49,
177   IPA_CLIENT_Q6_LAN_PROD = 50,
178   IPA_CLIENT_Q6_LAN_CONS = 51,
179   IPA_CLIENT_Q6_WAN_PROD = 52,
180   IPA_CLIENT_Q6_WAN_CONS = 53,
181   IPA_CLIENT_Q6_CMD_PROD = 54,
182   IPA_CLIENT_Q6_DUN_CONS = 55,
183   IPA_CLIENT_Q6_DECOMP_PROD = 56,
184   IPA_CLIENT_Q6_DECOMP_CONS = 57,
185   IPA_CLIENT_Q6_DECOMP2_PROD = 58,
186   IPA_CLIENT_Q6_DECOMP2_CONS = 59,
187   IPA_CLIENT_Q6_LTE_WIFI_AGGR_CONS = 61,
188   IPA_CLIENT_TEST_PROD = 62,
189   IPA_CLIENT_TEST_CONS = 63,
190   IPA_CLIENT_TEST1_PROD = 64,
191   IPA_CLIENT_TEST1_CONS = 65,
192   IPA_CLIENT_TEST2_PROD = 66,
193   IPA_CLIENT_TEST2_CONS = 67,
194   IPA_CLIENT_TEST3_PROD = 68,
195   IPA_CLIENT_TEST3_CONS = 69,
196   IPA_CLIENT_TEST4_PROD = 70,
197   IPA_CLIENT_TEST4_CONS = 71,
198   IPA_CLIENT_DUMMY_CONS = 73
199 };
200 #define IPA_CLIENT_MAX (IPA_CLIENT_DUMMY_CONS + 1)
201 #define IPA_CLIENT_IS_APPS_CONS(client) ((client) == IPA_CLIENT_APPS_LAN_CONS || (client) == IPA_CLIENT_APPS_WAN_CONS)
202 #define IPA_CLIENT_IS_USB_CONS(client) ((client) == IPA_CLIENT_USB_CONS || (client) == IPA_CLIENT_USB2_CONS || (client) == IPA_CLIENT_USB3_CONS || (client) == IPA_CLIENT_USB_DPL_CONS || (client) == IPA_CLIENT_USB4_CONS)
203 #define IPA_CLIENT_IS_WLAN_CONS(client) ((client) == IPA_CLIENT_WLAN1_CONS || (client) == IPA_CLIENT_WLAN2_CONS || (client) == IPA_CLIENT_WLAN3_CONS || (client) == IPA_CLIENT_WLAN4_CONS)
204 #define IPA_CLIENT_IS_ODU_CONS(client) ((client) == IPA_CLIENT_ODU_EMB_CONS || (client) == IPA_CLIENT_ODU_TETH_CONS)
205 #define IPA_CLIENT_IS_Q6_CONS(client) ((client) == IPA_CLIENT_Q6_LAN_CONS || (client) == IPA_CLIENT_Q6_WAN_CONS || (client) == IPA_CLIENT_Q6_DUN_CONS || (client) == IPA_CLIENT_Q6_DECOMP_CONS || (client) == IPA_CLIENT_Q6_DECOMP2_CONS || (client) == IPA_CLIENT_Q6_LTE_WIFI_AGGR_CONS)
206 #define IPA_CLIENT_IS_Q6_PROD(client) ((client) == IPA_CLIENT_Q6_LAN_PROD || (client) == IPA_CLIENT_Q6_WAN_PROD || (client) == IPA_CLIENT_Q6_CMD_PROD || (client) == IPA_CLIENT_Q6_DECOMP_PROD || (client) == IPA_CLIENT_Q6_DECOMP2_PROD)
207 #define IPA_CLIENT_IS_Q6_NON_ZIP_CONS(client) ((client) == IPA_CLIENT_Q6_LAN_CONS || (client) == IPA_CLIENT_Q6_WAN_CONS || (client) == IPA_CLIENT_Q6_DUN_CONS || (client) == IPA_CLIENT_Q6_LTE_WIFI_AGGR_CONS)
208 #define IPA_CLIENT_IS_Q6_ZIP_CONS(client) ((client) == IPA_CLIENT_Q6_DECOMP_CONS || (client) == IPA_CLIENT_Q6_DECOMP2_CONS)
209 #define IPA_CLIENT_IS_Q6_NON_ZIP_PROD(client) ((client) == IPA_CLIENT_Q6_LAN_PROD || (client) == IPA_CLIENT_Q6_WAN_PROD || (client) == IPA_CLIENT_Q6_CMD_PROD)
210 #define IPA_CLIENT_IS_Q6_ZIP_PROD(client) ((client) == IPA_CLIENT_Q6_DECOMP_PROD || (client) == IPA_CLIENT_Q6_DECOMP2_PROD)
211 #define IPA_CLIENT_IS_MEMCPY_DMA_CONS(client) ((client) == IPA_CLIENT_MEMCPY_DMA_SYNC_CONS || (client) == IPA_CLIENT_MEMCPY_DMA_ASYNC_CONS)
212 #define IPA_CLIENT_IS_MEMCPY_DMA_PROD(client) ((client) == IPA_CLIENT_MEMCPY_DMA_SYNC_PROD || (client) == IPA_CLIENT_MEMCPY_DMA_ASYNC_PROD)
213 #define IPA_CLIENT_IS_MHI_CONS(client) ((client) == IPA_CLIENT_MHI_CONS)
214 #define IPA_CLIENT_IS_MHI(client) ((client) == IPA_CLIENT_MHI_CONS || (client) == IPA_CLIENT_MHI_PROD)
215 #define IPA_CLIENT_IS_TEST_PROD(client) ((client) == IPA_CLIENT_TEST_PROD || (client) == IPA_CLIENT_TEST1_PROD || (client) == IPA_CLIENT_TEST2_PROD || (client) == IPA_CLIENT_TEST3_PROD || (client) == IPA_CLIENT_TEST4_PROD)
216 #define IPA_CLIENT_IS_TEST_CONS(client) ((client) == IPA_CLIENT_TEST_CONS || (client) == IPA_CLIENT_TEST1_CONS || (client) == IPA_CLIENT_TEST2_CONS || (client) == IPA_CLIENT_TEST3_CONS || (client) == IPA_CLIENT_TEST4_CONS)
217 #define IPA_CLIENT_IS_TEST(client) (IPA_CLIENT_IS_TEST_PROD(client) || IPA_CLIENT_IS_TEST_CONS(client))
218 enum ipa_ip_type {
219   IPA_IP_v4,
220   IPA_IP_v6,
221   IPA_IP_MAX
222 };
223 enum ipa_rule_type {
224   IPA_RULE_HASHABLE,
225   IPA_RULE_NON_HASHABLE,
226 };
227 #define IPA_RULE_TYPE_MAX (IPA_RULE_NON_HASHABLE + 1)
228 enum ipa_flt_action {
229   IPA_PASS_TO_ROUTING,
230   IPA_PASS_TO_SRC_NAT,
231   IPA_PASS_TO_DST_NAT,
232   IPA_PASS_TO_EXCEPTION
233 };
234 enum ipa_wlan_event {
235   WLAN_CLIENT_CONNECT,
236   WLAN_CLIENT_DISCONNECT,
237   WLAN_CLIENT_POWER_SAVE_MODE,
238   WLAN_CLIENT_NORMAL_MODE,
239   SW_ROUTING_ENABLE,
240   SW_ROUTING_DISABLE,
241   WLAN_AP_CONNECT,
242   WLAN_AP_DISCONNECT,
243   WLAN_STA_CONNECT,
244   WLAN_STA_DISCONNECT,
245   WLAN_CLIENT_CONNECT_EX,
246   WLAN_SWITCH_TO_SCC,
247   WLAN_SWITCH_TO_MCC,
248   WLAN_WDI_ENABLE,
249   WLAN_WDI_DISABLE,
250   IPA_WLAN_EVENT_MAX
251 };
252 enum ipa_wan_event {
253   WAN_UPSTREAM_ROUTE_ADD = IPA_WLAN_EVENT_MAX,
254   WAN_UPSTREAM_ROUTE_DEL,
255   WAN_EMBMS_CONNECT,
256   WAN_XLAT_CONNECT,
257   IPA_WAN_EVENT_MAX
258 };
259 enum ipa_ecm_event {
260   ECM_CONNECT = IPA_WAN_EVENT_MAX,
261   ECM_DISCONNECT,
262   IPA_ECM_EVENT_MAX,
263 };
264 enum ipa_tethering_stats_event {
265   IPA_TETHERING_STATS_UPDATE_STATS = IPA_ECM_EVENT_MAX,
266   IPA_TETHERING_STATS_UPDATE_NETWORK_STATS,
267   IPA_TETHERING_STATS_EVENT_MAX,
268 };
269 enum ipa_quota_event {
270   IPA_QUOTA_REACH = IPA_TETHERING_STATS_EVENT_MAX,
271   IPA_QUOTA_EVENT_MAX,
272 };
273 enum ipa_ssr_event {
274   IPA_SSR_BEFORE_SHUTDOWN = IPA_QUOTA_EVENT_MAX,
275   IPA_SSR_AFTER_POWERUP,
276   IPA_SSR_EVENT_MAX
277 };
278 enum ipa_vlan_l2tp_event {
279   ADD_VLAN_IFACE = IPA_SSR_EVENT_MAX,
280   DEL_VLAN_IFACE,
281   ADD_L2TP_VLAN_MAPPING,
282   DEL_L2TP_VLAN_MAPPING,
283   IPA_VLAN_L2TP_EVENT_MAX,
284 };
285 enum ipa_per_client_stats_event {
286   IPA_PER_CLIENT_STATS_CONNECT_EVENT = IPA_VLAN_L2TP_EVENT_MAX,
287   IPA_PER_CLIENT_STATS_DISCONNECT_EVENT,
288   IPA_PER_CLIENT_STATS_EVENT_MAX
289 };
290 enum ipa_wlan_fw_ssr_event {
291   WLAN_FWR_SSR_BEFORE_SHUTDOWN = IPA_PER_CLIENT_STATS_EVENT_MAX,
292   IPA_WLAN_FW_SSR_EVENT_MAX,
293 #define IPA_WLAN_FW_SSR_EVENT_MAX IPA_WLAN_FW_SSR_EVENT_MAX
294 };
295 #define IPA_EVENT_MAX_NUM (IPA_WLAN_FW_SSR_EVENT_MAX)
296 #define IPA_EVENT_MAX ((int) IPA_EVENT_MAX_NUM)
297 enum ipa_rm_resource_name {
298   IPA_RM_RESOURCE_Q6_PROD = 0,
299   IPA_RM_RESOURCE_Q6_CONS = 1,
300   IPA_RM_RESOURCE_USB_PROD = 2,
301   IPA_RM_RESOURCE_USB_CONS = 3,
302   IPA_RM_RESOURCE_USB_DPL_DUMMY_PROD = 4,
303   IPA_RM_RESOURCE_USB_DPL_CONS = 5,
304   IPA_RM_RESOURCE_HSIC_PROD = 6,
305   IPA_RM_RESOURCE_HSIC_CONS = 7,
306   IPA_RM_RESOURCE_STD_ECM_PROD = 8,
307   IPA_RM_RESOURCE_APPS_CONS = 9,
308   IPA_RM_RESOURCE_RNDIS_PROD = 10,
309   IPA_RM_RESOURCE_WWAN_0_PROD = 12,
310   IPA_RM_RESOURCE_WLAN_PROD = 14,
311   IPA_RM_RESOURCE_WLAN_CONS = 15,
312   IPA_RM_RESOURCE_ODU_ADAPT_PROD = 16,
313   IPA_RM_RESOURCE_ODU_ADAPT_CONS = 17,
314   IPA_RM_RESOURCE_MHI_PROD = 18,
315   IPA_RM_RESOURCE_MHI_CONS = 19,
316   IPA_RM_RESOURCE_ETHERNET_PROD = 20,
317   IPA_RM_RESOURCE_ETHERNET_CONS = 21,
318 };
319 #define IPA_RM_RESOURCE_MAX (IPA_RM_RESOURCE_ETHERNET_CONS + 1)
320 enum ipa_hw_type {
321   IPA_HW_None = 0,
322   IPA_HW_v1_0 = 1,
323   IPA_HW_v1_1 = 2,
324   IPA_HW_v2_0 = 3,
325   IPA_HW_v2_1 = 4,
326   IPA_HW_v2_5 = 5,
327   IPA_HW_v2_6 = IPA_HW_v2_5,
328   IPA_HW_v2_6L = 6,
329   IPA_HW_v3_0 = 10,
330   IPA_HW_v3_1 = 11,
331   IPA_HW_v3_5 = 12,
332   IPA_HW_v3_5_1 = 13,
333   IPA_HW_v4_0 = 14,
334 };
335 #define IPA_HW_MAX (IPA_HW_v4_0 + 1)
336 #define IPA_HW_v4_0 IPA_HW_v4_0
337 struct ipa_rule_attrib {
338   uint32_t attrib_mask;
339   uint16_t src_port_lo;
340   uint16_t src_port_hi;
341   uint16_t dst_port_lo;
342   uint16_t dst_port_hi;
343   uint8_t type;
344   uint8_t code;
345   uint8_t tos_value;
346   uint8_t tos_mask;
347   uint32_t spi;
348   uint16_t src_port;
349   uint16_t dst_port;
350   uint32_t meta_data;
351   uint32_t meta_data_mask;
352   uint8_t src_mac_addr[ETH_ALEN];
353   uint8_t src_mac_addr_mask[ETH_ALEN];
354   uint8_t dst_mac_addr[ETH_ALEN];
355   uint8_t dst_mac_addr_mask[ETH_ALEN];
356   uint16_t ether_type;
357   union {
358     struct {
359       uint8_t tos;
360       uint8_t protocol;
361       uint32_t src_addr;
362       uint32_t src_addr_mask;
363       uint32_t dst_addr;
364       uint32_t dst_addr_mask;
365     } v4;
366     struct {
367       uint8_t tc;
368       uint32_t flow_label;
369       uint8_t next_hdr;
370       uint32_t src_addr[4];
371       uint32_t src_addr_mask[4];
372       uint32_t dst_addr[4];
373       uint32_t dst_addr_mask[4];
374     } v6;
375   } u;
376 };
377 #define IPA_IPFLTR_NUM_MEQ_32_EQNS 2
378 #define IPA_IPFLTR_NUM_IHL_MEQ_32_EQNS 2
379 #define IPA_IPFLTR_NUM_MEQ_128_EQNS 2
380 #define IPA_IPFLTR_NUM_IHL_RANGE_16_EQNS 2
381 struct ipa_ipfltr_eq_16 {
382   int8_t offset;
383   uint16_t value;
384 };
385 struct ipa_ipfltr_eq_32 {
386   int8_t offset;
387   uint32_t value;
388 };
389 struct ipa_ipfltr_mask_eq_128 {
390   int8_t offset;
391   uint8_t mask[16];
392   uint8_t value[16];
393 };
394 struct ipa_ipfltr_mask_eq_32 {
395   int8_t offset;
396   uint32_t mask;
397   uint32_t value;
398 };
399 struct ipa_ipfltr_range_eq_16 {
400   int8_t offset;
401   uint16_t range_low;
402   uint16_t range_high;
403 };
404 struct ipa_ipfltri_rule_eq {
405   uint16_t rule_eq_bitmap;
406   uint8_t tos_eq_present;
407   uint8_t tos_eq;
408   uint8_t protocol_eq_present;
409   uint8_t protocol_eq;
410   uint8_t num_ihl_offset_range_16;
411   struct ipa_ipfltr_range_eq_16 ihl_offset_range_16[IPA_IPFLTR_NUM_IHL_RANGE_16_EQNS];
412   uint8_t num_offset_meq_32;
413   struct ipa_ipfltr_mask_eq_32 offset_meq_32[IPA_IPFLTR_NUM_MEQ_32_EQNS];
414   uint8_t tc_eq_present;
415   uint8_t tc_eq;
416   uint8_t fl_eq_present;
417   uint32_t fl_eq;
418   uint8_t ihl_offset_eq_16_present;
419   struct ipa_ipfltr_eq_16 ihl_offset_eq_16;
420   uint8_t ihl_offset_eq_32_present;
421   struct ipa_ipfltr_eq_32 ihl_offset_eq_32;
422   uint8_t num_ihl_offset_meq_32;
423   struct ipa_ipfltr_mask_eq_32 ihl_offset_meq_32[IPA_IPFLTR_NUM_IHL_MEQ_32_EQNS];
424   uint8_t num_offset_meq_128;
425   struct ipa_ipfltr_mask_eq_128 offset_meq_128[IPA_IPFLTR_NUM_MEQ_128_EQNS];
426   uint8_t metadata_meq32_present;
427   struct ipa_ipfltr_mask_eq_32 metadata_meq32;
428   uint8_t ipv4_frag_eq_present;
429 };
430 struct ipa_flt_rule {
431   uint8_t retain_hdr;
432   uint8_t to_uc;
433   enum ipa_flt_action action;
434   uint32_t rt_tbl_hdl;
435   struct ipa_rule_attrib attrib;
436   struct ipa_ipfltri_rule_eq eq_attrib;
437   uint32_t rt_tbl_idx;
438   uint8_t eq_attrib_type;
439   uint8_t max_prio;
440   uint8_t hashable;
441   uint16_t rule_id;
442   uint8_t set_metadata;
443   uint8_t pdn_idx;
444 };
445 enum ipa_hdr_l2_type {
446   IPA_HDR_L2_NONE,
447   IPA_HDR_L2_ETHERNET_II,
448   IPA_HDR_L2_802_3,
449   IPA_HDR_L2_802_1Q,
450 };
451 #define IPA_HDR_L2_MAX (IPA_HDR_L2_802_1Q + 1)
452 #define IPA_HDR_L2_802_1Q IPA_HDR_L2_802_1Q
453 enum ipa_hdr_proc_type {
454   IPA_HDR_PROC_NONE,
455   IPA_HDR_PROC_ETHII_TO_ETHII,
456   IPA_HDR_PROC_ETHII_TO_802_3,
457   IPA_HDR_PROC_802_3_TO_ETHII,
458   IPA_HDR_PROC_802_3_TO_802_3,
459   IPA_HDR_PROC_L2TP_HEADER_ADD,
460   IPA_HDR_PROC_L2TP_HEADER_REMOVE
461 };
462 #define IPA_HDR_PROC_MAX (IPA_HDR_PROC_L2TP_HEADER_REMOVE + 1)
463 struct ipa_rt_rule {
464   enum ipa_client_type dst;
465   uint32_t hdr_hdl;
466   uint32_t hdr_proc_ctx_hdl;
467   struct ipa_rule_attrib attrib;
468   uint8_t max_prio;
469   uint8_t hashable;
470   uint8_t retain_hdr;
471 };
472 struct ipa_hdr_add {
473   char name[IPA_RESOURCE_NAME_MAX];
474   uint8_t hdr[IPA_HDR_MAX_SIZE];
475   uint8_t hdr_len;
476   enum ipa_hdr_l2_type type;
477   uint8_t is_partial;
478   uint32_t hdr_hdl;
479   int status;
480   uint8_t is_eth2_ofst_valid;
481   uint16_t eth2_ofst;
482 };
483 struct ipa_ioc_add_hdr {
484   uint8_t commit;
485   uint8_t num_hdrs;
486   struct ipa_hdr_add hdr[0];
487 };
488 struct ipa_l2tp_header_add_procparams {
489   uint32_t eth_hdr_retained : 1;
490   uint32_t input_ip_version : 1;
491   uint32_t output_ip_version : 1;
492   uint32_t reserved : 29;
493 };
494 struct ipa_l2tp_header_remove_procparams {
495   uint32_t hdr_len_remove : 8;
496   uint32_t eth_hdr_retained : 1;
497   uint32_t hdr_ofst_pkt_size_valid : 1;
498   uint32_t hdr_ofst_pkt_size : 6;
499   uint32_t hdr_endianness : 1;
500   uint32_t reserved : 15;
501 };
502 struct ipa_l2tp_hdr_proc_ctx_params {
503   struct ipa_l2tp_header_add_procparams hdr_add_param;
504   struct ipa_l2tp_header_remove_procparams hdr_remove_param;
505   uint8_t is_dst_pipe_valid;
506   enum ipa_client_type dst_pipe;
507 };
508 #define L2TP_USER_SPACE_SPECIFY_DST_PIPE
509 struct ipa_hdr_proc_ctx_add {
510   enum ipa_hdr_proc_type type;
511   uint32_t hdr_hdl;
512   uint32_t proc_ctx_hdl;
513   int status;
514   struct ipa_l2tp_hdr_proc_ctx_params l2tp_params;
515 };
516 #define IPA_L2TP_HDR_PROC_SUPPORT
517 struct ipa_ioc_add_hdr_proc_ctx {
518   uint8_t commit;
519   uint8_t num_proc_ctxs;
520   struct ipa_hdr_proc_ctx_add proc_ctx[0];
521 };
522 struct ipa_ioc_copy_hdr {
523   char name[IPA_RESOURCE_NAME_MAX];
524   uint8_t hdr[IPA_HDR_MAX_SIZE];
525   uint8_t hdr_len;
526   enum ipa_hdr_l2_type type;
527   uint8_t is_partial;
528   uint8_t is_eth2_ofst_valid;
529   uint16_t eth2_ofst;
530 };
531 struct ipa_ioc_get_hdr {
532   char name[IPA_RESOURCE_NAME_MAX];
533   uint32_t hdl;
534 };
535 struct ipa_hdr_del {
536   uint32_t hdl;
537   int status;
538 };
539 struct ipa_ioc_del_hdr {
540   uint8_t commit;
541   uint8_t num_hdls;
542   struct ipa_hdr_del hdl[0];
543 };
544 struct ipa_hdr_proc_ctx_del {
545   uint32_t hdl;
546   int status;
547 };
548 struct ipa_ioc_del_hdr_proc_ctx {
549   uint8_t commit;
550   uint8_t num_hdls;
551   struct ipa_hdr_proc_ctx_del hdl[0];
552 };
553 struct ipa_rt_rule_add {
554   struct ipa_rt_rule rule;
555   uint8_t at_rear;
556   uint32_t rt_rule_hdl;
557   int status;
558 };
559 struct ipa_ioc_add_rt_rule {
560   uint8_t commit;
561   enum ipa_ip_type ip;
562   char rt_tbl_name[IPA_RESOURCE_NAME_MAX];
563   uint8_t num_rules;
564   struct ipa_rt_rule_add rules[0];
565 };
566 struct ipa_ioc_add_rt_rule_after {
567   uint8_t commit;
568   enum ipa_ip_type ip;
569   char rt_tbl_name[IPA_RESOURCE_NAME_MAX];
570   uint8_t num_rules;
571   uint32_t add_after_hdl;
572   struct ipa_rt_rule_add rules[0];
573 };
574 struct ipa_rt_rule_mdfy {
575   struct ipa_rt_rule rule;
576   uint32_t rt_rule_hdl;
577   int status;
578 };
579 struct ipa_ioc_mdfy_rt_rule {
580   uint8_t commit;
581   enum ipa_ip_type ip;
582   uint8_t num_rules;
583   struct ipa_rt_rule_mdfy rules[0];
584 };
585 struct ipa_rt_rule_del {
586   uint32_t hdl;
587   int status;
588 };
589 struct ipa_rt_rule_add_ext {
590   struct ipa_rt_rule rule;
591   uint8_t at_rear;
592   uint32_t rt_rule_hdl;
593   int status;
594   uint16_t rule_id;
595 };
596 struct ipa_ioc_add_rt_rule_ext {
597   uint8_t commit;
598   enum ipa_ip_type ip;
599   char rt_tbl_name[IPA_RESOURCE_NAME_MAX];
600   uint8_t num_rules;
601   struct ipa_rt_rule_add_ext rules[0];
602 };
603 struct ipa_ioc_del_rt_rule {
604   uint8_t commit;
605   enum ipa_ip_type ip;
606   uint8_t num_hdls;
607   struct ipa_rt_rule_del hdl[0];
608 };
609 struct ipa_ioc_get_rt_tbl_indx {
610   enum ipa_ip_type ip;
611   char name[IPA_RESOURCE_NAME_MAX];
612   uint32_t idx;
613 };
614 struct ipa_flt_rule_add {
615   struct ipa_flt_rule rule;
616   uint8_t at_rear;
617   uint32_t flt_rule_hdl;
618   int status;
619 };
620 struct ipa_ioc_add_flt_rule {
621   uint8_t commit;
622   enum ipa_ip_type ip;
623   enum ipa_client_type ep;
624   uint8_t global;
625   uint8_t num_rules;
626   struct ipa_flt_rule_add rules[0];
627 };
628 struct ipa_ioc_add_flt_rule_after {
629   uint8_t commit;
630   enum ipa_ip_type ip;
631   enum ipa_client_type ep;
632   uint8_t num_rules;
633   uint32_t add_after_hdl;
634   struct ipa_flt_rule_add rules[0];
635 };
636 struct ipa_flt_rule_mdfy {
637   struct ipa_flt_rule rule;
638   uint32_t rule_hdl;
639   int status;
640 };
641 struct ipa_ioc_mdfy_flt_rule {
642   uint8_t commit;
643   enum ipa_ip_type ip;
644   uint8_t num_rules;
645   struct ipa_flt_rule_mdfy rules[0];
646 };
647 struct ipa_flt_rule_del {
648   uint32_t hdl;
649   int status;
650 };
651 struct ipa_ioc_del_flt_rule {
652   uint8_t commit;
653   enum ipa_ip_type ip;
654   uint8_t num_hdls;
655   struct ipa_flt_rule_del hdl[0];
656 };
657 struct ipa_ioc_get_rt_tbl {
658   enum ipa_ip_type ip;
659   char name[IPA_RESOURCE_NAME_MAX];
660   uint32_t hdl;
661 };
662 struct ipa_ioc_query_intf {
663   char name[IPA_RESOURCE_NAME_MAX];
664   uint32_t num_tx_props;
665   uint32_t num_rx_props;
666   uint32_t num_ext_props;
667   enum ipa_client_type excp_pipe;
668 };
669 struct ipa_ioc_tx_intf_prop {
670   enum ipa_ip_type ip;
671   struct ipa_rule_attrib attrib;
672   enum ipa_client_type dst_pipe;
673   enum ipa_client_type alt_dst_pipe;
674   char hdr_name[IPA_RESOURCE_NAME_MAX];
675   enum ipa_hdr_l2_type hdr_l2_type;
676 };
677 struct ipa_ioc_query_intf_tx_props {
678   char name[IPA_RESOURCE_NAME_MAX];
679   uint32_t num_tx_props;
680   struct ipa_ioc_tx_intf_prop tx[0];
681 };
682 struct ipa_ioc_ext_intf_prop {
683   enum ipa_ip_type ip;
684   struct ipa_ipfltri_rule_eq eq_attrib;
685   enum ipa_flt_action action;
686   uint32_t rt_tbl_idx;
687   uint8_t mux_id;
688   uint32_t filter_hdl;
689   uint8_t is_xlat_rule;
690   uint32_t rule_id;
691   uint8_t is_rule_hashable;
692 };
693 struct ipa_ioc_query_intf_ext_props {
694   char name[IPA_RESOURCE_NAME_MAX];
695   uint32_t num_ext_props;
696   struct ipa_ioc_ext_intf_prop ext[0];
697 };
698 struct ipa_ioc_rx_intf_prop {
699   enum ipa_ip_type ip;
700   struct ipa_rule_attrib attrib;
701   enum ipa_client_type src_pipe;
702   enum ipa_hdr_l2_type hdr_l2_type;
703 };
704 struct ipa_ioc_query_intf_rx_props {
705   char name[IPA_RESOURCE_NAME_MAX];
706   uint32_t num_rx_props;
707   struct ipa_ioc_rx_intf_prop rx[0];
708 };
709 struct ipa_ioc_nat_alloc_mem {
710   char dev_name[IPA_RESOURCE_NAME_MAX];
711   size_t size;
712   off_t offset;
713 };
714 struct ipa_ioc_nat_ipv6ct_table_alloc {
715   size_t size;
716   off_t offset;
717 };
718 struct ipa_ioc_v4_nat_init {
719   uint8_t tbl_index;
720   uint32_t ipv4_rules_offset;
721   uint32_t expn_rules_offset;
722   uint32_t index_offset;
723   uint32_t index_expn_offset;
724   uint16_t table_entries;
725   uint16_t expn_table_entries;
726   uint32_t ip_addr;
727 };
728 struct ipa_ioc_ipv6ct_init {
729   uint32_t base_table_offset;
730   uint32_t expn_table_offset;
731   uint16_t table_entries;
732   uint16_t expn_table_entries;
733   uint8_t tbl_index;
734 };
735 struct ipa_ioc_v4_nat_del {
736   uint8_t table_index;
737   uint32_t public_ip_addr;
738 };
739 struct ipa_ioc_nat_ipv6ct_table_del {
740   uint8_t table_index;
741 };
742 struct ipa_ioc_nat_dma_one {
743   uint8_t table_index;
744   uint8_t base_addr;
745   uint32_t offset;
746   uint16_t data;
747 };
748 struct ipa_ioc_nat_dma_cmd {
749   uint8_t entries;
750   struct ipa_ioc_nat_dma_one dma[0];
751 };
752 struct ipa_ioc_nat_pdn_entry {
753   uint8_t pdn_index;
754   uint32_t public_ip;
755   uint32_t src_metadata;
756   uint32_t dst_metadata;
757 };
758 struct ipa_ioc_vlan_iface_info {
759   char name[IPA_RESOURCE_NAME_MAX];
760   uint8_t vlan_id;
761 };
762 struct ipa_ioc_l2tp_vlan_mapping_info {
763   enum ipa_ip_type iptype;
764   char l2tp_iface_name[IPA_RESOURCE_NAME_MAX];
765   uint8_t l2tp_session_id;
766   char vlan_iface_name[IPA_RESOURCE_NAME_MAX];
767 };
768 struct ipa_msg_meta {
769   uint8_t msg_type;
770   uint8_t rsvd;
771   uint16_t msg_len;
772 };
773 struct ipa_wlan_msg {
774   char name[IPA_RESOURCE_NAME_MAX];
775   uint8_t mac_addr[IPA_MAC_ADDR_SIZE];
776 };
777 enum ipa_wlan_hdr_attrib_type {
778   WLAN_HDR_ATTRIB_MAC_ADDR,
779   WLAN_HDR_ATTRIB_STA_ID
780 };
781 struct ipa_wlan_hdr_attrib_val {
782   enum ipa_wlan_hdr_attrib_type attrib_type;
783   uint8_t offset;
784   union {
785     uint8_t mac_addr[IPA_MAC_ADDR_SIZE];
786     uint8_t sta_id;
787   } u;
788 };
789 struct ipa_wlan_msg_ex {
790   char name[IPA_RESOURCE_NAME_MAX];
791   uint8_t num_of_attribs;
792   struct ipa_wlan_hdr_attrib_val attribs[0];
793 };
794 struct ipa_ecm_msg {
795   char name[IPA_RESOURCE_NAME_MAX];
796   int ifindex;
797 };
798 struct ipa_wan_msg {
799   char upstream_ifname[IPA_RESOURCE_NAME_MAX];
800   char tethered_ifname[IPA_RESOURCE_NAME_MAX];
801   enum ipa_ip_type ip;
802   uint32_t ipv4_addr_gw;
803   uint32_t ipv6_addr_gw[IPA_WAN_MSG_IPv6_ADDR_GW_LEN];
804 };
805 struct ipa_ioc_rm_dependency {
806   enum ipa_rm_resource_name resource_name;
807   enum ipa_rm_resource_name depends_on_name;
808 };
809 struct ipa_ioc_generate_flt_eq {
810   enum ipa_ip_type ip;
811   struct ipa_rule_attrib attrib;
812   struct ipa_ipfltri_rule_eq eq_attrib;
813 };
814 struct ipa_ioc_write_qmapid {
815   enum ipa_client_type client;
816   uint8_t qmap_id;
817 };
818 enum ipacm_client_enum {
819   IPACM_CLIENT_USB = 1,
820   IPACM_CLIENT_WLAN,
821   IPACM_CLIENT_MAX
822 };
823 enum ipacm_per_client_device_type {
824   IPACM_CLIENT_DEVICE_TYPE_USB = 0,
825   IPACM_CLIENT_DEVICE_TYPE_WLAN = 1,
826   IPACM_CLIENT_DEVICE_TYPE_ETH = 2
827 };
828 #define IPACM_MAX_CLIENT_DEVICE_TYPES 3
829 struct ipa_lan_client_msg {
830   char lanIface[IPA_RESOURCE_NAME_MAX];
831   uint8_t mac[IPA_MAC_ADDR_SIZE];
832 };
833 struct ipa_lan_client {
834   uint8_t mac[IPA_MAC_ADDR_SIZE];
835   int8_t client_idx;
836   uint8_t inited;
837 };
838 struct ipa_tether_device_info {
839   int32_t ul_src_pipe;
840   uint8_t hdr_len;
841   uint32_t num_clients;
842   struct ipa_lan_client lan_client[IPA_MAX_NUM_HW_PATH_CLIENTS];
843 };
844 enum ipa_vlan_ifaces {
845   IPA_VLAN_IF_ETH,
846   IPA_VLAN_IF_RNDIS,
847   IPA_VLAN_IF_ECM
848 };
849 #define IPA_VLAN_IF_EMAC IPA_VLAN_IF_ETH
850 #define IPA_VLAN_IF_MAX (IPA_VLAN_IF_ECM + 1)
851 struct ipa_ioc_get_vlan_mode {
852   enum ipa_vlan_ifaces iface;
853   uint32_t is_vlan_mode;
854 };
855 #define IPA_IOC_ADD_HDR _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ADD_HDR, struct ipa_ioc_add_hdr *)
856 #define IPA_IOC_DEL_HDR _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_DEL_HDR, struct ipa_ioc_del_hdr *)
857 #define IPA_IOC_ADD_RT_RULE _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ADD_RT_RULE, struct ipa_ioc_add_rt_rule *)
858 #define IPA_IOC_ADD_RT_RULE_EXT _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ADD_RT_RULE_EXT, struct ipa_ioc_add_rt_rule_ext *)
859 #define IPA_IOC_ADD_RT_RULE_AFTER _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ADD_RT_RULE_AFTER, struct ipa_ioc_add_rt_rule_after *)
860 #define IPA_IOC_DEL_RT_RULE _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_DEL_RT_RULE, struct ipa_ioc_del_rt_rule *)
861 #define IPA_IOC_ADD_FLT_RULE _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ADD_FLT_RULE, struct ipa_ioc_add_flt_rule *)
862 #define IPA_IOC_ADD_FLT_RULE_AFTER _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ADD_FLT_RULE_AFTER, struct ipa_ioc_add_flt_rule_after *)
863 #define IPA_IOC_DEL_FLT_RULE _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_DEL_FLT_RULE, struct ipa_ioc_del_flt_rule *)
864 #define IPA_IOC_COMMIT_HDR _IO(IPA_IOC_MAGIC, IPA_IOCTL_COMMIT_HDR)
865 #define IPA_IOC_RESET_HDR _IO(IPA_IOC_MAGIC, IPA_IOCTL_RESET_HDR)
866 #define IPA_IOC_COMMIT_RT _IOW(IPA_IOC_MAGIC, IPA_IOCTL_COMMIT_RT, enum ipa_ip_type)
867 #define IPA_IOC_RESET_RT _IOW(IPA_IOC_MAGIC, IPA_IOCTL_RESET_RT, enum ipa_ip_type)
868 #define IPA_IOC_COMMIT_FLT _IOW(IPA_IOC_MAGIC, IPA_IOCTL_COMMIT_FLT, enum ipa_ip_type)
869 #define IPA_IOC_RESET_FLT _IOW(IPA_IOC_MAGIC, IPA_IOCTL_RESET_FLT, enum ipa_ip_type)
870 #define IPA_IOC_DUMP _IO(IPA_IOC_MAGIC, IPA_IOCTL_DUMP)
871 #define IPA_IOC_GET_RT_TBL _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_GET_RT_TBL, struct ipa_ioc_get_rt_tbl *)
872 #define IPA_IOC_PUT_RT_TBL _IOW(IPA_IOC_MAGIC, IPA_IOCTL_PUT_RT_TBL, uint32_t)
873 #define IPA_IOC_COPY_HDR _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_COPY_HDR, struct ipa_ioc_copy_hdr *)
874 #define IPA_IOC_QUERY_INTF _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_QUERY_INTF, struct ipa_ioc_query_intf *)
875 #define IPA_IOC_QUERY_INTF_TX_PROPS _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_QUERY_INTF_TX_PROPS, struct ipa_ioc_query_intf_tx_props *)
876 #define IPA_IOC_QUERY_INTF_RX_PROPS _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_QUERY_INTF_RX_PROPS, struct ipa_ioc_query_intf_rx_props *)
877 #define IPA_IOC_QUERY_INTF_EXT_PROPS _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_QUERY_INTF_EXT_PROPS, struct ipa_ioc_query_intf_ext_props *)
878 #define IPA_IOC_GET_HDR _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_GET_HDR, struct ipa_ioc_get_hdr *)
879 #define IPA_IOC_PUT_HDR _IOW(IPA_IOC_MAGIC, IPA_IOCTL_PUT_HDR, uint32_t)
880 #define IPA_IOC_ALLOC_NAT_MEM _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ALLOC_NAT_MEM, struct ipa_ioc_nat_alloc_mem *)
881 #define IPA_IOC_ALLOC_NAT_TABLE _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ALLOC_NAT_TABLE, struct ipa_ioc_nat_ipv6ct_table_alloc *)
882 #define IPA_IOC_ALLOC_IPV6CT_TABLE _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ALLOC_IPV6CT_TABLE, struct ipa_ioc_nat_ipv6ct_table_alloc *)
883 #define IPA_IOC_V4_INIT_NAT _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_V4_INIT_NAT, struct ipa_ioc_v4_nat_init *)
884 #define IPA_IOC_INIT_IPV6CT_TABLE _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_INIT_IPV6CT_TABLE, struct ipa_ioc_ipv6ct_init *)
885 #define IPA_IOC_NAT_DMA _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_NAT_DMA, struct ipa_ioc_nat_dma_cmd *)
886 #define IPA_IOC_TABLE_DMA_CMD _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_TABLE_DMA_CMD, struct ipa_ioc_nat_dma_cmd *)
887 #define IPA_IOC_V4_DEL_NAT _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_V4_DEL_NAT, struct ipa_ioc_v4_nat_del *)
888 #define IPA_IOC_DEL_NAT_TABLE _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_DEL_NAT_TABLE, struct ipa_ioc_nat_ipv6ct_table_del *)
889 #define IPA_IOC_DEL_IPV6CT_TABLE _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_DEL_IPV6CT_TABLE, struct ipa_ioc_nat_ipv6ct_table_del *)
890 #define IPA_IOC_GET_NAT_OFFSET _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_GET_NAT_OFFSET, uint32_t *)
891 #define IPA_IOC_NAT_MODIFY_PDN _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_NAT_MODIFY_PDN, struct ipa_ioc_nat_pdn_entry *)
892 #define IPA_IOC_SET_FLT _IOW(IPA_IOC_MAGIC, IPA_IOCTL_SET_FLT, uint32_t)
893 #define IPA_IOC_PULL_MSG _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_PULL_MSG, struct ipa_msg_meta *)
894 #define IPA_IOC_RM_ADD_DEPENDENCY _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_RM_ADD_DEPENDENCY, struct ipa_ioc_rm_dependency *)
895 #define IPA_IOC_RM_DEL_DEPENDENCY _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_RM_DEL_DEPENDENCY, struct ipa_ioc_rm_dependency *)
896 #define IPA_IOC_GENERATE_FLT_EQ _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_GENERATE_FLT_EQ, struct ipa_ioc_generate_flt_eq *)
897 #define IPA_IOC_QUERY_EP_MAPPING _IOR(IPA_IOC_MAGIC, IPA_IOCTL_QUERY_EP_MAPPING, uint32_t)
898 #define IPA_IOC_QUERY_RT_TBL_INDEX _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_QUERY_RT_TBL_INDEX, struct ipa_ioc_get_rt_tbl_indx *)
899 #define IPA_IOC_WRITE_QMAPID _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_WRITE_QMAPID, struct ipa_ioc_write_qmapid *)
900 #define IPA_IOC_MDFY_FLT_RULE _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_MDFY_FLT_RULE, struct ipa_ioc_mdfy_flt_rule *)
901 #define IPA_IOC_MDFY_RT_RULE _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_MDFY_RT_RULE, struct ipa_ioc_mdfy_rt_rule *)
902 #define IPA_IOC_NOTIFY_WAN_UPSTREAM_ROUTE_ADD _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_NOTIFY_WAN_UPSTREAM_ROUTE_ADD, struct ipa_wan_msg *)
903 #define IPA_IOC_NOTIFY_WAN_UPSTREAM_ROUTE_DEL _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_NOTIFY_WAN_UPSTREAM_ROUTE_DEL, struct ipa_wan_msg *)
904 #define IPA_IOC_NOTIFY_WAN_EMBMS_CONNECTED _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_NOTIFY_WAN_EMBMS_CONNECTED, struct ipa_wan_msg *)
905 #define IPA_IOC_ADD_HDR_PROC_CTX _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ADD_HDR_PROC_CTX, struct ipa_ioc_add_hdr_proc_ctx *)
906 #define IPA_IOC_DEL_HDR_PROC_CTX _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_DEL_HDR_PROC_CTX, struct ipa_ioc_del_hdr_proc_ctx *)
907 #define IPA_IOC_GET_HW_VERSION _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_GET_HW_VERSION, enum ipa_hw_type *)
908 #define IPA_IOC_ADD_VLAN_IFACE _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ADD_VLAN_IFACE, struct ipa_ioc_vlan_iface_info *)
909 #define IPA_IOC_DEL_VLAN_IFACE _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_DEL_VLAN_IFACE, struct ipa_ioc_vlan_iface_info *)
910 #define IPA_IOC_ADD_L2TP_VLAN_MAPPING _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ADD_L2TP_VLAN_MAPPING, struct ipa_ioc_l2tp_vlan_mapping_info *)
911 #define IPA_IOC_DEL_L2TP_VLAN_MAPPING _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_DEL_L2TP_VLAN_MAPPING, struct ipa_ioc_l2tp_vlan_mapping_info *)
912 #define IPA_IOC_CLEANUP _IO(IPA_IOC_MAGIC, IPA_IOCTL_CLEANUP)
913 #define IPA_IOC_QUERY_WLAN_CLIENT _IO(IPA_IOC_MAGIC, IPA_IOCTL_QUERY_WLAN_CLIENT)
914 #define IPA_IOC_GET_VLAN_MODE _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_GET_VLAN_MODE, struct ipa_ioc_get_vlan_mode *)
915 #define TETH_BRIDGE_IOC_MAGIC 0xCE
916 #define TETH_BRIDGE_IOCTL_SET_BRIDGE_MODE 0
917 #define TETH_BRIDGE_IOCTL_SET_AGGR_PARAMS 1
918 #define TETH_BRIDGE_IOCTL_GET_AGGR_PARAMS 2
919 #define TETH_BRIDGE_IOCTL_GET_AGGR_CAPABILITIES 3
920 #define TETH_BRIDGE_IOCTL_MAX 4
921 enum teth_link_protocol_type {
922   TETH_LINK_PROTOCOL_IP,
923   TETH_LINK_PROTOCOL_ETHERNET,
924   TETH_LINK_PROTOCOL_MAX,
925 };
926 enum teth_aggr_protocol_type {
927   TETH_AGGR_PROTOCOL_NONE,
928   TETH_AGGR_PROTOCOL_MBIM,
929   TETH_AGGR_PROTOCOL_TLP,
930   TETH_AGGR_PROTOCOL_MAX,
931 };
932 struct teth_aggr_params_link {
933   enum teth_aggr_protocol_type aggr_prot;
934   uint32_t max_transfer_size_byte;
935   uint32_t max_datagrams;
936 };
937 struct teth_aggr_params {
938   struct teth_aggr_params_link ul;
939   struct teth_aggr_params_link dl;
940 };
941 struct teth_aggr_capabilities {
942   uint16_t num_protocols;
943   struct teth_aggr_params_link prot_caps[0];
944 };
945 struct teth_ioc_set_bridge_mode {
946   enum teth_link_protocol_type link_protocol;
947   uint16_t lcid;
948 };
949 struct teth_ioc_aggr_params {
950   struct teth_aggr_params aggr_params;
951   uint16_t lcid;
952 };
953 #define TETH_BRIDGE_IOC_SET_BRIDGE_MODE _IOW(TETH_BRIDGE_IOC_MAGIC, TETH_BRIDGE_IOCTL_SET_BRIDGE_MODE, struct teth_ioc_set_bridge_mode *)
954 #define TETH_BRIDGE_IOC_SET_AGGR_PARAMS _IOW(TETH_BRIDGE_IOC_MAGIC, TETH_BRIDGE_IOCTL_SET_AGGR_PARAMS, struct teth_ioc_aggr_params *)
955 #define TETH_BRIDGE_IOC_GET_AGGR_PARAMS _IOR(TETH_BRIDGE_IOC_MAGIC, TETH_BRIDGE_IOCTL_GET_AGGR_PARAMS, struct teth_ioc_aggr_params *)
956 #define TETH_BRIDGE_IOC_GET_AGGR_CAPABILITIES _IOWR(TETH_BRIDGE_IOC_MAGIC, TETH_BRIDGE_IOCTL_GET_AGGR_CAPABILITIES, struct teth_aggr_capabilities *)
957 #define ODU_BRIDGE_IOC_MAGIC 0xCD
958 #define ODU_BRIDGE_IOCTL_SET_MODE 0
959 #define ODU_BRIDGE_IOCTL_SET_LLV6_ADDR 1
960 #define ODU_BRIDGE_IOCTL_MAX 2
961 enum odu_bridge_mode {
962   ODU_BRIDGE_MODE_ROUTER,
963   ODU_BRIDGE_MODE_BRIDGE,
964   ODU_BRIDGE_MODE_MAX,
965 };
966 #define ODU_BRIDGE_IOC_SET_MODE _IOW(ODU_BRIDGE_IOC_MAGIC, ODU_BRIDGE_IOCTL_SET_MODE, enum odu_bridge_mode)
967 #define ODU_BRIDGE_IOC_SET_LLV6_ADDR _IOW(ODU_BRIDGE_IOC_MAGIC, ODU_BRIDGE_IOCTL_SET_LLV6_ADDR, struct in6_addr *)
968 #endif
969 
970