1219820Sjeff/*
2219820Sjeff * Copyright (c) 2007 Cisco, Inc.  All rights reserved.
3219820Sjeff *
4219820Sjeff * This software is available to you under a choice of one of two
5219820Sjeff * licenses.  You may choose to be licensed under the terms of the GNU
6219820Sjeff * General Public License (GPL) Version 2, available from the file
7219820Sjeff * COPYING in the main directory of this source tree, or the
8219820Sjeff * OpenIB.org BSD license below:
9219820Sjeff *
10219820Sjeff *     Redistribution and use in source and binary forms, with or
11219820Sjeff *     without modification, are permitted provided that the following
12219820Sjeff *     conditions are met:
13219820Sjeff *
14219820Sjeff *      - Redistributions of source code must retain the above
15219820Sjeff *        copyright notice, this list of conditions and the following
16219820Sjeff *        disclaimer.
17219820Sjeff *
18219820Sjeff *      - Redistributions in binary form must reproduce the above
19219820Sjeff *        copyright notice, this list of conditions and the following
20219820Sjeff *        disclaimer in the documentation and/or other materials
21219820Sjeff *        provided with the distribution.
22219820Sjeff *
23219820Sjeff * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24219820Sjeff * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25219820Sjeff * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26219820Sjeff * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27219820Sjeff * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28219820Sjeff * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29219820Sjeff * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30219820Sjeff * SOFTWARE.
31219820Sjeff */
32219820Sjeff
33219820Sjeff#ifndef MLX4_ABI_H
34219820Sjeff#define MLX4_ABI_H
35219820Sjeff
36219820Sjeff#include <infiniband/kern-abi.h>
37219820Sjeff
38219820Sjeff#define MLX4_UVERBS_MIN_ABI_VERSION	2
39219820Sjeff#define MLX4_UVERBS_MAX_ABI_VERSION	3
40219820Sjeff
41219820Sjeffstruct mlx4_alloc_ucontext_resp {
42219820Sjeff	struct ibv_get_context_resp	ibv_resp;
43219820Sjeff	__u32				qp_tab_size;
44219820Sjeff	__u16				bf_reg_size;
45219820Sjeff	__u16				bf_regs_per_page;
46219820Sjeff};
47219820Sjeff
48219820Sjeffstruct mlx4_alloc_pd_resp {
49219820Sjeff	struct ibv_alloc_pd_resp	ibv_resp;
50219820Sjeff	__u32				pdn;
51219820Sjeff	__u32				reserved;
52219820Sjeff};
53219820Sjeff
54219820Sjeffstruct mlx4_create_cq {
55219820Sjeff	struct ibv_create_cq		ibv_cmd;
56219820Sjeff	__u64				buf_addr;
57219820Sjeff	__u64				db_addr;
58219820Sjeff};
59219820Sjeff
60219820Sjeffstruct mlx4_create_cq_resp {
61219820Sjeff	struct ibv_create_cq_resp	ibv_resp;
62219820Sjeff	__u32				cqn;
63219820Sjeff	__u32				reserved;
64219820Sjeff};
65219820Sjeff
66219820Sjeffstruct mlx4_resize_cq {
67219820Sjeff	struct ibv_resize_cq		ibv_cmd;
68219820Sjeff	__u64				buf_addr;
69219820Sjeff};
70219820Sjeff
71219820Sjeff#ifdef HAVE_IBV_XRC_OPS
72219820Sjeffstruct mlx4_create_xrc_srq {
73219820Sjeff	struct ibv_create_xrc_srq	ibv_cmd;
74219820Sjeff	__u64				buf_addr;
75219820Sjeff	__u64				db_addr;
76219820Sjeff};
77219820Sjeff#endif
78219820Sjeff
79219820Sjeffstruct mlx4_create_srq {
80219820Sjeff	struct ibv_create_srq		ibv_cmd;
81219820Sjeff	__u64				buf_addr;
82219820Sjeff	__u64				db_addr;
83219820Sjeff};
84219820Sjeff
85219820Sjeffstruct mlx4_create_srq_resp {
86219820Sjeff	struct ibv_create_srq_resp	ibv_resp;
87219820Sjeff	__u32				srqn;
88219820Sjeff	__u32				reserved;
89219820Sjeff};
90219820Sjeff
91219820Sjeffstruct mlx4_create_qp {
92219820Sjeff	struct ibv_create_qp		ibv_cmd;
93219820Sjeff	__u64				buf_addr;
94219820Sjeff	__u64				db_addr;
95219820Sjeff	__u8				log_sq_bb_count;
96219820Sjeff	__u8				log_sq_stride;
97219820Sjeff	__u8				sq_no_prefetch;	/* was reserved in ABI 2 */
98219820Sjeff	__u8				reserved[5];
99219820Sjeff};
100219820Sjeff
101219820Sjeff#ifdef HAVE_IBV_XRC_OPS
102219820Sjeffstruct mlx4_open_xrc_domain_resp {
103219820Sjeff	struct ibv_open_xrc_domain_resp	ibv_resp;
104219820Sjeff	__u32				xrcdn;
105219820Sjeff	__u32				reserved;
106219820Sjeff};
107219820Sjeff#endif
108219820Sjeff
109219820Sjeff#endif /* MLX4_ABI_H */
110