4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _SYS_IB_ADAPTERS_MLNX_UMAP_H
28 #define _SYS_IB_ADAPTERS_MLNX_UMAP_H
36 * Contains all of the definions necessary for communicating the data
37 * needed for direct userland access to resources on Mellanox HCAs.
41 * Note: The structs in this file are used in the interface(s)
42 * between kernel service drivers, e.g. daplt, and the libraries
43 * on top of them, e.g. udapl_tavor.so.1. When any of the
44 * structs in this file change, any version control between the
45 * kernel service driver and the library will need to change.
47 * There is a version control on the structs defined here. The library
48 * (consumer of structs from ibt_ci_data_out()) must verify a version
49 * field to correctly read the data provided by the kernel driver
50 * (tavor, arbel, and hermon).
53 #define MLNX_UMAP_IF_VERSION 2
56 * The following defines are used in the database type field for each database
57 * entry. They specify the type of object (UAR pages, PIDs, CQ, QP, and MR
58 * umemcookie) that corresponds to the database key value. On database queries,
59 * this type value must match the search criterion.
61 #define MLNX_UMAP_UARPG_RSRC 0x11
62 #define MLNX_UMAP_BLUEFLAMEPG_RSRC 0x12
63 #define MLNX_UMAP_PID_RSRC 0x22
64 #define MLNX_UMAP_CQMEM_RSRC 0x33
65 #define MLNX_UMAP_QPMEM_RSRC 0x44
66 #define MLNX_UMAP_MRMEM_RSRC 0x55
67 #define MLNX_UMAP_SRQMEM_RSRC 0x66
68 #define MLNX_UMAP_DBRMEM_RSRC 0x77
69 #define MLNX_UMAP_RSRC_TYPE_MASK 0xFF
70 #define MLNX_UMAP_RSRC_TYPE_SHIFT 8
74 typedef struct mlnx_umap_cq_data_out_s
{
77 uint64_t mcq_mapoffset
;
82 /* Arbel/Hermon doorbell records */
83 uint64_t mcq_armdbr_mapoffset
;
84 uint64_t mcq_armdbr_maplen
;
85 uint64_t mcq_polldbr_mapoffset
;
86 uint64_t mcq_polldbr_maplen
;
87 uint32_t mcq_armdbr_offset
;
88 uint32_t mcq_polldbr_offset
;
89 } mlnx_umap_cq_data_out_t
;
91 typedef struct mlnx_umap_qp_data_out_s
{
94 uint64_t mqp_mapoffset
;
98 uint32_t mqp_rq_desc_addr
;
99 uint32_t mqp_rq_numwqe
;
100 uint32_t mqp_rq_wqesz
;
103 uint32_t mqp_sq_desc_addr
;
104 uint32_t mqp_sq_numwqe
;
105 uint32_t mqp_sq_wqesz
;
107 /* Arbel/Hermon doorbell records */
108 uint64_t mqp_sdbr_mapoffset
;
109 uint64_t mqp_sdbr_maplen
;
110 uint64_t mqp_rdbr_mapoffset
;
111 uint64_t mqp_rdbr_maplen
;
112 uint32_t mqp_sdbr_offset
;
113 uint32_t mqp_rdbr_offset
;
115 /* Hermon send queue headroom, in units of wqes */
116 uint32_t mqp_sq_headroomwqes
;
117 } mlnx_umap_qp_data_out_t
;
119 typedef struct mlnx_umap_srq_data_out_s
{
121 uint32_t msrq_srqnum
;
122 uint64_t msrq_mapoffset
;
123 uint64_t msrq_maplen
;
124 uint32_t msrq_desc_addr
;
125 uint32_t msrq_numwqe
;
127 uint32_t msrq_pad1
; /* reserved */
129 /* Arbel/Hermon doorbell records */
130 uint64_t msrq_rdbr_mapoffset
;
131 uint64_t msrq_rdbr_maplen
;
132 uint32_t msrq_rdbr_offset
;
133 uint32_t msrq_reserved
;
134 } mlnx_umap_srq_data_out_t
;
136 typedef struct mlnx_umap_pd_data_out_s
{
139 } mlnx_umap_pd_data_out_t
;
145 #endif /* _SYS_IB_ADAPTERS_MLNX_UMAP_H */