xref: /openbmc/linux/drivers/infiniband/hw/cxgb4/t4fw_ri_api.h (revision 9a87ffc99ec8eb8d35eed7c4f816d75f5cc9662e)
1cfdda9d7SSteve Wise /*
2cfdda9d7SSteve Wise  * Copyright (c) 2009-2010 Chelsio, Inc. All rights reserved.
3cfdda9d7SSteve Wise  *
4cfdda9d7SSteve Wise  * This software is available to you under a choice of one of two
5cfdda9d7SSteve Wise  * licenses.  You may choose to be licensed under the terms of the GNU
6cfdda9d7SSteve Wise  * General Public License (GPL) Version 2, available from the file
7cfdda9d7SSteve Wise  * COPYING in the main directory of this source tree, or the
8cfdda9d7SSteve Wise  * OpenIB.org BSD license below:
9cfdda9d7SSteve Wise  *
10cfdda9d7SSteve Wise  *     Redistribution and use in source and binary forms, with or
11cfdda9d7SSteve Wise  *     without modification, are permitted provided that the following
12cfdda9d7SSteve Wise  *     conditions are met:
13cfdda9d7SSteve Wise  *
14cfdda9d7SSteve Wise  *      - Redistributions of source code must retain the above
15cfdda9d7SSteve Wise  *        copyright notice, this list of conditions and the following
16cfdda9d7SSteve Wise  *        disclaimer.
17cfdda9d7SSteve Wise  *      - Redistributions in binary form must reproduce the above
18cfdda9d7SSteve Wise  *        copyright notice, this list of conditions and the following
19cfdda9d7SSteve Wise  *        disclaimer in the documentation and/or other materials
20cfdda9d7SSteve Wise  *        provided with the distribution.
21cfdda9d7SSteve Wise  *
22cfdda9d7SSteve Wise  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23cfdda9d7SSteve Wise  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24cfdda9d7SSteve Wise  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25cfdda9d7SSteve Wise  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
26cfdda9d7SSteve Wise  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
27cfdda9d7SSteve Wise  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
28cfdda9d7SSteve Wise  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29cfdda9d7SSteve Wise  * SOFTWARE.
30cfdda9d7SSteve Wise  */
31cfdda9d7SSteve Wise #ifndef _T4FW_RI_API_H_
32cfdda9d7SSteve Wise #define _T4FW_RI_API_H_
33cfdda9d7SSteve Wise 
34cfdda9d7SSteve Wise #include "t4fw_api.h"
35cfdda9d7SSteve Wise 
36cfdda9d7SSteve Wise enum fw_ri_wr_opcode {
37cfdda9d7SSteve Wise 	FW_RI_RDMA_WRITE		= 0x0,	/* IETF RDMAP v1.0 ... */
38cfdda9d7SSteve Wise 	FW_RI_READ_REQ			= 0x1,
39cfdda9d7SSteve Wise 	FW_RI_READ_RESP			= 0x2,
40cfdda9d7SSteve Wise 	FW_RI_SEND			= 0x3,
41cfdda9d7SSteve Wise 	FW_RI_SEND_WITH_INV		= 0x4,
42cfdda9d7SSteve Wise 	FW_RI_SEND_WITH_SE		= 0x5,
43cfdda9d7SSteve Wise 	FW_RI_SEND_WITH_SE_INV		= 0x6,
44cfdda9d7SSteve Wise 	FW_RI_TERMINATE			= 0x7,
45cfdda9d7SSteve Wise 	FW_RI_RDMA_INIT			= 0x8,	/* CHELSIO RI specific ... */
46cfdda9d7SSteve Wise 	FW_RI_BIND_MW			= 0x9,
47cfdda9d7SSteve Wise 	FW_RI_FAST_REGISTER		= 0xa,
48cfdda9d7SSteve Wise 	FW_RI_LOCAL_INV			= 0xb,
49cfdda9d7SSteve Wise 	FW_RI_QP_MODIFY			= 0xc,
50cfdda9d7SSteve Wise 	FW_RI_BYPASS			= 0xd,
51cfdda9d7SSteve Wise 	FW_RI_RECEIVE			= 0xe,
52cfdda9d7SSteve Wise 
53b9855f4cSPotnuri Bharat Teja 	FW_RI_SGE_EC_CR_RETURN		= 0xf,
54b9855f4cSPotnuri Bharat Teja 	FW_RI_WRITE_IMMEDIATE           = FW_RI_RDMA_INIT
55cfdda9d7SSteve Wise };
56cfdda9d7SSteve Wise 
57cfdda9d7SSteve Wise enum fw_ri_wr_flags {
58cfdda9d7SSteve Wise 	FW_RI_COMPLETION_FLAG		= 0x01,
59cfdda9d7SSteve Wise 	FW_RI_NOTIFICATION_FLAG		= 0x02,
60cfdda9d7SSteve Wise 	FW_RI_SOLICITED_EVENT_FLAG	= 0x04,
61cfdda9d7SSteve Wise 	FW_RI_READ_FENCE_FLAG		= 0x08,
62cfdda9d7SSteve Wise 	FW_RI_LOCAL_FENCE_FLAG		= 0x10,
63b9855f4cSPotnuri Bharat Teja 	FW_RI_RDMA_READ_INVALIDATE	= 0x20,
64b9855f4cSPotnuri Bharat Teja 	FW_RI_RDMA_WRITE_WITH_IMMEDIATE = 0x40
65cfdda9d7SSteve Wise };
66cfdda9d7SSteve Wise 
67cfdda9d7SSteve Wise enum fw_ri_mpa_attrs {
68cfdda9d7SSteve Wise 	FW_RI_MPA_RX_MARKER_ENABLE	= 0x01,
69cfdda9d7SSteve Wise 	FW_RI_MPA_TX_MARKER_ENABLE	= 0x02,
70cfdda9d7SSteve Wise 	FW_RI_MPA_CRC_ENABLE		= 0x04,
71cfdda9d7SSteve Wise 	FW_RI_MPA_IETF_ENABLE		= 0x08
72cfdda9d7SSteve Wise };
73cfdda9d7SSteve Wise 
74cfdda9d7SSteve Wise enum fw_ri_qp_caps {
75cfdda9d7SSteve Wise 	FW_RI_QP_RDMA_READ_ENABLE	= 0x01,
76cfdda9d7SSteve Wise 	FW_RI_QP_RDMA_WRITE_ENABLE	= 0x02,
77cfdda9d7SSteve Wise 	FW_RI_QP_BIND_ENABLE		= 0x04,
78cfdda9d7SSteve Wise 	FW_RI_QP_FAST_REGISTER_ENABLE	= 0x08,
79cfdda9d7SSteve Wise 	FW_RI_QP_STAG0_ENABLE		= 0x10
80cfdda9d7SSteve Wise };
81cfdda9d7SSteve Wise 
82cfdda9d7SSteve Wise enum fw_ri_addr_type {
83cfdda9d7SSteve Wise 	FW_RI_ZERO_BASED_TO		= 0x00,
84cfdda9d7SSteve Wise 	FW_RI_VA_BASED_TO		= 0x01
85cfdda9d7SSteve Wise };
86cfdda9d7SSteve Wise 
87cfdda9d7SSteve Wise enum fw_ri_mem_perms {
88cfdda9d7SSteve Wise 	FW_RI_MEM_ACCESS_REM_WRITE	= 0x01,
89cfdda9d7SSteve Wise 	FW_RI_MEM_ACCESS_REM_READ	= 0x02,
90cfdda9d7SSteve Wise 	FW_RI_MEM_ACCESS_REM		= 0x03,
91cfdda9d7SSteve Wise 	FW_RI_MEM_ACCESS_LOCAL_WRITE	= 0x04,
92cfdda9d7SSteve Wise 	FW_RI_MEM_ACCESS_LOCAL_READ	= 0x08,
93cfdda9d7SSteve Wise 	FW_RI_MEM_ACCESS_LOCAL		= 0x0C
94cfdda9d7SSteve Wise };
95cfdda9d7SSteve Wise 
96cfdda9d7SSteve Wise enum fw_ri_stag_type {
97cfdda9d7SSteve Wise 	FW_RI_STAG_NSMR			= 0x00,
98cfdda9d7SSteve Wise 	FW_RI_STAG_SMR			= 0x01,
99cfdda9d7SSteve Wise 	FW_RI_STAG_MW			= 0x02,
100cfdda9d7SSteve Wise 	FW_RI_STAG_MW_RELAXED		= 0x03
101cfdda9d7SSteve Wise };
102cfdda9d7SSteve Wise 
103cfdda9d7SSteve Wise enum fw_ri_data_op {
104cfdda9d7SSteve Wise 	FW_RI_DATA_IMMD			= 0x81,
105cfdda9d7SSteve Wise 	FW_RI_DATA_DSGL			= 0x82,
106cfdda9d7SSteve Wise 	FW_RI_DATA_ISGL			= 0x83
107cfdda9d7SSteve Wise };
108cfdda9d7SSteve Wise 
109cfdda9d7SSteve Wise enum fw_ri_sgl_depth {
110cfdda9d7SSteve Wise 	FW_RI_SGL_DEPTH_MAX_SQ		= 16,
111cfdda9d7SSteve Wise 	FW_RI_SGL_DEPTH_MAX_RQ		= 4
112cfdda9d7SSteve Wise };
113cfdda9d7SSteve Wise 
114cfdda9d7SSteve Wise struct fw_ri_dsge_pair {
115cfdda9d7SSteve Wise 	__be32	len[2];
116cfdda9d7SSteve Wise 	__be64	addr[2];
117cfdda9d7SSteve Wise };
118cfdda9d7SSteve Wise 
119cfdda9d7SSteve Wise struct fw_ri_dsgl {
120cfdda9d7SSteve Wise 	__u8	op;
121cfdda9d7SSteve Wise 	__u8	r1;
122cfdda9d7SSteve Wise 	__be16	nsge;
123cfdda9d7SSteve Wise 	__be32	len0;
124cfdda9d7SSteve Wise 	__be64	addr0;
1255b361328SGustavo A. R. Silva 	struct fw_ri_dsge_pair sge[];
126cfdda9d7SSteve Wise };
127cfdda9d7SSteve Wise 
128cfdda9d7SSteve Wise struct fw_ri_sge {
129cfdda9d7SSteve Wise 	__be32 stag;
130cfdda9d7SSteve Wise 	__be32 len;
131cfdda9d7SSteve Wise 	__be64 to;
132cfdda9d7SSteve Wise };
133cfdda9d7SSteve Wise 
134cfdda9d7SSteve Wise struct fw_ri_isgl {
135cfdda9d7SSteve Wise 	__u8	op;
136cfdda9d7SSteve Wise 	__u8	r1;
137cfdda9d7SSteve Wise 	__be16	nsge;
138cfdda9d7SSteve Wise 	__be32	r2;
1395b361328SGustavo A. R. Silva 	struct fw_ri_sge sge[];
140cfdda9d7SSteve Wise };
141cfdda9d7SSteve Wise 
142cfdda9d7SSteve Wise struct fw_ri_immd {
143cfdda9d7SSteve Wise 	__u8	op;
144cfdda9d7SSteve Wise 	__u8	r1;
145cfdda9d7SSteve Wise 	__be16	r2;
146cfdda9d7SSteve Wise 	__be32	immdlen;
1475b361328SGustavo A. R. Silva 	__u8	data[];
148cfdda9d7SSteve Wise };
149cfdda9d7SSteve Wise 
150cfdda9d7SSteve Wise struct fw_ri_tpte {
151cfdda9d7SSteve Wise 	__be32 valid_to_pdid;
152cfdda9d7SSteve Wise 	__be32 locread_to_qpid;
153cfdda9d7SSteve Wise 	__be32 nosnoop_pbladdr;
154cfdda9d7SSteve Wise 	__be32 len_lo;
155cfdda9d7SSteve Wise 	__be32 va_hi;
156cfdda9d7SSteve Wise 	__be32 va_lo_fbo;
157cfdda9d7SSteve Wise 	__be32 dca_mwbcnt_pstag;
158cfdda9d7SSteve Wise 	__be32 len_hi;
159cfdda9d7SSteve Wise };
160cfdda9d7SSteve Wise 
161cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_VALID_S		31
162cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_VALID_M		0x1
163cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_VALID_V(x)		((x) << FW_RI_TPTE_VALID_S)
164cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_VALID_G(x)		\
165cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_TPTE_VALID_S) & FW_RI_TPTE_VALID_M)
166cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_VALID_F		FW_RI_TPTE_VALID_V(1U)
167cfdda9d7SSteve Wise 
168cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_STAGKEY_S		23
169cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_STAGKEY_M		0xff
170cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_STAGKEY_V(x)		((x) << FW_RI_TPTE_STAGKEY_S)
171cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_STAGKEY_G(x)		\
172cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_TPTE_STAGKEY_S) & FW_RI_TPTE_STAGKEY_M)
173cfdda9d7SSteve Wise 
174cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_STAGSTATE_S		22
175cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_STAGSTATE_M		0x1
176cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_STAGSTATE_V(x)	((x) << FW_RI_TPTE_STAGSTATE_S)
177cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_STAGSTATE_G(x)	\
178cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_TPTE_STAGSTATE_S) & FW_RI_TPTE_STAGSTATE_M)
179cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_STAGSTATE_F		FW_RI_TPTE_STAGSTATE_V(1U)
180cfdda9d7SSteve Wise 
181cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_STAGTYPE_S		20
182cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_STAGTYPE_M		0x3
183cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_STAGTYPE_V(x)	((x) << FW_RI_TPTE_STAGTYPE_S)
184cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_STAGTYPE_G(x)	\
185cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_TPTE_STAGTYPE_S) & FW_RI_TPTE_STAGTYPE_M)
186cfdda9d7SSteve Wise 
187cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_PDID_S		0
188cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_PDID_M		0xfffff
189cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_PDID_V(x)		((x) << FW_RI_TPTE_PDID_S)
190cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_PDID_G(x)		\
191cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_TPTE_PDID_S) & FW_RI_TPTE_PDID_M)
192cfdda9d7SSteve Wise 
193cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_PERM_S		28
194cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_PERM_M		0xf
195cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_PERM_V(x)		((x) << FW_RI_TPTE_PERM_S)
196cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_PERM_G(x)		\
197cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_TPTE_PERM_S) & FW_RI_TPTE_PERM_M)
198cfdda9d7SSteve Wise 
199cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_REMINVDIS_S		27
200cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_REMINVDIS_M		0x1
201cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_REMINVDIS_V(x)	((x) << FW_RI_TPTE_REMINVDIS_S)
202cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_REMINVDIS_G(x)	\
203cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_TPTE_REMINVDIS_S) & FW_RI_TPTE_REMINVDIS_M)
204cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_REMINVDIS_F		FW_RI_TPTE_REMINVDIS_V(1U)
205cfdda9d7SSteve Wise 
206cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_ADDRTYPE_S		26
207cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_ADDRTYPE_M		1
208cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_ADDRTYPE_V(x)	((x) << FW_RI_TPTE_ADDRTYPE_S)
209cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_ADDRTYPE_G(x)	\
210cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_TPTE_ADDRTYPE_S) & FW_RI_TPTE_ADDRTYPE_M)
211cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_ADDRTYPE_F		FW_RI_TPTE_ADDRTYPE_V(1U)
212cfdda9d7SSteve Wise 
213cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_MWBINDEN_S		25
214cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_MWBINDEN_M		0x1
215cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_MWBINDEN_V(x)	((x) << FW_RI_TPTE_MWBINDEN_S)
216cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_MWBINDEN_G(x)	\
217cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_TPTE_MWBINDEN_S) & FW_RI_TPTE_MWBINDEN_M)
218cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_MWBINDEN_F		FW_RI_TPTE_MWBINDEN_V(1U)
219cfdda9d7SSteve Wise 
220cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_PS_S			20
221cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_PS_M			0x1f
222cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_PS_V(x)		((x) << FW_RI_TPTE_PS_S)
223cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_PS_G(x)		\
224cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_TPTE_PS_S) & FW_RI_TPTE_PS_M)
225cfdda9d7SSteve Wise 
226cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_QPID_S		0
227cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_QPID_M		0xfffff
228cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_QPID_V(x)		((x) << FW_RI_TPTE_QPID_S)
229cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_QPID_G(x)		\
230cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_TPTE_QPID_S) & FW_RI_TPTE_QPID_M)
231cfdda9d7SSteve Wise 
232cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_NOSNOOP_S		30
233cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_NOSNOOP_M		0x1
234cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_NOSNOOP_V(x)		((x) << FW_RI_TPTE_NOSNOOP_S)
235cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_NOSNOOP_G(x)		\
236cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_TPTE_NOSNOOP_S) & FW_RI_TPTE_NOSNOOP_M)
237cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_NOSNOOP_F		FW_RI_TPTE_NOSNOOP_V(1U)
238cfdda9d7SSteve Wise 
239cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_PBLADDR_S		0
240cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_PBLADDR_M		0x1fffffff
241cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_PBLADDR_V(x)		((x) << FW_RI_TPTE_PBLADDR_S)
242cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_PBLADDR_G(x)		\
243cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_TPTE_PBLADDR_S) & FW_RI_TPTE_PBLADDR_M)
244cfdda9d7SSteve Wise 
245cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_DCA_S		24
246cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_DCA_M		0x1f
247cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_DCA_V(x)		((x) << FW_RI_TPTE_DCA_S)
248cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_DCA_G(x)		\
249cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_TPTE_DCA_S) & FW_RI_TPTE_DCA_M)
250cfdda9d7SSteve Wise 
251cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_MWBCNT_PSTAG_S	0
252cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_MWBCNT_PSTAG_M	0xffffff
253cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_MWBCNT_PSTAT_V(x)	\
254cf7fe64aSHariprasad Shenai 	((x) << FW_RI_TPTE_MWBCNT_PSTAG_S)
255cf7fe64aSHariprasad Shenai #define FW_RI_TPTE_MWBCNT_PSTAG_G(x)	\
256cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_TPTE_MWBCNT_PSTAG_S) & FW_RI_TPTE_MWBCNT_PSTAG_M)
257cfdda9d7SSteve Wise 
258cfdda9d7SSteve Wise enum fw_ri_res_type {
259cfdda9d7SSteve Wise 	FW_RI_RES_TYPE_SQ,
260cfdda9d7SSteve Wise 	FW_RI_RES_TYPE_RQ,
261cfdda9d7SSteve Wise 	FW_RI_RES_TYPE_CQ,
2627fc7a7cfSRaju Rangoju 	FW_RI_RES_TYPE_SRQ,
263cfdda9d7SSteve Wise };
264cfdda9d7SSteve Wise 
265cfdda9d7SSteve Wise enum fw_ri_res_op {
266cfdda9d7SSteve Wise 	FW_RI_RES_OP_WRITE,
267cfdda9d7SSteve Wise 	FW_RI_RES_OP_RESET,
268cfdda9d7SSteve Wise };
269cfdda9d7SSteve Wise 
270cfdda9d7SSteve Wise struct fw_ri_res {
271cfdda9d7SSteve Wise 	union fw_ri_restype {
272cfdda9d7SSteve Wise 		struct fw_ri_res_sqrq {
273cfdda9d7SSteve Wise 			__u8   restype;
274cfdda9d7SSteve Wise 			__u8   op;
275cfdda9d7SSteve Wise 			__be16 r3;
276cfdda9d7SSteve Wise 			__be32 eqid;
277cfdda9d7SSteve Wise 			__be32 r4[2];
278cfdda9d7SSteve Wise 			__be32 fetchszm_to_iqid;
279cfdda9d7SSteve Wise 			__be32 dcaen_to_eqsize;
280cfdda9d7SSteve Wise 			__be64 eqaddr;
281cfdda9d7SSteve Wise 		} sqrq;
282cfdda9d7SSteve Wise 		struct fw_ri_res_cq {
283cfdda9d7SSteve Wise 			__u8   restype;
284cfdda9d7SSteve Wise 			__u8   op;
285cfdda9d7SSteve Wise 			__be16 r3;
286cfdda9d7SSteve Wise 			__be32 iqid;
287cfdda9d7SSteve Wise 			__be32 r4[2];
288cfdda9d7SSteve Wise 			__be32 iqandst_to_iqandstindex;
289cfdda9d7SSteve Wise 			__be16 iqdroprss_to_iqesize;
290cfdda9d7SSteve Wise 			__be16 iqsize;
291cfdda9d7SSteve Wise 			__be64 iqaddr;
292cfdda9d7SSteve Wise 			__be32 iqns_iqro;
293cfdda9d7SSteve Wise 			__be32 r6_lo;
294cfdda9d7SSteve Wise 			__be64 r7;
295cfdda9d7SSteve Wise 		} cq;
2967fc7a7cfSRaju Rangoju 		struct fw_ri_res_srq {
2977fc7a7cfSRaju Rangoju 			__u8   restype;
2987fc7a7cfSRaju Rangoju 			__u8   op;
2997fc7a7cfSRaju Rangoju 			__be16 r3;
3007fc7a7cfSRaju Rangoju 			__be32 eqid;
3017fc7a7cfSRaju Rangoju 			__be32 r4[2];
3027fc7a7cfSRaju Rangoju 			__be32 fetchszm_to_iqid;
3037fc7a7cfSRaju Rangoju 			__be32 dcaen_to_eqsize;
3047fc7a7cfSRaju Rangoju 			__be64 eqaddr;
3057fc7a7cfSRaju Rangoju 			__be32 srqid;
3067fc7a7cfSRaju Rangoju 			__be32 pdid;
3077fc7a7cfSRaju Rangoju 			__be32 hwsrqsize;
3087fc7a7cfSRaju Rangoju 			__be32 hwsrqaddr;
3097fc7a7cfSRaju Rangoju 		} srq;
310cfdda9d7SSteve Wise 	} u;
311cfdda9d7SSteve Wise };
312cfdda9d7SSteve Wise 
313cfdda9d7SSteve Wise struct fw_ri_res_wr {
314cfdda9d7SSteve Wise 	__be32 op_nres;
315cfdda9d7SSteve Wise 	__be32 len16_pkd;
316cfdda9d7SSteve Wise 	__u64  cookie;
3175b361328SGustavo A. R. Silva 	struct fw_ri_res res[];
318cfdda9d7SSteve Wise };
319cfdda9d7SSteve Wise 
320cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_NRES_S	0
321cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_NRES_M	0xff
322cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_NRES_V(x)	((x) << FW_RI_RES_WR_NRES_S)
323cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_NRES_G(x)	\
324cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_NRES_S) & FW_RI_RES_WR_NRES_M)
325cfdda9d7SSteve Wise 
326cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_FETCHSZM_S		26
327cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_FETCHSZM_M		0x1
328cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_FETCHSZM_V(x)	((x) << FW_RI_RES_WR_FETCHSZM_S)
329cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_FETCHSZM_G(x)	\
330cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_FETCHSZM_S) & FW_RI_RES_WR_FETCHSZM_M)
331cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_FETCHSZM_F	FW_RI_RES_WR_FETCHSZM_V(1U)
332cfdda9d7SSteve Wise 
333cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_STATUSPGNS_S	25
334cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_STATUSPGNS_M	0x1
335cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_STATUSPGNS_V(x)	((x) << FW_RI_RES_WR_STATUSPGNS_S)
336cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_STATUSPGNS_G(x)	\
337cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_STATUSPGNS_S) & FW_RI_RES_WR_STATUSPGNS_M)
338cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_STATUSPGNS_F	FW_RI_RES_WR_STATUSPGNS_V(1U)
339cfdda9d7SSteve Wise 
340cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_STATUSPGRO_S	24
341cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_STATUSPGRO_M	0x1
342cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_STATUSPGRO_V(x)	((x) << FW_RI_RES_WR_STATUSPGRO_S)
343cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_STATUSPGRO_G(x)	\
344cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_STATUSPGRO_S) & FW_RI_RES_WR_STATUSPGRO_M)
345cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_STATUSPGRO_F	FW_RI_RES_WR_STATUSPGRO_V(1U)
346cfdda9d7SSteve Wise 
347cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_FETCHNS_S		23
348cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_FETCHNS_M		0x1
349cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_FETCHNS_V(x)	((x) << FW_RI_RES_WR_FETCHNS_S)
350cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_FETCHNS_G(x)	\
351cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_FETCHNS_S) & FW_RI_RES_WR_FETCHNS_M)
352cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_FETCHNS_F	FW_RI_RES_WR_FETCHNS_V(1U)
353cfdda9d7SSteve Wise 
354cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_FETCHRO_S		22
355cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_FETCHRO_M		0x1
356cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_FETCHRO_V(x)	((x) << FW_RI_RES_WR_FETCHRO_S)
357cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_FETCHRO_G(x)	\
358cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_FETCHRO_S) & FW_RI_RES_WR_FETCHRO_M)
359cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_FETCHRO_F	FW_RI_RES_WR_FETCHRO_V(1U)
360cfdda9d7SSteve Wise 
361cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_HOSTFCMODE_S	20
362cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_HOSTFCMODE_M	0x3
363cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_HOSTFCMODE_V(x)	((x) << FW_RI_RES_WR_HOSTFCMODE_S)
364cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_HOSTFCMODE_G(x)	\
365cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_HOSTFCMODE_S) & FW_RI_RES_WR_HOSTFCMODE_M)
366cfdda9d7SSteve Wise 
367cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_CPRIO_S	19
368cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_CPRIO_M	0x1
369cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_CPRIO_V(x)	((x) << FW_RI_RES_WR_CPRIO_S)
370cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_CPRIO_G(x)	\
371cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_CPRIO_S) & FW_RI_RES_WR_CPRIO_M)
372cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_CPRIO_F	FW_RI_RES_WR_CPRIO_V(1U)
373cfdda9d7SSteve Wise 
374cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_ONCHIP_S		18
375cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_ONCHIP_M		0x1
376cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_ONCHIP_V(x)	((x) << FW_RI_RES_WR_ONCHIP_S)
377cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_ONCHIP_G(x)	\
378cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_ONCHIP_S) & FW_RI_RES_WR_ONCHIP_M)
379cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_ONCHIP_F	FW_RI_RES_WR_ONCHIP_V(1U)
380cfdda9d7SSteve Wise 
381cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_PCIECHN_S		16
382cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_PCIECHN_M		0x3
383cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_PCIECHN_V(x)	((x) << FW_RI_RES_WR_PCIECHN_S)
384cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_PCIECHN_G(x)	\
385cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_PCIECHN_S) & FW_RI_RES_WR_PCIECHN_M)
386cfdda9d7SSteve Wise 
387cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQID_S	0
388cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQID_M	0xffff
389cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQID_V(x)	((x) << FW_RI_RES_WR_IQID_S)
390cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQID_G(x)	\
391cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_IQID_S) & FW_RI_RES_WR_IQID_M)
392cfdda9d7SSteve Wise 
393cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_DCAEN_S	31
394cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_DCAEN_M	0x1
395cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_DCAEN_V(x)	((x) << FW_RI_RES_WR_DCAEN_S)
396cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_DCAEN_G(x)	\
397cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_DCAEN_S) & FW_RI_RES_WR_DCAEN_M)
398cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_DCAEN_F	FW_RI_RES_WR_DCAEN_V(1U)
399cfdda9d7SSteve Wise 
400cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_DCACPU_S		26
401cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_DCACPU_M		0x1f
402cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_DCACPU_V(x)	((x) << FW_RI_RES_WR_DCACPU_S)
403cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_DCACPU_G(x)	\
404cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_DCACPU_S) & FW_RI_RES_WR_DCACPU_M)
405cfdda9d7SSteve Wise 
406cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_FBMIN_S	23
407cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_FBMIN_M	0x7
408cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_FBMIN_V(x)	((x) << FW_RI_RES_WR_FBMIN_S)
409cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_FBMIN_G(x)	\
410cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_FBMIN_S) & FW_RI_RES_WR_FBMIN_M)
411cfdda9d7SSteve Wise 
412cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_FBMAX_S	20
413cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_FBMAX_M	0x7
414cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_FBMAX_V(x)	((x) << FW_RI_RES_WR_FBMAX_S)
415cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_FBMAX_G(x)	\
416cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_FBMAX_S) & FW_RI_RES_WR_FBMAX_M)
417cfdda9d7SSteve Wise 
418cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_CIDXFTHRESHO_S	19
419cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_CIDXFTHRESHO_M	0x1
420cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_CIDXFTHRESHO_V(x)	((x) << FW_RI_RES_WR_CIDXFTHRESHO_S)
421cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_CIDXFTHRESHO_G(x)	\
422cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_CIDXFTHRESHO_S) & FW_RI_RES_WR_CIDXFTHRESHO_M)
423cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_CIDXFTHRESHO_F	FW_RI_RES_WR_CIDXFTHRESHO_V(1U)
424cfdda9d7SSteve Wise 
425cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_CIDXFTHRESH_S	16
426cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_CIDXFTHRESH_M	0x7
427cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_CIDXFTHRESH_V(x)	((x) << FW_RI_RES_WR_CIDXFTHRESH_S)
428cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_CIDXFTHRESH_G(x)	\
429cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_CIDXFTHRESH_S) & FW_RI_RES_WR_CIDXFTHRESH_M)
430cfdda9d7SSteve Wise 
431cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_EQSIZE_S		0
432cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_EQSIZE_M		0xffff
433cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_EQSIZE_V(x)	((x) << FW_RI_RES_WR_EQSIZE_S)
434cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_EQSIZE_G(x)	\
435cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_EQSIZE_S) & FW_RI_RES_WR_EQSIZE_M)
436cfdda9d7SSteve Wise 
437cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQANDST_S		15
438cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQANDST_M		0x1
439cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQANDST_V(x)	((x) << FW_RI_RES_WR_IQANDST_S)
440cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQANDST_G(x)	\
441cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_IQANDST_S) & FW_RI_RES_WR_IQANDST_M)
442cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQANDST_F	FW_RI_RES_WR_IQANDST_V(1U)
443cfdda9d7SSteve Wise 
444cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQANUS_S		14
445cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQANUS_M		0x1
446cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQANUS_V(x)	((x) << FW_RI_RES_WR_IQANUS_S)
447cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQANUS_G(x)	\
448cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_IQANUS_S) & FW_RI_RES_WR_IQANUS_M)
449cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQANUS_F	FW_RI_RES_WR_IQANUS_V(1U)
450cfdda9d7SSteve Wise 
451cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQANUD_S		12
452cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQANUD_M		0x3
453cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQANUD_V(x)	((x) << FW_RI_RES_WR_IQANUD_S)
454cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQANUD_G(x)	\
455cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_IQANUD_S) & FW_RI_RES_WR_IQANUD_M)
456cfdda9d7SSteve Wise 
457cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQANDSTINDEX_S	0
458cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQANDSTINDEX_M	0xfff
459cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQANDSTINDEX_V(x)	((x) << FW_RI_RES_WR_IQANDSTINDEX_S)
460cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQANDSTINDEX_G(x)	\
461cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_IQANDSTINDEX_S) & FW_RI_RES_WR_IQANDSTINDEX_M)
462cfdda9d7SSteve Wise 
463cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQDROPRSS_S	15
464cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQDROPRSS_M	0x1
465cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQDROPRSS_V(x)	((x) << FW_RI_RES_WR_IQDROPRSS_S)
466cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQDROPRSS_G(x)	\
467cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_IQDROPRSS_S) & FW_RI_RES_WR_IQDROPRSS_M)
468cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQDROPRSS_F	FW_RI_RES_WR_IQDROPRSS_V(1U)
469cfdda9d7SSteve Wise 
470cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQGTSMODE_S	14
471cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQGTSMODE_M	0x1
472cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQGTSMODE_V(x)	((x) << FW_RI_RES_WR_IQGTSMODE_S)
473cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQGTSMODE_G(x)	\
474cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_IQGTSMODE_S) & FW_RI_RES_WR_IQGTSMODE_M)
475cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQGTSMODE_F	FW_RI_RES_WR_IQGTSMODE_V(1U)
476cfdda9d7SSteve Wise 
477cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQPCIECH_S		12
478cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQPCIECH_M		0x3
479cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQPCIECH_V(x)	((x) << FW_RI_RES_WR_IQPCIECH_S)
480cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQPCIECH_G(x)	\
481cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_IQPCIECH_S) & FW_RI_RES_WR_IQPCIECH_M)
482cfdda9d7SSteve Wise 
483cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQDCAEN_S		11
484cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQDCAEN_M		0x1
485cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQDCAEN_V(x)	((x) << FW_RI_RES_WR_IQDCAEN_S)
486cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQDCAEN_G(x)	\
487cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_IQDCAEN_S) & FW_RI_RES_WR_IQDCAEN_M)
488cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQDCAEN_F	FW_RI_RES_WR_IQDCAEN_V(1U)
489cfdda9d7SSteve Wise 
490cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQDCACPU_S		6
491cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQDCACPU_M		0x1f
492cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQDCACPU_V(x)	((x) << FW_RI_RES_WR_IQDCACPU_S)
493cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQDCACPU_G(x)	\
494cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_IQDCACPU_S) & FW_RI_RES_WR_IQDCACPU_M)
495cfdda9d7SSteve Wise 
496cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQINTCNTTHRESH_S		4
497cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQINTCNTTHRESH_M		0x3
498cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQINTCNTTHRESH_V(x)	\
499cf7fe64aSHariprasad Shenai 	((x) << FW_RI_RES_WR_IQINTCNTTHRESH_S)
500cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQINTCNTTHRESH_G(x)	\
501cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_IQINTCNTTHRESH_S) & FW_RI_RES_WR_IQINTCNTTHRESH_M)
502cfdda9d7SSteve Wise 
503cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQO_S	3
504cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQO_M	0x1
505cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQO_V(x)	((x) << FW_RI_RES_WR_IQO_S)
506cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQO_G(x)	\
507cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_IQO_S) & FW_RI_RES_WR_IQO_M)
508cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQO_F	FW_RI_RES_WR_IQO_V(1U)
509cfdda9d7SSteve Wise 
510cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQCPRIO_S		2
511cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQCPRIO_M		0x1
512cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQCPRIO_V(x)	((x) << FW_RI_RES_WR_IQCPRIO_S)
513cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQCPRIO_G(x)	\
514cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_IQCPRIO_S) & FW_RI_RES_WR_IQCPRIO_M)
515cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQCPRIO_F	FW_RI_RES_WR_IQCPRIO_V(1U)
516cfdda9d7SSteve Wise 
517cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQESIZE_S		0
518cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQESIZE_M		0x3
519cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQESIZE_V(x)	((x) << FW_RI_RES_WR_IQESIZE_S)
520cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQESIZE_G(x)	\
521cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_IQESIZE_S) & FW_RI_RES_WR_IQESIZE_M)
522cfdda9d7SSteve Wise 
523cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQNS_S	31
524cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQNS_M	0x1
525cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQNS_V(x)	((x) << FW_RI_RES_WR_IQNS_S)
526cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQNS_G(x)	\
527cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_IQNS_S) & FW_RI_RES_WR_IQNS_M)
528cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQNS_F	FW_RI_RES_WR_IQNS_V(1U)
529cfdda9d7SSteve Wise 
530cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQRO_S	30
531cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQRO_M	0x1
532cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQRO_V(x)	((x) << FW_RI_RES_WR_IQRO_S)
533cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQRO_G(x)	\
534cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_RES_WR_IQRO_S) & FW_RI_RES_WR_IQRO_M)
535cf7fe64aSHariprasad Shenai #define FW_RI_RES_WR_IQRO_F	FW_RI_RES_WR_IQRO_V(1U)
536cfdda9d7SSteve Wise 
537cfdda9d7SSteve Wise struct fw_ri_rdma_write_wr {
538cfdda9d7SSteve Wise 	__u8   opcode;
539cfdda9d7SSteve Wise 	__u8   flags;
540cfdda9d7SSteve Wise 	__u16  wrid;
541cfdda9d7SSteve Wise 	__u8   r1[3];
542cfdda9d7SSteve Wise 	__u8   len16;
543b9855f4cSPotnuri Bharat Teja 	/*
544b9855f4cSPotnuri Bharat Teja 	 * Use union for immediate data to be consistent with stack's 32 bit
545b9855f4cSPotnuri Bharat Teja 	 * data and iWARP spec's 64 bit data.
546b9855f4cSPotnuri Bharat Teja 	 */
547b9855f4cSPotnuri Bharat Teja 	union {
548b9855f4cSPotnuri Bharat Teja 		struct {
549b9855f4cSPotnuri Bharat Teja 			__be32 imm_data32;
550b9855f4cSPotnuri Bharat Teja 			u32 reserved;
551b9855f4cSPotnuri Bharat Teja 		} ib_imm_data;
552b9855f4cSPotnuri Bharat Teja 		__be64 imm_data64;
553b9855f4cSPotnuri Bharat Teja 	} iw_imm_data;
554cfdda9d7SSteve Wise 	__be32 plen;
555cfdda9d7SSteve Wise 	__be32 stag_sink;
556cfdda9d7SSteve Wise 	__be64 to_sink;
557cfdda9d7SSteve Wise 	union {
558*ccdbefcfSKees Cook 		DECLARE_FLEX_ARRAY(struct fw_ri_immd, immd_src);
559*ccdbefcfSKees Cook 		DECLARE_FLEX_ARRAY(struct fw_ri_isgl, isgl_src);
560cfdda9d7SSteve Wise 	} u;
561cfdda9d7SSteve Wise };
562cfdda9d7SSteve Wise 
563cfdda9d7SSteve Wise struct fw_ri_send_wr {
564cfdda9d7SSteve Wise 	__u8   opcode;
565cfdda9d7SSteve Wise 	__u8   flags;
566cfdda9d7SSteve Wise 	__u16  wrid;
567cfdda9d7SSteve Wise 	__u8   r1[3];
568cfdda9d7SSteve Wise 	__u8   len16;
569cfdda9d7SSteve Wise 	__be32 sendop_pkd;
570cfdda9d7SSteve Wise 	__be32 stag_inv;
571cfdda9d7SSteve Wise 	__be32 plen;
572cfdda9d7SSteve Wise 	__be32 r3;
573cfdda9d7SSteve Wise 	__be64 r4;
574cfdda9d7SSteve Wise 	union {
575*ccdbefcfSKees Cook 		DECLARE_FLEX_ARRAY(struct fw_ri_immd, immd_src);
576*ccdbefcfSKees Cook 		DECLARE_FLEX_ARRAY(struct fw_ri_isgl, isgl_src);
577cfdda9d7SSteve Wise 	} u;
578cfdda9d7SSteve Wise };
579cfdda9d7SSteve Wise 
580cf7fe64aSHariprasad Shenai #define FW_RI_SEND_WR_SENDOP_S		0
581cf7fe64aSHariprasad Shenai #define FW_RI_SEND_WR_SENDOP_M		0xf
582cf7fe64aSHariprasad Shenai #define FW_RI_SEND_WR_SENDOP_V(x)	((x) << FW_RI_SEND_WR_SENDOP_S)
583cf7fe64aSHariprasad Shenai #define FW_RI_SEND_WR_SENDOP_G(x)	\
584cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_SEND_WR_SENDOP_S) & FW_RI_SEND_WR_SENDOP_M)
585cfdda9d7SSteve Wise 
58694245f4aSPotnuri Bharat Teja struct fw_ri_rdma_write_cmpl_wr {
58794245f4aSPotnuri Bharat Teja 	__u8   opcode;
58894245f4aSPotnuri Bharat Teja 	__u8   flags;
58994245f4aSPotnuri Bharat Teja 	__u16  wrid;
59094245f4aSPotnuri Bharat Teja 	__u8   r1[3];
59194245f4aSPotnuri Bharat Teja 	__u8   len16;
59294245f4aSPotnuri Bharat Teja 	__u8   r2;
59394245f4aSPotnuri Bharat Teja 	__u8   flags_send;
59494245f4aSPotnuri Bharat Teja 	__u16  wrid_send;
59594245f4aSPotnuri Bharat Teja 	__be32 stag_inv;
59694245f4aSPotnuri Bharat Teja 	__be32 plen;
59794245f4aSPotnuri Bharat Teja 	__be32 stag_sink;
59894245f4aSPotnuri Bharat Teja 	__be64 to_sink;
59994245f4aSPotnuri Bharat Teja 	union fw_ri_cmpl {
60094245f4aSPotnuri Bharat Teja 		struct fw_ri_immd_cmpl {
60194245f4aSPotnuri Bharat Teja 			__u8   op;
60294245f4aSPotnuri Bharat Teja 			__u8   r1[6];
60394245f4aSPotnuri Bharat Teja 			__u8   immdlen;
60494245f4aSPotnuri Bharat Teja 			__u8   data[16];
60594245f4aSPotnuri Bharat Teja 		} immd_src;
60694245f4aSPotnuri Bharat Teja 		struct fw_ri_isgl isgl_src;
60794245f4aSPotnuri Bharat Teja 	} u_cmpl;
60894245f4aSPotnuri Bharat Teja 	__be64 r3;
60994245f4aSPotnuri Bharat Teja 	union fw_ri_write {
610*ccdbefcfSKees Cook 		DECLARE_FLEX_ARRAY(struct fw_ri_immd, immd_src);
611*ccdbefcfSKees Cook 		DECLARE_FLEX_ARRAY(struct fw_ri_isgl, isgl_src);
61294245f4aSPotnuri Bharat Teja 	} u;
61394245f4aSPotnuri Bharat Teja };
61494245f4aSPotnuri Bharat Teja 
615cfdda9d7SSteve Wise struct fw_ri_rdma_read_wr {
616cfdda9d7SSteve Wise 	__u8   opcode;
617cfdda9d7SSteve Wise 	__u8   flags;
618cfdda9d7SSteve Wise 	__u16  wrid;
619cfdda9d7SSteve Wise 	__u8   r1[3];
620cfdda9d7SSteve Wise 	__u8   len16;
621cfdda9d7SSteve Wise 	__be64 r2;
622cfdda9d7SSteve Wise 	__be32 stag_sink;
623cfdda9d7SSteve Wise 	__be32 to_sink_hi;
624cfdda9d7SSteve Wise 	__be32 to_sink_lo;
625cfdda9d7SSteve Wise 	__be32 plen;
626cfdda9d7SSteve Wise 	__be32 stag_src;
627cfdda9d7SSteve Wise 	__be32 to_src_hi;
628cfdda9d7SSteve Wise 	__be32 to_src_lo;
629cfdda9d7SSteve Wise 	__be32 r5;
630cfdda9d7SSteve Wise };
631cfdda9d7SSteve Wise 
632cfdda9d7SSteve Wise struct fw_ri_recv_wr {
633cfdda9d7SSteve Wise 	__u8   opcode;
634cfdda9d7SSteve Wise 	__u8   r1;
635cfdda9d7SSteve Wise 	__u16  wrid;
636cfdda9d7SSteve Wise 	__u8   r2[3];
637cfdda9d7SSteve Wise 	__u8   len16;
638cfdda9d7SSteve Wise 	struct fw_ri_isgl isgl;
639cfdda9d7SSteve Wise };
640cfdda9d7SSteve Wise 
641cfdda9d7SSteve Wise struct fw_ri_bind_mw_wr {
642cfdda9d7SSteve Wise 	__u8   opcode;
643cfdda9d7SSteve Wise 	__u8   flags;
644cfdda9d7SSteve Wise 	__u16  wrid;
645cfdda9d7SSteve Wise 	__u8   r1[3];
646cfdda9d7SSteve Wise 	__u8   len16;
647cfdda9d7SSteve Wise 	__u8   qpbinde_to_dcacpu;
648cfdda9d7SSteve Wise 	__u8   pgsz_shift;
649cfdda9d7SSteve Wise 	__u8   addr_type;
650cfdda9d7SSteve Wise 	__u8   mem_perms;
651cfdda9d7SSteve Wise 	__be32 stag_mr;
652cfdda9d7SSteve Wise 	__be32 stag_mw;
653cfdda9d7SSteve Wise 	__be32 r3;
654cfdda9d7SSteve Wise 	__be64 len_mw;
655cfdda9d7SSteve Wise 	__be64 va_fbo;
656cfdda9d7SSteve Wise 	__be64 r4;
657cfdda9d7SSteve Wise };
658cfdda9d7SSteve Wise 
659cf7fe64aSHariprasad Shenai #define FW_RI_BIND_MW_WR_QPBINDE_S	6
660cf7fe64aSHariprasad Shenai #define FW_RI_BIND_MW_WR_QPBINDE_M	0x1
661cf7fe64aSHariprasad Shenai #define FW_RI_BIND_MW_WR_QPBINDE_V(x)	((x) << FW_RI_BIND_MW_WR_QPBINDE_S)
662cf7fe64aSHariprasad Shenai #define FW_RI_BIND_MW_WR_QPBINDE_G(x)	\
663cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_BIND_MW_WR_QPBINDE_S) & FW_RI_BIND_MW_WR_QPBINDE_M)
664cf7fe64aSHariprasad Shenai #define FW_RI_BIND_MW_WR_QPBINDE_F	FW_RI_BIND_MW_WR_QPBINDE_V(1U)
665cfdda9d7SSteve Wise 
666cf7fe64aSHariprasad Shenai #define FW_RI_BIND_MW_WR_NS_S		5
667cf7fe64aSHariprasad Shenai #define FW_RI_BIND_MW_WR_NS_M		0x1
668cf7fe64aSHariprasad Shenai #define FW_RI_BIND_MW_WR_NS_V(x)	((x) << FW_RI_BIND_MW_WR_NS_S)
669cf7fe64aSHariprasad Shenai #define FW_RI_BIND_MW_WR_NS_G(x)	\
670cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_BIND_MW_WR_NS_S) & FW_RI_BIND_MW_WR_NS_M)
671cf7fe64aSHariprasad Shenai #define FW_RI_BIND_MW_WR_NS_F	FW_RI_BIND_MW_WR_NS_V(1U)
672cfdda9d7SSteve Wise 
673cf7fe64aSHariprasad Shenai #define FW_RI_BIND_MW_WR_DCACPU_S	0
674cf7fe64aSHariprasad Shenai #define FW_RI_BIND_MW_WR_DCACPU_M	0x1f
675cf7fe64aSHariprasad Shenai #define FW_RI_BIND_MW_WR_DCACPU_V(x)	((x) << FW_RI_BIND_MW_WR_DCACPU_S)
676cf7fe64aSHariprasad Shenai #define FW_RI_BIND_MW_WR_DCACPU_G(x)	\
677cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_BIND_MW_WR_DCACPU_S) & FW_RI_BIND_MW_WR_DCACPU_M)
678cfdda9d7SSteve Wise 
679cfdda9d7SSteve Wise struct fw_ri_fr_nsmr_wr {
680cfdda9d7SSteve Wise 	__u8   opcode;
681cfdda9d7SSteve Wise 	__u8   flags;
682cfdda9d7SSteve Wise 	__u16  wrid;
683cfdda9d7SSteve Wise 	__u8   r1[3];
684cfdda9d7SSteve Wise 	__u8   len16;
685cfdda9d7SSteve Wise 	__u8   qpbinde_to_dcacpu;
686cfdda9d7SSteve Wise 	__u8   pgsz_shift;
687cfdda9d7SSteve Wise 	__u8   addr_type;
688cfdda9d7SSteve Wise 	__u8   mem_perms;
689cfdda9d7SSteve Wise 	__be32 stag;
690cfdda9d7SSteve Wise 	__be32 len_hi;
691cfdda9d7SSteve Wise 	__be32 len_lo;
692cfdda9d7SSteve Wise 	__be32 va_hi;
693cfdda9d7SSteve Wise 	__be32 va_lo_fbo;
694cfdda9d7SSteve Wise };
695cfdda9d7SSteve Wise 
696cf7fe64aSHariprasad Shenai #define FW_RI_FR_NSMR_WR_QPBINDE_S	6
697cf7fe64aSHariprasad Shenai #define FW_RI_FR_NSMR_WR_QPBINDE_M	0x1
698cf7fe64aSHariprasad Shenai #define FW_RI_FR_NSMR_WR_QPBINDE_V(x)	((x) << FW_RI_FR_NSMR_WR_QPBINDE_S)
699cf7fe64aSHariprasad Shenai #define FW_RI_FR_NSMR_WR_QPBINDE_G(x)	\
700cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_FR_NSMR_WR_QPBINDE_S) & FW_RI_FR_NSMR_WR_QPBINDE_M)
701cf7fe64aSHariprasad Shenai #define FW_RI_FR_NSMR_WR_QPBINDE_F	FW_RI_FR_NSMR_WR_QPBINDE_V(1U)
702cfdda9d7SSteve Wise 
703cf7fe64aSHariprasad Shenai #define FW_RI_FR_NSMR_WR_NS_S		5
704cf7fe64aSHariprasad Shenai #define FW_RI_FR_NSMR_WR_NS_M		0x1
705cf7fe64aSHariprasad Shenai #define FW_RI_FR_NSMR_WR_NS_V(x)	((x) << FW_RI_FR_NSMR_WR_NS_S)
706cf7fe64aSHariprasad Shenai #define FW_RI_FR_NSMR_WR_NS_G(x)	\
707cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_FR_NSMR_WR_NS_S) & FW_RI_FR_NSMR_WR_NS_M)
708cf7fe64aSHariprasad Shenai #define FW_RI_FR_NSMR_WR_NS_F	FW_RI_FR_NSMR_WR_NS_V(1U)
709cfdda9d7SSteve Wise 
710cf7fe64aSHariprasad Shenai #define FW_RI_FR_NSMR_WR_DCACPU_S	0
711cf7fe64aSHariprasad Shenai #define FW_RI_FR_NSMR_WR_DCACPU_M	0x1f
712cf7fe64aSHariprasad Shenai #define FW_RI_FR_NSMR_WR_DCACPU_V(x)	((x) << FW_RI_FR_NSMR_WR_DCACPU_S)
713cf7fe64aSHariprasad Shenai #define FW_RI_FR_NSMR_WR_DCACPU_G(x)	\
714cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_FR_NSMR_WR_DCACPU_S) & FW_RI_FR_NSMR_WR_DCACPU_M)
715cfdda9d7SSteve Wise 
71649b53a93SSteve Wise struct fw_ri_fr_nsmr_tpte_wr {
71749b53a93SSteve Wise 	__u8	opcode;
71849b53a93SSteve Wise 	__u8   flags;
71949b53a93SSteve Wise 	__u16  wrid;
72049b53a93SSteve Wise 	__u8   r1[3];
72149b53a93SSteve Wise 	__u8   len16;
7227d7d065aSLeon Romanovsky 	__be32  r2;
7237d7d065aSLeon Romanovsky 	__be32  stag;
72449b53a93SSteve Wise 	struct fw_ri_tpte tpte;
72549b53a93SSteve Wise 	__u64  pbl[2];
72649b53a93SSteve Wise };
72749b53a93SSteve Wise 
728cfdda9d7SSteve Wise struct fw_ri_inv_lstag_wr {
729cfdda9d7SSteve Wise 	__u8   opcode;
730cfdda9d7SSteve Wise 	__u8   flags;
731cfdda9d7SSteve Wise 	__u16  wrid;
732cfdda9d7SSteve Wise 	__u8   r1[3];
733cfdda9d7SSteve Wise 	__u8   len16;
734cfdda9d7SSteve Wise 	__be32 r2;
735cfdda9d7SSteve Wise 	__be32 stag_inv;
736cfdda9d7SSteve Wise };
737cfdda9d7SSteve Wise 
738cfdda9d7SSteve Wise enum fw_ri_type {
739cfdda9d7SSteve Wise 	FW_RI_TYPE_INIT,
740cfdda9d7SSteve Wise 	FW_RI_TYPE_FINI,
741cfdda9d7SSteve Wise 	FW_RI_TYPE_TERMINATE
742cfdda9d7SSteve Wise };
743cfdda9d7SSteve Wise 
744cfdda9d7SSteve Wise enum fw_ri_init_p2ptype {
745cfdda9d7SSteve Wise 	FW_RI_INIT_P2PTYPE_RDMA_WRITE		= FW_RI_RDMA_WRITE,
746cfdda9d7SSteve Wise 	FW_RI_INIT_P2PTYPE_READ_REQ		= FW_RI_READ_REQ,
747cfdda9d7SSteve Wise 	FW_RI_INIT_P2PTYPE_SEND			= FW_RI_SEND,
748cfdda9d7SSteve Wise 	FW_RI_INIT_P2PTYPE_SEND_WITH_INV	= FW_RI_SEND_WITH_INV,
749cfdda9d7SSteve Wise 	FW_RI_INIT_P2PTYPE_SEND_WITH_SE		= FW_RI_SEND_WITH_SE,
750cfdda9d7SSteve Wise 	FW_RI_INIT_P2PTYPE_SEND_WITH_SE_INV	= FW_RI_SEND_WITH_SE_INV,
751cfdda9d7SSteve Wise 	FW_RI_INIT_P2PTYPE_DISABLED		= 0xf,
752cfdda9d7SSteve Wise };
753cfdda9d7SSteve Wise 
7547fc7a7cfSRaju Rangoju enum fw_ri_init_rqeqid_srq {
7557fc7a7cfSRaju Rangoju 	FW_RI_INIT_RQEQID_SRQ			= 1 << 31,
7567fc7a7cfSRaju Rangoju };
7577fc7a7cfSRaju Rangoju 
758cfdda9d7SSteve Wise struct fw_ri_wr {
759cfdda9d7SSteve Wise 	__be32 op_compl;
760cfdda9d7SSteve Wise 	__be32 flowid_len16;
761cfdda9d7SSteve Wise 	__u64  cookie;
762cfdda9d7SSteve Wise 	union fw_ri {
763cfdda9d7SSteve Wise 		struct fw_ri_init {
764cfdda9d7SSteve Wise 			__u8   type;
765cfdda9d7SSteve Wise 			__u8   mpareqbit_p2ptype;
766cfdda9d7SSteve Wise 			__u8   r4[2];
767cfdda9d7SSteve Wise 			__u8   mpa_attrs;
768cfdda9d7SSteve Wise 			__u8   qp_caps;
769cfdda9d7SSteve Wise 			__be16 nrqe;
770cfdda9d7SSteve Wise 			__be32 pdid;
771cfdda9d7SSteve Wise 			__be32 qpid;
772cfdda9d7SSteve Wise 			__be32 sq_eqid;
773cfdda9d7SSteve Wise 			__be32 rq_eqid;
774cfdda9d7SSteve Wise 			__be32 scqid;
775cfdda9d7SSteve Wise 			__be32 rcqid;
776cfdda9d7SSteve Wise 			__be32 ord_max;
777cfdda9d7SSteve Wise 			__be32 ird_max;
778cfdda9d7SSteve Wise 			__be32 iss;
779cfdda9d7SSteve Wise 			__be32 irs;
780cfdda9d7SSteve Wise 			__be32 hwrqsize;
781cfdda9d7SSteve Wise 			__be32 hwrqaddr;
782cfdda9d7SSteve Wise 			__be64 r5;
783cfdda9d7SSteve Wise 			union fw_ri_init_p2p {
784cfdda9d7SSteve Wise 				struct fw_ri_rdma_write_wr write;
785cfdda9d7SSteve Wise 				struct fw_ri_rdma_read_wr read;
786cfdda9d7SSteve Wise 				struct fw_ri_send_wr send;
787cfdda9d7SSteve Wise 			} u;
788cfdda9d7SSteve Wise 		} init;
789cfdda9d7SSteve Wise 		struct fw_ri_fini {
790cfdda9d7SSteve Wise 			__u8   type;
791cfdda9d7SSteve Wise 			__u8   r3[7];
792cfdda9d7SSteve Wise 			__be64 r4;
793cfdda9d7SSteve Wise 		} fini;
794cfdda9d7SSteve Wise 		struct fw_ri_terminate {
795cfdda9d7SSteve Wise 			__u8   type;
796cfdda9d7SSteve Wise 			__u8   r3[3];
797cfdda9d7SSteve Wise 			__be32 immdlen;
798cfdda9d7SSteve Wise 			__u8   termmsg[40];
799cfdda9d7SSteve Wise 		} terminate;
800cfdda9d7SSteve Wise 	} u;
801cfdda9d7SSteve Wise };
802cfdda9d7SSteve Wise 
803cf7fe64aSHariprasad Shenai #define FW_RI_WR_MPAREQBIT_S	7
804cf7fe64aSHariprasad Shenai #define FW_RI_WR_MPAREQBIT_M	0x1
805cf7fe64aSHariprasad Shenai #define FW_RI_WR_MPAREQBIT_V(x)	((x) << FW_RI_WR_MPAREQBIT_S)
806cf7fe64aSHariprasad Shenai #define FW_RI_WR_MPAREQBIT_G(x)	\
807cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_WR_MPAREQBIT_S) & FW_RI_WR_MPAREQBIT_M)
808cf7fe64aSHariprasad Shenai #define FW_RI_WR_MPAREQBIT_F	FW_RI_WR_MPAREQBIT_V(1U)
809cfdda9d7SSteve Wise 
810cf7fe64aSHariprasad Shenai #define FW_RI_WR_P2PTYPE_S	0
811cf7fe64aSHariprasad Shenai #define FW_RI_WR_P2PTYPE_M	0xf
812cf7fe64aSHariprasad Shenai #define FW_RI_WR_P2PTYPE_V(x)	((x) << FW_RI_WR_P2PTYPE_S)
813cf7fe64aSHariprasad Shenai #define FW_RI_WR_P2PTYPE_G(x)	\
814cf7fe64aSHariprasad Shenai 	(((x) >> FW_RI_WR_P2PTYPE_S) & FW_RI_WR_P2PTYPE_M)
815cfdda9d7SSteve Wise 
816cfdda9d7SSteve Wise #endif /* _T4FW_RI_API_H_ */
817