[opensm] removed opensm\user\include\ib_types.h, even though it was not used, it...
[mirror/winof/.git] / core / winverbs / wv_ioctl.h
1 /*\r
2  * Copyright (c) 2008 Intel Corporation. All rights reserved.\r
3  *\r
4  * This software is available to you under the OpenIB.org BSD license\r
5  * below:\r
6  *\r
7  *     Redistribution and use in source and binary forms, with or\r
8  *     without modification, are permitted provided that the following\r
9  *     conditions are met:\r
10  *\r
11  *      - Redistributions of source code must retain the above\r
12  *        copyright notice, this list of conditions and the following\r
13  *        disclaimer.\r
14  *\r
15  *      - Redistributions in binary form must reproduce the above\r
16  *        copyright notice, this list of conditions and the following\r
17  *        disclaimer in the documentation and/or other materials\r
18  *        provided with the distribution.\r
19  *\r
20  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
21  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
22  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AWV\r
23  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\r
24  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\r
25  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
26  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
27  * SOFTWARE.\r
28  */\r
29 \r
30 #pragma once\r
31 \r
32 #ifndef _WV_IOCTL_H_\r
33 #define _WV_IOCTL_H_\r
34 \r
35 typedef UINT16 NET16;\r
36 typedef UINT32 NET32;\r
37 typedef UINT64 NET64;\r
38 \r
39 #define WV_IOCTL(f)     CTL_CODE(FILE_DEVICE_INFINIBAND, f, METHOD_BUFFERED,\\r
40                                                          FILE_READ_DATA | FILE_WRITE_DATA)\r
41 \r
42 // input parameter / output parameter\r
43 // IOCTL\r
44 #define WV_IO_FUNCTION_BASE                             0x800\r
45 \r
46 enum {\r
47         WV_IO_FUNCTION_MIN,\r
48         WV_IO_FUNCTION_GUID_QUERY,\r
49         WV_IO_FUNCTION_LIBRARY_QUERY,\r
50         WV_IO_FUNCTION_DEVICE_OPEN,\r
51         WV_IO_FUNCTION_DEVICE_CLOSE,\r
52         WV_IO_FUNCTION_DEVICE_QUERY,\r
53         WV_IO_FUNCTION_DEVICE_PORT_QUERY,\r
54         WV_IO_FUNCTION_DEVICE_GID_QUERY,\r
55         WV_IO_FUNCTION_DEVICE_PKEY_QUERY,\r
56         WV_IO_FUNCTION_DEVICE_NOTIFY,\r
57         WV_IO_FUNCTION_DEVICE_CANCEL,\r
58         WV_IO_FUNCTION_PD_ALLOCATE,\r
59         WV_IO_FUNCTION_PD_DEALLOCATE,\r
60         WV_IO_FUNCTION_MEMORY_REGISTER,\r
61         WV_IO_FUNCTION_MEMORY_DEREGISTER,\r
62         WV_IO_FUNCTION_MW_ALLOCATE,\r
63         WV_IO_FUNCTION_MW_DEALLOCATE,\r
64         WV_IO_FUNCTION_AH_CREATE,\r
65         WV_IO_FUNCTION_AH_DESTROY,\r
66         WV_IO_FUNCTION_CQ_CREATE,\r
67         WV_IO_FUNCTION_CQ_DESTROY,\r
68         WV_IO_FUNCTION_CQ_RESIZE,\r
69         WV_IO_FUNCTION_CQ_NOTIFY,\r
70         WV_IO_FUNCTION_CQ_CANCEL,\r
71         WV_IO_FUNCTION_SRQ_CREATE,\r
72         WV_IO_FUNCTION_SRQ_DESTROY,\r
73         WV_IO_FUNCTION_SRQ_QUERY,\r
74         WV_IO_FUNCTION_SRQ_MODIFY,\r
75         WV_IO_FUNCTION_SRQ_NOTIFY,\r
76         WV_IO_FUNCTION_SRQ_CANCEL,\r
77         WV_IO_FUNCTION_QP_CREATE,\r
78         WV_IO_FUNCTION_QP_DESTROY,\r
79         WV_IO_FUNCTION_QP_QUERY,\r
80         WV_IO_FUNCTION_QP_MODIFY,\r
81         WV_IO_FUNCTION_QP_ATTACH,\r
82         WV_IO_FUNCTION_QP_DETACH,\r
83         WV_IO_FUNCTION_QP_CANCEL,\r
84         WV_IO_FUNCTION_EP_CREATE,\r
85         WV_IO_FUNCTION_EP_DESTROY,\r
86         WV_IO_FUNCTION_EP_MODIFY,\r
87         WV_IO_FUNCTION_EP_BIND,\r
88         WV_IO_FUNCTION_EP_REJECT,\r
89         WV_IO_FUNCTION_EP_CONNECT,\r
90         WV_IO_FUNCTION_EP_ACCEPT,\r
91         WV_IO_FUNCTION_EP_DISCONNECT,\r
92         WV_IO_FUNCTION_EP_DISCONNECT_NOTIFY,\r
93         WV_IO_FUNCTION_EP_QUERY,\r
94         WV_IO_FUNCTION_EP_LOOKUP,\r
95         WV_IO_FUNCTION_EP_MULTICAST_JOIN,\r
96         WV_IO_FUNCTION_EP_MULTICAST_LEAVE,\r
97         WV_IO_FUNCTION_EP_CANCEL,\r
98         WV_IO_FUNCTION_EP_LISTEN,\r
99         WV_IO_FUNCTION_EP_GET_REQUEST,\r
100         WV_IO_FUNCTION_PD_CANCEL,\r
101         WV_IO_FUNCTION_MAX\r
102 };\r
103 \r
104 // none / WV_IO_GUID_LIST\r
105 #define WV_IOCTL_GUID_QUERY                             WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
106                                                                                                  WV_IO_FUNCTION_GUID_QUERY)\r
107 \r
108 // NET64 Guid / LibraryName\r
109 #define WV_IOCTL_LIBRARY_QUERY                  WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
110                                                                                                  WV_IO_FUNCTION_LIBRARY_QUERY)\r
111 \r
112 // WV_IO_ID / WV_IO_ID\r
113 #define WV_IOCTL_DEVICE_OPEN                    WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
114                                                                                                  WV_IO_FUNCTION_DEVICE_OPEN)\r
115 \r
116 // UINT64 Id / none\r
117 #define WV_IOCTL_DEVICE_CLOSE                   WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
118                                                                                                  WV_IO_FUNCTION_DEVICE_CLOSE)\r
119 \r
120 // UINT64 Id / WV_IO_DEVICE_ATTRIBUTES\r
121 #define WV_IOCTL_DEVICE_QUERY                   WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
122                                                                                                  WV_IO_FUNCTION_DEVICE_QUERY)\r
123 \r
124 // WV_IO_DEVICE_PORT_QUERY / WV_IO_PORT_ATTRIBUTES == WV_PORT_ATTRIBUTES\r
125 #define WV_IOCTL_DEVICE_PORT_QUERY              WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
126                                                                                                  WV_IO_FUNCTION_DEVICE_PORT_QUERY)\r
127 \r
128 // WV_IO_DEVICE_PORT_QUERY / WV_IO_GID[] == WV_GID[]\r
129 #define WV_IOCTL_DEVICE_GID_QUERY               WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
130                                                                                                  WV_IO_FUNCTION_DEVICE_GID_QUERY)\r
131 \r
132 // WV_IO_DEVICE_PORT_QUERY / NET16 Pkey[]\r
133 #define WV_IOCTL_DEVICE_PKEY_QUERY              WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
134                                                                                                  WV_IO_FUNCTION_DEVICE_PKEY_QUERY)\r
135 \r
136 // WV_IO_ID / DWORD\r
137 #define WV_IOCTL_DEVICE_NOTIFY                  WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
138                                                                                                  WV_IO_FUNCTION_DEVICE_NOTIFY)\r
139 \r
140 // UINT64 Id / none\r
141 #define WV_IOCTL_DEVICE_CANCEL                  WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
142                                                                                                  WV_IO_FUNCTION_DEVICE_CANCEL)\r
143 \r
144 // WV_IO_ID / WV_IO_ID\r
145 #define WV_IOCTL_PD_ALLOCATE                    WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
146                                                                                                  WV_IO_FUNCTION_PD_ALLOCATE)\r
147 \r
148 // UINT64 Id / none\r
149 #define WV_IOCTL_PD_DEALLOCATE                  WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
150                                                                                                  WV_IO_FUNCTION_PD_DEALLOCATE)\r
151 \r
152 // UINT64 Id / none\r
153 #define WV_IOCTL_PD_CANCEL                              WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
154                                                                                                  WV_IO_FUNCTION_PD_CANCEL)\r
155 \r
156 // WV_IO_MEMORY_REGISTER / WV_IO_MEMORY_KEYS\r
157 #define WV_IOCTL_MEMORY_REGISTER                WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
158                                                                                                  WV_IO_FUNCTION_MEMORY_REGISTER)\r
159 \r
160 // WV_IO_ID / none\r
161 #define WV_IOCTL_MEMORY_DEREGISTER              WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
162                                                                                                  WV_IO_FUNCTION_MEMORY_DEREGISTER)\r
163 \r
164 // WV_IO_ID / WV_IO_ID\r
165 #define WV_IOCTL_MW_ALLOCATE                    WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
166                                                                                                  WV_IO_FUNCTION_MW_ALLOCATE)\r
167 \r
168 // UINT64 Id / none\r
169 #define WV_IOCTL_MW_DEALLOCATE                  WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
170                                                                                                  WV_IO_FUNCTION_MW_DEALLOCATE)\r
171 \r
172 // WV_IO_AH_CREATE / WV_IO_AH_CREATE\r
173 #define WV_IOCTL_AH_CREATE                              WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
174                                                                                                  WV_IO_FUNCTION_AH_CREATE)\r
175 \r
176 // UINT64 Id / none\r
177 #define WV_IOCTL_AH_DESTROY                             WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
178                                                                                                  WV_IO_FUNCTION_AH_DESTROY)\r
179 \r
180 // WV_IO_ID / WV_IO_ID\r
181 #define WV_IOCTL_CQ_CREATE                              WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
182                                                                                                  WV_IO_FUNCTION_CQ_CREATE)\r
183 \r
184 // UINT64 Id / none\r
185 #define WV_IOCTL_CQ_DESTROY                             WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
186                                                                                                  WV_IO_FUNCTION_CQ_DESTROY)\r
187 \r
188 // WV_IO_ID / WV_IO_ID\r
189 #define WV_IOCTL_CQ_RESIZE                              WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
190                                                                                                  WV_IO_FUNCTION_CQ_RESIZE)\r
191 \r
192 // WV_IO_ID / none\r
193 #define WV_IOCTL_CQ_NOTIFY                              WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
194                                                                                                  WV_IO_FUNCTION_CQ_NOTIFY)\r
195 \r
196 // UINT64 Id / none\r
197 #define WV_IOCTL_CQ_CANCEL                              WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
198                                                                                                  WV_IO_FUNCTION_CQ_CANCEL)\r
199 \r
200 // WV_IO_SRQ_ATTRIBUTES / WV_IO_SRQ_ATTRIBUTES\r
201 #define WV_IOCTL_SRQ_CREATE                             WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
202                                                                                                  WV_IO_FUNCTION_SRQ_CREATE)\r
203 \r
204 // UINT64 Id / none\r
205 #define WV_IOCTL_SRQ_DESTROY                    WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
206                                                                                                  WV_IO_FUNCTION_SRQ_DESTROY)\r
207 \r
208 // WV_IO_SRQ_ATTRIBUTES / WV_IO_SRQ_ATTRIBUTES\r
209 #define WV_IOCTL_SRQ_QUERY                              WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
210                                                                                                  WV_IO_FUNCTION_SRQ_QUERY)\r
211 \r
212 // WV_IO_SRQ_ATTRIBUTES / WV_IO_SRQ_ATTRIBUTES\r
213 #define WV_IOCTL_SRQ_MODIFY                             WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
214                                                                                                  WV_IO_FUNCTION_SRQ_MODIFY)\r
215 \r
216 // UINT64 Id / none\r
217 #define WV_IOCTL_SRQ_NOTIFY                             WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
218                                                                                                  WV_IO_FUNCTION_SRQ_NOTIFY)\r
219 \r
220 // UINT64 Id / none\r
221 #define WV_IOCTL_SRQ_CANCEL                             WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
222                                                                                                  WV_IO_FUNCTION_SRQ_CANCEL)\r
223 \r
224 // WV_IO_QP_CREATE / WV_IO_QP_CREATE\r
225 #define WV_IOCTL_QP_CREATE                              WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
226                                                                                                  WV_IO_FUNCTION_QP_CREATE)\r
227 \r
228 // UINT64 Id / none\r
229 #define WV_IOCTL_QP_DESTROY                             WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
230                                                                                                  WV_IO_FUNCTION_QP_DESTROY)\r
231 \r
232 // WV_IO_ID / WV_IO_QP_ATTRIBUTES\r
233 #define WV_IOCTL_QP_QUERY                               WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
234                                                                                                  WV_IO_FUNCTION_QP_QUERY)\r
235 \r
236 // WV_IO_QP_ATTRIBUTES / verbs specific\r
237 #define WV_IOCTL_QP_MODIFY                              WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
238                                                                                                  WV_IO_FUNCTION_QP_MODIFY)\r
239 \r
240 // WV_IO_QP_MULTICAST / none\r
241 #define WV_IOCTL_QP_ATTACH                              WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
242                                                                                                  WV_IO_FUNCTION_QP_ATTACH)\r
243 \r
244 // WV_IO_QP_MULTICAST / none\r
245 #define WV_IOCTL_QP_DETACH                              WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
246                                                                                                  WV_IO_FUNCTION_QP_DETACH)\r
247 \r
248 // UINT64 Id / none\r
249 #define WV_IOCTL_QP_CANCEL                              WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
250                                                                                                  WV_IO_FUNCTION_QP_CANCEL)\r
251 \r
252 // UINT64 EpType / UINT64 Id\r
253 #define WV_IOCTL_EP_CREATE                              WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
254                                                                                                  WV_IO_FUNCTION_EP_CREATE)\r
255 \r
256 // UINT64 Id / none\r
257 #define WV_IOCTL_EP_DESTROY                             WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
258                                                                                                  WV_IO_FUNCTION_EP_DESTROY)\r
259 \r
260 // WV_IO_ID + UINT8[] / none\r
261 #define WV_IOCTL_EP_MODIFY                              WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
262                                                                                                  WV_IO_FUNCTION_EP_MODIFY)\r
263 \r
264 // WV_IO_EP_BIND / WV_IO_EP_BIND\r
265 #define WV_IOCTL_EP_BIND                                WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
266                                                                                                  WV_IO_FUNCTION_EP_BIND)\r
267 \r
268 // WV_IO_ID + UINT8[] / none\r
269 #define WV_IOCTL_EP_REJECT                              WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
270                                                                                                  WV_IO_FUNCTION_EP_REJECT)\r
271 \r
272 // WV_IO_EP_CONNECT / none\r
273 #define WV_IOCTL_EP_CONNECT                             WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
274                                                                                                  WV_IO_FUNCTION_EP_CONNECT)\r
275 \r
276 // WV_IO_EP_ACCEPT / verbs specific\r
277 #define WV_IOCTL_EP_ACCEPT                              WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
278                                                                                                  WV_IO_FUNCTION_EP_ACCEPT)\r
279 \r
280 // WV_IO_EP_DISCONNECT/ verbs specific\r
281 #define WV_IOCTL_EP_DISCONNECT                  WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
282                                                                                                  WV_IO_FUNCTION_EP_DISCONNECT)\r
283 \r
284 // UINT64 Id / none\r
285 #define WV_IOCTL_EP_DISCONNECT_NOTIFY   WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
286                                                                                                  WV_IO_FUNCTION_EP_DISCONNECT_NOTIFY)\r
287 \r
288 // UINT64 Id / WV_IO_EP_ATTRIBUTES\r
289 #define WV_IOCTL_EP_QUERY                               WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
290                                                                                                  WV_IO_FUNCTION_EP_QUERY)\r
291 \r
292 // TODO\r
293 #define WV_IOCTL_EP_LOOKUP                              WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
294                                                                                                  WV_IO_FUNCTION_EP_LOOKUP)\r
295 \r
296 // TODO\r
297 #define WV_IOCTL_EP_MULTICAST_JOIN              WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
298                                                                                                  WV_IO_FUNCTION_EP_MULTICAST_JOIN)\r
299 \r
300 // TODO\r
301 #define WV_IOCTL_EP_MULTICAST_LEAVE             WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
302                                                                                                  WV_IO_FUNCTION_EP_MULTICAST_LEAVE)\r
303 \r
304 // UINT64 Id / none\r
305 #define WV_IOCTL_EP_CANCEL                              WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
306                                                                                                  WV_IO_FUNCTION_EP_CANCEL)\r
307 \r
308 // WV_IO_EP_LISTEN / none\r
309 #define WV_IOCTL_EP_LISTEN                              WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
310                                                                                                  WV_IO_FUNCTION_EP_LISTEN)\r
311 \r
312 // WV_IO_EP_GET_REQUEST / none\r
313 #define WV_IOCTL_EP_GET_REQUEST                 WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
314                                                                                                  WV_IO_FUNCTION_EP_GET_REQUEST)\r
315 \r
316 #define WV_IOCTL_MIN                                    WV_IO_FUNCTION_BASE + WV_IO_FUNCTION_MIN\r
317 #define WV_IOCTL_MAX                                    WV_IO_FUNCTION_BASE + WV_IO_FUNCTION_MAX\r
318 \r
319 // Device specific data follows input / output structures.\r
320 typedef struct _WV_IO_ID\r
321 {\r
322         UINT64                  Id;\r
323         UINT32                  VerbInfo;\r
324         UINT32                  Data;\r
325 \r
326 }       WV_IO_ID;\r
327 \r
328 typedef struct _WV_IO_GUID_LIST\r
329 {\r
330         UINT64                  Count;\r
331         NET64                   Guid[1];\r
332 \r
333 }       WV_IO_GUID_LIST;\r
334 \r
335 #define WV_MAX_LIB_NAME                         32\r
336 \r
337 // Device/port capability flags\r
338 #define WV_IO_RESIZE_MAX_WR                     0x00000001\r
339 #define WV_IO_BAD_PKEY_COUNTER          0x00000002\r
340 #define WV_IO_BAD_QKEY_COUNTER          0x00000004\r
341 // reserved                                                     0x00000008\r
342 #define WV_IO_PATH_MIGRATION            0x00000010\r
343 #define WV_IO_CHANGE_PHYSICAL_PORT      0x00000020\r
344 #define WV_IO_AH_PORT_CHECKING          0x00000040\r
345 #define WV_IO_QP_STATE_MODIFIER         0x00000080\r
346 #define WV_IO_SHUTDOWN_PORT                     0x00000100\r
347 #define WV_IO_INIT_TYPE                         0x00000200\r
348 #define WV_IO_PORT_ACTIVE_EVENT         0x00000400\r
349 #define WV_IO_SYSTEM_IMAGE_GUID         0x00000800\r
350 #define WV_IO_RC_RNR_NAK_GENERATION     0x00001000\r
351 #define WV_IO_SRQ_RESIZE                        0x00002000\r
352 #define WV_IO_BATCH_NOTIFY_CQ           0x00004000\r
353 \r
354 #define WV_DEVICE_UNKNOWN                       0\r
355 #define WV_DEVICE_INFINIBAND            1\r
356 #define WV_DEVICE_IWARP                         2\r
357 \r
358 #define WV_IO_ATOMIC_NONE                       0\r
359 #define WV_IO_ATOMIC_HCA                        1\r
360 #define WV_IO_ATOMIC_NODE                       2\r
361 \r
362 typedef struct _WV_IO_DEVICE_ATTRIBUTES\r
363 {\r
364         UINT64                  FwVersion;\r
365         NET64                   NodeGuid;\r
366         NET64                   SystemImageGuid;\r
367         UINT32                  VendorId;\r
368         UINT32                  VendorPartId;\r
369         UINT32                  HwVersion;\r
370         UINT32                  CapabilityFlags;\r
371         UINT32                  AtomicCapability;\r
372         UINT32                  PageSizeCapabilityFlags;\r
373         UINT64                  MaxMrSize;\r
374         UINT32                  MaxQp;\r
375         UINT32                  MaxQpWr;\r
376         UINT32                  MaxSge;\r
377         UINT32                  MaxCq;\r
378         UINT32                  MaxCqEntries;\r
379         UINT32                  MaxMr;\r
380         UINT32                  MaxPd;\r
381         UINT32                  MaxQpResponderResources;\r
382         UINT32                  MaxResponderResources;\r
383         UINT32                  MaxQpInitiatorDepth;\r
384         UINT32                  MaxInlineSend;\r
385         UINT32                  MaxMw;\r
386         UINT32                  MaxMulticast;\r
387         UINT32                  MaxQpAttach;\r
388         UINT32                  MaxMulticastQp;\r
389         UINT32                  MaxAh;\r
390         UINT32                  MaxFmr;\r
391         UINT32                  MaxMapPerFmr;\r
392         UINT32                  MaxSrq;\r
393         UINT32                  MaxSrqWr;\r
394         UINT32                  MaxSrqSge;\r
395         UINT32                  MaxPkeys;\r
396         UINT32                  DeviceType;\r
397         UINT8                   LocalAckDelay;\r
398         UINT8                   PhysPortCount;\r
399         UINT8                   Reserved[2];\r
400 \r
401 }       WV_IO_DEVICE_ATTRIBUTES;\r
402 \r
403 typedef struct _WV_IO_DEVICE_PORT_QUERY\r
404 {\r
405         UINT64                  Id;\r
406         UINT8                   PortNumber;\r
407         UINT8                   Reserved[7];\r
408 \r
409 }       WV_IO_DEVICE_PORT_QUERY;\r
410 \r
411 #define WV_IO_PORT_NOP                  0\r
412 #define WV_IO_PORT_DOWN                 1\r
413 #define WV_IO_PORT_INIT                 2\r
414 #define WV_IO_PORT_ARMED                3\r
415 #define WV_IO_PORT_ACTIVE               4\r
416 #define WV_IO_PORT_ACTIVEDEFER  5\r
417 \r
418 typedef struct _WV_IO_PORT_ATTRIBUTES\r
419 {\r
420         UINT32                  PortCabilityFlags;\r
421         UINT32                  State;\r
422         UINT32                  MaxMtu;\r
423         UINT32                  ActiveMtu;\r
424         UINT32                  GidTableLength;\r
425         UINT32                  MaxMessageSize;\r
426         UINT32                  BadPkeyCounter;\r
427         UINT32                  QkeyViolationCounter;\r
428         UINT16                  PkeyTableLength;\r
429         NET16                   Lid;\r
430         NET16                   SmLid;\r
431         UINT8                   Lmc;\r
432         UINT8                   MaxVls;\r
433         UINT8                   SmSl;\r
434         UINT8                   SubnetTimeout;\r
435         UINT8                   InitTypeReply;\r
436         UINT8                   ActiveWidth;\r
437         UINT8                   ActiveSpeed;\r
438         UINT8                   PhysicalState;\r
439         UINT8                   Reserved[2];\r
440 \r
441 }       WV_IO_PORT_ATTRIBUTES;\r
442 \r
443 // Port notification flags\r
444 #define WV_IO_EVENT_ERROR                       0x00000001\r
445 #define WV_IO_EVENT_STATE                       0x00000002\r
446 #define WV_IO_EVENT_ADDRESS                     0x00000004\r
447 #define WV_IO_EVENT_LINK_ADDRESS        0x00000008\r
448 #define WV_IO_EVENT_PARTITION           0x00000010\r
449 #define WV_IO_EVENT_MANAGEMENT          0x00000020\r
450 \r
451 typedef struct _WV_IO_GID\r
452 {\r
453         UINT8                   Raw[16];\r
454 \r
455 }       WV_IO_GID;\r
456 \r
457 typedef struct _WV_IO_EVENT\r
458 {\r
459         UINT32                  Status;\r
460         UINT32                  Type;\r
461         UINT8                   PortNumber;\r
462         UINT8                   Reserved[3];\r
463 \r
464 }       WV_IO_EVENT;\r
465 \r
466 typedef struct _WV_IO_MEMORY_REGISTER\r
467 {\r
468         UINT64                  Id;\r
469         UINT64                  Address;\r
470         UINT64                  BufferLength;\r
471         UINT32                  AccessFlags;\r
472         UINT32                  Reserved;                       \r
473 \r
474 }       WV_IO_MEMORY_REGISTER;\r
475 \r
476 typedef struct _WV_IO_MEMORY_KEYS\r
477 {\r
478         UINT32                  Lkey;\r
479         NET32                   Rkey;\r
480 \r
481 }       WV_IO_MEMORY_KEYS;\r
482 \r
483 typedef struct _WV_IO_AV\r
484 {\r
485         UINT8                   NetworkRouteValid;\r
486         UINT8                   Reserved1;\r
487         UINT8                   HopLimit;\r
488         UINT8                   TrafficClass;\r
489         NET32                   FlowLabel;\r
490         UINT8                   SGid[16];\r
491         UINT8                   DGid[16];\r
492 \r
493         UINT16                  Reserved2;\r
494         NET16                   DLid;\r
495         UINT8                   ServiceLevel;\r
496         UINT8                   SourcePathBits;\r
497         UINT8                   StaticRate;\r
498         UINT8                   PortNumber;\r
499 \r
500 }       WV_IO_AV;\r
501 \r
502 typedef struct _WV_IO_AH_CREATE\r
503 {\r
504         WV_IO_ID                Id;\r
505         WV_IO_AV                AddressVector;\r
506 \r
507 }       WV_IO_AH_CREATE;\r
508 \r
509 #define WV_CQ_ERROR                             0\r
510 #define WV_CQ_NEXT_COMPLETION   1\r
511 #define WV_CQ_SOLICITED                 2\r
512 \r
513 typedef struct _WV_IO_SRQ_ATTRIBUTES\r
514 {\r
515         WV_IO_ID                Id;\r
516         UINT32                  MaxWr;\r
517         UINT32                  MaxSge;\r
518         UINT32                  SrqLimit;\r
519         UINT32                  Reserved;\r
520 \r
521 }       WV_IO_SRQ_ATTRIBUTES;\r
522 \r
523 #define WV_IO_QP_SIGNAL_SENDS                   0x00000001\r
524 #define WV_IO_QP_MEMORY_MANAGEMENT              0x00000002\r
525 \r
526 typedef struct _WV_IO_QP_CREATE\r
527 {\r
528         WV_IO_ID                Id;\r
529         UINT64                  SendCqId;\r
530         UINT64                  ReceiveCqId;\r
531         UINT64                  SrqId;\r
532 \r
533         UINT32                  SendDepth;\r
534         UINT32                  SendSge;\r
535         UINT32                  ReceiveDepth;\r
536         UINT32                  ReceiveSge;\r
537         UINT32                  MaxInlineSend;\r
538         UINT32                  InitiatorDepth;\r
539         UINT32                  ResponderResources;\r
540 \r
541         UINT8                   QpType;\r
542         UINT8                   QpFlags;\r
543         UINT16                  Reserved;\r
544 \r
545 }       WV_IO_QP_CREATE;\r
546 \r
547 #define WV_IO_QP_STATE_RESET    0\r
548 #define WV_IO_QP_STATE_INIT             1\r
549 #define WV_IO_QP_STATE_RTR              2\r
550 #define WV_IO_QP_STATE_RTS              3\r
551 #define WV_IO_QP_STATE_SQD              4\r
552 #define WV_IO_QP_STATE_SQERROR  5\r
553 #define WV_IO_QP_STATE_ERROR    6\r
554 \r
555 #define WV_IO_QP_ATTR_CAPABILITIES                      0x00000001\r
556 #define WV_IO_QP_ATTR_INITIATOR_DEPTH           0x00000002\r
557 #define WV_IO_QP_ATTR_RESPONDER_RESOURCES       0x00000004\r
558 #define WV_IO_QP_ATTR_CURRENT_STATE                     0x00000008\r
559 #define WV_IO_QP_ATTR_STATE                                     0x00000010\r
560 #define WV_IO_QP_ATTR_PATH_MIG_STATE            0x00000020\r
561 #define WV_IO_QP_ATTR_DESTINATION_QPN           0x00000040\r
562 #define WV_IO_QP_ATTR_QKEY                                      0x00000080\r
563 #define WV_IO_QP_ATTR_SEND_PSN                          0x00000100\r
564 #define WV_IO_QP_ATTR_RECEIVE_PSN                       0x00000200\r
565 #define WV_IO_QP_ATTR_FLAGS                                     0x00000400\r
566 #define WV_IO_QP_ATTR_ACCESS_FLAGS                      0x00000800\r
567 #define WV_IO_QP_ATTR_AV                                        0x00001000\r
568 #define WV_IO_QP_ATTR_ALTERNATE_AV                      0x00002000\r
569 #define WV_IO_QP_ATTR_PORT_NUMBER                       0x00004000\r
570 #define WV_IO_QP_ATTR_PKEY_INDEX                        0x00008000\r
571 #define WV_IO_QP_ATTR_ACK_TIMEOUT                       0x00010000\r
572 #define WV_IO_QP_ATTR_RNR_NAK_TIMEOUT           0x00020000\r
573 #define WV_IO_QP_ATTR_ERROR_RETRY_COUNT         0x00040000\r
574 #define WV_IO_QP_ATTR_RNR_RETRY_COUNT           0x00080000\r
575 \r
576 typedef struct _WV_IO_QP_ATTRIBUTES\r
577 {\r
578         WV_IO_ID                Id;\r
579         UINT32                  SendDepth;\r
580         UINT32                  SendSge;\r
581         UINT32                  ReceiveDepth;\r
582         UINT32                  ReceiveSge;\r
583         UINT32                  MaxInlineSend;\r
584         UINT32                  InitiatorDepth;\r
585         UINT32                  ResponderResources;\r
586 \r
587         UINT32                  Options;\r
588         UINT8                   QpType;\r
589         UINT8                   CurrentQpState;\r
590         UINT8                   QpState;\r
591         UINT8                   ApmState;\r
592         NET32                   Qpn;\r
593         NET32                   DestinationQpn;\r
594         NET32                   Qkey;\r
595         NET32                   SendPsn;\r
596         NET32                   ReceivePsn;\r
597 \r
598         WV_IO_AV                AddressVector;\r
599         WV_IO_AV                AlternateAddressVector;\r
600         UINT32                  PathMtu;\r
601         UINT32                  AlternatePathMtu;\r
602         UINT16                  PkeyIndex;\r
603         UINT16                  AlternatePkeyIndex;\r
604         UINT8                   LocalAckTimeout;\r
605         UINT8                   AlternateLocalAckTimeout;\r
606 \r
607         UINT8                   RnrNakTimeout;\r
608         UINT8                   SequenceErrorRetryCount;\r
609         UINT8                   RnrRetryCount;\r
610 \r
611         UINT8                   AccessFlags;\r
612         UINT8                   QpFlags;\r
613         UINT8                   Reserved[5];\r
614 \r
615 }       WV_IO_QP_ATTRIBUTES;\r
616 \r
617 typedef struct _WV_IO_QP_MULTICAST\r
618 {\r
619         WV_IO_ID                Id;\r
620         WV_IO_GID               Gid;\r
621 \r
622 }       WV_IO_QP_MULTICAST;\r
623 \r
624 // Windows kernel does not define sockaddr* pre-Vista\r
625 typedef struct _WV_IO_SOCKADDR\r
626 {\r
627         UINT16                  SaFamily;\r
628         UINT8                   SaData[14];\r
629 \r
630 }       WV_IO_SOCKADDR;\r
631 \r
632 typedef struct _WV_IO_SOCKADDR_IN\r
633 {\r
634         UINT16                  SinFamily;\r
635         UINT16                  SinPort;\r
636         UINT32                  SinAddr;\r
637         UINT8                   SinZero[8];\r
638 \r
639 }       WV_IO_SOCKADDR_IN;\r
640 \r
641 typedef struct _WV_IO_SOCKADDR_IN6\r
642 {\r
643         UINT16                  Sin6Family;\r
644         UINT16                  Sin6Port;\r
645         UINT32                  Sin6FlowInfo;\r
646         UINT8                   Sin6Addr[16];\r
647         UINT32                  Sin6ScopeId;\r
648 \r
649 }       WV_IO_SOCKADDR_IN6;\r
650 \r
651 typedef struct _WV_IO_SOCKADDR_DATA\r
652 {\r
653         union\r
654         {\r
655                 WV_IO_SOCKADDR          Sa;\r
656                 WV_IO_SOCKADDR_IN       In;\r
657                 WV_IO_SOCKADDR_IN6      In6;\r
658 \r
659         }       SockAddr;\r
660 \r
661         UINT32                                  Reserved;\r
662 \r
663 }       WV_IO_SOCKADDR_DATA;\r
664 \r
665 typedef struct _WV_IO_DEVICE_ADDRESS\r
666 {\r
667         NET64                   DeviceGuid;\r
668         NET16                   Pkey;\r
669         UINT8                   PortNumber;\r
670         UINT8                   Reserved[5];\r
671 \r
672 }       WV_IO_DEVICE_ADDRESS;\r
673 \r
674 typedef struct _WV_IO_EP_BIND\r
675 {\r
676         UINT64                                  Id;\r
677         WV_IO_SOCKADDR_DATA             Address;\r
678         WV_IO_DEVICE_ADDRESS    Device;\r
679 \r
680 }       WV_IO_EP_BIND;\r
681 \r
682 #define WV_IO_EP_OPTION_ROUTE           0x00000001\r
683 \r
684 #define WV_IO_EP_TYPE_CONNECT           0x0106\r
685 #define WV_IO_EP_TYPE_DATAGRAM          0x0111\r
686 \r
687 typedef struct _WV_IO_EP_LISTEN\r
688 {\r
689         UINT64                  Id;\r
690         UINT64                  Backlog;\r
691 \r
692 }       WV_IO_EP_LISTEN;\r
693 \r
694 typedef struct _WV_IO_EP_GET_REQUEST\r
695 {\r
696         UINT64                  Id;\r
697         UINT64                  EpId;\r
698 \r
699 }       WV_IO_EP_GET_REQUEST;\r
700 \r
701 typedef struct _WV_IO_CONNECT_PARAM\r
702 {\r
703         UINT64                  ResponderResources;\r
704         UINT64                  InitiatorDepth;\r
705         UINT8                   RetryCount;\r
706         UINT8                   RnrRetryCount;\r
707         UINT8                   DataLength;\r
708         UINT8                   Reserved[5];\r
709         UINT8                   Data[56];\r
710 \r
711 }       WV_IO_CONNECT_PARAM;\r
712 \r
713 typedef struct _WV_IO_EP_CONNECT\r
714 {\r
715         UINT64                                  Id;\r
716         UINT64                                  QpId;\r
717         WV_IO_SOCKADDR_DATA             PeerAddress;\r
718         WV_IO_CONNECT_PARAM             Param;\r
719 \r
720 }       WV_IO_EP_CONNECT;\r
721 \r
722 typedef struct _WV_IO_EP_ACCEPT\r
723 {\r
724         UINT64                                  Id;\r
725         UINT64                                  QpId;\r
726         WV_IO_CONNECT_PARAM             Param;\r
727 \r
728 }       WV_IO_EP_ACCEPT;\r
729 \r
730 typedef struct _WV_IO_EP_ATTRIBUTES\r
731 {\r
732         WV_IO_SOCKADDR_DATA             LocalAddress;\r
733         WV_IO_SOCKADDR_DATA             PeerAddress;\r
734         WV_IO_DEVICE_ADDRESS    Device;\r
735 \r
736         union {\r
737                 WV_IO_CONNECT_PARAM     Connect;\r
738                 UINT64                          Backlog;\r
739 \r
740         }       Param;\r
741 \r
742 \r
743 }       WV_IO_EP_ATTRIBUTES;\r
744 \r
745 typedef struct _WV_IO_EP_DISCONNECT\r
746 {\r
747         UINT64                                  Id;\r
748         UINT64                                  QpId;\r
749 \r
750 }       WV_IO_EP_DISCONNECT;\r
751 \r
752 #endif // _WV_IOCTL_H_\r