[DAPL2] sync with WinOF 2.1 branch
[mirror/winof/.git] / inc / kernel / iba / ib_al_ifc.h
1 /*\r
2  * Copyright (c) 2005 SilverStorm Technologies.  All rights reserved.\r
3  * Portions Copyright (c) 2008 Microsoft Corporation.  All rights reserved.\r
4  *\r
5  * This software is available to you under the OpenIB.org BSD license\r
6  * below:\r
7  *\r
8  *     Redistribution and use in source and binary forms, with or\r
9  *     without modification, are permitted provided that the following\r
10  *     conditions are met:\r
11  *\r
12  *      - Redistributions of source code must retain the above\r
13  *        copyright notice, this list of conditions and the following\r
14  *        disclaimer.\r
15  *\r
16  *      - Redistributions in binary form must reproduce the above\r
17  *        copyright notice, this list of conditions and the following\r
18  *        disclaimer in the documentation and/or other materials\r
19  *        provided with the distribution.\r
20  *\r
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
22  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
23  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
24  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\r
25  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\r
26  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
27  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
28  * SOFTWARE.\r
29  *\r
30  * $Id$\r
31  */\r
32 \r
33 \r
34 \r
35 #if !defined _IB_AL_IFC_H_\r
36 #define _IB_AL_IFC_H_\r
37 \r
38 \r
39 #include <iba/ib_al.h>\r
40 \r
41 \r
42 /****h* Access Layer/AL Interface\r
43 * NAME\r
44 *       AL Interface\r
45 *\r
46 * DESCRIPTION\r
47 *       Header file for the interface exported to ICT client drivers for access to\r
48 *       IB resources provided by HCAs.\r
49 *********/\r
50 \r
51 #define AL_INTERFACE_VERSION            (12)\r
52 \r
53 \r
54 \r
55 /* Function prototypes.  Match definitions in ib_al.h. */\r
56 typedef void\r
57 (*ib_pfn_sync_destroy_t)(\r
58         IN                              void                                            *context );\r
59 \r
60 typedef ib_api_status_t\r
61 (*ib_pfn_open_ca_t)(\r
62         IN              const   ib_al_handle_t                          h_al,\r
63         IN              const   ib_net64_t                                      ca_guid,\r
64         IN              const   ib_pfn_event_cb_t                       ca_event_cb OPTIONAL,\r
65         IN              const   void* const                                     ca_context,\r
66                 OUT                     ib_ca_handle_t* const           ph_ca );\r
67 \r
68 typedef ib_api_status_t\r
69 (*ib_pfn_query_ca_t)(\r
70         IN              const   ib_ca_handle_t                          h_ca,\r
71                 OUT                     ib_ca_attr_t* const                     p_ca_attr OPTIONAL,\r
72         IN      OUT                     uint32_t* const                         p_size );\r
73 \r
74 typedef DEVICE_OBJECT*\r
75 (*ib_pfn_get_ca_dev_t)(\r
76         IN              const   ib_ca_handle_t                          h_ca );\r
77 \r
78 typedef ib_api_status_t\r
79 (*ib_pfn_query_ca_by_guid_t)(\r
80         IN              const   ib_al_handle_t                          h_al,\r
81         IN              const   ib_net64_t                                      ca_guid,\r
82                 OUT                     ib_ca_attr_t* const                     p_ca_attr OPTIONAL,\r
83         IN      OUT                     size_t* const                           p_size );\r
84 \r
85 typedef ib_api_status_t\r
86 (*ib_pfn_modify_ca_t)(\r
87         IN              const   ib_ca_handle_t                          h_ca,\r
88         IN              const   uint8_t                                         port_num,\r
89         IN              const   ib_ca_mod_t                                     ca_mod,\r
90         IN              const   ib_port_attr_mod_t* const       p_port_attr_mod );\r
91 \r
92 typedef ib_api_status_t\r
93 (*ib_pfn_close_ca_t)(\r
94         IN              const   ib_ca_handle_t                          h_ca,\r
95         IN              const   ib_pfn_destroy_cb_t                     destroy_cb OPTIONAL );\r
96 \r
97 typedef ib_api_status_t\r
98 (*ib_pfn_alloc_pd_t)(\r
99         IN              const   ib_ca_handle_t                          h_ca,\r
100         IN              const   ib_pd_type_t                            pd_type,\r
101         IN              const   void* const                                     pd_context,\r
102                 OUT                     ib_pd_handle_t* const           ph_pd );\r
103 \r
104 typedef ib_api_status_t\r
105 (*ib_pfn_dealloc_pd_t)(\r
106         IN              const   ib_pd_handle_t                          h_pd,\r
107         IN              const   ib_pfn_destroy_cb_t                     destroy_cb OPTIONAL );\r
108 \r
109 typedef ib_api_status_t\r
110 (*ib_pfn_create_av_t)(\r
111         IN              const   ib_pd_handle_t                          h_pd,\r
112         IN              const   ib_av_attr_t* const                     p_av_attr,\r
113                 OUT                     ib_av_handle_t* const           ph_av );\r
114 \r
115 typedef ib_api_status_t\r
116 (*ib_pfn_query_av_t)(\r
117         IN              const   ib_av_handle_t                          h_av,\r
118                 OUT                     ib_av_attr_t* const                     p_av_attr,\r
119                 OUT                     ib_pd_handle_t* const           ph_pd );\r
120 \r
121 typedef ib_api_status_t\r
122 (*ib_pfn_modify_av_t)(\r
123         IN              const   ib_av_handle_t                          h_av,\r
124         IN              const   ib_av_attr_t* const                     p_av_attr );\r
125 \r
126 typedef ib_api_status_t\r
127 (*ib_pfn_destroy_av_t)(\r
128         IN              const   ib_av_handle_t                          h_av );\r
129 \r
130 typedef ib_api_status_t\r
131 (*ib_pfn_create_srq_t)(\r
132         IN              const   ib_pd_handle_t                          h_pd,\r
133         IN              const   ib_srq_attr_t* const                    p_srq_attr,\r
134         IN              const   void* const                                     srq_context,\r
135         IN              const   ib_pfn_event_cb_t                               srq_event_cb OPTIONAL,\r
136                 OUT                     ib_srq_handle_t* const                  ph_srq );\r
137 \r
138 typedef ib_api_status_t\r
139 (*ib_pfn_query_srq_t)(\r
140         IN              const   ib_srq_handle_t                         h_srq,\r
141                 OUT                     ib_srq_attr_t* const                    p_srq_attr );\r
142 \r
143 typedef ib_api_status_t\r
144 (*ib_pfn_modify_srq_t)(\r
145         IN              const   ib_srq_handle_t                         h_srq,\r
146         IN              const   ib_srq_attr_t* const                    p_srq_attr,\r
147         IN              const   ib_srq_attr_mask_t                              srq_attr_mask );\r
148 \r
149 typedef ib_api_status_t\r
150 (*ib_pfn_destroy_srq_t)(\r
151         IN              const   ib_srq_handle_t                         h_srq,\r
152         IN              const   ib_pfn_destroy_cb_t                     destroy_cb OPTIONAL );\r
153 \r
154 typedef ib_api_status_t\r
155 (*ib_pfn_post_srq_recv_t)(\r
156         IN              const   ib_srq_handle_t                         h_srq,\r
157         IN                              ib_recv_wr_t* const                     p_recv_wr,\r
158                 OUT                     ib_recv_wr_t                            **pp_recv_failure OPTIONAL );\r
159 \r
160 typedef ib_api_status_t\r
161 (*ib_pfn_create_qp_t)(\r
162         IN              const   ib_pd_handle_t                          h_pd,\r
163         IN              const   ib_qp_create_t* const           p_qp_create,\r
164         IN              const   void* const                                     qp_context,\r
165         IN              const   ib_pfn_event_cb_t                       qp_event_cb OPTIONAL,\r
166                 OUT                     ib_qp_handle_t* const           ph_qp );\r
167 \r
168 typedef ib_api_status_t\r
169 (*ib_pfn_get_spl_qp_t)(\r
170         IN              const   ib_pd_handle_t                          h_pd,\r
171         IN              const   ib_net64_t                                      port_guid,\r
172         IN              const   ib_qp_create_t* const           p_qp_create,\r
173         IN              const   void* const                                     qp_context,\r
174         IN              const   ib_pfn_event_cb_t                       qp_event_cb OPTIONAL,\r
175                 OUT                     ib_pool_key_t* const            p_pool_key OPTIONAL,\r
176                 OUT                     ib_qp_handle_t* const           ph_qp );\r
177 \r
178 typedef ib_api_status_t\r
179 (*ib_pfn_query_qp_t)(\r
180         IN              const   ib_qp_handle_t                          h_qp,\r
181                 OUT                     ib_qp_attr_t* const                     p_qp_attr );\r
182 \r
183 typedef ib_api_status_t\r
184 (*ib_pfn_modify_qp_t)(\r
185         IN              const   ib_qp_handle_t                          h_qp,\r
186         IN              const   ib_qp_mod_t* const                      p_qp_mod );\r
187 \r
188 typedef ib_api_status_t\r
189 (*ib_pfn_destroy_qp_t)(\r
190         IN              const   ib_qp_handle_t                          h_qp,\r
191         IN              const   ib_pfn_destroy_cb_t                     destroy_cb OPTIONAL );\r
192 \r
193 typedef ib_api_status_t\r
194 (*ib_pfn_create_cq_t)(\r
195         IN              const   ib_ca_handle_t                          h_ca,\r
196         IN      OUT                     ib_cq_create_t* const           p_cq_create,\r
197         IN              const   void* const                                     cq_context,\r
198         IN              const   ib_pfn_event_cb_t                       cq_event_cb OPTIONAL,\r
199                 OUT                     ib_cq_handle_t* const           ph_cq );\r
200 \r
201 typedef ib_api_status_t\r
202 (*ib_pfn_modify_cq_t)(\r
203         IN              const   ib_cq_handle_t                          h_cq,\r
204         IN      OUT                     uint32_t* const                         p_size );\r
205 \r
206 typedef ib_api_status_t\r
207 (*ib_pfn_query_cq_t)(\r
208         IN              const   ib_cq_handle_t                          h_cq,\r
209                 OUT                     uint32_t* const                         p_size );\r
210 \r
211 typedef ib_api_status_t\r
212 (*ib_pfn_destroy_cq_t)(\r
213         IN              const   ib_cq_handle_t                          h_cq,\r
214         IN              const   ib_pfn_destroy_cb_t                     destroy_cb OPTIONAL );\r
215 \r
216 typedef ib_api_status_t\r
217 (*ib_pfn_reg_mem_t)(\r
218         IN              const   ib_pd_handle_t                          h_pd,\r
219         IN              const   ib_mr_create_t* const           p_mr_create,\r
220                 OUT                     uint32_t* const                         p_lkey,\r
221                 OUT                     uint32_t* const                         p_rkey,\r
222                 OUT                     ib_mr_handle_t* const           ph_mr );\r
223 \r
224 typedef ib_api_status_t\r
225 (*ib_pfn_reg_phys_t)(\r
226         IN              const   ib_pd_handle_t                          h_pd,\r
227         IN              const   ib_phys_create_t* const         p_phys_create,\r
228         IN      OUT                     uint64_t* const                         p_vaddr,\r
229                 OUT                     uint32_t* const                         p_lkey,\r
230                 OUT                     uint32_t* const                         p_rkey,\r
231                 OUT                     ib_mr_handle_t* const           ph_mr );\r
232 \r
233 typedef ib_api_status_t\r
234 (*ib_pfn_query_mr_t)(\r
235         IN              const   ib_mr_handle_t                          h_mr,\r
236                 OUT                     ib_mr_attr_t* const                     p_mr_attr );\r
237 \r
238 typedef ib_api_status_t\r
239 (*ib_pfn_rereg_mem_t)(\r
240         IN              const   ib_mr_handle_t                          h_mr,\r
241         IN              const   ib_mr_mod_t                                     mr_mod_mask,\r
242         IN              const   ib_mr_create_t* const           p_mr_create OPTIONAL,\r
243                 OUT                     uint32_t* const                         p_lkey,\r
244                 OUT                     uint32_t* const                         p_rkey,\r
245         IN              const   ib_pd_handle_t                          h_pd OPTIONAL );\r
246 \r
247 typedef ib_api_status_t\r
248 (*ib_pfn_rereg_phys_t)(\r
249         IN              const   ib_mr_handle_t                          h_mr,\r
250         IN              const   ib_mr_mod_t                                     mr_mod_mask,\r
251         IN              const   ib_phys_create_t* const         p_phys_create OPTIONAL,\r
252         IN      OUT                     void** const                            p_vaddr,\r
253                 OUT                     uint32_t* const                         p_lkey,\r
254                 OUT                     uint32_t* const                         p_rkey,\r
255         IN              const   ib_pd_handle_t                          h_pd OPTIONAL );\r
256 \r
257 typedef ib_api_status_t\r
258 (*ib_pfn_reg_shared_t)(\r
259         IN              const   ib_mr_handle_t                          h_mr,\r
260         IN              const   ib_pd_handle_t                          h_pd,\r
261         IN              const   ib_access_t                                     access_ctrl,\r
262         IN      OUT                     void** const                            p_vaddr,\r
263                 OUT                     uint32_t* const                         p_lkey,\r
264                 OUT                     uint32_t* const                         p_rkey,\r
265                 OUT                     ib_mr_handle_t* const           ph_mr );\r
266 \r
267 typedef ib_api_status_t\r
268 (*ib_pfn_create_shmid_t)(\r
269         IN              const   ib_pd_handle_t                          h_pd,\r
270         IN              const   int                                                     shmid,\r
271         IN              const   ib_mr_create_t* const           p_mr_create,\r
272                 OUT                     uint32_t* const                         p_lkey,\r
273                 OUT                     uint32_t* const                         p_rkey,\r
274                 OUT                     ib_mr_handle_t* const           ph_mr );\r
275 \r
276 typedef ib_api_status_t\r
277 (*ib_pfn_reg_shmid_t)(\r
278         IN              const   ib_pd_handle_t                          h_pd,\r
279         IN              const   ib_shmid_t                                      shmid,\r
280         IN              const   ib_mr_create_t* const           p_mr_create,\r
281         IN      OUT                     uint64_t* const                         p_vaddr,\r
282                 OUT                     net32_t* const                          p_lkey,\r
283                 OUT                     net32_t* const                          p_rkey,\r
284                 OUT                     ib_mr_handle_t* const           ph_mr );\r
285 \r
286 typedef ib_api_status_t\r
287 (*ib_pfn_dereg_mr_t)(\r
288         IN              const   ib_mr_handle_t                          h_mr );\r
289 \r
290 typedef ib_api_status_t\r
291 (*mlnx_pfn_create_fmr_t)(\r
292         IN              const   ib_pd_handle_t                          h_pd,\r
293         IN              const   mlnx_fmr_create_t* const        p_fmr_create,\r
294                 OUT                     mlnx_fmr_handle_t* const        ph_fmr );\r
295 \r
296 typedef ib_api_status_t\r
297 (*mlnx_pfn_map_phys_fmr_t)(\r
298         IN              const   mlnx_fmr_handle_t                       h_fmr,\r
299         IN              const   uint64_t* const                         paddr_list,\r
300         IN              const   int                                                     list_len,\r
301         IN      OUT                     uint64_t* const                         p_vaddr,\r
302                 OUT                     net32_t* const                          p_lkey,\r
303                 OUT                     net32_t* const                          p_rkey );\r
304 \r
305 typedef ib_api_status_t\r
306 (*mlnx_pfn_unmap_fmr_t)(\r
307         IN              const   mlnx_fmr_handle_t                       h_fmr );\r
308 \r
309 typedef ib_api_status_t\r
310 (*mlnx_pfn_destroy_fmr_t)(\r
311         IN              mlnx_fmr_handle_t  const                                h_fmr );\r
312 \r
313 \r
314 typedef ib_api_status_t\r
315 (*mlnx_pfn_create_fmr_pool_t)(\r
316         IN              const   ib_pd_handle_t                          h_pd,\r
317         IN              const   mlnx_fmr_pool_create_t          *p_fmr_pool_attr,\r
318         OUT             mlnx_fmr_pool_handle_t* const                   ph_pool );\r
319 \r
320 \r
321 typedef ib_api_status_t\r
322 (*mlnx_pfn_destroy_fmr_pool_t)(\r
323         IN              const   mlnx_fmr_pool_handle_t                  h_pool );\r
324 \r
325 \r
326 typedef ib_api_status_t\r
327 (*mlnx_pfn_map_phys_fmr_pool_t)(\r
328         IN              const   mlnx_fmr_pool_handle_t          h_pool ,\r
329         IN              const   uint64_t* const                         paddr_list,\r
330         IN              const   int                                                     list_len,\r
331         IN      OUT                     uint64_t* const                         p_vaddr,\r
332         OUT             net32_t* const                                  p_lkey,\r
333         OUT             net32_t* const                                  p_rkey,\r
334         OUT                             mlnx_fmr_pool_el_t                      *p_fmr_el);\r
335 \r
336 typedef ib_api_status_t\r
337 (*mlnx_pfn_unmap_fmr_pool_t)(\r
338         IN                      mlnx_fmr_pool_el_t                              p_fmr_el );\r
339 \r
340 typedef ib_api_status_t\r
341 (*mlnx_pfn_flush_fmr_pool_t)(\r
342         IN              const   mlnx_fmr_pool_handle_t                  h_pool );\r
343 \r
344 typedef ib_api_status_t\r
345 (*ib_pfn_create_mw_t)(\r
346         IN              const   ib_pd_handle_t                          h_pd,\r
347                 OUT                     uint32_t* const                         p_rkey,\r
348                 OUT                     ib_mw_handle_t* const                   ph_mw );\r
349 \r
350 typedef ib_api_status_t\r
351 (*ib_pfn_query_mw_t)(\r
352         IN              const   ib_mw_handle_t                          h_mw,\r
353                 OUT                     ib_pd_handle_t* const                   ph_pd,\r
354                 OUT                     uint32_t* const                         p_rkey );\r
355 \r
356 typedef ib_api_status_t\r
357 (*ib_pfn_bind_mw_t)(\r
358         IN              const   ib_mw_handle_t                          h_mw,\r
359         IN              const   ib_qp_handle_t                          h_qp,\r
360         IN                              ib_bind_wr_t* const                     p_mw_bind,\r
361                 OUT                     uint32_t* const                         p_rkey );\r
362 \r
363 typedef ib_api_status_t\r
364 (*ib_pfn_destroy_mw_t)(\r
365         IN              const   ib_mw_handle_t                          h_mw );\r
366 \r
367 typedef ib_api_status_t\r
368 (*ib_pfn_post_send_t)(\r
369         IN              const   ib_qp_handle_t                          h_qp,\r
370         IN                              ib_send_wr_t* const                     p_send_wr,\r
371                 OUT                     ib_send_wr_t                            **pp_send_failure OPTIONAL );\r
372 \r
373 typedef ib_api_status_t\r
374 (*ib_pfn_post_recv_t)(\r
375         IN              const   ib_qp_handle_t                          h_qp,\r
376         IN                              ib_recv_wr_t* const                     p_recv_wr,\r
377                 OUT                     ib_recv_wr_t                            **pp_recv_failure OPTIONAL );\r
378 \r
379 typedef ib_api_status_t\r
380 (*ib_pfn_send_mad_t)(\r
381         IN              const   ib_mad_svc_handle_t                     h_mad_svc,\r
382         IN                              ib_mad_element_t* const         p_mad_element_list,\r
383                 OUT                     ib_mad_element_t                        **pp_mad_failure OPTIONAL );\r
384 \r
385 typedef ib_api_status_t\r
386 (*ib_pfn_cancel_mad_t)(\r
387         IN              const   ib_mad_svc_handle_t                     h_mad_svc,\r
388         IN                              ib_mad_element_t* const         p_mad_element );\r
389 \r
390 typedef ib_api_status_t\r
391 (*ib_pfn_poll_cq_t)(\r
392         IN              const   ib_cq_handle_t                          h_cq,\r
393         IN      OUT                     ib_wc_t** const                         pp_free_wclist,\r
394                 OUT                     ib_wc_t** const                         pp_done_wclist );\r
395 \r
396 typedef ib_api_status_t\r
397 (*ib_pfn_rearm_cq_t)(\r
398         IN              const   ib_cq_handle_t                          h_cq,\r
399         IN              const   boolean_t                                       solicited );\r
400 \r
401 typedef ib_api_status_t\r
402 (*ib_pfn_join_mcast_t)(\r
403         IN              const   ib_qp_handle_t                          h_qp,\r
404         IN              const   ib_mcast_req_t* const           p_mcast_req );\r
405 \r
406 typedef ib_api_status_t\r
407 (*ib_pfn_leave_mcast_t)(\r
408         IN              const   ib_mcast_handle_t                       h_mcast,\r
409         IN              const   ib_pfn_destroy_cb_t                     destroy_cb );\r
410 \r
411 typedef ib_api_status_t\r
412 (*ib_pfn_local_mad_t)(\r
413         IN              const   ib_ca_handle_t                          h_ca,\r
414         IN              const   uint8_t                                         port_num,\r
415         IN              const   void* const                                     p_mad_in,\r
416                 OUT                     void*                                           p_mad_out );\r
417 \r
418 typedef ib_api_status_t\r
419 (*ib_pfn_cm_listen_t)(\r
420         IN              const   ib_al_handle_t                          h_al,\r
421         IN              const   ib_cm_listen_t* const           p_cm_listen,\r
422         IN              const   void* const                                     listen_context,\r
423                 OUT                     ib_listen_handle_t* const       ph_cm_listen );\r
424 \r
425 typedef ib_api_status_t\r
426 (*ib_pfn_cm_cancel_t)(\r
427         IN              const   ib_listen_handle_t                      h_cm_listen,\r
428         IN              const   ib_pfn_destroy_cb_t                     destroy_cb OPTIONAL );\r
429 \r
430 typedef ib_api_status_t\r
431 (*ib_pfn_cm_req_t)(\r
432         IN              const   ib_cm_req_t* const                      p_cm_req );\r
433 \r
434 typedef ib_api_status_t\r
435 (*ib_pfn_cm_rep_t)(\r
436         IN              const   ib_cm_handle_t                          h_cm_req,\r
437         IN              const   ib_cm_rep_t* const                      p_cm_rep );\r
438 \r
439 typedef ib_api_status_t\r
440 (*ib_pfn_cm_rtu_t)(\r
441         IN              const   ib_cm_handle_t                          h_cm_rep,\r
442         IN              const   ib_cm_rtu_t* const                      p_cm_rtu );\r
443 \r
444 typedef ib_api_status_t\r
445 (*ib_pfn_cm_rej_t)(\r
446         IN              const   ib_cm_handle_t                          h_cm,\r
447         IN              const   ib_cm_rej_t* const                      p_cm_rej );\r
448 \r
449 typedef ib_api_status_t\r
450 (*ib_pfn_cm_mra_t)(\r
451         IN              const   ib_cm_handle_t                          h_cm,\r
452         IN              const   ib_cm_mra_t* const                      p_cm_mra );\r
453 \r
454 typedef ib_api_status_t\r
455 (*ib_pfn_cm_lap_t)(\r
456         IN              const   ib_cm_lap_t* const                      p_cm_lap );\r
457 \r
458 typedef ib_api_status_t\r
459 (*ib_pfn_cm_apr_t)(\r
460         IN              const   ib_cm_handle_t                          h_cm_lap,\r
461         IN              const   ib_cm_apr_t* const                      p_cm_apr );\r
462 \r
463 typedef ib_api_status_t\r
464 (*ib_pfn_force_apm_t)(\r
465         IN              const   ib_qp_handle_t                          h_qp );\r
466 \r
467 typedef ib_api_status_t\r
468 (*ib_pfn_cm_dreq_t)(\r
469         IN              const   ib_cm_dreq_t* const                     p_cm_dreq );\r
470 \r
471 typedef ib_api_status_t\r
472 (*ib_pfn_cm_drep_t)(\r
473         IN              const   ib_cm_handle_t                          h_cm_dreq,\r
474         IN              const   ib_cm_drep_t* const                     p_cm_drep );\r
475 \r
476 typedef ib_api_status_t\r
477 (*ib_pfn_cm_handoff_t)(\r
478         IN              const   ib_cm_handle_t                          h_cm_req,\r
479         IN              const   ib_net64_t                                      svc_id );\r
480 \r
481 typedef ib_api_status_t\r
482 (*ib_pfn_create_ioc_t)(\r
483         IN              const   ib_ca_handle_t                          h_ca,\r
484         IN              const   ib_ioc_profile_t* const         p_ioc_profile,\r
485                 OUT                     ib_ioc_handle_t* const          ph_ioc );\r
486 \r
487 typedef ib_api_status_t\r
488 (*ib_pfn_destroy_ioc_t)(\r
489         IN              const   ib_ioc_handle_t                         h_ioc );\r
490 \r
491 typedef ib_api_status_t\r
492 (*ib_pfn_reg_ioc_t)(\r
493         IN              const   ib_ioc_handle_t                         h_ioc );\r
494 \r
495 typedef ib_api_status_t\r
496 (*ib_pfn_add_svc_entry_t)(\r
497         IN              const   ib_ioc_handle_t                         h_ioc,\r
498         IN              const   ib_svc_entry_t* const           p_svc_entry,\r
499                 OUT                     ib_svc_handle_t* const          ph_svc );\r
500 \r
501 typedef ib_api_status_t\r
502 (*ib_pfn_remove_svc_entry_t)(\r
503         IN              const   ib_svc_handle_t                         h_svc );\r
504 \r
505 typedef ib_api_status_t\r
506 (*ib_pfn_get_ca_guids_t)(\r
507         IN                              ib_al_handle_t                          h_al,\r
508                 OUT                     ib_net64_t* const                       p_guid_array OPTIONAL,\r
509         IN      OUT                     uintn_t* const                          p_guid_cnt );\r
510 \r
511 typedef ib_api_status_t\r
512 (*ib_pfn_get_ca_by_gid_t)(\r
513         IN                              ib_al_handle_t                          h_al,\r
514         IN              const   ib_gid_t* const                         p_gid,\r
515                 OUT                     ib_net64_t* const                       p_ca_guid );\r
516 \r
517 typedef ib_api_status_t\r
518 (*ib_pfn_get_ca_by_gid_t)(\r
519         IN                              ib_al_handle_t                          h_al,\r
520         IN              const   ib_gid_t* const                         p_gid,\r
521                 OUT                     ib_net64_t* const                       p_ca_guid );\r
522 \r
523 typedef ib_api_status_t\r
524 (*ib_pfn_get_port_by_gid_t)(\r
525         IN                              ib_al_handle_t                          h_al,\r
526         IN              const   ib_gid_t* const                         p_gid,\r
527                 OUT                     ib_net64_t* const                       p_port_guid );\r
528 \r
529 typedef ib_api_status_t\r
530 (*ib_pfn_create_mad_pool_t)(\r
531         IN              const   ib_al_handle_t                          h_al,\r
532         IN              const   size_t                                          min,\r
533         IN              const   size_t                                          max,\r
534         IN              const   size_t                                          grow_size,\r
535                 OUT                     ib_pool_handle_t* const         ph_pool );\r
536 \r
537 typedef ib_api_status_t\r
538 (*ib_pfn_destroy_mad_pool_t)(\r
539         IN              const   ib_pool_handle_t                        h_pool );\r
540 \r
541 typedef ib_api_status_t\r
542 (*ib_pfn_reg_mad_pool_t)(\r
543         IN              const   ib_pool_handle_t                        h_pool,\r
544         IN              const   ib_pd_handle_t                          h_pd,\r
545                 OUT                     ib_pool_key_t* const            p_pool_key );\r
546 \r
547 typedef ib_api_status_t\r
548 (*ib_pfn_dereg_mad_pool_t)(\r
549         IN              const   ib_pool_key_t                           pool_key );\r
550 \r
551 typedef ib_api_status_t\r
552 (*ib_pfn_get_mad_t)(\r
553         IN              const   ib_pool_key_t                           pool_key,\r
554         IN              const   size_t                                          buf_size,\r
555                 OUT                     ib_mad_element_t                        **pp_mad_element );\r
556 \r
557 typedef ib_api_status_t\r
558 (*ib_pfn_put_mad_t)(\r
559         IN              const   ib_mad_element_t*                       p_mad_element_list );\r
560 \r
561 typedef ib_api_status_t\r
562 (*ib_pfn_init_dgrm_svc_t)(\r
563         IN              const   ib_qp_handle_t                          h_qp,\r
564         IN              const   ib_dgrm_info_t* const           p_dgrm_info OPTIONAL );\r
565 \r
566 typedef ib_api_status_t\r
567 (*ib_pfn_reg_mad_svc_t)(\r
568         IN              const   ib_qp_handle_t                          h_qp,\r
569         IN              const   ib_mad_svc_t* const                     p_mad_svc,\r
570                 OUT                     ib_mad_svc_handle_t* const      ph_mad_svc );\r
571 \r
572 typedef ib_api_status_t\r
573 (*ib_pfn_reg_svc_t)(\r
574         IN              const   ib_al_handle_t                          h_al,\r
575         IN              const   ib_reg_svc_req_t* const         p_reg_svc_req,\r
576                 OUT                     ib_reg_svc_handle_t* const      ph_reg_svc );\r
577 \r
578 typedef ib_api_status_t\r
579 (*ib_pfn_dereg_svc_t)(\r
580         IN              const   ib_reg_svc_handle_t                     h_reg_svc,\r
581         IN              const   ib_pfn_destroy_cb_t                     destroy_cb OPTIONAL );\r
582 \r
583 typedef ib_api_status_t\r
584 (*ib_pfn_query_t)(\r
585         IN              const   ib_al_handle_t                          h_al,\r
586         IN              const   ib_query_req_t* const           p_query_req,\r
587                 OUT                     ib_query_handle_t* const        ph_query OPTIONAL );\r
588 \r
589 typedef void\r
590 (*ib_pfn_cancel_query_t)(\r
591         IN              const   ib_al_handle_t                          h_al,\r
592         IN              const   ib_query_handle_t                       query_hndl );\r
593 \r
594 typedef ib_api_status_t\r
595 (*ib_pfn_reg_pnp_t)(\r
596         IN              const   ib_al_handle_t                          h_al,\r
597         IN              const   ib_pnp_req_t* const                     p_pnp_req,\r
598                 OUT                     ib_pnp_handle_t* const          ph_pnp );\r
599 \r
600 typedef ib_api_status_t\r
601 (*ib_pfn_dereg_pnp_t)(\r
602         IN              const   ib_pnp_handle_t                         h_pnp,\r
603         IN              const   ib_pfn_destroy_cb_t                     destroy_cb OPTIONAL );\r
604 \r
605 typedef ib_api_status_t\r
606 (*ib_pfn_subscribe_t)(\r
607         IN              const   ib_al_handle_t                          h_al,\r
608         IN              const   ib_sub_req_t* const                     p_sub_req,\r
609                 OUT                     ib_sub_handle_t* const          ph_sub );\r
610 \r
611 typedef ib_api_status_t\r
612 (*ib_pfn_unsubscribe_t)(\r
613         IN              const   ib_sub_handle_t                         h_sub,\r
614         IN              const   ib_pfn_destroy_cb_t                     destroy_cb OPTIONAL );\r
615 \r
616 typedef ib_api_status_t\r
617 (*ib_pfn_reject_ioc_t)(\r
618         IN              const   ib_al_handle_t                          h_al,\r
619         IN              const   ib_pnp_handle_t                         h_ioc_event );\r
620 \r
621 typedef ib_api_status_t\r
622 (*ib_pfn_ci_call_t)(\r
623         IN                              ib_ca_handle_t                          h_ca,\r
624         IN              const   void**                          const   handle_array    OPTIONAL,\r
625         IN                              uint32_t                                        num_handles,\r
626         IN                              ib_ci_op_t*                     const   p_ci_op );\r
627 \r
628 typedef ib_api_status_t\r
629 (*ib_pfn_open_al_t)(\r
630                 OUT                     ib_al_handle_t* const           ph_al );\r
631 \r
632 typedef ib_api_status_t\r
633 (*ib_pfn_close_al_t)(\r
634         IN              const   ib_al_handle_t                          h_al );\r
635 \r
636 typedef const char*\r
637 (*ib_pfn_get_err_str_t)(\r
638         IN                              ib_api_status_t                         status );\r
639 \r
640 typedef const char*\r
641 (*ib_pfn_get_wc_status_str_t)(\r
642         IN                              ib_wc_status_t                          wc_status );\r
643 \r
644 \r
645 /* Interface specific data header. */\r
646 typedef struct _ib_al_ifc_data\r
647 {\r
648         const GUID                                      *type;\r
649         USHORT                                          size;\r
650         USHORT                                          version;\r
651         void                                            *p_data;\r
652 \r
653 }       ib_al_ifc_data_t;\r
654 \r
655 \r
656 /* Interface definitions */\r
657 typedef struct _ib_al_ifc\r
658 {\r
659         /* Standard interface header. */\r
660         INTERFACE                                       wdm;\r
661 \r
662         /* AL entry points. */\r
663         ib_pfn_sync_destroy_t           sync_destroy;\r
664         ib_pfn_open_ca_t                        open_ca;\r
665         ib_pfn_query_ca_t                       query_ca;\r
666         ib_pfn_get_ca_dev_t                     get_dev;\r
667         ib_pfn_close_ca_t                       close_ca;\r
668         ib_pfn_alloc_pd_t                       alloc_pd;\r
669         ib_pfn_dealloc_pd_t                     dealloc_pd;\r
670         ib_pfn_create_av_t                      create_av;\r
671         ib_pfn_query_av_t                       query_av;\r
672         ib_pfn_modify_av_t                      modify_av;\r
673         ib_pfn_destroy_av_t                     destroy_av;\r
674         ib_pfn_create_qp_t                      create_qp;\r
675         ib_pfn_get_spl_qp_t                     get_spl_qp;\r
676         ib_pfn_query_qp_t                       query_qp;\r
677         ib_pfn_modify_qp_t                      modify_qp;\r
678         ib_pfn_destroy_qp_t                     destroy_qp;\r
679         ib_pfn_create_cq_t                      create_cq;\r
680         ib_pfn_modify_cq_t                      modify_cq;\r
681         ib_pfn_query_cq_t                       query_cq;\r
682         ib_pfn_destroy_cq_t                     destroy_cq;\r
683         ib_pfn_reg_mem_t                        reg_mem;\r
684         ib_pfn_reg_phys_t                       reg_phys;\r
685         ib_pfn_query_mr_t                       query_mr;\r
686         ib_pfn_rereg_mem_t                      rereg_mem;\r
687         ib_pfn_create_shmid_t           create_shmid;\r
688         ib_pfn_reg_shmid_t                      reg_shmid;\r
689         ib_pfn_dereg_mr_t                       dereg_mr;\r
690         ib_pfn_create_mw_t                      create_mw;\r
691         ib_pfn_query_mw_t                       query_mw;\r
692         ib_pfn_bind_mw_t                        bind_mw;\r
693         ib_pfn_destroy_mw_t                     destroy_mw;\r
694         ib_pfn_post_send_t                      post_send;\r
695         ib_pfn_post_recv_t                      post_recv;\r
696         ib_pfn_send_mad_t                       send_mad;\r
697         ib_pfn_cancel_mad_t                     cancel_mad;\r
698         ib_pfn_poll_cq_t                        poll_cq;\r
699         ib_pfn_rearm_cq_t                       rearm_cq;\r
700         ib_pfn_join_mcast_t                     join_mcast;\r
701         ib_pfn_leave_mcast_t            leave_mcast;\r
702         ib_pfn_local_mad_t                      local_mad;\r
703         ib_pfn_cm_listen_t                      cm_listen;\r
704         ib_pfn_cm_cancel_t                      cm_cancel;\r
705         ib_pfn_cm_req_t                         cm_req;\r
706         ib_pfn_cm_rep_t                         cm_rep;\r
707         ib_pfn_cm_rtu_t                         cm_rtu;\r
708         ib_pfn_cm_rej_t                         cm_rej;\r
709         ib_pfn_cm_mra_t                         cm_mra;\r
710         ib_pfn_cm_lap_t                         cm_lap;\r
711         ib_pfn_cm_apr_t                         cm_apr;\r
712         ib_pfn_force_apm_t                      force_apm;\r
713         ib_pfn_cm_dreq_t                        cm_dreq;\r
714         ib_pfn_cm_drep_t                        cm_drep;\r
715         ib_pfn_cm_handoff_t                     cm_handoff;\r
716         ib_pfn_create_ioc_t                     create_ioc;\r
717         ib_pfn_destroy_ioc_t            destroy_ioc;\r
718         ib_pfn_reg_ioc_t                        reg_ioc;\r
719         ib_pfn_add_svc_entry_t          add_svc_entry;\r
720         ib_pfn_remove_svc_entry_t       remove_svc_entry;\r
721         ib_pfn_get_ca_guids_t           get_ca_guids;\r
722         ib_pfn_get_ca_by_gid_t          get_ca_by_gid;\r
723         ib_pfn_get_port_by_gid_t        get_port_by_gid;\r
724         ib_pfn_create_mad_pool_t        create_mad_pool;\r
725         ib_pfn_destroy_mad_pool_t       destroy_mad_pool;\r
726         ib_pfn_reg_mad_pool_t           reg_mad_pool;\r
727         ib_pfn_dereg_mad_pool_t         dereg_mad_pool;\r
728         ib_pfn_get_mad_t                        get_mad;\r
729         ib_pfn_put_mad_t                        put_mad;\r
730         ib_pfn_init_dgrm_svc_t          init_dgrm_svc;\r
731         ib_pfn_reg_mad_svc_t            reg_mad_svc;\r
732         ib_pfn_reg_svc_t                        reg_svc;\r
733         ib_pfn_dereg_svc_t                      dereg_svc;\r
734         ib_pfn_query_t                          query;\r
735         ib_pfn_cancel_query_t           cancel_query;\r
736         ib_pfn_reg_pnp_t                        reg_pnp;\r
737         ib_pfn_dereg_pnp_t                      dereg_pnp;\r
738         ib_pfn_subscribe_t                      subscribe;\r
739         ib_pfn_unsubscribe_t            unsubscribe;\r
740         ib_pfn_reject_ioc_t                     reject_ioc;\r
741         ib_pfn_ci_call_t                        ci_call;\r
742         ib_pfn_open_al_t                        open_al;\r
743         ib_pfn_close_al_t                       close_al;\r
744         ib_pfn_get_err_str_t            get_err_str;\r
745         ib_pfn_get_wc_status_str_t      get_wc_status_str;\r
746         mlnx_pfn_create_fmr_t           create_mlnx_fmr;\r
747         mlnx_pfn_map_phys_fmr_t         map_phys_mlnx_fmr;\r
748         mlnx_pfn_unmap_fmr_t            unmap_mlnx_fmr;\r
749         mlnx_pfn_destroy_fmr_t          destroy_mlnx_fmr;\r
750         mlnx_pfn_create_fmr_pool_t              create_mlnx_fmr_pool;\r
751         mlnx_pfn_destroy_fmr_pool_t     destroy_mlnx_fmr_pool;\r
752         mlnx_pfn_map_phys_fmr_pool_t            map_phys_mlnx_fmr_pool;\r
753         mlnx_pfn_unmap_fmr_pool_t               unmap_mlnx_fmr_pool;\r
754         mlnx_pfn_flush_fmr_pool_t               flush_mlnx_fmr_pool;\r
755         \r
756         ib_pfn_create_srq_t             create_srq;\r
757         ib_pfn_query_srq_t                      query_srq;\r
758         ib_pfn_modify_srq_t             modify_srq;\r
759         ib_pfn_destroy_srq_t            destroy_srq;\r
760         ib_pfn_post_srq_recv_t          post_srq_recv;\r
761 \r
762 }       ib_al_ifc_t;\r
763 \r
764 \r
765 #endif  /* !defined _IB_AL_IFC_H_ */\r
766 \r
767 /*\r
768  * AL interface GUID.  The GUID is defined outside the conditional include\r
769  * on purpose so that it can be instantiated only once where it is actually\r
770  * needed.  See the DDK docs section "Using GUIDs in Drivers" for more info.\r
771  */\r
772 /* {707A1BDE-BF9F-4565-8FDD-144EF6514FE8} */\r
773 DEFINE_GUID(GUID_IB_AL_INTERFACE, \r
774 0x707a1bde, 0xbf9f, 0x4565, 0x8f, 0xdd, 0x14, 0x4e, 0xf6, 0x51, 0x4f, 0xe8);\r