xref: /linux/include/uapi/rdma/bnxt_re-abi.h (revision 958d2c1ba37680b765a089dc374cc199fb61619b)
1e2be04c7SGreg Kroah-Hartman /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */
21ac5a404SSelvin Xavier /*
31ac5a404SSelvin Xavier  * Broadcom NetXtreme-E RoCE driver.
41ac5a404SSelvin Xavier  *
51ac5a404SSelvin Xavier  * Copyright (c) 2016 - 2017, Broadcom. All rights reserved.  The term
61ac5a404SSelvin Xavier  * Broadcom refers to Broadcom Limited and/or its subsidiaries.
71ac5a404SSelvin Xavier  *
81ac5a404SSelvin Xavier  * This software is available to you under a choice of one of two
91ac5a404SSelvin Xavier  * licenses.  You may choose to be licensed under the terms of the GNU
101ac5a404SSelvin Xavier  * General Public License (GPL) Version 2, available from the file
111ac5a404SSelvin Xavier  * COPYING in the main directory of this source tree, or the
121ac5a404SSelvin Xavier  * BSD license below:
131ac5a404SSelvin Xavier  *
141ac5a404SSelvin Xavier  * Redistribution and use in source and binary forms, with or without
151ac5a404SSelvin Xavier  * modification, are permitted provided that the following conditions
161ac5a404SSelvin Xavier  * are met:
171ac5a404SSelvin Xavier  *
181ac5a404SSelvin Xavier  * 1. Redistributions of source code must retain the above copyright
191ac5a404SSelvin Xavier  *    notice, this list of conditions and the following disclaimer.
201ac5a404SSelvin Xavier  * 2. Redistributions in binary form must reproduce the above copyright
211ac5a404SSelvin Xavier  *    notice, this list of conditions and the following disclaimer in
221ac5a404SSelvin Xavier  *    the documentation and/or other materials provided with the
231ac5a404SSelvin Xavier  *    distribution.
241ac5a404SSelvin Xavier  *
251ac5a404SSelvin Xavier  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
261ac5a404SSelvin Xavier  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
271ac5a404SSelvin Xavier  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
281ac5a404SSelvin Xavier  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
291ac5a404SSelvin Xavier  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
301ac5a404SSelvin Xavier  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
311ac5a404SSelvin Xavier  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
321ac5a404SSelvin Xavier  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
331ac5a404SSelvin Xavier  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
341ac5a404SSelvin Xavier  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
351ac5a404SSelvin Xavier  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
361ac5a404SSelvin Xavier  *
371ac5a404SSelvin Xavier  * Description: Uverbs ABI header file
381ac5a404SSelvin Xavier  */
391ac5a404SSelvin Xavier 
401ac5a404SSelvin Xavier #ifndef __BNXT_RE_UVERBS_ABI_H__
411ac5a404SSelvin Xavier #define __BNXT_RE_UVERBS_ABI_H__
421ac5a404SSelvin Xavier 
439078b4eeSNicolas Dichtel #include <linux/types.h>
449078b4eeSNicolas Dichtel 
451ac5a404SSelvin Xavier #define BNXT_RE_ABI_VERSION	1
461ac5a404SSelvin Xavier 
471ac5a404SSelvin Xavier struct bnxt_re_uctx_resp {
481ac5a404SSelvin Xavier 	__u32 dev_id;
491ac5a404SSelvin Xavier 	__u32 max_qp;
501ac5a404SSelvin Xavier 	__u32 pg_size;
511ac5a404SSelvin Xavier 	__u32 cqe_sz;
521ac5a404SSelvin Xavier 	__u32 max_cqd;
531ac5a404SSelvin Xavier 	__u32 rsvd;
541ac5a404SSelvin Xavier };
551ac5a404SSelvin Xavier 
56*958d2c1bSJason Gunthorpe /*
57*958d2c1bSJason Gunthorpe  * This struct is placed after the ib_uverbs_alloc_pd_resp struct, which is
58*958d2c1bSJason Gunthorpe  * not 8 byted aligned. To avoid undesired padding in various cases we have to
59*958d2c1bSJason Gunthorpe  * set this struct to packed.
60*958d2c1bSJason Gunthorpe  */
611ac5a404SSelvin Xavier struct bnxt_re_pd_resp {
621ac5a404SSelvin Xavier 	__u32 pdid;
631ac5a404SSelvin Xavier 	__u32 dpi;
641ac5a404SSelvin Xavier 	__u64 dbr;
65*958d2c1bSJason Gunthorpe } __attribute__((packed, aligned(4)));
661ac5a404SSelvin Xavier 
671ac5a404SSelvin Xavier struct bnxt_re_cq_req {
681ac5a404SSelvin Xavier 	__u64 cq_va;
691ac5a404SSelvin Xavier 	__u64 cq_handle;
701ac5a404SSelvin Xavier };
711ac5a404SSelvin Xavier 
721ac5a404SSelvin Xavier struct bnxt_re_cq_resp {
731ac5a404SSelvin Xavier 	__u32 cqid;
741ac5a404SSelvin Xavier 	__u32 tail;
751ac5a404SSelvin Xavier 	__u32 phase;
761ac5a404SSelvin Xavier 	__u32 rsvd;
771ac5a404SSelvin Xavier };
781ac5a404SSelvin Xavier 
791ac5a404SSelvin Xavier struct bnxt_re_qp_req {
801ac5a404SSelvin Xavier 	__u64 qpsva;
811ac5a404SSelvin Xavier 	__u64 qprva;
821ac5a404SSelvin Xavier 	__u64 qp_handle;
831ac5a404SSelvin Xavier };
841ac5a404SSelvin Xavier 
851ac5a404SSelvin Xavier struct bnxt_re_qp_resp {
861ac5a404SSelvin Xavier 	__u32 qpid;
871ac5a404SSelvin Xavier 	__u32 rsvd;
881ac5a404SSelvin Xavier };
891ac5a404SSelvin Xavier 
9037cb11acSDevesh Sharma struct bnxt_re_srq_req {
9137cb11acSDevesh Sharma 	__u64 srqva;
9237cb11acSDevesh Sharma 	__u64 srq_handle;
9337cb11acSDevesh Sharma };
9437cb11acSDevesh Sharma 
9537cb11acSDevesh Sharma struct bnxt_re_srq_resp {
9637cb11acSDevesh Sharma 	__u32 srqid;
9737cb11acSDevesh Sharma };
9837cb11acSDevesh Sharma 
991ac5a404SSelvin Xavier enum bnxt_re_shpg_offt {
1001ac5a404SSelvin Xavier 	BNXT_RE_BEG_RESV_OFFT	= 0x00,
1011ac5a404SSelvin Xavier 	BNXT_RE_AVID_OFFT	= 0x10,
1021ac5a404SSelvin Xavier 	BNXT_RE_AVID_SIZE	= 0x04,
1031ac5a404SSelvin Xavier 	BNXT_RE_END_RESV_OFFT	= 0xFF0
1041ac5a404SSelvin Xavier };
1051ac5a404SSelvin Xavier 
1061ac5a404SSelvin Xavier #endif /* __BNXT_RE_UVERBS_ABI_H__*/
107