2 * Copyright (c) 2009-2010 Chelsio, Inc. All rights reserved.
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
17 * - Redistributions in binary form must reproduce the above
18 * copyright notice, this list of conditions and the following
19 * disclaimer in the documentation and/or other materials
20 * provided with the distribution.
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
26 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
27 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
28 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31 #ifndef _T4FW_RI_API_H_
32 #define _T4FW_RI_API_H_
36 enum fw_ri_wr_opcode
{
37 FW_RI_RDMA_WRITE
= 0x0, /* IETF RDMAP v1.0 ... */
39 FW_RI_READ_RESP
= 0x2,
41 FW_RI_SEND_WITH_INV
= 0x4,
42 FW_RI_SEND_WITH_SE
= 0x5,
43 FW_RI_SEND_WITH_SE_INV
= 0x6,
44 FW_RI_TERMINATE
= 0x7,
45 FW_RI_RDMA_INIT
= 0x8, /* CHELSIO RI specific ... */
47 FW_RI_FAST_REGISTER
= 0xa,
48 FW_RI_LOCAL_INV
= 0xb,
49 FW_RI_QP_MODIFY
= 0xc,
53 FW_RI_SGE_EC_CR_RETURN
= 0xf,
54 FW_RI_WRITE_IMMEDIATE
= FW_RI_RDMA_INIT
58 FW_RI_COMPLETION_FLAG
= 0x01,
59 FW_RI_NOTIFICATION_FLAG
= 0x02,
60 FW_RI_SOLICITED_EVENT_FLAG
= 0x04,
61 FW_RI_READ_FENCE_FLAG
= 0x08,
62 FW_RI_LOCAL_FENCE_FLAG
= 0x10,
63 FW_RI_RDMA_READ_INVALIDATE
= 0x20,
64 FW_RI_RDMA_WRITE_WITH_IMMEDIATE
= 0x40
67 enum fw_ri_mpa_attrs
{
68 FW_RI_MPA_RX_MARKER_ENABLE
= 0x01,
69 FW_RI_MPA_TX_MARKER_ENABLE
= 0x02,
70 FW_RI_MPA_CRC_ENABLE
= 0x04,
71 FW_RI_MPA_IETF_ENABLE
= 0x08
75 FW_RI_QP_RDMA_READ_ENABLE
= 0x01,
76 FW_RI_QP_RDMA_WRITE_ENABLE
= 0x02,
77 FW_RI_QP_BIND_ENABLE
= 0x04,
78 FW_RI_QP_FAST_REGISTER_ENABLE
= 0x08,
79 FW_RI_QP_STAG0_ENABLE
= 0x10
82 enum fw_ri_addr_type
{
83 FW_RI_ZERO_BASED_TO
= 0x00,
84 FW_RI_VA_BASED_TO
= 0x01
87 enum fw_ri_mem_perms
{
88 FW_RI_MEM_ACCESS_REM_WRITE
= 0x01,
89 FW_RI_MEM_ACCESS_REM_READ
= 0x02,
90 FW_RI_MEM_ACCESS_REM
= 0x03,
91 FW_RI_MEM_ACCESS_LOCAL_WRITE
= 0x04,
92 FW_RI_MEM_ACCESS_LOCAL_READ
= 0x08,
93 FW_RI_MEM_ACCESS_LOCAL
= 0x0C
96 enum fw_ri_stag_type
{
97 FW_RI_STAG_NSMR
= 0x00,
98 FW_RI_STAG_SMR
= 0x01,
100 FW_RI_STAG_MW_RELAXED
= 0x03
104 FW_RI_DATA_IMMD
= 0x81,
105 FW_RI_DATA_DSGL
= 0x82,
106 FW_RI_DATA_ISGL
= 0x83
109 enum fw_ri_sgl_depth
{
110 FW_RI_SGL_DEPTH_MAX_SQ
= 16,
111 FW_RI_SGL_DEPTH_MAX_RQ
= 4
114 struct fw_ri_dsge_pair
{
125 #ifndef C99_NOT_SUPPORTED
126 struct fw_ri_dsge_pair sge
[];
141 #ifndef C99_NOT_SUPPORTED
142 struct fw_ri_sge sge
[];
151 #ifndef C99_NOT_SUPPORTED
157 __be32 valid_to_pdid
;
158 __be32 locread_to_qpid
;
159 __be32 nosnoop_pbladdr
;
163 __be32 dca_mwbcnt_pstag
;
167 #define FW_RI_TPTE_VALID_S 31
168 #define FW_RI_TPTE_VALID_M 0x1
169 #define FW_RI_TPTE_VALID_V(x) ((x) << FW_RI_TPTE_VALID_S)
170 #define FW_RI_TPTE_VALID_G(x) \
171 (((x) >> FW_RI_TPTE_VALID_S) & FW_RI_TPTE_VALID_M)
172 #define FW_RI_TPTE_VALID_F FW_RI_TPTE_VALID_V(1U)
174 #define FW_RI_TPTE_STAGKEY_S 23
175 #define FW_RI_TPTE_STAGKEY_M 0xff
176 #define FW_RI_TPTE_STAGKEY_V(x) ((x) << FW_RI_TPTE_STAGKEY_S)
177 #define FW_RI_TPTE_STAGKEY_G(x) \
178 (((x) >> FW_RI_TPTE_STAGKEY_S) & FW_RI_TPTE_STAGKEY_M)
180 #define FW_RI_TPTE_STAGSTATE_S 22
181 #define FW_RI_TPTE_STAGSTATE_M 0x1
182 #define FW_RI_TPTE_STAGSTATE_V(x) ((x) << FW_RI_TPTE_STAGSTATE_S)
183 #define FW_RI_TPTE_STAGSTATE_G(x) \
184 (((x) >> FW_RI_TPTE_STAGSTATE_S) & FW_RI_TPTE_STAGSTATE_M)
185 #define FW_RI_TPTE_STAGSTATE_F FW_RI_TPTE_STAGSTATE_V(1U)
187 #define FW_RI_TPTE_STAGTYPE_S 20
188 #define FW_RI_TPTE_STAGTYPE_M 0x3
189 #define FW_RI_TPTE_STAGTYPE_V(x) ((x) << FW_RI_TPTE_STAGTYPE_S)
190 #define FW_RI_TPTE_STAGTYPE_G(x) \
191 (((x) >> FW_RI_TPTE_STAGTYPE_S) & FW_RI_TPTE_STAGTYPE_M)
193 #define FW_RI_TPTE_PDID_S 0
194 #define FW_RI_TPTE_PDID_M 0xfffff
195 #define FW_RI_TPTE_PDID_V(x) ((x) << FW_RI_TPTE_PDID_S)
196 #define FW_RI_TPTE_PDID_G(x) \
197 (((x) >> FW_RI_TPTE_PDID_S) & FW_RI_TPTE_PDID_M)
199 #define FW_RI_TPTE_PERM_S 28
200 #define FW_RI_TPTE_PERM_M 0xf
201 #define FW_RI_TPTE_PERM_V(x) ((x) << FW_RI_TPTE_PERM_S)
202 #define FW_RI_TPTE_PERM_G(x) \
203 (((x) >> FW_RI_TPTE_PERM_S) & FW_RI_TPTE_PERM_M)
205 #define FW_RI_TPTE_REMINVDIS_S 27
206 #define FW_RI_TPTE_REMINVDIS_M 0x1
207 #define FW_RI_TPTE_REMINVDIS_V(x) ((x) << FW_RI_TPTE_REMINVDIS_S)
208 #define FW_RI_TPTE_REMINVDIS_G(x) \
209 (((x) >> FW_RI_TPTE_REMINVDIS_S) & FW_RI_TPTE_REMINVDIS_M)
210 #define FW_RI_TPTE_REMINVDIS_F FW_RI_TPTE_REMINVDIS_V(1U)
212 #define FW_RI_TPTE_ADDRTYPE_S 26
213 #define FW_RI_TPTE_ADDRTYPE_M 1
214 #define FW_RI_TPTE_ADDRTYPE_V(x) ((x) << FW_RI_TPTE_ADDRTYPE_S)
215 #define FW_RI_TPTE_ADDRTYPE_G(x) \
216 (((x) >> FW_RI_TPTE_ADDRTYPE_S) & FW_RI_TPTE_ADDRTYPE_M)
217 #define FW_RI_TPTE_ADDRTYPE_F FW_RI_TPTE_ADDRTYPE_V(1U)
219 #define FW_RI_TPTE_MWBINDEN_S 25
220 #define FW_RI_TPTE_MWBINDEN_M 0x1
221 #define FW_RI_TPTE_MWBINDEN_V(x) ((x) << FW_RI_TPTE_MWBINDEN_S)
222 #define FW_RI_TPTE_MWBINDEN_G(x) \
223 (((x) >> FW_RI_TPTE_MWBINDEN_S) & FW_RI_TPTE_MWBINDEN_M)
224 #define FW_RI_TPTE_MWBINDEN_F FW_RI_TPTE_MWBINDEN_V(1U)
226 #define FW_RI_TPTE_PS_S 20
227 #define FW_RI_TPTE_PS_M 0x1f
228 #define FW_RI_TPTE_PS_V(x) ((x) << FW_RI_TPTE_PS_S)
229 #define FW_RI_TPTE_PS_G(x) \
230 (((x) >> FW_RI_TPTE_PS_S) & FW_RI_TPTE_PS_M)
232 #define FW_RI_TPTE_QPID_S 0
233 #define FW_RI_TPTE_QPID_M 0xfffff
234 #define FW_RI_TPTE_QPID_V(x) ((x) << FW_RI_TPTE_QPID_S)
235 #define FW_RI_TPTE_QPID_G(x) \
236 (((x) >> FW_RI_TPTE_QPID_S) & FW_RI_TPTE_QPID_M)
238 #define FW_RI_TPTE_NOSNOOP_S 30
239 #define FW_RI_TPTE_NOSNOOP_M 0x1
240 #define FW_RI_TPTE_NOSNOOP_V(x) ((x) << FW_RI_TPTE_NOSNOOP_S)
241 #define FW_RI_TPTE_NOSNOOP_G(x) \
242 (((x) >> FW_RI_TPTE_NOSNOOP_S) & FW_RI_TPTE_NOSNOOP_M)
243 #define FW_RI_TPTE_NOSNOOP_F FW_RI_TPTE_NOSNOOP_V(1U)
245 #define FW_RI_TPTE_PBLADDR_S 0
246 #define FW_RI_TPTE_PBLADDR_M 0x1fffffff
247 #define FW_RI_TPTE_PBLADDR_V(x) ((x) << FW_RI_TPTE_PBLADDR_S)
248 #define FW_RI_TPTE_PBLADDR_G(x) \
249 (((x) >> FW_RI_TPTE_PBLADDR_S) & FW_RI_TPTE_PBLADDR_M)
251 #define FW_RI_TPTE_DCA_S 24
252 #define FW_RI_TPTE_DCA_M 0x1f
253 #define FW_RI_TPTE_DCA_V(x) ((x) << FW_RI_TPTE_DCA_S)
254 #define FW_RI_TPTE_DCA_G(x) \
255 (((x) >> FW_RI_TPTE_DCA_S) & FW_RI_TPTE_DCA_M)
257 #define FW_RI_TPTE_MWBCNT_PSTAG_S 0
258 #define FW_RI_TPTE_MWBCNT_PSTAG_M 0xffffff
259 #define FW_RI_TPTE_MWBCNT_PSTAT_V(x) \
260 ((x) << FW_RI_TPTE_MWBCNT_PSTAG_S)
261 #define FW_RI_TPTE_MWBCNT_PSTAG_G(x) \
262 (((x) >> FW_RI_TPTE_MWBCNT_PSTAG_S) & FW_RI_TPTE_MWBCNT_PSTAG_M)
264 enum fw_ri_res_type
{
277 union fw_ri_restype
{
278 struct fw_ri_res_sqrq
{
284 __be32 fetchszm_to_iqid
;
285 __be32 dcaen_to_eqsize
;
288 struct fw_ri_res_cq
{
294 __be32 iqandst_to_iqandstindex
;
295 __be16 iqdroprss_to_iqesize
;
302 struct fw_ri_res_srq
{
308 __be32 fetchszm_to_iqid
;
309 __be32 dcaen_to_eqsize
;
319 struct fw_ri_res_wr
{
323 #ifndef C99_NOT_SUPPORTED
324 struct fw_ri_res res
[];
328 #define FW_RI_RES_WR_NRES_S 0
329 #define FW_RI_RES_WR_NRES_M 0xff
330 #define FW_RI_RES_WR_NRES_V(x) ((x) << FW_RI_RES_WR_NRES_S)
331 #define FW_RI_RES_WR_NRES_G(x) \
332 (((x) >> FW_RI_RES_WR_NRES_S) & FW_RI_RES_WR_NRES_M)
334 #define FW_RI_RES_WR_FETCHSZM_S 26
335 #define FW_RI_RES_WR_FETCHSZM_M 0x1
336 #define FW_RI_RES_WR_FETCHSZM_V(x) ((x) << FW_RI_RES_WR_FETCHSZM_S)
337 #define FW_RI_RES_WR_FETCHSZM_G(x) \
338 (((x) >> FW_RI_RES_WR_FETCHSZM_S) & FW_RI_RES_WR_FETCHSZM_M)
339 #define FW_RI_RES_WR_FETCHSZM_F FW_RI_RES_WR_FETCHSZM_V(1U)
341 #define FW_RI_RES_WR_STATUSPGNS_S 25
342 #define FW_RI_RES_WR_STATUSPGNS_M 0x1
343 #define FW_RI_RES_WR_STATUSPGNS_V(x) ((x) << FW_RI_RES_WR_STATUSPGNS_S)
344 #define FW_RI_RES_WR_STATUSPGNS_G(x) \
345 (((x) >> FW_RI_RES_WR_STATUSPGNS_S) & FW_RI_RES_WR_STATUSPGNS_M)
346 #define FW_RI_RES_WR_STATUSPGNS_F FW_RI_RES_WR_STATUSPGNS_V(1U)
348 #define FW_RI_RES_WR_STATUSPGRO_S 24
349 #define FW_RI_RES_WR_STATUSPGRO_M 0x1
350 #define FW_RI_RES_WR_STATUSPGRO_V(x) ((x) << FW_RI_RES_WR_STATUSPGRO_S)
351 #define FW_RI_RES_WR_STATUSPGRO_G(x) \
352 (((x) >> FW_RI_RES_WR_STATUSPGRO_S) & FW_RI_RES_WR_STATUSPGRO_M)
353 #define FW_RI_RES_WR_STATUSPGRO_F FW_RI_RES_WR_STATUSPGRO_V(1U)
355 #define FW_RI_RES_WR_FETCHNS_S 23
356 #define FW_RI_RES_WR_FETCHNS_M 0x1
357 #define FW_RI_RES_WR_FETCHNS_V(x) ((x) << FW_RI_RES_WR_FETCHNS_S)
358 #define FW_RI_RES_WR_FETCHNS_G(x) \
359 (((x) >> FW_RI_RES_WR_FETCHNS_S) & FW_RI_RES_WR_FETCHNS_M)
360 #define FW_RI_RES_WR_FETCHNS_F FW_RI_RES_WR_FETCHNS_V(1U)
362 #define FW_RI_RES_WR_FETCHRO_S 22
363 #define FW_RI_RES_WR_FETCHRO_M 0x1
364 #define FW_RI_RES_WR_FETCHRO_V(x) ((x) << FW_RI_RES_WR_FETCHRO_S)
365 #define FW_RI_RES_WR_FETCHRO_G(x) \
366 (((x) >> FW_RI_RES_WR_FETCHRO_S) & FW_RI_RES_WR_FETCHRO_M)
367 #define FW_RI_RES_WR_FETCHRO_F FW_RI_RES_WR_FETCHRO_V(1U)
369 #define FW_RI_RES_WR_HOSTFCMODE_S 20
370 #define FW_RI_RES_WR_HOSTFCMODE_M 0x3
371 #define FW_RI_RES_WR_HOSTFCMODE_V(x) ((x) << FW_RI_RES_WR_HOSTFCMODE_S)
372 #define FW_RI_RES_WR_HOSTFCMODE_G(x) \
373 (((x) >> FW_RI_RES_WR_HOSTFCMODE_S) & FW_RI_RES_WR_HOSTFCMODE_M)
375 #define FW_RI_RES_WR_CPRIO_S 19
376 #define FW_RI_RES_WR_CPRIO_M 0x1
377 #define FW_RI_RES_WR_CPRIO_V(x) ((x) << FW_RI_RES_WR_CPRIO_S)
378 #define FW_RI_RES_WR_CPRIO_G(x) \
379 (((x) >> FW_RI_RES_WR_CPRIO_S) & FW_RI_RES_WR_CPRIO_M)
380 #define FW_RI_RES_WR_CPRIO_F FW_RI_RES_WR_CPRIO_V(1U)
382 #define FW_RI_RES_WR_ONCHIP_S 18
383 #define FW_RI_RES_WR_ONCHIP_M 0x1
384 #define FW_RI_RES_WR_ONCHIP_V(x) ((x) << FW_RI_RES_WR_ONCHIP_S)
385 #define FW_RI_RES_WR_ONCHIP_G(x) \
386 (((x) >> FW_RI_RES_WR_ONCHIP_S) & FW_RI_RES_WR_ONCHIP_M)
387 #define FW_RI_RES_WR_ONCHIP_F FW_RI_RES_WR_ONCHIP_V(1U)
389 #define FW_RI_RES_WR_PCIECHN_S 16
390 #define FW_RI_RES_WR_PCIECHN_M 0x3
391 #define FW_RI_RES_WR_PCIECHN_V(x) ((x) << FW_RI_RES_WR_PCIECHN_S)
392 #define FW_RI_RES_WR_PCIECHN_G(x) \
393 (((x) >> FW_RI_RES_WR_PCIECHN_S) & FW_RI_RES_WR_PCIECHN_M)
395 #define FW_RI_RES_WR_IQID_S 0
396 #define FW_RI_RES_WR_IQID_M 0xffff
397 #define FW_RI_RES_WR_IQID_V(x) ((x) << FW_RI_RES_WR_IQID_S)
398 #define FW_RI_RES_WR_IQID_G(x) \
399 (((x) >> FW_RI_RES_WR_IQID_S) & FW_RI_RES_WR_IQID_M)
401 #define FW_RI_RES_WR_DCAEN_S 31
402 #define FW_RI_RES_WR_DCAEN_M 0x1
403 #define FW_RI_RES_WR_DCAEN_V(x) ((x) << FW_RI_RES_WR_DCAEN_S)
404 #define FW_RI_RES_WR_DCAEN_G(x) \
405 (((x) >> FW_RI_RES_WR_DCAEN_S) & FW_RI_RES_WR_DCAEN_M)
406 #define FW_RI_RES_WR_DCAEN_F FW_RI_RES_WR_DCAEN_V(1U)
408 #define FW_RI_RES_WR_DCACPU_S 26
409 #define FW_RI_RES_WR_DCACPU_M 0x1f
410 #define FW_RI_RES_WR_DCACPU_V(x) ((x) << FW_RI_RES_WR_DCACPU_S)
411 #define FW_RI_RES_WR_DCACPU_G(x) \
412 (((x) >> FW_RI_RES_WR_DCACPU_S) & FW_RI_RES_WR_DCACPU_M)
414 #define FW_RI_RES_WR_FBMIN_S 23
415 #define FW_RI_RES_WR_FBMIN_M 0x7
416 #define FW_RI_RES_WR_FBMIN_V(x) ((x) << FW_RI_RES_WR_FBMIN_S)
417 #define FW_RI_RES_WR_FBMIN_G(x) \
418 (((x) >> FW_RI_RES_WR_FBMIN_S) & FW_RI_RES_WR_FBMIN_M)
420 #define FW_RI_RES_WR_FBMAX_S 20
421 #define FW_RI_RES_WR_FBMAX_M 0x7
422 #define FW_RI_RES_WR_FBMAX_V(x) ((x) << FW_RI_RES_WR_FBMAX_S)
423 #define FW_RI_RES_WR_FBMAX_G(x) \
424 (((x) >> FW_RI_RES_WR_FBMAX_S) & FW_RI_RES_WR_FBMAX_M)
426 #define FW_RI_RES_WR_CIDXFTHRESHO_S 19
427 #define FW_RI_RES_WR_CIDXFTHRESHO_M 0x1
428 #define FW_RI_RES_WR_CIDXFTHRESHO_V(x) ((x) << FW_RI_RES_WR_CIDXFTHRESHO_S)
429 #define FW_RI_RES_WR_CIDXFTHRESHO_G(x) \
430 (((x) >> FW_RI_RES_WR_CIDXFTHRESHO_S) & FW_RI_RES_WR_CIDXFTHRESHO_M)
431 #define FW_RI_RES_WR_CIDXFTHRESHO_F FW_RI_RES_WR_CIDXFTHRESHO_V(1U)
433 #define FW_RI_RES_WR_CIDXFTHRESH_S 16
434 #define FW_RI_RES_WR_CIDXFTHRESH_M 0x7
435 #define FW_RI_RES_WR_CIDXFTHRESH_V(x) ((x) << FW_RI_RES_WR_CIDXFTHRESH_S)
436 #define FW_RI_RES_WR_CIDXFTHRESH_G(x) \
437 (((x) >> FW_RI_RES_WR_CIDXFTHRESH_S) & FW_RI_RES_WR_CIDXFTHRESH_M)
439 #define FW_RI_RES_WR_EQSIZE_S 0
440 #define FW_RI_RES_WR_EQSIZE_M 0xffff
441 #define FW_RI_RES_WR_EQSIZE_V(x) ((x) << FW_RI_RES_WR_EQSIZE_S)
442 #define FW_RI_RES_WR_EQSIZE_G(x) \
443 (((x) >> FW_RI_RES_WR_EQSIZE_S) & FW_RI_RES_WR_EQSIZE_M)
445 #define FW_RI_RES_WR_IQANDST_S 15
446 #define FW_RI_RES_WR_IQANDST_M 0x1
447 #define FW_RI_RES_WR_IQANDST_V(x) ((x) << FW_RI_RES_WR_IQANDST_S)
448 #define FW_RI_RES_WR_IQANDST_G(x) \
449 (((x) >> FW_RI_RES_WR_IQANDST_S) & FW_RI_RES_WR_IQANDST_M)
450 #define FW_RI_RES_WR_IQANDST_F FW_RI_RES_WR_IQANDST_V(1U)
452 #define FW_RI_RES_WR_IQANUS_S 14
453 #define FW_RI_RES_WR_IQANUS_M 0x1
454 #define FW_RI_RES_WR_IQANUS_V(x) ((x) << FW_RI_RES_WR_IQANUS_S)
455 #define FW_RI_RES_WR_IQANUS_G(x) \
456 (((x) >> FW_RI_RES_WR_IQANUS_S) & FW_RI_RES_WR_IQANUS_M)
457 #define FW_RI_RES_WR_IQANUS_F FW_RI_RES_WR_IQANUS_V(1U)
459 #define FW_RI_RES_WR_IQANUD_S 12
460 #define FW_RI_RES_WR_IQANUD_M 0x3
461 #define FW_RI_RES_WR_IQANUD_V(x) ((x) << FW_RI_RES_WR_IQANUD_S)
462 #define FW_RI_RES_WR_IQANUD_G(x) \
463 (((x) >> FW_RI_RES_WR_IQANUD_S) & FW_RI_RES_WR_IQANUD_M)
465 #define FW_RI_RES_WR_IQANDSTINDEX_S 0
466 #define FW_RI_RES_WR_IQANDSTINDEX_M 0xfff
467 #define FW_RI_RES_WR_IQANDSTINDEX_V(x) ((x) << FW_RI_RES_WR_IQANDSTINDEX_S)
468 #define FW_RI_RES_WR_IQANDSTINDEX_G(x) \
469 (((x) >> FW_RI_RES_WR_IQANDSTINDEX_S) & FW_RI_RES_WR_IQANDSTINDEX_M)
471 #define FW_RI_RES_WR_IQDROPRSS_S 15
472 #define FW_RI_RES_WR_IQDROPRSS_M 0x1
473 #define FW_RI_RES_WR_IQDROPRSS_V(x) ((x) << FW_RI_RES_WR_IQDROPRSS_S)
474 #define FW_RI_RES_WR_IQDROPRSS_G(x) \
475 (((x) >> FW_RI_RES_WR_IQDROPRSS_S) & FW_RI_RES_WR_IQDROPRSS_M)
476 #define FW_RI_RES_WR_IQDROPRSS_F FW_RI_RES_WR_IQDROPRSS_V(1U)
478 #define FW_RI_RES_WR_IQGTSMODE_S 14
479 #define FW_RI_RES_WR_IQGTSMODE_M 0x1
480 #define FW_RI_RES_WR_IQGTSMODE_V(x) ((x) << FW_RI_RES_WR_IQGTSMODE_S)
481 #define FW_RI_RES_WR_IQGTSMODE_G(x) \
482 (((x) >> FW_RI_RES_WR_IQGTSMODE_S) & FW_RI_RES_WR_IQGTSMODE_M)
483 #define FW_RI_RES_WR_IQGTSMODE_F FW_RI_RES_WR_IQGTSMODE_V(1U)
485 #define FW_RI_RES_WR_IQPCIECH_S 12
486 #define FW_RI_RES_WR_IQPCIECH_M 0x3
487 #define FW_RI_RES_WR_IQPCIECH_V(x) ((x) << FW_RI_RES_WR_IQPCIECH_S)
488 #define FW_RI_RES_WR_IQPCIECH_G(x) \
489 (((x) >> FW_RI_RES_WR_IQPCIECH_S) & FW_RI_RES_WR_IQPCIECH_M)
491 #define FW_RI_RES_WR_IQDCAEN_S 11
492 #define FW_RI_RES_WR_IQDCAEN_M 0x1
493 #define FW_RI_RES_WR_IQDCAEN_V(x) ((x) << FW_RI_RES_WR_IQDCAEN_S)
494 #define FW_RI_RES_WR_IQDCAEN_G(x) \
495 (((x) >> FW_RI_RES_WR_IQDCAEN_S) & FW_RI_RES_WR_IQDCAEN_M)
496 #define FW_RI_RES_WR_IQDCAEN_F FW_RI_RES_WR_IQDCAEN_V(1U)
498 #define FW_RI_RES_WR_IQDCACPU_S 6
499 #define FW_RI_RES_WR_IQDCACPU_M 0x1f
500 #define FW_RI_RES_WR_IQDCACPU_V(x) ((x) << FW_RI_RES_WR_IQDCACPU_S)
501 #define FW_RI_RES_WR_IQDCACPU_G(x) \
502 (((x) >> FW_RI_RES_WR_IQDCACPU_S) & FW_RI_RES_WR_IQDCACPU_M)
504 #define FW_RI_RES_WR_IQINTCNTTHRESH_S 4
505 #define FW_RI_RES_WR_IQINTCNTTHRESH_M 0x3
506 #define FW_RI_RES_WR_IQINTCNTTHRESH_V(x) \
507 ((x) << FW_RI_RES_WR_IQINTCNTTHRESH_S)
508 #define FW_RI_RES_WR_IQINTCNTTHRESH_G(x) \
509 (((x) >> FW_RI_RES_WR_IQINTCNTTHRESH_S) & FW_RI_RES_WR_IQINTCNTTHRESH_M)
511 #define FW_RI_RES_WR_IQO_S 3
512 #define FW_RI_RES_WR_IQO_M 0x1
513 #define FW_RI_RES_WR_IQO_V(x) ((x) << FW_RI_RES_WR_IQO_S)
514 #define FW_RI_RES_WR_IQO_G(x) \
515 (((x) >> FW_RI_RES_WR_IQO_S) & FW_RI_RES_WR_IQO_M)
516 #define FW_RI_RES_WR_IQO_F FW_RI_RES_WR_IQO_V(1U)
518 #define FW_RI_RES_WR_IQCPRIO_S 2
519 #define FW_RI_RES_WR_IQCPRIO_M 0x1
520 #define FW_RI_RES_WR_IQCPRIO_V(x) ((x) << FW_RI_RES_WR_IQCPRIO_S)
521 #define FW_RI_RES_WR_IQCPRIO_G(x) \
522 (((x) >> FW_RI_RES_WR_IQCPRIO_S) & FW_RI_RES_WR_IQCPRIO_M)
523 #define FW_RI_RES_WR_IQCPRIO_F FW_RI_RES_WR_IQCPRIO_V(1U)
525 #define FW_RI_RES_WR_IQESIZE_S 0
526 #define FW_RI_RES_WR_IQESIZE_M 0x3
527 #define FW_RI_RES_WR_IQESIZE_V(x) ((x) << FW_RI_RES_WR_IQESIZE_S)
528 #define FW_RI_RES_WR_IQESIZE_G(x) \
529 (((x) >> FW_RI_RES_WR_IQESIZE_S) & FW_RI_RES_WR_IQESIZE_M)
531 #define FW_RI_RES_WR_IQNS_S 31
532 #define FW_RI_RES_WR_IQNS_M 0x1
533 #define FW_RI_RES_WR_IQNS_V(x) ((x) << FW_RI_RES_WR_IQNS_S)
534 #define FW_RI_RES_WR_IQNS_G(x) \
535 (((x) >> FW_RI_RES_WR_IQNS_S) & FW_RI_RES_WR_IQNS_M)
536 #define FW_RI_RES_WR_IQNS_F FW_RI_RES_WR_IQNS_V(1U)
538 #define FW_RI_RES_WR_IQRO_S 30
539 #define FW_RI_RES_WR_IQRO_M 0x1
540 #define FW_RI_RES_WR_IQRO_V(x) ((x) << FW_RI_RES_WR_IQRO_S)
541 #define FW_RI_RES_WR_IQRO_G(x) \
542 (((x) >> FW_RI_RES_WR_IQRO_S) & FW_RI_RES_WR_IQRO_M)
543 #define FW_RI_RES_WR_IQRO_F FW_RI_RES_WR_IQRO_V(1U)
545 struct fw_ri_rdma_write_wr
{
552 * Use union for immediate data to be consistent with stack's 32 bit
553 * data and iWARP spec's 64 bit data.
565 #ifndef C99_NOT_SUPPORTED
567 struct fw_ri_immd immd_src
[0];
568 struct fw_ri_isgl isgl_src
[0];
573 struct fw_ri_send_wr
{
584 #ifndef C99_NOT_SUPPORTED
586 struct fw_ri_immd immd_src
[0];
587 struct fw_ri_isgl isgl_src
[0];
592 #define FW_RI_SEND_WR_SENDOP_S 0
593 #define FW_RI_SEND_WR_SENDOP_M 0xf
594 #define FW_RI_SEND_WR_SENDOP_V(x) ((x) << FW_RI_SEND_WR_SENDOP_S)
595 #define FW_RI_SEND_WR_SENDOP_G(x) \
596 (((x) >> FW_RI_SEND_WR_SENDOP_S) & FW_RI_SEND_WR_SENDOP_M)
598 struct fw_ri_rdma_write_cmpl_wr
{
612 struct fw_ri_immd_cmpl
{
618 struct fw_ri_isgl isgl_src
;
621 #ifndef C99_NOT_SUPPORTED
623 struct fw_ri_immd immd_src
[0];
624 struct fw_ri_isgl isgl_src
[0];
629 struct fw_ri_rdma_read_wr
{
646 struct fw_ri_recv_wr
{
652 struct fw_ri_isgl isgl
;
655 struct fw_ri_bind_mw_wr
{
661 __u8 qpbinde_to_dcacpu
;
673 #define FW_RI_BIND_MW_WR_QPBINDE_S 6
674 #define FW_RI_BIND_MW_WR_QPBINDE_M 0x1
675 #define FW_RI_BIND_MW_WR_QPBINDE_V(x) ((x) << FW_RI_BIND_MW_WR_QPBINDE_S)
676 #define FW_RI_BIND_MW_WR_QPBINDE_G(x) \
677 (((x) >> FW_RI_BIND_MW_WR_QPBINDE_S) & FW_RI_BIND_MW_WR_QPBINDE_M)
678 #define FW_RI_BIND_MW_WR_QPBINDE_F FW_RI_BIND_MW_WR_QPBINDE_V(1U)
680 #define FW_RI_BIND_MW_WR_NS_S 5
681 #define FW_RI_BIND_MW_WR_NS_M 0x1
682 #define FW_RI_BIND_MW_WR_NS_V(x) ((x) << FW_RI_BIND_MW_WR_NS_S)
683 #define FW_RI_BIND_MW_WR_NS_G(x) \
684 (((x) >> FW_RI_BIND_MW_WR_NS_S) & FW_RI_BIND_MW_WR_NS_M)
685 #define FW_RI_BIND_MW_WR_NS_F FW_RI_BIND_MW_WR_NS_V(1U)
687 #define FW_RI_BIND_MW_WR_DCACPU_S 0
688 #define FW_RI_BIND_MW_WR_DCACPU_M 0x1f
689 #define FW_RI_BIND_MW_WR_DCACPU_V(x) ((x) << FW_RI_BIND_MW_WR_DCACPU_S)
690 #define FW_RI_BIND_MW_WR_DCACPU_G(x) \
691 (((x) >> FW_RI_BIND_MW_WR_DCACPU_S) & FW_RI_BIND_MW_WR_DCACPU_M)
693 struct fw_ri_fr_nsmr_wr
{
699 __u8 qpbinde_to_dcacpu
;
710 #define FW_RI_FR_NSMR_WR_QPBINDE_S 6
711 #define FW_RI_FR_NSMR_WR_QPBINDE_M 0x1
712 #define FW_RI_FR_NSMR_WR_QPBINDE_V(x) ((x) << FW_RI_FR_NSMR_WR_QPBINDE_S)
713 #define FW_RI_FR_NSMR_WR_QPBINDE_G(x) \
714 (((x) >> FW_RI_FR_NSMR_WR_QPBINDE_S) & FW_RI_FR_NSMR_WR_QPBINDE_M)
715 #define FW_RI_FR_NSMR_WR_QPBINDE_F FW_RI_FR_NSMR_WR_QPBINDE_V(1U)
717 #define FW_RI_FR_NSMR_WR_NS_S 5
718 #define FW_RI_FR_NSMR_WR_NS_M 0x1
719 #define FW_RI_FR_NSMR_WR_NS_V(x) ((x) << FW_RI_FR_NSMR_WR_NS_S)
720 #define FW_RI_FR_NSMR_WR_NS_G(x) \
721 (((x) >> FW_RI_FR_NSMR_WR_NS_S) & FW_RI_FR_NSMR_WR_NS_M)
722 #define FW_RI_FR_NSMR_WR_NS_F FW_RI_FR_NSMR_WR_NS_V(1U)
724 #define FW_RI_FR_NSMR_WR_DCACPU_S 0
725 #define FW_RI_FR_NSMR_WR_DCACPU_M 0x1f
726 #define FW_RI_FR_NSMR_WR_DCACPU_V(x) ((x) << FW_RI_FR_NSMR_WR_DCACPU_S)
727 #define FW_RI_FR_NSMR_WR_DCACPU_G(x) \
728 (((x) >> FW_RI_FR_NSMR_WR_DCACPU_S) & FW_RI_FR_NSMR_WR_DCACPU_M)
730 struct fw_ri_fr_nsmr_tpte_wr
{
738 struct fw_ri_tpte tpte
;
742 struct fw_ri_inv_lstag_wr
{
758 enum fw_ri_init_p2ptype
{
759 FW_RI_INIT_P2PTYPE_RDMA_WRITE
= FW_RI_RDMA_WRITE
,
760 FW_RI_INIT_P2PTYPE_READ_REQ
= FW_RI_READ_REQ
,
761 FW_RI_INIT_P2PTYPE_SEND
= FW_RI_SEND
,
762 FW_RI_INIT_P2PTYPE_SEND_WITH_INV
= FW_RI_SEND_WITH_INV
,
763 FW_RI_INIT_P2PTYPE_SEND_WITH_SE
= FW_RI_SEND_WITH_SE
,
764 FW_RI_INIT_P2PTYPE_SEND_WITH_SE_INV
= FW_RI_SEND_WITH_SE_INV
,
765 FW_RI_INIT_P2PTYPE_DISABLED
= 0xf,
768 enum fw_ri_init_rqeqid_srq
{
769 FW_RI_INIT_RQEQID_SRQ
= 1 << 31,
779 __u8 mpareqbit_p2ptype
;
797 union fw_ri_init_p2p
{
798 struct fw_ri_rdma_write_wr write
;
799 struct fw_ri_rdma_read_wr read
;
800 struct fw_ri_send_wr send
;
808 struct fw_ri_terminate
{
817 #define FW_RI_WR_MPAREQBIT_S 7
818 #define FW_RI_WR_MPAREQBIT_M 0x1
819 #define FW_RI_WR_MPAREQBIT_V(x) ((x) << FW_RI_WR_MPAREQBIT_S)
820 #define FW_RI_WR_MPAREQBIT_G(x) \
821 (((x) >> FW_RI_WR_MPAREQBIT_S) & FW_RI_WR_MPAREQBIT_M)
822 #define FW_RI_WR_MPAREQBIT_F FW_RI_WR_MPAREQBIT_V(1U)
824 #define FW_RI_WR_P2PTYPE_S 0
825 #define FW_RI_WR_P2PTYPE_M 0xf
826 #define FW_RI_WR_P2PTYPE_V(x) ((x) << FW_RI_WR_P2PTYPE_S)
827 #define FW_RI_WR_P2PTYPE_G(x) \
828 (((x) >> FW_RI_WR_P2PTYPE_S) & FW_RI_WR_P2PTYPE_M)
830 #endif /* _T4FW_RI_API_H_ */