2 * Copyright (c) 2005 Topspin Communications. All rights reserved.
3 * Copyright (c) 2005 Cisco Systems. All rights reserved.
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the
9 * OpenIB.org BSD license below:
11 * Redistribution and use in source and binary forms, with or
12 * without modification, are permitted provided that the following
15 * - Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
19 * - Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
21 * disclaimer in the documentation and/or other materials
22 * provided with the distribution.
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33 * $Id: ib_user_verbs.h 2708 2005-06-24 17:27:21Z roland $
36 #ifndef IB_USER_VERBS_H
37 #define IB_USER_VERBS_H
39 #include <linux/types.h>
42 * Increment this value if any changes that break userspace ABI
43 * compatibility are made.
45 #define IB_USER_VERBS_ABI_VERSION 3
48 IB_USER_VERBS_CMD_GET_CONTEXT,
49 IB_USER_VERBS_CMD_QUERY_DEVICE,
50 IB_USER_VERBS_CMD_QUERY_PORT,
51 IB_USER_VERBS_CMD_ALLOC_PD,
52 IB_USER_VERBS_CMD_DEALLOC_PD,
53 IB_USER_VERBS_CMD_CREATE_AH,
54 IB_USER_VERBS_CMD_MODIFY_AH,
55 IB_USER_VERBS_CMD_QUERY_AH,
56 IB_USER_VERBS_CMD_DESTROY_AH,
57 IB_USER_VERBS_CMD_REG_MR,
58 IB_USER_VERBS_CMD_REG_SMR,
59 IB_USER_VERBS_CMD_REREG_MR,
60 IB_USER_VERBS_CMD_QUERY_MR,
61 IB_USER_VERBS_CMD_DEREG_MR,
62 IB_USER_VERBS_CMD_ALLOC_MW,
63 IB_USER_VERBS_CMD_BIND_MW,
64 IB_USER_VERBS_CMD_DEALLOC_MW,
65 IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL,
66 IB_USER_VERBS_CMD_CREATE_CQ,
67 IB_USER_VERBS_CMD_RESIZE_CQ,
68 IB_USER_VERBS_CMD_DESTROY_CQ,
69 IB_USER_VERBS_CMD_POLL_CQ,
70 IB_USER_VERBS_CMD_PEEK_CQ,
71 IB_USER_VERBS_CMD_REQ_NOTIFY_CQ,
72 IB_USER_VERBS_CMD_CREATE_QP,
73 IB_USER_VERBS_CMD_QUERY_QP,
74 IB_USER_VERBS_CMD_MODIFY_QP,
75 IB_USER_VERBS_CMD_DESTROY_QP,
76 IB_USER_VERBS_CMD_POST_SEND,
77 IB_USER_VERBS_CMD_POST_RECV,
78 IB_USER_VERBS_CMD_ATTACH_MCAST,
79 IB_USER_VERBS_CMD_DETACH_MCAST,
80 IB_USER_VERBS_CMD_CREATE_SRQ,
81 IB_USER_VERBS_CMD_MODIFY_SRQ,
82 IB_USER_VERBS_CMD_QUERY_SRQ,
83 IB_USER_VERBS_CMD_DESTROY_SRQ,
84 IB_USER_VERBS_CMD_POST_SRQ_RECV
88 * Make sure that all structs defined in this file remain laid out so
89 * that they pack the same way on 32-bit and 64-bit architectures (to
90 * avoid incompatibility between 32-bit userspace and 64-bit kernels).
91 * In particular do not use pointer types -- pass pointers in __u64
95 struct ib_uverbs_async_event_desc {
97 __u32 event_type; /* enum ib_event_type */
101 struct ib_uverbs_comp_event_desc {
106 * All commands from userspace should start with a __u32 command field
107 * followed by __u16 in_words and out_words fields (which give the
108 * length of the command block and response buffer if any in 32-bit
109 * words). The kernel driver will read these fields first and read
110 * the rest of the command struct based on these value.
113 struct ib_uverbs_cmd_hdr {
119 struct ib_uverbs_get_context {
121 __u64 driver_data[0];
124 struct ib_uverbs_get_context_resp {
126 __u32 num_comp_vectors;
129 struct ib_uverbs_query_device {
131 __u64 driver_data[0];
134 struct ib_uverbs_query_device_resp {
137 __be64 sys_image_guid;
141 __u32 vendor_part_id;
145 __u32 device_cap_flags;
152 __u32 max_qp_rd_atom;
153 __u32 max_ee_rd_atom;
154 __u32 max_res_rd_atom;
155 __u32 max_qp_init_rd_atom;
156 __u32 max_ee_init_rd_atom;
161 __u32 max_raw_ipv6_qp;
162 __u32 max_raw_ethy_qp;
164 __u32 max_mcast_qp_attach;
165 __u32 max_total_mcast_qp_attach;
168 __u32 max_map_per_fmr;
173 __u8 local_ca_ack_delay;
178 struct ib_uverbs_query_port {
182 __u64 driver_data[0];
185 struct ib_uverbs_query_port_resp {
186 __u32 port_cap_flags;
189 __u32 qkey_viol_cntr;
201 __u8 init_type_reply;
208 struct ib_uverbs_alloc_pd {
210 __u64 driver_data[0];
213 struct ib_uverbs_alloc_pd_resp {
217 struct ib_uverbs_dealloc_pd {
221 struct ib_uverbs_reg_mr {
228 __u64 driver_data[0];
231 struct ib_uverbs_reg_mr_resp {
237 struct ib_uverbs_dereg_mr {
241 struct ib_uverbs_create_comp_channel {
245 struct ib_uverbs_create_comp_channel_resp {
249 struct ib_uverbs_create_cq {
256 __u64 driver_data[0];
259 struct ib_uverbs_create_cq_resp {
264 struct ib_uverbs_destroy_cq {
270 struct ib_uverbs_destroy_cq_resp {
271 __u32 comp_events_reported;
272 __u32 async_events_reported;
275 struct ib_uverbs_create_qp {
279 __u32 send_cq_handle;
280 __u32 recv_cq_handle;
286 __u32 max_inline_data;
291 __u64 driver_data[0];
294 struct ib_uverbs_create_qp_resp {
300 * This struct needs to remain a multiple of 8 bytes to keep the
301 * alignment of the modify QP parameters.
303 struct ib_uverbs_qp_dest {
318 struct ib_uverbs_modify_qp {
319 struct ib_uverbs_qp_dest dest;
320 struct ib_uverbs_qp_dest alt_dest;
327 __u32 qp_access_flags;
329 __u16 alt_pkey_index;
334 __u8 en_sqd_async_notify;
336 __u8 max_dest_rd_atomic;
345 __u64 driver_data[0];
348 struct ib_uverbs_modify_qp_resp {
351 struct ib_uverbs_destroy_qp {
357 struct ib_uverbs_destroy_qp_resp {
358 __u32 events_reported;
361 struct ib_uverbs_attach_mcast {
366 __u64 driver_data[0];
369 struct ib_uverbs_detach_mcast {
374 __u64 driver_data[0];
377 struct ib_uverbs_create_srq {
384 __u64 driver_data[0];
387 struct ib_uverbs_create_srq_resp {
391 struct ib_uverbs_modify_srq {
398 __u64 driver_data[0];
401 struct ib_uverbs_destroy_srq {
407 struct ib_uverbs_destroy_srq_resp {
408 __u32 events_reported;
411 #endif /* IB_USER_VERBS_H */