[CORE] Expose vendor defined device in ibiou.
[mirror/winof/.git] / core / al / al_dev.h
1 /*\r
2  * Copyright (c) 2005 SilverStorm Technologies.  All rights reserved.\r
3  * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. \r
4  * Portions Copyright (c) 2008 Microsoft Corporation.  All rights reserved.\r
5  *\r
6  * This software is available to you under the OpenIB.org BSD license\r
7  * below:\r
8  *\r
9  *     Redistribution and use in source and binary forms, with or\r
10  *     without modification, are permitted provided that the following\r
11  *     conditions are met:\r
12  *\r
13  *      - Redistributions of source code must retain the above\r
14  *        copyright notice, this list of conditions and the following\r
15  *        disclaimer.\r
16  *\r
17  *      - Redistributions in binary form must reproduce the above\r
18  *        copyright notice, this list of conditions and the following\r
19  *        disclaimer in the documentation and/or other materials\r
20  *        provided with the distribution.\r
21  *\r
22  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
23  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
24  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
25  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\r
26  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\r
27  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
28  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
29  * SOFTWARE.\r
30  *\r
31  * $Id$\r
32  */\r
33 \r
34 \r
35 \r
36 /*\r
37  * Abstract:\r
38  *      This header file defines data structures for the user-mode proxy\r
39  *      and UAL support\r
40  *\r
41  * Environment:\r
42  *      Kernel and User Mode.\r
43  */\r
44 \r
45 \r
46 #ifndef _ALDEV_H_\r
47 #define _ALDEV_H_\r
48 \r
49 #include <complib/comp_lib.h>\r
50 #include <complib/cl_waitobj.h>\r
51 #include <complib/cl_ioctl.h>\r
52 #include <iba/ib_al.h>\r
53 #include <iba/ib_al_ioctl.h>\r
54 \r
55 #define AL_DEVICE_NAME  L"\\Device\\ibal"\r
56 #define ALDEV_KEY               (0x3B)  /* Matches FILE_DEVICE_INFINIBAND from wdm.h */\r
57 \r
58 #define AL_IOCTL_VERSION                        (11)\r
59 \r
60 /* max number of devices with non-default pkey */\r
61 #define MAX_NUM_PKEY    16\r
62 \r
63 typedef struct _pkey_array\r
64 {\r
65         ib_net64_t         port_guid;\r
66         ib_net16_t         pkey_num;\r
67         ib_net16_t     pkey_array[MAX_NUM_PKEY];\r
68 }pkey_array_t;\r
69 #ifdef  CL_KERNEL\r
70 \r
71 /* Function prototypes for al device framework */\r
72 \r
73 AL_EXPORT cl_status_t AL_API\r
74 al_dev_open(\r
75         IN                              cl_ioctl_handle_t                       h_ioctl );\r
76 \r
77 AL_EXPORT cl_status_t AL_API\r
78 al_dev_close(\r
79         IN                              cl_ioctl_handle_t                       h_ioctl );\r
80 \r
81 AL_EXPORT cl_status_t AL_API\r
82 al_dev_ioctl(\r
83         IN                              cl_ioctl_handle_t                       h_ioctl );\r
84 \r
85 void\r
86 al_dev_cancel_ioctl(\r
87         IN                              cl_ioctl_handle_t                       h_ioctl );\r
88 \r
89 void\r
90 al_dev_cancel_io(\r
91         IN                              DEVICE_OBJECT                           *p_dev_obj,\r
92         IN                              IRP                                                     *p_irp );\r
93 \r
94 cl_status_t\r
95 bus_add_pkey(\r
96         IN                              cl_ioctl_handle_t                       h_ioctl );\r
97 cl_status_t\r
98 bus_rem_pkey(\r
99         IN                              cl_ioctl_handle_t                       h_ioctl );\r
100 \r
101 /* Define data structures for user-mode proxy */\r
102 #else           /* CL_KERNEL */\r
103 \r
104 \r
105 /* Prototype for the ioctl support function */\r
106 cl_status_t\r
107 do_al_dev_ioctl(\r
108         IN                              uint32_t                                        command,\r
109         IN                              void                                            *p_buf,\r
110         IN                              uintn_t                                         buf_size,\r
111         IN                              void                                            *p_out_buf,\r
112         IN                              uintn_t                                         out_buf_size,\r
113                 OUT                     uintn_t                                         *p_bytes_ret );\r
114 \r
115 \r
116 #endif          /* CL_KERNEL */\r
117 \r
118 /*\r
119  * Shared between user and kernel mode.\r
120  */\r
121 \r
122 \r
123 /****d* AL device Helper/al_proxy_ops_t\r
124 * NAME\r
125 *       al_proxy_ops_t\r
126 *\r
127 * DESCRIPTION\r
128 *\r
129 *       Define the enumeration for UAL/proxy excluding AL specific\r
130 *       These are intended to be the support ioctls such as the\r
131 *       notification from the proxy to the UAL in user-mode\r
132 *\r
133 * SYNOPSIS\r
134 */\r
135 typedef enum al_proxy_ops\r
136 {\r
137         al_proxy_ops_start = 0,\r
138 \r
139         ual_get_comp_cb_info = al_proxy_ops_start+1,\r
140         ual_get_misc_cb_info,\r
141         ual_bind,\r
142         ual_bind_sa,\r
143         ual_bind_pnp,\r
144         ual_bind_misc,\r
145         ual_bind_cm,\r
146         ual_bind_cq,\r
147         ual_bind_destroy,\r
148         ual_bind_nd,\r
149         al_proxy_maxops\r
150 \r
151 }       al_proxy_ops_t;\r
152 /**********/\r
153 /*\r
154  * Various Opration Allowable on the System Helper\r
155  */\r
156 \r
157 /* IOCTL to specify what notification wait objects are used by UAL\r
158  * for asynchronous event notifications from proxy\r
159  */\r
160 \r
161 #define UAL_GET_COMP_CB_INFO    IOCTL_CODE(ALDEV_KEY, ual_get_comp_cb_info)\r
162 #define UAL_GET_MISC_CB_INFO    IOCTL_CODE(ALDEV_KEY, ual_get_misc_cb_info)\r
163 #define UAL_BIND                        IOCTL_CODE(ALDEV_KEY, ual_bind)\r
164 #define UAL_BIND_SA                     IOCTL_CODE(ALDEV_KEY, ual_bind_sa)\r
165 #define UAL_BIND_PNP            IOCTL_CODE(ALDEV_KEY, ual_bind_pnp)\r
166 #define UAL_BIND_MISC           IOCTL_CODE(ALDEV_KEY, ual_bind_misc)\r
167 #define UAL_BIND_CM                     IOCTL_CODE(ALDEV_KEY, ual_bind_cm)\r
168 #define UAL_BIND_CQ                     IOCTL_CODE(ALDEV_KEY, ual_bind_cq)\r
169 #define UAL_BIND_DESTROY        IOCTL_CODE(ALDEV_KEY, ual_bind_destroy)\r
170 #define UAL_BIND_ND                     IOCTL_CODE(ALDEV_KEY, ual_bind_nd)\r
171 \r
172 #define AL_PROXY_OPS_START      IOCTL_CODE(ALDEV_KEY, al_proxy_ops_start)\r
173 #define AL_PROXY_MAXOPS         IOCTL_CODE(ALDEV_KEY, al_proxy_maxops)\r
174 \r
175 #define IS_AL_PROXY_IOCTL(cmd)  \\r
176                         ((cmd) > AL_PROXY_OPS_START && (cmd) < AL_PROXY_MAXOPS)\r
177 \r
178 \r
179 \r
180 /****d* AL device Helper/al_dev_ops_t\r
181 * NAME\r
182 *       al_dev_ops_t\r
183 *\r
184 * DESCRIPTION\r
185 *       AL device supports the following ioctls\r
186 *               1. those meant strictly for the consumption of the proxy\r
187 *               2. those meant to denote an AL api and hence the call\r
188 *               is further dispatched AL api and/or KAL internal interface\r
189 *\r
190 * SYNOPSIS\r
191 */\r
192 /* All verbs related ioctls */\r
193 typedef enum _al_verbs_ops\r
194 {\r
195         al_verbs_ops_start = al_proxy_maxops,\r
196 \r
197         ual_get_uvp_name_cmd = al_verbs_ops_start + 1,\r
198         ual_open_ca_ioctl_cmd,\r
199         ual_query_ca_ioctl_cmd,\r
200         ual_modify_ca_ioctl_cmd,\r
201         ual_close_ca_ioctl_cmd,\r
202         ual_ci_call_ioctl_cmd,\r
203         ual_alloc_pd_ioctl_cmd,\r
204         ual_dealloc_pd_ioctl_cmd,\r
205         ual_create_av_ioctl_cmd,\r
206         ual_query_av_ioctl_cmd,\r
207         ual_modify_av_ioctl_cmd,\r
208         ual_destroy_av_ioctl_cmd,\r
209         ual_create_srq_ioctl_cmd,\r
210         ual_query_srq_ioctl_cmd,\r
211         ual_modify_srq_ioctl_cmd,\r
212         ual_destroy_srq_ioctl_cmd,\r
213         ual_create_qp_ioctl_cmd,\r
214         ual_query_qp_ioctl_cmd,\r
215         ual_modify_qp_ioctl_cmd,\r
216         ual_destroy_qp_ioctl_cmd,\r
217         ual_create_cq_ioctl_cmd,\r
218         ual_query_cq_ioctl_cmd,\r
219         ual_modify_cq_ioctl_cmd,\r
220         ual_destroy_cq_ioctl_cmd,\r
221         ual_reg_mr_ioctl_cmd,\r
222         ual_query_mr_ioctl_cmd,\r
223         ual_rereg_mem_ioctl_cmd,\r
224         ual_reg_shared_ioctl_cmd,\r
225         ual_dereg_mr_ioctl_cmd,\r
226         ual_create_mw_ioctl_cmd,\r
227         ual_query_mw_ioctl_cmd,\r
228         ual_bind_mw_ioctl_cmd,\r
229         ual_destroy_mw_ioctl_cmd,\r
230         ual_post_send_ioctl_cmd,\r
231         ual_post_recv_ioctl_cmd,\r
232         ual_post_srq_recv_ioctl_cmd,\r
233         ual_peek_cq_ioctl_cmd,\r
234         ual_poll_cq_ioctl_cmd,\r
235         ual_rearm_cq_ioctl_cmd,\r
236         ual_rearm_n_cq_ioctl_cmd,\r
237         ual_attach_mcast_ioctl_cmd,\r
238         ual_detach_mcast_ioctl_cmd,\r
239         ual_get_spl_qp_cmd,\r
240 \r
241         al_verbs_maxops\r
242 \r
243 }       al_verbs_ops_t;\r
244 \r
245 #define AL_VERBS_OPS_START      IOCTL_CODE(ALDEV_KEY, al_verbs_ops_start)\r
246 #define AL_VERBS_MAXOPS         IOCTL_CODE(ALDEV_KEY, al_verbs_maxops)\r
247 #define IS_VERBS_IOCTL(cmd)             \\r
248         ((cmd) > AL_VERBS_OPS_START && (cmd) < AL_VERBS_MAXOPS)\r
249 \r
250 /* All subnet management related ioctls */\r
251 \r
252 typedef enum _al_subnet_ops\r
253 {\r
254         al_subnet_ops_start = al_verbs_maxops,\r
255 \r
256         ual_reg_svc_cmd = al_subnet_ops_start + 1,\r
257         ual_dereg_svc_cmd,\r
258         ual_send_sa_req_cmd,\r
259         ual_cancel_sa_req_cmd,\r
260         ual_mad_send_cmd,\r
261         ual_mad_recv_cmd,\r
262         ual_init_dgram_svc_cmd,\r
263         ual_reg_mad_svc_cmd,\r
264         ual_dereg_mad_svc_cmd,\r
265         ual_reg_mad_pool_cmd,\r
266         ual_dereg_mad_pool_cmd,\r
267         ual_cancel_mad_cmd,\r
268         ual_mad_recv_comp_cmd,\r
269         ual_local_mad_cmd,\r
270         \r
271         al_subnet_maxops\r
272 \r
273 }       al_subnet_ops_t;\r
274 \r
275 #define AL_SUBNET_OPS_START     IOCTL_CODE(ALDEV_KEY, al_subnet_ops_start)\r
276 #define AL_SUBNET_MAXOPS        IOCTL_CODE(ALDEV_KEY, al_subnet_maxops)\r
277 #define IS_SUBNET_IOCTL(cmd)    \\r
278         ((cmd) > AL_SUBNET_OPS_START && (cmd) < AL_SUBNET_MAXOPS)\r
279 \r
280 /* All ioc related ioctls */\r
281 \r
282 typedef enum _al_ioc_ops\r
283 {\r
284         al_ioc_ops_start = al_subnet_maxops,\r
285 \r
286         ual_create_ioc_cmd = al_ioc_ops_start + 1,\r
287         ual_destroy_ioc_cmd,\r
288         ual_reg_ioc_cmd,\r
289         ual_reject_ioc_cmd,\r
290         ual_add_svc_entry_cmd,\r
291         ual_remove_svc_entry_cmd,\r
292         ual_req_create_pdo,\r
293         ual_req_remove_pdo,\r
294         al_ioc_maxops,\r
295 \r
296 }       al_ioc_ops_t;\r
297 \r
298 #define AL_IOC_OPS_START        IOCTL_CODE(ALDEV_KEY, al_ioc_ops_start)\r
299 #define AL_IOC_MAXOPS           IOCTL_CODE(ALDEV_KEY, al_ioc_maxops)\r
300 #define IS_IOC_IOCTL(cmd)               \\r
301         ((cmd) > AL_IOC_OPS_START && (cmd) < AL_IOC_MAXOPS)\r
302 \r
303 typedef enum _al_cm_sidr_ops\r
304 {\r
305         al_cm_ops_start = al_ioc_maxops,\r
306         ual_cm_req_cmd = al_cm_ops_start + 1,\r
307         ual_cm_rep_cmd,\r
308         ual_cm_dreq_cmd,\r
309         ual_cm_drep_cmd,\r
310         ual_cm_listen_cmd,\r
311         ual_cm_cancel_cmd,\r
312         ual_cm_rtu_cmd,\r
313         ual_cm_rej_cmd,\r
314         ual_cm_handoff_cmd,\r
315         ual_cm_mra_cmd,\r
316         ual_cm_lap_cmd,\r
317         ual_cm_apr_cmd,\r
318         ual_force_apm_cmd,\r
319         ual_reg_sidr_cmd,\r
320         ual_sidr_req_cmd,\r
321         ual_sidr_rep_cmd,\r
322 \r
323         al_cm_maxops\r
324 \r
325 } al_cm_sidr_ops_t;\r
326 \r
327 #define AL_CM_OPS_START         IOCTL_CODE(ALDEV_KEY, al_cm_ops_start)\r
328 #define AL_CM_MAXOPS            IOCTL_CODE(ALDEV_KEY, al_cm_maxops)\r
329 #define IS_CM_IOCTL(cmd)                \\r
330         ((cmd) > AL_CM_OPS_START && (cmd) < AL_CM_MAXOPS)\r
331 \r
332 \r
333 typedef enum _ual_cep_ops\r
334 {\r
335         al_cep_ops_start = al_ioc_maxops,\r
336         ual_create_cep,\r
337         ual_destroy_cep,\r
338         ual_cep_listen,\r
339         ual_cep_pre_req,\r
340         ual_cep_send_req,\r
341         ual_cep_pre_rep,\r
342         ual_cep_send_rep,\r
343         ual_cep_get_rtr,\r
344         ual_cep_get_rts,\r
345         ual_cep_rtu,\r
346         ual_cep_rej,\r
347         ual_cep_mra,\r
348         ual_cep_lap,\r
349         ual_cep_pre_apr,\r
350         ual_cep_send_apr,\r
351         ual_cep_dreq,\r
352         ual_cep_drep,\r
353         ual_cep_get_timewait,\r
354         ual_cep_get_event,\r
355         ual_cep_poll,\r
356         ual_cep_get_req_cid,\r
357         ual_cep_get_pdata,\r
358 \r
359         al_cep_maxops\r
360 \r
361 } ual_cep_ops_t;\r
362 \r
363 #define UAL_CEP_OPS_START       IOCTL_CODE(ALDEV_KEY, al_cep_ops_start)\r
364 #define UAL_CEP_MAXOPS          IOCTL_CODE(ALDEV_KEY, al_cep_maxops)\r
365 #define IS_CEP_IOCTL(cmd)               \\r
366         ((cmd) > UAL_CEP_OPS_START && (cmd) < UAL_CEP_MAXOPS)\r
367 \r
368 \r
369 /* AL ioctls */\r
370 \r
371 typedef enum _al_dev_ops\r
372 {\r
373         al_ops_start = al_cep_maxops,\r
374 \r
375         ual_reg_shmid_cmd,\r
376         ual_get_ca_attr,\r
377         ual_reg_pnp_cmd,\r
378         ual_poll_pnp_cmd,\r
379         ual_rearm_pnp_cmd,\r
380         ual_dereg_pnp_cmd,\r
381         \r
382         ual_access_flash,\r
383 \r
384         al_maxops\r
385 \r
386 }       al_dev_ops_t;\r
387 \r
388 #define AL_OPS_START                    IOCTL_CODE(ALDEV_KEY, al_ops_start)\r
389 #define AL_MAXOPS                               IOCTL_CODE(ALDEV_KEY, al_maxops)\r
390 \r
391 #define IS_AL_IOCTL(cmd)                \\r
392         ((cmd) > AL_OPS_START && (cmd) < AL_MAXOPS)\r
393 \r
394 /* NDI ioctls */\r
395 \r
396 typedef enum _al_ndi_ops\r
397 {\r
398         al_ndi_ops_start = al_maxops,\r
399 \r
400         ual_ndi_create_cq_ioctl_cmd,\r
401         ual_ndi_notify_cq_ioctl_cmd,\r
402         ual_ndi_cancel_cq_ioctl_cmd,\r
403         ual_ndi_modify_qp_ioctl_cmd,\r
404         ual_ndi_req_cm_ioctl_cmd,\r
405         ual_ndi_rep_cm_ioctl_cmd,\r
406         ual_ndi_rtu_cm_ioctl_cmd,\r
407         ual_ndi_rej_cm_ioctl_cmd,\r
408         ual_ndi_dreq_cm_ioctl_cmd,\r
409     ual_ndi_noop,\r
410     ual_ndi_notify_dreq_cmd,\r
411 \r
412         al_ndi_maxops\r
413 \r
414 }       al_ndi_ops_t;\r
415 \r
416 typedef enum _al_ioc_device_config\r
417 {\r
418         al_ioc_device_config_start = al_ndi_maxops,\r
419         ual_ioc_device_create,\r
420         ual_ioc_list,\r
421         al_ioc_device_config_maxops\r
422 \r
423 }       al_ioc_device_config_t;\r
424 \r
425 #define AL_NDI_OPS_START                        IOCTL_CODE(ALDEV_KEY, al_ndi_ops_start)\r
426 #define AL_NDI_MAXOPS                           IOCTL_CODE(ALDEV_KEY, al_ndi_maxops)\r
427 \r
428 #define IS_NDI_IOCTL(cmd)               \\r
429         ((cmd) > AL_NDI_OPS_START && (cmd) < AL_NDI_MAXOPS)\r
430 \r
431 /* NDI Related ioctl commands */\r
432 #define UAL_NDI_CREATE_CQ               IOCTL_CODE(ALDEV_KEY, ual_ndi_create_cq_ioctl_cmd)\r
433 #define UAL_NDI_NOTIFY_CQ               IOCTL_CODE(ALDEV_KEY, ual_ndi_notify_cq_ioctl_cmd)\r
434 #define UAL_NDI_CANCEL_CQ               IOCTL_CODE(ALDEV_KEY, ual_ndi_cancel_cq_ioctl_cmd)\r
435 #define UAL_NDI_MODIFY_QP               IOCTL_CODE(ALDEV_KEY, ual_ndi_modify_qp_ioctl_cmd)\r
436 #define UAL_NDI_REQ_CM                  IOCTL_CODE(ALDEV_KEY, ual_ndi_req_cm_ioctl_cmd)\r
437 #define UAL_NDI_REP_CM                  IOCTL_CODE(ALDEV_KEY, ual_ndi_rep_cm_ioctl_cmd)\r
438 #define UAL_NDI_RTU_CM                  IOCTL_CODE(ALDEV_KEY, ual_ndi_rtu_cm_ioctl_cmd)\r
439 #define UAL_NDI_REJ_CM                  IOCTL_CODE(ALDEV_KEY, ual_ndi_rej_cm_ioctl_cmd)\r
440 #define UAL_NDI_DREQ_CM                 IOCTL_CODE(ALDEV_KEY, ual_ndi_dreq_cm_ioctl_cmd)\r
441 #define UAL_NDI_NOOP            IOCTL_CODE(ALDEV_KEY, ual_ndi_noop)\r
442 #define UAL_NDI_NOTIFY_DREQ     IOCTL_CODE(ALDEV_KEY, ual_ndi_notify_dreq_cmd)\r
443 \r
444 /*\r
445  * Various Operation Allowable on the System Helper\r
446  */\r
447 \r
448 #define UAL_REG_SHMID           IOCTL_CODE(ALDEV_KEY, ual_reg_shmid_cmd)\r
449 #define UAL_GET_VENDOR_LIBCFG IOCTL_CODE(ALDEV_KEY, ual_get_uvp_name_cmd)\r
450 #define UAL_OPEN_CA                     IOCTL_CODE(ALDEV_KEY, ual_open_ca_ioctl_cmd)\r
451 #define UAL_QUERY_CA            IOCTL_CODE(ALDEV_KEY, ual_query_ca_ioctl_cmd)\r
452 #define UAL_MODIFY_CA           IOCTL_CODE(ALDEV_KEY, ual_modify_ca_ioctl_cmd)\r
453 #define UAL_CLOSE_CA            IOCTL_CODE(ALDEV_KEY, ual_close_ca_ioctl_cmd)\r
454 #define UAL_CI_CALL                     IOCTL_CODE(ALDEV_KEY, ual_ci_call_ioctl_cmd)\r
455 #define UAL_ALLOC_PD            IOCTL_CODE(ALDEV_KEY, ual_alloc_pd_ioctl_cmd)\r
456 #define UAL_DEALLOC_PD          IOCTL_CODE(ALDEV_KEY, ual_dealloc_pd_ioctl_cmd)\r
457 #define UAL_CREATE_AV           IOCTL_CODE(ALDEV_KEY, ual_create_av_ioctl_cmd)\r
458 #define UAL_QUERY_AV            IOCTL_CODE(ALDEV_KEY, ual_query_av_ioctl_cmd)\r
459 #define UAL_MODIFY_AV           IOCTL_CODE(ALDEV_KEY, ual_modify_av_ioctl_cmd)\r
460 #define UAL_DESTROY_AV          IOCTL_CODE(ALDEV_KEY, ual_destroy_av_ioctl_cmd)\r
461 #define UAL_CREATE_SRQ          IOCTL_CODE(ALDEV_KEY, ual_create_srq_ioctl_cmd)\r
462 #define UAL_QUERY_SRQ           IOCTL_CODE(ALDEV_KEY, ual_query_srq_ioctl_cmd)\r
463 #define UAL_MODIFY_SRQ          IOCTL_CODE(ALDEV_KEY, ual_modify_srq_ioctl_cmd)\r
464 #define UAL_DESTROY_SRQ IOCTL_CODE(ALDEV_KEY, ual_destroy_srq_ioctl_cmd)\r
465 #define UAL_CREATE_QP           IOCTL_CODE(ALDEV_KEY, ual_create_qp_ioctl_cmd)\r
466 #define UAL_QUERY_QP            IOCTL_CODE(ALDEV_KEY, ual_query_qp_ioctl_cmd)\r
467 #define UAL_MODIFY_QP           IOCTL_CODE(ALDEV_KEY, ual_modify_qp_ioctl_cmd)\r
468 #define UAL_DESTROY_QP          IOCTL_CODE(ALDEV_KEY, ual_destroy_qp_ioctl_cmd)\r
469 #define UAL_CREATE_CQ           IOCTL_CODE(ALDEV_KEY, ual_create_cq_ioctl_cmd)\r
470 #define UAL_QUERY_CQ            IOCTL_CODE(ALDEV_KEY, ual_query_cq_ioctl_cmd)\r
471 #define UAL_MODIFY_CQ           IOCTL_CODE(ALDEV_KEY, ual_modify_cq_ioctl_cmd)\r
472 #define UAL_DESTROY_CQ          IOCTL_CODE(ALDEV_KEY, ual_destroy_cq_ioctl_cmd)\r
473 #define UAL_REG_MR                      IOCTL_CODE(ALDEV_KEY, ual_reg_mr_ioctl_cmd)\r
474 #define UAL_QUERY_MR            IOCTL_CODE(ALDEV_KEY, ual_query_mr_ioctl_cmd)\r
475 #define UAL_MODIFY_MR           IOCTL_CODE(ALDEV_KEY, ual_rereg_mem_ioctl_cmd)\r
476 #define UAL_REG_SHARED          IOCTL_CODE(ALDEV_KEY, ual_reg_shared_ioctl_cmd)\r
477 #define UAL_DEREG_MR            IOCTL_CODE(ALDEV_KEY, ual_dereg_mr_ioctl_cmd)\r
478 #define UAL_CREATE_MW           IOCTL_CODE(ALDEV_KEY, ual_create_mw_ioctl_cmd)\r
479 #define UAL_QUERY_MW            IOCTL_CODE(ALDEV_KEY, ual_query_mw_ioctl_cmd)\r
480 #define UAL_BIND_MW                     IOCTL_CODE(ALDEV_KEY, ual_bind_mw_ioctl_cmd)\r
481 #define UAL_DESTROY_MW          IOCTL_CODE(ALDEV_KEY, ual_destroy_mw_ioctl_cmd)\r
482 #define UAL_POST_SEND           IOCTL_CODE(ALDEV_KEY, ual_post_send_ioctl_cmd)\r
483 #define UAL_POST_RECV           IOCTL_CODE(ALDEV_KEY, ual_post_recv_ioctl_cmd)\r
484 #define UAL_POST_SRQ_RECV       IOCTL_CODE(ALDEV_KEY, ual_post_srq_recv_ioctl_cmd)\r
485 #define UAL_PEEK_CQ                     IOCTL_CODE(ALDEV_KEY, ual_peek_cq_ioctl_cmd)\r
486 #define UAL_POLL_CQ                     IOCTL_CODE(ALDEV_KEY, ual_poll_cq_ioctl_cmd)\r
487 #define UAL_REARM_CQ            IOCTL_CODE(ALDEV_KEY, ual_rearm_cq_ioctl_cmd)\r
488 #define UAL_REARM_N_CQ          IOCTL_CODE(ALDEV_KEY, ual_rearm_n_cq_ioctl_cmd)\r
489 #define UAL_ATTACH_MCAST        IOCTL_CODE(ALDEV_KEY, ual_attach_mcast_ioctl_cmd)\r
490 #define UAL_DETACH_MCAST        IOCTL_CODE(ALDEV_KEY, ual_detach_mcast_ioctl_cmd)\r
491 \r
492 /* Subnet management related ioctl commands */\r
493 #define UAL_REG_SVC                     IOCTL_CODE(ALDEV_KEY, ual_reg_svc_cmd)\r
494 #define UAL_DEREG_SVC           IOCTL_CODE(ALDEV_KEY, ual_dereg_svc_cmd)\r
495 #define UAL_SEND_SA_REQ         IOCTL_CODE(ALDEV_KEY, ual_send_sa_req_cmd)\r
496 #define UAL_CANCEL_SA_REQ       IOCTL_CODE(ALDEV_KEY, ual_cancel_sa_req_cmd)\r
497 #define UAL_MAD_SEND            IOCTL_CODE(ALDEV_KEY, ual_mad_send_cmd)\r
498 #define UAL_INIT_DGRM_SVC       IOCTL_CODE(ALDEV_KEY, ual_init_dgram_svc_cmd)\r
499 #define UAL_REG_MAD_SVC         IOCTL_CODE(ALDEV_KEY, ual_reg_mad_svc_cmd)\r
500 #define UAL_DEREG_MAD_SVC       IOCTL_CODE(ALDEV_KEY, ual_dereg_mad_svc_cmd)\r
501 #define UAL_REG_MAD_POOL        IOCTL_CODE(ALDEV_KEY, ual_reg_mad_pool_cmd)\r
502 #define UAL_DEREG_MAD_POOL      IOCTL_CODE(ALDEV_KEY, ual_dereg_mad_pool_cmd)\r
503 #define UAL_CANCEL_MAD          IOCTL_CODE(ALDEV_KEY, ual_cancel_mad_cmd)\r
504 #define UAL_GET_SPL_QP_ALIAS IOCTL_CODE(ALDEV_KEY, ual_get_spl_qp_cmd)\r
505 #define UAL_MAD_RECV_COMP       IOCTL_CODE(ALDEV_KEY, ual_mad_recv_comp_cmd)\r
506 #define UAL_LOCAL_MAD           IOCTL_CODE(ALDEV_KEY, ual_local_mad_cmd)\r
507 \r
508 /* CM Related ioctl commands */\r
509 #define UAL_CM_LISTEN           IOCTL_CODE(ALDEV_KEY, ual_cm_listen_cmd)\r
510 #define UAL_CM_CANCEL           IOCTL_CODE(ALDEV_KEY, ual_cm_cancel_cmd)\r
511 #define UAL_CM_REQ                      IOCTL_CODE(ALDEV_KEY, ual_cm_req_cmd)\r
512 #define UAL_CM_REP                      IOCTL_CODE(ALDEV_KEY, ual_cm_rep_cmd)\r
513 #define UAL_CM_RTU                      IOCTL_CODE(ALDEV_KEY, ual_cm_rtu_cmd)\r
514 #define UAL_CM_REJ                      IOCTL_CODE(ALDEV_KEY, ual_cm_rej_cmd)\r
515 #define UAL_CM_HANDOFF          IOCTL_CODE(ALDEV_KEY, ual_cm_handoff_cmd)\r
516 #define UAL_CM_DREQ                     IOCTL_CODE(ALDEV_KEY, ual_cm_dreq_cmd)\r
517 #define UAL_CM_DREP                     IOCTL_CODE(ALDEV_KEY, ual_cm_drep_cmd)\r
518 #define UAL_CM_MRA                      IOCTL_CODE(ALDEV_KEY, ual_cm_mra_cmd)\r
519 #define UAL_CM_LAP                      IOCTL_CODE(ALDEV_KEY, ual_cm_lap_cmd)\r
520 #define UAL_CM_APR                      IOCTL_CODE(ALDEV_KEY, ual_cm_apr_cmd)\r
521 #define UAL_CM_FORCE_APM        IOCTL_CODE(ALDEV_KEY, ual_force_apm_cmd)\r
522 \r
523 /* CEP Related IOCTL commands */\r
524 #define UAL_CREATE_CEP          IOCTL_CODE(ALDEV_KEY, ual_create_cep)\r
525 #define UAL_DESTROY_CEP         IOCTL_CODE(ALDEV_KEY, ual_destroy_cep)\r
526 #define UAL_CEP_LISTEN          IOCTL_CODE(ALDEV_KEY, ual_cep_listen)\r
527 #define UAL_CEP_PRE_REQ         IOCTL_CODE(ALDEV_KEY, ual_cep_pre_req)\r
528 #define UAL_CEP_SEND_REQ        IOCTL_CODE(ALDEV_KEY, ual_cep_send_req)\r
529 #define UAL_CEP_PRE_REP         IOCTL_CODE(ALDEV_KEY, ual_cep_pre_rep)\r
530 #define UAL_CEP_SEND_REP        IOCTL_CODE(ALDEV_KEY, ual_cep_send_rep)\r
531 #define UAL_CEP_GET_RTR         IOCTL_CODE(ALDEV_KEY, ual_cep_get_rtr)\r
532 #define UAL_CEP_GET_RTS         IOCTL_CODE(ALDEV_KEY, ual_cep_get_rts)\r
533 #define UAL_CEP_RTU                     IOCTL_CODE(ALDEV_KEY, ual_cep_rtu)\r
534 #define UAL_CEP_REJ                     IOCTL_CODE(ALDEV_KEY, ual_cep_rej)\r
535 #define UAL_CEP_MRA                     IOCTL_CODE(ALDEV_KEY, ual_cep_mra)\r
536 #define UAL_CEP_LAP                     IOCTL_CODE(ALDEV_KEY, ual_cep_lap)\r
537 #define UAL_CEP_PRE_APR         IOCTL_CODE(ALDEV_KEY, ual_cep_pre_apr)\r
538 #define UAL_CEP_SEND_APR        IOCTL_CODE(ALDEV_KEY, ual_cep_send_apr)\r
539 #define UAL_CEP_DREQ            IOCTL_CODE(ALDEV_KEY, ual_cep_dreq)\r
540 #define UAL_CEP_DREP            IOCTL_CODE(ALDEV_KEY, ual_cep_drep)\r
541 #define UAL_CEP_GET_TIMEWAIT    IOCTL_CODE(ALDEV_KEY, ual_cep_get_timewait)\r
542 #define UAL_CEP_GET_EVENT       IOCTL_CODE(ALDEV_KEY, ual_cep_get_event)\r
543 #define UAL_CEP_POLL            IOCTL_CODE(ALDEV_KEY, ual_cep_poll)\r
544 #define UAL_CEP_GET_REQ_CID     IOCTL_CODE(ALDEV_KEY, ual_cep_get_req_cid)\r
545 #define UAL_CEP_GET_PDATA       IOCTL_CODE(ALDEV_KEY, ual_cep_get_pdata)\r
546 \r
547 \r
548 #define UAL_GET_CA_ATTR_INFO    IOCTL_CODE(ALDEV_KEY, ual_get_ca_attr)\r
549 #define UAL_REQ_CREATE_PDO              IOCTL_CODE(ALDEV_KEY, ual_req_create_pdo)\r
550 #define UAL_REQ_REMOVE_PDO              IOCTL_CODE(ALDEV_KEY, ual_req_remove_pdo)\r
551 \r
552 /* PnP related ioctl commands. */\r
553 #define UAL_REG_PNP                     IOCTL_CODE(ALDEV_KEY, ual_reg_pnp_cmd)\r
554 #define UAL_POLL_PNP            IOCTL_CODE(ALDEV_KEY, ual_poll_pnp_cmd)\r
555 #define UAL_REARM_PNP           IOCTL_CODE(ALDEV_KEY, ual_rearm_pnp_cmd)\r
556 #define UAL_DEREG_PNP           IOCTL_CODE(ALDEV_KEY, ual_dereg_pnp_cmd)\r
557 #define UAL_ACCESS_FLASH        IOCTL_CODE(ALDEV_KEY, ual_access_flash)\r
558 \r
559 #define AL_IOC_DEVICE_CONFIG_START              IOCTL_CODE(ALDEV_KEY, al_ioc_device_config_start)\r
560 #define AL_IOC_DEVICE_CONFIG_MAXOPS             IOCTL_CODE(ALDEV_KEY, al_ioc_device_config_maxops)\r
561 \r
562 #define IS_IOC_DEVICE_CONFIG_IOCTL(cmd)         \\r
563         ((cmd) > AL_IOC_DEVICE_CONFIG_START && (cmd) < AL_IOC_DEVICE_CONFIG_MAXOPS)\r
564 \r
565 #define UAL_IOC_DEVICE_CREATE                   IOCTL_CODE(ALDEV_KEY, ual_ioc_device_create)\r
566 #define UAL_IOC_LIST                            IOCTL_CODE(ALDEV_KEY, ual_ioc_list)\r
567 \r
568 #endif  /* _AL_DEV_H_ */\r