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
39272407Shselasky#define MLX4_UVERBS_MAX_ABI_VERSION	4
40219820Sjeff
41277160Shselaskystruct mlx4_alloc_ucontext_resp_v3 {
42277160Shselasky	struct ibv_get_context_resp	ibv_resp;
43277160Shselasky	__u32				qp_tab_size;
44277160Shselasky	__u16				bf_reg_size;
45277160Shselasky	__u16				bf_regs_per_page;
46277160Shselasky};
47277160Shselasky
48219820Sjeffstruct mlx4_alloc_ucontext_resp {
49219820Sjeff	struct ibv_get_context_resp	ibv_resp;
50275228Shselasky	__u32				dev_caps;
51219820Sjeff	__u32				qp_tab_size;
52219820Sjeff	__u16				bf_reg_size;
53219820Sjeff	__u16				bf_regs_per_page;
54275228Shselasky	__u32				cqe_size;
55219820Sjeff};
56219820Sjeff
57219820Sjeffstruct mlx4_alloc_pd_resp {
58219820Sjeff	struct ibv_alloc_pd_resp	ibv_resp;
59219820Sjeff	__u32				pdn;
60219820Sjeff	__u32				reserved;
61219820Sjeff};
62219820Sjeff
63219820Sjeffstruct mlx4_create_cq {
64219820Sjeff	struct ibv_create_cq		ibv_cmd;
65219820Sjeff	__u64				buf_addr;
66219820Sjeff	__u64				db_addr;
67219820Sjeff};
68219820Sjeff
69219820Sjeffstruct mlx4_create_cq_resp {
70219820Sjeff	struct ibv_create_cq_resp	ibv_resp;
71219820Sjeff	__u32				cqn;
72219820Sjeff	__u32				reserved;
73219820Sjeff};
74219820Sjeff
75219820Sjeffstruct mlx4_resize_cq {
76219820Sjeff	struct ibv_resize_cq		ibv_cmd;
77219820Sjeff	__u64				buf_addr;
78219820Sjeff};
79219820Sjeff
80219820Sjeff#ifdef HAVE_IBV_XRC_OPS
81219820Sjeffstruct mlx4_create_xrc_srq {
82219820Sjeff	struct ibv_create_xrc_srq	ibv_cmd;
83219820Sjeff	__u64				buf_addr;
84219820Sjeff	__u64				db_addr;
85219820Sjeff};
86219820Sjeff#endif
87219820Sjeff
88219820Sjeffstruct mlx4_create_srq {
89219820Sjeff	struct ibv_create_srq		ibv_cmd;
90219820Sjeff	__u64				buf_addr;
91219820Sjeff	__u64				db_addr;
92219820Sjeff};
93219820Sjeff
94219820Sjeffstruct mlx4_create_srq_resp {
95219820Sjeff	struct ibv_create_srq_resp	ibv_resp;
96219820Sjeff	__u32				srqn;
97219820Sjeff	__u32				reserved;
98219820Sjeff};
99219820Sjeff
100219820Sjeffstruct mlx4_create_qp {
101219820Sjeff	struct ibv_create_qp		ibv_cmd;
102219820Sjeff	__u64				buf_addr;
103219820Sjeff	__u64				db_addr;
104219820Sjeff	__u8				log_sq_bb_count;
105219820Sjeff	__u8				log_sq_stride;
106219820Sjeff	__u8				sq_no_prefetch;	/* was reserved in ABI 2 */
107219820Sjeff	__u8				reserved[5];
108219820Sjeff};
109219820Sjeff
110219820Sjeff#ifdef HAVE_IBV_XRC_OPS
111219820Sjeffstruct mlx4_open_xrc_domain_resp {
112219820Sjeff	struct ibv_open_xrc_domain_resp	ibv_resp;
113219820Sjeff	__u32				xrcdn;
114219820Sjeff	__u32				reserved;
115219820Sjeff};
116219820Sjeff#endif
117219820Sjeff
118219820Sjeff#endif /* MLX4_ABI_H */
119