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