^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) /* This file is part of the Emulex RoCE Device Driver for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * RoCE (RDMA over Converged Ethernet) adapters.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Copyright (C) 2012-2015 Emulex. All rights reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * EMULEX and SLI are trademarks of Emulex.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * www.emulex.com
^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 licenses.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * You may choose to be licensed under the terms of the GNU General Public
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * License (GPL) Version 2, available from the file COPYING in the main
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * directory of this source tree, or the BSD license below:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) * Redistribution and use in source and binary forms, with or without
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * modification, are permitted provided that the following conditions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) * are met:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * - Redistributions of source code must retain the above copyright notice,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) * this list of conditions and the following disclaimer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) * - 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 distribution.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,THE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) * Contact Information:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) * linux-drivers@emulex.com
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) * Emulex
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) * 3333 Susan Street
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) * Costa Mesa, CA 92626
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) #ifndef OCRDMA_ABI_USER_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) #define OCRDMA_ABI_USER_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) #define OCRDMA_ABI_VERSION 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) #define OCRDMA_BE_ROCE_ABI_VERSION 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) /* user kernel communication data structures. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) struct ocrdma_alloc_ucontext_resp {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) __u32 dev_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) __u32 wqe_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) __u32 max_inline_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) __u32 dpp_wqe_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) __aligned_u64 ah_tbl_page;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) __u32 ah_tbl_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) __u32 rqe_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) __u8 fw_ver[32];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) /* for future use/new features in progress */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) __aligned_u64 rsvd1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) __aligned_u64 rsvd2;
^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) struct ocrdma_alloc_pd_ureq {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) __u32 rsvd[2];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) struct ocrdma_alloc_pd_uresp {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) __u32 id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) __u32 dpp_enabled;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) __u32 dpp_page_addr_hi;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) __u32 dpp_page_addr_lo;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) __u32 rsvd[2];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) struct ocrdma_create_cq_ureq {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) __u32 dpp_cq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) __u32 rsvd; /* pad */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) #define MAX_CQ_PAGES 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) struct ocrdma_create_cq_uresp {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) __u32 cq_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) __u32 page_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) __u32 num_pages;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) __u32 max_hw_cqe;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) __aligned_u64 page_addr[MAX_CQ_PAGES];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) __aligned_u64 db_page_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) __u32 db_page_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) __u32 phase_change;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) /* for future use/new features in progress */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) __aligned_u64 rsvd1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) __aligned_u64 rsvd2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) #define MAX_QP_PAGES 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) #define MAX_UD_AV_PAGES 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) struct ocrdma_create_qp_ureq {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) __u8 enable_dpp_cq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) __u8 rsvd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) __u16 dpp_cq_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) __u32 rsvd1; /* pad */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) struct ocrdma_create_qp_uresp {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) __u16 qp_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) __u16 sq_dbid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) __u16 rq_dbid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) __u16 resv0; /* pad */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) __u32 sq_page_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) __u32 rq_page_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) __u32 num_sq_pages;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) __u32 num_rq_pages;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) __aligned_u64 sq_page_addr[MAX_QP_PAGES];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) __aligned_u64 rq_page_addr[MAX_QP_PAGES];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) __aligned_u64 db_page_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) __u32 db_page_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) __u32 dpp_credit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) __u32 dpp_offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) __u32 num_wqe_allocated;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) __u32 num_rqe_allocated;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) __u32 db_sq_offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) __u32 db_rq_offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) __u32 db_shift;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) __aligned_u64 rsvd[11];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) struct ocrdma_create_srq_uresp {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) __u16 rq_dbid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) __u16 resv0; /* pad */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) __u32 resv1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) __u32 rq_page_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) __u32 num_rq_pages;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) __aligned_u64 rq_page_addr[MAX_QP_PAGES];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) __aligned_u64 db_page_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) __u32 db_page_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) __u32 num_rqe_allocated;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) __u32 db_rq_offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) __u32 db_shift;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) __aligned_u64 rsvd2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) __aligned_u64 rsvd3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) #endif /* OCRDMA_ABI_USER_H */