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