Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */
0002 /*
0003  * Broadcom NetXtreme-E RoCE driver.
0004  *
0005  * Copyright (c) 2016 - 2017, Broadcom. All rights reserved.  The term
0006  * Broadcom refers to Broadcom Limited and/or its subsidiaries.
0007  *
0008  * This software is available to you under a choice of one of two
0009  * licenses.  You may choose to be licensed under the terms of the GNU
0010  * General Public License (GPL) Version 2, available from the file
0011  * COPYING in the main directory of this source tree, or the
0012  * BSD license below:
0013  *
0014  * Redistribution and use in source and binary forms, with or without
0015  * modification, are permitted provided that the following conditions
0016  * are met:
0017  *
0018  * 1. Redistributions of source code must retain the above copyright
0019  *    notice, this list of conditions and the following disclaimer.
0020  * 2. Redistributions in binary form must reproduce the above copyright
0021  *    notice, this list of conditions and the following disclaimer in
0022  *    the documentation and/or other materials provided with the
0023  *    distribution.
0024  *
0025  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
0026  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
0027  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
0028  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
0029  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0030  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0031  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
0032  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
0033  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
0034  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
0035  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0036  *
0037  * Description: Uverbs ABI header file
0038  */
0039 
0040 #ifndef __BNXT_RE_UVERBS_ABI_H__
0041 #define __BNXT_RE_UVERBS_ABI_H__
0042 
0043 #include <linux/types.h>
0044 
0045 #define BNXT_RE_ABI_VERSION 1
0046 
0047 #define BNXT_RE_CHIP_ID0_CHIP_NUM_SFT       0x00
0048 #define BNXT_RE_CHIP_ID0_CHIP_REV_SFT       0x10
0049 #define BNXT_RE_CHIP_ID0_CHIP_MET_SFT       0x18
0050 
0051 enum {
0052     BNXT_RE_UCNTX_CMASK_HAVE_CCTX = 0x1ULL,
0053     BNXT_RE_UCNTX_CMASK_HAVE_MODE = 0x02ULL,
0054 };
0055 
0056 enum bnxt_re_wqe_mode {
0057     BNXT_QPLIB_WQE_MODE_STATIC  = 0x00,
0058     BNXT_QPLIB_WQE_MODE_VARIABLE    = 0x01,
0059     BNXT_QPLIB_WQE_MODE_INVALID = 0x02,
0060 };
0061 
0062 struct bnxt_re_uctx_resp {
0063     __u32 dev_id;
0064     __u32 max_qp;
0065     __u32 pg_size;
0066     __u32 cqe_sz;
0067     __u32 max_cqd;
0068     __u32 rsvd;
0069     __aligned_u64 comp_mask;
0070     __u32 chip_id0;
0071     __u32 chip_id1;
0072     __u32 mode;
0073     __u32 rsvd1; /* padding */
0074 };
0075 
0076 /*
0077  * This struct is placed after the ib_uverbs_alloc_pd_resp struct, which is
0078  * not 8 byted aligned. To avoid undesired padding in various cases we have to
0079  * set this struct to packed.
0080  */
0081 struct bnxt_re_pd_resp {
0082     __u32 pdid;
0083     __u32 dpi;
0084     __u64 dbr;
0085 } __attribute__((packed, aligned(4)));
0086 
0087 struct bnxt_re_cq_req {
0088     __aligned_u64 cq_va;
0089     __aligned_u64 cq_handle;
0090 };
0091 
0092 struct bnxt_re_cq_resp {
0093     __u32 cqid;
0094     __u32 tail;
0095     __u32 phase;
0096     __u32 rsvd;
0097 };
0098 
0099 struct bnxt_re_qp_req {
0100     __aligned_u64 qpsva;
0101     __aligned_u64 qprva;
0102     __aligned_u64 qp_handle;
0103 };
0104 
0105 struct bnxt_re_qp_resp {
0106     __u32 qpid;
0107     __u32 rsvd;
0108 };
0109 
0110 struct bnxt_re_srq_req {
0111     __aligned_u64 srqva;
0112     __aligned_u64 srq_handle;
0113 };
0114 
0115 struct bnxt_re_srq_resp {
0116     __u32 srqid;
0117 };
0118 
0119 enum bnxt_re_shpg_offt {
0120     BNXT_RE_BEG_RESV_OFFT   = 0x00,
0121     BNXT_RE_AVID_OFFT   = 0x10,
0122     BNXT_RE_AVID_SIZE   = 0x04,
0123     BNXT_RE_END_RESV_OFFT   = 0xFF0
0124 };
0125 
0126 #endif /* __BNXT_RE_UVERBS_ABI_H__*/