^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Broadcom NetXtreme-E RoCE driver.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright (c) 2016 - 2017, Broadcom. All rights reserved. The term
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Broadcom refers to Broadcom Limited and/or its subsidiaries.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * This software is available to you under a choice of one of two
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * licenses. You may choose to be licensed under the terms of the GNU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * General Public License (GPL) Version 2, available from the file
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * COPYING in the main directory of this source tree, or the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * BSD license below:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * Redistribution and use in source and binary forms, with or without
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) * modification, are permitted provided that the following conditions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) * are met:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) * 1. Redistributions of source code must retain the above copyright
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) * notice, this list of conditions and the following disclaimer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) * 2. Redistributions in binary form must reproduce the above copyright
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) * notice, this list of conditions and the following disclaimer in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) * the documentation and/or other materials provided with the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) * distribution.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) * Description: Uverbs ABI header file
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) #ifndef __BNXT_RE_UVERBS_ABI_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) #define __BNXT_RE_UVERBS_ABI_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) #define BNXT_RE_ABI_VERSION 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) #define BNXT_RE_CHIP_ID0_CHIP_NUM_SFT 0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) #define BNXT_RE_CHIP_ID0_CHIP_REV_SFT 0x10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) #define BNXT_RE_CHIP_ID0_CHIP_MET_SFT 0x18
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) enum {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) BNXT_RE_UCNTX_CMASK_HAVE_CCTX = 0x1ULL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) struct bnxt_re_uctx_resp {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) __u32 dev_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) __u32 max_qp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) __u32 pg_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) __u32 cqe_sz;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) __u32 max_cqd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) __u32 rsvd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) __aligned_u64 comp_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) __u32 chip_id0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) __u32 chip_id1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) * This struct is placed after the ib_uverbs_alloc_pd_resp struct, which is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) * not 8 byted aligned. To avoid undesired padding in various cases we have to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) * set this struct to packed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) struct bnxt_re_pd_resp {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) __u32 pdid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) __u32 dpi;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) __u64 dbr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) } __attribute__((packed, aligned(4)));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) struct bnxt_re_cq_req {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) __aligned_u64 cq_va;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) __aligned_u64 cq_handle;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) struct bnxt_re_cq_resp {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) __u32 cqid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) __u32 tail;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) __u32 phase;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) __u32 rsvd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) struct bnxt_re_qp_req {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) __aligned_u64 qpsva;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) __aligned_u64 qprva;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) __aligned_u64 qp_handle;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) struct bnxt_re_qp_resp {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) __u32 qpid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) __u32 rsvd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) struct bnxt_re_srq_req {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) __aligned_u64 srqva;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) __aligned_u64 srq_handle;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) struct bnxt_re_srq_resp {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) __u32 srqid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) enum bnxt_re_shpg_offt {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) BNXT_RE_BEG_RESV_OFFT = 0x00,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) BNXT_RE_AVID_OFFT = 0x10,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) BNXT_RE_AVID_SIZE = 0x04,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) BNXT_RE_END_RESV_OFFT = 0xFF0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) #endif /* __BNXT_RE_UVERBS_ABI_H__*/