• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 <stdio.h>
22 #include <stdint.h>
23 #include <stddef.h>
24 #include <sys/stat.h>
25 #include <linux/ioctl.h>
26 #include <linux/types.h>
27 #include <linux/if_ether.h>
28 #define IPA_IOC_MAGIC 0xCF
29 #define IPA_DEV_NAME "/dev/ipa"
30 #define IPA_NAT_DEV_NAME "ipaNatTable"
31 #define IPA_IPV6CT_DEV_NAME "ipaIpv6CTTable"
32 #define IPA_DFLT_RT_TBL_NAME "ipa_dflt_rt"
33 #define IPAHAL_NAT_INVALID_PROTOCOL 0xFF
34 #define IPA_IOCTL_ADD_HDR 0
35 #define IPA_IOCTL_DEL_HDR 1
36 #define IPA_IOCTL_ADD_RT_RULE 2
37 #define IPA_IOCTL_DEL_RT_RULE 3
38 #define IPA_IOCTL_ADD_FLT_RULE 4
39 #define IPA_IOCTL_DEL_FLT_RULE 5
40 #define IPA_IOCTL_COMMIT_HDR 6
41 #define IPA_IOCTL_RESET_HDR 7
42 #define IPA_IOCTL_COMMIT_RT 8
43 #define IPA_IOCTL_RESET_RT 9
44 #define IPA_IOCTL_COMMIT_FLT 10
45 #define IPA_IOCTL_RESET_FLT 11
46 #define IPA_IOCTL_DUMP 12
47 #define IPA_IOCTL_GET_RT_TBL 13
48 #define IPA_IOCTL_PUT_RT_TBL 14
49 #define IPA_IOCTL_COPY_HDR 15
50 #define IPA_IOCTL_QUERY_INTF 16
51 #define IPA_IOCTL_QUERY_INTF_TX_PROPS 17
52 #define IPA_IOCTL_QUERY_INTF_RX_PROPS 18
53 #define IPA_IOCTL_GET_HDR 19
54 #define IPA_IOCTL_PUT_HDR 20
55 #define IPA_IOCTL_SET_FLT 21
56 #define IPA_IOCTL_ALLOC_NAT_MEM 22
57 #define IPA_IOCTL_V4_INIT_NAT 23
58 #define IPA_IOCTL_TABLE_DMA_CMD 24
59 #define IPA_IOCTL_NAT_DMA IPA_IOCTL_TABLE_DMA_CMD
60 #define IPA_IOCTL_INIT_IPV6CT_TABLE 25
61 #define IPA_IOCTL_V4_DEL_NAT 26
62 #define IPA_IOCTL_PULL_MSG 27
63 #define IPA_IOCTL_GET_NAT_OFFSET 28
64 #define IPA_IOCTL_RM_ADD_DEPENDENCY 29
65 #define IPA_IOCTL_RM_DEL_DEPENDENCY 30
66 #define IPA_IOCTL_GENERATE_FLT_EQ 31
67 #define IPA_IOCTL_QUERY_INTF_EXT_PROPS 32
68 #define IPA_IOCTL_QUERY_EP_MAPPING 33
69 #define IPA_IOCTL_QUERY_RT_TBL_INDEX 34
70 #define IPA_IOCTL_WRITE_QMAPID 35
71 #define IPA_IOCTL_MDFY_FLT_RULE 36
72 #define IPA_IOCTL_NOTIFY_WAN_UPSTREAM_ROUTE_ADD 37
73 #define IPA_IOCTL_NOTIFY_WAN_UPSTREAM_ROUTE_DEL 38
74 #define IPA_IOCTL_NOTIFY_WAN_EMBMS_CONNECTED 39
75 #define IPA_IOCTL_ADD_HDR_PROC_CTX 40
76 #define IPA_IOCTL_DEL_HDR_PROC_CTX 41
77 #define IPA_IOCTL_MDFY_RT_RULE 42
78 #define IPA_IOCTL_ADD_RT_RULE_AFTER 43
79 #define IPA_IOCTL_ADD_FLT_RULE_AFTER 44
80 #define IPA_IOCTL_GET_HW_VERSION 45
81 #define IPA_IOCTL_ADD_RT_RULE_EXT 46
82 #define IPA_IOCTL_ADD_VLAN_IFACE 47
83 #define IPA_IOCTL_DEL_VLAN_IFACE 48
84 #define IPA_IOCTL_ADD_L2TP_VLAN_MAPPING 49
85 #define IPA_IOCTL_DEL_L2TP_VLAN_MAPPING 50
86 #define IPA_IOCTL_NAT_MODIFY_PDN 51
87 #define IPA_IOCTL_ALLOC_NAT_TABLE 52
88 #define IPA_IOCTL_ALLOC_IPV6CT_TABLE 53
89 #define IPA_IOCTL_DEL_NAT_TABLE 54
90 #define IPA_IOCTL_DEL_IPV6CT_TABLE 55
91 #define IPA_IOCTL_CLEANUP 56
92 #define IPA_IOCTL_QUERY_WLAN_CLIENT 57
93 #define IPA_IOCTL_GET_VLAN_MODE 58
94 #define IPA_IOCTL_ADD_BRIDGE_VLAN_MAPPING 59
95 #define IPA_IOCTL_DEL_BRIDGE_VLAN_MAPPING 60
96 #define IPA_IOCTL_ODL_QUERY_ADAPL_EP_INFO 61
97 #define IPA_IOCTL_ODL_GET_AGG_BYTE_LIMIT 62
98 #define IPA_IOCTL_ODL_QUERY_MODEM_CONFIG 63
99 #define IPA_IOCTL_GSB_CONNECT 64
100 #define IPA_IOCTL_GSB_DISCONNECT 65
101 #define IPA_IOCTL_WIGIG_FST_SWITCH 66
102 #define IPA_IOCTL_ADD_RT_RULE_V2 67
103 #define IPA_IOCTL_ADD_RT_RULE_EXT_V2 68
104 #define IPA_IOCTL_ADD_RT_RULE_AFTER_V2 69
105 #define IPA_IOCTL_MDFY_RT_RULE_V2 70
106 #define IPA_IOCTL_ADD_FLT_RULE_V2 71
107 #define IPA_IOCTL_ADD_FLT_RULE_AFTER_V2 72
108 #define IPA_IOCTL_MDFY_FLT_RULE_V2 73
109 #define IPA_IOCTL_FNR_COUNTER_ALLOC 74
110 #define IPA_IOCTL_FNR_COUNTER_DEALLOC 75
111 #define IPA_IOCTL_FNR_COUNTER_QUERY 76
112 #define IPA_IOCTL_GET_NAT_IN_SRAM_INFO 77
113 #define IPA_IOCTL_GET_PHERIPHERAL_EP_INFO 78
114 #define IPA_IOCTL_APP_CLOCK_VOTE 79
115 #define IPA_HDR_MAX_SIZE 128
116 #define IPA_RESOURCE_NAME_MAX 32
117 #define IPA_NUM_PROPS_MAX 35
118 #define IPA_MAC_ADDR_SIZE 6
119 #define IPA_MBIM_MAX_STREAM_NUM 8
120 #define IPA_WAN_MSG_IPv6_ADDR_GW_LEN 4
121 #define IPA_MAX_NUM_HW_PATH_CLIENTS 16
122 #define QMI_IPA_MAX_CLIENT_DST_PIPES 4
123 #define IPA_MAX_FLT_RT_CNT_INDEX (128)
124 #define IPA_FLT_RT_HW_COUNTER (120)
125 #define IPA_FLT_RT_SW_COUNTER (IPA_MAX_FLT_RT_CNT_INDEX - IPA_FLT_RT_HW_COUNTER)
126 #define IPA_MAX_FLT_RT_CLIENTS 60
127 #define IPA_CV2X_SUPPORT
128 #define IPA_FLT_TOS (1ul << 0)
129 #define IPA_FLT_PROTOCOL (1ul << 1)
130 #define IPA_FLT_SRC_ADDR (1ul << 2)
131 #define IPA_FLT_DST_ADDR (1ul << 3)
132 #define IPA_FLT_SRC_PORT_RANGE (1ul << 4)
133 #define IPA_FLT_DST_PORT_RANGE (1ul << 5)
134 #define IPA_FLT_TYPE (1ul << 6)
135 #define IPA_FLT_CODE (1ul << 7)
136 #define IPA_FLT_SPI (1ul << 8)
137 #define IPA_FLT_SRC_PORT (1ul << 9)
138 #define IPA_FLT_DST_PORT (1ul << 10)
139 #define IPA_FLT_TC (1ul << 11)
140 #define IPA_FLT_FLOW_LABEL (1ul << 12)
141 #define IPA_FLT_NEXT_HDR (1ul << 13)
142 #define IPA_FLT_META_DATA (1ul << 14)
143 #define IPA_FLT_FRAGMENT (1ul << 15)
144 #define IPA_FLT_TOS_MASKED (1ul << 16)
145 #define IPA_FLT_MAC_SRC_ADDR_ETHER_II (1ul << 17)
146 #define IPA_FLT_MAC_DST_ADDR_ETHER_II (1ul << 18)
147 #define IPA_FLT_MAC_SRC_ADDR_802_3 (1ul << 19)
148 #define IPA_FLT_MAC_DST_ADDR_802_3 (1ul << 20)
149 #define IPA_FLT_MAC_ETHER_TYPE (1ul << 21)
150 #define IPA_FLT_MAC_DST_ADDR_L2TP (1ul << 22)
151 #define IPA_FLT_TCP_SYN (1ul << 23)
152 #define IPA_FLT_TCP_SYN_L2TP (1ul << 24)
153 #define IPA_FLT_L2TP_INNER_IP_TYPE (1ul << 25)
154 #define IPA_FLT_L2TP_INNER_IPV4_DST_ADDR (1ul << 26)
155 #define IPA_FLT_IS_PURE_ACK (1ul << 27)
156 #define IPA_FLT_VLAN_ID (1ul << 28)
157 #define IPA_FLT_MAC_SRC_ADDR_802_1Q (1ul << 29)
158 #define IPA_FLT_MAC_DST_ADDR_802_1Q (1ul << 30)
159 #define IPA_FLT_L2TP_UDP_INNER_MAC_DST_ADDR (1ul << 31)
160 #define IPA_FLT_EXT_L2TP_UDP_TCP_SYN (1ul << 0)
161 #define IPA_FLT_EXT_L2TP_UDP_INNER_ETHER_TYPE (1ul << 1)
162 #define IPA_FLT_EXT_MTU (1ul << 2)
163 #define IPA_FLT_EXT_L2TP_UDP_INNER_NEXT_HDR (1ul << 3)
164 #define IPA_FLT_EXT_NEXT_HDR (1ul << 4)
165 #define IPA_MAX_PDN_NUM 5
166 enum ipa_client_type {
167   IPA_CLIENT_HSIC1_PROD = 0,
168   IPA_CLIENT_HSIC1_CONS = 1,
169   IPA_CLIENT_HSIC2_PROD = 2,
170   IPA_CLIENT_HSIC2_CONS = 3,
171   IPA_CLIENT_HSIC3_PROD = 4,
172   IPA_CLIENT_HSIC3_CONS = 5,
173   IPA_CLIENT_HSIC4_PROD = 6,
174   IPA_CLIENT_HSIC4_CONS = 7,
175   IPA_CLIENT_HSIC5_PROD = 8,
176   IPA_CLIENT_HSIC5_CONS = 9,
177   IPA_CLIENT_WLAN1_PROD = 10,
178   IPA_CLIENT_WLAN1_CONS = 11,
179   IPA_CLIENT_A5_WLAN_AMPDU_PROD = 12,
180   IPA_CLIENT_WLAN2_CONS = 13,
181   IPA_CLIENT_WLAN3_CONS = 15,
182   IPA_CLIENT_WLAN4_CONS = 17,
183   IPA_CLIENT_USB_PROD = 18,
184   IPA_CLIENT_USB_CONS = 19,
185   IPA_CLIENT_USB2_PROD = 20,
186   IPA_CLIENT_USB2_CONS = 21,
187   IPA_CLIENT_USB3_PROD = 22,
188   IPA_CLIENT_USB3_CONS = 23,
189   IPA_CLIENT_USB4_PROD = 24,
190   IPA_CLIENT_USB4_CONS = 25,
191   IPA_CLIENT_UC_USB_PROD = 26,
192   IPA_CLIENT_USB_DPL_CONS = 27,
193   IPA_CLIENT_A2_EMBEDDED_PROD = 28,
194   IPA_CLIENT_A2_EMBEDDED_CONS = 29,
195   IPA_CLIENT_A2_TETHERED_PROD = 30,
196   IPA_CLIENT_A2_TETHERED_CONS = 31,
197   IPA_CLIENT_APPS_LAN_PROD = 32,
198   IPA_CLIENT_APPS_LAN_CONS = 33,
199   IPA_CLIENT_APPS_WAN_PROD = 34,
200   IPA_CLIENT_APPS_LAN_WAN_PROD = IPA_CLIENT_APPS_WAN_PROD,
201   IPA_CLIENT_APPS_WAN_CONS = 35,
202   IPA_CLIENT_APPS_CMD_PROD = 36,
203   IPA_CLIENT_A5_LAN_WAN_CONS = 37,
204   IPA_CLIENT_ODU_PROD = 38,
205   IPA_CLIENT_ODU_EMB_CONS = 39,
206   IPA_CLIENT_ODU_TETH_CONS = 41,
207   IPA_CLIENT_MHI_PROD = 42,
208   IPA_CLIENT_MHI_CONS = 43,
209   IPA_CLIENT_MEMCPY_DMA_SYNC_PROD = 44,
210   IPA_CLIENT_MEMCPY_DMA_SYNC_CONS = 45,
211   IPA_CLIENT_MEMCPY_DMA_ASYNC_PROD = 46,
212   IPA_CLIENT_MEMCPY_DMA_ASYNC_CONS = 47,
213   IPA_CLIENT_ETHERNET_PROD = 48,
214   IPA_CLIENT_ETHERNET_CONS = 49,
215   IPA_CLIENT_Q6_LAN_PROD = 50,
216   IPA_CLIENT_Q6_LAN_CONS = 51,
217   IPA_CLIENT_Q6_WAN_PROD = 52,
218   IPA_CLIENT_Q6_WAN_CONS = 53,
219   IPA_CLIENT_Q6_CMD_PROD = 54,
220   IPA_CLIENT_Q6_DUN_CONS = 55,
221   IPA_CLIENT_Q6_DECOMP_PROD = 56,
222   IPA_CLIENT_Q6_DECOMP_CONS = 57,
223   IPA_CLIENT_Q6_DECOMP2_PROD = 58,
224   IPA_CLIENT_Q6_DECOMP2_CONS = 59,
225   IPA_CLIENT_Q6_LTE_WIFI_AGGR_CONS = 61,
226   IPA_CLIENT_TEST_PROD = 62,
227   IPA_CLIENT_TEST_CONS = 63,
228   IPA_CLIENT_TEST1_PROD = 64,
229   IPA_CLIENT_TEST1_CONS = 65,
230   IPA_CLIENT_TEST2_PROD = 66,
231   IPA_CLIENT_TEST2_CONS = 67,
232   IPA_CLIENT_TEST3_PROD = 68,
233   IPA_CLIENT_TEST3_CONS = 69,
234   IPA_CLIENT_TEST4_PROD = 70,
235   IPA_CLIENT_TEST4_CONS = 71,
236   IPA_CLIENT_DUMMY_CONS = 73,
237   IPA_CLIENT_Q6_DL_NLO_DATA_PROD = 74,
238   IPA_CLIENT_Q6_UL_NLO_DATA_CONS = 75,
239   IPA_CLIENT_Q6_UL_NLO_ACK_CONS = 77,
240   IPA_CLIENT_Q6_QBAP_STATUS_CONS = 79,
241   IPA_CLIENT_MHI_DPL_CONS = 81,
242   IPA_CLIENT_ODL_DPL_CONS = 83,
243   IPA_CLIENT_Q6_AUDIO_DMA_MHI_PROD = 84,
244   IPA_CLIENT_Q6_AUDIO_DMA_MHI_CONS = 85,
245   IPA_CLIENT_APPS_WAN_COAL_CONS = 87,
246   IPA_CLIENT_WIGIG_PROD = 88,
247   IPA_CLIENT_WIGIG1_CONS = 89,
248   IPA_CLIENT_WIGIG2_CONS = 91,
249   IPA_CLIENT_WIGIG3_CONS = 93,
250   IPA_CLIENT_WIGIG4_CONS = 95,
251   IPA_CLIENT_AQC_ETHERNET_PROD = 96,
252   IPA_CLIENT_AQC_ETHERNET_CONS = 97,
253   IPA_CLIENT_MHI_PRIME_TETH_PROD = 98,
254   IPA_CLIENT_MHI_PRIME_TETH_CONS = 99,
255   IPA_CLIENT_MHI_PRIME_RMNET_PROD = 100,
256   IPA_CLIENT_MHI_PRIME_RMNET_CONS = 101,
257   IPA_CLIENT_MHI_PRIME_DPL_PROD = 102,
258   IPA_CLIENT_MHI2_PROD = 104,
259   IPA_CLIENT_MHI2_CONS = 105,
260   IPA_CLIENT_Q6_CV2X_PROD = 106,
261   IPA_CLIENT_Q6_CV2X_CONS = 107,
262   IPA_CLIENT_MHI_LOW_LAT_PROD = 108,
263   IPA_CLIENT_MHI_LOW_LAT_CONS = 109,
264   IPA_CLIENT_MHI_QDSS_CONS = 111,
265 };
266 #define IPA_CLIENT_MAX (IPA_CLIENT_MHI_QDSS_CONS + 1)
267 #define IPA_CLIENT_WLAN2_PROD IPA_CLIENT_A5_WLAN_AMPDU_PROD
268 #define IPA_CLIENT_Q6_DL_NLO_DATA_PROD IPA_CLIENT_Q6_DL_NLO_DATA_PROD
269 #define IPA_CLIENT_Q6_UL_NLO_ACK_CONS IPA_CLIENT_Q6_UL_NLO_ACK_CONS
270 #define IPA_CLIENT_Q6_QBAP_STATUS_CONS IPA_CLIENT_Q6_QBAP_STATUS_CONS
271 #define IPA_CLIENT_MHI_DPL_CONS IPA_CLIENT_MHI_DPL_CONS
272 #define IPA_CLIENT_Q6_AUDIO_DMA_MHI_PROD IPA_CLIENT_Q6_AUDIO_DMA_MHI_PROD
273 #define IPA_CLIENT_Q6_AUDIO_DMA_MHI_CONS IPA_CLIENT_Q6_AUDIO_DMA_MHI_CONS
274 #define IPA_CLIENT_WIGIG_PROD IPA_CLIENT_WIGIG_PROD
275 #define IPA_CLIENT_WIGIG1_CONS IPA_CLIENT_WIGIG1_CONS
276 #define IPA_CLIENT_WIGIG2_CONS IPA_CLIENT_WIGIG2_CONS
277 #define IPA_CLIENT_WIGIG3_CONS IPA_CLIENT_WIGIG3_CONS
278 #define IPA_CLIENT_WIGIG4_CONS IPA_CLIENT_WIGIG4_CONS
279 #define IPA_CLIENT_AQC_ETHERNET_PROD IPA_CLIENT_AQC_ETHERNET_PROD
280 #define IPA_CLIENT_AQC_ETHERNET_CONS IPA_CLIENT_AQC_ETHERNET_CONS
281 #define IPA_CLIENT_MHI_PRIME_TETH_PROD IPA_CLIENT_MHI_PRIME_TETH_PROD
282 #define IPA_CLIENT_MHI_PRIME_TETH_CONS IPA_CLIENT_MHI_PRIME_TETH_CONS
283 #define IPA_CLIENT_MHI_PRIME_RMNET_PROD IPA_CLIENT_MHI_PRIME_RMNET_PROD
284 #define IPA_CLIENT_MHI_PRIME_RMNET_CONS IPA_CLIENT_MHI_PRIME_RMNET_CONS
285 #define IPA_CLIENT_MHI_PRIME_DPL_PROD IPA_CLIENT_MHI_PRIME_DPL_PROD
286 #define IPA_CLIENT_MHI_QDSS_CONS IPA_CLIENT_MHI_QDSS_CONS
287 #define IPA_CLIENT_IS_APPS_CONS(client) ((client) == IPA_CLIENT_APPS_LAN_CONS || (client) == IPA_CLIENT_APPS_WAN_CONS || (client) == IPA_CLIENT_APPS_WAN_COAL_CONS)
288 #define IPA_CLIENT_IS_APPS_PROD(client) ((client) == IPA_CLIENT_APPS_LAN_PROD || (client) == IPA_CLIENT_APPS_WAN_PROD)
289 #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)
290 #define IPA_CLIENT_IS_WAN_CONS(client) ((client) == IPA_CLIENT_APPS_WAN_CONS || (client) == IPA_CLIENT_APPS_WAN_COAL_CONS)
291 #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)
292 #define IPA_CLIENT_IS_ODU_CONS(client) ((client) == IPA_CLIENT_ODU_EMB_CONS || (client) == IPA_CLIENT_ODU_TETH_CONS)
293 #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 || (client) == IPA_CLIENT_Q6_UL_NLO_DATA_CONS || (client) == IPA_CLIENT_Q6_UL_NLO_ACK_CONS || (client) == IPA_CLIENT_Q6_QBAP_STATUS_CONS || (client) == IPA_CLIENT_Q6_CV2X_CONS || (client) == IPA_CLIENT_Q6_AUDIO_DMA_MHI_CONS)
294 #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 || (client) == IPA_CLIENT_Q6_DL_NLO_DATA_PROD || (client) == IPA_CLIENT_Q6_CV2X_PROD || (client) == IPA_CLIENT_Q6_AUDIO_DMA_MHI_PROD)
295 #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 || (client) == IPA_CLIENT_Q6_UL_NLO_DATA_CONS || (client) == IPA_CLIENT_Q6_UL_NLO_ACK_CONS || (client) == IPA_CLIENT_Q6_QBAP_STATUS_CONS || (client) == IPA_CLIENT_Q6_CV2X_CONS || (client) == IPA_CLIENT_Q6_AUDIO_DMA_MHI_CONS)
296 #define IPA_CLIENT_IS_Q6_ZIP_CONS(client) ((client) == IPA_CLIENT_Q6_DECOMP_CONS || (client) == IPA_CLIENT_Q6_DECOMP2_CONS)
297 #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 || (client) == IPA_CLIENT_Q6_DL_NLO_DATA_PROD || (client) == IPA_CLIENT_Q6_CV2X_PROD || (client) == IPA_CLIENT_Q6_AUDIO_DMA_MHI_PROD)
298 #define IPA_CLIENT_IS_Q6_ZIP_PROD(client) ((client) == IPA_CLIENT_Q6_DECOMP_PROD || (client) == IPA_CLIENT_Q6_DECOMP2_PROD)
299 #define IPA_CLIENT_IS_MEMCPY_DMA_CONS(client) ((client) == IPA_CLIENT_MEMCPY_DMA_SYNC_CONS || (client) == IPA_CLIENT_MEMCPY_DMA_ASYNC_CONS)
300 #define IPA_CLIENT_IS_MEMCPY_DMA_PROD(client) ((client) == IPA_CLIENT_MEMCPY_DMA_SYNC_PROD || (client) == IPA_CLIENT_MEMCPY_DMA_ASYNC_PROD)
301 #define IPA_CLIENT_IS_MHI(client) ((client) == IPA_CLIENT_MHI_CONS || (client) == IPA_CLIENT_MHI_PROD || (client) == IPA_CLIENT_MHI2_PROD || (client) == IPA_CLIENT_MHI2_CONS || (client) == IPA_CLIENT_MHI_LOW_LAT_PROD || (client) == IPA_CLIENT_MHI_LOW_LAT_CONS || (client) == IPA_CLIENT_MHI_DPL_CONS || (client) == IPA_CLIENT_MHI_QDSS_CONS)
302 #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)
303 #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)
304 #define IPA_CLIENT_IS_TEST(client) (IPA_CLIENT_IS_TEST_PROD(client) || IPA_CLIENT_IS_TEST_CONS(client))
305 enum ipa3_nat_mem_in {
306   IPA_NAT_MEM_IN_DDR = 0,
307   IPA_NAT_MEM_IN_SRAM = 1,
308   IPA_NAT_MEM_IN_MAX
309 };
310 #define IPA_VALID_NAT_MEM_IN(t) ((t) >= IPA_NAT_MEM_IN_DDR && (t) < IPA_NAT_MEM_IN_MAX)
311 enum ipa_ip_type {
312   IPA_IP_v4,
313   IPA_IP_v6,
314   IPA_IP_MAX
315 };
316 #define VALID_IPA_IP_TYPE(t) ((t) >= IPA_IP_v4 && (t) < IPA_IP_MAX)
317 enum ipa_rule_type {
318   IPA_RULE_HASHABLE,
319   IPA_RULE_NON_HASHABLE,
320 };
321 #define IPA_RULE_TYPE_MAX (IPA_RULE_NON_HASHABLE + 1)
322 enum ipa_flt_action {
323   IPA_PASS_TO_ROUTING,
324   IPA_PASS_TO_SRC_NAT,
325   IPA_PASS_TO_DST_NAT,
326   IPA_PASS_TO_EXCEPTION
327 };
328 enum ipa_wlan_event {
329   WLAN_CLIENT_CONNECT,
330   WLAN_CLIENT_DISCONNECT,
331   WLAN_CLIENT_POWER_SAVE_MODE,
332   WLAN_CLIENT_NORMAL_MODE,
333   SW_ROUTING_ENABLE,
334   SW_ROUTING_DISABLE,
335   WLAN_AP_CONNECT,
336   WLAN_AP_DISCONNECT,
337   WLAN_STA_CONNECT,
338   WLAN_STA_DISCONNECT,
339   WLAN_CLIENT_CONNECT_EX,
340   WLAN_SWITCH_TO_SCC,
341   WLAN_SWITCH_TO_MCC,
342   WLAN_WDI_ENABLE,
343   WLAN_WDI_DISABLE,
344   IPA_WLAN_EVENT_MAX
345 };
346 enum ipa_wan_event {
347   WAN_UPSTREAM_ROUTE_ADD = IPA_WLAN_EVENT_MAX,
348   WAN_UPSTREAM_ROUTE_DEL,
349   WAN_EMBMS_CONNECT,
350   WAN_XLAT_CONNECT,
351   IPA_WAN_EVENT_MAX
352 };
353 enum ipa_ecm_event {
354   ECM_CONNECT = IPA_WAN_EVENT_MAX,
355   ECM_DISCONNECT,
356   IPA_ECM_EVENT_MAX,
357 };
358 enum ipa_tethering_stats_event {
359   IPA_TETHERING_STATS_UPDATE_STATS = IPA_ECM_EVENT_MAX,
360   IPA_TETHERING_STATS_UPDATE_NETWORK_STATS,
361   IPA_TETHERING_STATS_EVENT_MAX,
362 };
363 enum ipa_quota_event {
364   IPA_QUOTA_REACH = IPA_TETHERING_STATS_EVENT_MAX,
365   IPA_QUOTA_EVENT_MAX,
366 };
367 enum ipa_ssr_event {
368   IPA_SSR_BEFORE_SHUTDOWN = IPA_QUOTA_EVENT_MAX,
369   IPA_SSR_AFTER_POWERUP,
370   IPA_SSR_EVENT_MAX,
371 };
372 enum ipa_vlan_l2tp_event {
373   ADD_VLAN_IFACE = IPA_SSR_EVENT_MAX,
374   DEL_VLAN_IFACE,
375   ADD_L2TP_VLAN_MAPPING,
376   DEL_L2TP_VLAN_MAPPING,
377   IPA_VLAN_L2TP_EVENT_MAX,
378 };
379 enum ipa_per_client_stats_event {
380   IPA_PER_CLIENT_STATS_CONNECT_EVENT = IPA_VLAN_L2TP_EVENT_MAX,
381   IPA_PER_CLIENT_STATS_DISCONNECT_EVENT,
382   IPA_PER_CLIENT_STATS_EVENT_MAX,
383 };
384 enum ipa_vlan_bridge_event {
385   ADD_BRIDGE_VLAN_MAPPING = IPA_PER_CLIENT_STATS_EVENT_MAX,
386   DEL_BRIDGE_VLAN_MAPPING,
387   BRIDGE_VLAN_MAPPING_MAX,
388 };
389 enum ipa_wlan_fw_ssr_event {
390   WLAN_FWR_SSR_BEFORE_SHUTDOWN = BRIDGE_VLAN_MAPPING_MAX,
391   IPA_WLAN_FW_SSR_EVENT_MAX,
392 #define IPA_WLAN_FW_SSR_EVENT_MAX IPA_WLAN_FW_SSR_EVENT_MAX
393 };
394 enum ipa_gsb_event {
395   IPA_GSB_CONNECT = IPA_WLAN_FW_SSR_EVENT_MAX,
396   IPA_GSB_DISCONNECT,
397   IPA_GSB_EVENT_MAX,
398 };
399 enum ipa_coalesce_event {
400   IPA_COALESCE_ENABLE = IPA_GSB_EVENT_MAX,
401   IPA_COALESCE_DISABLE,
402   IPA_COALESCE_EVENT_MAX
403 #define IPA_COALESCE_EVENT_MAX IPA_COALESCE_EVENT_MAX
404 };
405 #define WIGIG_CLIENT_CONNECT (IPA_COALESCE_EVENT_MAX)
406 enum ipa_peripheral_event {
407   IPA_PERIPHERAL_CONNECT = ECM_CONNECT,
408   IPA_PERIPHERAL_DISCONNECT = ECM_DISCONNECT
409 };
410 #define WIGIG_FST_SWITCH (WIGIG_CLIENT_CONNECT + 1)
411 #define WIGIG_EVENT_MAX (WIGIG_FST_SWITCH + 1)
412 enum ipa_sockv5_event {
413   IPA_SOCKV5_ADD = WIGIG_EVENT_MAX,
414   IPA_SOCKV5_DEL,
415   IPA_SOCKV5_EVENT_MAX
416 #define IPA_SOCKV5_EVENT_MAX IPA_SOCKV5_EVENT_MAX
417 };
418 #define IPA_EVENT_MAX_NUM (IPA_SOCKV5_EVENT_MAX)
419 #define IPA_EVENT_MAX ((int) IPA_EVENT_MAX_NUM)
420 enum ipa_rm_resource_name {
421   IPA_RM_RESOURCE_Q6_PROD = 0,
422   IPA_RM_RESOURCE_Q6_CONS = 1,
423   IPA_RM_RESOURCE_USB_PROD = 2,
424   IPA_RM_RESOURCE_USB_CONS = 3,
425   IPA_RM_RESOURCE_USB_DPL_DUMMY_PROD = 4,
426   IPA_RM_RESOURCE_USB_DPL_CONS = 5,
427   IPA_RM_RESOURCE_HSIC_PROD = 6,
428   IPA_RM_RESOURCE_HSIC_CONS = 7,
429   IPA_RM_RESOURCE_STD_ECM_PROD = 8,
430   IPA_RM_RESOURCE_APPS_CONS = 9,
431   IPA_RM_RESOURCE_RNDIS_PROD = 10,
432   IPA_RM_RESOURCE_WWAN_0_PROD = 12,
433   IPA_RM_RESOURCE_WLAN_PROD = 14,
434   IPA_RM_RESOURCE_WLAN_CONS = 15,
435   IPA_RM_RESOURCE_ODU_ADAPT_PROD = 16,
436   IPA_RM_RESOURCE_ODU_ADAPT_CONS = 17,
437   IPA_RM_RESOURCE_MHI_PROD = 18,
438   IPA_RM_RESOURCE_MHI_CONS = 19,
439   IPA_RM_RESOURCE_ETHERNET_PROD = 20,
440   IPA_RM_RESOURCE_ETHERNET_CONS = 21,
441 };
442 #define IPA_RM_RESOURCE_MAX (IPA_RM_RESOURCE_ETHERNET_CONS + 1)
443 enum ipa_hw_type {
444   IPA_HW_None = 0,
445   IPA_HW_v1_0 = 1,
446   IPA_HW_v1_1 = 2,
447   IPA_HW_v2_0 = 3,
448   IPA_HW_v2_1 = 4,
449   IPA_HW_v2_5 = 5,
450   IPA_HW_v2_6 = IPA_HW_v2_5,
451   IPA_HW_v2_6L = 6,
452   IPA_HW_v3_0 = 10,
453   IPA_HW_v3_1 = 11,
454   IPA_HW_v3_5 = 12,
455   IPA_HW_v3_5_1 = 13,
456   IPA_HW_v4_0 = 14,
457   IPA_HW_v4_1 = 15,
458   IPA_HW_v4_2 = 16,
459   IPA_HW_v4_5 = 17,
460 };
461 #define IPA_HW_MAX (IPA_HW_v4_5 + 1)
462 #define IPA_HW_v4_0 IPA_HW_v4_0
463 #define IPA_HW_v4_1 IPA_HW_v4_1
464 #define IPA_HW_v4_2 IPA_HW_v4_2
465 #define IPA_HW_v4_5 IPA_HW_v4_5
466 struct ipa_rule_attrib {
467   uint32_t attrib_mask;
468   uint16_t src_port_lo;
469   uint16_t src_port_hi;
470   uint16_t dst_port_lo;
471   uint16_t dst_port_hi;
472   uint8_t type;
473   uint8_t code;
474   uint8_t tos_value;
475   uint8_t tos_mask;
476   uint32_t spi;
477   uint16_t src_port;
478   uint16_t dst_port;
479   uint32_t meta_data;
480   uint32_t meta_data_mask;
481   uint8_t src_mac_addr[ETH_ALEN];
482   uint8_t src_mac_addr_mask[ETH_ALEN];
483   uint8_t dst_mac_addr[ETH_ALEN];
484   uint8_t dst_mac_addr_mask[ETH_ALEN];
485   uint16_t ether_type;
486   union {
487     struct {
488       uint8_t tos;
489       uint8_t protocol;
490       uint32_t src_addr;
491       uint32_t src_addr_mask;
492       uint32_t dst_addr;
493       uint32_t dst_addr_mask;
494     } v4;
495     struct {
496       uint8_t tc;
497       uint32_t flow_label;
498       uint8_t next_hdr;
499       uint32_t src_addr[4];
500       uint32_t src_addr_mask[4];
501       uint32_t dst_addr[4];
502       uint32_t dst_addr_mask[4];
503     } v6;
504   } u;
505   uint16_t vlan_id;
506   uint16_t payload_length;
507   uint32_t ext_attrib_mask;
508   uint8_t l2tp_udp_next_hdr;
509 };
510 #define IPA_IPFLTR_NUM_MEQ_32_EQNS 2
511 #define IPA_IPFLTR_NUM_IHL_MEQ_32_EQNS 2
512 #define IPA_IPFLTR_NUM_MEQ_128_EQNS 2
513 #define IPA_IPFLTR_NUM_IHL_RANGE_16_EQNS 2
514 struct ipa_ipfltr_eq_16 {
515   int8_t offset;
516   uint16_t value;
517 };
518 struct ipa_ipfltr_eq_32 {
519   int8_t offset;
520   uint32_t value;
521 };
522 struct ipa_ipfltr_mask_eq_128 {
523   int8_t offset;
524   uint8_t mask[16];
525   uint8_t value[16];
526 };
527 struct ipa_ipfltr_mask_eq_32 {
528   int8_t offset;
529   uint32_t mask;
530   uint32_t value;
531 };
532 struct ipa_ipfltr_range_eq_16 {
533   int8_t offset;
534   uint16_t range_low;
535   uint16_t range_high;
536 };
537 struct ipa_ipfltri_rule_eq {
538   uint16_t rule_eq_bitmap;
539   uint8_t tos_eq_present;
540   uint8_t tos_eq;
541   uint8_t protocol_eq_present;
542   uint8_t protocol_eq;
543   uint8_t num_ihl_offset_range_16;
544   struct ipa_ipfltr_range_eq_16 ihl_offset_range_16[IPA_IPFLTR_NUM_IHL_RANGE_16_EQNS];
545   uint8_t num_offset_meq_32;
546   struct ipa_ipfltr_mask_eq_32 offset_meq_32[IPA_IPFLTR_NUM_MEQ_32_EQNS];
547   uint8_t tc_eq_present;
548   uint8_t tc_eq;
549   uint8_t fl_eq_present;
550   uint32_t fl_eq;
551   uint8_t ihl_offset_eq_16_present;
552   struct ipa_ipfltr_eq_16 ihl_offset_eq_16;
553   uint8_t ihl_offset_eq_32_present;
554   struct ipa_ipfltr_eq_32 ihl_offset_eq_32;
555   uint8_t num_ihl_offset_meq_32;
556   struct ipa_ipfltr_mask_eq_32 ihl_offset_meq_32[IPA_IPFLTR_NUM_IHL_MEQ_32_EQNS];
557   uint8_t num_offset_meq_128;
558   struct ipa_ipfltr_mask_eq_128 offset_meq_128[IPA_IPFLTR_NUM_MEQ_128_EQNS];
559   uint8_t metadata_meq32_present;
560   struct ipa_ipfltr_mask_eq_32 metadata_meq32;
561   uint8_t ipv4_frag_eq_present;
562 };
563 struct ipa_flt_rule {
564   uint8_t retain_hdr;
565   uint8_t to_uc;
566   enum ipa_flt_action action;
567   uint32_t rt_tbl_hdl;
568   struct ipa_rule_attrib attrib;
569   struct ipa_ipfltri_rule_eq eq_attrib;
570   uint32_t rt_tbl_idx;
571   uint8_t eq_attrib_type;
572   uint8_t max_prio;
573   uint8_t hashable;
574   uint16_t rule_id;
575   uint8_t set_metadata;
576   uint8_t pdn_idx;
577 };
578 struct ipa_flt_rule_v2 {
579   uint8_t retain_hdr;
580   uint8_t to_uc;
581   enum ipa_flt_action action;
582   uint32_t rt_tbl_hdl;
583   struct ipa_rule_attrib attrib;
584   struct ipa_ipfltri_rule_eq eq_attrib;
585   uint32_t rt_tbl_idx;
586   uint8_t eq_attrib_type;
587   uint8_t max_prio;
588   uint8_t hashable;
589   uint16_t rule_id;
590   uint8_t set_metadata;
591   uint8_t pdn_idx;
592   uint8_t enable_stats;
593   uint8_t cnt_idx;
594 };
595 enum ipa_hdr_l2_type {
596   IPA_HDR_L2_NONE,
597   IPA_HDR_L2_ETHERNET_II,
598   IPA_HDR_L2_802_3,
599   IPA_HDR_L2_802_1Q,
600 };
601 #define IPA_HDR_L2_MAX (IPA_HDR_L2_802_1Q + 1)
602 #define IPA_HDR_L2_802_1Q IPA_HDR_L2_802_1Q
603 enum ipa_hdr_proc_type {
604   IPA_HDR_PROC_NONE,
605   IPA_HDR_PROC_ETHII_TO_ETHII,
606   IPA_HDR_PROC_ETHII_TO_802_3,
607   IPA_HDR_PROC_802_3_TO_ETHII,
608   IPA_HDR_PROC_802_3_TO_802_3,
609   IPA_HDR_PROC_L2TP_HEADER_ADD,
610   IPA_HDR_PROC_L2TP_HEADER_REMOVE,
611   IPA_HDR_PROC_ETHII_TO_ETHII_EX,
612   IPA_HDR_PROC_L2TP_UDP_HEADER_ADD,
613   IPA_HDR_PROC_L2TP_UDP_HEADER_REMOVE
614 };
615 #define IPA_HDR_PROC_MAX (IPA_HDR_PROC_L2TP_UDP_HEADER_REMOVE + 1)
616 struct ipa_rt_rule {
617   enum ipa_client_type dst;
618   uint32_t hdr_hdl;
619   uint32_t hdr_proc_ctx_hdl;
620   struct ipa_rule_attrib attrib;
621   uint8_t max_prio;
622   uint8_t hashable;
623   uint8_t retain_hdr;
624   uint8_t coalesce;
625 };
626 #define IPA_RT_SUPPORT_COAL
627 struct ipa_rt_rule_v2 {
628   enum ipa_client_type dst;
629   uint32_t hdr_hdl;
630   uint32_t hdr_proc_ctx_hdl;
631   struct ipa_rule_attrib attrib;
632   uint8_t max_prio;
633   uint8_t hashable;
634   uint8_t retain_hdr;
635   uint8_t coalesce;
636   uint8_t enable_stats;
637   uint8_t cnt_idx;
638 };
639 struct ipa_hdr_add {
640   char name[IPA_RESOURCE_NAME_MAX];
641   uint8_t hdr[IPA_HDR_MAX_SIZE];
642   uint8_t hdr_len;
643   enum ipa_hdr_l2_type type;
644   uint8_t is_partial;
645   uint32_t hdr_hdl;
646   int status;
647   uint8_t is_eth2_ofst_valid;
648   uint16_t eth2_ofst;
649 };
650 struct ipa_ioc_add_hdr {
651   uint8_t commit;
652   uint8_t num_hdrs;
653   struct ipa_hdr_add hdr[0];
654 };
655 struct ipa_l2tp_header_add_procparams {
656   uint32_t eth_hdr_retained : 1;
657   uint32_t input_ip_version : 1;
658   uint32_t output_ip_version : 1;
659   uint32_t second_pass : 1;
660   uint32_t reserved : 28;
661 };
662 struct ipa_l2tp_header_remove_procparams {
663   uint32_t hdr_len_remove : 8;
664   uint32_t eth_hdr_retained : 1;
665   uint32_t hdr_ofst_pkt_size_valid : 1;
666   uint32_t hdr_ofst_pkt_size : 6;
667   uint32_t hdr_endianness : 1;
668   uint32_t reserved : 15;
669 };
670 struct ipa_l2tp_hdr_proc_ctx_params {
671   struct ipa_l2tp_header_add_procparams hdr_add_param;
672   struct ipa_l2tp_header_remove_procparams hdr_remove_param;
673   uint8_t is_dst_pipe_valid;
674   enum ipa_client_type dst_pipe;
675 };
676 struct ipa_eth_II_to_eth_II_ex_procparams {
677   uint32_t input_ethhdr_negative_offset : 8;
678   uint32_t output_ethhdr_negative_offset : 8;
679   uint32_t reserved : 16;
680 };
681 #define L2TP_USER_SPACE_SPECIFY_DST_PIPE
682 struct ipa_hdr_proc_ctx_add {
683   enum ipa_hdr_proc_type type;
684   uint32_t hdr_hdl;
685   uint32_t proc_ctx_hdl;
686   int status;
687   struct ipa_l2tp_hdr_proc_ctx_params l2tp_params;
688   struct ipa_eth_II_to_eth_II_ex_procparams generic_params;
689 };
690 #define IPA_L2TP_HDR_PROC_SUPPORT
691 struct ipa_ioc_add_hdr_proc_ctx {
692   uint8_t commit;
693   uint8_t num_proc_ctxs;
694   struct ipa_hdr_proc_ctx_add proc_ctx[0];
695 };
696 struct ipa_ioc_copy_hdr {
697   char name[IPA_RESOURCE_NAME_MAX];
698   uint8_t hdr[IPA_HDR_MAX_SIZE];
699   uint8_t hdr_len;
700   enum ipa_hdr_l2_type type;
701   uint8_t is_partial;
702   uint8_t is_eth2_ofst_valid;
703   uint16_t eth2_ofst;
704 };
705 struct ipa_ioc_get_hdr {
706   char name[IPA_RESOURCE_NAME_MAX];
707   uint32_t hdl;
708 };
709 struct ipa_hdr_del {
710   uint32_t hdl;
711   int status;
712 };
713 struct ipa_ioc_del_hdr {
714   uint8_t commit;
715   uint8_t num_hdls;
716   struct ipa_hdr_del hdl[0];
717 };
718 struct ipa_hdr_proc_ctx_del {
719   uint32_t hdl;
720   int status;
721 };
722 struct ipa_ioc_del_hdr_proc_ctx {
723   uint8_t commit;
724   uint8_t num_hdls;
725   struct ipa_hdr_proc_ctx_del hdl[0];
726 };
727 struct ipa_rt_rule_add {
728   struct ipa_rt_rule rule;
729   uint8_t at_rear;
730   uint32_t rt_rule_hdl;
731   int status;
732 };
733 struct ipa_rt_rule_add_v2 {
734   uint8_t at_rear;
735   uint32_t rt_rule_hdl;
736   int status;
737   struct ipa_rt_rule_v2 rule;
738 };
739 struct ipa_ioc_add_rt_rule {
740   uint8_t commit;
741   enum ipa_ip_type ip;
742   char rt_tbl_name[IPA_RESOURCE_NAME_MAX];
743   uint8_t num_rules;
744   struct ipa_rt_rule_add rules[0];
745 };
746 struct ipa_ioc_add_rt_rule_v2 {
747   uint8_t commit;
748   enum ipa_ip_type ip;
749   char rt_tbl_name[IPA_RESOURCE_NAME_MAX];
750   uint8_t num_rules;
751   uint32_t rule_add_size;
752   uintptr_t rules;
753 };
754 struct ipa_ioc_add_rt_rule_after {
755   uint8_t commit;
756   enum ipa_ip_type ip;
757   char rt_tbl_name[IPA_RESOURCE_NAME_MAX];
758   uint8_t num_rules;
759   uint32_t add_after_hdl;
760   struct ipa_rt_rule_add rules[0];
761 };
762 struct ipa_ioc_add_rt_rule_after_v2 {
763   uint8_t commit;
764   enum ipa_ip_type ip;
765   char rt_tbl_name[IPA_RESOURCE_NAME_MAX];
766   uint8_t num_rules;
767   uint32_t add_after_hdl;
768   uint32_t rule_add_size;
769   uintptr_t rules;
770 };
771 struct ipa_rt_rule_mdfy {
772   struct ipa_rt_rule rule;
773   uint32_t rt_rule_hdl;
774   int status;
775 };
776 struct ipa_rt_rule_mdfy_v2 {
777   uint32_t rt_rule_hdl;
778   int status;
779   struct ipa_rt_rule_v2 rule;
780 };
781 struct ipa_ioc_mdfy_rt_rule {
782   uint8_t commit;
783   enum ipa_ip_type ip;
784   uint8_t num_rules;
785   struct ipa_rt_rule_mdfy rules[0];
786 };
787 struct ipa_ioc_mdfy_rt_rule_v2 {
788   uint8_t commit;
789   enum ipa_ip_type ip;
790   uint8_t num_rules;
791   uint32_t rule_mdfy_size;
792   uintptr_t rules;
793 };
794 struct ipa_rt_rule_del {
795   uint32_t hdl;
796   int status;
797 };
798 struct ipa_rt_rule_add_ext {
799   struct ipa_rt_rule rule;
800   uint8_t at_rear;
801   uint32_t rt_rule_hdl;
802   int status;
803   uint16_t rule_id;
804 };
805 struct ipa_rt_rule_add_ext_v2 {
806   uint8_t at_rear;
807   uint32_t rt_rule_hdl;
808   int status;
809   uint16_t rule_id;
810   struct ipa_rt_rule_v2 rule;
811 };
812 struct ipa_ioc_add_rt_rule_ext {
813   uint8_t commit;
814   enum ipa_ip_type ip;
815   char rt_tbl_name[IPA_RESOURCE_NAME_MAX];
816   uint8_t num_rules;
817   struct ipa_rt_rule_add_ext rules[0];
818 };
819 struct ipa_ioc_add_rt_rule_ext_v2 {
820   uint8_t commit;
821   enum ipa_ip_type ip;
822   char rt_tbl_name[IPA_RESOURCE_NAME_MAX];
823   uint8_t num_rules;
824   uint32_t rule_add_ext_size;
825   uintptr_t rules;
826 };
827 struct ipa_ioc_del_rt_rule {
828   uint8_t commit;
829   enum ipa_ip_type ip;
830   uint8_t num_hdls;
831   struct ipa_rt_rule_del hdl[0];
832 };
833 struct ipa_ioc_get_rt_tbl_indx {
834   enum ipa_ip_type ip;
835   char name[IPA_RESOURCE_NAME_MAX];
836   uint32_t idx;
837 };
838 struct ipa_flt_rule_add {
839   struct ipa_flt_rule rule;
840   uint8_t at_rear;
841   uint32_t flt_rule_hdl;
842   int status;
843 };
844 struct ipa_flt_rule_add_v2 {
845   uint8_t at_rear;
846   uint32_t flt_rule_hdl;
847   int status;
848   struct ipa_flt_rule_v2 rule;
849 };
850 struct ipa_ioc_add_flt_rule {
851   uint8_t commit;
852   enum ipa_ip_type ip;
853   enum ipa_client_type ep;
854   uint8_t global;
855   uint8_t num_rules;
856   struct ipa_flt_rule_add rules[0];
857 };
858 struct ipa_ioc_add_flt_rule_v2 {
859   uint8_t commit;
860   enum ipa_ip_type ip;
861   enum ipa_client_type ep;
862   uint8_t global;
863   uint8_t num_rules;
864   uint32_t flt_rule_size;
865   uintptr_t rules;
866 };
867 struct ipa_ioc_add_flt_rule_after {
868   uint8_t commit;
869   enum ipa_ip_type ip;
870   enum ipa_client_type ep;
871   uint8_t num_rules;
872   uint32_t add_after_hdl;
873   struct ipa_flt_rule_add rules[0];
874 };
875 struct ipa_ioc_add_flt_rule_after_v2 {
876   uint8_t commit;
877   enum ipa_ip_type ip;
878   enum ipa_client_type ep;
879   uint8_t num_rules;
880   uint32_t add_after_hdl;
881   uint32_t flt_rule_size;
882   uintptr_t rules;
883 };
884 struct ipa_flt_rule_mdfy {
885   struct ipa_flt_rule rule;
886   uint32_t rule_hdl;
887   int status;
888 };
889 struct ipa_flt_rule_mdfy_v2 {
890   uint32_t rule_hdl;
891   int status;
892   struct ipa_flt_rule_v2 rule;
893 };
894 struct ipa_ioc_mdfy_flt_rule {
895   uint8_t commit;
896   enum ipa_ip_type ip;
897   uint8_t num_rules;
898   struct ipa_flt_rule_mdfy rules[0];
899 };
900 struct ipa_ioc_mdfy_flt_rule_v2 {
901   uint8_t commit;
902   enum ipa_ip_type ip;
903   uint8_t num_rules;
904   uint32_t rule_mdfy_size;
905   uintptr_t rules;
906 };
907 struct ipa_flt_rule_del {
908   uint32_t hdl;
909   int status;
910 };
911 struct ipa_ioc_del_flt_rule {
912   uint8_t commit;
913   enum ipa_ip_type ip;
914   uint8_t num_hdls;
915   struct ipa_flt_rule_del hdl[0];
916 };
917 struct ipa_ioc_get_rt_tbl {
918   enum ipa_ip_type ip;
919   char name[IPA_RESOURCE_NAME_MAX];
920   uint32_t hdl;
921 };
922 struct ipa_ioc_query_intf {
923   char name[IPA_RESOURCE_NAME_MAX];
924   uint32_t num_tx_props;
925   uint32_t num_rx_props;
926   uint32_t num_ext_props;
927   enum ipa_client_type excp_pipe;
928 };
929 struct ipa_ioc_tx_intf_prop {
930   enum ipa_ip_type ip;
931   struct ipa_rule_attrib attrib;
932   enum ipa_client_type dst_pipe;
933   enum ipa_client_type alt_dst_pipe;
934   char hdr_name[IPA_RESOURCE_NAME_MAX];
935   enum ipa_hdr_l2_type hdr_l2_type;
936 };
937 struct ipa_ioc_query_intf_tx_props {
938   char name[IPA_RESOURCE_NAME_MAX];
939   uint32_t num_tx_props;
940   struct ipa_ioc_tx_intf_prop tx[0];
941 };
942 struct ipa_ioc_ext_intf_prop {
943   enum ipa_ip_type ip;
944   struct ipa_ipfltri_rule_eq eq_attrib;
945   enum ipa_flt_action action;
946   uint32_t rt_tbl_idx;
947   uint8_t mux_id;
948   uint32_t filter_hdl;
949   uint8_t is_xlat_rule;
950   uint32_t rule_id;
951   uint8_t is_rule_hashable;
952 #define IPA_V6_UL_WL_FIREWALL_HANDLE
953   uint8_t replicate_needed;
954 };
955 struct ipa_ioc_query_intf_ext_props {
956   char name[IPA_RESOURCE_NAME_MAX];
957   uint32_t num_ext_props;
958   struct ipa_ioc_ext_intf_prop ext[0];
959 };
960 struct ipa_ioc_rx_intf_prop {
961   enum ipa_ip_type ip;
962   struct ipa_rule_attrib attrib;
963   enum ipa_client_type src_pipe;
964   enum ipa_hdr_l2_type hdr_l2_type;
965 };
966 struct ipa_ioc_query_intf_rx_props {
967   char name[IPA_RESOURCE_NAME_MAX];
968   uint32_t num_rx_props;
969   struct ipa_ioc_rx_intf_prop rx[0];
970 };
971 struct ipa_ioc_nat_alloc_mem {
972   char dev_name[IPA_RESOURCE_NAME_MAX];
973   size_t size;
974   off_t offset;
975 };
976 struct ipa_ioc_nat_ipv6ct_table_alloc {
977   size_t size;
978   off_t offset;
979 };
980 struct ipa_ioc_v4_nat_init {
981   uint8_t tbl_index;
982   uint32_t ipv4_rules_offset;
983   uint32_t expn_rules_offset;
984   uint32_t index_offset;
985   uint32_t index_expn_offset;
986   uint16_t table_entries;
987   uint16_t expn_table_entries;
988   uint32_t ip_addr;
989   uint8_t mem_type;
990   uint8_t focus_change;
991 };
992 struct ipa_ioc_ipv6ct_init {
993   uint32_t base_table_offset;
994   uint32_t expn_table_offset;
995   uint16_t table_entries;
996   uint16_t expn_table_entries;
997   uint8_t tbl_index;
998 };
999 struct ipa_ioc_v4_nat_del {
1000   uint8_t table_index;
1001   uint32_t public_ip_addr;
1002 };
1003 struct ipa_ioc_nat_ipv6ct_table_del {
1004   uint8_t table_index;
1005   uint8_t mem_type;
1006 };
1007 struct ipa_ioc_nat_dma_one {
1008   uint8_t table_index;
1009   uint8_t base_addr;
1010   uint32_t offset;
1011   uint16_t data;
1012 };
1013 struct ipa_ioc_nat_dma_cmd {
1014   uint8_t entries;
1015   uint8_t mem_type;
1016   struct ipa_ioc_nat_dma_one dma[0];
1017 };
1018 struct ipa_ioc_nat_pdn_entry {
1019   uint8_t pdn_index;
1020   uint32_t public_ip;
1021   uint32_t src_metadata;
1022   uint32_t dst_metadata;
1023 };
1024 struct ipa_ioc_vlan_iface_info {
1025   char name[IPA_RESOURCE_NAME_MAX];
1026   uint8_t vlan_id;
1027 };
1028 enum ipa_l2tp_tunnel_type {
1029   IPA_L2TP_TUNNEL_IP = 1,
1030   IPA_L2TP_TUNNEL_UDP = 2
1031 #define IPA_L2TP_TUNNEL_UDP IPA_L2TP_TUNNEL_UDP
1032 };
1033 struct ipa_ioc_l2tp_vlan_mapping_info {
1034   enum ipa_ip_type iptype;
1035   char l2tp_iface_name[IPA_RESOURCE_NAME_MAX];
1036   uint8_t l2tp_session_id;
1037   char vlan_iface_name[IPA_RESOURCE_NAME_MAX];
1038   enum ipa_l2tp_tunnel_type tunnel_type;
1039   uint16_t src_port;
1040   uint16_t dst_port;
1041   uint16_t mtu;
1042 };
1043 struct ipa_ioc_gsb_info {
1044   char name[IPA_RESOURCE_NAME_MAX];
1045 };
1046 #define QUERY_MAX_EP_PAIRS 2
1047 #define IPA_USB0_EP_ID 11
1048 #define IPA_USB1_EP_ID 12
1049 #define IPA_PCIE0_EP_ID 21
1050 #define IPA_PCIE1_EP_ID 22
1051 enum ipa_peripheral_ep_type {
1052   IPA_DATA_EP_TYP_RESERVED = 0,
1053   IPA_DATA_EP_TYP_HSIC = 1,
1054   IPA_DATA_EP_TYP_HSUSB = 2,
1055   IPA_DATA_EP_TYP_PCIE = 3,
1056   IPA_DATA_EP_TYP_EMBEDDED = 4,
1057   IPA_DATA_EP_TYP_BAM_DMUX,
1058 };
1059 enum ipa_data_ep_prot_type {
1060   IPA_PROT_RMNET = 0,
1061   IPA_PROT_RMNET_CV2X = 1,
1062   IPA_PROT_MAX
1063 };
1064 struct ipa_ep_pair_info {
1065   uint32_t consumer_pipe_num;
1066   uint32_t producer_pipe_num;
1067   uint32_t ep_id;
1068 };
1069 struct ipa_ioc_get_ep_info {
1070   enum ipa_peripheral_ep_type ep_type;
1071   uint8_t max_ep_pairs;
1072   uint8_t num_ep_pairs;
1073   uint32_t ep_pair_size;
1074   uintptr_t info;
1075   enum ipa_data_ep_prot_type teth_prot;
1076   uint8_t teth_prot_valid;
1077 };
1078 struct ipa_ioc_wigig_fst_switch {
1079   uint8_t netdev_name[IPA_RESOURCE_NAME_MAX];
1080   uint8_t client_mac_addr[IPA_MAC_ADDR_SIZE];
1081   int to_wigig;
1082 };
1083 struct ipa_msg_meta {
1084   uint8_t msg_type;
1085   uint8_t rsvd;
1086   uint16_t msg_len;
1087 };
1088 struct ipa_wlan_msg {
1089   char name[IPA_RESOURCE_NAME_MAX];
1090   uint8_t mac_addr[IPA_MAC_ADDR_SIZE];
1091 };
1092 enum ipa_wlan_hdr_attrib_type {
1093   WLAN_HDR_ATTRIB_MAC_ADDR,
1094   WLAN_HDR_ATTRIB_STA_ID
1095 };
1096 struct ipa_wlan_hdr_attrib_val {
1097   enum ipa_wlan_hdr_attrib_type attrib_type;
1098   uint8_t offset;
1099   union {
1100     uint8_t mac_addr[IPA_MAC_ADDR_SIZE];
1101     uint8_t sta_id;
1102   } u;
1103 };
1104 struct ipa_wlan_msg_ex {
1105   char name[IPA_RESOURCE_NAME_MAX];
1106   uint8_t num_of_attribs;
1107   struct ipa_wlan_hdr_attrib_val attribs[0];
1108 };
1109 struct ipa_wigig_msg {
1110   char name[IPA_RESOURCE_NAME_MAX];
1111   uint8_t client_mac_addr[IPA_MAC_ADDR_SIZE];
1112   union {
1113     enum ipa_client_type ipa_client;
1114     uint8_t to_wigig;
1115   } u;
1116 };
1117 struct ipa_ecm_msg {
1118   char name[IPA_RESOURCE_NAME_MAX];
1119   int ifindex;
1120 };
1121 struct ipa_wan_msg {
1122   char upstream_ifname[IPA_RESOURCE_NAME_MAX];
1123   char tethered_ifname[IPA_RESOURCE_NAME_MAX];
1124   enum ipa_ip_type ip;
1125   uint32_t ipv4_addr_gw;
1126   uint32_t ipv6_addr_gw[IPA_WAN_MSG_IPv6_ADDR_GW_LEN];
1127 };
1128 struct ipacm_socksv5_info {
1129   enum ipa_ip_type ip_type;
1130   uint32_t ipv4_src;
1131   uint32_t ipv4_dst;
1132   uint32_t ipv6_src[4];
1133   uint32_t ipv6_dst[4];
1134   uint16_t src_port;
1135   uint16_t dst_port;
1136   uint16_t index;
1137 };
1138 struct ipa_socksv5_msg {
1139   struct ipacm_socksv5_info ul_in;
1140   struct ipacm_socksv5_info dl_in;
1141   uint16_t handle;
1142 };
1143 struct ipa_ioc_rm_dependency {
1144   enum ipa_rm_resource_name resource_name;
1145   enum ipa_rm_resource_name depends_on_name;
1146 };
1147 struct ipa_ioc_generate_flt_eq {
1148   enum ipa_ip_type ip;
1149   struct ipa_rule_attrib attrib;
1150   struct ipa_ipfltri_rule_eq eq_attrib;
1151 };
1152 struct ipa_ioc_write_qmapid {
1153   enum ipa_client_type client;
1154   uint8_t qmap_id;
1155 };
1156 struct ipa_flt_rt_counter_alloc {
1157   uint8_t num_counters;
1158   uint8_t allow_less;
1159   uint8_t start_id;
1160   uint8_t end_id;
1161 };
1162 struct ipa_ioc_flt_rt_counter_alloc {
1163   int hdl;
1164   struct ipa_flt_rt_counter_alloc hw_counter;
1165   struct ipa_flt_rt_counter_alloc sw_counter;
1166 };
1167 struct ipa_flt_rt_stats {
1168   uint32_t num_pkts;
1169   uint32_t num_pkts_hash;
1170   uint64_t num_bytes;
1171 };
1172 struct ipa_ioc_flt_rt_query {
1173   uint8_t start_id;
1174   uint8_t end_id;
1175   uint8_t reset;
1176   uint32_t stats_size;
1177   uintptr_t stats;
1178 };
1179 enum ipacm_client_enum {
1180   IPACM_CLIENT_USB = 1,
1181   IPACM_CLIENT_WLAN,
1182   IPACM_CLIENT_MAX
1183 };
1184 #define IPACM_SUPPORT_OF_LAN_STATS_FOR_ODU_CLIENTS
1185 enum ipacm_per_client_device_type {
1186   IPACM_CLIENT_DEVICE_TYPE_USB = 0,
1187   IPACM_CLIENT_DEVICE_TYPE_WLAN = 1,
1188   IPACM_CLIENT_DEVICE_TYPE_ETH = 2,
1189   IPACM_CLIENT_DEVICE_TYPE_ODU = 3,
1190   IPACM_CLIENT_DEVICE_MAX
1191 };
1192 #define IPACM_MAX_CLIENT_DEVICE_TYPES IPACM_CLIENT_DEVICE_MAX
1193 struct ipa_lan_client_msg {
1194   char lanIface[IPA_RESOURCE_NAME_MAX];
1195   uint8_t mac[IPA_MAC_ADDR_SIZE];
1196 };
1197 struct ipa_lan_client {
1198   uint8_t mac[IPA_MAC_ADDR_SIZE];
1199   int8_t client_idx;
1200   uint8_t inited;
1201 };
1202 struct ipa_lan_client_cntr_index {
1203   uint8_t ul_cnt_idx;
1204   uint8_t dl_cnt_idx;
1205 };
1206 struct ipa_tether_device_info {
1207   int32_t ul_src_pipe;
1208   uint8_t hdr_len;
1209   uint32_t num_clients;
1210   struct ipa_lan_client lan_client[IPA_MAX_NUM_HW_PATH_CLIENTS];
1211   struct ipa_lan_client_cntr_index lan_client_indices[IPA_MAX_NUM_HW_PATH_CLIENTS];
1212 };
1213 enum ipa_vlan_ifaces {
1214   IPA_VLAN_IF_ETH,
1215   IPA_VLAN_IF_RNDIS,
1216   IPA_VLAN_IF_ECM
1217 };
1218 #define IPA_VLAN_IF_EMAC IPA_VLAN_IF_ETH
1219 #define IPA_VLAN_IF_MAX (IPA_VLAN_IF_ECM + 1)
1220 struct ipa_ioc_get_vlan_mode {
1221   enum ipa_vlan_ifaces iface;
1222   uint32_t is_vlan_mode;
1223 };
1224 struct ipa_ioc_bridge_vlan_mapping_info {
1225   char bridge_name[IPA_RESOURCE_NAME_MAX];
1226   uint16_t vlan_id;
1227   uint32_t bridge_ipv4;
1228   uint32_t subnet_mask;
1229 };
1230 struct ipa_coalesce_info {
1231   uint8_t qmap_id;
1232   uint8_t tcp_enable;
1233   uint8_t udp_enable;
1234 };
1235 struct ipa_odl_ep_info {
1236   __u32 cons_pipe_num;
1237   __u32 prod_pipe_num;
1238   __u32 peripheral_iface_id;
1239   __u32 ep_type;
1240 };
1241 struct odl_agg_pipe_info {
1242   __u16 agg_byte_limit;
1243 };
1244 struct ipa_odl_modem_config {
1245   __u8 config_status;
1246 };
1247 #define IPA_IOC_ADD_HDR _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ADD_HDR, struct ipa_ioc_add_hdr *)
1248 #define IPA_IOC_DEL_HDR _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_DEL_HDR, struct ipa_ioc_del_hdr *)
1249 #define IPA_IOC_ADD_RT_RULE _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ADD_RT_RULE, struct ipa_ioc_add_rt_rule *)
1250 #define IPA_IOC_ADD_RT_RULE_V2 _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ADD_RT_RULE_V2, struct ipa_ioc_add_rt_rule_v2 *)
1251 #define IPA_IOC_ADD_RT_RULE_EXT _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ADD_RT_RULE_EXT, struct ipa_ioc_add_rt_rule_ext *)
1252 #define IPA_IOC_ADD_RT_RULE_EXT_V2 _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ADD_RT_RULE_EXT_V2, struct ipa_ioc_add_rt_rule_ext_v2 *)
1253 #define IPA_IOC_ADD_RT_RULE_AFTER _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ADD_RT_RULE_AFTER, struct ipa_ioc_add_rt_rule_after *)
1254 #define IPA_IOC_ADD_RT_RULE_AFTER_V2 _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ADD_RT_RULE_AFTER_V2, struct ipa_ioc_add_rt_rule_after_v2 *)
1255 #define IPA_IOC_DEL_RT_RULE _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_DEL_RT_RULE, struct ipa_ioc_del_rt_rule *)
1256 #define IPA_IOC_ADD_FLT_RULE _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ADD_FLT_RULE, struct ipa_ioc_add_flt_rule *)
1257 #define IPA_IOC_ADD_FLT_RULE_V2 _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ADD_FLT_RULE_V2, struct ipa_ioc_add_flt_rule_v2 *)
1258 #define IPA_IOC_ADD_FLT_RULE_AFTER _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ADD_FLT_RULE_AFTER, struct ipa_ioc_add_flt_rule_after *)
1259 #define IPA_IOC_ADD_FLT_RULE_AFTER_V2 _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ADD_FLT_RULE_AFTER_V2, struct ipa_ioc_add_flt_rule_after_v2 *)
1260 #define IPA_IOC_DEL_FLT_RULE _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_DEL_FLT_RULE, struct ipa_ioc_del_flt_rule *)
1261 #define IPA_IOC_COMMIT_HDR _IO(IPA_IOC_MAGIC, IPA_IOCTL_COMMIT_HDR)
1262 #define IPA_IOC_RESET_HDR _IO(IPA_IOC_MAGIC, IPA_IOCTL_RESET_HDR)
1263 #define IPA_IOC_COMMIT_RT _IOW(IPA_IOC_MAGIC, IPA_IOCTL_COMMIT_RT, enum ipa_ip_type)
1264 #define IPA_IOC_RESET_RT _IOW(IPA_IOC_MAGIC, IPA_IOCTL_RESET_RT, enum ipa_ip_type)
1265 #define IPA_IOC_COMMIT_FLT _IOW(IPA_IOC_MAGIC, IPA_IOCTL_COMMIT_FLT, enum ipa_ip_type)
1266 #define IPA_IOC_RESET_FLT _IOW(IPA_IOC_MAGIC, IPA_IOCTL_RESET_FLT, enum ipa_ip_type)
1267 #define IPA_IOC_DUMP _IO(IPA_IOC_MAGIC, IPA_IOCTL_DUMP)
1268 #define IPA_IOC_GET_RT_TBL _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_GET_RT_TBL, struct ipa_ioc_get_rt_tbl *)
1269 #define IPA_IOC_PUT_RT_TBL _IOW(IPA_IOC_MAGIC, IPA_IOCTL_PUT_RT_TBL, uint32_t)
1270 #define IPA_IOC_COPY_HDR _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_COPY_HDR, struct ipa_ioc_copy_hdr *)
1271 #define IPA_IOC_QUERY_INTF _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_QUERY_INTF, struct ipa_ioc_query_intf *)
1272 #define IPA_IOC_QUERY_INTF_TX_PROPS _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_QUERY_INTF_TX_PROPS, struct ipa_ioc_query_intf_tx_props *)
1273 #define IPA_IOC_QUERY_INTF_RX_PROPS _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_QUERY_INTF_RX_PROPS, struct ipa_ioc_query_intf_rx_props *)
1274 #define IPA_IOC_QUERY_INTF_EXT_PROPS _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_QUERY_INTF_EXT_PROPS, struct ipa_ioc_query_intf_ext_props *)
1275 #define IPA_IOC_GET_HDR _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_GET_HDR, struct ipa_ioc_get_hdr *)
1276 #define IPA_IOC_PUT_HDR _IOW(IPA_IOC_MAGIC, IPA_IOCTL_PUT_HDR, uint32_t)
1277 #define IPA_IOC_ALLOC_NAT_MEM _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ALLOC_NAT_MEM, struct ipa_ioc_nat_alloc_mem *)
1278 #define IPA_IOC_ALLOC_NAT_TABLE _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ALLOC_NAT_TABLE, struct ipa_ioc_nat_ipv6ct_table_alloc *)
1279 #define IPA_IOC_ALLOC_IPV6CT_TABLE _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ALLOC_IPV6CT_TABLE, struct ipa_ioc_nat_ipv6ct_table_alloc *)
1280 #define IPA_IOC_V4_INIT_NAT _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_V4_INIT_NAT, struct ipa_ioc_v4_nat_init *)
1281 #define IPA_IOC_INIT_IPV6CT_TABLE _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_INIT_IPV6CT_TABLE, struct ipa_ioc_ipv6ct_init *)
1282 #define IPA_IOC_NAT_DMA _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_NAT_DMA, struct ipa_ioc_nat_dma_cmd *)
1283 #define IPA_IOC_TABLE_DMA_CMD _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_TABLE_DMA_CMD, struct ipa_ioc_nat_dma_cmd *)
1284 #define IPA_IOC_V4_DEL_NAT _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_V4_DEL_NAT, struct ipa_ioc_v4_nat_del *)
1285 #define IPA_IOC_DEL_NAT_TABLE _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_DEL_NAT_TABLE, struct ipa_ioc_nat_ipv6ct_table_del *)
1286 #define IPA_IOC_DEL_IPV6CT_TABLE _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_DEL_IPV6CT_TABLE, struct ipa_ioc_nat_ipv6ct_table_del *)
1287 #define IPA_IOC_GET_NAT_OFFSET _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_GET_NAT_OFFSET, uint32_t *)
1288 #define IPA_IOC_NAT_MODIFY_PDN _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_NAT_MODIFY_PDN, struct ipa_ioc_nat_pdn_entry *)
1289 #define IPA_IOC_SET_FLT _IOW(IPA_IOC_MAGIC, IPA_IOCTL_SET_FLT, uint32_t)
1290 #define IPA_IOC_PULL_MSG _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_PULL_MSG, struct ipa_msg_meta *)
1291 #define IPA_IOC_RM_ADD_DEPENDENCY _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_RM_ADD_DEPENDENCY, struct ipa_ioc_rm_dependency *)
1292 #define IPA_IOC_RM_DEL_DEPENDENCY _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_RM_DEL_DEPENDENCY, struct ipa_ioc_rm_dependency *)
1293 #define IPA_IOC_GENERATE_FLT_EQ _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_GENERATE_FLT_EQ, struct ipa_ioc_generate_flt_eq *)
1294 #define IPA_IOC_QUERY_EP_MAPPING _IOR(IPA_IOC_MAGIC, IPA_IOCTL_QUERY_EP_MAPPING, uint32_t)
1295 #define IPA_IOC_QUERY_RT_TBL_INDEX _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_QUERY_RT_TBL_INDEX, struct ipa_ioc_get_rt_tbl_indx *)
1296 #define IPA_IOC_WRITE_QMAPID _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_WRITE_QMAPID, struct ipa_ioc_write_qmapid *)
1297 #define IPA_IOC_MDFY_FLT_RULE _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_MDFY_FLT_RULE, struct ipa_ioc_mdfy_flt_rule *)
1298 #define IPA_IOC_MDFY_FLT_RULE_V2 _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_MDFY_FLT_RULE_V2, struct ipa_ioc_mdfy_flt_rule_v2 *)
1299 #define IPA_IOC_MDFY_RT_RULE _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_MDFY_RT_RULE, struct ipa_ioc_mdfy_rt_rule *)
1300 #define IPA_IOC_MDFY_RT_RULE_V2 _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_MDFY_RT_RULE_V2, struct ipa_ioc_mdfy_rt_rule_v2 *)
1301 #define IPA_IOC_NOTIFY_WAN_UPSTREAM_ROUTE_ADD _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_NOTIFY_WAN_UPSTREAM_ROUTE_ADD, struct ipa_wan_msg *)
1302 #define IPA_IOC_NOTIFY_WAN_UPSTREAM_ROUTE_DEL _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_NOTIFY_WAN_UPSTREAM_ROUTE_DEL, struct ipa_wan_msg *)
1303 #define IPA_IOC_NOTIFY_WAN_EMBMS_CONNECTED _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_NOTIFY_WAN_EMBMS_CONNECTED, struct ipa_wan_msg *)
1304 #define IPA_IOC_ADD_HDR_PROC_CTX _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ADD_HDR_PROC_CTX, struct ipa_ioc_add_hdr_proc_ctx *)
1305 #define IPA_IOC_DEL_HDR_PROC_CTX _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_DEL_HDR_PROC_CTX, struct ipa_ioc_del_hdr_proc_ctx *)
1306 #define IPA_IOC_GET_HW_VERSION _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_GET_HW_VERSION, enum ipa_hw_type *)
1307 #define IPA_IOC_ADD_VLAN_IFACE _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ADD_VLAN_IFACE, struct ipa_ioc_vlan_iface_info *)
1308 #define IPA_IOC_DEL_VLAN_IFACE _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_DEL_VLAN_IFACE, struct ipa_ioc_vlan_iface_info *)
1309 #define IPA_IOC_ADD_L2TP_VLAN_MAPPING _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ADD_L2TP_VLAN_MAPPING, struct ipa_ioc_l2tp_vlan_mapping_info *)
1310 #define IPA_IOC_DEL_L2TP_VLAN_MAPPING _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_DEL_L2TP_VLAN_MAPPING, struct ipa_ioc_l2tp_vlan_mapping_info *)
1311 #define IPA_IOC_GET_VLAN_MODE _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_GET_VLAN_MODE, struct ipa_ioc_get_vlan_mode *)
1312 #define IPA_IOC_ADD_BRIDGE_VLAN_MAPPING _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ADD_BRIDGE_VLAN_MAPPING, struct ipa_ioc_bridge_vlan_mapping_info)
1313 #define IPA_IOC_DEL_BRIDGE_VLAN_MAPPING _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_DEL_BRIDGE_VLAN_MAPPING, struct ipa_ioc_bridge_vlan_mapping_info)
1314 #define IPA_IOC_CLEANUP _IO(IPA_IOC_MAGIC, IPA_IOCTL_CLEANUP)
1315 #define IPA_IOC_QUERY_WLAN_CLIENT _IO(IPA_IOC_MAGIC, IPA_IOCTL_QUERY_WLAN_CLIENT)
1316 #define IPA_IOC_ODL_QUERY_ADAPL_EP_INFO _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ODL_QUERY_ADAPL_EP_INFO, struct ipa_odl_ep_info)
1317 #define IPA_IOC_ODL_GET_AGG_BYTE_LIMIT _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ODL_GET_AGG_BYTE_LIMIT, struct odl_agg_pipe_info)
1318 #define IPA_IOC_ODL_QUERY_MODEM_CONFIG _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_ODL_QUERY_MODEM_CONFIG, struct ipa_odl_modem_config)
1319 #define IPA_IOC_GSB_CONNECT _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_GSB_CONNECT, struct ipa_ioc_gsb_info)
1320 #define IPA_IOC_GSB_DISCONNECT _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_GSB_DISCONNECT, struct ipa_ioc_gsb_info)
1321 #define IPA_IOC_WIGIG_FST_SWITCH _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_WIGIG_FST_SWITCH, struct ipa_ioc_wigig_fst_switch)
1322 #define IPA_IOC_FNR_COUNTER_ALLOC _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_FNR_COUNTER_ALLOC, struct ipa_ioc_flt_rt_counter_alloc)
1323 #define IPA_IOC_FNR_COUNTER_DEALLOC _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_FNR_COUNTER_DEALLOC, int)
1324 #define IPA_IOC_FNR_COUNTER_QUERY _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_FNR_COUNTER_QUERY, struct ipa_ioc_flt_rt_query)
1325 #define IPA_IOC_GET_NAT_IN_SRAM_INFO _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_GET_NAT_IN_SRAM_INFO, struct ipa_nat_in_sram_info)
1326 #define IPA_IOC_GET_PHERIPHERAL_EP_INFO _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_GET_PHERIPHERAL_EP_INFO, struct ipa_ioc_get_ep_info)
1327 #define IPA_IOC_APP_CLOCK_VOTE _IOWR(IPA_IOC_MAGIC, IPA_IOCTL_APP_CLOCK_VOTE, uint32_t)
1328 #define TETH_BRIDGE_IOC_MAGIC 0xCE
1329 #define TETH_BRIDGE_IOCTL_SET_BRIDGE_MODE 0
1330 #define TETH_BRIDGE_IOCTL_SET_AGGR_PARAMS 1
1331 #define TETH_BRIDGE_IOCTL_GET_AGGR_PARAMS 2
1332 #define TETH_BRIDGE_IOCTL_GET_AGGR_CAPABILITIES 3
1333 #define TETH_BRIDGE_IOCTL_MAX 4
1334 enum teth_link_protocol_type {
1335   TETH_LINK_PROTOCOL_IP,
1336   TETH_LINK_PROTOCOL_ETHERNET,
1337   TETH_LINK_PROTOCOL_MAX,
1338 };
1339 enum teth_aggr_protocol_type {
1340   TETH_AGGR_PROTOCOL_NONE,
1341   TETH_AGGR_PROTOCOL_MBIM,
1342   TETH_AGGR_PROTOCOL_TLP,
1343   TETH_AGGR_PROTOCOL_MAX,
1344 };
1345 struct teth_aggr_params_link {
1346   enum teth_aggr_protocol_type aggr_prot;
1347   uint32_t max_transfer_size_byte;
1348   uint32_t max_datagrams;
1349 };
1350 struct teth_aggr_params {
1351   struct teth_aggr_params_link ul;
1352   struct teth_aggr_params_link dl;
1353 };
1354 struct teth_aggr_capabilities {
1355   uint16_t num_protocols;
1356   struct teth_aggr_params_link prot_caps[0];
1357 };
1358 struct teth_ioc_set_bridge_mode {
1359   enum teth_link_protocol_type link_protocol;
1360   uint16_t lcid;
1361 };
1362 struct teth_ioc_aggr_params {
1363   struct teth_aggr_params aggr_params;
1364   uint16_t lcid;
1365 };
1366 struct ipa_nat_in_sram_info {
1367   uint32_t sram_mem_available_for_nat;
1368   uint32_t nat_table_offset_into_mmap;
1369   uint32_t best_nat_in_sram_size_rqst;
1370 };
1371 enum ipa_app_clock_vote_type {
1372   IPA_APP_CLK_DEVOTE = 0,
1373   IPA_APP_CLK_VOTE = 1,
1374   IPA_APP_CLK_RESET_VOTE = 2,
1375 };
1376 #define TETH_BRIDGE_IOC_SET_BRIDGE_MODE _IOW(TETH_BRIDGE_IOC_MAGIC, TETH_BRIDGE_IOCTL_SET_BRIDGE_MODE, struct teth_ioc_set_bridge_mode *)
1377 #define TETH_BRIDGE_IOC_SET_AGGR_PARAMS _IOW(TETH_BRIDGE_IOC_MAGIC, TETH_BRIDGE_IOCTL_SET_AGGR_PARAMS, struct teth_ioc_aggr_params *)
1378 #define TETH_BRIDGE_IOC_GET_AGGR_PARAMS _IOR(TETH_BRIDGE_IOC_MAGIC, TETH_BRIDGE_IOCTL_GET_AGGR_PARAMS, struct teth_ioc_aggr_params *)
1379 #define TETH_BRIDGE_IOC_GET_AGGR_CAPABILITIES _IOWR(TETH_BRIDGE_IOC_MAGIC, TETH_BRIDGE_IOCTL_GET_AGGR_CAPABILITIES, struct teth_aggr_capabilities *)
1380 #define ODU_BRIDGE_IOC_MAGIC 0xCD
1381 #define ODU_BRIDGE_IOCTL_SET_MODE 0
1382 #define ODU_BRIDGE_IOCTL_SET_LLV6_ADDR 1
1383 #define ODU_BRIDGE_IOCTL_MAX 2
1384 enum odu_bridge_mode {
1385   ODU_BRIDGE_MODE_ROUTER,
1386   ODU_BRIDGE_MODE_BRIDGE,
1387   ODU_BRIDGE_MODE_MAX,
1388 };
1389 #define ODU_BRIDGE_IOC_SET_MODE _IOW(ODU_BRIDGE_IOC_MAGIC, ODU_BRIDGE_IOCTL_SET_MODE, enum odu_bridge_mode)
1390 #define ODU_BRIDGE_IOC_SET_LLV6_ADDR _IOW(ODU_BRIDGE_IOC_MAGIC, ODU_BRIDGE_IOCTL_SET_LLV6_ADDR, struct in6_addr *)
1391 #endif
1392