Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */
0002 /* This file is part of the Emulex RoCE Device Driver for
0003  * RoCE (RDMA over Converged Ethernet) adapters.
0004  * Copyright (C) 2012-2015 Emulex. All rights reserved.
0005  * EMULEX and SLI are trademarks of Emulex.
0006  * www.emulex.com
0007  *
0008  * This software is available to you under a choice of one of two licenses.
0009  * You may choose to be licensed under the terms of the GNU General Public
0010  * License (GPL) Version 2, available from the file COPYING in the main
0011  * directory of this source tree, or the BSD license below:
0012  *
0013  * Redistribution and use in source and binary forms, with or without
0014  * modification, are permitted provided that the following conditions
0015  * are met:
0016  *
0017  * - Redistributions of source code must retain the above copyright notice,
0018  *   this list of conditions and the following disclaimer.
0019  *
0020  * - 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 distribution.
0023  *
0024  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0025  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,THE
0026  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0027  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
0028  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0029  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0030  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
0031  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
0032  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
0033  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
0034  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0035  *
0036  * Contact Information:
0037  * linux-drivers@emulex.com
0038  *
0039  * Emulex
0040  * 3333 Susan Street
0041  * Costa Mesa, CA 92626
0042  */
0043 
0044 #ifndef OCRDMA_ABI_USER_H
0045 #define OCRDMA_ABI_USER_H
0046 
0047 #include <linux/types.h>
0048 
0049 #define OCRDMA_ABI_VERSION 2
0050 #define OCRDMA_BE_ROCE_ABI_VERSION 1
0051 /* user kernel communication data structures. */
0052 
0053 struct ocrdma_alloc_ucontext_resp {
0054     __u32 dev_id;
0055     __u32 wqe_size;
0056     __u32 max_inline_data;
0057     __u32 dpp_wqe_size;
0058     __aligned_u64 ah_tbl_page;
0059     __u32 ah_tbl_len;
0060     __u32 rqe_size;
0061     __u8 fw_ver[32];
0062     /* for future use/new features in progress */
0063     __aligned_u64 rsvd1;
0064     __aligned_u64 rsvd2;
0065 };
0066 
0067 struct ocrdma_alloc_pd_ureq {
0068     __u32 rsvd[2];
0069 };
0070 
0071 struct ocrdma_alloc_pd_uresp {
0072     __u32 id;
0073     __u32 dpp_enabled;
0074     __u32 dpp_page_addr_hi;
0075     __u32 dpp_page_addr_lo;
0076     __u32 rsvd[2];
0077 };
0078 
0079 struct ocrdma_create_cq_ureq {
0080     __u32 dpp_cq;
0081     __u32 rsvd; /* pad */
0082 };
0083 
0084 #define MAX_CQ_PAGES 8
0085 struct ocrdma_create_cq_uresp {
0086     __u32 cq_id;
0087     __u32 page_size;
0088     __u32 num_pages;
0089     __u32 max_hw_cqe;
0090     __aligned_u64 page_addr[MAX_CQ_PAGES];
0091     __aligned_u64 db_page_addr;
0092     __u32 db_page_size;
0093     __u32 phase_change;
0094     /* for future use/new features in progress */
0095     __aligned_u64 rsvd1;
0096     __aligned_u64 rsvd2;
0097 };
0098 
0099 #define MAX_QP_PAGES 8
0100 #define MAX_UD_AV_PAGES 8
0101 
0102 struct ocrdma_create_qp_ureq {
0103     __u8 enable_dpp_cq;
0104     __u8 rsvd;
0105     __u16 dpp_cq_id;
0106     __u32 rsvd1;    /* pad */
0107 };
0108 
0109 struct ocrdma_create_qp_uresp {
0110     __u16 qp_id;
0111     __u16 sq_dbid;
0112     __u16 rq_dbid;
0113     __u16 resv0;    /* pad */
0114     __u32 sq_page_size;
0115     __u32 rq_page_size;
0116     __u32 num_sq_pages;
0117     __u32 num_rq_pages;
0118     __aligned_u64 sq_page_addr[MAX_QP_PAGES];
0119     __aligned_u64 rq_page_addr[MAX_QP_PAGES];
0120     __aligned_u64 db_page_addr;
0121     __u32 db_page_size;
0122     __u32 dpp_credit;
0123     __u32 dpp_offset;
0124     __u32 num_wqe_allocated;
0125     __u32 num_rqe_allocated;
0126     __u32 db_sq_offset;
0127     __u32 db_rq_offset;
0128     __u32 db_shift;
0129     __aligned_u64 rsvd[11];
0130 };
0131 
0132 struct ocrdma_create_srq_uresp {
0133     __u16 rq_dbid;
0134     __u16 resv0;    /* pad */
0135     __u32 resv1;
0136 
0137     __u32 rq_page_size;
0138     __u32 num_rq_pages;
0139 
0140     __aligned_u64 rq_page_addr[MAX_QP_PAGES];
0141     __aligned_u64 db_page_addr;
0142 
0143     __u32 db_page_size;
0144     __u32 num_rqe_allocated;
0145     __u32 db_rq_offset;
0146     __u32 db_shift;
0147 
0148     __aligned_u64 rsvd2;
0149     __aligned_u64 rsvd3;
0150 };
0151 
0152 #endif  /* OCRDMA_ABI_USER_H */