1 /*
2  * Broadcom NetXtreme-E RoCE driver.
3  *
4  * Copyright (c) 2016 - 2017, Broadcom. All rights reserved.  The term
5  * Broadcom refers to Broadcom Limited and/or its subsidiaries.
6  *
7  * This software is available to you under a choice of one of two
8  * licenses.  You may choose to be licensed under the terms of the GNU
9  * General Public License (GPL) Version 2, available from the file
10  * COPYING in the main directory of this source tree, or the
11  * 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  * 1. Redistributions of source code must retain the above copyright
18  *    notice, this list of conditions and the following disclaimer.
19  * 2. 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
22  *    distribution.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
25  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
26  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
27  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
28  * BE 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
33  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
34  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35  *
36  * Description: RoCE HSI File - Autogenerated
37  */
38 
39 #ifndef __BNXT_RE_HSI_H__
40 #define __BNXT_RE_HSI_H__
41 
42 /* include bnxt_hsi.h from bnxt_en driver */
43 #include "bnxt_hsi.h"
44 
45 /* tx_doorbell (size:32b/4B) */
46 struct tx_doorbell {
47 	__le32	key_idx;
48 	#define TX_DOORBELL_IDX_MASK 0xffffffUL
49 	#define TX_DOORBELL_IDX_SFT 0
50 	#define TX_DOORBELL_KEY_MASK 0xf0000000UL
51 	#define TX_DOORBELL_KEY_SFT 28
52 	#define TX_DOORBELL_KEY_TX    (0x0UL << 28)
53 	#define TX_DOORBELL_KEY_LAST TX_DOORBELL_KEY_TX
54 };
55 
56 /* rx_doorbell (size:32b/4B) */
57 struct rx_doorbell {
58 	__le32	key_idx;
59 	#define RX_DOORBELL_IDX_MASK 0xffffffUL
60 	#define RX_DOORBELL_IDX_SFT 0
61 	#define RX_DOORBELL_KEY_MASK 0xf0000000UL
62 	#define RX_DOORBELL_KEY_SFT 28
63 	#define RX_DOORBELL_KEY_RX    (0x1UL << 28)
64 	#define RX_DOORBELL_KEY_LAST RX_DOORBELL_KEY_RX
65 };
66 
67 /* cmpl_doorbell (size:32b/4B) */
68 struct cmpl_doorbell {
69 	__le32	key_mask_valid_idx;
70 	#define CMPL_DOORBELL_IDX_MASK      0xffffffUL
71 	#define CMPL_DOORBELL_IDX_SFT       0
72 	#define CMPL_DOORBELL_IDX_VALID     0x4000000UL
73 	#define CMPL_DOORBELL_MASK          0x8000000UL
74 	#define CMPL_DOORBELL_KEY_MASK      0xf0000000UL
75 	#define CMPL_DOORBELL_KEY_SFT       28
76 	#define CMPL_DOORBELL_KEY_CMPL        (0x2UL << 28)
77 	#define CMPL_DOORBELL_KEY_LAST       CMPL_DOORBELL_KEY_CMPL
78 };
79 
80 /* status_doorbell (size:32b/4B) */
81 struct status_doorbell {
82 	__le32	key_idx;
83 	#define STATUS_DOORBELL_IDX_MASK 0xffffffUL
84 	#define STATUS_DOORBELL_IDX_SFT 0
85 	#define STATUS_DOORBELL_KEY_MASK 0xf0000000UL
86 	#define STATUS_DOORBELL_KEY_SFT 28
87 	#define STATUS_DOORBELL_KEY_STAT  (0x3UL << 28)
88 	#define STATUS_DOORBELL_KEY_LAST STATUS_DOORBELL_KEY_STAT
89 };
90 
91 /* cmdq_init (size:128b/16B) */
92 struct cmdq_init {
93 	__le64	cmdq_pbl;
94 	__le16	cmdq_size_cmdq_lvl;
95 	#define CMDQ_INIT_CMDQ_LVL_MASK 0x3UL
96 	#define CMDQ_INIT_CMDQ_LVL_SFT  0
97 	#define CMDQ_INIT_CMDQ_SIZE_MASK 0xfffcUL
98 	#define CMDQ_INIT_CMDQ_SIZE_SFT 2
99 	__le16	creq_ring_id;
100 	__le32	prod_idx;
101 };
102 
103 /* cmdq_base (size:128b/16B) */
104 struct cmdq_base {
105 	u8	opcode;
106 	#define CMDQ_BASE_OPCODE_CREATE_QP              0x1UL
107 	#define CMDQ_BASE_OPCODE_DESTROY_QP             0x2UL
108 	#define CMDQ_BASE_OPCODE_MODIFY_QP              0x3UL
109 	#define CMDQ_BASE_OPCODE_QUERY_QP               0x4UL
110 	#define CMDQ_BASE_OPCODE_CREATE_SRQ             0x5UL
111 	#define CMDQ_BASE_OPCODE_DESTROY_SRQ            0x6UL
112 	#define CMDQ_BASE_OPCODE_QUERY_SRQ              0x8UL
113 	#define CMDQ_BASE_OPCODE_CREATE_CQ              0x9UL
114 	#define CMDQ_BASE_OPCODE_DESTROY_CQ             0xaUL
115 	#define CMDQ_BASE_OPCODE_RESIZE_CQ              0xcUL
116 	#define CMDQ_BASE_OPCODE_ALLOCATE_MRW           0xdUL
117 	#define CMDQ_BASE_OPCODE_DEALLOCATE_KEY         0xeUL
118 	#define CMDQ_BASE_OPCODE_REGISTER_MR            0xfUL
119 	#define CMDQ_BASE_OPCODE_DEREGISTER_MR          0x10UL
120 	#define CMDQ_BASE_OPCODE_ADD_GID                0x11UL
121 	#define CMDQ_BASE_OPCODE_DELETE_GID             0x12UL
122 	#define CMDQ_BASE_OPCODE_MODIFY_GID             0x17UL
123 	#define CMDQ_BASE_OPCODE_QUERY_GID              0x18UL
124 	#define CMDQ_BASE_OPCODE_CREATE_QP1             0x13UL
125 	#define CMDQ_BASE_OPCODE_DESTROY_QP1            0x14UL
126 	#define CMDQ_BASE_OPCODE_CREATE_AH              0x15UL
127 	#define CMDQ_BASE_OPCODE_DESTROY_AH             0x16UL
128 	#define CMDQ_BASE_OPCODE_INITIALIZE_FW          0x80UL
129 	#define CMDQ_BASE_OPCODE_DEINITIALIZE_FW        0x81UL
130 	#define CMDQ_BASE_OPCODE_STOP_FUNC              0x82UL
131 	#define CMDQ_BASE_OPCODE_QUERY_FUNC             0x83UL
132 	#define CMDQ_BASE_OPCODE_SET_FUNC_RESOURCES     0x84UL
133 	#define CMDQ_BASE_OPCODE_READ_CONTEXT           0x85UL
134 	#define CMDQ_BASE_OPCODE_VF_BACKCHANNEL_REQUEST 0x86UL
135 	#define CMDQ_BASE_OPCODE_READ_VF_MEMORY         0x87UL
136 	#define CMDQ_BASE_OPCODE_COMPLETE_VF_REQUEST    0x88UL
137 	#define CMDQ_BASE_OPCODE_EXTEND_CONTEXT_ARRRAY  0x89UL
138 	#define CMDQ_BASE_OPCODE_MAP_TC_TO_COS          0x8aUL
139 	#define CMDQ_BASE_OPCODE_QUERY_VERSION          0x8bUL
140 	#define CMDQ_BASE_OPCODE_MODIFY_ROCE_CC         0x8cUL
141 	#define CMDQ_BASE_OPCODE_QUERY_ROCE_CC          0x8dUL
142 	#define CMDQ_BASE_OPCODE_QUERY_ROCE_STATS       0x8eUL
143 	#define CMDQ_BASE_OPCODE_SET_LINK_AGGR_MODE     0x8fUL
144 	#define CMDQ_BASE_OPCODE_MODIFY_CQ              0x90UL
145 	#define CMDQ_BASE_OPCODE_QUERY_QP_EXTEND        0x91UL
146 	#define CMDQ_BASE_OPCODE_QUERY_ROCE_STATS_EXT   0x92UL
147 	#define CMDQ_BASE_OPCODE_LAST                  CMDQ_BASE_OPCODE_QUERY_ROCE_STATS_EXT
148 	u8	cmd_size;
149 	__le16	flags;
150 	__le16	cookie;
151 	u8	resp_size;
152 	u8	reserved8;
153 	__le64	resp_addr;
154 };
155 
156 /* creq_base (size:128b/16B) */
157 struct creq_base {
158 	u8	type;
159 	#define CREQ_BASE_TYPE_MASK      0x3fUL
160 	#define CREQ_BASE_TYPE_SFT       0
161 	#define CREQ_BASE_TYPE_QP_EVENT    0x38UL
162 	#define CREQ_BASE_TYPE_FUNC_EVENT  0x3aUL
163 	#define CREQ_BASE_TYPE_LAST       CREQ_BASE_TYPE_FUNC_EVENT
164 	u8	reserved56[7];
165 	u8	v;
166 	#define CREQ_BASE_V     0x1UL
167 	u8	event;
168 	u8	reserved48[6];
169 };
170 
171 /* cmdq_query_version (size:128b/16B) */
172 struct cmdq_query_version {
173 	u8	opcode;
174 	#define CMDQ_QUERY_VERSION_OPCODE_QUERY_VERSION 0x8bUL
175 	#define CMDQ_QUERY_VERSION_OPCODE_LAST         CMDQ_QUERY_VERSION_OPCODE_QUERY_VERSION
176 	u8	cmd_size;
177 	__le16	flags;
178 	__le16	cookie;
179 	u8	resp_size;
180 	u8	reserved8;
181 	__le64	resp_addr;
182 };
183 
184 /* creq_query_version_resp (size:128b/16B) */
185 struct creq_query_version_resp {
186 	u8	type;
187 	#define CREQ_QUERY_VERSION_RESP_TYPE_MASK    0x3fUL
188 	#define CREQ_QUERY_VERSION_RESP_TYPE_SFT     0
189 	#define CREQ_QUERY_VERSION_RESP_TYPE_QP_EVENT  0x38UL
190 	#define CREQ_QUERY_VERSION_RESP_TYPE_LAST     CREQ_QUERY_VERSION_RESP_TYPE_QP_EVENT
191 	u8	status;
192 	__le16	cookie;
193 	u8	fw_maj;
194 	u8	fw_minor;
195 	u8	fw_bld;
196 	u8	fw_rsvd;
197 	u8	v;
198 	#define CREQ_QUERY_VERSION_RESP_V     0x1UL
199 	u8	event;
200 	#define CREQ_QUERY_VERSION_RESP_EVENT_QUERY_VERSION 0x8bUL
201 	#define CREQ_QUERY_VERSION_RESP_EVENT_LAST         \
202 		CREQ_QUERY_VERSION_RESP_EVENT_QUERY_VERSION
203 	__le16	reserved16;
204 	u8	intf_maj;
205 	u8	intf_minor;
206 	u8	intf_bld;
207 	u8	intf_rsvd;
208 };
209 
210 /* cmdq_initialize_fw (size:896b/112B) */
211 struct cmdq_initialize_fw {
212 	u8	opcode;
213 	#define CMDQ_INITIALIZE_FW_OPCODE_INITIALIZE_FW 0x80UL
214 	#define CMDQ_INITIALIZE_FW_OPCODE_LAST         CMDQ_INITIALIZE_FW_OPCODE_INITIALIZE_FW
215 	u8	cmd_size;
216 	__le16	flags;
217 	#define CMDQ_INITIALIZE_FW_FLAGS_MRAV_RESERVATION_SPLIT          0x1UL
218 	#define CMDQ_INITIALIZE_FW_FLAGS_HW_REQUESTER_RETX_SUPPORTED     0x2UL
219 	__le16	cookie;
220 	u8	resp_size;
221 	u8	reserved8;
222 	__le64	resp_addr;
223 	u8	qpc_pg_size_qpc_lvl;
224 	#define CMDQ_INITIALIZE_FW_QPC_LVL_MASK      0xfUL
225 	#define CMDQ_INITIALIZE_FW_QPC_LVL_SFT       0
226 	#define CMDQ_INITIALIZE_FW_QPC_LVL_LVL_0       0x0UL
227 	#define CMDQ_INITIALIZE_FW_QPC_LVL_LVL_1       0x1UL
228 	#define CMDQ_INITIALIZE_FW_QPC_LVL_LVL_2       0x2UL
229 	#define CMDQ_INITIALIZE_FW_QPC_LVL_LAST       CMDQ_INITIALIZE_FW_QPC_LVL_LVL_2
230 	#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_MASK  0xf0UL
231 	#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_SFT   4
232 	#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_4K   (0x0UL << 4)
233 	#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_8K   (0x1UL << 4)
234 	#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_64K  (0x2UL << 4)
235 	#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_2M   (0x3UL << 4)
236 	#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_8M   (0x4UL << 4)
237 	#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_1G   (0x5UL << 4)
238 	#define CMDQ_INITIALIZE_FW_QPC_PG_SIZE_LAST   CMDQ_INITIALIZE_FW_QPC_PG_SIZE_PG_1G
239 	u8	mrw_pg_size_mrw_lvl;
240 	#define CMDQ_INITIALIZE_FW_MRW_LVL_MASK      0xfUL
241 	#define CMDQ_INITIALIZE_FW_MRW_LVL_SFT       0
242 	#define CMDQ_INITIALIZE_FW_MRW_LVL_LVL_0       0x0UL
243 	#define CMDQ_INITIALIZE_FW_MRW_LVL_LVL_1       0x1UL
244 	#define CMDQ_INITIALIZE_FW_MRW_LVL_LVL_2       0x2UL
245 	#define CMDQ_INITIALIZE_FW_MRW_LVL_LAST       CMDQ_INITIALIZE_FW_MRW_LVL_LVL_2
246 	#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_MASK  0xf0UL
247 	#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_SFT   4
248 	#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_4K   (0x0UL << 4)
249 	#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_8K   (0x1UL << 4)
250 	#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_64K  (0x2UL << 4)
251 	#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_2M   (0x3UL << 4)
252 	#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_8M   (0x4UL << 4)
253 	#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_1G   (0x5UL << 4)
254 	#define CMDQ_INITIALIZE_FW_MRW_PG_SIZE_LAST   CMDQ_INITIALIZE_FW_MRW_PG_SIZE_PG_1G
255 	u8	srq_pg_size_srq_lvl;
256 	#define CMDQ_INITIALIZE_FW_SRQ_LVL_MASK      0xfUL
257 	#define CMDQ_INITIALIZE_FW_SRQ_LVL_SFT       0
258 	#define CMDQ_INITIALIZE_FW_SRQ_LVL_LVL_0       0x0UL
259 	#define CMDQ_INITIALIZE_FW_SRQ_LVL_LVL_1       0x1UL
260 	#define CMDQ_INITIALIZE_FW_SRQ_LVL_LVL_2       0x2UL
261 	#define CMDQ_INITIALIZE_FW_SRQ_LVL_LAST       CMDQ_INITIALIZE_FW_SRQ_LVL_LVL_2
262 	#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_MASK  0xf0UL
263 	#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_SFT   4
264 	#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_4K   (0x0UL << 4)
265 	#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_8K   (0x1UL << 4)
266 	#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_64K  (0x2UL << 4)
267 	#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_2M   (0x3UL << 4)
268 	#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_8M   (0x4UL << 4)
269 	#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_1G   (0x5UL << 4)
270 	#define CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_LAST   CMDQ_INITIALIZE_FW_SRQ_PG_SIZE_PG_1G
271 	u8	cq_pg_size_cq_lvl;
272 	#define CMDQ_INITIALIZE_FW_CQ_LVL_MASK      0xfUL
273 	#define CMDQ_INITIALIZE_FW_CQ_LVL_SFT       0
274 	#define CMDQ_INITIALIZE_FW_CQ_LVL_LVL_0       0x0UL
275 	#define CMDQ_INITIALIZE_FW_CQ_LVL_LVL_1       0x1UL
276 	#define CMDQ_INITIALIZE_FW_CQ_LVL_LVL_2       0x2UL
277 	#define CMDQ_INITIALIZE_FW_CQ_LVL_LAST       CMDQ_INITIALIZE_FW_CQ_LVL_LVL_2
278 	#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_MASK  0xf0UL
279 	#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_SFT   4
280 	#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_4K   (0x0UL << 4)
281 	#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_8K   (0x1UL << 4)
282 	#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_64K  (0x2UL << 4)
283 	#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_2M   (0x3UL << 4)
284 	#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_8M   (0x4UL << 4)
285 	#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_1G   (0x5UL << 4)
286 	#define CMDQ_INITIALIZE_FW_CQ_PG_SIZE_LAST   CMDQ_INITIALIZE_FW_CQ_PG_SIZE_PG_1G
287 	u8	tqm_pg_size_tqm_lvl;
288 	#define CMDQ_INITIALIZE_FW_TQM_LVL_MASK      0xfUL
289 	#define CMDQ_INITIALIZE_FW_TQM_LVL_SFT       0
290 	#define CMDQ_INITIALIZE_FW_TQM_LVL_LVL_0       0x0UL
291 	#define CMDQ_INITIALIZE_FW_TQM_LVL_LVL_1       0x1UL
292 	#define CMDQ_INITIALIZE_FW_TQM_LVL_LVL_2       0x2UL
293 	#define CMDQ_INITIALIZE_FW_TQM_LVL_LAST       CMDQ_INITIALIZE_FW_TQM_LVL_LVL_2
294 	#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_MASK  0xf0UL
295 	#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_SFT   4
296 	#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_4K   (0x0UL << 4)
297 	#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_8K   (0x1UL << 4)
298 	#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_64K  (0x2UL << 4)
299 	#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_2M   (0x3UL << 4)
300 	#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_8M   (0x4UL << 4)
301 	#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_1G   (0x5UL << 4)
302 	#define CMDQ_INITIALIZE_FW_TQM_PG_SIZE_LAST   CMDQ_INITIALIZE_FW_TQM_PG_SIZE_PG_1G
303 	u8	tim_pg_size_tim_lvl;
304 	#define CMDQ_INITIALIZE_FW_TIM_LVL_MASK      0xfUL
305 	#define CMDQ_INITIALIZE_FW_TIM_LVL_SFT       0
306 	#define CMDQ_INITIALIZE_FW_TIM_LVL_LVL_0       0x0UL
307 	#define CMDQ_INITIALIZE_FW_TIM_LVL_LVL_1       0x1UL
308 	#define CMDQ_INITIALIZE_FW_TIM_LVL_LVL_2       0x2UL
309 	#define CMDQ_INITIALIZE_FW_TIM_LVL_LAST       CMDQ_INITIALIZE_FW_TIM_LVL_LVL_2
310 	#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_MASK  0xf0UL
311 	#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_SFT   4
312 	#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_4K   (0x0UL << 4)
313 	#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_8K   (0x1UL << 4)
314 	#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_64K  (0x2UL << 4)
315 	#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_2M   (0x3UL << 4)
316 	#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_8M   (0x4UL << 4)
317 	#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_1G   (0x5UL << 4)
318 	#define CMDQ_INITIALIZE_FW_TIM_PG_SIZE_LAST   CMDQ_INITIALIZE_FW_TIM_PG_SIZE_PG_1G
319 	__le16	log2_dbr_pg_size;
320 	#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_MASK   0xfUL
321 	#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_SFT    0
322 	#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_4K    0x0UL
323 	#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_8K    0x1UL
324 	#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_16K   0x2UL
325 	#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_32K   0x3UL
326 	#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_64K   0x4UL
327 	#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_128K  0x5UL
328 	#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_256K  0x6UL
329 	#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_512K  0x7UL
330 	#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_1M    0x8UL
331 	#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_2M    0x9UL
332 	#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_4M    0xaUL
333 	#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_8M    0xbUL
334 	#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_16M   0xcUL
335 	#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_32M   0xdUL
336 	#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_64M   0xeUL
337 	#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_128M  0xfUL
338 	#define CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_LAST    \
339 		CMDQ_INITIALIZE_FW_LOG2_DBR_PG_SIZE_PG_128M
340 	#define CMDQ_INITIALIZE_FW_RSVD_MASK               0xfff0UL
341 	#define CMDQ_INITIALIZE_FW_RSVD_SFT                4
342 	__le64	qpc_page_dir;
343 	__le64	mrw_page_dir;
344 	__le64	srq_page_dir;
345 	__le64	cq_page_dir;
346 	__le64	tqm_page_dir;
347 	__le64	tim_page_dir;
348 	__le32	number_of_qp;
349 	__le32	number_of_mrw;
350 	__le32	number_of_srq;
351 	__le32	number_of_cq;
352 	__le32	max_qp_per_vf;
353 	__le32	max_mrw_per_vf;
354 	__le32	max_srq_per_vf;
355 	__le32	max_cq_per_vf;
356 	__le32	max_gid_per_vf;
357 	__le32	stat_ctx_id;
358 };
359 
360 /* creq_initialize_fw_resp (size:128b/16B) */
361 struct creq_initialize_fw_resp {
362 	u8	type;
363 	#define CREQ_INITIALIZE_FW_RESP_TYPE_MASK    0x3fUL
364 	#define CREQ_INITIALIZE_FW_RESP_TYPE_SFT     0
365 	#define CREQ_INITIALIZE_FW_RESP_TYPE_QP_EVENT  0x38UL
366 	#define CREQ_INITIALIZE_FW_RESP_TYPE_LAST     CREQ_INITIALIZE_FW_RESP_TYPE_QP_EVENT
367 	u8	status;
368 	__le16	cookie;
369 	__le32	reserved32;
370 	u8	v;
371 	#define CREQ_INITIALIZE_FW_RESP_V     0x1UL
372 	u8	event;
373 	#define CREQ_INITIALIZE_FW_RESP_EVENT_INITIALIZE_FW 0x80UL
374 	#define CREQ_INITIALIZE_FW_RESP_EVENT_LAST         \
375 		CREQ_INITIALIZE_FW_RESP_EVENT_INITIALIZE_FW
376 	u8	reserved48[6];
377 };
378 
379 /* cmdq_deinitialize_fw (size:128b/16B) */
380 struct cmdq_deinitialize_fw {
381 	u8	opcode;
382 	#define CMDQ_DEINITIALIZE_FW_OPCODE_DEINITIALIZE_FW 0x81UL
383 	#define CMDQ_DEINITIALIZE_FW_OPCODE_LAST           \
384 		CMDQ_DEINITIALIZE_FW_OPCODE_DEINITIALIZE_FW
385 	u8	cmd_size;
386 	__le16	flags;
387 	__le16	cookie;
388 	u8	resp_size;
389 	u8	reserved8;
390 	__le64	resp_addr;
391 };
392 
393 /* creq_deinitialize_fw_resp (size:128b/16B) */
394 struct creq_deinitialize_fw_resp {
395 	u8	type;
396 	#define CREQ_DEINITIALIZE_FW_RESP_TYPE_MASK    0x3fUL
397 	#define CREQ_DEINITIALIZE_FW_RESP_TYPE_SFT     0
398 	#define CREQ_DEINITIALIZE_FW_RESP_TYPE_QP_EVENT  0x38UL
399 	#define CREQ_DEINITIALIZE_FW_RESP_TYPE_LAST     CREQ_DEINITIALIZE_FW_RESP_TYPE_QP_EVENT
400 	u8	status;
401 	__le16	cookie;
402 	__le32	reserved32;
403 	u8	v;
404 	#define CREQ_DEINITIALIZE_FW_RESP_V     0x1UL
405 	u8	event;
406 	#define CREQ_DEINITIALIZE_FW_RESP_EVENT_DEINITIALIZE_FW 0x81UL
407 	#define CREQ_DEINITIALIZE_FW_RESP_EVENT_LAST           \
408 		CREQ_DEINITIALIZE_FW_RESP_EVENT_DEINITIALIZE_FW
409 	u8	reserved48[6];
410 };
411 
412 /* cmdq_create_qp (size:768b/96B) */
413 struct cmdq_create_qp {
414 	u8	opcode;
415 	#define CMDQ_CREATE_QP_OPCODE_CREATE_QP 0x1UL
416 	#define CMDQ_CREATE_QP_OPCODE_LAST     CMDQ_CREATE_QP_OPCODE_CREATE_QP
417 	u8	cmd_size;
418 	__le16	flags;
419 	__le16	cookie;
420 	u8	resp_size;
421 	u8	reserved8;
422 	__le64	resp_addr;
423 	__le64	qp_handle;
424 	__le32	qp_flags;
425 	#define CMDQ_CREATE_QP_QP_FLAGS_SRQ_USED                   0x1UL
426 	#define CMDQ_CREATE_QP_QP_FLAGS_FORCE_COMPLETION           0x2UL
427 	#define CMDQ_CREATE_QP_QP_FLAGS_RESERVED_LKEY_ENABLE       0x4UL
428 	#define CMDQ_CREATE_QP_QP_FLAGS_FR_PMR_ENABLED             0x8UL
429 	#define CMDQ_CREATE_QP_QP_FLAGS_VARIABLE_SIZED_WQE_ENABLED 0x10UL
430 	#define CMDQ_CREATE_QP_QP_FLAGS_OPTIMIZED_TRANSMIT_ENABLED 0x20UL
431 	#define CMDQ_CREATE_QP_QP_FLAGS_RESPONDER_UD_CQE_WITH_CFA  0x40UL
432 	#define CMDQ_CREATE_QP_QP_FLAGS_EXT_STATS_ENABLED          0x80UL
433 	#define CMDQ_CREATE_QP_QP_FLAGS_LAST                      \
434 		CMDQ_CREATE_QP_QP_FLAGS_EXT_STATS_ENABLED
435 	u8	type;
436 	#define CMDQ_CREATE_QP_TYPE_RC            0x2UL
437 	#define CMDQ_CREATE_QP_TYPE_UD            0x4UL
438 	#define CMDQ_CREATE_QP_TYPE_RAW_ETHERTYPE 0x6UL
439 	#define CMDQ_CREATE_QP_TYPE_GSI           0x7UL
440 	#define CMDQ_CREATE_QP_TYPE_LAST         CMDQ_CREATE_QP_TYPE_GSI
441 	u8	sq_pg_size_sq_lvl;
442 	#define CMDQ_CREATE_QP_SQ_LVL_MASK      0xfUL
443 	#define CMDQ_CREATE_QP_SQ_LVL_SFT       0
444 	#define CMDQ_CREATE_QP_SQ_LVL_LVL_0       0x0UL
445 	#define CMDQ_CREATE_QP_SQ_LVL_LVL_1       0x1UL
446 	#define CMDQ_CREATE_QP_SQ_LVL_LVL_2       0x2UL
447 	#define CMDQ_CREATE_QP_SQ_LVL_LAST       CMDQ_CREATE_QP_SQ_LVL_LVL_2
448 	#define CMDQ_CREATE_QP_SQ_PG_SIZE_MASK  0xf0UL
449 	#define CMDQ_CREATE_QP_SQ_PG_SIZE_SFT   4
450 	#define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_4K   (0x0UL << 4)
451 	#define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_8K   (0x1UL << 4)
452 	#define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_64K  (0x2UL << 4)
453 	#define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_2M   (0x3UL << 4)
454 	#define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_8M   (0x4UL << 4)
455 	#define CMDQ_CREATE_QP_SQ_PG_SIZE_PG_1G   (0x5UL << 4)
456 	#define CMDQ_CREATE_QP_SQ_PG_SIZE_LAST   CMDQ_CREATE_QP_SQ_PG_SIZE_PG_1G
457 	u8	rq_pg_size_rq_lvl;
458 	#define CMDQ_CREATE_QP_RQ_LVL_MASK      0xfUL
459 	#define CMDQ_CREATE_QP_RQ_LVL_SFT       0
460 	#define CMDQ_CREATE_QP_RQ_LVL_LVL_0       0x0UL
461 	#define CMDQ_CREATE_QP_RQ_LVL_LVL_1       0x1UL
462 	#define CMDQ_CREATE_QP_RQ_LVL_LVL_2       0x2UL
463 	#define CMDQ_CREATE_QP_RQ_LVL_LAST       CMDQ_CREATE_QP_RQ_LVL_LVL_2
464 	#define CMDQ_CREATE_QP_RQ_PG_SIZE_MASK  0xf0UL
465 	#define CMDQ_CREATE_QP_RQ_PG_SIZE_SFT   4
466 	#define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_4K   (0x0UL << 4)
467 	#define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_8K   (0x1UL << 4)
468 	#define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_64K  (0x2UL << 4)
469 	#define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_2M   (0x3UL << 4)
470 	#define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_8M   (0x4UL << 4)
471 	#define CMDQ_CREATE_QP_RQ_PG_SIZE_PG_1G   (0x5UL << 4)
472 	#define CMDQ_CREATE_QP_RQ_PG_SIZE_LAST   CMDQ_CREATE_QP_RQ_PG_SIZE_PG_1G
473 	u8	unused_0;
474 	__le32	dpi;
475 	__le32	sq_size;
476 	__le32	rq_size;
477 	__le16	sq_fwo_sq_sge;
478 	#define CMDQ_CREATE_QP_SQ_SGE_MASK 0xfUL
479 	#define CMDQ_CREATE_QP_SQ_SGE_SFT 0
480 	#define CMDQ_CREATE_QP_SQ_FWO_MASK 0xfff0UL
481 	#define CMDQ_CREATE_QP_SQ_FWO_SFT 4
482 	__le16	rq_fwo_rq_sge;
483 	#define CMDQ_CREATE_QP_RQ_SGE_MASK 0xfUL
484 	#define CMDQ_CREATE_QP_RQ_SGE_SFT 0
485 	#define CMDQ_CREATE_QP_RQ_FWO_MASK 0xfff0UL
486 	#define CMDQ_CREATE_QP_RQ_FWO_SFT 4
487 	__le32	scq_cid;
488 	__le32	rcq_cid;
489 	__le32	srq_cid;
490 	__le32	pd_id;
491 	__le64	sq_pbl;
492 	__le64	rq_pbl;
493 	__le64	irrq_addr;
494 	__le64	orrq_addr;
495 };
496 
497 /* creq_create_qp_resp (size:128b/16B) */
498 struct creq_create_qp_resp {
499 	u8	type;
500 	#define CREQ_CREATE_QP_RESP_TYPE_MASK    0x3fUL
501 	#define CREQ_CREATE_QP_RESP_TYPE_SFT     0
502 	#define CREQ_CREATE_QP_RESP_TYPE_QP_EVENT  0x38UL
503 	#define CREQ_CREATE_QP_RESP_TYPE_LAST     CREQ_CREATE_QP_RESP_TYPE_QP_EVENT
504 	u8	status;
505 	__le16	cookie;
506 	__le32	xid;
507 	u8	v;
508 	#define CREQ_CREATE_QP_RESP_V     0x1UL
509 	u8	event;
510 	#define CREQ_CREATE_QP_RESP_EVENT_CREATE_QP 0x1UL
511 	#define CREQ_CREATE_QP_RESP_EVENT_LAST     CREQ_CREATE_QP_RESP_EVENT_CREATE_QP
512 	u8	optimized_transmit_enabled;
513 	u8	reserved48[5];
514 };
515 
516 /* cmdq_destroy_qp (size:192b/24B) */
517 struct cmdq_destroy_qp {
518 	u8	opcode;
519 	#define CMDQ_DESTROY_QP_OPCODE_DESTROY_QP 0x2UL
520 	#define CMDQ_DESTROY_QP_OPCODE_LAST      CMDQ_DESTROY_QP_OPCODE_DESTROY_QP
521 	u8	cmd_size;
522 	__le16	flags;
523 	__le16	cookie;
524 	u8	resp_size;
525 	u8	reserved8;
526 	__le64	resp_addr;
527 	__le32	qp_cid;
528 	__le32	unused_0;
529 };
530 
531 /* creq_destroy_qp_resp (size:128b/16B) */
532 struct creq_destroy_qp_resp {
533 	u8	type;
534 	#define CREQ_DESTROY_QP_RESP_TYPE_MASK    0x3fUL
535 	#define CREQ_DESTROY_QP_RESP_TYPE_SFT     0
536 	#define CREQ_DESTROY_QP_RESP_TYPE_QP_EVENT  0x38UL
537 	#define CREQ_DESTROY_QP_RESP_TYPE_LAST     CREQ_DESTROY_QP_RESP_TYPE_QP_EVENT
538 	u8	status;
539 	__le16	cookie;
540 	__le32	xid;
541 	u8	v;
542 	#define CREQ_DESTROY_QP_RESP_V     0x1UL
543 	u8	event;
544 	#define CREQ_DESTROY_QP_RESP_EVENT_DESTROY_QP 0x2UL
545 	#define CREQ_DESTROY_QP_RESP_EVENT_LAST      CREQ_DESTROY_QP_RESP_EVENT_DESTROY_QP
546 	u8	reserved48[6];
547 };
548 
549 /* cmdq_modify_qp (size:1024b/128B) */
550 struct cmdq_modify_qp {
551 	u8	opcode;
552 	#define CMDQ_MODIFY_QP_OPCODE_MODIFY_QP 0x3UL
553 	#define CMDQ_MODIFY_QP_OPCODE_LAST     CMDQ_MODIFY_QP_OPCODE_MODIFY_QP
554 	u8	cmd_size;
555 	__le16	flags;
556 	__le16	cookie;
557 	u8	resp_size;
558 	u8	qp_type;
559 	#define CMDQ_MODIFY_QP_QP_TYPE_RC            0x2UL
560 	#define CMDQ_MODIFY_QP_QP_TYPE_UD            0x4UL
561 	#define CMDQ_MODIFY_QP_QP_TYPE_RAW_ETHERTYPE 0x6UL
562 	#define CMDQ_MODIFY_QP_QP_TYPE_GSI           0x7UL
563 	#define CMDQ_MODIFY_QP_QP_TYPE_LAST         CMDQ_MODIFY_QP_QP_TYPE_GSI
564 	__le64	resp_addr;
565 	__le32	modify_mask;
566 	#define CMDQ_MODIFY_QP_MODIFY_MASK_STATE                   0x1UL
567 	#define CMDQ_MODIFY_QP_MODIFY_MASK_EN_SQD_ASYNC_NOTIFY     0x2UL
568 	#define CMDQ_MODIFY_QP_MODIFY_MASK_ACCESS                  0x4UL
569 	#define CMDQ_MODIFY_QP_MODIFY_MASK_PKEY                    0x8UL
570 	#define CMDQ_MODIFY_QP_MODIFY_MASK_QKEY                    0x10UL
571 	#define CMDQ_MODIFY_QP_MODIFY_MASK_DGID                    0x20UL
572 	#define CMDQ_MODIFY_QP_MODIFY_MASK_FLOW_LABEL              0x40UL
573 	#define CMDQ_MODIFY_QP_MODIFY_MASK_SGID_INDEX              0x80UL
574 	#define CMDQ_MODIFY_QP_MODIFY_MASK_HOP_LIMIT               0x100UL
575 	#define CMDQ_MODIFY_QP_MODIFY_MASK_TRAFFIC_CLASS           0x200UL
576 	#define CMDQ_MODIFY_QP_MODIFY_MASK_DEST_MAC                0x400UL
577 	#define CMDQ_MODIFY_QP_MODIFY_MASK_PINGPONG_PUSH_MODE      0x800UL
578 	#define CMDQ_MODIFY_QP_MODIFY_MASK_PATH_MTU                0x1000UL
579 	#define CMDQ_MODIFY_QP_MODIFY_MASK_TIMEOUT                 0x2000UL
580 	#define CMDQ_MODIFY_QP_MODIFY_MASK_RETRY_CNT               0x4000UL
581 	#define CMDQ_MODIFY_QP_MODIFY_MASK_RNR_RETRY               0x8000UL
582 	#define CMDQ_MODIFY_QP_MODIFY_MASK_RQ_PSN                  0x10000UL
583 	#define CMDQ_MODIFY_QP_MODIFY_MASK_MAX_RD_ATOMIC           0x20000UL
584 	#define CMDQ_MODIFY_QP_MODIFY_MASK_MIN_RNR_TIMER           0x40000UL
585 	#define CMDQ_MODIFY_QP_MODIFY_MASK_SQ_PSN                  0x80000UL
586 	#define CMDQ_MODIFY_QP_MODIFY_MASK_MAX_DEST_RD_ATOMIC      0x100000UL
587 	#define CMDQ_MODIFY_QP_MODIFY_MASK_SQ_SIZE                 0x200000UL
588 	#define CMDQ_MODIFY_QP_MODIFY_MASK_RQ_SIZE                 0x400000UL
589 	#define CMDQ_MODIFY_QP_MODIFY_MASK_SQ_SGE                  0x800000UL
590 	#define CMDQ_MODIFY_QP_MODIFY_MASK_RQ_SGE                  0x1000000UL
591 	#define CMDQ_MODIFY_QP_MODIFY_MASK_MAX_INLINE_DATA         0x2000000UL
592 	#define CMDQ_MODIFY_QP_MODIFY_MASK_DEST_QP_ID              0x4000000UL
593 	#define CMDQ_MODIFY_QP_MODIFY_MASK_SRC_MAC                 0x8000000UL
594 	#define CMDQ_MODIFY_QP_MODIFY_MASK_VLAN_ID                 0x10000000UL
595 	#define CMDQ_MODIFY_QP_MODIFY_MASK_ENABLE_CC               0x20000000UL
596 	#define CMDQ_MODIFY_QP_MODIFY_MASK_TOS_ECN                 0x40000000UL
597 	#define CMDQ_MODIFY_QP_MODIFY_MASK_TOS_DSCP                0x80000000UL
598 	__le32	qp_cid;
599 	u8	network_type_en_sqd_async_notify_new_state;
600 	#define CMDQ_MODIFY_QP_NEW_STATE_MASK          0xfUL
601 	#define CMDQ_MODIFY_QP_NEW_STATE_SFT           0
602 	#define CMDQ_MODIFY_QP_NEW_STATE_RESET           0x0UL
603 	#define CMDQ_MODIFY_QP_NEW_STATE_INIT            0x1UL
604 	#define CMDQ_MODIFY_QP_NEW_STATE_RTR             0x2UL
605 	#define CMDQ_MODIFY_QP_NEW_STATE_RTS             0x3UL
606 	#define CMDQ_MODIFY_QP_NEW_STATE_SQD             0x4UL
607 	#define CMDQ_MODIFY_QP_NEW_STATE_SQE             0x5UL
608 	#define CMDQ_MODIFY_QP_NEW_STATE_ERR             0x6UL
609 	#define CMDQ_MODIFY_QP_NEW_STATE_LAST           CMDQ_MODIFY_QP_NEW_STATE_ERR
610 	#define CMDQ_MODIFY_QP_EN_SQD_ASYNC_NOTIFY     0x10UL
611 	#define CMDQ_MODIFY_QP_UNUSED1                 0x20UL
612 	#define CMDQ_MODIFY_QP_NETWORK_TYPE_MASK       0xc0UL
613 	#define CMDQ_MODIFY_QP_NETWORK_TYPE_SFT        6
614 	#define CMDQ_MODIFY_QP_NETWORK_TYPE_ROCEV1       (0x0UL << 6)
615 	#define CMDQ_MODIFY_QP_NETWORK_TYPE_ROCEV2_IPV4  (0x2UL << 6)
616 	#define CMDQ_MODIFY_QP_NETWORK_TYPE_ROCEV2_IPV6  (0x3UL << 6)
617 	#define CMDQ_MODIFY_QP_NETWORK_TYPE_LAST        CMDQ_MODIFY_QP_NETWORK_TYPE_ROCEV2_IPV6
618 	u8	access;
619 	#define CMDQ_MODIFY_QP_ACCESS_REMOTE_ATOMIC_REMOTE_READ_REMOTE_WRITE_LOCAL_WRITE_MASK 0xffUL
620 	#define CMDQ_MODIFY_QP_ACCESS_REMOTE_ATOMIC_REMOTE_READ_REMOTE_WRITE_LOCAL_WRITE_SFT 0
621 	#define CMDQ_MODIFY_QP_ACCESS_LOCAL_WRITE   0x1UL
622 	#define CMDQ_MODIFY_QP_ACCESS_REMOTE_WRITE  0x2UL
623 	#define CMDQ_MODIFY_QP_ACCESS_REMOTE_READ   0x4UL
624 	#define CMDQ_MODIFY_QP_ACCESS_REMOTE_ATOMIC 0x8UL
625 	__le16	pkey;
626 	__le32	qkey;
627 	__le32	dgid[4];
628 	__le32	flow_label;
629 	__le16	sgid_index;
630 	u8	hop_limit;
631 	u8	traffic_class;
632 	__le16	dest_mac[3];
633 	u8	tos_dscp_tos_ecn;
634 	#define CMDQ_MODIFY_QP_TOS_ECN_MASK 0x3UL
635 	#define CMDQ_MODIFY_QP_TOS_ECN_SFT  0
636 	#define CMDQ_MODIFY_QP_TOS_DSCP_MASK 0xfcUL
637 	#define CMDQ_MODIFY_QP_TOS_DSCP_SFT 2
638 	u8	path_mtu_pingpong_push_enable;
639 	#define CMDQ_MODIFY_QP_PINGPONG_PUSH_ENABLE     0x1UL
640 	#define CMDQ_MODIFY_QP_UNUSED3_MASK             0xeUL
641 	#define CMDQ_MODIFY_QP_UNUSED3_SFT              1
642 	#define CMDQ_MODIFY_QP_PATH_MTU_MASK            0xf0UL
643 	#define CMDQ_MODIFY_QP_PATH_MTU_SFT             4
644 	#define CMDQ_MODIFY_QP_PATH_MTU_MTU_256           (0x0UL << 4)
645 	#define CMDQ_MODIFY_QP_PATH_MTU_MTU_512           (0x1UL << 4)
646 	#define CMDQ_MODIFY_QP_PATH_MTU_MTU_1024          (0x2UL << 4)
647 	#define CMDQ_MODIFY_QP_PATH_MTU_MTU_2048          (0x3UL << 4)
648 	#define CMDQ_MODIFY_QP_PATH_MTU_MTU_4096          (0x4UL << 4)
649 	#define CMDQ_MODIFY_QP_PATH_MTU_MTU_8192          (0x5UL << 4)
650 	#define CMDQ_MODIFY_QP_PATH_MTU_LAST             CMDQ_MODIFY_QP_PATH_MTU_MTU_8192
651 	u8	timeout;
652 	u8	retry_cnt;
653 	u8	rnr_retry;
654 	u8	min_rnr_timer;
655 	__le32	rq_psn;
656 	__le32	sq_psn;
657 	u8	max_rd_atomic;
658 	u8	max_dest_rd_atomic;
659 	__le16	enable_cc;
660 	#define CMDQ_MODIFY_QP_ENABLE_CC     0x1UL
661 	#define CMDQ_MODIFY_QP_UNUSED15_MASK 0xfffeUL
662 	#define CMDQ_MODIFY_QP_UNUSED15_SFT  1
663 	__le32	sq_size;
664 	__le32	rq_size;
665 	__le16	sq_sge;
666 	__le16	rq_sge;
667 	__le32	max_inline_data;
668 	__le32	dest_qp_id;
669 	__le32	pingpong_push_dpi;
670 	__le16	src_mac[3];
671 	__le16	vlan_pcp_vlan_dei_vlan_id;
672 	#define CMDQ_MODIFY_QP_VLAN_ID_MASK 0xfffUL
673 	#define CMDQ_MODIFY_QP_VLAN_ID_SFT  0
674 	#define CMDQ_MODIFY_QP_VLAN_DEI     0x1000UL
675 	#define CMDQ_MODIFY_QP_VLAN_PCP_MASK 0xe000UL
676 	#define CMDQ_MODIFY_QP_VLAN_PCP_SFT 13
677 	__le64	irrq_addr;
678 	__le64	orrq_addr;
679 	__le32	ext_modify_mask;
680 	#define CMDQ_MODIFY_QP_EXT_MODIFY_MASK_EXT_STATS_CTX     0x1UL
681 	#define CMDQ_MODIFY_QP_EXT_MODIFY_MASK_SCHQ_ID_VALID     0x2UL
682 	__le32	ext_stats_ctx_id;
683 	__le16	schq_id;
684 	__le16	unused_0;
685 	__le32	reserved32;
686 };
687 
688 /* creq_modify_qp_resp (size:128b/16B) */
689 struct creq_modify_qp_resp {
690 	u8	type;
691 	#define CREQ_MODIFY_QP_RESP_TYPE_MASK    0x3fUL
692 	#define CREQ_MODIFY_QP_RESP_TYPE_SFT     0
693 	#define CREQ_MODIFY_QP_RESP_TYPE_QP_EVENT  0x38UL
694 	#define CREQ_MODIFY_QP_RESP_TYPE_LAST     CREQ_MODIFY_QP_RESP_TYPE_QP_EVENT
695 	u8	status;
696 	__le16	cookie;
697 	__le32	xid;
698 	u8	v;
699 	#define CREQ_MODIFY_QP_RESP_V     0x1UL
700 	u8	event;
701 	#define CREQ_MODIFY_QP_RESP_EVENT_MODIFY_QP 0x3UL
702 	#define CREQ_MODIFY_QP_RESP_EVENT_LAST     CREQ_MODIFY_QP_RESP_EVENT_MODIFY_QP
703 	u8	pingpong_push_state_index_enabled;
704 	#define CREQ_MODIFY_QP_RESP_PINGPONG_PUSH_ENABLED     0x1UL
705 	#define CREQ_MODIFY_QP_RESP_PINGPONG_PUSH_INDEX_MASK  0xeUL
706 	#define CREQ_MODIFY_QP_RESP_PINGPONG_PUSH_INDEX_SFT   1
707 	#define CREQ_MODIFY_QP_RESP_PINGPONG_PUSH_STATE       0x10UL
708 	u8	reserved8;
709 	__le32	lag_src_mac;
710 };
711 
712 /* cmdq_query_qp (size:192b/24B) */
713 struct cmdq_query_qp {
714 	u8	opcode;
715 	#define CMDQ_QUERY_QP_OPCODE_QUERY_QP 0x4UL
716 	#define CMDQ_QUERY_QP_OPCODE_LAST    CMDQ_QUERY_QP_OPCODE_QUERY_QP
717 	u8	cmd_size;
718 	__le16	flags;
719 	__le16	cookie;
720 	u8	resp_size;
721 	u8	reserved8;
722 	__le64	resp_addr;
723 	__le32	qp_cid;
724 	__le32	unused_0;
725 };
726 
727 /* creq_query_qp_resp (size:128b/16B) */
728 struct creq_query_qp_resp {
729 	u8	type;
730 	#define CREQ_QUERY_QP_RESP_TYPE_MASK    0x3fUL
731 	#define CREQ_QUERY_QP_RESP_TYPE_SFT     0
732 	#define CREQ_QUERY_QP_RESP_TYPE_QP_EVENT  0x38UL
733 	#define CREQ_QUERY_QP_RESP_TYPE_LAST     CREQ_QUERY_QP_RESP_TYPE_QP_EVENT
734 	u8	status;
735 	__le16	cookie;
736 	__le32	size;
737 	u8	v;
738 	#define CREQ_QUERY_QP_RESP_V     0x1UL
739 	u8	event;
740 	#define CREQ_QUERY_QP_RESP_EVENT_QUERY_QP 0x4UL
741 	#define CREQ_QUERY_QP_RESP_EVENT_LAST    CREQ_QUERY_QP_RESP_EVENT_QUERY_QP
742 	u8	reserved48[6];
743 };
744 
745 /* creq_query_qp_resp_sb (size:832b/104B) */
746 struct creq_query_qp_resp_sb {
747 	u8	opcode;
748 	#define CREQ_QUERY_QP_RESP_SB_OPCODE_QUERY_QP 0x4UL
749 	#define CREQ_QUERY_QP_RESP_SB_OPCODE_LAST    CREQ_QUERY_QP_RESP_SB_OPCODE_QUERY_QP
750 	u8	status;
751 	__le16	cookie;
752 	__le16	flags;
753 	u8	resp_size;
754 	u8	reserved8;
755 	__le32	xid;
756 	u8	en_sqd_async_notify_state;
757 	#define CREQ_QUERY_QP_RESP_SB_STATE_MASK              0xfUL
758 	#define CREQ_QUERY_QP_RESP_SB_STATE_SFT               0
759 	#define CREQ_QUERY_QP_RESP_SB_STATE_RESET               0x0UL
760 	#define CREQ_QUERY_QP_RESP_SB_STATE_INIT                0x1UL
761 	#define CREQ_QUERY_QP_RESP_SB_STATE_RTR                 0x2UL
762 	#define CREQ_QUERY_QP_RESP_SB_STATE_RTS                 0x3UL
763 	#define CREQ_QUERY_QP_RESP_SB_STATE_SQD                 0x4UL
764 	#define CREQ_QUERY_QP_RESP_SB_STATE_SQE                 0x5UL
765 	#define CREQ_QUERY_QP_RESP_SB_STATE_ERR                 0x6UL
766 	#define CREQ_QUERY_QP_RESP_SB_STATE_LAST               CREQ_QUERY_QP_RESP_SB_STATE_ERR
767 	#define CREQ_QUERY_QP_RESP_SB_EN_SQD_ASYNC_NOTIFY     0x10UL
768 	#define CREQ_QUERY_QP_RESP_SB_UNUSED3_MASK            0xe0UL
769 	#define CREQ_QUERY_QP_RESP_SB_UNUSED3_SFT             5
770 	u8	access;
771 	#define \
772 	CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_ATOMIC_REMOTE_READ_REMOTE_WRITE_LOCAL_WRITE_MASK\
773 		0xffUL
774 	#define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_ATOMIC_REMOTE_READ_REMOTE_WRITE_LOCAL_WRITE_SFT\
775 		0
776 	#define CREQ_QUERY_QP_RESP_SB_ACCESS_LOCAL_WRITE 0x1UL
777 	#define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_WRITE 0x2UL
778 	#define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_READ 0x4UL
779 	#define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_ATOMIC 0x8UL
780 	__le16	pkey;
781 	__le32	qkey;
782 	__le32	reserved32;
783 	__le32	dgid[4];
784 	__le32	flow_label;
785 	__le16	sgid_index;
786 	u8	hop_limit;
787 	u8	traffic_class;
788 	__le16	dest_mac[3];
789 	__le16	path_mtu_dest_vlan_id;
790 	#define CREQ_QUERY_QP_RESP_SB_DEST_VLAN_ID_MASK 0xfffUL
791 	#define CREQ_QUERY_QP_RESP_SB_DEST_VLAN_ID_SFT 0
792 	#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MASK    0xf000UL
793 	#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_SFT     12
794 	#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_256   (0x0UL << 12)
795 	#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_512   (0x1UL << 12)
796 	#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_1024  (0x2UL << 12)
797 	#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_2048  (0x3UL << 12)
798 	#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_4096  (0x4UL << 12)
799 	#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_8192  (0x5UL << 12)
800 	#define CREQ_QUERY_QP_RESP_SB_PATH_MTU_LAST     CREQ_QUERY_QP_RESP_SB_PATH_MTU_MTU_8192
801 	u8	timeout;
802 	u8	retry_cnt;
803 	u8	rnr_retry;
804 	u8	min_rnr_timer;
805 	__le32	rq_psn;
806 	__le32	sq_psn;
807 	u8	max_rd_atomic;
808 	u8	max_dest_rd_atomic;
809 	u8	tos_dscp_tos_ecn;
810 	#define CREQ_QUERY_QP_RESP_SB_TOS_ECN_MASK 0x3UL
811 	#define CREQ_QUERY_QP_RESP_SB_TOS_ECN_SFT  0
812 	#define CREQ_QUERY_QP_RESP_SB_TOS_DSCP_MASK 0xfcUL
813 	#define CREQ_QUERY_QP_RESP_SB_TOS_DSCP_SFT 2
814 	u8	enable_cc;
815 	#define CREQ_QUERY_QP_RESP_SB_ENABLE_CC     0x1UL
816 	__le32	sq_size;
817 	__le32	rq_size;
818 	__le16	sq_sge;
819 	__le16	rq_sge;
820 	__le32	max_inline_data;
821 	__le32	dest_qp_id;
822 	__le16	port_id;
823 	u8	unused_0;
824 	u8	stat_collection_id;
825 	__le16	src_mac[3];
826 	__le16	vlan_pcp_vlan_dei_vlan_id;
827 	#define CREQ_QUERY_QP_RESP_SB_VLAN_ID_MASK 0xfffUL
828 	#define CREQ_QUERY_QP_RESP_SB_VLAN_ID_SFT  0
829 	#define CREQ_QUERY_QP_RESP_SB_VLAN_DEI     0x1000UL
830 	#define CREQ_QUERY_QP_RESP_SB_VLAN_PCP_MASK 0xe000UL
831 	#define CREQ_QUERY_QP_RESP_SB_VLAN_PCP_SFT 13
832 };
833 
834 /* cmdq_query_qp_extend (size:192b/24B) */
835 struct cmdq_query_qp_extend {
836 	u8	opcode;
837 	#define CMDQ_QUERY_QP_EXTEND_OPCODE_QUERY_QP_EXTEND 0x91UL
838 	#define CMDQ_QUERY_QP_EXTEND_OPCODE_LAST CMDQ_QUERY_QP_EXTEND_OPCODE_QUERY_QP_EXTEND
839 	u8	cmd_size;
840 	__le16	flags;
841 	__le16	cookie;
842 	u8	resp_size;
843 	u8	num_qps;
844 	__le64	resp_addr;
845 	__le32	function_id;
846 	#define CMDQ_QUERY_QP_EXTEND_PF_NUM_MASK  0xffUL
847 	#define CMDQ_QUERY_QP_EXTEND_PF_NUM_SFT   0
848 	#define CMDQ_QUERY_QP_EXTEND_VF_NUM_MASK  0xffff00UL
849 	#define CMDQ_QUERY_QP_EXTEND_VF_NUM_SFT   8
850 	#define CMDQ_QUERY_QP_EXTEND_VF_VALID     0x1000000UL
851 	__le32	current_index;
852 };
853 
854 /* creq_query_qp_extend_resp (size:128b/16B) */
855 struct creq_query_qp_extend_resp {
856 	u8	type;
857 	#define CREQ_QUERY_QP_EXTEND_RESP_TYPE_MASK    0x3fUL
858 	#define CREQ_QUERY_QP_EXTEND_RESP_TYPE_SFT     0
859 	#define CREQ_QUERY_QP_EXTEND_RESP_TYPE_QP_EVENT  0x38UL
860 	#define CREQ_QUERY_QP_EXTEND_RESP_TYPE_LAST     CREQ_QUERY_QP_EXTEND_RESP_TYPE_QP_EVENT
861 	u8	status;
862 	__le16	cookie;
863 	__le32	size;
864 	u8	v;
865 	#define CREQ_QUERY_QP_EXTEND_RESP_V     0x1UL
866 	u8	event;
867 	#define CREQ_QUERY_QP_EXTEND_RESP_EVENT_QUERY_QP_EXTEND 0x91UL
868 	#define CREQ_QUERY_QP_EXTEND_RESP_EVENT_LAST CREQ_QUERY_QP_EXTEND_RESP_EVENT_QUERY_QP_EXTEND
869 	__le16	reserved16;
870 	__le32	current_index;
871 };
872 
873 /* creq_query_qp_extend_resp_sb (size:384b/48B) */
874 struct creq_query_qp_extend_resp_sb {
875 	u8	opcode;
876 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_OPCODE_QUERY_QP_EXTEND 0x91UL
877 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_OPCODE_LAST \
878 		CREQ_QUERY_QP_EXTEND_RESP_SB_OPCODE_QUERY_QP_EXTEND
879 	u8	status;
880 	__le16	cookie;
881 	__le16	flags;
882 	u8	resp_size;
883 	u8	reserved8;
884 	__le32	xid;
885 	u8	state;
886 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_MASK  0xfUL
887 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_SFT   0
888 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_RESET   0x0UL
889 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_INIT    0x1UL
890 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_RTR     0x2UL
891 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_RTS     0x3UL
892 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_SQD     0x4UL
893 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_SQE     0x5UL
894 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_ERR     0x6UL
895 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_LAST   CREQ_QUERY_QP_EXTEND_RESP_SB_STATE_ERR
896 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_UNUSED4_MASK 0xf0UL
897 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_UNUSED4_SFT 4
898 	u8	reserved_8;
899 	__le16	port_id;
900 	__le32	qkey;
901 	__le16	sgid_index;
902 	u8	network_type;
903 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_NETWORK_TYPE_ROCEV1      0x0UL
904 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_NETWORK_TYPE_ROCEV2_IPV4 0x2UL
905 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_NETWORK_TYPE_ROCEV2_IPV6 0x3UL
906 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_NETWORK_TYPE_LAST \
907 		CREQ_QUERY_QP_EXTEND_RESP_SB_NETWORK_TYPE_ROCEV2_IPV6
908 	u8	unused_0;
909 	__le32	dgid[4];
910 	__le32	dest_qp_id;
911 	u8	stat_collection_id;
912 	u8	reservred_8;
913 	__le16	reserved_16;
914 };
915 
916 /* creq_query_qp_extend_resp_sb_tlv (size:512b/64B) */
917 struct creq_query_qp_extend_resp_sb_tlv {
918 	__le16	cmd_discr;
919 	u8	reserved_8b;
920 	u8	tlv_flags;
921 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_MORE         0x1UL
922 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_MORE_LAST      0x0UL
923 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_MORE_NOT_LAST  0x1UL
924 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_REQUIRED     0x2UL
925 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_REQUIRED_NO    (0x0UL << 1)
926 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_REQUIRED_YES   (0x1UL << 1)
927 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_REQUIRED_LAST \
928 		CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_TLV_FLAGS_REQUIRED_YES
929 	__le16	tlv_type;
930 	__le16	length;
931 	u8	total_size;
932 	u8	reserved56[7];
933 	u8	opcode;
934 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_OPCODE_QUERY_QP_EXTEND 0x91UL
935 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_OPCODE_LAST \
936 		CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_OPCODE_QUERY_QP_EXTEND
937 	u8	status;
938 	__le16	cookie;
939 	__le16	flags;
940 	u8	resp_size;
941 	u8	reserved8;
942 	__le32	xid;
943 	u8	state;
944 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_MASK  0xfUL
945 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_SFT   0
946 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_RESET   0x0UL
947 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_INIT    0x1UL
948 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_RTR     0x2UL
949 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_RTS     0x3UL
950 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_SQD     0x4UL
951 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_SQE     0x5UL
952 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_ERR     0x6UL
953 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_LAST \
954 		CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_STATE_ERR
955 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_UNUSED4_MASK 0xf0UL
956 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_UNUSED4_SFT 4
957 	u8	reserved_8;
958 	__le16	port_id;
959 	__le32	qkey;
960 	__le16	sgid_index;
961 	u8	network_type;
962 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_NETWORK_TYPE_ROCEV1      0x0UL
963 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_NETWORK_TYPE_ROCEV2_IPV4 0x2UL
964 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_NETWORK_TYPE_ROCEV2_IPV6 0x3UL
965 	#define CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_NETWORK_TYPE_LAST \
966 		CREQ_QUERY_QP_EXTEND_RESP_SB_TLV_NETWORK_TYPE_ROCEV2_IPV6
967 	u8	unused_0;
968 	__le32	dgid[4];
969 	__le32	dest_qp_id;
970 	u8	stat_collection_id;
971 	u8	reservred_8;
972 	__le16	reserved_16;
973 };
974 
975 /* cmdq_create_srq (size:384b/48B) */
976 struct cmdq_create_srq {
977 	u8	opcode;
978 	#define CMDQ_CREATE_SRQ_OPCODE_CREATE_SRQ 0x5UL
979 	#define CMDQ_CREATE_SRQ_OPCODE_LAST      CMDQ_CREATE_SRQ_OPCODE_CREATE_SRQ
980 	u8	cmd_size;
981 	__le16	flags;
982 	__le16	cookie;
983 	u8	resp_size;
984 	u8	reserved8;
985 	__le64	resp_addr;
986 	__le64	srq_handle;
987 	__le16	pg_size_lvl;
988 	#define CMDQ_CREATE_SRQ_LVL_MASK      0x3UL
989 	#define CMDQ_CREATE_SRQ_LVL_SFT       0
990 	#define CMDQ_CREATE_SRQ_LVL_LVL_0       0x0UL
991 	#define CMDQ_CREATE_SRQ_LVL_LVL_1       0x1UL
992 	#define CMDQ_CREATE_SRQ_LVL_LVL_2       0x2UL
993 	#define CMDQ_CREATE_SRQ_LVL_LAST       CMDQ_CREATE_SRQ_LVL_LVL_2
994 	#define CMDQ_CREATE_SRQ_PG_SIZE_MASK  0x1cUL
995 	#define CMDQ_CREATE_SRQ_PG_SIZE_SFT   2
996 	#define CMDQ_CREATE_SRQ_PG_SIZE_PG_4K   (0x0UL << 2)
997 	#define CMDQ_CREATE_SRQ_PG_SIZE_PG_8K   (0x1UL << 2)
998 	#define CMDQ_CREATE_SRQ_PG_SIZE_PG_64K  (0x2UL << 2)
999 	#define CMDQ_CREATE_SRQ_PG_SIZE_PG_2M   (0x3UL << 2)
1000 	#define CMDQ_CREATE_SRQ_PG_SIZE_PG_8M   (0x4UL << 2)
1001 	#define CMDQ_CREATE_SRQ_PG_SIZE_PG_1G   (0x5UL << 2)
1002 	#define CMDQ_CREATE_SRQ_PG_SIZE_LAST   CMDQ_CREATE_SRQ_PG_SIZE_PG_1G
1003 	#define CMDQ_CREATE_SRQ_UNUSED11_MASK 0xffe0UL
1004 	#define CMDQ_CREATE_SRQ_UNUSED11_SFT  5
1005 	__le16	eventq_id;
1006 	#define CMDQ_CREATE_SRQ_EVENTQ_ID_MASK 0xfffUL
1007 	#define CMDQ_CREATE_SRQ_EVENTQ_ID_SFT 0
1008 	#define CMDQ_CREATE_SRQ_UNUSED4_MASK  0xf000UL
1009 	#define CMDQ_CREATE_SRQ_UNUSED4_SFT   12
1010 	__le16	srq_size;
1011 	__le16	srq_fwo;
1012 	__le32	dpi;
1013 	__le32	pd_id;
1014 	__le64	pbl;
1015 };
1016 
1017 /* creq_create_srq_resp (size:128b/16B) */
1018 struct creq_create_srq_resp {
1019 	u8	type;
1020 	#define CREQ_CREATE_SRQ_RESP_TYPE_MASK    0x3fUL
1021 	#define CREQ_CREATE_SRQ_RESP_TYPE_SFT     0
1022 	#define CREQ_CREATE_SRQ_RESP_TYPE_QP_EVENT  0x38UL
1023 	#define CREQ_CREATE_SRQ_RESP_TYPE_LAST     CREQ_CREATE_SRQ_RESP_TYPE_QP_EVENT
1024 	u8	status;
1025 	__le16	cookie;
1026 	__le32	xid;
1027 	u8	v;
1028 	#define CREQ_CREATE_SRQ_RESP_V     0x1UL
1029 	u8	event;
1030 	#define CREQ_CREATE_SRQ_RESP_EVENT_CREATE_SRQ 0x5UL
1031 	#define CREQ_CREATE_SRQ_RESP_EVENT_LAST      CREQ_CREATE_SRQ_RESP_EVENT_CREATE_SRQ
1032 	u8	reserved48[6];
1033 };
1034 
1035 /* cmdq_destroy_srq (size:192b/24B) */
1036 struct cmdq_destroy_srq {
1037 	u8	opcode;
1038 	#define CMDQ_DESTROY_SRQ_OPCODE_DESTROY_SRQ 0x6UL
1039 	#define CMDQ_DESTROY_SRQ_OPCODE_LAST       CMDQ_DESTROY_SRQ_OPCODE_DESTROY_SRQ
1040 	u8	cmd_size;
1041 	__le16	flags;
1042 	__le16	cookie;
1043 	u8	resp_size;
1044 	u8	reserved8;
1045 	__le64	resp_addr;
1046 	__le32	srq_cid;
1047 	__le32	unused_0;
1048 };
1049 
1050 /* creq_destroy_srq_resp (size:128b/16B) */
1051 struct creq_destroy_srq_resp {
1052 	u8	type;
1053 	#define CREQ_DESTROY_SRQ_RESP_TYPE_MASK    0x3fUL
1054 	#define CREQ_DESTROY_SRQ_RESP_TYPE_SFT     0
1055 	#define CREQ_DESTROY_SRQ_RESP_TYPE_QP_EVENT  0x38UL
1056 	#define CREQ_DESTROY_SRQ_RESP_TYPE_LAST     CREQ_DESTROY_SRQ_RESP_TYPE_QP_EVENT
1057 	u8	status;
1058 	__le16	cookie;
1059 	__le32	xid;
1060 	u8	v;
1061 	#define CREQ_DESTROY_SRQ_RESP_V     0x1UL
1062 	u8	event;
1063 	#define CREQ_DESTROY_SRQ_RESP_EVENT_DESTROY_SRQ 0x6UL
1064 	#define CREQ_DESTROY_SRQ_RESP_EVENT_LAST       CREQ_DESTROY_SRQ_RESP_EVENT_DESTROY_SRQ
1065 	__le16	enable_for_arm[3];
1066 	#define CREQ_DESTROY_SRQ_RESP_UNUSED0_MASK       0xffffUL
1067 	#define CREQ_DESTROY_SRQ_RESP_UNUSED0_SFT        0
1068 	#define CREQ_DESTROY_SRQ_RESP_ENABLE_FOR_ARM_MASK 0x30000UL
1069 	#define CREQ_DESTROY_SRQ_RESP_ENABLE_FOR_ARM_SFT 16
1070 };
1071 
1072 /* cmdq_query_srq (size:192b/24B) */
1073 struct cmdq_query_srq {
1074 	u8	opcode;
1075 	#define CMDQ_QUERY_SRQ_OPCODE_QUERY_SRQ 0x8UL
1076 	#define CMDQ_QUERY_SRQ_OPCODE_LAST     CMDQ_QUERY_SRQ_OPCODE_QUERY_SRQ
1077 	u8	cmd_size;
1078 	__le16	flags;
1079 	__le16	cookie;
1080 	u8	resp_size;
1081 	u8	reserved8;
1082 	__le64	resp_addr;
1083 	__le32	srq_cid;
1084 	__le32	unused_0;
1085 };
1086 
1087 /* creq_query_srq_resp (size:128b/16B) */
1088 struct creq_query_srq_resp {
1089 	u8	type;
1090 	#define CREQ_QUERY_SRQ_RESP_TYPE_MASK    0x3fUL
1091 	#define CREQ_QUERY_SRQ_RESP_TYPE_SFT     0
1092 	#define CREQ_QUERY_SRQ_RESP_TYPE_QP_EVENT  0x38UL
1093 	#define CREQ_QUERY_SRQ_RESP_TYPE_LAST     CREQ_QUERY_SRQ_RESP_TYPE_QP_EVENT
1094 	u8	status;
1095 	__le16	cookie;
1096 	__le32	size;
1097 	u8	v;
1098 	#define CREQ_QUERY_SRQ_RESP_V     0x1UL
1099 	u8	event;
1100 	#define CREQ_QUERY_SRQ_RESP_EVENT_QUERY_SRQ 0x8UL
1101 	#define CREQ_QUERY_SRQ_RESP_EVENT_LAST     CREQ_QUERY_SRQ_RESP_EVENT_QUERY_SRQ
1102 	u8	reserved48[6];
1103 };
1104 
1105 /* creq_query_srq_resp_sb (size:256b/32B) */
1106 struct creq_query_srq_resp_sb {
1107 	u8	opcode;
1108 	#define CREQ_QUERY_SRQ_RESP_SB_OPCODE_QUERY_SRQ 0x8UL
1109 	#define CREQ_QUERY_SRQ_RESP_SB_OPCODE_LAST     CREQ_QUERY_SRQ_RESP_SB_OPCODE_QUERY_SRQ
1110 	u8	status;
1111 	__le16	cookie;
1112 	__le16	flags;
1113 	u8	resp_size;
1114 	u8	reserved8;
1115 	__le32	xid;
1116 	__le16	srq_limit;
1117 	__le16	reserved16;
1118 	__le32	data[4];
1119 };
1120 
1121 /* cmdq_create_cq (size:384b/48B) */
1122 struct cmdq_create_cq {
1123 	u8	opcode;
1124 	#define CMDQ_CREATE_CQ_OPCODE_CREATE_CQ 0x9UL
1125 	#define CMDQ_CREATE_CQ_OPCODE_LAST     CMDQ_CREATE_CQ_OPCODE_CREATE_CQ
1126 	u8	cmd_size;
1127 	__le16	flags;
1128 	#define CMDQ_CREATE_CQ_FLAGS_DISABLE_CQ_OVERFLOW_DETECTION     0x1UL
1129 	__le16	cookie;
1130 	u8	resp_size;
1131 	u8	reserved8;
1132 	__le64	resp_addr;
1133 	__le64	cq_handle;
1134 	__le32	pg_size_lvl;
1135 	#define CMDQ_CREATE_CQ_LVL_MASK      0x3UL
1136 	#define CMDQ_CREATE_CQ_LVL_SFT       0
1137 	#define CMDQ_CREATE_CQ_LVL_LVL_0       0x0UL
1138 	#define CMDQ_CREATE_CQ_LVL_LVL_1       0x1UL
1139 	#define CMDQ_CREATE_CQ_LVL_LVL_2       0x2UL
1140 	#define CMDQ_CREATE_CQ_LVL_LAST       CMDQ_CREATE_CQ_LVL_LVL_2
1141 	#define CMDQ_CREATE_CQ_PG_SIZE_MASK  0x1cUL
1142 	#define CMDQ_CREATE_CQ_PG_SIZE_SFT   2
1143 	#define CMDQ_CREATE_CQ_PG_SIZE_PG_4K   (0x0UL << 2)
1144 	#define CMDQ_CREATE_CQ_PG_SIZE_PG_8K   (0x1UL << 2)
1145 	#define CMDQ_CREATE_CQ_PG_SIZE_PG_64K  (0x2UL << 2)
1146 	#define CMDQ_CREATE_CQ_PG_SIZE_PG_2M   (0x3UL << 2)
1147 	#define CMDQ_CREATE_CQ_PG_SIZE_PG_8M   (0x4UL << 2)
1148 	#define CMDQ_CREATE_CQ_PG_SIZE_PG_1G   (0x5UL << 2)
1149 	#define CMDQ_CREATE_CQ_PG_SIZE_LAST   CMDQ_CREATE_CQ_PG_SIZE_PG_1G
1150 	#define CMDQ_CREATE_CQ_UNUSED27_MASK 0xffffffe0UL
1151 	#define CMDQ_CREATE_CQ_UNUSED27_SFT  5
1152 	__le32	cq_fco_cnq_id;
1153 	#define CMDQ_CREATE_CQ_CNQ_ID_MASK 0xfffUL
1154 	#define CMDQ_CREATE_CQ_CNQ_ID_SFT 0
1155 	#define CMDQ_CREATE_CQ_CQ_FCO_MASK 0xfffff000UL
1156 	#define CMDQ_CREATE_CQ_CQ_FCO_SFT 12
1157 	__le32	dpi;
1158 	__le32	cq_size;
1159 	__le64	pbl;
1160 };
1161 
1162 /* creq_create_cq_resp (size:128b/16B) */
1163 struct creq_create_cq_resp {
1164 	u8	type;
1165 	#define CREQ_CREATE_CQ_RESP_TYPE_MASK    0x3fUL
1166 	#define CREQ_CREATE_CQ_RESP_TYPE_SFT     0
1167 	#define CREQ_CREATE_CQ_RESP_TYPE_QP_EVENT  0x38UL
1168 	#define CREQ_CREATE_CQ_RESP_TYPE_LAST     CREQ_CREATE_CQ_RESP_TYPE_QP_EVENT
1169 	u8	status;
1170 	__le16	cookie;
1171 	__le32	xid;
1172 	u8	v;
1173 	#define CREQ_CREATE_CQ_RESP_V     0x1UL
1174 	u8	event;
1175 	#define CREQ_CREATE_CQ_RESP_EVENT_CREATE_CQ 0x9UL
1176 	#define CREQ_CREATE_CQ_RESP_EVENT_LAST     CREQ_CREATE_CQ_RESP_EVENT_CREATE_CQ
1177 	u8	reserved48[6];
1178 };
1179 
1180 /* cmdq_destroy_cq (size:192b/24B) */
1181 struct cmdq_destroy_cq {
1182 	u8	opcode;
1183 	#define CMDQ_DESTROY_CQ_OPCODE_DESTROY_CQ 0xaUL
1184 	#define CMDQ_DESTROY_CQ_OPCODE_LAST      CMDQ_DESTROY_CQ_OPCODE_DESTROY_CQ
1185 	u8	cmd_size;
1186 	__le16	flags;
1187 	__le16	cookie;
1188 	u8	resp_size;
1189 	u8	reserved8;
1190 	__le64	resp_addr;
1191 	__le32	cq_cid;
1192 	__le32	unused_0;
1193 };
1194 
1195 /* creq_destroy_cq_resp (size:128b/16B) */
1196 struct creq_destroy_cq_resp {
1197 	u8	type;
1198 	#define CREQ_DESTROY_CQ_RESP_TYPE_MASK    0x3fUL
1199 	#define CREQ_DESTROY_CQ_RESP_TYPE_SFT     0
1200 	#define CREQ_DESTROY_CQ_RESP_TYPE_QP_EVENT  0x38UL
1201 	#define CREQ_DESTROY_CQ_RESP_TYPE_LAST     CREQ_DESTROY_CQ_RESP_TYPE_QP_EVENT
1202 	u8	status;
1203 	__le16	cookie;
1204 	__le32	xid;
1205 	u8	v;
1206 	#define CREQ_DESTROY_CQ_RESP_V     0x1UL
1207 	u8	event;
1208 	#define CREQ_DESTROY_CQ_RESP_EVENT_DESTROY_CQ 0xaUL
1209 	#define CREQ_DESTROY_CQ_RESP_EVENT_LAST      CREQ_DESTROY_CQ_RESP_EVENT_DESTROY_CQ
1210 	__le16	cq_arm_lvl;
1211 	#define CREQ_DESTROY_CQ_RESP_CQ_ARM_LVL_MASK 0x3UL
1212 	#define CREQ_DESTROY_CQ_RESP_CQ_ARM_LVL_SFT 0
1213 	__le16	total_cnq_events;
1214 	__le16	reserved16;
1215 };
1216 
1217 /* cmdq_resize_cq (size:320b/40B) */
1218 struct cmdq_resize_cq {
1219 	u8	opcode;
1220 	#define CMDQ_RESIZE_CQ_OPCODE_RESIZE_CQ 0xcUL
1221 	#define CMDQ_RESIZE_CQ_OPCODE_LAST     CMDQ_RESIZE_CQ_OPCODE_RESIZE_CQ
1222 	u8	cmd_size;
1223 	__le16	flags;
1224 	__le16	cookie;
1225 	u8	resp_size;
1226 	u8	reserved8;
1227 	__le64	resp_addr;
1228 	__le32	cq_cid;
1229 	__le32	new_cq_size_pg_size_lvl;
1230 	#define CMDQ_RESIZE_CQ_LVL_MASK        0x3UL
1231 	#define CMDQ_RESIZE_CQ_LVL_SFT         0
1232 	#define CMDQ_RESIZE_CQ_LVL_LVL_0         0x0UL
1233 	#define CMDQ_RESIZE_CQ_LVL_LVL_1         0x1UL
1234 	#define CMDQ_RESIZE_CQ_LVL_LVL_2         0x2UL
1235 	#define CMDQ_RESIZE_CQ_LVL_LAST         CMDQ_RESIZE_CQ_LVL_LVL_2
1236 	#define CMDQ_RESIZE_CQ_PG_SIZE_MASK    0x1cUL
1237 	#define CMDQ_RESIZE_CQ_PG_SIZE_SFT     2
1238 	#define CMDQ_RESIZE_CQ_PG_SIZE_PG_4K     (0x0UL << 2)
1239 	#define CMDQ_RESIZE_CQ_PG_SIZE_PG_8K     (0x1UL << 2)
1240 	#define CMDQ_RESIZE_CQ_PG_SIZE_PG_64K    (0x2UL << 2)
1241 	#define CMDQ_RESIZE_CQ_PG_SIZE_PG_2M     (0x3UL << 2)
1242 	#define CMDQ_RESIZE_CQ_PG_SIZE_PG_8M     (0x4UL << 2)
1243 	#define CMDQ_RESIZE_CQ_PG_SIZE_PG_1G     (0x5UL << 2)
1244 	#define CMDQ_RESIZE_CQ_PG_SIZE_LAST     CMDQ_RESIZE_CQ_PG_SIZE_PG_1G
1245 	#define CMDQ_RESIZE_CQ_NEW_CQ_SIZE_MASK 0x1fffffe0UL
1246 	#define CMDQ_RESIZE_CQ_NEW_CQ_SIZE_SFT 5
1247 	__le64	new_pbl;
1248 	__le32	new_cq_fco;
1249 	__le32	unused_0;
1250 };
1251 
1252 /* creq_resize_cq_resp (size:128b/16B) */
1253 struct creq_resize_cq_resp {
1254 	u8	type;
1255 	#define CREQ_RESIZE_CQ_RESP_TYPE_MASK    0x3fUL
1256 	#define CREQ_RESIZE_CQ_RESP_TYPE_SFT     0
1257 	#define CREQ_RESIZE_CQ_RESP_TYPE_QP_EVENT  0x38UL
1258 	#define CREQ_RESIZE_CQ_RESP_TYPE_LAST     CREQ_RESIZE_CQ_RESP_TYPE_QP_EVENT
1259 	u8	status;
1260 	__le16	cookie;
1261 	__le32	xid;
1262 	u8	v;
1263 	#define CREQ_RESIZE_CQ_RESP_V     0x1UL
1264 	u8	event;
1265 	#define CREQ_RESIZE_CQ_RESP_EVENT_RESIZE_CQ 0xcUL
1266 	#define CREQ_RESIZE_CQ_RESP_EVENT_LAST     CREQ_RESIZE_CQ_RESP_EVENT_RESIZE_CQ
1267 	u8	reserved48[6];
1268 };
1269 
1270 /* cmdq_allocate_mrw (size:256b/32B) */
1271 struct cmdq_allocate_mrw {
1272 	u8	opcode;
1273 	#define CMDQ_ALLOCATE_MRW_OPCODE_ALLOCATE_MRW 0xdUL
1274 	#define CMDQ_ALLOCATE_MRW_OPCODE_LAST        CMDQ_ALLOCATE_MRW_OPCODE_ALLOCATE_MRW
1275 	u8	cmd_size;
1276 	__le16	flags;
1277 	__le16	cookie;
1278 	u8	resp_size;
1279 	u8	reserved8;
1280 	__le64	resp_addr;
1281 	__le64	mrw_handle;
1282 	u8	mrw_flags;
1283 	#define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MASK     0xfUL
1284 	#define CMDQ_ALLOCATE_MRW_MRW_FLAGS_SFT      0
1285 	#define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MR         0x0UL
1286 	#define CMDQ_ALLOCATE_MRW_MRW_FLAGS_PMR        0x1UL
1287 	#define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE1   0x2UL
1288 	#define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A  0x3UL
1289 	#define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B  0x4UL
1290 	#define CMDQ_ALLOCATE_MRW_MRW_FLAGS_LAST      CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B
1291 	#define CMDQ_ALLOCATE_MRW_UNUSED4_MASK       0xf0UL
1292 	#define CMDQ_ALLOCATE_MRW_UNUSED4_SFT        4
1293 	u8	access;
1294 	#define CMDQ_ALLOCATE_MRW_ACCESS_CONSUMER_OWNED_KEY     0x20UL
1295 	__le16	unused16;
1296 	__le32	pd_id;
1297 };
1298 
1299 /* creq_allocate_mrw_resp (size:128b/16B) */
1300 struct creq_allocate_mrw_resp {
1301 	u8	type;
1302 	#define CREQ_ALLOCATE_MRW_RESP_TYPE_MASK    0x3fUL
1303 	#define CREQ_ALLOCATE_MRW_RESP_TYPE_SFT     0
1304 	#define CREQ_ALLOCATE_MRW_RESP_TYPE_QP_EVENT  0x38UL
1305 	#define CREQ_ALLOCATE_MRW_RESP_TYPE_LAST     CREQ_ALLOCATE_MRW_RESP_TYPE_QP_EVENT
1306 	u8	status;
1307 	__le16	cookie;
1308 	__le32	xid;
1309 	u8	v;
1310 	#define CREQ_ALLOCATE_MRW_RESP_V     0x1UL
1311 	u8	event;
1312 	#define CREQ_ALLOCATE_MRW_RESP_EVENT_ALLOCATE_MRW 0xdUL
1313 	#define CREQ_ALLOCATE_MRW_RESP_EVENT_LAST        CREQ_ALLOCATE_MRW_RESP_EVENT_ALLOCATE_MRW
1314 	u8	reserved48[6];
1315 };
1316 
1317 /* cmdq_deallocate_key (size:192b/24B) */
1318 struct cmdq_deallocate_key {
1319 	u8	opcode;
1320 	#define CMDQ_DEALLOCATE_KEY_OPCODE_DEALLOCATE_KEY 0xeUL
1321 	#define CMDQ_DEALLOCATE_KEY_OPCODE_LAST          CMDQ_DEALLOCATE_KEY_OPCODE_DEALLOCATE_KEY
1322 	u8	cmd_size;
1323 	__le16	flags;
1324 	__le16	cookie;
1325 	u8	resp_size;
1326 	u8	reserved8;
1327 	__le64	resp_addr;
1328 	u8	mrw_flags;
1329 	#define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MASK     0xfUL
1330 	#define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_SFT      0
1331 	#define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MR         0x0UL
1332 	#define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_PMR        0x1UL
1333 	#define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MW_TYPE1   0x2UL
1334 	#define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MW_TYPE2A  0x3UL
1335 	#define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MW_TYPE2B  0x4UL
1336 	#define CMDQ_DEALLOCATE_KEY_MRW_FLAGS_LAST      CMDQ_DEALLOCATE_KEY_MRW_FLAGS_MW_TYPE2B
1337 	#define CMDQ_DEALLOCATE_KEY_UNUSED4_MASK       0xf0UL
1338 	#define CMDQ_DEALLOCATE_KEY_UNUSED4_SFT        4
1339 	u8	unused24[3];
1340 	__le32	key;
1341 };
1342 
1343 /* creq_deallocate_key_resp (size:128b/16B) */
1344 struct creq_deallocate_key_resp {
1345 	u8	type;
1346 	#define CREQ_DEALLOCATE_KEY_RESP_TYPE_MASK    0x3fUL
1347 	#define CREQ_DEALLOCATE_KEY_RESP_TYPE_SFT     0
1348 	#define CREQ_DEALLOCATE_KEY_RESP_TYPE_QP_EVENT  0x38UL
1349 	#define CREQ_DEALLOCATE_KEY_RESP_TYPE_LAST     CREQ_DEALLOCATE_KEY_RESP_TYPE_QP_EVENT
1350 	u8	status;
1351 	__le16	cookie;
1352 	__le32	xid;
1353 	u8	v;
1354 	#define CREQ_DEALLOCATE_KEY_RESP_V     0x1UL
1355 	u8	event;
1356 	#define CREQ_DEALLOCATE_KEY_RESP_EVENT_DEALLOCATE_KEY 0xeUL
1357 	#define CREQ_DEALLOCATE_KEY_RESP_EVENT_LAST CREQ_DEALLOCATE_KEY_RESP_EVENT_DEALLOCATE_KEY
1358 	__le16	reserved16;
1359 	__le32	bound_window_info;
1360 };
1361 
1362 /* cmdq_register_mr (size:384b/48B) */
1363 struct cmdq_register_mr {
1364 	u8	opcode;
1365 	#define CMDQ_REGISTER_MR_OPCODE_REGISTER_MR 0xfUL
1366 	#define CMDQ_REGISTER_MR_OPCODE_LAST       CMDQ_REGISTER_MR_OPCODE_REGISTER_MR
1367 	u8	cmd_size;
1368 	__le16	flags;
1369 	#define CMDQ_REGISTER_MR_FLAGS_ALLOC_MR     0x1UL
1370 	__le16	cookie;
1371 	u8	resp_size;
1372 	u8	reserved8;
1373 	__le64	resp_addr;
1374 	u8	log2_pg_size_lvl;
1375 	#define CMDQ_REGISTER_MR_LVL_MASK            0x3UL
1376 	#define CMDQ_REGISTER_MR_LVL_SFT             0
1377 	#define CMDQ_REGISTER_MR_LVL_LVL_0             0x0UL
1378 	#define CMDQ_REGISTER_MR_LVL_LVL_1             0x1UL
1379 	#define CMDQ_REGISTER_MR_LVL_LVL_2             0x2UL
1380 	#define CMDQ_REGISTER_MR_LVL_LAST             CMDQ_REGISTER_MR_LVL_LVL_2
1381 	#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_MASK   0x7cUL
1382 	#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_SFT    2
1383 	#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_4K    (0xcUL << 2)
1384 	#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_8K    (0xdUL << 2)
1385 	#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_64K   (0x10UL << 2)
1386 	#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_256K  (0x12UL << 2)
1387 	#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_1M    (0x14UL << 2)
1388 	#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_2M    (0x15UL << 2)
1389 	#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_4M    (0x16UL << 2)
1390 	#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_1G    (0x1eUL << 2)
1391 	#define CMDQ_REGISTER_MR_LOG2_PG_SIZE_LAST    CMDQ_REGISTER_MR_LOG2_PG_SIZE_PG_1G
1392 	#define CMDQ_REGISTER_MR_UNUSED1             0x80UL
1393 	u8	access;
1394 	#define CMDQ_REGISTER_MR_ACCESS_LOCAL_WRITE       0x1UL
1395 	#define CMDQ_REGISTER_MR_ACCESS_REMOTE_READ       0x2UL
1396 	#define CMDQ_REGISTER_MR_ACCESS_REMOTE_WRITE      0x4UL
1397 	#define CMDQ_REGISTER_MR_ACCESS_REMOTE_ATOMIC     0x8UL
1398 	#define CMDQ_REGISTER_MR_ACCESS_MW_BIND           0x10UL
1399 	#define CMDQ_REGISTER_MR_ACCESS_ZERO_BASED        0x20UL
1400 	__le16	log2_pbl_pg_size;
1401 	#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_MASK   0x1fUL
1402 	#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_SFT    0
1403 	#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_4K    0xcUL
1404 	#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_8K    0xdUL
1405 	#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_64K   0x10UL
1406 	#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_256K  0x12UL
1407 	#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_1M    0x14UL
1408 	#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_2M    0x15UL
1409 	#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_4M    0x16UL
1410 	#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_1G    0x1eUL
1411 	#define CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_LAST    CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_PG_1G
1412 	#define CMDQ_REGISTER_MR_UNUSED11_MASK           0xffe0UL
1413 	#define CMDQ_REGISTER_MR_UNUSED11_SFT            5
1414 	__le32	key;
1415 	__le64	pbl;
1416 	__le64	va;
1417 	__le64	mr_size;
1418 };
1419 
1420 /* creq_register_mr_resp (size:128b/16B) */
1421 struct creq_register_mr_resp {
1422 	u8	type;
1423 	#define CREQ_REGISTER_MR_RESP_TYPE_MASK    0x3fUL
1424 	#define CREQ_REGISTER_MR_RESP_TYPE_SFT     0
1425 	#define CREQ_REGISTER_MR_RESP_TYPE_QP_EVENT  0x38UL
1426 	#define CREQ_REGISTER_MR_RESP_TYPE_LAST     CREQ_REGISTER_MR_RESP_TYPE_QP_EVENT
1427 	u8	status;
1428 	__le16	cookie;
1429 	__le32	xid;
1430 	u8	v;
1431 	#define CREQ_REGISTER_MR_RESP_V     0x1UL
1432 	u8	event;
1433 	#define CREQ_REGISTER_MR_RESP_EVENT_REGISTER_MR 0xfUL
1434 	#define CREQ_REGISTER_MR_RESP_EVENT_LAST       CREQ_REGISTER_MR_RESP_EVENT_REGISTER_MR
1435 	u8	reserved48[6];
1436 };
1437 
1438 /* cmdq_deregister_mr (size:192b/24B) */
1439 struct cmdq_deregister_mr {
1440 	u8	opcode;
1441 	#define CMDQ_DEREGISTER_MR_OPCODE_DEREGISTER_MR 0x10UL
1442 	#define CMDQ_DEREGISTER_MR_OPCODE_LAST         CMDQ_DEREGISTER_MR_OPCODE_DEREGISTER_MR
1443 	u8	cmd_size;
1444 	__le16	flags;
1445 	__le16	cookie;
1446 	u8	resp_size;
1447 	u8	reserved8;
1448 	__le64	resp_addr;
1449 	__le32	lkey;
1450 	__le32	unused_0;
1451 };
1452 
1453 /* creq_deregister_mr_resp (size:128b/16B) */
1454 struct creq_deregister_mr_resp {
1455 	u8	type;
1456 	#define CREQ_DEREGISTER_MR_RESP_TYPE_MASK    0x3fUL
1457 	#define CREQ_DEREGISTER_MR_RESP_TYPE_SFT     0
1458 	#define CREQ_DEREGISTER_MR_RESP_TYPE_QP_EVENT  0x38UL
1459 	#define CREQ_DEREGISTER_MR_RESP_TYPE_LAST     CREQ_DEREGISTER_MR_RESP_TYPE_QP_EVENT
1460 	u8	status;
1461 	__le16	cookie;
1462 	__le32	xid;
1463 	u8	v;
1464 	#define CREQ_DEREGISTER_MR_RESP_V     0x1UL
1465 	u8	event;
1466 	#define CREQ_DEREGISTER_MR_RESP_EVENT_DEREGISTER_MR 0x10UL
1467 	#define CREQ_DEREGISTER_MR_RESP_EVENT_LAST CREQ_DEREGISTER_MR_RESP_EVENT_DEREGISTER_MR
1468 	__le16	reserved16;
1469 	__le32	bound_windows;
1470 };
1471 
1472 /* cmdq_add_gid (size:384b/48B) */
1473 struct cmdq_add_gid {
1474 	u8	opcode;
1475 	#define CMDQ_ADD_GID_OPCODE_ADD_GID 0x11UL
1476 	#define CMDQ_ADD_GID_OPCODE_LAST   CMDQ_ADD_GID_OPCODE_ADD_GID
1477 	u8	cmd_size;
1478 	__le16	flags;
1479 	__le16	cookie;
1480 	u8	resp_size;
1481 	u8	reserved8;
1482 	__le64	resp_addr;
1483 	__be32	gid[4];
1484 	__be16	src_mac[3];
1485 	__le16	vlan;
1486 	#define CMDQ_ADD_GID_VLAN_VLAN_EN_TPID_VLAN_ID_MASK          0xffffUL
1487 	#define CMDQ_ADD_GID_VLAN_VLAN_EN_TPID_VLAN_ID_SFT           0
1488 	#define CMDQ_ADD_GID_VLAN_VLAN_ID_MASK                       0xfffUL
1489 	#define CMDQ_ADD_GID_VLAN_VLAN_ID_SFT                        0
1490 	#define CMDQ_ADD_GID_VLAN_TPID_MASK                          0x7000UL
1491 	#define CMDQ_ADD_GID_VLAN_TPID_SFT                           12
1492 	#define CMDQ_ADD_GID_VLAN_TPID_TPID_88A8                       (0x0UL << 12)
1493 	#define CMDQ_ADD_GID_VLAN_TPID_TPID_8100                       (0x1UL << 12)
1494 	#define CMDQ_ADD_GID_VLAN_TPID_TPID_9100                       (0x2UL << 12)
1495 	#define CMDQ_ADD_GID_VLAN_TPID_TPID_9200                       (0x3UL << 12)
1496 	#define CMDQ_ADD_GID_VLAN_TPID_TPID_9300                       (0x4UL << 12)
1497 	#define CMDQ_ADD_GID_VLAN_TPID_TPID_CFG1                       (0x5UL << 12)
1498 	#define CMDQ_ADD_GID_VLAN_TPID_TPID_CFG2                       (0x6UL << 12)
1499 	#define CMDQ_ADD_GID_VLAN_TPID_TPID_CFG3                       (0x7UL << 12)
1500 	#define CMDQ_ADD_GID_VLAN_TPID_LAST CMDQ_ADD_GID_VLAN_TPID_TPID_CFG3
1501 	#define CMDQ_ADD_GID_VLAN_VLAN_EN                            0x8000UL
1502 	__le16	ipid;
1503 	__le16	stats_ctx;
1504 	#define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_VALID_STATS_CTX_ID_MASK                0xffffUL
1505 	#define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_VALID_STATS_CTX_ID_SFT                 0
1506 	#define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_ID_MASK                                0x7fffUL
1507 	#define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_ID_SFT                                 0
1508 	#define CMDQ_ADD_GID_STATS_CTX_STATS_CTX_VALID                                  0x8000UL
1509 	__le32	unused_0;
1510 };
1511 
1512 /* creq_add_gid_resp (size:128b/16B) */
1513 struct creq_add_gid_resp {
1514 	u8	type;
1515 	#define CREQ_ADD_GID_RESP_TYPE_MASK    0x3fUL
1516 	#define CREQ_ADD_GID_RESP_TYPE_SFT     0
1517 	#define CREQ_ADD_GID_RESP_TYPE_QP_EVENT  0x38UL
1518 	#define CREQ_ADD_GID_RESP_TYPE_LAST     CREQ_ADD_GID_RESP_TYPE_QP_EVENT
1519 	u8	status;
1520 	__le16	cookie;
1521 	__le32	xid;
1522 	u8	v;
1523 	#define CREQ_ADD_GID_RESP_V     0x1UL
1524 	u8	event;
1525 	#define CREQ_ADD_GID_RESP_EVENT_ADD_GID 0x11UL
1526 	#define CREQ_ADD_GID_RESP_EVENT_LAST   CREQ_ADD_GID_RESP_EVENT_ADD_GID
1527 	u8	reserved48[6];
1528 };
1529 
1530 /* cmdq_delete_gid (size:192b/24B) */
1531 struct cmdq_delete_gid {
1532 	u8	opcode;
1533 	#define CMDQ_DELETE_GID_OPCODE_DELETE_GID 0x12UL
1534 	#define CMDQ_DELETE_GID_OPCODE_LAST      CMDQ_DELETE_GID_OPCODE_DELETE_GID
1535 	u8	cmd_size;
1536 	__le16	flags;
1537 	__le16	cookie;
1538 	u8	resp_size;
1539 	u8	reserved8;
1540 	__le64	resp_addr;
1541 	__le16	gid_index;
1542 	u8	unused_0[6];
1543 };
1544 
1545 /* creq_delete_gid_resp (size:128b/16B) */
1546 struct creq_delete_gid_resp {
1547 	u8	type;
1548 	#define CREQ_DELETE_GID_RESP_TYPE_MASK    0x3fUL
1549 	#define CREQ_DELETE_GID_RESP_TYPE_SFT     0
1550 	#define CREQ_DELETE_GID_RESP_TYPE_QP_EVENT  0x38UL
1551 	#define CREQ_DELETE_GID_RESP_TYPE_LAST     CREQ_DELETE_GID_RESP_TYPE_QP_EVENT
1552 	u8	status;
1553 	__le16	cookie;
1554 	__le32	xid;
1555 	u8	v;
1556 	#define CREQ_DELETE_GID_RESP_V     0x1UL
1557 	u8	event;
1558 	#define CREQ_DELETE_GID_RESP_EVENT_DELETE_GID 0x12UL
1559 	#define CREQ_DELETE_GID_RESP_EVENT_LAST      CREQ_DELETE_GID_RESP_EVENT_DELETE_GID
1560 	u8	reserved48[6];
1561 };
1562 
1563 /* cmdq_modify_gid (size:384b/48B) */
1564 struct cmdq_modify_gid {
1565 	u8	opcode;
1566 	#define CMDQ_MODIFY_GID_OPCODE_MODIFY_GID 0x17UL
1567 	#define CMDQ_MODIFY_GID_OPCODE_LAST      CMDQ_MODIFY_GID_OPCODE_MODIFY_GID
1568 	u8	cmd_size;
1569 	__le16	flags;
1570 	__le16	cookie;
1571 	u8	resp_size;
1572 	u8	reserved8;
1573 	__le64	resp_addr;
1574 	__be32	gid[4];
1575 	__be16	src_mac[3];
1576 	__le16	vlan;
1577 	#define CMDQ_MODIFY_GID_VLAN_VLAN_ID_MASK  0xfffUL
1578 	#define CMDQ_MODIFY_GID_VLAN_VLAN_ID_SFT   0
1579 	#define CMDQ_MODIFY_GID_VLAN_TPID_MASK     0x7000UL
1580 	#define CMDQ_MODIFY_GID_VLAN_TPID_SFT      12
1581 	#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_88A8  (0x0UL << 12)
1582 	#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_8100  (0x1UL << 12)
1583 	#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_9100  (0x2UL << 12)
1584 	#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_9200  (0x3UL << 12)
1585 	#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_9300  (0x4UL << 12)
1586 	#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG1  (0x5UL << 12)
1587 	#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG2  (0x6UL << 12)
1588 	#define CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG3  (0x7UL << 12)
1589 	#define CMDQ_MODIFY_GID_VLAN_TPID_LAST      CMDQ_MODIFY_GID_VLAN_TPID_TPID_CFG3
1590 	#define CMDQ_MODIFY_GID_VLAN_VLAN_EN       0x8000UL
1591 	__le16	ipid;
1592 	__le16	gid_index;
1593 	__le16	stats_ctx;
1594 	#define CMDQ_MODIFY_GID_STATS_CTX_STATS_CTX_ID_MASK   0x7fffUL
1595 	#define CMDQ_MODIFY_GID_STATS_CTX_STATS_CTX_ID_SFT    0
1596 	#define CMDQ_MODIFY_GID_STATS_CTX_STATS_CTX_VALID     0x8000UL
1597 	__le16	unused_0;
1598 };
1599 
1600 /* creq_modify_gid_resp (size:128b/16B) */
1601 struct creq_modify_gid_resp {
1602 	u8	type;
1603 	#define CREQ_MODIFY_GID_RESP_TYPE_MASK    0x3fUL
1604 	#define CREQ_MODIFY_GID_RESP_TYPE_SFT     0
1605 	#define CREQ_MODIFY_GID_RESP_TYPE_QP_EVENT  0x38UL
1606 	#define CREQ_MODIFY_GID_RESP_TYPE_LAST     CREQ_MODIFY_GID_RESP_TYPE_QP_EVENT
1607 	u8	status;
1608 	__le16	cookie;
1609 	__le32	xid;
1610 	u8	v;
1611 	#define CREQ_MODIFY_GID_RESP_V     0x1UL
1612 	u8	event;
1613 	#define CREQ_MODIFY_GID_RESP_EVENT_ADD_GID 0x11UL
1614 	#define CREQ_MODIFY_GID_RESP_EVENT_LAST   CREQ_MODIFY_GID_RESP_EVENT_ADD_GID
1615 	u8	reserved48[6];
1616 };
1617 
1618 /* cmdq_query_gid (size:192b/24B) */
1619 struct cmdq_query_gid {
1620 	u8	opcode;
1621 	#define CMDQ_QUERY_GID_OPCODE_QUERY_GID 0x18UL
1622 	#define CMDQ_QUERY_GID_OPCODE_LAST     CMDQ_QUERY_GID_OPCODE_QUERY_GID
1623 	u8	cmd_size;
1624 	__le16	flags;
1625 	__le16	cookie;
1626 	u8	resp_size;
1627 	u8	reserved8;
1628 	__le64	resp_addr;
1629 	__le16	gid_index;
1630 	u8	unused16[6];
1631 };
1632 
1633 /* creq_query_gid_resp (size:128b/16B) */
1634 struct creq_query_gid_resp {
1635 	u8	type;
1636 	#define CREQ_QUERY_GID_RESP_TYPE_MASK    0x3fUL
1637 	#define CREQ_QUERY_GID_RESP_TYPE_SFT     0
1638 	#define CREQ_QUERY_GID_RESP_TYPE_QP_EVENT  0x38UL
1639 	#define CREQ_QUERY_GID_RESP_TYPE_LAST     CREQ_QUERY_GID_RESP_TYPE_QP_EVENT
1640 	u8	status;
1641 	__le16	cookie;
1642 	__le32	size;
1643 	u8	v;
1644 	#define CREQ_QUERY_GID_RESP_V     0x1UL
1645 	u8	event;
1646 	#define CREQ_QUERY_GID_RESP_EVENT_QUERY_GID 0x18UL
1647 	#define CREQ_QUERY_GID_RESP_EVENT_LAST     CREQ_QUERY_GID_RESP_EVENT_QUERY_GID
1648 	u8	reserved48[6];
1649 };
1650 
1651 /* creq_query_gid_resp_sb (size:320b/40B) */
1652 struct creq_query_gid_resp_sb {
1653 	u8	opcode;
1654 	#define CREQ_QUERY_GID_RESP_SB_OPCODE_QUERY_GID 0x18UL
1655 	#define CREQ_QUERY_GID_RESP_SB_OPCODE_LAST     CREQ_QUERY_GID_RESP_SB_OPCODE_QUERY_GID
1656 	u8	status;
1657 	__le16	cookie;
1658 	__le16	flags;
1659 	u8	resp_size;
1660 	u8	reserved8;
1661 	__le32	gid[4];
1662 	__le16	src_mac[3];
1663 	__le16	vlan;
1664 	#define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_EN_TPID_VLAN_ID_MASK          0xffffUL
1665 	#define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_EN_TPID_VLAN_ID_SFT           0
1666 	#define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_ID_MASK                       0xfffUL
1667 	#define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_ID_SFT                        0
1668 	#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_MASK                          0x7000UL
1669 	#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_SFT                           12
1670 	#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_88A8                       (0x0UL << 12)
1671 	#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_8100                       (0x1UL << 12)
1672 	#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_9100                       (0x2UL << 12)
1673 	#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_9200                       (0x3UL << 12)
1674 	#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_9300                       (0x4UL << 12)
1675 	#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG1                       (0x5UL << 12)
1676 	#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG2                       (0x6UL << 12)
1677 	#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG3                       (0x7UL << 12)
1678 	#define CREQ_QUERY_GID_RESP_SB_VLAN_TPID_LAST CREQ_QUERY_GID_RESP_SB_VLAN_TPID_TPID_CFG3
1679 	#define CREQ_QUERY_GID_RESP_SB_VLAN_VLAN_EN                            0x8000UL
1680 	__le16	ipid;
1681 	__le16	gid_index;
1682 	__le32	unused_0;
1683 };
1684 
1685 /* cmdq_create_qp1 (size:640b/80B) */
1686 struct cmdq_create_qp1 {
1687 	u8	opcode;
1688 	#define CMDQ_CREATE_QP1_OPCODE_CREATE_QP1 0x13UL
1689 	#define CMDQ_CREATE_QP1_OPCODE_LAST      CMDQ_CREATE_QP1_OPCODE_CREATE_QP1
1690 	u8	cmd_size;
1691 	__le16	flags;
1692 	__le16	cookie;
1693 	u8	resp_size;
1694 	u8	reserved8;
1695 	__le64	resp_addr;
1696 	__le64	qp_handle;
1697 	__le32	qp_flags;
1698 	#define CMDQ_CREATE_QP1_QP_FLAGS_SRQ_USED             0x1UL
1699 	#define CMDQ_CREATE_QP1_QP_FLAGS_FORCE_COMPLETION     0x2UL
1700 	#define CMDQ_CREATE_QP1_QP_FLAGS_RESERVED_LKEY_ENABLE 0x4UL
1701 	#define CMDQ_CREATE_QP1_QP_FLAGS_LAST     CMDQ_CREATE_QP1_QP_FLAGS_RESERVED_LKEY_ENABLE
1702 	u8	type;
1703 	#define CMDQ_CREATE_QP1_TYPE_GSI 0x1UL
1704 	#define CMDQ_CREATE_QP1_TYPE_LAST CMDQ_CREATE_QP1_TYPE_GSI
1705 	u8	sq_pg_size_sq_lvl;
1706 	#define CMDQ_CREATE_QP1_SQ_LVL_MASK      0xfUL
1707 	#define CMDQ_CREATE_QP1_SQ_LVL_SFT       0
1708 	#define CMDQ_CREATE_QP1_SQ_LVL_LVL_0       0x0UL
1709 	#define CMDQ_CREATE_QP1_SQ_LVL_LVL_1       0x1UL
1710 	#define CMDQ_CREATE_QP1_SQ_LVL_LVL_2       0x2UL
1711 	#define CMDQ_CREATE_QP1_SQ_LVL_LAST       CMDQ_CREATE_QP1_SQ_LVL_LVL_2
1712 	#define CMDQ_CREATE_QP1_SQ_PG_SIZE_MASK  0xf0UL
1713 	#define CMDQ_CREATE_QP1_SQ_PG_SIZE_SFT   4
1714 	#define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_4K   (0x0UL << 4)
1715 	#define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_8K   (0x1UL << 4)
1716 	#define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_64K  (0x2UL << 4)
1717 	#define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_2M   (0x3UL << 4)
1718 	#define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_8M   (0x4UL << 4)
1719 	#define CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_1G   (0x5UL << 4)
1720 	#define CMDQ_CREATE_QP1_SQ_PG_SIZE_LAST   CMDQ_CREATE_QP1_SQ_PG_SIZE_PG_1G
1721 	u8	rq_pg_size_rq_lvl;
1722 	#define CMDQ_CREATE_QP1_RQ_LVL_MASK      0xfUL
1723 	#define CMDQ_CREATE_QP1_RQ_LVL_SFT       0
1724 	#define CMDQ_CREATE_QP1_RQ_LVL_LVL_0       0x0UL
1725 	#define CMDQ_CREATE_QP1_RQ_LVL_LVL_1       0x1UL
1726 	#define CMDQ_CREATE_QP1_RQ_LVL_LVL_2       0x2UL
1727 	#define CMDQ_CREATE_QP1_RQ_LVL_LAST       CMDQ_CREATE_QP1_RQ_LVL_LVL_2
1728 	#define CMDQ_CREATE_QP1_RQ_PG_SIZE_MASK  0xf0UL
1729 	#define CMDQ_CREATE_QP1_RQ_PG_SIZE_SFT   4
1730 	#define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_4K   (0x0UL << 4)
1731 	#define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_8K   (0x1UL << 4)
1732 	#define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_64K  (0x2UL << 4)
1733 	#define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_2M   (0x3UL << 4)
1734 	#define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_8M   (0x4UL << 4)
1735 	#define CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_1G   (0x5UL << 4)
1736 	#define CMDQ_CREATE_QP1_RQ_PG_SIZE_LAST   CMDQ_CREATE_QP1_RQ_PG_SIZE_PG_1G
1737 	u8	unused_0;
1738 	__le32	dpi;
1739 	__le32	sq_size;
1740 	__le32	rq_size;
1741 	__le16	sq_fwo_sq_sge;
1742 	#define CMDQ_CREATE_QP1_SQ_SGE_MASK 0xfUL
1743 	#define CMDQ_CREATE_QP1_SQ_SGE_SFT 0
1744 	#define CMDQ_CREATE_QP1_SQ_FWO_MASK 0xfff0UL
1745 	#define CMDQ_CREATE_QP1_SQ_FWO_SFT 4
1746 	__le16	rq_fwo_rq_sge;
1747 	#define CMDQ_CREATE_QP1_RQ_SGE_MASK 0xfUL
1748 	#define CMDQ_CREATE_QP1_RQ_SGE_SFT 0
1749 	#define CMDQ_CREATE_QP1_RQ_FWO_MASK 0xfff0UL
1750 	#define CMDQ_CREATE_QP1_RQ_FWO_SFT 4
1751 	__le32	scq_cid;
1752 	__le32	rcq_cid;
1753 	__le32	srq_cid;
1754 	__le32	pd_id;
1755 	__le64	sq_pbl;
1756 	__le64	rq_pbl;
1757 };
1758 
1759 /* creq_create_qp1_resp (size:128b/16B) */
1760 struct creq_create_qp1_resp {
1761 	u8	type;
1762 	#define CREQ_CREATE_QP1_RESP_TYPE_MASK    0x3fUL
1763 	#define CREQ_CREATE_QP1_RESP_TYPE_SFT     0
1764 	#define CREQ_CREATE_QP1_RESP_TYPE_QP_EVENT  0x38UL
1765 	#define CREQ_CREATE_QP1_RESP_TYPE_LAST     CREQ_CREATE_QP1_RESP_TYPE_QP_EVENT
1766 	u8	status;
1767 	__le16	cookie;
1768 	__le32	xid;
1769 	u8	v;
1770 	#define CREQ_CREATE_QP1_RESP_V     0x1UL
1771 	u8	event;
1772 	#define CREQ_CREATE_QP1_RESP_EVENT_CREATE_QP1 0x13UL
1773 	#define CREQ_CREATE_QP1_RESP_EVENT_LAST      CREQ_CREATE_QP1_RESP_EVENT_CREATE_QP1
1774 	u8	reserved48[6];
1775 };
1776 
1777 /* cmdq_destroy_qp1 (size:192b/24B) */
1778 struct cmdq_destroy_qp1 {
1779 	u8	opcode;
1780 	#define CMDQ_DESTROY_QP1_OPCODE_DESTROY_QP1 0x14UL
1781 	#define CMDQ_DESTROY_QP1_OPCODE_LAST       CMDQ_DESTROY_QP1_OPCODE_DESTROY_QP1
1782 	u8	cmd_size;
1783 	__le16	flags;
1784 	__le16	cookie;
1785 	u8	resp_size;
1786 	u8	reserved8;
1787 	__le64	resp_addr;
1788 	__le32	qp1_cid;
1789 	__le32	unused_0;
1790 };
1791 
1792 /* creq_destroy_qp1_resp (size:128b/16B) */
1793 struct creq_destroy_qp1_resp {
1794 	u8	type;
1795 	#define CREQ_DESTROY_QP1_RESP_TYPE_MASK    0x3fUL
1796 	#define CREQ_DESTROY_QP1_RESP_TYPE_SFT     0
1797 	#define CREQ_DESTROY_QP1_RESP_TYPE_QP_EVENT  0x38UL
1798 	#define CREQ_DESTROY_QP1_RESP_TYPE_LAST     CREQ_DESTROY_QP1_RESP_TYPE_QP_EVENT
1799 	u8	status;
1800 	__le16	cookie;
1801 	__le32	xid;
1802 	u8	v;
1803 	#define CREQ_DESTROY_QP1_RESP_V     0x1UL
1804 	u8	event;
1805 	#define CREQ_DESTROY_QP1_RESP_EVENT_DESTROY_QP1 0x14UL
1806 	#define CREQ_DESTROY_QP1_RESP_EVENT_LAST       CREQ_DESTROY_QP1_RESP_EVENT_DESTROY_QP1
1807 	u8	reserved48[6];
1808 };
1809 
1810 /* cmdq_create_ah (size:512b/64B) */
1811 struct cmdq_create_ah {
1812 	u8	opcode;
1813 	#define CMDQ_CREATE_AH_OPCODE_CREATE_AH 0x15UL
1814 	#define CMDQ_CREATE_AH_OPCODE_LAST     CMDQ_CREATE_AH_OPCODE_CREATE_AH
1815 	u8	cmd_size;
1816 	__le16	flags;
1817 	__le16	cookie;
1818 	u8	resp_size;
1819 	u8	reserved8;
1820 	__le64	resp_addr;
1821 	__le64	ah_handle;
1822 	__le32	dgid[4];
1823 	u8	type;
1824 	#define CMDQ_CREATE_AH_TYPE_V1     0x0UL
1825 	#define CMDQ_CREATE_AH_TYPE_V2IPV4 0x2UL
1826 	#define CMDQ_CREATE_AH_TYPE_V2IPV6 0x3UL
1827 	#define CMDQ_CREATE_AH_TYPE_LAST  CMDQ_CREATE_AH_TYPE_V2IPV6
1828 	u8	hop_limit;
1829 	__le16	sgid_index;
1830 	__le32	dest_vlan_id_flow_label;
1831 	#define CMDQ_CREATE_AH_FLOW_LABEL_MASK  0xfffffUL
1832 	#define CMDQ_CREATE_AH_FLOW_LABEL_SFT   0
1833 	#define CMDQ_CREATE_AH_DEST_VLAN_ID_MASK 0xfff00000UL
1834 	#define CMDQ_CREATE_AH_DEST_VLAN_ID_SFT 20
1835 	__le32	pd_id;
1836 	__le32	unused_0;
1837 	__le16	dest_mac[3];
1838 	u8	traffic_class;
1839 	u8	enable_cc;
1840 	#define CMDQ_CREATE_AH_ENABLE_CC     0x1UL
1841 };
1842 
1843 /* creq_create_ah_resp (size:128b/16B) */
1844 struct creq_create_ah_resp {
1845 	u8	type;
1846 	#define CREQ_CREATE_AH_RESP_TYPE_MASK    0x3fUL
1847 	#define CREQ_CREATE_AH_RESP_TYPE_SFT     0
1848 	#define CREQ_CREATE_AH_RESP_TYPE_QP_EVENT  0x38UL
1849 	#define CREQ_CREATE_AH_RESP_TYPE_LAST     CREQ_CREATE_AH_RESP_TYPE_QP_EVENT
1850 	u8	status;
1851 	__le16	cookie;
1852 	__le32	xid;
1853 	u8	v;
1854 	#define CREQ_CREATE_AH_RESP_V     0x1UL
1855 	u8	event;
1856 	#define CREQ_CREATE_AH_RESP_EVENT_CREATE_AH 0x15UL
1857 	#define CREQ_CREATE_AH_RESP_EVENT_LAST     CREQ_CREATE_AH_RESP_EVENT_CREATE_AH
1858 	u8	reserved48[6];
1859 };
1860 
1861 /* cmdq_destroy_ah (size:192b/24B) */
1862 struct cmdq_destroy_ah {
1863 	u8	opcode;
1864 	#define CMDQ_DESTROY_AH_OPCODE_DESTROY_AH 0x16UL
1865 	#define CMDQ_DESTROY_AH_OPCODE_LAST      CMDQ_DESTROY_AH_OPCODE_DESTROY_AH
1866 	u8	cmd_size;
1867 	__le16	flags;
1868 	__le16	cookie;
1869 	u8	resp_size;
1870 	u8	reserved8;
1871 	__le64	resp_addr;
1872 	__le32	ah_cid;
1873 	__le32	unused_0;
1874 };
1875 
1876 /* creq_destroy_ah_resp (size:128b/16B) */
1877 struct creq_destroy_ah_resp {
1878 	u8	type;
1879 	#define CREQ_DESTROY_AH_RESP_TYPE_MASK    0x3fUL
1880 	#define CREQ_DESTROY_AH_RESP_TYPE_SFT     0
1881 	#define CREQ_DESTROY_AH_RESP_TYPE_QP_EVENT  0x38UL
1882 	#define CREQ_DESTROY_AH_RESP_TYPE_LAST     CREQ_DESTROY_AH_RESP_TYPE_QP_EVENT
1883 	u8	status;
1884 	__le16	cookie;
1885 	__le32	xid;
1886 	u8	v;
1887 	#define CREQ_DESTROY_AH_RESP_V     0x1UL
1888 	u8	event;
1889 	#define CREQ_DESTROY_AH_RESP_EVENT_DESTROY_AH 0x16UL
1890 	#define CREQ_DESTROY_AH_RESP_EVENT_LAST      CREQ_DESTROY_AH_RESP_EVENT_DESTROY_AH
1891 	u8	reserved48[6];
1892 };
1893 
1894 /* cmdq_query_roce_stats (size:192b/24B) */
1895 struct cmdq_query_roce_stats {
1896 	u8	opcode;
1897 	#define CMDQ_QUERY_ROCE_STATS_OPCODE_QUERY_ROCE_STATS 0x8eUL
1898 	#define CMDQ_QUERY_ROCE_STATS_OPCODE_LAST    CMDQ_QUERY_ROCE_STATS_OPCODE_QUERY_ROCE_STATS
1899 	u8	cmd_size;
1900 	__le16	flags;
1901 	#define CMDQ_QUERY_ROCE_STATS_FLAGS_COLLECTION_ID     0x1UL
1902 	#define CMDQ_QUERY_ROCE_STATS_FLAGS_FUNCTION_ID       0x2UL
1903 	__le16	cookie;
1904 	u8	resp_size;
1905 	u8	collection_id;
1906 	__le64	resp_addr;
1907 	__le32	function_id;
1908 	#define CMDQ_QUERY_ROCE_STATS_PF_NUM_MASK  0xffUL
1909 	#define CMDQ_QUERY_ROCE_STATS_PF_NUM_SFT   0
1910 	#define CMDQ_QUERY_ROCE_STATS_VF_NUM_MASK  0xffff00UL
1911 	#define CMDQ_QUERY_ROCE_STATS_VF_NUM_SFT   8
1912 	#define CMDQ_QUERY_ROCE_STATS_VF_VALID     0x1000000UL
1913 	__le32	reserved32;
1914 };
1915 
1916 /* creq_query_roce_stats_resp (size:128b/16B) */
1917 struct creq_query_roce_stats_resp {
1918 	u8	type;
1919 	#define CREQ_QUERY_ROCE_STATS_RESP_TYPE_MASK    0x3fUL
1920 	#define CREQ_QUERY_ROCE_STATS_RESP_TYPE_SFT     0
1921 	#define CREQ_QUERY_ROCE_STATS_RESP_TYPE_QP_EVENT  0x38UL
1922 	#define CREQ_QUERY_ROCE_STATS_RESP_TYPE_LAST     CREQ_QUERY_ROCE_STATS_RESP_TYPE_QP_EVENT
1923 	u8	status;
1924 	__le16	cookie;
1925 	__le32	size;
1926 	u8	v;
1927 	#define CREQ_QUERY_ROCE_STATS_RESP_V     0x1UL
1928 	u8	event;
1929 	#define CREQ_QUERY_ROCE_STATS_RESP_EVENT_QUERY_ROCE_STATS 0x8eUL
1930 	#define CREQ_QUERY_ROCE_STATS_RESP_EVENT_LAST \
1931 		CREQ_QUERY_ROCE_STATS_RESP_EVENT_QUERY_ROCE_STATS
1932 	u8	reserved48[6];
1933 };
1934 
1935 /* creq_query_roce_stats_resp_sb (size:2944b/368B) */
1936 struct creq_query_roce_stats_resp_sb {
1937 	u8	opcode;
1938 	#define CREQ_QUERY_ROCE_STATS_RESP_SB_OPCODE_QUERY_ROCE_STATS 0x8eUL
1939 	#define CREQ_QUERY_ROCE_STATS_RESP_SB_OPCODE_LAST \
1940 		CREQ_QUERY_ROCE_STATS_RESP_SB_OPCODE_QUERY_ROCE_STATS
1941 	u8	status;
1942 	__le16	cookie;
1943 	__le16	flags;
1944 	u8	resp_size;
1945 	u8	rsvd;
1946 	__le32	num_counters;
1947 	__le32	rsvd1;
1948 	__le64	to_retransmits;
1949 	__le64	seq_err_naks_rcvd;
1950 	__le64	max_retry_exceeded;
1951 	__le64	rnr_naks_rcvd;
1952 	__le64	missing_resp;
1953 	__le64	unrecoverable_err;
1954 	__le64	bad_resp_err;
1955 	__le64	local_qp_op_err;
1956 	__le64	local_protection_err;
1957 	__le64	mem_mgmt_op_err;
1958 	__le64	remote_invalid_req_err;
1959 	__le64	remote_access_err;
1960 	__le64	remote_op_err;
1961 	__le64	dup_req;
1962 	__le64	res_exceed_max;
1963 	__le64	res_length_mismatch;
1964 	__le64	res_exceeds_wqe;
1965 	__le64	res_opcode_err;
1966 	__le64	res_rx_invalid_rkey;
1967 	__le64	res_rx_domain_err;
1968 	__le64	res_rx_no_perm;
1969 	__le64	res_rx_range_err;
1970 	__le64	res_tx_invalid_rkey;
1971 	__le64	res_tx_domain_err;
1972 	__le64	res_tx_no_perm;
1973 	__le64	res_tx_range_err;
1974 	__le64	res_irrq_oflow;
1975 	__le64	res_unsup_opcode;
1976 	__le64	res_unaligned_atomic;
1977 	__le64	res_rem_inv_err;
1978 	__le64	res_mem_error;
1979 	__le64	res_srq_err;
1980 	__le64	res_cmp_err;
1981 	__le64	res_invalid_dup_rkey;
1982 	__le64	res_wqe_format_err;
1983 	__le64	res_cq_load_err;
1984 	__le64	res_srq_load_err;
1985 	__le64	res_tx_pci_err;
1986 	__le64	res_rx_pci_err;
1987 	__le64	res_oos_drop_count;
1988 	__le64	active_qp_count_p0;
1989 	__le64	active_qp_count_p1;
1990 	__le64	active_qp_count_p2;
1991 	__le64	active_qp_count_p3;
1992 };
1993 
1994 /* cmdq_query_roce_stats_ext (size:192b/24B) */
1995 struct cmdq_query_roce_stats_ext {
1996 	u8	opcode;
1997 	#define CMDQ_QUERY_ROCE_STATS_EXT_OPCODE_QUERY_ROCE_STATS 0x92UL
1998 	#define CMDQ_QUERY_ROCE_STATS_EXT_OPCODE_LAST \
1999 			CMDQ_QUERY_ROCE_STATS_EXT_OPCODE_QUERY_ROCE_STATS
2000 	u8	cmd_size;
2001 	__le16	flags;
2002 	#define CMDQ_QUERY_ROCE_STATS_EXT_FLAGS_COLLECTION_ID     0x1UL
2003 	#define CMDQ_QUERY_ROCE_STATS_EXT_FLAGS_FUNCTION_ID       0x2UL
2004 	__le16	cookie;
2005 	u8	resp_size;
2006 	u8	collection_id;
2007 	__le64	resp_addr;
2008 	__le32	function_id;
2009 	#define CMDQ_QUERY_ROCE_STATS_EXT_PF_NUM_MASK  0xffUL
2010 	#define CMDQ_QUERY_ROCE_STATS_EXT_PF_NUM_SFT   0
2011 	#define CMDQ_QUERY_ROCE_STATS_EXT_VF_NUM_MASK  0xffff00UL
2012 	#define CMDQ_QUERY_ROCE_STATS_EXT_VF_NUM_SFT   8
2013 	#define CMDQ_QUERY_ROCE_STATS_EXT_VF_VALID     0x1000000UL
2014 	__le32	reserved32;
2015 };
2016 
2017 /* creq_query_roce_stats_ext_resp (size:128b/16B) */
2018 struct creq_query_roce_stats_ext_resp {
2019 	u8	type;
2020 	#define CREQ_QUERY_ROCE_STATS_EXT_RESP_TYPE_MASK    0x3fUL
2021 	#define CREQ_QUERY_ROCE_STATS_EXT_RESP_TYPE_SFT     0
2022 	#define CREQ_QUERY_ROCE_STATS_EXT_RESP_TYPE_QP_EVENT  0x38UL
2023 	#define CREQ_QUERY_ROCE_STATS_EXT_RESP_TYPE_LAST \
2024 		CREQ_QUERY_ROCE_STATS_EXT_RESP_TYPE_QP_EVENT
2025 	u8	status;
2026 	__le16	cookie;
2027 	__le32	size;
2028 	u8	v;
2029 	#define CREQ_QUERY_ROCE_STATS_EXT_RESP_V     0x1UL
2030 	u8	event;
2031 	#define CREQ_QUERY_ROCE_STATS_EXT_RESP_EVENT_QUERY_ROCE_STATS_EXT 0x92UL
2032 	#define CREQ_QUERY_ROCE_STATS_EXT_RESP_EVENT_LAST \
2033 		CREQ_QUERY_ROCE_STATS_EXT_RESP_EVENT_QUERY_ROCE_STATS_EXT
2034 	u8	reserved48[6];
2035 };
2036 
2037 /* creq_query_roce_stats_ext_resp_sb (size:1856b/232B) */
2038 struct creq_query_roce_stats_ext_resp_sb {
2039 	u8	opcode;
2040 	#define CREQ_QUERY_ROCE_STATS_EXT_RESP_SB_OPCODE_QUERY_ROCE_STATS_EXT 0x92UL
2041 	#define CREQ_QUERY_ROCE_STATS_EXT_RESP_SB_OPCODE_LAST \
2042 		CREQ_QUERY_ROCE_STATS_EXT_RESP_SB_OPCODE_QUERY_ROCE_STATS_EXT
2043 	u8	status;
2044 	__le16	cookie;
2045 	__le16	flags;
2046 	u8	resp_size;
2047 	u8	rsvd;
2048 	__le64	tx_atomic_req_pkts;
2049 	__le64	tx_read_req_pkts;
2050 	__le64	tx_read_res_pkts;
2051 	__le64	tx_write_req_pkts;
2052 	__le64	tx_send_req_pkts;
2053 	__le64	tx_roce_pkts;
2054 	__le64	tx_roce_bytes;
2055 	__le64	rx_atomic_req_pkts;
2056 	__le64	rx_read_req_pkts;
2057 	__le64	rx_read_res_pkts;
2058 	__le64	rx_write_req_pkts;
2059 	__le64	rx_send_req_pkts;
2060 	__le64	rx_roce_pkts;
2061 	__le64	rx_roce_bytes;
2062 	__le64	rx_roce_good_pkts;
2063 	__le64	rx_roce_good_bytes;
2064 	__le64	rx_out_of_buffer_pkts;
2065 	__le64	rx_out_of_sequence_pkts;
2066 	__le64	tx_cnp_pkts;
2067 	__le64	rx_cnp_pkts;
2068 	__le64	rx_ecn_marked_pkts;
2069 	__le64	tx_cnp_bytes;
2070 	__le64	rx_cnp_bytes;
2071 	__le64	seq_err_naks_rcvd;
2072 	__le64	rnr_naks_rcvd;
2073 	__le64	missing_resp;
2074 	__le64	to_retransmit;
2075 	__le64	dup_req;
2076 };
2077 
2078 /* cmdq_query_func (size:128b/16B) */
2079 struct cmdq_query_func {
2080 	u8	opcode;
2081 	#define CMDQ_QUERY_FUNC_OPCODE_QUERY_FUNC 0x83UL
2082 	#define CMDQ_QUERY_FUNC_OPCODE_LAST      CMDQ_QUERY_FUNC_OPCODE_QUERY_FUNC
2083 	u8	cmd_size;
2084 	__le16	flags;
2085 	__le16	cookie;
2086 	u8	resp_size;
2087 	u8	reserved8;
2088 	__le64	resp_addr;
2089 };
2090 
2091 /* creq_query_func_resp (size:128b/16B) */
2092 struct creq_query_func_resp {
2093 	u8	type;
2094 	#define CREQ_QUERY_FUNC_RESP_TYPE_MASK    0x3fUL
2095 	#define CREQ_QUERY_FUNC_RESP_TYPE_SFT     0
2096 	#define CREQ_QUERY_FUNC_RESP_TYPE_QP_EVENT  0x38UL
2097 	#define CREQ_QUERY_FUNC_RESP_TYPE_LAST     CREQ_QUERY_FUNC_RESP_TYPE_QP_EVENT
2098 	u8	status;
2099 	__le16	cookie;
2100 	__le32	size;
2101 	u8	v;
2102 	#define CREQ_QUERY_FUNC_RESP_V     0x1UL
2103 	u8	event;
2104 	#define CREQ_QUERY_FUNC_RESP_EVENT_QUERY_FUNC 0x83UL
2105 	#define CREQ_QUERY_FUNC_RESP_EVENT_LAST      CREQ_QUERY_FUNC_RESP_EVENT_QUERY_FUNC
2106 	u8	reserved48[6];
2107 };
2108 
2109 /* creq_query_func_resp_sb (size:1088b/136B) */
2110 struct creq_query_func_resp_sb {
2111 	u8	opcode;
2112 	#define CREQ_QUERY_FUNC_RESP_SB_OPCODE_QUERY_FUNC 0x83UL
2113 	#define CREQ_QUERY_FUNC_RESP_SB_OPCODE_LAST      CREQ_QUERY_FUNC_RESP_SB_OPCODE_QUERY_FUNC
2114 	u8	status;
2115 	__le16	cookie;
2116 	__le16	flags;
2117 	u8	resp_size;
2118 	u8	reserved8;
2119 	__le64	max_mr_size;
2120 	__le32	max_qp;
2121 	__le16	max_qp_wr;
2122 	__le16	dev_cap_flags;
2123 	#define CREQ_QUERY_FUNC_RESP_SB_RESIZE_QP                      0x1UL
2124 	#define CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_MASK             0xeUL
2125 	#define CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_SFT              1
2126 	#define CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_CC_GEN0            (0x0UL << 1)
2127 	#define CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_CC_GEN1            (0x1UL << 1)
2128 	#define CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_CC_GEN1_EXT        (0x2UL << 1)
2129 	#define CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_LAST \
2130 		CREQ_QUERY_FUNC_RESP_SB_CC_GENERATION_CC_GEN1_EXT
2131 	#define CREQ_QUERY_FUNC_RESP_SB_EXT_STATS                      0x10UL
2132 	#define CREQ_QUERY_FUNC_RESP_SB_MR_REGISTER_ALLOC              0x20UL
2133 	#define CREQ_QUERY_FUNC_RESP_SB_OPTIMIZED_TRANSMIT_ENABLED     0x40UL
2134 	#define CREQ_QUERY_FUNC_RESP_SB_CQE_V2                         0x80UL
2135 	#define CREQ_QUERY_FUNC_RESP_SB_PINGPONG_PUSH_MODE             0x100UL
2136 	#define CREQ_QUERY_FUNC_RESP_SB_HW_REQUESTER_RETX_ENABLED      0x200UL
2137 	#define CREQ_QUERY_FUNC_RESP_SB_HW_RESPONDER_RETX_ENABLED      0x400UL
2138 	__le32	max_cq;
2139 	__le32	max_cqe;
2140 	__le32	max_pd;
2141 	u8	max_sge;
2142 	u8	max_srq_sge;
2143 	u8	max_qp_rd_atom;
2144 	u8	max_qp_init_rd_atom;
2145 	__le32	max_mr;
2146 	__le32	max_mw;
2147 	__le32	max_raw_eth_qp;
2148 	__le32	max_ah;
2149 	__le32	max_fmr;
2150 	__le32	max_srq_wr;
2151 	__le32	max_pkeys;
2152 	__le32	max_inline_data;
2153 	u8	max_map_per_fmr;
2154 	u8	l2_db_space_size;
2155 	__le16	max_srq;
2156 	__le32	max_gid;
2157 	__le32	tqm_alloc_reqs[12];
2158 	__le32	max_dpi;
2159 	u8	max_sge_var_wqe;
2160 	u8	reserved_8;
2161 	__le16	max_inline_data_var_wqe;
2162 };
2163 
2164 /* cmdq_set_func_resources (size:448b/56B) */
2165 struct cmdq_set_func_resources {
2166 	u8	opcode;
2167 	#define CMDQ_SET_FUNC_RESOURCES_OPCODE_SET_FUNC_RESOURCES 0x84UL
2168 	#define CMDQ_SET_FUNC_RESOURCES_OPCODE_LAST\
2169 			CMDQ_SET_FUNC_RESOURCES_OPCODE_SET_FUNC_RESOURCES
2170 	u8	cmd_size;
2171 	__le16	flags;
2172 	#define CMDQ_SET_FUNC_RESOURCES_FLAGS_MRAV_RESERVATION_SPLIT     0x1UL
2173 	__le16	cookie;
2174 	u8	resp_size;
2175 	u8	reserved8;
2176 	__le64	resp_addr;
2177 	__le32	number_of_qp;
2178 	__le32	number_of_mrw;
2179 	__le32	number_of_srq;
2180 	__le32	number_of_cq;
2181 	__le32	max_qp_per_vf;
2182 	__le32	max_mrw_per_vf;
2183 	__le32	max_srq_per_vf;
2184 	__le32	max_cq_per_vf;
2185 	__le32	max_gid_per_vf;
2186 	__le32	stat_ctx_id;
2187 };
2188 
2189 /* creq_set_func_resources_resp (size:128b/16B) */
2190 struct creq_set_func_resources_resp {
2191 	u8	type;
2192 	#define CREQ_SET_FUNC_RESOURCES_RESP_TYPE_MASK    0x3fUL
2193 	#define CREQ_SET_FUNC_RESOURCES_RESP_TYPE_SFT     0
2194 	#define CREQ_SET_FUNC_RESOURCES_RESP_TYPE_QP_EVENT  0x38UL
2195 	#define CREQ_SET_FUNC_RESOURCES_RESP_TYPE_LAST CREQ_SET_FUNC_RESOURCES_RESP_TYPE_QP_EVENT
2196 	u8	status;
2197 	__le16	cookie;
2198 	__le32	reserved32;
2199 	u8	v;
2200 	#define CREQ_SET_FUNC_RESOURCES_RESP_V     0x1UL
2201 	u8	event;
2202 	#define CREQ_SET_FUNC_RESOURCES_RESP_EVENT_SET_FUNC_RESOURCES 0x84UL
2203 	#define CREQ_SET_FUNC_RESOURCES_RESP_EVENT_LAST \
2204 		CREQ_SET_FUNC_RESOURCES_RESP_EVENT_SET_FUNC_RESOURCES
2205 	u8	reserved48[6];
2206 };
2207 
2208 /* cmdq_map_tc_to_cos (size:192b/24B) */
2209 struct cmdq_map_tc_to_cos {
2210 	u8	opcode;
2211 	#define CMDQ_MAP_TC_TO_COS_OPCODE_MAP_TC_TO_COS 0x8aUL
2212 	#define CMDQ_MAP_TC_TO_COS_OPCODE_LAST         CMDQ_MAP_TC_TO_COS_OPCODE_MAP_TC_TO_COS
2213 	u8	cmd_size;
2214 	__le16	flags;
2215 	__le16	cookie;
2216 	u8	resp_size;
2217 	u8	reserved8;
2218 	__le64	resp_addr;
2219 	__le16	cos0;
2220 	#define CMDQ_MAP_TC_TO_COS_COS0_NO_CHANGE 0xffffUL
2221 	#define CMDQ_MAP_TC_TO_COS_COS0_LAST     CMDQ_MAP_TC_TO_COS_COS0_NO_CHANGE
2222 	__le16	cos1;
2223 	#define CMDQ_MAP_TC_TO_COS_COS1_DISABLE   0x8000UL
2224 	#define CMDQ_MAP_TC_TO_COS_COS1_NO_CHANGE 0xffffUL
2225 	#define CMDQ_MAP_TC_TO_COS_COS1_LAST     CMDQ_MAP_TC_TO_COS_COS1_NO_CHANGE
2226 	__le32	unused_0;
2227 };
2228 
2229 /* creq_map_tc_to_cos_resp (size:128b/16B) */
2230 struct creq_map_tc_to_cos_resp {
2231 	u8	type;
2232 	#define CREQ_MAP_TC_TO_COS_RESP_TYPE_MASK    0x3fUL
2233 	#define CREQ_MAP_TC_TO_COS_RESP_TYPE_SFT     0
2234 	#define CREQ_MAP_TC_TO_COS_RESP_TYPE_QP_EVENT  0x38UL
2235 	#define CREQ_MAP_TC_TO_COS_RESP_TYPE_LAST     CREQ_MAP_TC_TO_COS_RESP_TYPE_QP_EVENT
2236 	u8	status;
2237 	__le16	cookie;
2238 	__le32	reserved32;
2239 	u8	v;
2240 	#define CREQ_MAP_TC_TO_COS_RESP_V     0x1UL
2241 	u8	event;
2242 	#define CREQ_MAP_TC_TO_COS_RESP_EVENT_MAP_TC_TO_COS 0x8aUL
2243 	#define CREQ_MAP_TC_TO_COS_RESP_EVENT_LAST CREQ_MAP_TC_TO_COS_RESP_EVENT_MAP_TC_TO_COS
2244 	u8	reserved48[6];
2245 };
2246 
2247 /* cmdq_query_roce_cc (size:128b/16B) */
2248 struct cmdq_query_roce_cc {
2249 	u8	opcode;
2250 	#define CMDQ_QUERY_ROCE_CC_OPCODE_QUERY_ROCE_CC 0x8dUL
2251 	#define CMDQ_QUERY_ROCE_CC_OPCODE_LAST CMDQ_QUERY_ROCE_CC_OPCODE_QUERY_ROCE_CC
2252 	u8	cmd_size;
2253 	__le16	flags;
2254 	__le16	cookie;
2255 	u8	resp_size;
2256 	u8	reserved8;
2257 	__le64	resp_addr;
2258 };
2259 
2260 /* creq_query_roce_cc_resp (size:128b/16B) */
2261 struct creq_query_roce_cc_resp {
2262 	u8	type;
2263 	#define CREQ_QUERY_ROCE_CC_RESP_TYPE_MASK    0x3fUL
2264 	#define CREQ_QUERY_ROCE_CC_RESP_TYPE_SFT     0
2265 	#define CREQ_QUERY_ROCE_CC_RESP_TYPE_QP_EVENT  0x38UL
2266 	#define CREQ_QUERY_ROCE_CC_RESP_TYPE_LAST     CREQ_QUERY_ROCE_CC_RESP_TYPE_QP_EVENT
2267 	u8	status;
2268 	__le16	cookie;
2269 	__le32	size;
2270 	u8	v;
2271 	#define CREQ_QUERY_ROCE_CC_RESP_V     0x1UL
2272 	u8	event;
2273 	#define CREQ_QUERY_ROCE_CC_RESP_EVENT_QUERY_ROCE_CC 0x8dUL
2274 	#define CREQ_QUERY_ROCE_CC_RESP_EVENT_LAST  CREQ_QUERY_ROCE_CC_RESP_EVENT_QUERY_ROCE_CC
2275 	u8	reserved48[6];
2276 };
2277 
2278 /* creq_query_roce_cc_resp_sb (size:256b/32B) */
2279 struct creq_query_roce_cc_resp_sb {
2280 	u8	opcode;
2281 	#define CREQ_QUERY_ROCE_CC_RESP_SB_OPCODE_QUERY_ROCE_CC 0x8dUL
2282 	#define CREQ_QUERY_ROCE_CC_RESP_SB_OPCODE_LAST \
2283 		CREQ_QUERY_ROCE_CC_RESP_SB_OPCODE_QUERY_ROCE_CC
2284 	u8	status;
2285 	__le16	cookie;
2286 	__le16	flags;
2287 	u8	resp_size;
2288 	u8	reserved8;
2289 	u8	enable_cc;
2290 	#define CREQ_QUERY_ROCE_CC_RESP_SB_ENABLE_CC     0x1UL
2291 	#define CREQ_QUERY_ROCE_CC_RESP_SB_UNUSED7_MASK  0xfeUL
2292 	#define CREQ_QUERY_ROCE_CC_RESP_SB_UNUSED7_SFT   1
2293 	u8	tos_dscp_tos_ecn;
2294 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TOS_ECN_MASK 0x3UL
2295 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TOS_ECN_SFT  0
2296 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TOS_DSCP_MASK 0xfcUL
2297 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TOS_DSCP_SFT 2
2298 	u8	g;
2299 	u8	num_phases_per_state;
2300 	__le16	init_cr;
2301 	__le16	init_tr;
2302 	u8	alt_vlan_pcp;
2303 	#define CREQ_QUERY_ROCE_CC_RESP_SB_ALT_VLAN_PCP_MASK 0x7UL
2304 	#define CREQ_QUERY_ROCE_CC_RESP_SB_ALT_VLAN_PCP_SFT 0
2305 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD1_MASK       0xf8UL
2306 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD1_SFT        3
2307 	u8	alt_tos_dscp;
2308 	#define CREQ_QUERY_ROCE_CC_RESP_SB_ALT_TOS_DSCP_MASK 0x3fUL
2309 	#define CREQ_QUERY_ROCE_CC_RESP_SB_ALT_TOS_DSCP_SFT 0
2310 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD4_MASK       0xc0UL
2311 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD4_SFT        6
2312 	u8	cc_mode;
2313 	#define CREQ_QUERY_ROCE_CC_RESP_SB_CC_MODE_DCTCP         0x0UL
2314 	#define CREQ_QUERY_ROCE_CC_RESP_SB_CC_MODE_PROBABILISTIC 0x1UL
2315 	#define CREQ_QUERY_ROCE_CC_RESP_SB_CC_MODE_LAST \
2316 		CREQ_QUERY_ROCE_CC_RESP_SB_CC_MODE_PROBABILISTIC
2317 	u8	tx_queue;
2318 	__le16	rtt;
2319 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RTT_MASK  0x3fffUL
2320 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RTT_SFT   0
2321 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD5_MASK 0xc000UL
2322 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD5_SFT 14
2323 	__le16	tcp_cp;
2324 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TCP_CP_MASK 0x3ffUL
2325 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TCP_CP_SFT 0
2326 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD6_MASK 0xfc00UL
2327 	#define CREQ_QUERY_ROCE_CC_RESP_SB_RSVD6_SFT  10
2328 	__le16	inactivity_th;
2329 	u8	pkts_per_phase;
2330 	u8	time_per_phase;
2331 	__le32	reserved32;
2332 };
2333 
2334 /* creq_query_roce_cc_resp_sb_tlv (size:384b/48B) */
2335 struct creq_query_roce_cc_resp_sb_tlv {
2336 	__le16	cmd_discr;
2337 	u8	reserved_8b;
2338 	u8	tlv_flags;
2339 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_MORE         0x1UL
2340 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_MORE_LAST      0x0UL
2341 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_MORE_NOT_LAST  0x1UL
2342 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_REQUIRED     0x2UL
2343 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_REQUIRED_NO    (0x0UL << 1)
2344 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_REQUIRED_YES   (0x1UL << 1)
2345 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_REQUIRED_LAST \
2346 		CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TLV_FLAGS_REQUIRED_YES
2347 	__le16	tlv_type;
2348 	__le16	length;
2349 	u8	total_size;
2350 	u8	reserved56[7];
2351 	u8	opcode;
2352 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_OPCODE_QUERY_ROCE_CC 0x8dUL
2353 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_OPCODE_LAST \
2354 		CREQ_QUERY_ROCE_CC_RESP_SB_TLV_OPCODE_QUERY_ROCE_CC
2355 	u8	status;
2356 	__le16	cookie;
2357 	__le16	flags;
2358 	u8	resp_size;
2359 	u8	reserved8;
2360 	u8	enable_cc;
2361 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_ENABLE_CC     0x1UL
2362 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_UNUSED7_MASK  0xfeUL
2363 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_UNUSED7_SFT   1
2364 	u8	tos_dscp_tos_ecn;
2365 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TOS_ECN_MASK 0x3UL
2366 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TOS_ECN_SFT  0
2367 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TOS_DSCP_MASK 0xfcUL
2368 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TOS_DSCP_SFT 2
2369 	u8	g;
2370 	u8	num_phases_per_state;
2371 	__le16	init_cr;
2372 	__le16	init_tr;
2373 	u8	alt_vlan_pcp;
2374 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_ALT_VLAN_PCP_MASK 0x7UL
2375 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_ALT_VLAN_PCP_SFT 0
2376 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD1_MASK       0xf8UL
2377 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD1_SFT        3
2378 	u8	alt_tos_dscp;
2379 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_ALT_TOS_DSCP_MASK 0x3fUL
2380 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_ALT_TOS_DSCP_SFT 0
2381 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD4_MASK       0xc0UL
2382 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD4_SFT        6
2383 	u8	cc_mode;
2384 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_CC_MODE_DCTCP         0x0UL
2385 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_CC_MODE_PROBABILISTIC 0x1UL
2386 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_CC_MODE_LAST\
2387 		CREQ_QUERY_ROCE_CC_RESP_SB_TLV_CC_MODE_PROBABILISTIC
2388 	u8	tx_queue;
2389 	__le16	rtt;
2390 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RTT_MASK  0x3fffUL
2391 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RTT_SFT   0
2392 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD5_MASK 0xc000UL
2393 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD5_SFT 14
2394 	__le16	tcp_cp;
2395 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TCP_CP_MASK 0x3ffUL
2396 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_TCP_CP_SFT 0
2397 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD6_MASK 0xfc00UL
2398 	#define CREQ_QUERY_ROCE_CC_RESP_SB_TLV_RSVD6_SFT  10
2399 	__le16	inactivity_th;
2400 	u8	pkts_per_phase;
2401 	u8	time_per_phase;
2402 	__le32	reserved32;
2403 };
2404 
2405 /* creq_query_roce_cc_gen1_resp_sb_tlv (size:704b/88B) */
2406 struct creq_query_roce_cc_gen1_resp_sb_tlv {
2407 	__le16	cmd_discr;
2408 	u8	reserved_8b;
2409 	u8	tlv_flags;
2410 	#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_MORE         0x1UL
2411 	#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_MORE_LAST      0x0UL
2412 	#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_MORE_NOT_LAST  0x1UL
2413 	#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_REQUIRED     0x2UL
2414 	#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_REQUIRED_NO    (0x0UL << 1)
2415 	#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_REQUIRED_YES   (0x1UL << 1)
2416 	#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_REQUIRED_LAST \
2417 		CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_TLV_FLAGS_REQUIRED_YES
2418 	__le16	tlv_type;
2419 	__le16	length;
2420 	__le64	reserved64;
2421 	__le16	inactivity_th_hi;
2422 	__le16	min_time_between_cnps;
2423 	__le16	init_cp;
2424 	u8	tr_update_mode;
2425 	u8	tr_update_cycles;
2426 	u8	fr_num_rtts;
2427 	u8	ai_rate_increase;
2428 	__le16	reduction_relax_rtts_th;
2429 	__le16	additional_relax_cr_th;
2430 	__le16	cr_min_th;
2431 	u8	bw_avg_weight;
2432 	u8	actual_cr_factor;
2433 	__le16	max_cp_cr_th;
2434 	u8	cp_bias_en;
2435 	u8	cp_bias;
2436 	u8	cnp_ecn;
2437 	#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_CNP_ECN_NOT_ECT 0x0UL
2438 	#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_CNP_ECN_ECT_1   0x1UL
2439 	#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_CNP_ECN_ECT_0   0x2UL
2440 	#define CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_CNP_ECN_LAST \
2441 		CREQ_QUERY_ROCE_CC_GEN1_RESP_SB_TLV_CNP_ECN_ECT_0
2442 	u8	rtt_jitter_en;
2443 	__le16	link_bytes_per_usec;
2444 	__le16	reset_cc_cr_th;
2445 	u8	cr_width;
2446 	u8	quota_period_min;
2447 	u8	quota_period_max;
2448 	u8	quota_period_abs_max;
2449 	__le16	tr_lower_bound;
2450 	u8	cr_prob_factor;
2451 	u8	tr_prob_factor;
2452 	__le16	fairness_cr_th;
2453 	u8	red_div;
2454 	u8	cnp_ratio_th;
2455 	__le16	exp_ai_rtts;
2456 	u8	exp_ai_cr_cp_ratio;
2457 	u8	use_rate_table;
2458 	__le16	cp_exp_update_th;
2459 	__le16	high_exp_ai_rtts_th1;
2460 	__le16	high_exp_ai_rtts_th2;
2461 	__le16	actual_cr_cong_free_rtts_th;
2462 	__le16	severe_cong_cr_th1;
2463 	__le16	severe_cong_cr_th2;
2464 	__le32	link64B_per_rtt;
2465 	u8	cc_ack_bytes;
2466 	u8	reduce_init_en;
2467 	__le16	reduce_init_cong_free_rtts_th;
2468 	u8	random_no_red_en;
2469 	u8	actual_cr_shift_correction_en;
2470 	u8	quota_period_adjust_en;
2471 	u8	reserved[5];
2472 };
2473 
2474 /* cmdq_modify_roce_cc (size:448b/56B) */
2475 struct cmdq_modify_roce_cc {
2476 	u8	opcode;
2477 	#define CMDQ_MODIFY_ROCE_CC_OPCODE_MODIFY_ROCE_CC 0x8cUL
2478 	#define CMDQ_MODIFY_ROCE_CC_OPCODE_LAST          CMDQ_MODIFY_ROCE_CC_OPCODE_MODIFY_ROCE_CC
2479 	u8	cmd_size;
2480 	__le16	flags;
2481 	__le16	cookie;
2482 	u8	resp_size;
2483 	u8	reserved8;
2484 	__le64	resp_addr;
2485 	__le32	modify_mask;
2486 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_ENABLE_CC            0x1UL
2487 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_G                    0x2UL
2488 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_NUMPHASEPERSTATE     0x4UL
2489 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_INIT_CR              0x8UL
2490 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_INIT_TR              0x10UL
2491 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TOS_ECN              0x20UL
2492 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TOS_DSCP             0x40UL
2493 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_ALT_VLAN_PCP         0x80UL
2494 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_ALT_TOS_DSCP         0x100UL
2495 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_RTT                  0x200UL
2496 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_CC_MODE              0x400UL
2497 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TCP_CP               0x800UL
2498 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TX_QUEUE             0x1000UL
2499 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_INACTIVITY_CP        0x2000UL
2500 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TIME_PER_PHASE       0x4000UL
2501 	#define CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_PKTS_PER_PHASE       0x8000UL
2502 	u8	enable_cc;
2503 	#define CMDQ_MODIFY_ROCE_CC_ENABLE_CC     0x1UL
2504 	#define CMDQ_MODIFY_ROCE_CC_RSVD1_MASK    0xfeUL
2505 	#define CMDQ_MODIFY_ROCE_CC_RSVD1_SFT     1
2506 	u8	g;
2507 	u8	num_phases_per_state;
2508 	u8	pkts_per_phase;
2509 	__le16	init_cr;
2510 	__le16	init_tr;
2511 	u8	tos_dscp_tos_ecn;
2512 	#define CMDQ_MODIFY_ROCE_CC_TOS_ECN_MASK 0x3UL
2513 	#define CMDQ_MODIFY_ROCE_CC_TOS_ECN_SFT  0
2514 	#define CMDQ_MODIFY_ROCE_CC_TOS_DSCP_MASK 0xfcUL
2515 	#define CMDQ_MODIFY_ROCE_CC_TOS_DSCP_SFT 2
2516 	u8	alt_vlan_pcp;
2517 	#define CMDQ_MODIFY_ROCE_CC_ALT_VLAN_PCP_MASK 0x7UL
2518 	#define CMDQ_MODIFY_ROCE_CC_ALT_VLAN_PCP_SFT 0
2519 	#define CMDQ_MODIFY_ROCE_CC_RSVD3_MASK       0xf8UL
2520 	#define CMDQ_MODIFY_ROCE_CC_RSVD3_SFT        3
2521 	__le16	alt_tos_dscp;
2522 	#define CMDQ_MODIFY_ROCE_CC_ALT_TOS_DSCP_MASK 0x3fUL
2523 	#define CMDQ_MODIFY_ROCE_CC_ALT_TOS_DSCP_SFT 0
2524 	#define CMDQ_MODIFY_ROCE_CC_RSVD4_MASK       0xffc0UL
2525 	#define CMDQ_MODIFY_ROCE_CC_RSVD4_SFT        6
2526 	__le16	rtt;
2527 	#define CMDQ_MODIFY_ROCE_CC_RTT_MASK  0x3fffUL
2528 	#define CMDQ_MODIFY_ROCE_CC_RTT_SFT   0
2529 	#define CMDQ_MODIFY_ROCE_CC_RSVD5_MASK 0xc000UL
2530 	#define CMDQ_MODIFY_ROCE_CC_RSVD5_SFT 14
2531 	__le16	tcp_cp;
2532 	#define CMDQ_MODIFY_ROCE_CC_TCP_CP_MASK 0x3ffUL
2533 	#define CMDQ_MODIFY_ROCE_CC_TCP_CP_SFT 0
2534 	#define CMDQ_MODIFY_ROCE_CC_RSVD6_MASK 0xfc00UL
2535 	#define CMDQ_MODIFY_ROCE_CC_RSVD6_SFT  10
2536 	u8	cc_mode;
2537 	#define CMDQ_MODIFY_ROCE_CC_CC_MODE_DCTCP_CC_MODE         0x0UL
2538 	#define CMDQ_MODIFY_ROCE_CC_CC_MODE_PROBABILISTIC_CC_MODE 0x1UL
2539 	#define CMDQ_MODIFY_ROCE_CC_CC_MODE_LAST CMDQ_MODIFY_ROCE_CC_CC_MODE_PROBABILISTIC_CC_MODE
2540 	u8	tx_queue;
2541 	__le16	inactivity_th;
2542 	u8	time_per_phase;
2543 	u8	reserved8_1;
2544 	__le16	reserved16;
2545 	__le32	reserved32;
2546 	__le64	reserved64;
2547 };
2548 
2549 /* cmdq_modify_roce_cc_tlv (size:640b/80B) */
2550 struct cmdq_modify_roce_cc_tlv {
2551 	__le16	cmd_discr;
2552 	u8	reserved_8b;
2553 	u8	tlv_flags;
2554 	#define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_MORE         0x1UL
2555 	#define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_MORE_LAST      0x0UL
2556 	#define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_MORE_NOT_LAST  0x1UL
2557 	#define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_REQUIRED     0x2UL
2558 	#define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_REQUIRED_NO    (0x0UL << 1)
2559 	#define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_REQUIRED_YES   (0x1UL << 1)
2560 	#define CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_REQUIRED_LAST \
2561 		CMDQ_MODIFY_ROCE_CC_TLV_TLV_FLAGS_REQUIRED_YES
2562 	__le16	tlv_type;
2563 	__le16	length;
2564 	u8	total_size;
2565 	u8	reserved56[7];
2566 	u8	opcode;
2567 	#define CMDQ_MODIFY_ROCE_CC_TLV_OPCODE_MODIFY_ROCE_CC 0x8cUL
2568 	#define CMDQ_MODIFY_ROCE_CC_TLV_OPCODE_LAST CMDQ_MODIFY_ROCE_CC_TLV_OPCODE_MODIFY_ROCE_CC
2569 	u8	cmd_size;
2570 	__le16	flags;
2571 	__le16	cookie;
2572 	u8	resp_size;
2573 	u8	reserved8;
2574 	__le64	resp_addr;
2575 	__le32	modify_mask;
2576 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_ENABLE_CC            0x1UL
2577 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_G                    0x2UL
2578 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_NUMPHASEPERSTATE     0x4UL
2579 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_INIT_CR              0x8UL
2580 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_INIT_TR              0x10UL
2581 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_TOS_ECN              0x20UL
2582 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_TOS_DSCP             0x40UL
2583 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_ALT_VLAN_PCP         0x80UL
2584 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_ALT_TOS_DSCP         0x100UL
2585 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_RTT                  0x200UL
2586 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_CC_MODE              0x400UL
2587 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_TCP_CP               0x800UL
2588 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_TX_QUEUE             0x1000UL
2589 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_INACTIVITY_CP        0x2000UL
2590 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_TIME_PER_PHASE       0x4000UL
2591 	#define CMDQ_MODIFY_ROCE_CC_TLV_MODIFY_MASK_PKTS_PER_PHASE       0x8000UL
2592 	u8	enable_cc;
2593 	#define CMDQ_MODIFY_ROCE_CC_TLV_ENABLE_CC     0x1UL
2594 	#define CMDQ_MODIFY_ROCE_CC_TLV_RSVD1_MASK    0xfeUL
2595 	#define CMDQ_MODIFY_ROCE_CC_TLV_RSVD1_SFT     1
2596 	u8	g;
2597 	u8	num_phases_per_state;
2598 	u8	pkts_per_phase;
2599 	__le16	init_cr;
2600 	__le16	init_tr;
2601 	u8	tos_dscp_tos_ecn;
2602 	#define CMDQ_MODIFY_ROCE_CC_TLV_TOS_ECN_MASK 0x3UL
2603 	#define CMDQ_MODIFY_ROCE_CC_TLV_TOS_ECN_SFT  0
2604 	#define CMDQ_MODIFY_ROCE_CC_TLV_TOS_DSCP_MASK 0xfcUL
2605 	#define CMDQ_MODIFY_ROCE_CC_TLV_TOS_DSCP_SFT 2
2606 	u8	alt_vlan_pcp;
2607 	#define CMDQ_MODIFY_ROCE_CC_TLV_ALT_VLAN_PCP_MASK 0x7UL
2608 	#define CMDQ_MODIFY_ROCE_CC_TLV_ALT_VLAN_PCP_SFT 0
2609 	#define CMDQ_MODIFY_ROCE_CC_TLV_RSVD3_MASK       0xf8UL
2610 	#define CMDQ_MODIFY_ROCE_CC_TLV_RSVD3_SFT        3
2611 	__le16	alt_tos_dscp;
2612 	#define CMDQ_MODIFY_ROCE_CC_TLV_ALT_TOS_DSCP_MASK 0x3fUL
2613 	#define CMDQ_MODIFY_ROCE_CC_TLV_ALT_TOS_DSCP_SFT 0
2614 	#define CMDQ_MODIFY_ROCE_CC_TLV_RSVD4_MASK       0xffc0UL
2615 	#define CMDQ_MODIFY_ROCE_CC_TLV_RSVD4_SFT        6
2616 	__le16	rtt;
2617 	#define CMDQ_MODIFY_ROCE_CC_TLV_RTT_MASK  0x3fffUL
2618 	#define CMDQ_MODIFY_ROCE_CC_TLV_RTT_SFT   0
2619 	#define CMDQ_MODIFY_ROCE_CC_TLV_RSVD5_MASK 0xc000UL
2620 	#define CMDQ_MODIFY_ROCE_CC_TLV_RSVD5_SFT 14
2621 	__le16	tcp_cp;
2622 	#define CMDQ_MODIFY_ROCE_CC_TLV_TCP_CP_MASK 0x3ffUL
2623 	#define CMDQ_MODIFY_ROCE_CC_TLV_TCP_CP_SFT 0
2624 	#define CMDQ_MODIFY_ROCE_CC_TLV_RSVD6_MASK 0xfc00UL
2625 	#define CMDQ_MODIFY_ROCE_CC_TLV_RSVD6_SFT  10
2626 	u8	cc_mode;
2627 	#define CMDQ_MODIFY_ROCE_CC_TLV_CC_MODE_DCTCP_CC_MODE         0x0UL
2628 	#define CMDQ_MODIFY_ROCE_CC_TLV_CC_MODE_PROBABILISTIC_CC_MODE 0x1UL
2629 	#define CMDQ_MODIFY_ROCE_CC_TLV_CC_MODE_LAST\
2630 		CMDQ_MODIFY_ROCE_CC_TLV_CC_MODE_PROBABILISTIC_CC_MODE
2631 	u8	tx_queue;
2632 	__le16	inactivity_th;
2633 	u8	time_per_phase;
2634 	u8	reserved8_1;
2635 	__le16	reserved16;
2636 	__le32	reserved32;
2637 	__le64	reserved64;
2638 	__le64	reservedtlvpad;
2639 };
2640 
2641 /* cmdq_modify_roce_cc_gen1_tlv (size:768b/96B) */
2642 struct cmdq_modify_roce_cc_gen1_tlv {
2643 	__le16	cmd_discr;
2644 	u8	reserved_8b;
2645 	u8	tlv_flags;
2646 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_MORE         0x1UL
2647 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_MORE_LAST      0x0UL
2648 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_MORE_NOT_LAST  0x1UL
2649 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_REQUIRED     0x2UL
2650 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_REQUIRED_NO    (0x0UL << 1)
2651 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_REQUIRED_YES   (0x1UL << 1)
2652 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_REQUIRED_LAST\
2653 		CMDQ_MODIFY_ROCE_CC_GEN1_TLV_TLV_FLAGS_REQUIRED_YES
2654 	__le16	tlv_type;
2655 	__le16	length;
2656 	__le64	reserved64;
2657 	__le64	modify_mask;
2658 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_MIN_TIME_BETWEEN_CNPS       0x1UL
2659 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_INIT_CP                     0x2UL
2660 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_TR_UPDATE_MODE              0x4UL
2661 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_TR_UPDATE_CYCLES            0x8UL
2662 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_FR_NUM_RTTS                 0x10UL
2663 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_AI_RATE_INCREASE            0x20UL
2664 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_REDUCTION_RELAX_RTTS_TH     0x40UL
2665 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_ADDITIONAL_RELAX_CR_TH      0x80UL
2666 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CR_MIN_TH                   0x100UL
2667 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_BW_AVG_WEIGHT               0x200UL
2668 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_ACTUAL_CR_FACTOR            0x400UL
2669 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_MAX_CP_CR_TH                0x800UL
2670 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CP_BIAS_EN                  0x1000UL
2671 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CP_BIAS                     0x2000UL
2672 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CNP_ECN                     0x4000UL
2673 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_RTT_JITTER_EN               0x8000UL
2674 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_LINK_BYTES_PER_USEC         0x10000UL
2675 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_RESET_CC_CR_TH              0x20000UL
2676 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CR_WIDTH                    0x40000UL
2677 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_QUOTA_PERIOD_MIN            0x80000UL
2678 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_QUOTA_PERIOD_MAX            0x100000UL
2679 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_QUOTA_PERIOD_ABS_MAX        0x200000UL
2680 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_TR_LOWER_BOUND              0x400000UL
2681 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CR_PROB_FACTOR              0x800000UL
2682 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_TR_PROB_FACTOR              0x1000000UL
2683 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_FAIRNESS_CR_TH              0x2000000UL
2684 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_RED_DIV                     0x4000000UL
2685 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CNP_RATIO_TH                0x8000000UL
2686 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_EXP_AI_RTTS                 0x10000000UL
2687 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_EXP_AI_CR_CP_RATIO          0x20000000UL
2688 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CP_EXP_UPDATE_TH            0x40000000UL
2689 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_HIGH_EXP_AI_RTTS_TH1        0x80000000UL
2690 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_HIGH_EXP_AI_RTTS_TH2        0x100000000ULL
2691 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_USE_RATE_TABLE              0x200000000ULL
2692 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_LINK64B_PER_RTT             0x400000000ULL
2693 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_ACTUAL_CR_CONG_FREE_RTTS_TH 0x800000000ULL
2694 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_SEVERE_CONG_CR_TH1          0x1000000000ULL
2695 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_SEVERE_CONG_CR_TH2          0x2000000000ULL
2696 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_CC_ACK_BYTES                0x4000000000ULL
2697 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_REDUCE_INIT_EN              0x8000000000ULL
2698 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_REDUCE_INIT_CONG_FREE_RTTS_TH \
2699 										0x10000000000ULL
2700 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_RANDOM_NO_RED_EN 0x20000000000ULL
2701 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_ACTUAL_CR_SHIFT_CORRECTION_EN \
2702 										0x40000000000ULL
2703 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_MODIFY_MASK_QUOTA_PERIOD_ADJUST_EN 0x80000000000ULL
2704 	__le16	inactivity_th_hi;
2705 	__le16	min_time_between_cnps;
2706 	__le16	init_cp;
2707 	u8	tr_update_mode;
2708 	u8	tr_update_cycles;
2709 	u8	fr_num_rtts;
2710 	u8	ai_rate_increase;
2711 	__le16	reduction_relax_rtts_th;
2712 	__le16	additional_relax_cr_th;
2713 	__le16	cr_min_th;
2714 	u8	bw_avg_weight;
2715 	u8	actual_cr_factor;
2716 	__le16	max_cp_cr_th;
2717 	u8	cp_bias_en;
2718 	u8	cp_bias;
2719 	u8	cnp_ecn;
2720 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_CNP_ECN_NOT_ECT 0x0UL
2721 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_CNP_ECN_ECT_1   0x1UL
2722 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_CNP_ECN_ECT_0   0x2UL
2723 	#define CMDQ_MODIFY_ROCE_CC_GEN1_TLV_CNP_ECN_LAST CMDQ_MODIFY_ROCE_CC_GEN1_TLV_CNP_ECN_ECT_0
2724 	u8	rtt_jitter_en;
2725 	__le16	link_bytes_per_usec;
2726 	__le16	reset_cc_cr_th;
2727 	u8	cr_width;
2728 	u8	quota_period_min;
2729 	u8	quota_period_max;
2730 	u8	quota_period_abs_max;
2731 	__le16	tr_lower_bound;
2732 	u8	cr_prob_factor;
2733 	u8	tr_prob_factor;
2734 	__le16	fairness_cr_th;
2735 	u8	red_div;
2736 	u8	cnp_ratio_th;
2737 	__le16	exp_ai_rtts;
2738 	u8	exp_ai_cr_cp_ratio;
2739 	u8	use_rate_table;
2740 	__le16	cp_exp_update_th;
2741 	__le16	high_exp_ai_rtts_th1;
2742 	__le16	high_exp_ai_rtts_th2;
2743 	__le16	actual_cr_cong_free_rtts_th;
2744 	__le16	severe_cong_cr_th1;
2745 	__le16	severe_cong_cr_th2;
2746 	__le32	link64B_per_rtt;
2747 	u8	cc_ack_bytes;
2748 	u8	reduce_init_en;
2749 	__le16	reduce_init_cong_free_rtts_th;
2750 	u8	random_no_red_en;
2751 	u8	actual_cr_shift_correction_en;
2752 	u8	quota_period_adjust_en;
2753 	u8	reserved[5];
2754 };
2755 
2756 /* creq_modify_roce_cc_resp (size:128b/16B) */
2757 struct creq_modify_roce_cc_resp {
2758 	u8	type;
2759 	#define CREQ_MODIFY_ROCE_CC_RESP_TYPE_MASK    0x3fUL
2760 	#define CREQ_MODIFY_ROCE_CC_RESP_TYPE_SFT     0
2761 	#define CREQ_MODIFY_ROCE_CC_RESP_TYPE_QP_EVENT  0x38UL
2762 	#define CREQ_MODIFY_ROCE_CC_RESP_TYPE_LAST     CREQ_MODIFY_ROCE_CC_RESP_TYPE_QP_EVENT
2763 	u8	status;
2764 	__le16	cookie;
2765 	__le32	reserved32;
2766 	u8	v;
2767 	#define CREQ_MODIFY_ROCE_CC_RESP_V     0x1UL
2768 	u8	event;
2769 	#define CREQ_MODIFY_ROCE_CC_RESP_EVENT_MODIFY_ROCE_CC 0x8cUL
2770 	#define CREQ_MODIFY_ROCE_CC_RESP_EVENT_LAST   CREQ_MODIFY_ROCE_CC_RESP_EVENT_MODIFY_ROCE_CC
2771 	u8	reserved48[6];
2772 };
2773 
2774 /* cmdq_set_link_aggr_mode_cc (size:320b/40B) */
2775 struct cmdq_set_link_aggr_mode_cc {
2776 	u8	opcode;
2777 	#define CMDQ_SET_LINK_AGGR_MODE_OPCODE_SET_LINK_AGGR_MODE 0x8fUL
2778 	#define CMDQ_SET_LINK_AGGR_MODE_OPCODE_LAST \
2779 		CMDQ_SET_LINK_AGGR_MODE_OPCODE_SET_LINK_AGGR_MODE
2780 	u8	cmd_size;
2781 	__le16	flags;
2782 	__le16	cookie;
2783 	u8	resp_size;
2784 	u8	reserved8;
2785 	__le64	resp_addr;
2786 	__le32	modify_mask;
2787 	#define CMDQ_SET_LINK_AGGR_MODE_MODIFY_MASK_AGGR_EN             0x1UL
2788 	#define CMDQ_SET_LINK_AGGR_MODE_MODIFY_MASK_ACTIVE_PORT_MAP     0x2UL
2789 	#define CMDQ_SET_LINK_AGGR_MODE_MODIFY_MASK_MEMBER_PORT_MAP     0x4UL
2790 	#define CMDQ_SET_LINK_AGGR_MODE_MODIFY_MASK_AGGR_MODE           0x8UL
2791 	#define CMDQ_SET_LINK_AGGR_MODE_MODIFY_MASK_STAT_CTX_ID         0x10UL
2792 	u8	aggr_enable;
2793 	#define CMDQ_SET_LINK_AGGR_MODE_AGGR_ENABLE     0x1UL
2794 	#define CMDQ_SET_LINK_AGGR_MODE_RSVD1_MASK      0xfeUL
2795 	#define CMDQ_SET_LINK_AGGR_MODE_RSVD1_SFT       1
2796 	u8	active_port_map;
2797 	#define CMDQ_SET_LINK_AGGR_MODE_ACTIVE_PORT_MAP_MASK 0xfUL
2798 	#define CMDQ_SET_LINK_AGGR_MODE_ACTIVE_PORT_MAP_SFT 0
2799 	#define CMDQ_SET_LINK_AGGR_MODE_RSVD2_MASK          0xf0UL
2800 	#define CMDQ_SET_LINK_AGGR_MODE_RSVD2_SFT           4
2801 	u8	member_port_map;
2802 	u8	link_aggr_mode;
2803 	#define CMDQ_SET_LINK_AGGR_MODE_AGGR_MODE_ACTIVE_ACTIVE 0x1UL
2804 	#define CMDQ_SET_LINK_AGGR_MODE_AGGR_MODE_ACTIVE_BACKUP 0x2UL
2805 	#define CMDQ_SET_LINK_AGGR_MODE_AGGR_MODE_BALANCE_XOR   0x3UL
2806 	#define CMDQ_SET_LINK_AGGR_MODE_AGGR_MODE_802_3_AD      0x4UL
2807 	#define CMDQ_SET_LINK_AGGR_MODE_AGGR_MODE_LAST CMDQ_SET_LINK_AGGR_MODE_AGGR_MODE_802_3_AD
2808 	__le16	stat_ctx_id[4];
2809 	__le64	rsvd1;
2810 };
2811 
2812 /* creq_set_link_aggr_mode_resources_resp (size:128b/16B) */
2813 struct creq_set_link_aggr_mode_resources_resp {
2814 	u8	type;
2815 	#define CREQ_SET_LINK_AGGR_MODE_RESP_TYPE_MASK    0x3fUL
2816 	#define CREQ_SET_LINK_AGGR_MODE_RESP_TYPE_SFT     0
2817 	#define CREQ_SET_LINK_AGGR_MODE_RESP_TYPE_QP_EVENT  0x38UL
2818 	#define CREQ_SET_LINK_AGGR_MODE_RESP_TYPE_LAST CREQ_SET_LINK_AGGR_MODE_RESP_TYPE_QP_EVENT
2819 	u8	status;
2820 	__le16	cookie;
2821 	__le32	reserved32;
2822 	u8	v;
2823 	#define CREQ_SET_LINK_AGGR_MODE_RESP_V     0x1UL
2824 	u8	event;
2825 	#define CREQ_SET_LINK_AGGR_MODE_RESP_EVENT_SET_LINK_AGGR_MODE 0x8fUL
2826 	#define CREQ_SET_LINK_AGGR_MODE_RESP_EVENT_LAST\
2827 		CREQ_SET_LINK_AGGR_MODE_RESP_EVENT_SET_LINK_AGGR_MODE
2828 	u8	reserved48[6];
2829 };
2830 
2831 /* creq_func_event (size:128b/16B) */
2832 struct creq_func_event {
2833 	u8	type;
2834 	#define CREQ_FUNC_EVENT_TYPE_MASK      0x3fUL
2835 	#define CREQ_FUNC_EVENT_TYPE_SFT       0
2836 	#define CREQ_FUNC_EVENT_TYPE_FUNC_EVENT  0x3aUL
2837 	#define CREQ_FUNC_EVENT_TYPE_LAST       CREQ_FUNC_EVENT_TYPE_FUNC_EVENT
2838 	u8	reserved56[7];
2839 	u8	v;
2840 	#define CREQ_FUNC_EVENT_V     0x1UL
2841 	u8	event;
2842 	#define CREQ_FUNC_EVENT_EVENT_TX_WQE_ERROR       0x1UL
2843 	#define CREQ_FUNC_EVENT_EVENT_TX_DATA_ERROR      0x2UL
2844 	#define CREQ_FUNC_EVENT_EVENT_RX_WQE_ERROR       0x3UL
2845 	#define CREQ_FUNC_EVENT_EVENT_RX_DATA_ERROR      0x4UL
2846 	#define CREQ_FUNC_EVENT_EVENT_CQ_ERROR           0x5UL
2847 	#define CREQ_FUNC_EVENT_EVENT_TQM_ERROR          0x6UL
2848 	#define CREQ_FUNC_EVENT_EVENT_CFCQ_ERROR         0x7UL
2849 	#define CREQ_FUNC_EVENT_EVENT_CFCS_ERROR         0x8UL
2850 	#define CREQ_FUNC_EVENT_EVENT_CFCC_ERROR         0x9UL
2851 	#define CREQ_FUNC_EVENT_EVENT_CFCM_ERROR         0xaUL
2852 	#define CREQ_FUNC_EVENT_EVENT_TIM_ERROR          0xbUL
2853 	#define CREQ_FUNC_EVENT_EVENT_VF_COMM_REQUEST    0x80UL
2854 	#define CREQ_FUNC_EVENT_EVENT_RESOURCE_EXHAUSTED 0x81UL
2855 	#define CREQ_FUNC_EVENT_EVENT_LAST              CREQ_FUNC_EVENT_EVENT_RESOURCE_EXHAUSTED
2856 	u8	reserved48[6];
2857 };
2858 
2859 /* creq_qp_event (size:128b/16B) */
2860 struct creq_qp_event {
2861 	u8	type;
2862 	#define CREQ_QP_EVENT_TYPE_MASK    0x3fUL
2863 	#define CREQ_QP_EVENT_TYPE_SFT     0
2864 	#define CREQ_QP_EVENT_TYPE_QP_EVENT  0x38UL
2865 	#define CREQ_QP_EVENT_TYPE_LAST     CREQ_QP_EVENT_TYPE_QP_EVENT
2866 	u8	status;
2867 	#define CREQ_QP_EVENT_STATUS_SUCCESS           0x0UL
2868 	#define CREQ_QP_EVENT_STATUS_FAIL              0x1UL
2869 	#define CREQ_QP_EVENT_STATUS_RESOURCES         0x2UL
2870 	#define CREQ_QP_EVENT_STATUS_INVALID_CMD       0x3UL
2871 	#define CREQ_QP_EVENT_STATUS_NOT_IMPLEMENTED   0x4UL
2872 	#define CREQ_QP_EVENT_STATUS_INVALID_PARAMETER 0x5UL
2873 	#define CREQ_QP_EVENT_STATUS_HARDWARE_ERROR    0x6UL
2874 	#define CREQ_QP_EVENT_STATUS_INTERNAL_ERROR    0x7UL
2875 	#define CREQ_QP_EVENT_STATUS_LAST             CREQ_QP_EVENT_STATUS_INTERNAL_ERROR
2876 	__le16	cookie;
2877 	__le32	reserved32;
2878 	u8	v;
2879 	#define CREQ_QP_EVENT_V     0x1UL
2880 	u8	event;
2881 	#define CREQ_QP_EVENT_EVENT_CREATE_QP             0x1UL
2882 	#define CREQ_QP_EVENT_EVENT_DESTROY_QP            0x2UL
2883 	#define CREQ_QP_EVENT_EVENT_MODIFY_QP             0x3UL
2884 	#define CREQ_QP_EVENT_EVENT_QUERY_QP              0x4UL
2885 	#define CREQ_QP_EVENT_EVENT_CREATE_SRQ            0x5UL
2886 	#define CREQ_QP_EVENT_EVENT_DESTROY_SRQ           0x6UL
2887 	#define CREQ_QP_EVENT_EVENT_QUERY_SRQ             0x8UL
2888 	#define CREQ_QP_EVENT_EVENT_CREATE_CQ             0x9UL
2889 	#define CREQ_QP_EVENT_EVENT_DESTROY_CQ            0xaUL
2890 	#define CREQ_QP_EVENT_EVENT_RESIZE_CQ             0xcUL
2891 	#define CREQ_QP_EVENT_EVENT_ALLOCATE_MRW          0xdUL
2892 	#define CREQ_QP_EVENT_EVENT_DEALLOCATE_KEY        0xeUL
2893 	#define CREQ_QP_EVENT_EVENT_REGISTER_MR           0xfUL
2894 	#define CREQ_QP_EVENT_EVENT_DEREGISTER_MR         0x10UL
2895 	#define CREQ_QP_EVENT_EVENT_ADD_GID               0x11UL
2896 	#define CREQ_QP_EVENT_EVENT_DELETE_GID            0x12UL
2897 	#define CREQ_QP_EVENT_EVENT_MODIFY_GID            0x17UL
2898 	#define CREQ_QP_EVENT_EVENT_QUERY_GID             0x18UL
2899 	#define CREQ_QP_EVENT_EVENT_CREATE_QP1            0x13UL
2900 	#define CREQ_QP_EVENT_EVENT_DESTROY_QP1           0x14UL
2901 	#define CREQ_QP_EVENT_EVENT_CREATE_AH             0x15UL
2902 	#define CREQ_QP_EVENT_EVENT_DESTROY_AH            0x16UL
2903 	#define CREQ_QP_EVENT_EVENT_INITIALIZE_FW         0x80UL
2904 	#define CREQ_QP_EVENT_EVENT_DEINITIALIZE_FW       0x81UL
2905 	#define CREQ_QP_EVENT_EVENT_STOP_FUNC             0x82UL
2906 	#define CREQ_QP_EVENT_EVENT_QUERY_FUNC            0x83UL
2907 	#define CREQ_QP_EVENT_EVENT_SET_FUNC_RESOURCES    0x84UL
2908 	#define CREQ_QP_EVENT_EVENT_READ_CONTEXT          0x85UL
2909 	#define CREQ_QP_EVENT_EVENT_MAP_TC_TO_COS         0x8aUL
2910 	#define CREQ_QP_EVENT_EVENT_QUERY_VERSION         0x8bUL
2911 	#define CREQ_QP_EVENT_EVENT_MODIFY_CC             0x8cUL
2912 	#define CREQ_QP_EVENT_EVENT_QUERY_CC              0x8dUL
2913 	#define CREQ_QP_EVENT_EVENT_QUERY_ROCE_STATS      0x8eUL
2914 	#define CREQ_QP_EVENT_EVENT_SET_LINK_AGGR_MODE    0x8fUL
2915 	#define CREQ_QP_EVENT_EVENT_QUERY_QP_EXTEND       0x91UL
2916 	#define CREQ_QP_EVENT_EVENT_QP_ERROR_NOTIFICATION 0xc0UL
2917 	#define CREQ_QP_EVENT_EVENT_CQ_ERROR_NOTIFICATION 0xc1UL
2918 	#define CREQ_QP_EVENT_EVENT_LAST                 CREQ_QP_EVENT_EVENT_CQ_ERROR_NOTIFICATION
2919 	u8	reserved48[6];
2920 };
2921 
2922 /* creq_qp_error_notification (size:128b/16B) */
2923 struct creq_qp_error_notification {
2924 	u8	type;
2925 	#define CREQ_QP_ERROR_NOTIFICATION_TYPE_MASK    0x3fUL
2926 	#define CREQ_QP_ERROR_NOTIFICATION_TYPE_SFT     0
2927 	#define CREQ_QP_ERROR_NOTIFICATION_TYPE_QP_EVENT  0x38UL
2928 	#define CREQ_QP_ERROR_NOTIFICATION_TYPE_LAST     CREQ_QP_ERROR_NOTIFICATION_TYPE_QP_EVENT
2929 	u8	status;
2930 	u8	req_slow_path_state;
2931 	u8	req_err_state_reason;
2932 	__le32	xid;
2933 	u8	v;
2934 	#define CREQ_QP_ERROR_NOTIFICATION_V     0x1UL
2935 	u8	event;
2936 	#define CREQ_QP_ERROR_NOTIFICATION_EVENT_QP_ERROR_NOTIFICATION 0xc0UL
2937 	#define CREQ_QP_ERROR_NOTIFICATION_EVENT_LAST \
2938 		CREQ_QP_ERROR_NOTIFICATION_EVENT_QP_ERROR_NOTIFICATION
2939 	u8	res_slow_path_state;
2940 	u8	res_err_state_reason;
2941 	__le16	sq_cons_idx;
2942 	__le16	rq_cons_idx;
2943 };
2944 
2945 /* creq_cq_error_notification (size:128b/16B) */
2946 struct creq_cq_error_notification {
2947 	u8	type;
2948 	#define CREQ_CQ_ERROR_NOTIFICATION_TYPE_MASK    0x3fUL
2949 	#define CREQ_CQ_ERROR_NOTIFICATION_TYPE_SFT     0
2950 	#define CREQ_CQ_ERROR_NOTIFICATION_TYPE_CQ_EVENT  0x38UL
2951 	#define CREQ_CQ_ERROR_NOTIFICATION_TYPE_LAST     CREQ_CQ_ERROR_NOTIFICATION_TYPE_CQ_EVENT
2952 	u8	status;
2953 	u8	cq_err_reason;
2954 	#define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_REQ_CQ_INVALID_ERROR  0x1UL
2955 	#define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_REQ_CQ_OVERFLOW_ERROR 0x2UL
2956 	#define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_REQ_CQ_LOAD_ERROR     0x3UL
2957 	#define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_RES_CQ_INVALID_ERROR  0x4UL
2958 	#define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_RES_CQ_OVERFLOW_ERROR 0x5UL
2959 	#define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_RES_CQ_LOAD_ERROR     0x6UL
2960 	#define CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_LAST \
2961 			CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_RES_CQ_LOAD_ERROR
2962 	u8	reserved8;
2963 	__le32	xid;
2964 	u8	v;
2965 	#define CREQ_CQ_ERROR_NOTIFICATION_V     0x1UL
2966 	u8	event;
2967 	#define CREQ_CQ_ERROR_NOTIFICATION_EVENT_CQ_ERROR_NOTIFICATION 0xc1UL
2968 	#define CREQ_CQ_ERROR_NOTIFICATION_EVENT_LAST \
2969 		CREQ_CQ_ERROR_NOTIFICATION_EVENT_CQ_ERROR_NOTIFICATION
2970 	u8	reserved48[6];
2971 };
2972 
2973 /* sq_base (size:64b/8B) */
2974 struct sq_base {
2975 	u8	wqe_type;
2976 	#define SQ_BASE_WQE_TYPE_SEND           0x0UL
2977 	#define SQ_BASE_WQE_TYPE_SEND_W_IMMEAD  0x1UL
2978 	#define SQ_BASE_WQE_TYPE_SEND_W_INVALID 0x2UL
2979 	#define SQ_BASE_WQE_TYPE_WRITE_WQE      0x4UL
2980 	#define SQ_BASE_WQE_TYPE_WRITE_W_IMMEAD 0x5UL
2981 	#define SQ_BASE_WQE_TYPE_READ_WQE       0x6UL
2982 	#define SQ_BASE_WQE_TYPE_ATOMIC_CS      0x8UL
2983 	#define SQ_BASE_WQE_TYPE_ATOMIC_FA      0xbUL
2984 	#define SQ_BASE_WQE_TYPE_LOCAL_INVALID  0xcUL
2985 	#define SQ_BASE_WQE_TYPE_FR_PMR         0xdUL
2986 	#define SQ_BASE_WQE_TYPE_BIND           0xeUL
2987 	#define SQ_BASE_WQE_TYPE_FR_PPMR        0xfUL
2988 	#define SQ_BASE_WQE_TYPE_LAST          SQ_BASE_WQE_TYPE_FR_PPMR
2989 	u8	unused_0[7];
2990 };
2991 
2992 /* sq_sge (size:128b/16B) */
2993 struct sq_sge {
2994 	__le64	va_or_pa;
2995 	__le32	l_key;
2996 	__le32	size;
2997 };
2998 
2999 /* sq_psn_search (size:64b/8B) */
3000 struct sq_psn_search {
3001 	__le32	opcode_start_psn;
3002 	#define SQ_PSN_SEARCH_START_PSN_MASK 0xffffffUL
3003 	#define SQ_PSN_SEARCH_START_PSN_SFT 0
3004 	#define SQ_PSN_SEARCH_OPCODE_MASK   0xff000000UL
3005 	#define SQ_PSN_SEARCH_OPCODE_SFT    24
3006 	__le32	flags_next_psn;
3007 	#define SQ_PSN_SEARCH_NEXT_PSN_MASK 0xffffffUL
3008 	#define SQ_PSN_SEARCH_NEXT_PSN_SFT 0
3009 	#define SQ_PSN_SEARCH_FLAGS_MASK   0xff000000UL
3010 	#define SQ_PSN_SEARCH_FLAGS_SFT    24
3011 };
3012 
3013 /* sq_psn_search_ext (size:128b/16B) */
3014 struct sq_psn_search_ext {
3015 	__le32	opcode_start_psn;
3016 	#define SQ_PSN_SEARCH_EXT_START_PSN_MASK 0xffffffUL
3017 	#define SQ_PSN_SEARCH_EXT_START_PSN_SFT 0
3018 	#define SQ_PSN_SEARCH_EXT_OPCODE_MASK   0xff000000UL
3019 	#define SQ_PSN_SEARCH_EXT_OPCODE_SFT    24
3020 	__le32	flags_next_psn;
3021 	#define SQ_PSN_SEARCH_EXT_NEXT_PSN_MASK 0xffffffUL
3022 	#define SQ_PSN_SEARCH_EXT_NEXT_PSN_SFT 0
3023 	#define SQ_PSN_SEARCH_EXT_FLAGS_MASK   0xff000000UL
3024 	#define SQ_PSN_SEARCH_EXT_FLAGS_SFT    24
3025 	__le16	start_slot_idx;
3026 	__le16	reserved16;
3027 	__le32	reserved32;
3028 };
3029 
3030 /* sq_msn_search (size:64b/8B) */
3031 struct sq_msn_search {
3032 	__le64	start_idx_next_psn_start_psn;
3033 	#define SQ_MSN_SEARCH_START_PSN_MASK 0xffffffUL
3034 	#define SQ_MSN_SEARCH_START_PSN_SFT 0
3035 	#define SQ_MSN_SEARCH_NEXT_PSN_MASK 0xffffff000000ULL
3036 	#define SQ_MSN_SEARCH_NEXT_PSN_SFT  24
3037 	#define SQ_MSN_SEARCH_START_IDX_MASK 0xffff000000000000ULL
3038 	#define SQ_MSN_SEARCH_START_IDX_SFT 48
3039 };
3040 
3041 /* sq_send (size:1024b/128B) */
3042 struct sq_send {
3043 	u8	wqe_type;
3044 	#define SQ_SEND_WQE_TYPE_SEND           0x0UL
3045 	#define SQ_SEND_WQE_TYPE_SEND_W_IMMEAD  0x1UL
3046 	#define SQ_SEND_WQE_TYPE_SEND_W_INVALID 0x2UL
3047 	#define SQ_SEND_WQE_TYPE_LAST          SQ_SEND_WQE_TYPE_SEND_W_INVALID
3048 	u8	flags;
3049 	#define SQ_SEND_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK 0xffUL
3050 	#define SQ_SEND_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT  0
3051 	#define SQ_SEND_FLAGS_SIGNAL_COMP                                            0x1UL
3052 	#define SQ_SEND_FLAGS_RD_OR_ATOMIC_FENCE                                     0x2UL
3053 	#define SQ_SEND_FLAGS_UC_FENCE                                               0x4UL
3054 	#define SQ_SEND_FLAGS_SE                                                     0x8UL
3055 	#define SQ_SEND_FLAGS_INLINE                                                 0x10UL
3056 	#define SQ_SEND_FLAGS_WQE_TS_EN                                              0x20UL
3057 	#define SQ_SEND_FLAGS_DEBUG_TRACE                                            0x40UL
3058 	u8	wqe_size;
3059 	u8	reserved8_1;
3060 	__le32	inv_key_or_imm_data;
3061 	__le32	length;
3062 	__le32	q_key;
3063 	__le32	dst_qp;
3064 	#define SQ_SEND_DST_QP_MASK 0xffffffUL
3065 	#define SQ_SEND_DST_QP_SFT 0
3066 	__le32	avid;
3067 	#define SQ_SEND_AVID_MASK 0xfffffUL
3068 	#define SQ_SEND_AVID_SFT 0
3069 	__le32	reserved32;
3070 	__le32	timestamp;
3071 	#define SQ_SEND_TIMESTAMP_MASK 0xffffffUL
3072 	#define SQ_SEND_TIMESTAMP_SFT 0
3073 	__le32	data[24];
3074 };
3075 
3076 /* sq_send_hdr (size:256b/32B) */
3077 struct sq_send_hdr {
3078 	u8	wqe_type;
3079 	#define SQ_SEND_HDR_WQE_TYPE_SEND           0x0UL
3080 	#define SQ_SEND_HDR_WQE_TYPE_SEND_W_IMMEAD  0x1UL
3081 	#define SQ_SEND_HDR_WQE_TYPE_SEND_W_INVALID 0x2UL
3082 	#define SQ_SEND_HDR_WQE_TYPE_LAST          SQ_SEND_HDR_WQE_TYPE_SEND_W_INVALID
3083 	u8	flags;
3084 	#define SQ_SEND_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK 0xffUL
3085 	#define SQ_SEND_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT  0
3086 	#define SQ_SEND_HDR_FLAGS_SIGNAL_COMP                                            0x1UL
3087 	#define SQ_SEND_HDR_FLAGS_RD_OR_ATOMIC_FENCE                                     0x2UL
3088 	#define SQ_SEND_HDR_FLAGS_UC_FENCE                                               0x4UL
3089 	#define SQ_SEND_HDR_FLAGS_SE                                                     0x8UL
3090 	#define SQ_SEND_HDR_FLAGS_INLINE                                                 0x10UL
3091 	#define SQ_SEND_HDR_FLAGS_WQE_TS_EN                                              0x20UL
3092 	#define SQ_SEND_HDR_FLAGS_DEBUG_TRACE                                            0x40UL
3093 	u8	wqe_size;
3094 	u8	reserved8_1;
3095 	__le32	inv_key_or_imm_data;
3096 	__le32	length;
3097 	__le32	q_key;
3098 	__le32	dst_qp;
3099 	#define SQ_SEND_HDR_DST_QP_MASK 0xffffffUL
3100 	#define SQ_SEND_HDR_DST_QP_SFT 0
3101 	__le32	avid;
3102 	#define SQ_SEND_HDR_AVID_MASK 0xfffffUL
3103 	#define SQ_SEND_HDR_AVID_SFT 0
3104 	__le32	reserved32;
3105 	__le32	timestamp;
3106 	#define SQ_SEND_HDR_TIMESTAMP_MASK 0xffffffUL
3107 	#define SQ_SEND_HDR_TIMESTAMP_SFT 0
3108 };
3109 
3110 /* sq_send_raweth_qp1 (size:1024b/128B) */
3111 struct sq_send_raweth_qp1 {
3112 	u8	wqe_type;
3113 	#define SQ_SEND_RAWETH_QP1_WQE_TYPE_SEND 0x0UL
3114 	#define SQ_SEND_RAWETH_QP1_WQE_TYPE_LAST SQ_SEND_RAWETH_QP1_WQE_TYPE_SEND
3115 	u8	flags;
3116 	#define SQ_SEND_RAWETH_QP1_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK \
3117 		0xffUL
3118 	#define SQ_SEND_RAWETH_QP1_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT \
3119 		0
3120 	#define SQ_SEND_RAWETH_QP1_FLAGS_SIGNAL_COMP  0x1UL
3121 	#define SQ_SEND_RAWETH_QP1_FLAGS_RD_OR_ATOMIC_FENCE  0x2UL
3122 	#define SQ_SEND_RAWETH_QP1_FLAGS_UC_FENCE 0x4UL
3123 	#define SQ_SEND_RAWETH_QP1_FLAGS_SE	0x8UL
3124 	#define SQ_SEND_RAWETH_QP1_FLAGS_INLINE 0x10UL
3125 	#define SQ_SEND_RAWETH_QP1_FLAGS_WQE_TS_EN 0x20UL
3126 	#define SQ_SEND_RAWETH_QP1_FLAGS_DEBUG_TRACE 0x40UL
3127 	u8	wqe_size;
3128 	u8	reserved8;
3129 	__le16	lflags;
3130 	#define SQ_SEND_RAWETH_QP1_LFLAGS_TCP_UDP_CHKSUM     0x1UL
3131 	#define SQ_SEND_RAWETH_QP1_LFLAGS_IP_CHKSUM          0x2UL
3132 	#define SQ_SEND_RAWETH_QP1_LFLAGS_NOCRC              0x4UL
3133 	#define SQ_SEND_RAWETH_QP1_LFLAGS_STAMP              0x8UL
3134 	#define SQ_SEND_RAWETH_QP1_LFLAGS_T_IP_CHKSUM        0x10UL
3135 	#define SQ_SEND_RAWETH_QP1_LFLAGS_ROCE_CRC           0x100UL
3136 	#define SQ_SEND_RAWETH_QP1_LFLAGS_FCOE_CRC           0x200UL
3137 	__le16	cfa_action;
3138 	__le32	length;
3139 	__le32	reserved32_1;
3140 	__le32	cfa_meta;
3141 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_VID_MASK     0xfffUL
3142 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_VID_SFT      0
3143 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_DE           0x1000UL
3144 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_PRI_MASK     0xe000UL
3145 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_PRI_SFT      13
3146 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_MASK    0x70000UL
3147 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_SFT     16
3148 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID88A8  (0x0UL << 16)
3149 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID8100  (0x1UL << 16)
3150 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID9100  (0x2UL << 16)
3151 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID9200  (0x3UL << 16)
3152 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPID9300  (0x4UL << 16)
3153 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPIDCFG   (0x5UL << 16)
3154 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_LAST\
3155 		SQ_SEND_RAWETH_QP1_CFA_META_VLAN_TPID_TPIDCFG
3156 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_RESERVED_MASK 0xff80000UL
3157 	#define SQ_SEND_RAWETH_QP1_CFA_META_VLAN_RESERVED_SFT 19
3158 	#define SQ_SEND_RAWETH_QP1_CFA_META_KEY_MASK          0xf0000000UL
3159 	#define SQ_SEND_RAWETH_QP1_CFA_META_KEY_SFT           28
3160 	#define SQ_SEND_RAWETH_QP1_CFA_META_KEY_NONE            (0x0UL << 28)
3161 	#define SQ_SEND_RAWETH_QP1_CFA_META_KEY_VLAN_TAG        (0x1UL << 28)
3162 	#define SQ_SEND_RAWETH_QP1_CFA_META_KEY_LAST SQ_SEND_RAWETH_QP1_CFA_META_KEY_VLAN_TAG
3163 	__le32	reserved32_2;
3164 	__le32	reserved32_3;
3165 	__le32	timestamp;
3166 	#define SQ_SEND_RAWETH_QP1_TIMESTAMP_MASK 0xffffffUL
3167 	#define SQ_SEND_RAWETH_QP1_TIMESTAMP_SFT 0
3168 	__le32	data[24];
3169 };
3170 
3171 /* sq_send_raweth_qp1_hdr (size:256b/32B) */
3172 struct sq_send_raweth_qp1_hdr {
3173 	u8	wqe_type;
3174 	#define SQ_SEND_RAWETH_QP1_HDR_WQE_TYPE_SEND 0x0UL
3175 	#define SQ_SEND_RAWETH_QP1_HDR_WQE_TYPE_LAST SQ_SEND_RAWETH_QP1_HDR_WQE_TYPE_SEND
3176 	u8	flags;
3177 	#define \
3178 	SQ_SEND_RAWETH_QP1_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK 0xffUL
3179 	#define SQ_SEND_RAWETH_QP1_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT\
3180 		0
3181 	#define SQ_SEND_RAWETH_QP1_HDR_FLAGS_SIGNAL_COMP 0x1UL
3182 	#define SQ_SEND_RAWETH_QP1_HDR_FLAGS_RD_OR_ATOMIC_FENCE 0x2UL
3183 	#define SQ_SEND_RAWETH_QP1_HDR_FLAGS_UC_FENCE 0x4UL
3184 	#define SQ_SEND_RAWETH_QP1_HDR_FLAGS_SE 0x8UL
3185 	#define SQ_SEND_RAWETH_QP1_HDR_FLAGS_INLINE 0x10UL
3186 	#define SQ_SEND_RAWETH_QP1_HDR_FLAGS_WQE_TS_EN 0x20UL
3187 	#define SQ_SEND_RAWETH_QP1_HDR_FLAGS_DEBUG_TRACE 0x40UL
3188 	u8	wqe_size;
3189 	u8	reserved8;
3190 	__le16	lflags;
3191 	#define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_TCP_UDP_CHKSUM     0x1UL
3192 	#define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_IP_CHKSUM          0x2UL
3193 	#define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_NOCRC              0x4UL
3194 	#define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_STAMP              0x8UL
3195 	#define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_T_IP_CHKSUM        0x10UL
3196 	#define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_ROCE_CRC           0x100UL
3197 	#define SQ_SEND_RAWETH_QP1_HDR_LFLAGS_FCOE_CRC           0x200UL
3198 	__le16	cfa_action;
3199 	__le32	length;
3200 	__le32	reserved32_1;
3201 	__le32	cfa_meta;
3202 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_VID_MASK     0xfffUL
3203 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_VID_SFT      0
3204 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_DE           0x1000UL
3205 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_PRI_MASK     0xe000UL
3206 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_PRI_SFT      13
3207 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_MASK    0x70000UL
3208 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_SFT     16
3209 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPID88A8  (0x0UL << 16)
3210 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPID8100  (0x1UL << 16)
3211 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPID9100  (0x2UL << 16)
3212 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPID9200  (0x3UL << 16)
3213 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPID9300  (0x4UL << 16)
3214 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPIDCFG   (0x5UL << 16)
3215 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_LAST\
3216 			SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_TPID_TPIDCFG
3217 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_RESERVED_MASK 0xff80000UL
3218 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_VLAN_RESERVED_SFT 19
3219 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_KEY_MASK          0xf0000000UL
3220 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_KEY_SFT           28
3221 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_KEY_NONE            (0x0UL << 28)
3222 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_KEY_VLAN_TAG        (0x1UL << 28)
3223 	#define SQ_SEND_RAWETH_QP1_HDR_CFA_META_KEY_LAST\
3224 		SQ_SEND_RAWETH_QP1_HDR_CFA_META_KEY_VLAN_TAG
3225 	__le32	reserved32_2;
3226 	__le32	reserved32_3;
3227 	__le32	timestamp;
3228 	#define SQ_SEND_RAWETH_QP1_HDR_TIMESTAMP_MASK 0xffffffUL
3229 	#define SQ_SEND_RAWETH_QP1_HDR_TIMESTAMP_SFT 0
3230 };
3231 
3232 /* sq_rdma (size:1024b/128B) */
3233 struct sq_rdma {
3234 	u8	wqe_type;
3235 	#define SQ_RDMA_WQE_TYPE_WRITE_WQE      0x4UL
3236 	#define SQ_RDMA_WQE_TYPE_WRITE_W_IMMEAD 0x5UL
3237 	#define SQ_RDMA_WQE_TYPE_READ_WQE       0x6UL
3238 	#define SQ_RDMA_WQE_TYPE_LAST          SQ_RDMA_WQE_TYPE_READ_WQE
3239 	u8	flags;
3240 	#define SQ_RDMA_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK 0xffUL
3241 	#define SQ_RDMA_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT  0
3242 	#define SQ_RDMA_FLAGS_SIGNAL_COMP                                            0x1UL
3243 	#define SQ_RDMA_FLAGS_RD_OR_ATOMIC_FENCE                                     0x2UL
3244 	#define SQ_RDMA_FLAGS_UC_FENCE                                               0x4UL
3245 	#define SQ_RDMA_FLAGS_SE                                                     0x8UL
3246 	#define SQ_RDMA_FLAGS_INLINE                                                 0x10UL
3247 	#define SQ_RDMA_FLAGS_WQE_TS_EN                                              0x20UL
3248 	#define SQ_RDMA_FLAGS_DEBUG_TRACE                                            0x40UL
3249 	u8	wqe_size;
3250 	u8	reserved8;
3251 	__le32	imm_data;
3252 	__le32	length;
3253 	__le32	reserved32_1;
3254 	__le64	remote_va;
3255 	__le32	remote_key;
3256 	__le32	timestamp;
3257 	#define SQ_RDMA_TIMESTAMP_MASK 0xffffffUL
3258 	#define SQ_RDMA_TIMESTAMP_SFT 0
3259 	__le32	data[24];
3260 };
3261 
3262 /* sq_rdma_hdr (size:256b/32B) */
3263 struct sq_rdma_hdr {
3264 	u8	wqe_type;
3265 	#define SQ_RDMA_HDR_WQE_TYPE_WRITE_WQE      0x4UL
3266 	#define SQ_RDMA_HDR_WQE_TYPE_WRITE_W_IMMEAD 0x5UL
3267 	#define SQ_RDMA_HDR_WQE_TYPE_READ_WQE       0x6UL
3268 	#define SQ_RDMA_HDR_WQE_TYPE_LAST          SQ_RDMA_HDR_WQE_TYPE_READ_WQE
3269 	u8	flags;
3270 	#define SQ_RDMA_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK 0xffUL
3271 	#define SQ_RDMA_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT  0
3272 	#define SQ_RDMA_HDR_FLAGS_SIGNAL_COMP                                            0x1UL
3273 	#define SQ_RDMA_HDR_FLAGS_RD_OR_ATOMIC_FENCE                                     0x2UL
3274 	#define SQ_RDMA_HDR_FLAGS_UC_FENCE                                               0x4UL
3275 	#define SQ_RDMA_HDR_FLAGS_SE                                                     0x8UL
3276 	#define SQ_RDMA_HDR_FLAGS_INLINE                                                 0x10UL
3277 	#define SQ_RDMA_HDR_FLAGS_WQE_TS_EN                                              0x20UL
3278 	#define SQ_RDMA_HDR_FLAGS_DEBUG_TRACE                                            0x40UL
3279 	u8	wqe_size;
3280 	u8	reserved8;
3281 	__le32	imm_data;
3282 	__le32	length;
3283 	__le32	reserved32_1;
3284 	__le64	remote_va;
3285 	__le32	remote_key;
3286 	__le32	timestamp;
3287 	#define SQ_RDMA_HDR_TIMESTAMP_MASK 0xffffffUL
3288 	#define SQ_RDMA_HDR_TIMESTAMP_SFT 0
3289 };
3290 
3291 /* sq_atomic (size:1024b/128B) */
3292 struct sq_atomic {
3293 	u8	wqe_type;
3294 	#define SQ_ATOMIC_WQE_TYPE_ATOMIC_CS 0x8UL
3295 	#define SQ_ATOMIC_WQE_TYPE_ATOMIC_FA 0xbUL
3296 	#define SQ_ATOMIC_WQE_TYPE_LAST     SQ_ATOMIC_WQE_TYPE_ATOMIC_FA
3297 	u8	flags;
3298 	#define SQ_ATOMIC_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK   0xffUL
3299 	#define SQ_ATOMIC_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT    0
3300 	#define SQ_ATOMIC_FLAGS_SIGNAL_COMP                                              0x1UL
3301 	#define SQ_ATOMIC_FLAGS_RD_OR_ATOMIC_FENCE                                       0x2UL
3302 	#define SQ_ATOMIC_FLAGS_UC_FENCE                                                 0x4UL
3303 	#define SQ_ATOMIC_FLAGS_SE                                                       0x8UL
3304 	#define SQ_ATOMIC_FLAGS_INLINE                                                   0x10UL
3305 	#define SQ_ATOMIC_FLAGS_WQE_TS_EN                                                0x20UL
3306 	#define SQ_ATOMIC_FLAGS_DEBUG_TRACE                                              0x40UL
3307 	__le16	reserved16;
3308 	__le32	remote_key;
3309 	__le64	remote_va;
3310 	__le64	swap_data;
3311 	__le64	cmp_data;
3312 	__le32	data[24];
3313 };
3314 
3315 /* sq_atomic_hdr (size:256b/32B) */
3316 struct sq_atomic_hdr {
3317 	u8	wqe_type;
3318 	#define SQ_ATOMIC_HDR_WQE_TYPE_ATOMIC_CS 0x8UL
3319 	#define SQ_ATOMIC_HDR_WQE_TYPE_ATOMIC_FA 0xbUL
3320 	#define SQ_ATOMIC_HDR_WQE_TYPE_LAST     SQ_ATOMIC_HDR_WQE_TYPE_ATOMIC_FA
3321 	u8	flags;
3322 	#define SQ_ATOMIC_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK 0xffUL
3323 	#define SQ_ATOMIC_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT 0
3324 	#define SQ_ATOMIC_HDR_FLAGS_SIGNAL_COMP  0x1UL
3325 	#define SQ_ATOMIC_HDR_FLAGS_RD_OR_ATOMIC_FENCE  0x2UL
3326 	#define SQ_ATOMIC_HDR_FLAGS_UC_FENCE            0x4UL
3327 	#define SQ_ATOMIC_HDR_FLAGS_SE                  0x8UL
3328 	#define SQ_ATOMIC_HDR_FLAGS_INLINE              0x10UL
3329 	#define SQ_ATOMIC_HDR_FLAGS_WQE_TS_EN           0x20UL
3330 	#define SQ_ATOMIC_HDR_FLAGS_DEBUG_TRACE         0x40UL
3331 	__le16	reserved16;
3332 	__le32	remote_key;
3333 	__le64	remote_va;
3334 	__le64	swap_data;
3335 	__le64	cmp_data;
3336 };
3337 
3338 /* sq_localinvalidate (size:1024b/128B) */
3339 struct sq_localinvalidate {
3340 	u8	wqe_type;
3341 	#define SQ_LOCALINVALIDATE_WQE_TYPE_LOCAL_INVALID 0xcUL
3342 	#define SQ_LOCALINVALIDATE_WQE_TYPE_LAST         SQ_LOCALINVALIDATE_WQE_TYPE_LOCAL_INVALID
3343 	u8	flags;
3344 	#define SQ_LOCALINVALIDATE_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK\
3345 		0xffUL
3346 	#define SQ_LOCALINVALIDATE_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT\
3347 		0
3348 	#define SQ_LOCALINVALIDATE_FLAGS_SIGNAL_COMP   0x1UL
3349 	#define SQ_LOCALINVALIDATE_FLAGS_RD_OR_ATOMIC_FENCE 0x2UL
3350 	#define SQ_LOCALINVALIDATE_FLAGS_UC_FENCE 0x4UL
3351 	#define SQ_LOCALINVALIDATE_FLAGS_SE 0x8UL
3352 	#define SQ_LOCALINVALIDATE_FLAGS_INLINE 0x10UL
3353 	#define SQ_LOCALINVALIDATE_FLAGS_WQE_TS_EN 0x20UL
3354 	#define SQ_LOCALINVALIDATE_FLAGS_DEBUG_TRACE 0x40UL
3355 	__le16	reserved16;
3356 	__le32	inv_l_key;
3357 	__le64	reserved64;
3358 	u8	reserved128[16];
3359 	__le32	data[24];
3360 };
3361 
3362 /* sq_localinvalidate_hdr (size:256b/32B) */
3363 struct sq_localinvalidate_hdr {
3364 	u8	wqe_type;
3365 	#define SQ_LOCALINVALIDATE_HDR_WQE_TYPE_LOCAL_INVALID 0xcUL
3366 	#define SQ_LOCALINVALIDATE_HDR_WQE_TYPE_LAST SQ_LOCALINVALIDATE_HDR_WQE_TYPE_LOCAL_INVALID
3367 	u8	flags;
3368 	#define \
3369 	SQ_LOCALINVALIDATE_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK 0xffUL
3370 	#define SQ_LOCALINVALIDATE_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT\
3371 		0
3372 	#define SQ_LOCALINVALIDATE_HDR_FLAGS_SIGNAL_COMP 0x1UL
3373 	#define SQ_LOCALINVALIDATE_HDR_FLAGS_RD_OR_ATOMIC_FENCE 0x2UL
3374 	#define SQ_LOCALINVALIDATE_HDR_FLAGS_UC_FENCE 0x4UL
3375 	#define SQ_LOCALINVALIDATE_HDR_FLAGS_SE 0x8UL
3376 	#define SQ_LOCALINVALIDATE_HDR_FLAGS_INLINE 0x10UL
3377 	#define SQ_LOCALINVALIDATE_HDR_FLAGS_WQE_TS_EN  0x20UL
3378 	#define SQ_LOCALINVALIDATE_HDR_FLAGS_DEBUG_TRACE 0x40UL
3379 	__le16	reserved16;
3380 	__le32	inv_l_key;
3381 	__le64	reserved64;
3382 	u8	reserved128[16];
3383 };
3384 
3385 /* sq_fr_pmr (size:1024b/128B) */
3386 struct sq_fr_pmr {
3387 	u8	wqe_type;
3388 	#define SQ_FR_PMR_WQE_TYPE_FR_PMR 0xdUL
3389 	#define SQ_FR_PMR_WQE_TYPE_LAST  SQ_FR_PMR_WQE_TYPE_FR_PMR
3390 	u8	flags;
3391 	#define SQ_FR_PMR_FLAGS_SIGNAL_COMP            0x1UL
3392 	#define SQ_FR_PMR_FLAGS_RD_OR_ATOMIC_FENCE     0x2UL
3393 	#define SQ_FR_PMR_FLAGS_UC_FENCE               0x4UL
3394 	#define SQ_FR_PMR_FLAGS_SE                     0x8UL
3395 	#define SQ_FR_PMR_FLAGS_INLINE                 0x10UL
3396 	#define SQ_FR_PMR_FLAGS_WQE_TS_EN              0x20UL
3397 	#define SQ_FR_PMR_FLAGS_DEBUG_TRACE            0x40UL
3398 	u8	access_cntl;
3399 	#define SQ_FR_PMR_ACCESS_CNTL_LOCAL_WRITE       0x1UL
3400 	#define SQ_FR_PMR_ACCESS_CNTL_REMOTE_READ       0x2UL
3401 	#define SQ_FR_PMR_ACCESS_CNTL_REMOTE_WRITE      0x4UL
3402 	#define SQ_FR_PMR_ACCESS_CNTL_REMOTE_ATOMIC     0x8UL
3403 	#define SQ_FR_PMR_ACCESS_CNTL_WINDOW_BIND       0x10UL
3404 	u8	zero_based_page_size_log;
3405 	#define SQ_FR_PMR_PAGE_SIZE_LOG_MASK     0x1fUL
3406 	#define SQ_FR_PMR_PAGE_SIZE_LOG_SFT      0
3407 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_4K    0x0UL
3408 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_8K    0x1UL
3409 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_16K   0x2UL
3410 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_32K   0x3UL
3411 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_64K   0x4UL
3412 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_128K  0x5UL
3413 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_256K  0x6UL
3414 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_512K  0x7UL
3415 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_1M    0x8UL
3416 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_2M    0x9UL
3417 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_4M    0xaUL
3418 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_8M    0xbUL
3419 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_16M   0xcUL
3420 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_32M   0xdUL
3421 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_64M   0xeUL
3422 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_128M  0xfUL
3423 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_256M  0x10UL
3424 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_512M  0x11UL
3425 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_1G    0x12UL
3426 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_2G    0x13UL
3427 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_4G    0x14UL
3428 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_8G    0x15UL
3429 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_16G   0x16UL
3430 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_32G   0x17UL
3431 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_64G   0x18UL
3432 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_128G  0x19UL
3433 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_256G  0x1aUL
3434 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_512G  0x1bUL
3435 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_1T    0x1cUL
3436 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_2T    0x1dUL
3437 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_4T    0x1eUL
3438 	#define SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_8T    0x1fUL
3439 	#define SQ_FR_PMR_PAGE_SIZE_LOG_LAST      SQ_FR_PMR_PAGE_SIZE_LOG_PGSZ_8T
3440 	#define SQ_FR_PMR_ZERO_BASED             0x20UL
3441 	__le32	l_key;
3442 	u8	length[5];
3443 	u8	reserved8_1;
3444 	u8	reserved8_2;
3445 	u8	numlevels_pbl_page_size_log;
3446 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_MASK     0x1fUL
3447 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_SFT      0
3448 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_4K    0x0UL
3449 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_8K    0x1UL
3450 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_16K   0x2UL
3451 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_32K   0x3UL
3452 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_64K   0x4UL
3453 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_128K  0x5UL
3454 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_256K  0x6UL
3455 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_512K  0x7UL
3456 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_1M    0x8UL
3457 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_2M    0x9UL
3458 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_4M    0xaUL
3459 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_8M    0xbUL
3460 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_16M   0xcUL
3461 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_32M   0xdUL
3462 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_64M   0xeUL
3463 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_128M  0xfUL
3464 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_256M  0x10UL
3465 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_512M  0x11UL
3466 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_1G    0x12UL
3467 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_2G    0x13UL
3468 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_4G    0x14UL
3469 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_8G    0x15UL
3470 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_16G   0x16UL
3471 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_32G   0x17UL
3472 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_64G   0x18UL
3473 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_128G  0x19UL
3474 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_256G  0x1aUL
3475 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_512G  0x1bUL
3476 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_1T    0x1cUL
3477 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_2T    0x1dUL
3478 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_4T    0x1eUL
3479 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_8T    0x1fUL
3480 	#define SQ_FR_PMR_PBL_PAGE_SIZE_LOG_LAST      SQ_FR_PMR_PBL_PAGE_SIZE_LOG_PGSZ_8T
3481 	#define SQ_FR_PMR_NUMLEVELS_MASK             0xc0UL
3482 	#define SQ_FR_PMR_NUMLEVELS_SFT              6
3483 	#define SQ_FR_PMR_NUMLEVELS_PHYSICAL           (0x0UL << 6)
3484 	#define SQ_FR_PMR_NUMLEVELS_LAYER1             (0x1UL << 6)
3485 	#define SQ_FR_PMR_NUMLEVELS_LAYER2             (0x2UL << 6)
3486 	#define SQ_FR_PMR_NUMLEVELS_LAST              SQ_FR_PMR_NUMLEVELS_LAYER2
3487 	__le64	pblptr;
3488 	__le64	va;
3489 	__le32	data[24];
3490 };
3491 
3492 /* sq_fr_pmr_hdr (size:256b/32B) */
3493 struct sq_fr_pmr_hdr {
3494 	u8	wqe_type;
3495 	#define SQ_FR_PMR_HDR_WQE_TYPE_FR_PMR 0xdUL
3496 	#define SQ_FR_PMR_HDR_WQE_TYPE_LAST  SQ_FR_PMR_HDR_WQE_TYPE_FR_PMR
3497 	u8	flags;
3498 	#define SQ_FR_PMR_HDR_FLAGS_SIGNAL_COMP            0x1UL
3499 	#define SQ_FR_PMR_HDR_FLAGS_RD_OR_ATOMIC_FENCE     0x2UL
3500 	#define SQ_FR_PMR_HDR_FLAGS_UC_FENCE               0x4UL
3501 	#define SQ_FR_PMR_HDR_FLAGS_SE                     0x8UL
3502 	#define SQ_FR_PMR_HDR_FLAGS_INLINE                 0x10UL
3503 	#define SQ_FR_PMR_HDR_FLAGS_WQE_TS_EN              0x20UL
3504 	#define SQ_FR_PMR_HDR_FLAGS_DEBUG_TRACE            0x40UL
3505 	u8	access_cntl;
3506 	#define SQ_FR_PMR_HDR_ACCESS_CNTL_LOCAL_WRITE       0x1UL
3507 	#define SQ_FR_PMR_HDR_ACCESS_CNTL_REMOTE_READ       0x2UL
3508 	#define SQ_FR_PMR_HDR_ACCESS_CNTL_REMOTE_WRITE      0x4UL
3509 	#define SQ_FR_PMR_HDR_ACCESS_CNTL_REMOTE_ATOMIC     0x8UL
3510 	#define SQ_FR_PMR_HDR_ACCESS_CNTL_WINDOW_BIND       0x10UL
3511 	u8	zero_based_page_size_log;
3512 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_MASK     0x1fUL
3513 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_SFT      0
3514 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_4K    0x0UL
3515 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_8K    0x1UL
3516 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_16K   0x2UL
3517 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_32K   0x3UL
3518 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_64K   0x4UL
3519 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_128K  0x5UL
3520 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_256K  0x6UL
3521 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_512K  0x7UL
3522 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_1M    0x8UL
3523 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_2M    0x9UL
3524 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_4M    0xaUL
3525 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_8M    0xbUL
3526 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_16M   0xcUL
3527 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_32M   0xdUL
3528 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_64M   0xeUL
3529 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_128M  0xfUL
3530 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_256M  0x10UL
3531 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_512M  0x11UL
3532 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_1G    0x12UL
3533 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_2G    0x13UL
3534 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_4G    0x14UL
3535 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_8G    0x15UL
3536 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_16G   0x16UL
3537 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_32G   0x17UL
3538 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_64G   0x18UL
3539 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_128G  0x19UL
3540 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_256G  0x1aUL
3541 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_512G  0x1bUL
3542 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_1T    0x1cUL
3543 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_2T    0x1dUL
3544 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_4T    0x1eUL
3545 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_8T    0x1fUL
3546 	#define SQ_FR_PMR_HDR_PAGE_SIZE_LOG_LAST      SQ_FR_PMR_HDR_PAGE_SIZE_LOG_PGSZ_8T
3547 	#define SQ_FR_PMR_HDR_ZERO_BASED             0x20UL
3548 	__le32	l_key;
3549 	u8	length[5];
3550 	u8	reserved8_1;
3551 	u8	reserved8_2;
3552 	u8	numlevels_pbl_page_size_log;
3553 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_MASK     0x1fUL
3554 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_SFT      0
3555 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4K    0x0UL
3556 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8K    0x1UL
3557 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_16K   0x2UL
3558 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_32K   0x3UL
3559 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_64K   0x4UL
3560 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_128K  0x5UL
3561 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_256K  0x6UL
3562 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_512K  0x7UL
3563 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_1M    0x8UL
3564 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_2M    0x9UL
3565 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4M    0xaUL
3566 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8M    0xbUL
3567 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_16M   0xcUL
3568 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_32M   0xdUL
3569 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_64M   0xeUL
3570 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_128M  0xfUL
3571 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_256M  0x10UL
3572 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_512M  0x11UL
3573 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_1G    0x12UL
3574 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_2G    0x13UL
3575 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4G    0x14UL
3576 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8G    0x15UL
3577 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_16G   0x16UL
3578 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_32G   0x17UL
3579 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_64G   0x18UL
3580 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_128G  0x19UL
3581 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_256G  0x1aUL
3582 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_512G  0x1bUL
3583 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_1T    0x1cUL
3584 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_2T    0x1dUL
3585 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_4T    0x1eUL
3586 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8T    0x1fUL
3587 	#define SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_LAST      SQ_FR_PMR_HDR_PBL_PAGE_SIZE_LOG_PGSZ_8T
3588 	#define SQ_FR_PMR_HDR_NUMLEVELS_MASK             0xc0UL
3589 	#define SQ_FR_PMR_HDR_NUMLEVELS_SFT              6
3590 	#define SQ_FR_PMR_HDR_NUMLEVELS_PHYSICAL           (0x0UL << 6)
3591 	#define SQ_FR_PMR_HDR_NUMLEVELS_LAYER1             (0x1UL << 6)
3592 	#define SQ_FR_PMR_HDR_NUMLEVELS_LAYER2             (0x2UL << 6)
3593 	#define SQ_FR_PMR_HDR_NUMLEVELS_LAST              SQ_FR_PMR_HDR_NUMLEVELS_LAYER2
3594 	__le64	pblptr;
3595 	__le64	va;
3596 };
3597 
3598 /* sq_bind (size:1024b/128B) */
3599 struct sq_bind {
3600 	u8	wqe_type;
3601 	#define SQ_BIND_WQE_TYPE_BIND 0xeUL
3602 	#define SQ_BIND_WQE_TYPE_LAST SQ_BIND_WQE_TYPE_BIND
3603 	u8	flags;
3604 	#define SQ_BIND_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK 0xffUL
3605 	#define SQ_BIND_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT  0
3606 	#define SQ_BIND_FLAGS_SIGNAL_COMP                                            0x1UL
3607 	#define SQ_BIND_FLAGS_RD_OR_ATOMIC_FENCE                                     0x2UL
3608 	#define SQ_BIND_FLAGS_UC_FENCE                                               0x4UL
3609 	#define SQ_BIND_FLAGS_SE                                                     0x8UL
3610 	#define SQ_BIND_FLAGS_INLINE                                                 0x10UL
3611 	#define SQ_BIND_FLAGS_WQE_TS_EN                                              0x20UL
3612 	#define SQ_BIND_FLAGS_DEBUG_TRACE                                            0x40UL
3613 	u8	access_cntl;
3614 	#define \
3615 	SQ_BIND_ACCESS_CNTL_WINDOW_BIND_REMOTE_ATOMIC_REMOTE_WRITE_REMOTE_READ_LOCAL_WRITE_MASK\
3616 		0xffUL
3617 	#define \
3618 	SQ_BIND_ACCESS_CNTL_WINDOW_BIND_REMOTE_ATOMIC_REMOTE_WRITE_REMOTE_READ_LOCAL_WRITE_SFT 0
3619 	#define SQ_BIND_ACCESS_CNTL_LOCAL_WRITE       0x1UL
3620 	#define SQ_BIND_ACCESS_CNTL_REMOTE_READ       0x2UL
3621 	#define SQ_BIND_ACCESS_CNTL_REMOTE_WRITE      0x4UL
3622 	#define SQ_BIND_ACCESS_CNTL_REMOTE_ATOMIC     0x8UL
3623 	#define SQ_BIND_ACCESS_CNTL_WINDOW_BIND       0x10UL
3624 	u8	reserved8_1;
3625 	u8	mw_type_zero_based;
3626 	#define SQ_BIND_ZERO_BASED     0x1UL
3627 	#define SQ_BIND_MW_TYPE        0x2UL
3628 	#define SQ_BIND_MW_TYPE_TYPE1    (0x0UL << 1)
3629 	#define SQ_BIND_MW_TYPE_TYPE2    (0x1UL << 1)
3630 	#define SQ_BIND_MW_TYPE_LAST    SQ_BIND_MW_TYPE_TYPE2
3631 	u8	reserved8_2;
3632 	__le16	reserved16;
3633 	__le32	parent_l_key;
3634 	__le32	l_key;
3635 	__le64	va;
3636 	u8	length[5];
3637 	u8	reserved24[3];
3638 	__le32	data[24];
3639 };
3640 
3641 /* sq_bind_hdr (size:256b/32B) */
3642 struct sq_bind_hdr {
3643 	u8	wqe_type;
3644 	#define SQ_BIND_HDR_WQE_TYPE_BIND 0xeUL
3645 	#define SQ_BIND_HDR_WQE_TYPE_LAST SQ_BIND_HDR_WQE_TYPE_BIND
3646 	u8	flags;
3647 	#define SQ_BIND_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_MASK 0xffUL
3648 	#define SQ_BIND_HDR_FLAGS_INLINE_SE_UC_FENCE_RD_OR_ATOMIC_FENCE_SIGNAL_COMP_SFT  0
3649 	#define SQ_BIND_HDR_FLAGS_SIGNAL_COMP		0x1UL
3650 	#define SQ_BIND_HDR_FLAGS_RD_OR_ATOMIC_FENCE	0x2UL
3651 	#define SQ_BIND_HDR_FLAGS_UC_FENCE		0x4UL
3652 	#define SQ_BIND_HDR_FLAGS_SE                    0x8UL
3653 	#define SQ_BIND_HDR_FLAGS_INLINE                0x10UL
3654 	#define SQ_BIND_HDR_FLAGS_WQE_TS_EN             0x20UL
3655 	#define SQ_BIND_HDR_FLAGS_DEBUG_TRACE           0x40UL
3656 	u8	access_cntl;
3657 	#define \
3658 	SQ_BIND_HDR_ACCESS_CNTL_WINDOW_BIND_REMOTE_ATOMIC_REMOTE_WRITE_REMOTE_READ_LOCAL_WRITE_MASK\
3659 		0xffUL
3660 	#define \
3661 	SQ_BIND_HDR_ACCESS_CNTL_WINDOW_BIND_REMOTE_ATOMIC_REMOTE_WRITE_REMOTE_READ_LOCAL_WRITE_SFT \
3662 		0
3663 	#define SQ_BIND_HDR_ACCESS_CNTL_LOCAL_WRITE	0x1UL
3664 	#define SQ_BIND_HDR_ACCESS_CNTL_REMOTE_READ	0x2UL
3665 	#define SQ_BIND_HDR_ACCESS_CNTL_REMOTE_WRITE    0x4UL
3666 	#define SQ_BIND_HDR_ACCESS_CNTL_REMOTE_ATOMIC   0x8UL
3667 	#define SQ_BIND_HDR_ACCESS_CNTL_WINDOW_BIND     0x10UL
3668 	u8	reserved8_1;
3669 	u8	mw_type_zero_based;
3670 	#define SQ_BIND_HDR_ZERO_BASED     0x1UL
3671 	#define SQ_BIND_HDR_MW_TYPE        0x2UL
3672 	#define SQ_BIND_HDR_MW_TYPE_TYPE1    (0x0UL << 1)
3673 	#define SQ_BIND_HDR_MW_TYPE_TYPE2    (0x1UL << 1)
3674 	#define SQ_BIND_HDR_MW_TYPE_LAST    SQ_BIND_HDR_MW_TYPE_TYPE2
3675 	u8	reserved8_2;
3676 	__le16	reserved16;
3677 	__le32	parent_l_key;
3678 	__le32	l_key;
3679 	__le64	va;
3680 	u8	length[5];
3681 	u8	reserved24[3];
3682 };
3683 
3684 /* rq_wqe (size:1024b/128B) */
3685 struct rq_wqe {
3686 	u8	wqe_type;
3687 	#define RQ_WQE_WQE_TYPE_RCV 0x80UL
3688 	#define RQ_WQE_WQE_TYPE_LAST RQ_WQE_WQE_TYPE_RCV
3689 	u8	flags;
3690 	u8	wqe_size;
3691 	u8	reserved8;
3692 	__le32	reserved32;
3693 	__le32	wr_id[2];
3694 	#define RQ_WQE_WR_ID_MASK 0xfffffUL
3695 	#define RQ_WQE_WR_ID_SFT 0
3696 	u8	reserved128[16];
3697 	__le32	data[24];
3698 };
3699 
3700 /* rq_wqe_hdr (size:256b/32B) */
3701 struct rq_wqe_hdr {
3702 	u8	wqe_type;
3703 	#define RQ_WQE_HDR_WQE_TYPE_RCV 0x80UL
3704 	#define RQ_WQE_HDR_WQE_TYPE_LAST RQ_WQE_HDR_WQE_TYPE_RCV
3705 	u8	flags;
3706 	u8	wqe_size;
3707 	u8	reserved8;
3708 	__le32	reserved32;
3709 	__le32	wr_id[2];
3710 	#define RQ_WQE_HDR_WR_ID_MASK 0xfffffUL
3711 	#define RQ_WQE_HDR_WR_ID_SFT 0
3712 	u8	reserved128[16];
3713 };
3714 
3715 /* cq_base (size:256b/32B) */
3716 struct cq_base {
3717 	__le64	reserved64_1;
3718 	__le64	reserved64_2;
3719 	__le64	reserved64_3;
3720 	u8	cqe_type_toggle;
3721 	#define CQ_BASE_TOGGLE                 0x1UL
3722 	#define CQ_BASE_CQE_TYPE_MASK          0x1eUL
3723 	#define CQ_BASE_CQE_TYPE_SFT           1
3724 	#define CQ_BASE_CQE_TYPE_REQ             (0x0UL << 1)
3725 	#define CQ_BASE_CQE_TYPE_RES_RC          (0x1UL << 1)
3726 	#define CQ_BASE_CQE_TYPE_RES_UD          (0x2UL << 1)
3727 	#define CQ_BASE_CQE_TYPE_RES_RAWETH_QP1  (0x3UL << 1)
3728 	#define CQ_BASE_CQE_TYPE_RES_UD_CFA      (0x4UL << 1)
3729 	#define CQ_BASE_CQE_TYPE_REQ_V3             (0x8UL << 1)
3730 	#define CQ_BASE_CQE_TYPE_RES_RC_V3          (0x9UL << 1)
3731 	#define CQ_BASE_CQE_TYPE_RES_UD_V3          (0xaUL << 1)
3732 	#define CQ_BASE_CQE_TYPE_RES_RAWETH_QP1_V3  (0xbUL << 1)
3733 	#define CQ_BASE_CQE_TYPE_RES_UD_CFA_V3      (0xcUL << 1)
3734 	#define CQ_BASE_CQE_TYPE_NO_OP           (0xdUL << 1)
3735 	#define CQ_BASE_CQE_TYPE_TERMINAL        (0xeUL << 1)
3736 	#define CQ_BASE_CQE_TYPE_CUT_OFF         (0xfUL << 1)
3737 	#define CQ_BASE_CQE_TYPE_LAST           CQ_BASE_CQE_TYPE_CUT_OFF
3738 	u8	status;
3739 	#define CQ_BASE_STATUS_OK                         0x0UL
3740 	#define CQ_BASE_STATUS_BAD_RESPONSE_ERR           0x1UL
3741 	#define CQ_BASE_STATUS_LOCAL_LENGTH_ERR           0x2UL
3742 	#define CQ_BASE_STATUS_HW_LOCAL_LENGTH_ERR        0x3UL
3743 	#define CQ_BASE_STATUS_LOCAL_QP_OPERATION_ERR     0x4UL
3744 	#define CQ_BASE_STATUS_LOCAL_PROTECTION_ERR       0x5UL
3745 	#define CQ_BASE_STATUS_LOCAL_ACCESS_ERROR         0x6UL
3746 	#define CQ_BASE_STATUS_MEMORY_MGT_OPERATION_ERR   0x7UL
3747 	#define CQ_BASE_STATUS_REMOTE_INVALID_REQUEST_ERR 0x8UL
3748 	#define CQ_BASE_STATUS_REMOTE_ACCESS_ERR          0x9UL
3749 	#define CQ_BASE_STATUS_REMOTE_OPERATION_ERR       0xaUL
3750 	#define CQ_BASE_STATUS_RNR_NAK_RETRY_CNT_ERR      0xbUL
3751 	#define CQ_BASE_STATUS_TRANSPORT_RETRY_CNT_ERR    0xcUL
3752 	#define CQ_BASE_STATUS_WORK_REQUEST_FLUSHED_ERR   0xdUL
3753 	#define CQ_BASE_STATUS_HW_FLUSH_ERR               0xeUL
3754 	#define CQ_BASE_STATUS_OVERFLOW_ERR               0xfUL
3755 	#define CQ_BASE_STATUS_LAST                      CQ_BASE_STATUS_OVERFLOW_ERR
3756 	__le16	reserved16;
3757 	__le32	opaque;
3758 };
3759 
3760 /* cq_req (size:256b/32B) */
3761 struct cq_req {
3762 	__le64	qp_handle;
3763 	__le16	sq_cons_idx;
3764 	__le16	reserved16_1;
3765 	__le32	reserved32_2;
3766 	__le64	reserved64;
3767 	u8	cqe_type_toggle;
3768 	#define CQ_REQ_TOGGLE       0x1UL
3769 	#define CQ_REQ_CQE_TYPE_MASK 0x1eUL
3770 	#define CQ_REQ_CQE_TYPE_SFT 1
3771 	#define CQ_REQ_CQE_TYPE_REQ   (0x0UL << 1)
3772 	#define CQ_REQ_CQE_TYPE_LAST CQ_REQ_CQE_TYPE_REQ
3773 	#define CQ_REQ_PUSH         0x20UL
3774 	u8	status;
3775 	#define CQ_REQ_STATUS_OK                         0x0UL
3776 	#define CQ_REQ_STATUS_BAD_RESPONSE_ERR           0x1UL
3777 	#define CQ_REQ_STATUS_LOCAL_LENGTH_ERR           0x2UL
3778 	#define CQ_REQ_STATUS_LOCAL_QP_OPERATION_ERR     0x3UL
3779 	#define CQ_REQ_STATUS_LOCAL_PROTECTION_ERR       0x4UL
3780 	#define CQ_REQ_STATUS_MEMORY_MGT_OPERATION_ERR   0x5UL
3781 	#define CQ_REQ_STATUS_REMOTE_INVALID_REQUEST_ERR 0x6UL
3782 	#define CQ_REQ_STATUS_REMOTE_ACCESS_ERR          0x7UL
3783 	#define CQ_REQ_STATUS_REMOTE_OPERATION_ERR       0x8UL
3784 	#define CQ_REQ_STATUS_RNR_NAK_RETRY_CNT_ERR      0x9UL
3785 	#define CQ_REQ_STATUS_TRANSPORT_RETRY_CNT_ERR    0xaUL
3786 	#define CQ_REQ_STATUS_WORK_REQUEST_FLUSHED_ERR   0xbUL
3787 	#define CQ_REQ_STATUS_LAST                      CQ_REQ_STATUS_WORK_REQUEST_FLUSHED_ERR
3788 	__le16	reserved16_2;
3789 	__le32	reserved32_1;
3790 };
3791 
3792 /* cq_res_rc (size:256b/32B) */
3793 struct cq_res_rc {
3794 	__le32	length;
3795 	__le32	imm_data_or_inv_r_key;
3796 	__le64	qp_handle;
3797 	__le64	mr_handle;
3798 	u8	cqe_type_toggle;
3799 	#define CQ_RES_RC_TOGGLE         0x1UL
3800 	#define CQ_RES_RC_CQE_TYPE_MASK  0x1eUL
3801 	#define CQ_RES_RC_CQE_TYPE_SFT   1
3802 	#define CQ_RES_RC_CQE_TYPE_RES_RC  (0x1UL << 1)
3803 	#define CQ_RES_RC_CQE_TYPE_LAST   CQ_RES_RC_CQE_TYPE_RES_RC
3804 	u8	status;
3805 	#define CQ_RES_RC_STATUS_OK                         0x0UL
3806 	#define CQ_RES_RC_STATUS_LOCAL_ACCESS_ERROR         0x1UL
3807 	#define CQ_RES_RC_STATUS_LOCAL_LENGTH_ERR           0x2UL
3808 	#define CQ_RES_RC_STATUS_LOCAL_PROTECTION_ERR       0x3UL
3809 	#define CQ_RES_RC_STATUS_LOCAL_QP_OPERATION_ERR     0x4UL
3810 	#define CQ_RES_RC_STATUS_MEMORY_MGT_OPERATION_ERR   0x5UL
3811 	#define CQ_RES_RC_STATUS_REMOTE_INVALID_REQUEST_ERR 0x6UL
3812 	#define CQ_RES_RC_STATUS_WORK_REQUEST_FLUSHED_ERR   0x7UL
3813 	#define CQ_RES_RC_STATUS_HW_FLUSH_ERR               0x8UL
3814 	#define CQ_RES_RC_STATUS_LAST                      CQ_RES_RC_STATUS_HW_FLUSH_ERR
3815 	__le16	flags;
3816 	#define CQ_RES_RC_FLAGS_SRQ            0x1UL
3817 	#define CQ_RES_RC_FLAGS_SRQ_RQ           0x0UL
3818 	#define CQ_RES_RC_FLAGS_SRQ_SRQ          0x1UL
3819 	#define CQ_RES_RC_FLAGS_SRQ_LAST        CQ_RES_RC_FLAGS_SRQ_SRQ
3820 	#define CQ_RES_RC_FLAGS_IMM            0x2UL
3821 	#define CQ_RES_RC_FLAGS_INV            0x4UL
3822 	#define CQ_RES_RC_FLAGS_RDMA           0x8UL
3823 	#define CQ_RES_RC_FLAGS_RDMA_SEND        (0x0UL << 3)
3824 	#define CQ_RES_RC_FLAGS_RDMA_RDMA_WRITE  (0x1UL << 3)
3825 	#define CQ_RES_RC_FLAGS_RDMA_LAST       CQ_RES_RC_FLAGS_RDMA_RDMA_WRITE
3826 	__le32	srq_or_rq_wr_id;
3827 	#define CQ_RES_RC_SRQ_OR_RQ_WR_ID_MASK 0xfffffUL
3828 	#define CQ_RES_RC_SRQ_OR_RQ_WR_ID_SFT 0
3829 };
3830 
3831 /* cq_res_ud (size:256b/32B) */
3832 struct cq_res_ud {
3833 	__le16	length;
3834 	#define CQ_RES_UD_LENGTH_MASK 0x3fffUL
3835 	#define CQ_RES_UD_LENGTH_SFT 0
3836 	__le16	cfa_metadata;
3837 	#define CQ_RES_UD_CFA_METADATA_VID_MASK 0xfffUL
3838 	#define CQ_RES_UD_CFA_METADATA_VID_SFT 0
3839 	#define CQ_RES_UD_CFA_METADATA_DE      0x1000UL
3840 	#define CQ_RES_UD_CFA_METADATA_PRI_MASK 0xe000UL
3841 	#define CQ_RES_UD_CFA_METADATA_PRI_SFT 13
3842 	__le32	imm_data;
3843 	__le64	qp_handle;
3844 	__le16	src_mac[3];
3845 	__le16	src_qp_low;
3846 	u8	cqe_type_toggle;
3847 	#define CQ_RES_UD_TOGGLE         0x1UL
3848 	#define CQ_RES_UD_CQE_TYPE_MASK  0x1eUL
3849 	#define CQ_RES_UD_CQE_TYPE_SFT   1
3850 	#define CQ_RES_UD_CQE_TYPE_RES_UD  (0x2UL << 1)
3851 	#define CQ_RES_UD_CQE_TYPE_LAST   CQ_RES_UD_CQE_TYPE_RES_UD
3852 	u8	status;
3853 	#define CQ_RES_UD_STATUS_OK                       0x0UL
3854 	#define CQ_RES_UD_STATUS_LOCAL_ACCESS_ERROR       0x1UL
3855 	#define CQ_RES_UD_STATUS_HW_LOCAL_LENGTH_ERR      0x2UL
3856 	#define CQ_RES_UD_STATUS_LOCAL_PROTECTION_ERR     0x3UL
3857 	#define CQ_RES_UD_STATUS_LOCAL_QP_OPERATION_ERR   0x4UL
3858 	#define CQ_RES_UD_STATUS_MEMORY_MGT_OPERATION_ERR 0x5UL
3859 	#define CQ_RES_UD_STATUS_WORK_REQUEST_FLUSHED_ERR 0x7UL
3860 	#define CQ_RES_UD_STATUS_HW_FLUSH_ERR             0x8UL
3861 	#define CQ_RES_UD_STATUS_LAST                    CQ_RES_UD_STATUS_HW_FLUSH_ERR
3862 	__le16	flags;
3863 	#define CQ_RES_UD_FLAGS_SRQ                   0x1UL
3864 	#define CQ_RES_UD_FLAGS_SRQ_RQ                  0x0UL
3865 	#define CQ_RES_UD_FLAGS_SRQ_SRQ                 0x1UL
3866 	#define CQ_RES_UD_FLAGS_SRQ_LAST               CQ_RES_UD_FLAGS_SRQ_SRQ
3867 	#define CQ_RES_UD_FLAGS_IMM                   0x2UL
3868 	#define CQ_RES_UD_FLAGS_UNUSED_MASK           0xcUL
3869 	#define CQ_RES_UD_FLAGS_UNUSED_SFT            2
3870 	#define CQ_RES_UD_FLAGS_ROCE_IP_VER_MASK      0x30UL
3871 	#define CQ_RES_UD_FLAGS_ROCE_IP_VER_SFT       4
3872 	#define CQ_RES_UD_FLAGS_ROCE_IP_VER_V1          (0x0UL << 4)
3873 	#define CQ_RES_UD_FLAGS_ROCE_IP_VER_V2IPV4      (0x2UL << 4)
3874 	#define CQ_RES_UD_FLAGS_ROCE_IP_VER_V2IPV6      (0x3UL << 4)
3875 	#define CQ_RES_UD_FLAGS_ROCE_IP_VER_LAST       CQ_RES_UD_FLAGS_ROCE_IP_VER_V2IPV6
3876 	#define CQ_RES_UD_FLAGS_META_FORMAT_MASK      0x3c0UL
3877 	#define CQ_RES_UD_FLAGS_META_FORMAT_SFT       6
3878 	#define CQ_RES_UD_FLAGS_META_FORMAT_NONE        (0x0UL << 6)
3879 	#define CQ_RES_UD_FLAGS_META_FORMAT_VLAN        (0x1UL << 6)
3880 	#define CQ_RES_UD_FLAGS_META_FORMAT_TUNNEL_ID   (0x2UL << 6)
3881 	#define CQ_RES_UD_FLAGS_META_FORMAT_CHDR_DATA   (0x3UL << 6)
3882 	#define CQ_RES_UD_FLAGS_META_FORMAT_HDR_OFFSET  (0x4UL << 6)
3883 	#define CQ_RES_UD_FLAGS_META_FORMAT_LAST       CQ_RES_UD_FLAGS_META_FORMAT_HDR_OFFSET
3884 	#define CQ_RES_UD_FLAGS_EXT_META_FORMAT_MASK  0xc00UL
3885 	#define CQ_RES_UD_FLAGS_EXT_META_FORMAT_SFT   10
3886 	__le32	src_qp_high_srq_or_rq_wr_id;
3887 	#define CQ_RES_UD_SRQ_OR_RQ_WR_ID_MASK 0xfffffUL
3888 	#define CQ_RES_UD_SRQ_OR_RQ_WR_ID_SFT 0
3889 	#define CQ_RES_UD_SRC_QP_HIGH_MASK    0xff000000UL
3890 	#define CQ_RES_UD_SRC_QP_HIGH_SFT     24
3891 };
3892 
3893 /* cq_res_ud_v2 (size:256b/32B) */
3894 struct cq_res_ud_v2 {
3895 	__le16	length;
3896 	#define CQ_RES_UD_V2_LENGTH_MASK 0x3fffUL
3897 	#define CQ_RES_UD_V2_LENGTH_SFT 0
3898 	__le16	cfa_metadata0;
3899 	#define CQ_RES_UD_V2_CFA_METADATA0_VID_MASK 0xfffUL
3900 	#define CQ_RES_UD_V2_CFA_METADATA0_VID_SFT 0
3901 	#define CQ_RES_UD_V2_CFA_METADATA0_DE      0x1000UL
3902 	#define CQ_RES_UD_V2_CFA_METADATA0_PRI_MASK 0xe000UL
3903 	#define CQ_RES_UD_V2_CFA_METADATA0_PRI_SFT 13
3904 	__le32	imm_data;
3905 	__le64	qp_handle;
3906 	__le16	src_mac[3];
3907 	__le16	src_qp_low;
3908 	u8	cqe_type_toggle;
3909 	#define CQ_RES_UD_V2_TOGGLE         0x1UL
3910 	#define CQ_RES_UD_V2_CQE_TYPE_MASK  0x1eUL
3911 	#define CQ_RES_UD_V2_CQE_TYPE_SFT   1
3912 	#define CQ_RES_UD_V2_CQE_TYPE_RES_UD  (0x2UL << 1)
3913 	#define CQ_RES_UD_V2_CQE_TYPE_LAST   CQ_RES_UD_V2_CQE_TYPE_RES_UD
3914 	u8	status;
3915 	#define CQ_RES_UD_V2_STATUS_OK                       0x0UL
3916 	#define CQ_RES_UD_V2_STATUS_LOCAL_ACCESS_ERROR       0x1UL
3917 	#define CQ_RES_UD_V2_STATUS_HW_LOCAL_LENGTH_ERR      0x2UL
3918 	#define CQ_RES_UD_V2_STATUS_LOCAL_PROTECTION_ERR     0x3UL
3919 	#define CQ_RES_UD_V2_STATUS_LOCAL_QP_OPERATION_ERR   0x4UL
3920 	#define CQ_RES_UD_V2_STATUS_MEMORY_MGT_OPERATION_ERR 0x5UL
3921 	#define CQ_RES_UD_V2_STATUS_WORK_REQUEST_FLUSHED_ERR 0x7UL
3922 	#define CQ_RES_UD_V2_STATUS_HW_FLUSH_ERR             0x8UL
3923 	#define CQ_RES_UD_V2_STATUS_LAST                    CQ_RES_UD_V2_STATUS_HW_FLUSH_ERR
3924 	__le16	flags;
3925 	#define CQ_RES_UD_V2_FLAGS_SRQ                    0x1UL
3926 	#define CQ_RES_UD_V2_FLAGS_SRQ_RQ                   0x0UL
3927 	#define CQ_RES_UD_V2_FLAGS_SRQ_SRQ                  0x1UL
3928 	#define CQ_RES_UD_V2_FLAGS_SRQ_LAST                CQ_RES_UD_V2_FLAGS_SRQ_SRQ
3929 	#define CQ_RES_UD_V2_FLAGS_IMM                    0x2UL
3930 	#define CQ_RES_UD_V2_FLAGS_UNUSED_MASK            0xcUL
3931 	#define CQ_RES_UD_V2_FLAGS_UNUSED_SFT             2
3932 	#define CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_MASK       0x30UL
3933 	#define CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_SFT        4
3934 	#define CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_V1           (0x0UL << 4)
3935 	#define CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_V2IPV4       (0x2UL << 4)
3936 	#define CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_V2IPV6       (0x3UL << 4)
3937 	#define CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_LAST        CQ_RES_UD_V2_FLAGS_ROCE_IP_VER_V2IPV6
3938 	#define CQ_RES_UD_V2_FLAGS_META_FORMAT_MASK       0x3c0UL
3939 	#define CQ_RES_UD_V2_FLAGS_META_FORMAT_SFT        6
3940 	#define CQ_RES_UD_V2_FLAGS_META_FORMAT_NONE         (0x0UL << 6)
3941 	#define CQ_RES_UD_V2_FLAGS_META_FORMAT_ACT_REC_PTR  (0x1UL << 6)
3942 	#define CQ_RES_UD_V2_FLAGS_META_FORMAT_TUNNEL_ID    (0x2UL << 6)
3943 	#define CQ_RES_UD_V2_FLAGS_META_FORMAT_CHDR_DATA    (0x3UL << 6)
3944 	#define CQ_RES_UD_V2_FLAGS_META_FORMAT_HDR_OFFSET   (0x4UL << 6)
3945 	#define CQ_RES_UD_V2_FLAGS_META_FORMAT_LAST        CQ_RES_UD_V2_FLAGS_META_FORMAT_HDR_OFFSET
3946 	__le32	src_qp_high_srq_or_rq_wr_id;
3947 	#define CQ_RES_UD_V2_SRQ_OR_RQ_WR_ID_MASK           0xfffffUL
3948 	#define CQ_RES_UD_V2_SRQ_OR_RQ_WR_ID_SFT            0
3949 	#define CQ_RES_UD_V2_CFA_METADATA1_MASK             0xf00000UL
3950 	#define CQ_RES_UD_V2_CFA_METADATA1_SFT              20
3951 	#define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_MASK     0x700000UL
3952 	#define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_SFT      20
3953 	#define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPID88A8   (0x0UL << 20)
3954 	#define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPID8100   (0x1UL << 20)
3955 	#define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPID9100   (0x2UL << 20)
3956 	#define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPID9200   (0x3UL << 20)
3957 	#define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPID9300   (0x4UL << 20)
3958 	#define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPIDCFG    (0x5UL << 20)
3959 	#define CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_LAST CQ_RES_UD_V2_CFA_METADATA1_TPID_SEL_TPIDCFG
3960 	#define CQ_RES_UD_V2_CFA_METADATA1_VALID             0x800000UL
3961 	#define CQ_RES_UD_V2_SRC_QP_HIGH_MASK               0xff000000UL
3962 	#define CQ_RES_UD_V2_SRC_QP_HIGH_SFT                24
3963 };
3964 
3965 /* cq_res_ud_cfa (size:256b/32B) */
3966 struct cq_res_ud_cfa {
3967 	__le16	length;
3968 	#define CQ_RES_UD_CFA_LENGTH_MASK 0x3fffUL
3969 	#define CQ_RES_UD_CFA_LENGTH_SFT 0
3970 	__le16	cfa_code;
3971 	__le32	imm_data;
3972 	__le32	qid;
3973 	#define CQ_RES_UD_CFA_QID_MASK 0xfffffUL
3974 	#define CQ_RES_UD_CFA_QID_SFT 0
3975 	__le32	cfa_metadata;
3976 	#define CQ_RES_UD_CFA_CFA_METADATA_VID_MASK 0xfffUL
3977 	#define CQ_RES_UD_CFA_CFA_METADATA_VID_SFT  0
3978 	#define CQ_RES_UD_CFA_CFA_METADATA_DE       0x1000UL
3979 	#define CQ_RES_UD_CFA_CFA_METADATA_PRI_MASK 0xe000UL
3980 	#define CQ_RES_UD_CFA_CFA_METADATA_PRI_SFT  13
3981 	#define CQ_RES_UD_CFA_CFA_METADATA_TPID_MASK 0xffff0000UL
3982 	#define CQ_RES_UD_CFA_CFA_METADATA_TPID_SFT 16
3983 	__le16	src_mac[3];
3984 	__le16	src_qp_low;
3985 	u8	cqe_type_toggle;
3986 	#define CQ_RES_UD_CFA_TOGGLE             0x1UL
3987 	#define CQ_RES_UD_CFA_CQE_TYPE_MASK      0x1eUL
3988 	#define CQ_RES_UD_CFA_CQE_TYPE_SFT       1
3989 	#define CQ_RES_UD_CFA_CQE_TYPE_RES_UD_CFA  (0x4UL << 1)
3990 	#define CQ_RES_UD_CFA_CQE_TYPE_LAST       CQ_RES_UD_CFA_CQE_TYPE_RES_UD_CFA
3991 	u8	status;
3992 	#define CQ_RES_UD_CFA_STATUS_OK                       0x0UL
3993 	#define CQ_RES_UD_CFA_STATUS_LOCAL_ACCESS_ERROR       0x1UL
3994 	#define CQ_RES_UD_CFA_STATUS_HW_LOCAL_LENGTH_ERR      0x2UL
3995 	#define CQ_RES_UD_CFA_STATUS_LOCAL_PROTECTION_ERR     0x3UL
3996 	#define CQ_RES_UD_CFA_STATUS_LOCAL_QP_OPERATION_ERR   0x4UL
3997 	#define CQ_RES_UD_CFA_STATUS_MEMORY_MGT_OPERATION_ERR 0x5UL
3998 	#define CQ_RES_UD_CFA_STATUS_WORK_REQUEST_FLUSHED_ERR 0x7UL
3999 	#define CQ_RES_UD_CFA_STATUS_HW_FLUSH_ERR             0x8UL
4000 	#define CQ_RES_UD_CFA_STATUS_LAST                    CQ_RES_UD_CFA_STATUS_HW_FLUSH_ERR
4001 	__le16	flags;
4002 	#define CQ_RES_UD_CFA_FLAGS_SRQ                   0x1UL
4003 	#define CQ_RES_UD_CFA_FLAGS_SRQ_RQ                  0x0UL
4004 	#define CQ_RES_UD_CFA_FLAGS_SRQ_SRQ                 0x1UL
4005 	#define CQ_RES_UD_CFA_FLAGS_SRQ_LAST               CQ_RES_UD_CFA_FLAGS_SRQ_SRQ
4006 	#define CQ_RES_UD_CFA_FLAGS_IMM                   0x2UL
4007 	#define CQ_RES_UD_CFA_FLAGS_UNUSED_MASK           0xcUL
4008 	#define CQ_RES_UD_CFA_FLAGS_UNUSED_SFT            2
4009 	#define CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_MASK      0x30UL
4010 	#define CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_SFT       4
4011 	#define CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_V1          (0x0UL << 4)
4012 	#define CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_V2IPV4      (0x2UL << 4)
4013 	#define CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_V2IPV6      (0x3UL << 4)
4014 	#define CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_LAST       CQ_RES_UD_CFA_FLAGS_ROCE_IP_VER_V2IPV6
4015 	#define CQ_RES_UD_CFA_FLAGS_META_FORMAT_MASK      0x3c0UL
4016 	#define CQ_RES_UD_CFA_FLAGS_META_FORMAT_SFT       6
4017 	#define CQ_RES_UD_CFA_FLAGS_META_FORMAT_NONE        (0x0UL << 6)
4018 	#define CQ_RES_UD_CFA_FLAGS_META_FORMAT_VLAN        (0x1UL << 6)
4019 	#define CQ_RES_UD_CFA_FLAGS_META_FORMAT_TUNNEL_ID   (0x2UL << 6)
4020 	#define CQ_RES_UD_CFA_FLAGS_META_FORMAT_CHDR_DATA   (0x3UL << 6)
4021 	#define CQ_RES_UD_CFA_FLAGS_META_FORMAT_HDR_OFFSET  (0x4UL << 6)
4022 	#define CQ_RES_UD_CFA_FLAGS_META_FORMAT_LAST	CQ_RES_UD_CFA_FLAGS_META_FORMAT_HDR_OFFSET
4023 	#define CQ_RES_UD_CFA_FLAGS_EXT_META_FORMAT_MASK  0xc00UL
4024 	#define CQ_RES_UD_CFA_FLAGS_EXT_META_FORMAT_SFT   10
4025 	__le32	src_qp_high_srq_or_rq_wr_id;
4026 	#define CQ_RES_UD_CFA_SRQ_OR_RQ_WR_ID_MASK 0xfffffUL
4027 	#define CQ_RES_UD_CFA_SRQ_OR_RQ_WR_ID_SFT 0
4028 	#define CQ_RES_UD_CFA_SRC_QP_HIGH_MASK    0xff000000UL
4029 	#define CQ_RES_UD_CFA_SRC_QP_HIGH_SFT     24
4030 };
4031 
4032 /* cq_res_ud_cfa_v2 (size:256b/32B) */
4033 struct cq_res_ud_cfa_v2 {
4034 	__le16	length;
4035 	#define CQ_RES_UD_CFA_V2_LENGTH_MASK 0x3fffUL
4036 	#define CQ_RES_UD_CFA_V2_LENGTH_SFT 0
4037 	__le16	cfa_metadata0;
4038 	#define CQ_RES_UD_CFA_V2_CFA_METADATA0_VID_MASK 0xfffUL
4039 	#define CQ_RES_UD_CFA_V2_CFA_METADATA0_VID_SFT 0
4040 	#define CQ_RES_UD_CFA_V2_CFA_METADATA0_DE      0x1000UL
4041 	#define CQ_RES_UD_CFA_V2_CFA_METADATA0_PRI_MASK 0xe000UL
4042 	#define CQ_RES_UD_CFA_V2_CFA_METADATA0_PRI_SFT 13
4043 	__le32	imm_data;
4044 	__le32	qid;
4045 	#define CQ_RES_UD_CFA_V2_QID_MASK 0xfffffUL
4046 	#define CQ_RES_UD_CFA_V2_QID_SFT 0
4047 	__le32	cfa_metadata2;
4048 	__le16	src_mac[3];
4049 	__le16	src_qp_low;
4050 	u8	cqe_type_toggle;
4051 	#define CQ_RES_UD_CFA_V2_TOGGLE             0x1UL
4052 	#define CQ_RES_UD_CFA_V2_CQE_TYPE_MASK      0x1eUL
4053 	#define CQ_RES_UD_CFA_V2_CQE_TYPE_SFT       1
4054 	#define CQ_RES_UD_CFA_V2_CQE_TYPE_RES_UD_CFA  (0x4UL << 1)
4055 	#define CQ_RES_UD_CFA_V2_CQE_TYPE_LAST       CQ_RES_UD_CFA_V2_CQE_TYPE_RES_UD_CFA
4056 	u8	status;
4057 	#define CQ_RES_UD_CFA_V2_STATUS_OK                       0x0UL
4058 	#define CQ_RES_UD_CFA_V2_STATUS_LOCAL_ACCESS_ERROR       0x1UL
4059 	#define CQ_RES_UD_CFA_V2_STATUS_HW_LOCAL_LENGTH_ERR      0x2UL
4060 	#define CQ_RES_UD_CFA_V2_STATUS_LOCAL_PROTECTION_ERR     0x3UL
4061 	#define CQ_RES_UD_CFA_V2_STATUS_LOCAL_QP_OPERATION_ERR   0x4UL
4062 	#define CQ_RES_UD_CFA_V2_STATUS_MEMORY_MGT_OPERATION_ERR 0x5UL
4063 	#define CQ_RES_UD_CFA_V2_STATUS_WORK_REQUEST_FLUSHED_ERR 0x7UL
4064 	#define CQ_RES_UD_CFA_V2_STATUS_HW_FLUSH_ERR             0x8UL
4065 	#define CQ_RES_UD_CFA_V2_STATUS_LAST   CQ_RES_UD_CFA_V2_STATUS_HW_FLUSH_ERR
4066 	__le16	flags;
4067 	#define CQ_RES_UD_CFA_V2_FLAGS_SRQ                    0x1UL
4068 	#define CQ_RES_UD_CFA_V2_FLAGS_SRQ_RQ                   0x0UL
4069 	#define CQ_RES_UD_CFA_V2_FLAGS_SRQ_SRQ                  0x1UL
4070 	#define CQ_RES_UD_CFA_V2_FLAGS_SRQ_LAST                CQ_RES_UD_CFA_V2_FLAGS_SRQ_SRQ
4071 	#define CQ_RES_UD_CFA_V2_FLAGS_IMM                    0x2UL
4072 	#define CQ_RES_UD_CFA_V2_FLAGS_UNUSED_MASK            0xcUL
4073 	#define CQ_RES_UD_CFA_V2_FLAGS_UNUSED_SFT             2
4074 	#define CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_MASK       0x30UL
4075 	#define CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_SFT        4
4076 	#define CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_V1           (0x0UL << 4)
4077 	#define CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_V2IPV4       (0x2UL << 4)
4078 	#define CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_V2IPV6       (0x3UL << 4)
4079 	#define CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_LAST  CQ_RES_UD_CFA_V2_FLAGS_ROCE_IP_VER_V2IPV6
4080 	#define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_MASK       0x3c0UL
4081 	#define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_SFT        6
4082 	#define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_NONE         (0x0UL << 6)
4083 	#define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_ACT_REC_PTR  (0x1UL << 6)
4084 	#define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_TUNNEL_ID    (0x2UL << 6)
4085 	#define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_CHDR_DATA    (0x3UL << 6)
4086 	#define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_HDR_OFFSET   (0x4UL << 6)
4087 	#define CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_LAST \
4088 		CQ_RES_UD_CFA_V2_FLAGS_META_FORMAT_HDR_OFFSET
4089 	__le32	src_qp_high_srq_or_rq_wr_id;
4090 	#define CQ_RES_UD_CFA_V2_SRQ_OR_RQ_WR_ID_MASK           0xfffffUL
4091 	#define CQ_RES_UD_CFA_V2_SRQ_OR_RQ_WR_ID_SFT            0
4092 	#define CQ_RES_UD_CFA_V2_CFA_METADATA1_MASK             0xf00000UL
4093 	#define CQ_RES_UD_CFA_V2_CFA_METADATA1_SFT              20
4094 	#define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_MASK     0x700000UL
4095 	#define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_SFT      20
4096 	#define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPID88A8   (0x0UL << 20)
4097 	#define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPID8100   (0x1UL << 20)
4098 	#define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPID9100   (0x2UL << 20)
4099 	#define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPID9200   (0x3UL << 20)
4100 	#define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPID9300   (0x4UL << 20)
4101 	#define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPIDCFG    (0x5UL << 20)
4102 	#define CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_LAST \
4103 		CQ_RES_UD_CFA_V2_CFA_METADATA1_TPID_SEL_TPIDCFG
4104 	#define CQ_RES_UD_CFA_V2_CFA_METADATA1_VALID             0x800000UL
4105 	#define CQ_RES_UD_CFA_V2_SRC_QP_HIGH_MASK               0xff000000UL
4106 	#define CQ_RES_UD_CFA_V2_SRC_QP_HIGH_SFT                24
4107 };
4108 
4109 /* cq_res_raweth_qp1 (size:256b/32B) */
4110 struct cq_res_raweth_qp1 {
4111 	__le16	length;
4112 	#define CQ_RES_RAWETH_QP1_LENGTH_MASK 0x3fffUL
4113 	#define CQ_RES_RAWETH_QP1_LENGTH_SFT 0
4114 	__le16	raweth_qp1_flags;
4115 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_MASK                  0x3ffUL
4116 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_SFT                   0
4117 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ERROR                  0x1UL
4118 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_MASK             0x3c0UL
4119 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_SFT              6
4120 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_NOT_KNOWN          (0x0UL << 6)
4121 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_IP                 (0x1UL << 6)
4122 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_TCP                (0x2UL << 6)
4123 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_UDP                (0x3UL << 6)
4124 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_FCOE               (0x4UL << 6)
4125 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_ROCE               (0x5UL << 6)
4126 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_ICMP               (0x7UL << 6)
4127 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_PTP_WO_TIMESTAMP   (0x8UL << 6)
4128 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_PTP_W_TIMESTAMP    (0x9UL << 6)
4129 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_LAST \
4130 		CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS_ITYPE_PTP_W_TIMESTAMP
4131 	__le16	raweth_qp1_errors;
4132 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_IP_CS_ERROR   0x10UL
4133 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_L4_CS_ERROR   0x20UL
4134 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_IP_CS_ERROR 0x40UL
4135 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_L4_CS_ERROR 0x80UL
4136 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_CRC_ERROR     0x100UL
4137 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_MASK  0xe00UL
4138 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_SFT   9
4139 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_NO_ERROR                (0x0UL << 9)
4140 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION        (0x1UL << 9)
4141 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN        (0x2UL << 9)
4142 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_TUNNEL_TOTAL_ERROR      (0x3UL << 9)
4143 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR        (0x4UL << 9)
4144 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR       (0x5UL << 9)
4145 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL            (0x6UL << 9)
4146 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_LAST \
4147 		CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL
4148 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_MASK                    0xf000UL
4149 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_SFT                     12
4150 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_NO_ERROR	(0x0UL << 12)
4151 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_VERSION	(0x1UL << 12)
4152 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN    (0x2UL << 12)
4153 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_TTL        (0x3UL << 12)
4154 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_IP_TOTAL_ERROR    (0x4UL << 12)
4155 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR   (0x5UL << 12)
4156 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN    (0x6UL << 12)
4157 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL (0x7UL << 12)
4158 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN (0x8UL << 12)
4159 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_LAST \
4160 		CQ_RES_RAWETH_QP1_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN
4161 	__le16	raweth_qp1_cfa_code;
4162 	__le64	qp_handle;
4163 	__le32	raweth_qp1_flags2;
4164 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_IP_CS_CALC                 0x1UL
4165 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_L4_CS_CALC                 0x2UL
4166 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_T_IP_CS_CALC               0x4UL
4167 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_T_L4_CS_CALC               0x8UL
4168 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_MASK           0xf0UL
4169 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_SFT            4
4170 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_NONE             (0x0UL << 4)
4171 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_VLAN             (0x1UL << 4)
4172 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_TUNNEL_ID        (0x2UL << 4)
4173 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_CHDR_DATA        (0x3UL << 4)
4174 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_HDR_OFFSET       (0x4UL << 4)
4175 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_LAST \
4176 		CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_META_FORMAT_HDR_OFFSET
4177 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_IP_TYPE                    0x100UL
4178 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_CALC     0x200UL
4179 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_EXT_META_FORMAT_MASK       0xc00UL
4180 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_EXT_META_FORMAT_SFT        10
4181 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_MASK     0xffff0000UL
4182 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_SFT      16
4183 	__le32	raweth_qp1_metadata;
4184 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_PRI_DE_VID_MASK    0xffffUL
4185 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_PRI_DE_VID_SFT     0
4186 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_VID_MASK           0xfffUL
4187 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_VID_SFT            0
4188 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_DE                 0x1000UL
4189 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_PRI_MASK           0xe000UL
4190 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_PRI_SFT            13
4191 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_TPID_MASK          0xffff0000UL
4192 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_METADATA_TPID_SFT           16
4193 	u8	cqe_type_toggle;
4194 	#define CQ_RES_RAWETH_QP1_TOGGLE                 0x1UL
4195 	#define CQ_RES_RAWETH_QP1_CQE_TYPE_MASK          0x1eUL
4196 	#define CQ_RES_RAWETH_QP1_CQE_TYPE_SFT           1
4197 	#define CQ_RES_RAWETH_QP1_CQE_TYPE_RES_RAWETH_QP1  (0x3UL << 1)
4198 	#define CQ_RES_RAWETH_QP1_CQE_TYPE_LAST           CQ_RES_RAWETH_QP1_CQE_TYPE_RES_RAWETH_QP1
4199 	u8	status;
4200 	#define CQ_RES_RAWETH_QP1_STATUS_OK                       0x0UL
4201 	#define CQ_RES_RAWETH_QP1_STATUS_LOCAL_ACCESS_ERROR       0x1UL
4202 	#define CQ_RES_RAWETH_QP1_STATUS_HW_LOCAL_LENGTH_ERR      0x2UL
4203 	#define CQ_RES_RAWETH_QP1_STATUS_LOCAL_PROTECTION_ERR     0x3UL
4204 	#define CQ_RES_RAWETH_QP1_STATUS_LOCAL_QP_OPERATION_ERR   0x4UL
4205 	#define CQ_RES_RAWETH_QP1_STATUS_MEMORY_MGT_OPERATION_ERR 0x5UL
4206 	#define CQ_RES_RAWETH_QP1_STATUS_WORK_REQUEST_FLUSHED_ERR 0x7UL
4207 	#define CQ_RES_RAWETH_QP1_STATUS_HW_FLUSH_ERR             0x8UL
4208 	#define CQ_RES_RAWETH_QP1_STATUS_LAST  CQ_RES_RAWETH_QP1_STATUS_HW_FLUSH_ERR
4209 	__le16	flags;
4210 	#define CQ_RES_RAWETH_QP1_FLAGS_SRQ     0x1UL
4211 	#define CQ_RES_RAWETH_QP1_FLAGS_SRQ_RQ    0x0UL
4212 	#define CQ_RES_RAWETH_QP1_FLAGS_SRQ_SRQ   0x1UL
4213 	#define CQ_RES_RAWETH_QP1_FLAGS_SRQ_LAST CQ_RES_RAWETH_QP1_FLAGS_SRQ_SRQ
4214 	__le32	raweth_qp1_payload_offset_srq_or_rq_wr_id;
4215 	#define CQ_RES_RAWETH_QP1_SRQ_OR_RQ_WR_ID_MASK          0xfffffUL
4216 	#define CQ_RES_RAWETH_QP1_SRQ_OR_RQ_WR_ID_SFT           0
4217 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_PAYLOAD_OFFSET_MASK 0xff000000UL
4218 	#define CQ_RES_RAWETH_QP1_RAWETH_QP1_PAYLOAD_OFFSET_SFT 24
4219 };
4220 
4221 /* cq_res_raweth_qp1_v2 (size:256b/32B) */
4222 struct cq_res_raweth_qp1_v2 {
4223 	__le16	length;
4224 	#define CQ_RES_RAWETH_QP1_V2_LENGTH_MASK 0x3fffUL
4225 	#define CQ_RES_RAWETH_QP1_V2_LENGTH_SFT 0
4226 	__le16	raweth_qp1_flags;
4227 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_MASK                  0x3ffUL
4228 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_SFT                   0
4229 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ERROR                  0x1UL
4230 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_MASK             0x3c0UL
4231 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_SFT              6
4232 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_NOT_KNOWN          (0x0UL << 6)
4233 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_IP                 (0x1UL << 6)
4234 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_TCP                (0x2UL << 6)
4235 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_UDP                (0x3UL << 6)
4236 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_FCOE               (0x4UL << 6)
4237 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_ROCE               (0x5UL << 6)
4238 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_ICMP               (0x7UL << 6)
4239 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_PTP_WO_TIMESTAMP   (0x8UL << 6)
4240 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_PTP_W_TIMESTAMP    (0x9UL << 6)
4241 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_LAST \
4242 		CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS_ITYPE_PTP_W_TIMESTAMP
4243 	__le16	raweth_qp1_errors;
4244 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_IP_CS_ERROR                       0x10UL
4245 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_L4_CS_ERROR                       0x20UL
4246 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_IP_CS_ERROR                     0x40UL
4247 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_L4_CS_ERROR                     0x80UL
4248 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_CRC_ERROR                         0x100UL
4249 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_MASK                  0xe00UL
4250 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_SFT                   9
4251 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_NO_ERROR (0x0UL << 9)
4252 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION (0x1UL << 9)
4253 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN (0x2UL << 9)
4254 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_TUNNEL_TOTAL_ERROR (0x3UL << 9)
4255 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR (0x4UL << 9)
4256 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR (0x5UL << 9)
4257 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL (0x6UL << 9)
4258 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_LAST \
4259 		CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL
4260 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_MASK    0xf000UL
4261 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_SFT 12
4262 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_NO_ERROR   (0x0UL << 12)
4263 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_VERSION  (0x1UL << 12)
4264 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN  (0x2UL << 12)
4265 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L3_BAD_TTL      (0x3UL << 12)
4266 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_IP_TOTAL_ERROR  (0x4UL << 12)
4267 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR (0x5UL << 12)
4268 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN  (0x6UL << 12)
4269 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL \
4270 		(0x7UL << 12)
4271 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN \
4272 		(0x8UL << 12)
4273 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_LAST \
4274 		CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN
4275 	__le16	cfa_metadata0;
4276 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA0_VID_MASK 0xfffUL
4277 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA0_VID_SFT 0
4278 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA0_DE      0x1000UL
4279 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA0_PRI_MASK 0xe000UL
4280 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA0_PRI_SFT 13
4281 	__le64	qp_handle;
4282 	__le32	raweth_qp1_flags2;
4283 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_CS_ALL_OK_MODE             0x8UL
4284 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_MASK           0xf0UL
4285 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_SFT            4
4286 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_NONE             (0x0UL << 4)
4287 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_ACT_REC_PTR      (0x1UL << 4)
4288 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_TUNNEL_ID        (0x2UL << 4)
4289 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_CHDR_DATA        (0x3UL << 4)
4290 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_HDR_OFFSET       (0x4UL << 4)
4291 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_LAST \
4292 		CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_META_FORMAT_HDR_OFFSET
4293 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_IP_TYPE                    0x100UL
4294 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_CALC     0x200UL
4295 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_CS_OK_MASK                 0xfc00UL
4296 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_CS_OK_SFT                  10
4297 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_MASK     0xffff0000UL
4298 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_FLAGS2_COMPLETE_CHECKSUM_SFT      16
4299 	__le32	cfa_metadata2;
4300 	u8	cqe_type_toggle;
4301 	#define CQ_RES_RAWETH_QP1_V2_TOGGLE                 0x1UL
4302 	#define CQ_RES_RAWETH_QP1_V2_CQE_TYPE_MASK          0x1eUL
4303 	#define CQ_RES_RAWETH_QP1_V2_CQE_TYPE_SFT           1
4304 	#define CQ_RES_RAWETH_QP1_V2_CQE_TYPE_RES_RAWETH_QP1  (0x3UL << 1)
4305 	#define CQ_RES_RAWETH_QP1_V2_CQE_TYPE_LAST CQ_RES_RAWETH_QP1_V2_CQE_TYPE_RES_RAWETH_QP1
4306 	u8	status;
4307 	#define CQ_RES_RAWETH_QP1_V2_STATUS_OK                       0x0UL
4308 	#define CQ_RES_RAWETH_QP1_V2_STATUS_LOCAL_ACCESS_ERROR       0x1UL
4309 	#define CQ_RES_RAWETH_QP1_V2_STATUS_HW_LOCAL_LENGTH_ERR      0x2UL
4310 	#define CQ_RES_RAWETH_QP1_V2_STATUS_LOCAL_PROTECTION_ERR     0x3UL
4311 	#define CQ_RES_RAWETH_QP1_V2_STATUS_LOCAL_QP_OPERATION_ERR   0x4UL
4312 	#define CQ_RES_RAWETH_QP1_V2_STATUS_MEMORY_MGT_OPERATION_ERR 0x5UL
4313 	#define CQ_RES_RAWETH_QP1_V2_STATUS_WORK_REQUEST_FLUSHED_ERR 0x7UL
4314 	#define CQ_RES_RAWETH_QP1_V2_STATUS_HW_FLUSH_ERR             0x8UL
4315 	#define CQ_RES_RAWETH_QP1_V2_STATUS_LAST CQ_RES_RAWETH_QP1_V2_STATUS_HW_FLUSH_ERR
4316 	__le16	flags;
4317 	#define CQ_RES_RAWETH_QP1_V2_FLAGS_SRQ     0x1UL
4318 	#define CQ_RES_RAWETH_QP1_V2_FLAGS_SRQ_RQ    0x0UL
4319 	#define CQ_RES_RAWETH_QP1_V2_FLAGS_SRQ_SRQ   0x1UL
4320 	#define CQ_RES_RAWETH_QP1_V2_FLAGS_SRQ_LAST CQ_RES_RAWETH_QP1_V2_FLAGS_SRQ_SRQ
4321 	__le32	raweth_qp1_payload_offset_srq_or_rq_wr_id;
4322 	#define CQ_RES_RAWETH_QP1_V2_SRQ_OR_RQ_WR_ID_MASK           0xfffffUL
4323 	#define CQ_RES_RAWETH_QP1_V2_SRQ_OR_RQ_WR_ID_SFT            0
4324 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_MASK             0xf00000UL
4325 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_SFT              20
4326 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_MASK     0x700000UL
4327 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_SFT      20
4328 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPID88A8   (0x0UL << 20)
4329 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPID8100   (0x1UL << 20)
4330 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPID9100   (0x2UL << 20)
4331 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPID9200   (0x3UL << 20)
4332 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPID9300   (0x4UL << 20)
4333 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPIDCFG    (0x5UL << 20)
4334 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_LAST \
4335 		CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_TPID_SEL_TPIDCFG
4336 	#define CQ_RES_RAWETH_QP1_V2_CFA_METADATA1_VALID             0x800000UL
4337 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_PAYLOAD_OFFSET_MASK 0xff000000UL
4338 	#define CQ_RES_RAWETH_QP1_V2_RAWETH_QP1_PAYLOAD_OFFSET_SFT  24
4339 };
4340 
4341 /* cq_terminal (size:256b/32B) */
4342 struct cq_terminal {
4343 	__le64	qp_handle;
4344 	__le16	sq_cons_idx;
4345 	__le16	rq_cons_idx;
4346 	__le32	reserved32_1;
4347 	__le64	reserved64_3;
4348 	u8	cqe_type_toggle;
4349 	#define CQ_TERMINAL_TOGGLE           0x1UL
4350 	#define CQ_TERMINAL_CQE_TYPE_MASK    0x1eUL
4351 	#define CQ_TERMINAL_CQE_TYPE_SFT     1
4352 	#define CQ_TERMINAL_CQE_TYPE_TERMINAL  (0xeUL << 1)
4353 	#define CQ_TERMINAL_CQE_TYPE_LAST     CQ_TERMINAL_CQE_TYPE_TERMINAL
4354 	u8	status;
4355 	#define CQ_TERMINAL_STATUS_OK 0x0UL
4356 	#define CQ_TERMINAL_STATUS_LAST CQ_TERMINAL_STATUS_OK
4357 	__le16	reserved16;
4358 	__le32	reserved32_2;
4359 };
4360 
4361 /* cq_cutoff (size:256b/32B) */
4362 struct cq_cutoff {
4363 	__le64	reserved64_1;
4364 	__le64	reserved64_2;
4365 	__le64	reserved64_3;
4366 	u8	cqe_type_toggle;
4367 	#define CQ_CUTOFF_TOGGLE          0x1UL
4368 	#define CQ_CUTOFF_CQE_TYPE_MASK   0x1eUL
4369 	#define CQ_CUTOFF_CQE_TYPE_SFT    1
4370 	#define CQ_CUTOFF_CQE_TYPE_CUT_OFF  (0xfUL << 1)
4371 	#define CQ_CUTOFF_CQE_TYPE_LAST    CQ_CUTOFF_CQE_TYPE_CUT_OFF
4372 	#define CQ_CUTOFF_RESIZE_TOGGLE_MASK 0x60UL
4373 	#define CQ_CUTOFF_RESIZE_TOGGLE_SFT 5
4374 	u8	status;
4375 	#define CQ_CUTOFF_STATUS_OK 0x0UL
4376 	#define CQ_CUTOFF_STATUS_LAST CQ_CUTOFF_STATUS_OK
4377 	__le16	reserved16;
4378 	__le32	reserved32;
4379 };
4380 
4381 /* nq_base (size:128b/16B) */
4382 struct nq_base {
4383 	__le16	info10_type;
4384 	#define NQ_BASE_TYPE_MASK           0x3fUL
4385 	#define NQ_BASE_TYPE_SFT            0
4386 	#define NQ_BASE_TYPE_CQ_NOTIFICATION  0x30UL
4387 	#define NQ_BASE_TYPE_SRQ_EVENT        0x32UL
4388 	#define NQ_BASE_TYPE_DBQ_EVENT        0x34UL
4389 	#define NQ_BASE_TYPE_QP_EVENT         0x38UL
4390 	#define NQ_BASE_TYPE_FUNC_EVENT       0x3aUL
4391 	#define NQ_BASE_TYPE_LAST            NQ_BASE_TYPE_FUNC_EVENT
4392 	#define NQ_BASE_INFO10_MASK         0xffc0UL
4393 	#define NQ_BASE_INFO10_SFT          6
4394 	__le16	info16;
4395 	__le32	info32;
4396 	__le32	info63_v[2];
4397 	#define NQ_BASE_V          0x1UL
4398 	#define NQ_BASE_INFO63_MASK 0xfffffffeUL
4399 	#define NQ_BASE_INFO63_SFT 1
4400 };
4401 
4402 /* nq_cn (size:128b/16B) */
4403 struct nq_cn {
4404 	__le16	type;
4405 	#define NQ_CN_TYPE_MASK           0x3fUL
4406 	#define NQ_CN_TYPE_SFT            0
4407 	#define NQ_CN_TYPE_CQ_NOTIFICATION  0x30UL
4408 	#define NQ_CN_TYPE_LAST            NQ_CN_TYPE_CQ_NOTIFICATION
4409 	#define NQ_CN_TOGGLE_MASK         0xc0UL
4410 	#define NQ_CN_TOGGLE_SFT          6
4411 	__le16	reserved16;
4412 	__le32	cq_handle_low;
4413 	__le32	v;
4414 	#define NQ_CN_V     0x1UL
4415 	__le32	cq_handle_high;
4416 };
4417 
4418 /* nq_srq_event (size:128b/16B) */
4419 struct nq_srq_event {
4420 	u8	type;
4421 	#define NQ_SRQ_EVENT_TYPE_MASK     0x3fUL
4422 	#define NQ_SRQ_EVENT_TYPE_SFT      0
4423 	#define NQ_SRQ_EVENT_TYPE_SRQ_EVENT  0x32UL
4424 	#define NQ_SRQ_EVENT_TYPE_LAST      NQ_SRQ_EVENT_TYPE_SRQ_EVENT
4425 	#define NQ_SRQ_EVENT_TOGGLE_MASK   0xc0UL
4426 	#define NQ_SRQ_EVENT_TOGGLE_SFT    6
4427 	u8	event;
4428 	#define NQ_SRQ_EVENT_EVENT_SRQ_THRESHOLD_EVENT 0x1UL
4429 	#define NQ_SRQ_EVENT_EVENT_LAST               NQ_SRQ_EVENT_EVENT_SRQ_THRESHOLD_EVENT
4430 	__le16	reserved16;
4431 	__le32	srq_handle_low;
4432 	__le32	v;
4433 	#define NQ_SRQ_EVENT_V     0x1UL
4434 	__le32	srq_handle_high;
4435 };
4436 
4437 /* nq_dbq_event (size:128b/16B) */
4438 struct nq_dbq_event {
4439 	u8	type;
4440 	#define NQ_DBQ_EVENT_TYPE_MASK     0x3fUL
4441 	#define NQ_DBQ_EVENT_TYPE_SFT      0
4442 	#define NQ_DBQ_EVENT_TYPE_DBQ_EVENT  0x34UL
4443 	#define NQ_DBQ_EVENT_TYPE_LAST      NQ_DBQ_EVENT_TYPE_DBQ_EVENT
4444 	u8	event;
4445 	#define NQ_DBQ_EVENT_EVENT_DBQ_THRESHOLD_EVENT 0x1UL
4446 	#define NQ_DBQ_EVENT_EVENT_LAST               NQ_DBQ_EVENT_EVENT_DBQ_THRESHOLD_EVENT
4447 	__le16	db_pfid;
4448 	#define NQ_DBQ_EVENT_DB_PFID_MASK 0xfUL
4449 	#define NQ_DBQ_EVENT_DB_PFID_SFT 0
4450 	__le32	db_dpi;
4451 	#define NQ_DBQ_EVENT_DB_DPI_MASK 0xfffffUL
4452 	#define NQ_DBQ_EVENT_DB_DPI_SFT 0
4453 	__le32	v;
4454 	#define NQ_DBQ_EVENT_V     0x1UL
4455 	__le32	db_type_db_xid;
4456 	#define NQ_DBQ_EVENT_DB_XID_MASK 0xfffffUL
4457 	#define NQ_DBQ_EVENT_DB_XID_SFT  0
4458 	#define NQ_DBQ_EVENT_DB_TYPE_MASK 0xf0000000UL
4459 	#define NQ_DBQ_EVENT_DB_TYPE_SFT 28
4460 };
4461 
4462 /* xrrq_irrq (size:256b/32B) */
4463 struct xrrq_irrq {
4464 	__le16	credits_type;
4465 	#define XRRQ_IRRQ_TYPE           0x1UL
4466 	#define XRRQ_IRRQ_TYPE_READ_REQ    0x0UL
4467 	#define XRRQ_IRRQ_TYPE_ATOMIC_REQ  0x1UL
4468 	#define XRRQ_IRRQ_TYPE_LAST       XRRQ_IRRQ_TYPE_ATOMIC_REQ
4469 	#define XRRQ_IRRQ_CREDITS_MASK   0xf800UL
4470 	#define XRRQ_IRRQ_CREDITS_SFT    11
4471 	__le16	reserved16;
4472 	__le32	reserved32;
4473 	__le32	psn;
4474 	#define XRRQ_IRRQ_PSN_MASK 0xffffffUL
4475 	#define XRRQ_IRRQ_PSN_SFT 0
4476 	__le32	msn;
4477 	#define XRRQ_IRRQ_MSN_MASK 0xffffffUL
4478 	#define XRRQ_IRRQ_MSN_SFT 0
4479 	__le64	va_or_atomic_result;
4480 	__le32	rdma_r_key;
4481 	__le32	length;
4482 };
4483 
4484 /* xrrq_orrq (size:256b/32B) */
4485 struct xrrq_orrq {
4486 	__le16	num_sges_type;
4487 	#define XRRQ_ORRQ_TYPE           0x1UL
4488 	#define XRRQ_ORRQ_TYPE_READ_REQ    0x0UL
4489 	#define XRRQ_ORRQ_TYPE_ATOMIC_REQ  0x1UL
4490 	#define XRRQ_ORRQ_TYPE_LAST       XRRQ_ORRQ_TYPE_ATOMIC_REQ
4491 	#define XRRQ_ORRQ_NUM_SGES_MASK  0xf800UL
4492 	#define XRRQ_ORRQ_NUM_SGES_SFT   11
4493 	__le16	reserved16;
4494 	__le32	length;
4495 	__le32	psn;
4496 	#define XRRQ_ORRQ_PSN_MASK 0xffffffUL
4497 	#define XRRQ_ORRQ_PSN_SFT 0
4498 	__le32	end_psn;
4499 	#define XRRQ_ORRQ_END_PSN_MASK 0xffffffUL
4500 	#define XRRQ_ORRQ_END_PSN_SFT 0
4501 	__le64	first_sge_phy_or_sing_sge_va;
4502 	__le32	single_sge_l_key;
4503 	__le32	single_sge_size;
4504 };
4505 
4506 /* ptu_pte (size:64b/8B) */
4507 struct ptu_pte {
4508 	__le32	page_next_to_last_last_valid[2];
4509 	#define PTU_PTE_VALID            0x1UL
4510 	#define PTU_PTE_LAST             0x2UL
4511 	#define PTU_PTE_NEXT_TO_LAST     0x4UL
4512 	#define PTU_PTE_UNUSED_MASK      0xff8UL
4513 	#define PTU_PTE_UNUSED_SFT       3
4514 	#define PTU_PTE_PAGE_MASK        0xfffff000UL
4515 	#define PTU_PTE_PAGE_SFT         12
4516 };
4517 
4518 /* ptu_pde (size:64b/8B) */
4519 struct ptu_pde {
4520 	__le32	page_valid[2];
4521 	#define PTU_PDE_VALID      0x1UL
4522 	#define PTU_PDE_UNUSED_MASK 0xffeUL
4523 	#define PTU_PDE_UNUSED_SFT 1
4524 	#define PTU_PDE_PAGE_MASK  0xfffff000UL
4525 	#define PTU_PDE_PAGE_SFT   12
4526 };
4527 
4528 #endif /* ___BNXT_RE_HSI_H__ */
4529