1e2be04c7SGreg Kroah-Hartman /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */ 271ee6730SDevesh Sharma /* This file is part of the Emulex RoCE Device Driver for 371ee6730SDevesh Sharma * RoCE (RDMA over Converged Ethernet) adapters. 471ee6730SDevesh Sharma * Copyright (C) 2012-2015 Emulex. All rights reserved. 571ee6730SDevesh Sharma * EMULEX and SLI are trademarks of Emulex. 671ee6730SDevesh Sharma * www.emulex.com 771ee6730SDevesh Sharma * 871ee6730SDevesh Sharma * This software is available to you under a choice of one of two licenses. 971ee6730SDevesh Sharma * You may choose to be licensed under the terms of the GNU General Public 1071ee6730SDevesh Sharma * License (GPL) Version 2, available from the file COPYING in the main 1171ee6730SDevesh Sharma * directory of this source tree, or the BSD license below: 1271ee6730SDevesh Sharma * 1371ee6730SDevesh Sharma * Redistribution and use in source and binary forms, with or without 1471ee6730SDevesh Sharma * modification, are permitted provided that the following conditions 1571ee6730SDevesh Sharma * are met: 1671ee6730SDevesh Sharma * 1771ee6730SDevesh Sharma * - Redistributions of source code must retain the above copyright notice, 1871ee6730SDevesh Sharma * this list of conditions and the following disclaimer. 1971ee6730SDevesh Sharma * 2071ee6730SDevesh Sharma * - Redistributions in binary form must reproduce the above copyright 2171ee6730SDevesh Sharma * notice, this list of conditions and the following disclaimer in 2271ee6730SDevesh Sharma * the documentation and/or other materials provided with the distribution. 2371ee6730SDevesh Sharma * 2471ee6730SDevesh Sharma * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 2571ee6730SDevesh Sharma * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,THE 2671ee6730SDevesh Sharma * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2771ee6730SDevesh Sharma * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 2871ee6730SDevesh Sharma * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2971ee6730SDevesh Sharma * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 3071ee6730SDevesh Sharma * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 3171ee6730SDevesh Sharma * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 3271ee6730SDevesh Sharma * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 3371ee6730SDevesh Sharma * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 3471ee6730SDevesh Sharma * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35fe2caefcSParav Pandit * 36fe2caefcSParav Pandit * Contact Information: 37fe2caefcSParav Pandit * linux-drivers@emulex.com 38fe2caefcSParav Pandit * 39fe2caefcSParav Pandit * Emulex 40fe2caefcSParav Pandit * 3333 Susan Street 41fe2caefcSParav Pandit * Costa Mesa, CA 92626 4271ee6730SDevesh Sharma */ 43fe2caefcSParav Pandit 44a7fe7380SLeon Romanovsky #ifndef OCRDMA_ABI_USER_H 45a7fe7380SLeon Romanovsky #define OCRDMA_ABI_USER_H 46a7fe7380SLeon Romanovsky 47a7fe7380SLeon Romanovsky #include <linux/types.h> 48fe2caefcSParav Pandit 492e6e9f2bSDevesh Sharma #define OCRDMA_ABI_VERSION 2 50b6b87d2eSDevesh Sharma #define OCRDMA_BE_ROCE_ABI_VERSION 1 517b9b1a59SNaresh Gottumukkala /* user kernel communication data structures. */ 527b9b1a59SNaresh Gottumukkala 53fe2caefcSParav Pandit struct ocrdma_alloc_ucontext_resp { 54a7fe7380SLeon Romanovsky __u32 dev_id; 55a7fe7380SLeon Romanovsky __u32 wqe_size; 56a7fe7380SLeon Romanovsky __u32 max_inline_data; 57a7fe7380SLeon Romanovsky __u32 dpp_wqe_size; 58*26b99066SJason Gunthorpe __aligned_u64 ah_tbl_page; 59a7fe7380SLeon Romanovsky __u32 ah_tbl_len; 60a7fe7380SLeon Romanovsky __u32 rqe_size; 61a7fe7380SLeon Romanovsky __u8 fw_ver[32]; 627b9b1a59SNaresh Gottumukkala /* for future use/new features in progress */ 63*26b99066SJason Gunthorpe __aligned_u64 rsvd1; 64*26b99066SJason Gunthorpe __aligned_u64 rsvd2; 657b9b1a59SNaresh Gottumukkala }; 66fe2caefcSParav Pandit 67fe2caefcSParav Pandit struct ocrdma_alloc_pd_ureq { 68f64705b8SJason Gunthorpe __u32 rsvd[2]; 697b9b1a59SNaresh Gottumukkala }; 70fe2caefcSParav Pandit 71fe2caefcSParav Pandit struct ocrdma_alloc_pd_uresp { 72a7fe7380SLeon Romanovsky __u32 id; 73a7fe7380SLeon Romanovsky __u32 dpp_enabled; 74a7fe7380SLeon Romanovsky __u32 dpp_page_addr_hi; 75a7fe7380SLeon Romanovsky __u32 dpp_page_addr_lo; 76f64705b8SJason Gunthorpe __u32 rsvd[2]; 777b9b1a59SNaresh Gottumukkala }; 78fe2caefcSParav Pandit 79fe2caefcSParav Pandit struct ocrdma_create_cq_ureq { 80a7fe7380SLeon Romanovsky __u32 dpp_cq; 81a7fe7380SLeon Romanovsky __u32 rsvd; /* pad */ 827b9b1a59SNaresh Gottumukkala }; 83fe2caefcSParav Pandit 84fe2caefcSParav Pandit #define MAX_CQ_PAGES 8 85fe2caefcSParav Pandit struct ocrdma_create_cq_uresp { 86a7fe7380SLeon Romanovsky __u32 cq_id; 87a7fe7380SLeon Romanovsky __u32 page_size; 88a7fe7380SLeon Romanovsky __u32 num_pages; 89a7fe7380SLeon Romanovsky __u32 max_hw_cqe; 90*26b99066SJason Gunthorpe __aligned_u64 page_addr[MAX_CQ_PAGES]; 91*26b99066SJason Gunthorpe __aligned_u64 db_page_addr; 92a7fe7380SLeon Romanovsky __u32 db_page_size; 93a7fe7380SLeon Romanovsky __u32 phase_change; 947b9b1a59SNaresh Gottumukkala /* for future use/new features in progress */ 95*26b99066SJason Gunthorpe __aligned_u64 rsvd1; 96*26b99066SJason Gunthorpe __aligned_u64 rsvd2; 977b9b1a59SNaresh Gottumukkala }; 98fe2caefcSParav Pandit 99fe2caefcSParav Pandit #define MAX_QP_PAGES 8 100fe2caefcSParav Pandit #define MAX_UD_AV_PAGES 8 101fe2caefcSParav Pandit 102fe2caefcSParav Pandit struct ocrdma_create_qp_ureq { 103a7fe7380SLeon Romanovsky __u8 enable_dpp_cq; 104a7fe7380SLeon Romanovsky __u8 rsvd; 105a7fe7380SLeon Romanovsky __u16 dpp_cq_id; 106a7fe7380SLeon Romanovsky __u32 rsvd1; /* pad */ 107fe2caefcSParav Pandit }; 108fe2caefcSParav Pandit 109fe2caefcSParav Pandit struct ocrdma_create_qp_uresp { 110a7fe7380SLeon Romanovsky __u16 qp_id; 111a7fe7380SLeon Romanovsky __u16 sq_dbid; 112a7fe7380SLeon Romanovsky __u16 rq_dbid; 113a7fe7380SLeon Romanovsky __u16 resv0; /* pad */ 114a7fe7380SLeon Romanovsky __u32 sq_page_size; 115a7fe7380SLeon Romanovsky __u32 rq_page_size; 116a7fe7380SLeon Romanovsky __u32 num_sq_pages; 117a7fe7380SLeon Romanovsky __u32 num_rq_pages; 118*26b99066SJason Gunthorpe __aligned_u64 sq_page_addr[MAX_QP_PAGES]; 119*26b99066SJason Gunthorpe __aligned_u64 rq_page_addr[MAX_QP_PAGES]; 120*26b99066SJason Gunthorpe __aligned_u64 db_page_addr; 121a7fe7380SLeon Romanovsky __u32 db_page_size; 122a7fe7380SLeon Romanovsky __u32 dpp_credit; 123a7fe7380SLeon Romanovsky __u32 dpp_offset; 124a7fe7380SLeon Romanovsky __u32 num_wqe_allocated; 125a7fe7380SLeon Romanovsky __u32 num_rqe_allocated; 126a7fe7380SLeon Romanovsky __u32 db_sq_offset; 127a7fe7380SLeon Romanovsky __u32 db_rq_offset; 128a7fe7380SLeon Romanovsky __u32 db_shift; 129*26b99066SJason Gunthorpe __aligned_u64 rsvd[11]; 1305229f87eSJason Gunthorpe }; 131fe2caefcSParav Pandit 132fe2caefcSParav Pandit struct ocrdma_create_srq_uresp { 133a7fe7380SLeon Romanovsky __u16 rq_dbid; 134a7fe7380SLeon Romanovsky __u16 resv0; /* pad */ 135a7fe7380SLeon Romanovsky __u32 resv1; 136fe2caefcSParav Pandit 137a7fe7380SLeon Romanovsky __u32 rq_page_size; 138a7fe7380SLeon Romanovsky __u32 num_rq_pages; 139fe2caefcSParav Pandit 140*26b99066SJason Gunthorpe __aligned_u64 rq_page_addr[MAX_QP_PAGES]; 141*26b99066SJason Gunthorpe __aligned_u64 db_page_addr; 142fe2caefcSParav Pandit 143a7fe7380SLeon Romanovsky __u32 db_page_size; 144a7fe7380SLeon Romanovsky __u32 num_rqe_allocated; 145a7fe7380SLeon Romanovsky __u32 db_rq_offset; 146a7fe7380SLeon Romanovsky __u32 db_shift; 147fe2caefcSParav Pandit 148*26b99066SJason Gunthorpe __aligned_u64 rsvd2; 149*26b99066SJason Gunthorpe __aligned_u64 rsvd3; 1507b9b1a59SNaresh Gottumukkala }; 151fe2caefcSParav Pandit 152a7fe7380SLeon Romanovsky #endif /* OCRDMA_ABI_USER_H */ 153