18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Copyright (c) 2009-2010 Chelsio, Inc. All rights reserved.
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * This software is available to you under a choice of one of two
58c2ecf20Sopenharmony_ci * licenses.  You may choose to be licensed under the terms of the GNU
68c2ecf20Sopenharmony_ci * General Public License (GPL) Version 2, available from the file
78c2ecf20Sopenharmony_ci * COPYING in the main directory of this source tree, or the
88c2ecf20Sopenharmony_ci * OpenIB.org BSD license below:
98c2ecf20Sopenharmony_ci *
108c2ecf20Sopenharmony_ci *     Redistribution and use in source and binary forms, with or
118c2ecf20Sopenharmony_ci *     without modification, are permitted provided that the following
128c2ecf20Sopenharmony_ci *     conditions are met:
138c2ecf20Sopenharmony_ci *
148c2ecf20Sopenharmony_ci *      - Redistributions of source code must retain the above
158c2ecf20Sopenharmony_ci *        copyright notice, this list of conditions and the following
168c2ecf20Sopenharmony_ci *        disclaimer.
178c2ecf20Sopenharmony_ci *      - Redistributions in binary form must reproduce the above
188c2ecf20Sopenharmony_ci *        copyright notice, this list of conditions and the following
198c2ecf20Sopenharmony_ci *        disclaimer in the documentation and/or other materials
208c2ecf20Sopenharmony_ci *        provided with the distribution.
218c2ecf20Sopenharmony_ci *
228c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
238c2ecf20Sopenharmony_ci * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
248c2ecf20Sopenharmony_ci * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
258c2ecf20Sopenharmony_ci * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
268c2ecf20Sopenharmony_ci * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
278c2ecf20Sopenharmony_ci * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
288c2ecf20Sopenharmony_ci * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
298c2ecf20Sopenharmony_ci * SOFTWARE.
308c2ecf20Sopenharmony_ci */
318c2ecf20Sopenharmony_ci#ifndef _T4FW_RI_API_H_
328c2ecf20Sopenharmony_ci#define _T4FW_RI_API_H_
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci#include "t4fw_api.h"
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_cienum fw_ri_wr_opcode {
378c2ecf20Sopenharmony_ci	FW_RI_RDMA_WRITE		= 0x0,	/* IETF RDMAP v1.0 ... */
388c2ecf20Sopenharmony_ci	FW_RI_READ_REQ			= 0x1,
398c2ecf20Sopenharmony_ci	FW_RI_READ_RESP			= 0x2,
408c2ecf20Sopenharmony_ci	FW_RI_SEND			= 0x3,
418c2ecf20Sopenharmony_ci	FW_RI_SEND_WITH_INV		= 0x4,
428c2ecf20Sopenharmony_ci	FW_RI_SEND_WITH_SE		= 0x5,
438c2ecf20Sopenharmony_ci	FW_RI_SEND_WITH_SE_INV		= 0x6,
448c2ecf20Sopenharmony_ci	FW_RI_TERMINATE			= 0x7,
458c2ecf20Sopenharmony_ci	FW_RI_RDMA_INIT			= 0x8,	/* CHELSIO RI specific ... */
468c2ecf20Sopenharmony_ci	FW_RI_BIND_MW			= 0x9,
478c2ecf20Sopenharmony_ci	FW_RI_FAST_REGISTER		= 0xa,
488c2ecf20Sopenharmony_ci	FW_RI_LOCAL_INV			= 0xb,
498c2ecf20Sopenharmony_ci	FW_RI_QP_MODIFY			= 0xc,
508c2ecf20Sopenharmony_ci	FW_RI_BYPASS			= 0xd,
518c2ecf20Sopenharmony_ci	FW_RI_RECEIVE			= 0xe,
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci	FW_RI_SGE_EC_CR_RETURN		= 0xf,
548c2ecf20Sopenharmony_ci	FW_RI_WRITE_IMMEDIATE           = FW_RI_RDMA_INIT
558c2ecf20Sopenharmony_ci};
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_cienum fw_ri_wr_flags {
588c2ecf20Sopenharmony_ci	FW_RI_COMPLETION_FLAG		= 0x01,
598c2ecf20Sopenharmony_ci	FW_RI_NOTIFICATION_FLAG		= 0x02,
608c2ecf20Sopenharmony_ci	FW_RI_SOLICITED_EVENT_FLAG	= 0x04,
618c2ecf20Sopenharmony_ci	FW_RI_READ_FENCE_FLAG		= 0x08,
628c2ecf20Sopenharmony_ci	FW_RI_LOCAL_FENCE_FLAG		= 0x10,
638c2ecf20Sopenharmony_ci	FW_RI_RDMA_READ_INVALIDATE	= 0x20,
648c2ecf20Sopenharmony_ci	FW_RI_RDMA_WRITE_WITH_IMMEDIATE = 0x40
658c2ecf20Sopenharmony_ci};
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_cienum fw_ri_mpa_attrs {
688c2ecf20Sopenharmony_ci	FW_RI_MPA_RX_MARKER_ENABLE	= 0x01,
698c2ecf20Sopenharmony_ci	FW_RI_MPA_TX_MARKER_ENABLE	= 0x02,
708c2ecf20Sopenharmony_ci	FW_RI_MPA_CRC_ENABLE		= 0x04,
718c2ecf20Sopenharmony_ci	FW_RI_MPA_IETF_ENABLE		= 0x08
728c2ecf20Sopenharmony_ci};
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_cienum fw_ri_qp_caps {
758c2ecf20Sopenharmony_ci	FW_RI_QP_RDMA_READ_ENABLE	= 0x01,
768c2ecf20Sopenharmony_ci	FW_RI_QP_RDMA_WRITE_ENABLE	= 0x02,
778c2ecf20Sopenharmony_ci	FW_RI_QP_BIND_ENABLE		= 0x04,
788c2ecf20Sopenharmony_ci	FW_RI_QP_FAST_REGISTER_ENABLE	= 0x08,
798c2ecf20Sopenharmony_ci	FW_RI_QP_STAG0_ENABLE		= 0x10
808c2ecf20Sopenharmony_ci};
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_cienum fw_ri_addr_type {
838c2ecf20Sopenharmony_ci	FW_RI_ZERO_BASED_TO		= 0x00,
848c2ecf20Sopenharmony_ci	FW_RI_VA_BASED_TO		= 0x01
858c2ecf20Sopenharmony_ci};
868c2ecf20Sopenharmony_ci
878c2ecf20Sopenharmony_cienum fw_ri_mem_perms {
888c2ecf20Sopenharmony_ci	FW_RI_MEM_ACCESS_REM_WRITE	= 0x01,
898c2ecf20Sopenharmony_ci	FW_RI_MEM_ACCESS_REM_READ	= 0x02,
908c2ecf20Sopenharmony_ci	FW_RI_MEM_ACCESS_REM		= 0x03,
918c2ecf20Sopenharmony_ci	FW_RI_MEM_ACCESS_LOCAL_WRITE	= 0x04,
928c2ecf20Sopenharmony_ci	FW_RI_MEM_ACCESS_LOCAL_READ	= 0x08,
938c2ecf20Sopenharmony_ci	FW_RI_MEM_ACCESS_LOCAL		= 0x0C
948c2ecf20Sopenharmony_ci};
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_cienum fw_ri_stag_type {
978c2ecf20Sopenharmony_ci	FW_RI_STAG_NSMR			= 0x00,
988c2ecf20Sopenharmony_ci	FW_RI_STAG_SMR			= 0x01,
998c2ecf20Sopenharmony_ci	FW_RI_STAG_MW			= 0x02,
1008c2ecf20Sopenharmony_ci	FW_RI_STAG_MW_RELAXED		= 0x03
1018c2ecf20Sopenharmony_ci};
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_cienum fw_ri_data_op {
1048c2ecf20Sopenharmony_ci	FW_RI_DATA_IMMD			= 0x81,
1058c2ecf20Sopenharmony_ci	FW_RI_DATA_DSGL			= 0x82,
1068c2ecf20Sopenharmony_ci	FW_RI_DATA_ISGL			= 0x83
1078c2ecf20Sopenharmony_ci};
1088c2ecf20Sopenharmony_ci
1098c2ecf20Sopenharmony_cienum fw_ri_sgl_depth {
1108c2ecf20Sopenharmony_ci	FW_RI_SGL_DEPTH_MAX_SQ		= 16,
1118c2ecf20Sopenharmony_ci	FW_RI_SGL_DEPTH_MAX_RQ		= 4
1128c2ecf20Sopenharmony_ci};
1138c2ecf20Sopenharmony_ci
1148c2ecf20Sopenharmony_cistruct fw_ri_dsge_pair {
1158c2ecf20Sopenharmony_ci	__be32	len[2];
1168c2ecf20Sopenharmony_ci	__be64	addr[2];
1178c2ecf20Sopenharmony_ci};
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_cistruct fw_ri_dsgl {
1208c2ecf20Sopenharmony_ci	__u8	op;
1218c2ecf20Sopenharmony_ci	__u8	r1;
1228c2ecf20Sopenharmony_ci	__be16	nsge;
1238c2ecf20Sopenharmony_ci	__be32	len0;
1248c2ecf20Sopenharmony_ci	__be64	addr0;
1258c2ecf20Sopenharmony_ci#ifndef C99_NOT_SUPPORTED
1268c2ecf20Sopenharmony_ci	struct fw_ri_dsge_pair sge[];
1278c2ecf20Sopenharmony_ci#endif
1288c2ecf20Sopenharmony_ci};
1298c2ecf20Sopenharmony_ci
1308c2ecf20Sopenharmony_cistruct fw_ri_sge {
1318c2ecf20Sopenharmony_ci	__be32 stag;
1328c2ecf20Sopenharmony_ci	__be32 len;
1338c2ecf20Sopenharmony_ci	__be64 to;
1348c2ecf20Sopenharmony_ci};
1358c2ecf20Sopenharmony_ci
1368c2ecf20Sopenharmony_cistruct fw_ri_isgl {
1378c2ecf20Sopenharmony_ci	__u8	op;
1388c2ecf20Sopenharmony_ci	__u8	r1;
1398c2ecf20Sopenharmony_ci	__be16	nsge;
1408c2ecf20Sopenharmony_ci	__be32	r2;
1418c2ecf20Sopenharmony_ci#ifndef C99_NOT_SUPPORTED
1428c2ecf20Sopenharmony_ci	struct fw_ri_sge sge[];
1438c2ecf20Sopenharmony_ci#endif
1448c2ecf20Sopenharmony_ci};
1458c2ecf20Sopenharmony_ci
1468c2ecf20Sopenharmony_cistruct fw_ri_immd {
1478c2ecf20Sopenharmony_ci	__u8	op;
1488c2ecf20Sopenharmony_ci	__u8	r1;
1498c2ecf20Sopenharmony_ci	__be16	r2;
1508c2ecf20Sopenharmony_ci	__be32	immdlen;
1518c2ecf20Sopenharmony_ci#ifndef C99_NOT_SUPPORTED
1528c2ecf20Sopenharmony_ci	__u8	data[];
1538c2ecf20Sopenharmony_ci#endif
1548c2ecf20Sopenharmony_ci};
1558c2ecf20Sopenharmony_ci
1568c2ecf20Sopenharmony_cistruct fw_ri_tpte {
1578c2ecf20Sopenharmony_ci	__be32 valid_to_pdid;
1588c2ecf20Sopenharmony_ci	__be32 locread_to_qpid;
1598c2ecf20Sopenharmony_ci	__be32 nosnoop_pbladdr;
1608c2ecf20Sopenharmony_ci	__be32 len_lo;
1618c2ecf20Sopenharmony_ci	__be32 va_hi;
1628c2ecf20Sopenharmony_ci	__be32 va_lo_fbo;
1638c2ecf20Sopenharmony_ci	__be32 dca_mwbcnt_pstag;
1648c2ecf20Sopenharmony_ci	__be32 len_hi;
1658c2ecf20Sopenharmony_ci};
1668c2ecf20Sopenharmony_ci
1678c2ecf20Sopenharmony_ci#define FW_RI_TPTE_VALID_S		31
1688c2ecf20Sopenharmony_ci#define FW_RI_TPTE_VALID_M		0x1
1698c2ecf20Sopenharmony_ci#define FW_RI_TPTE_VALID_V(x)		((x) << FW_RI_TPTE_VALID_S)
1708c2ecf20Sopenharmony_ci#define FW_RI_TPTE_VALID_G(x)		\
1718c2ecf20Sopenharmony_ci	(((x) >> FW_RI_TPTE_VALID_S) & FW_RI_TPTE_VALID_M)
1728c2ecf20Sopenharmony_ci#define FW_RI_TPTE_VALID_F		FW_RI_TPTE_VALID_V(1U)
1738c2ecf20Sopenharmony_ci
1748c2ecf20Sopenharmony_ci#define FW_RI_TPTE_STAGKEY_S		23
1758c2ecf20Sopenharmony_ci#define FW_RI_TPTE_STAGKEY_M		0xff
1768c2ecf20Sopenharmony_ci#define FW_RI_TPTE_STAGKEY_V(x)		((x) << FW_RI_TPTE_STAGKEY_S)
1778c2ecf20Sopenharmony_ci#define FW_RI_TPTE_STAGKEY_G(x)		\
1788c2ecf20Sopenharmony_ci	(((x) >> FW_RI_TPTE_STAGKEY_S) & FW_RI_TPTE_STAGKEY_M)
1798c2ecf20Sopenharmony_ci
1808c2ecf20Sopenharmony_ci#define FW_RI_TPTE_STAGSTATE_S		22
1818c2ecf20Sopenharmony_ci#define FW_RI_TPTE_STAGSTATE_M		0x1
1828c2ecf20Sopenharmony_ci#define FW_RI_TPTE_STAGSTATE_V(x)	((x) << FW_RI_TPTE_STAGSTATE_S)
1838c2ecf20Sopenharmony_ci#define FW_RI_TPTE_STAGSTATE_G(x)	\
1848c2ecf20Sopenharmony_ci	(((x) >> FW_RI_TPTE_STAGSTATE_S) & FW_RI_TPTE_STAGSTATE_M)
1858c2ecf20Sopenharmony_ci#define FW_RI_TPTE_STAGSTATE_F		FW_RI_TPTE_STAGSTATE_V(1U)
1868c2ecf20Sopenharmony_ci
1878c2ecf20Sopenharmony_ci#define FW_RI_TPTE_STAGTYPE_S		20
1888c2ecf20Sopenharmony_ci#define FW_RI_TPTE_STAGTYPE_M		0x3
1898c2ecf20Sopenharmony_ci#define FW_RI_TPTE_STAGTYPE_V(x)	((x) << FW_RI_TPTE_STAGTYPE_S)
1908c2ecf20Sopenharmony_ci#define FW_RI_TPTE_STAGTYPE_G(x)	\
1918c2ecf20Sopenharmony_ci	(((x) >> FW_RI_TPTE_STAGTYPE_S) & FW_RI_TPTE_STAGTYPE_M)
1928c2ecf20Sopenharmony_ci
1938c2ecf20Sopenharmony_ci#define FW_RI_TPTE_PDID_S		0
1948c2ecf20Sopenharmony_ci#define FW_RI_TPTE_PDID_M		0xfffff
1958c2ecf20Sopenharmony_ci#define FW_RI_TPTE_PDID_V(x)		((x) << FW_RI_TPTE_PDID_S)
1968c2ecf20Sopenharmony_ci#define FW_RI_TPTE_PDID_G(x)		\
1978c2ecf20Sopenharmony_ci	(((x) >> FW_RI_TPTE_PDID_S) & FW_RI_TPTE_PDID_M)
1988c2ecf20Sopenharmony_ci
1998c2ecf20Sopenharmony_ci#define FW_RI_TPTE_PERM_S		28
2008c2ecf20Sopenharmony_ci#define FW_RI_TPTE_PERM_M		0xf
2018c2ecf20Sopenharmony_ci#define FW_RI_TPTE_PERM_V(x)		((x) << FW_RI_TPTE_PERM_S)
2028c2ecf20Sopenharmony_ci#define FW_RI_TPTE_PERM_G(x)		\
2038c2ecf20Sopenharmony_ci	(((x) >> FW_RI_TPTE_PERM_S) & FW_RI_TPTE_PERM_M)
2048c2ecf20Sopenharmony_ci
2058c2ecf20Sopenharmony_ci#define FW_RI_TPTE_REMINVDIS_S		27
2068c2ecf20Sopenharmony_ci#define FW_RI_TPTE_REMINVDIS_M		0x1
2078c2ecf20Sopenharmony_ci#define FW_RI_TPTE_REMINVDIS_V(x)	((x) << FW_RI_TPTE_REMINVDIS_S)
2088c2ecf20Sopenharmony_ci#define FW_RI_TPTE_REMINVDIS_G(x)	\
2098c2ecf20Sopenharmony_ci	(((x) >> FW_RI_TPTE_REMINVDIS_S) & FW_RI_TPTE_REMINVDIS_M)
2108c2ecf20Sopenharmony_ci#define FW_RI_TPTE_REMINVDIS_F		FW_RI_TPTE_REMINVDIS_V(1U)
2118c2ecf20Sopenharmony_ci
2128c2ecf20Sopenharmony_ci#define FW_RI_TPTE_ADDRTYPE_S		26
2138c2ecf20Sopenharmony_ci#define FW_RI_TPTE_ADDRTYPE_M		1
2148c2ecf20Sopenharmony_ci#define FW_RI_TPTE_ADDRTYPE_V(x)	((x) << FW_RI_TPTE_ADDRTYPE_S)
2158c2ecf20Sopenharmony_ci#define FW_RI_TPTE_ADDRTYPE_G(x)	\
2168c2ecf20Sopenharmony_ci	(((x) >> FW_RI_TPTE_ADDRTYPE_S) & FW_RI_TPTE_ADDRTYPE_M)
2178c2ecf20Sopenharmony_ci#define FW_RI_TPTE_ADDRTYPE_F		FW_RI_TPTE_ADDRTYPE_V(1U)
2188c2ecf20Sopenharmony_ci
2198c2ecf20Sopenharmony_ci#define FW_RI_TPTE_MWBINDEN_S		25
2208c2ecf20Sopenharmony_ci#define FW_RI_TPTE_MWBINDEN_M		0x1
2218c2ecf20Sopenharmony_ci#define FW_RI_TPTE_MWBINDEN_V(x)	((x) << FW_RI_TPTE_MWBINDEN_S)
2228c2ecf20Sopenharmony_ci#define FW_RI_TPTE_MWBINDEN_G(x)	\
2238c2ecf20Sopenharmony_ci	(((x) >> FW_RI_TPTE_MWBINDEN_S) & FW_RI_TPTE_MWBINDEN_M)
2248c2ecf20Sopenharmony_ci#define FW_RI_TPTE_MWBINDEN_F		FW_RI_TPTE_MWBINDEN_V(1U)
2258c2ecf20Sopenharmony_ci
2268c2ecf20Sopenharmony_ci#define FW_RI_TPTE_PS_S			20
2278c2ecf20Sopenharmony_ci#define FW_RI_TPTE_PS_M			0x1f
2288c2ecf20Sopenharmony_ci#define FW_RI_TPTE_PS_V(x)		((x) << FW_RI_TPTE_PS_S)
2298c2ecf20Sopenharmony_ci#define FW_RI_TPTE_PS_G(x)		\
2308c2ecf20Sopenharmony_ci	(((x) >> FW_RI_TPTE_PS_S) & FW_RI_TPTE_PS_M)
2318c2ecf20Sopenharmony_ci
2328c2ecf20Sopenharmony_ci#define FW_RI_TPTE_QPID_S		0
2338c2ecf20Sopenharmony_ci#define FW_RI_TPTE_QPID_M		0xfffff
2348c2ecf20Sopenharmony_ci#define FW_RI_TPTE_QPID_V(x)		((x) << FW_RI_TPTE_QPID_S)
2358c2ecf20Sopenharmony_ci#define FW_RI_TPTE_QPID_G(x)		\
2368c2ecf20Sopenharmony_ci	(((x) >> FW_RI_TPTE_QPID_S) & FW_RI_TPTE_QPID_M)
2378c2ecf20Sopenharmony_ci
2388c2ecf20Sopenharmony_ci#define FW_RI_TPTE_NOSNOOP_S		30
2398c2ecf20Sopenharmony_ci#define FW_RI_TPTE_NOSNOOP_M		0x1
2408c2ecf20Sopenharmony_ci#define FW_RI_TPTE_NOSNOOP_V(x)		((x) << FW_RI_TPTE_NOSNOOP_S)
2418c2ecf20Sopenharmony_ci#define FW_RI_TPTE_NOSNOOP_G(x)		\
2428c2ecf20Sopenharmony_ci	(((x) >> FW_RI_TPTE_NOSNOOP_S) & FW_RI_TPTE_NOSNOOP_M)
2438c2ecf20Sopenharmony_ci#define FW_RI_TPTE_NOSNOOP_F		FW_RI_TPTE_NOSNOOP_V(1U)
2448c2ecf20Sopenharmony_ci
2458c2ecf20Sopenharmony_ci#define FW_RI_TPTE_PBLADDR_S		0
2468c2ecf20Sopenharmony_ci#define FW_RI_TPTE_PBLADDR_M		0x1fffffff
2478c2ecf20Sopenharmony_ci#define FW_RI_TPTE_PBLADDR_V(x)		((x) << FW_RI_TPTE_PBLADDR_S)
2488c2ecf20Sopenharmony_ci#define FW_RI_TPTE_PBLADDR_G(x)		\
2498c2ecf20Sopenharmony_ci	(((x) >> FW_RI_TPTE_PBLADDR_S) & FW_RI_TPTE_PBLADDR_M)
2508c2ecf20Sopenharmony_ci
2518c2ecf20Sopenharmony_ci#define FW_RI_TPTE_DCA_S		24
2528c2ecf20Sopenharmony_ci#define FW_RI_TPTE_DCA_M		0x1f
2538c2ecf20Sopenharmony_ci#define FW_RI_TPTE_DCA_V(x)		((x) << FW_RI_TPTE_DCA_S)
2548c2ecf20Sopenharmony_ci#define FW_RI_TPTE_DCA_G(x)		\
2558c2ecf20Sopenharmony_ci	(((x) >> FW_RI_TPTE_DCA_S) & FW_RI_TPTE_DCA_M)
2568c2ecf20Sopenharmony_ci
2578c2ecf20Sopenharmony_ci#define FW_RI_TPTE_MWBCNT_PSTAG_S	0
2588c2ecf20Sopenharmony_ci#define FW_RI_TPTE_MWBCNT_PSTAG_M	0xffffff
2598c2ecf20Sopenharmony_ci#define FW_RI_TPTE_MWBCNT_PSTAT_V(x)	\
2608c2ecf20Sopenharmony_ci	((x) << FW_RI_TPTE_MWBCNT_PSTAG_S)
2618c2ecf20Sopenharmony_ci#define FW_RI_TPTE_MWBCNT_PSTAG_G(x)	\
2628c2ecf20Sopenharmony_ci	(((x) >> FW_RI_TPTE_MWBCNT_PSTAG_S) & FW_RI_TPTE_MWBCNT_PSTAG_M)
2638c2ecf20Sopenharmony_ci
2648c2ecf20Sopenharmony_cienum fw_ri_res_type {
2658c2ecf20Sopenharmony_ci	FW_RI_RES_TYPE_SQ,
2668c2ecf20Sopenharmony_ci	FW_RI_RES_TYPE_RQ,
2678c2ecf20Sopenharmony_ci	FW_RI_RES_TYPE_CQ,
2688c2ecf20Sopenharmony_ci	FW_RI_RES_TYPE_SRQ,
2698c2ecf20Sopenharmony_ci};
2708c2ecf20Sopenharmony_ci
2718c2ecf20Sopenharmony_cienum fw_ri_res_op {
2728c2ecf20Sopenharmony_ci	FW_RI_RES_OP_WRITE,
2738c2ecf20Sopenharmony_ci	FW_RI_RES_OP_RESET,
2748c2ecf20Sopenharmony_ci};
2758c2ecf20Sopenharmony_ci
2768c2ecf20Sopenharmony_cistruct fw_ri_res {
2778c2ecf20Sopenharmony_ci	union fw_ri_restype {
2788c2ecf20Sopenharmony_ci		struct fw_ri_res_sqrq {
2798c2ecf20Sopenharmony_ci			__u8   restype;
2808c2ecf20Sopenharmony_ci			__u8   op;
2818c2ecf20Sopenharmony_ci			__be16 r3;
2828c2ecf20Sopenharmony_ci			__be32 eqid;
2838c2ecf20Sopenharmony_ci			__be32 r4[2];
2848c2ecf20Sopenharmony_ci			__be32 fetchszm_to_iqid;
2858c2ecf20Sopenharmony_ci			__be32 dcaen_to_eqsize;
2868c2ecf20Sopenharmony_ci			__be64 eqaddr;
2878c2ecf20Sopenharmony_ci		} sqrq;
2888c2ecf20Sopenharmony_ci		struct fw_ri_res_cq {
2898c2ecf20Sopenharmony_ci			__u8   restype;
2908c2ecf20Sopenharmony_ci			__u8   op;
2918c2ecf20Sopenharmony_ci			__be16 r3;
2928c2ecf20Sopenharmony_ci			__be32 iqid;
2938c2ecf20Sopenharmony_ci			__be32 r4[2];
2948c2ecf20Sopenharmony_ci			__be32 iqandst_to_iqandstindex;
2958c2ecf20Sopenharmony_ci			__be16 iqdroprss_to_iqesize;
2968c2ecf20Sopenharmony_ci			__be16 iqsize;
2978c2ecf20Sopenharmony_ci			__be64 iqaddr;
2988c2ecf20Sopenharmony_ci			__be32 iqns_iqro;
2998c2ecf20Sopenharmony_ci			__be32 r6_lo;
3008c2ecf20Sopenharmony_ci			__be64 r7;
3018c2ecf20Sopenharmony_ci		} cq;
3028c2ecf20Sopenharmony_ci		struct fw_ri_res_srq {
3038c2ecf20Sopenharmony_ci			__u8   restype;
3048c2ecf20Sopenharmony_ci			__u8   op;
3058c2ecf20Sopenharmony_ci			__be16 r3;
3068c2ecf20Sopenharmony_ci			__be32 eqid;
3078c2ecf20Sopenharmony_ci			__be32 r4[2];
3088c2ecf20Sopenharmony_ci			__be32 fetchszm_to_iqid;
3098c2ecf20Sopenharmony_ci			__be32 dcaen_to_eqsize;
3108c2ecf20Sopenharmony_ci			__be64 eqaddr;
3118c2ecf20Sopenharmony_ci			__be32 srqid;
3128c2ecf20Sopenharmony_ci			__be32 pdid;
3138c2ecf20Sopenharmony_ci			__be32 hwsrqsize;
3148c2ecf20Sopenharmony_ci			__be32 hwsrqaddr;
3158c2ecf20Sopenharmony_ci		} srq;
3168c2ecf20Sopenharmony_ci	} u;
3178c2ecf20Sopenharmony_ci};
3188c2ecf20Sopenharmony_ci
3198c2ecf20Sopenharmony_cistruct fw_ri_res_wr {
3208c2ecf20Sopenharmony_ci	__be32 op_nres;
3218c2ecf20Sopenharmony_ci	__be32 len16_pkd;
3228c2ecf20Sopenharmony_ci	__u64  cookie;
3238c2ecf20Sopenharmony_ci#ifndef C99_NOT_SUPPORTED
3248c2ecf20Sopenharmony_ci	struct fw_ri_res res[];
3258c2ecf20Sopenharmony_ci#endif
3268c2ecf20Sopenharmony_ci};
3278c2ecf20Sopenharmony_ci
3288c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_NRES_S	0
3298c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_NRES_M	0xff
3308c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_NRES_V(x)	((x) << FW_RI_RES_WR_NRES_S)
3318c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_NRES_G(x)	\
3328c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_NRES_S) & FW_RI_RES_WR_NRES_M)
3338c2ecf20Sopenharmony_ci
3348c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_FETCHSZM_S		26
3358c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_FETCHSZM_M		0x1
3368c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_FETCHSZM_V(x)	((x) << FW_RI_RES_WR_FETCHSZM_S)
3378c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_FETCHSZM_G(x)	\
3388c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_FETCHSZM_S) & FW_RI_RES_WR_FETCHSZM_M)
3398c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_FETCHSZM_F	FW_RI_RES_WR_FETCHSZM_V(1U)
3408c2ecf20Sopenharmony_ci
3418c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_STATUSPGNS_S	25
3428c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_STATUSPGNS_M	0x1
3438c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_STATUSPGNS_V(x)	((x) << FW_RI_RES_WR_STATUSPGNS_S)
3448c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_STATUSPGNS_G(x)	\
3458c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_STATUSPGNS_S) & FW_RI_RES_WR_STATUSPGNS_M)
3468c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_STATUSPGNS_F	FW_RI_RES_WR_STATUSPGNS_V(1U)
3478c2ecf20Sopenharmony_ci
3488c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_STATUSPGRO_S	24
3498c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_STATUSPGRO_M	0x1
3508c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_STATUSPGRO_V(x)	((x) << FW_RI_RES_WR_STATUSPGRO_S)
3518c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_STATUSPGRO_G(x)	\
3528c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_STATUSPGRO_S) & FW_RI_RES_WR_STATUSPGRO_M)
3538c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_STATUSPGRO_F	FW_RI_RES_WR_STATUSPGRO_V(1U)
3548c2ecf20Sopenharmony_ci
3558c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_FETCHNS_S		23
3568c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_FETCHNS_M		0x1
3578c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_FETCHNS_V(x)	((x) << FW_RI_RES_WR_FETCHNS_S)
3588c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_FETCHNS_G(x)	\
3598c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_FETCHNS_S) & FW_RI_RES_WR_FETCHNS_M)
3608c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_FETCHNS_F	FW_RI_RES_WR_FETCHNS_V(1U)
3618c2ecf20Sopenharmony_ci
3628c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_FETCHRO_S		22
3638c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_FETCHRO_M		0x1
3648c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_FETCHRO_V(x)	((x) << FW_RI_RES_WR_FETCHRO_S)
3658c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_FETCHRO_G(x)	\
3668c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_FETCHRO_S) & FW_RI_RES_WR_FETCHRO_M)
3678c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_FETCHRO_F	FW_RI_RES_WR_FETCHRO_V(1U)
3688c2ecf20Sopenharmony_ci
3698c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_HOSTFCMODE_S	20
3708c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_HOSTFCMODE_M	0x3
3718c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_HOSTFCMODE_V(x)	((x) << FW_RI_RES_WR_HOSTFCMODE_S)
3728c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_HOSTFCMODE_G(x)	\
3738c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_HOSTFCMODE_S) & FW_RI_RES_WR_HOSTFCMODE_M)
3748c2ecf20Sopenharmony_ci
3758c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_CPRIO_S	19
3768c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_CPRIO_M	0x1
3778c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_CPRIO_V(x)	((x) << FW_RI_RES_WR_CPRIO_S)
3788c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_CPRIO_G(x)	\
3798c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_CPRIO_S) & FW_RI_RES_WR_CPRIO_M)
3808c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_CPRIO_F	FW_RI_RES_WR_CPRIO_V(1U)
3818c2ecf20Sopenharmony_ci
3828c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_ONCHIP_S		18
3838c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_ONCHIP_M		0x1
3848c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_ONCHIP_V(x)	((x) << FW_RI_RES_WR_ONCHIP_S)
3858c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_ONCHIP_G(x)	\
3868c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_ONCHIP_S) & FW_RI_RES_WR_ONCHIP_M)
3878c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_ONCHIP_F	FW_RI_RES_WR_ONCHIP_V(1U)
3888c2ecf20Sopenharmony_ci
3898c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_PCIECHN_S		16
3908c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_PCIECHN_M		0x3
3918c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_PCIECHN_V(x)	((x) << FW_RI_RES_WR_PCIECHN_S)
3928c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_PCIECHN_G(x)	\
3938c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_PCIECHN_S) & FW_RI_RES_WR_PCIECHN_M)
3948c2ecf20Sopenharmony_ci
3958c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQID_S	0
3968c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQID_M	0xffff
3978c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQID_V(x)	((x) << FW_RI_RES_WR_IQID_S)
3988c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQID_G(x)	\
3998c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_IQID_S) & FW_RI_RES_WR_IQID_M)
4008c2ecf20Sopenharmony_ci
4018c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_DCAEN_S	31
4028c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_DCAEN_M	0x1
4038c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_DCAEN_V(x)	((x) << FW_RI_RES_WR_DCAEN_S)
4048c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_DCAEN_G(x)	\
4058c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_DCAEN_S) & FW_RI_RES_WR_DCAEN_M)
4068c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_DCAEN_F	FW_RI_RES_WR_DCAEN_V(1U)
4078c2ecf20Sopenharmony_ci
4088c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_DCACPU_S		26
4098c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_DCACPU_M		0x1f
4108c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_DCACPU_V(x)	((x) << FW_RI_RES_WR_DCACPU_S)
4118c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_DCACPU_G(x)	\
4128c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_DCACPU_S) & FW_RI_RES_WR_DCACPU_M)
4138c2ecf20Sopenharmony_ci
4148c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_FBMIN_S	23
4158c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_FBMIN_M	0x7
4168c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_FBMIN_V(x)	((x) << FW_RI_RES_WR_FBMIN_S)
4178c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_FBMIN_G(x)	\
4188c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_FBMIN_S) & FW_RI_RES_WR_FBMIN_M)
4198c2ecf20Sopenharmony_ci
4208c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_FBMAX_S	20
4218c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_FBMAX_M	0x7
4228c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_FBMAX_V(x)	((x) << FW_RI_RES_WR_FBMAX_S)
4238c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_FBMAX_G(x)	\
4248c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_FBMAX_S) & FW_RI_RES_WR_FBMAX_M)
4258c2ecf20Sopenharmony_ci
4268c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_CIDXFTHRESHO_S	19
4278c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_CIDXFTHRESHO_M	0x1
4288c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_CIDXFTHRESHO_V(x)	((x) << FW_RI_RES_WR_CIDXFTHRESHO_S)
4298c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_CIDXFTHRESHO_G(x)	\
4308c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_CIDXFTHRESHO_S) & FW_RI_RES_WR_CIDXFTHRESHO_M)
4318c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_CIDXFTHRESHO_F	FW_RI_RES_WR_CIDXFTHRESHO_V(1U)
4328c2ecf20Sopenharmony_ci
4338c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_CIDXFTHRESH_S	16
4348c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_CIDXFTHRESH_M	0x7
4358c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_CIDXFTHRESH_V(x)	((x) << FW_RI_RES_WR_CIDXFTHRESH_S)
4368c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_CIDXFTHRESH_G(x)	\
4378c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_CIDXFTHRESH_S) & FW_RI_RES_WR_CIDXFTHRESH_M)
4388c2ecf20Sopenharmony_ci
4398c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_EQSIZE_S		0
4408c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_EQSIZE_M		0xffff
4418c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_EQSIZE_V(x)	((x) << FW_RI_RES_WR_EQSIZE_S)
4428c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_EQSIZE_G(x)	\
4438c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_EQSIZE_S) & FW_RI_RES_WR_EQSIZE_M)
4448c2ecf20Sopenharmony_ci
4458c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQANDST_S		15
4468c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQANDST_M		0x1
4478c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQANDST_V(x)	((x) << FW_RI_RES_WR_IQANDST_S)
4488c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQANDST_G(x)	\
4498c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_IQANDST_S) & FW_RI_RES_WR_IQANDST_M)
4508c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQANDST_F	FW_RI_RES_WR_IQANDST_V(1U)
4518c2ecf20Sopenharmony_ci
4528c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQANUS_S		14
4538c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQANUS_M		0x1
4548c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQANUS_V(x)	((x) << FW_RI_RES_WR_IQANUS_S)
4558c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQANUS_G(x)	\
4568c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_IQANUS_S) & FW_RI_RES_WR_IQANUS_M)
4578c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQANUS_F	FW_RI_RES_WR_IQANUS_V(1U)
4588c2ecf20Sopenharmony_ci
4598c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQANUD_S		12
4608c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQANUD_M		0x3
4618c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQANUD_V(x)	((x) << FW_RI_RES_WR_IQANUD_S)
4628c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQANUD_G(x)	\
4638c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_IQANUD_S) & FW_RI_RES_WR_IQANUD_M)
4648c2ecf20Sopenharmony_ci
4658c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQANDSTINDEX_S	0
4668c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQANDSTINDEX_M	0xfff
4678c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQANDSTINDEX_V(x)	((x) << FW_RI_RES_WR_IQANDSTINDEX_S)
4688c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQANDSTINDEX_G(x)	\
4698c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_IQANDSTINDEX_S) & FW_RI_RES_WR_IQANDSTINDEX_M)
4708c2ecf20Sopenharmony_ci
4718c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQDROPRSS_S	15
4728c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQDROPRSS_M	0x1
4738c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQDROPRSS_V(x)	((x) << FW_RI_RES_WR_IQDROPRSS_S)
4748c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQDROPRSS_G(x)	\
4758c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_IQDROPRSS_S) & FW_RI_RES_WR_IQDROPRSS_M)
4768c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQDROPRSS_F	FW_RI_RES_WR_IQDROPRSS_V(1U)
4778c2ecf20Sopenharmony_ci
4788c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQGTSMODE_S	14
4798c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQGTSMODE_M	0x1
4808c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQGTSMODE_V(x)	((x) << FW_RI_RES_WR_IQGTSMODE_S)
4818c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQGTSMODE_G(x)	\
4828c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_IQGTSMODE_S) & FW_RI_RES_WR_IQGTSMODE_M)
4838c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQGTSMODE_F	FW_RI_RES_WR_IQGTSMODE_V(1U)
4848c2ecf20Sopenharmony_ci
4858c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQPCIECH_S		12
4868c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQPCIECH_M		0x3
4878c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQPCIECH_V(x)	((x) << FW_RI_RES_WR_IQPCIECH_S)
4888c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQPCIECH_G(x)	\
4898c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_IQPCIECH_S) & FW_RI_RES_WR_IQPCIECH_M)
4908c2ecf20Sopenharmony_ci
4918c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQDCAEN_S		11
4928c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQDCAEN_M		0x1
4938c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQDCAEN_V(x)	((x) << FW_RI_RES_WR_IQDCAEN_S)
4948c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQDCAEN_G(x)	\
4958c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_IQDCAEN_S) & FW_RI_RES_WR_IQDCAEN_M)
4968c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQDCAEN_F	FW_RI_RES_WR_IQDCAEN_V(1U)
4978c2ecf20Sopenharmony_ci
4988c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQDCACPU_S		6
4998c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQDCACPU_M		0x1f
5008c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQDCACPU_V(x)	((x) << FW_RI_RES_WR_IQDCACPU_S)
5018c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQDCACPU_G(x)	\
5028c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_IQDCACPU_S) & FW_RI_RES_WR_IQDCACPU_M)
5038c2ecf20Sopenharmony_ci
5048c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQINTCNTTHRESH_S		4
5058c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQINTCNTTHRESH_M		0x3
5068c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQINTCNTTHRESH_V(x)	\
5078c2ecf20Sopenharmony_ci	((x) << FW_RI_RES_WR_IQINTCNTTHRESH_S)
5088c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQINTCNTTHRESH_G(x)	\
5098c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_IQINTCNTTHRESH_S) & FW_RI_RES_WR_IQINTCNTTHRESH_M)
5108c2ecf20Sopenharmony_ci
5118c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQO_S	3
5128c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQO_M	0x1
5138c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQO_V(x)	((x) << FW_RI_RES_WR_IQO_S)
5148c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQO_G(x)	\
5158c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_IQO_S) & FW_RI_RES_WR_IQO_M)
5168c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQO_F	FW_RI_RES_WR_IQO_V(1U)
5178c2ecf20Sopenharmony_ci
5188c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQCPRIO_S		2
5198c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQCPRIO_M		0x1
5208c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQCPRIO_V(x)	((x) << FW_RI_RES_WR_IQCPRIO_S)
5218c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQCPRIO_G(x)	\
5228c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_IQCPRIO_S) & FW_RI_RES_WR_IQCPRIO_M)
5238c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQCPRIO_F	FW_RI_RES_WR_IQCPRIO_V(1U)
5248c2ecf20Sopenharmony_ci
5258c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQESIZE_S		0
5268c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQESIZE_M		0x3
5278c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQESIZE_V(x)	((x) << FW_RI_RES_WR_IQESIZE_S)
5288c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQESIZE_G(x)	\
5298c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_IQESIZE_S) & FW_RI_RES_WR_IQESIZE_M)
5308c2ecf20Sopenharmony_ci
5318c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQNS_S	31
5328c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQNS_M	0x1
5338c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQNS_V(x)	((x) << FW_RI_RES_WR_IQNS_S)
5348c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQNS_G(x)	\
5358c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_IQNS_S) & FW_RI_RES_WR_IQNS_M)
5368c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQNS_F	FW_RI_RES_WR_IQNS_V(1U)
5378c2ecf20Sopenharmony_ci
5388c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQRO_S	30
5398c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQRO_M	0x1
5408c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQRO_V(x)	((x) << FW_RI_RES_WR_IQRO_S)
5418c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQRO_G(x)	\
5428c2ecf20Sopenharmony_ci	(((x) >> FW_RI_RES_WR_IQRO_S) & FW_RI_RES_WR_IQRO_M)
5438c2ecf20Sopenharmony_ci#define FW_RI_RES_WR_IQRO_F	FW_RI_RES_WR_IQRO_V(1U)
5448c2ecf20Sopenharmony_ci
5458c2ecf20Sopenharmony_cistruct fw_ri_rdma_write_wr {
5468c2ecf20Sopenharmony_ci	__u8   opcode;
5478c2ecf20Sopenharmony_ci	__u8   flags;
5488c2ecf20Sopenharmony_ci	__u16  wrid;
5498c2ecf20Sopenharmony_ci	__u8   r1[3];
5508c2ecf20Sopenharmony_ci	__u8   len16;
5518c2ecf20Sopenharmony_ci	/*
5528c2ecf20Sopenharmony_ci	 * Use union for immediate data to be consistent with stack's 32 bit
5538c2ecf20Sopenharmony_ci	 * data and iWARP spec's 64 bit data.
5548c2ecf20Sopenharmony_ci	 */
5558c2ecf20Sopenharmony_ci	union {
5568c2ecf20Sopenharmony_ci		struct {
5578c2ecf20Sopenharmony_ci			__be32 imm_data32;
5588c2ecf20Sopenharmony_ci			u32 reserved;
5598c2ecf20Sopenharmony_ci		} ib_imm_data;
5608c2ecf20Sopenharmony_ci		__be64 imm_data64;
5618c2ecf20Sopenharmony_ci	} iw_imm_data;
5628c2ecf20Sopenharmony_ci	__be32 plen;
5638c2ecf20Sopenharmony_ci	__be32 stag_sink;
5648c2ecf20Sopenharmony_ci	__be64 to_sink;
5658c2ecf20Sopenharmony_ci#ifndef C99_NOT_SUPPORTED
5668c2ecf20Sopenharmony_ci	union {
5678c2ecf20Sopenharmony_ci		struct fw_ri_immd immd_src[0];
5688c2ecf20Sopenharmony_ci		struct fw_ri_isgl isgl_src[0];
5698c2ecf20Sopenharmony_ci	} u;
5708c2ecf20Sopenharmony_ci#endif
5718c2ecf20Sopenharmony_ci};
5728c2ecf20Sopenharmony_ci
5738c2ecf20Sopenharmony_cistruct fw_ri_send_wr {
5748c2ecf20Sopenharmony_ci	__u8   opcode;
5758c2ecf20Sopenharmony_ci	__u8   flags;
5768c2ecf20Sopenharmony_ci	__u16  wrid;
5778c2ecf20Sopenharmony_ci	__u8   r1[3];
5788c2ecf20Sopenharmony_ci	__u8   len16;
5798c2ecf20Sopenharmony_ci	__be32 sendop_pkd;
5808c2ecf20Sopenharmony_ci	__be32 stag_inv;
5818c2ecf20Sopenharmony_ci	__be32 plen;
5828c2ecf20Sopenharmony_ci	__be32 r3;
5838c2ecf20Sopenharmony_ci	__be64 r4;
5848c2ecf20Sopenharmony_ci#ifndef C99_NOT_SUPPORTED
5858c2ecf20Sopenharmony_ci	union {
5868c2ecf20Sopenharmony_ci		struct fw_ri_immd immd_src[0];
5878c2ecf20Sopenharmony_ci		struct fw_ri_isgl isgl_src[0];
5888c2ecf20Sopenharmony_ci	} u;
5898c2ecf20Sopenharmony_ci#endif
5908c2ecf20Sopenharmony_ci};
5918c2ecf20Sopenharmony_ci
5928c2ecf20Sopenharmony_ci#define FW_RI_SEND_WR_SENDOP_S		0
5938c2ecf20Sopenharmony_ci#define FW_RI_SEND_WR_SENDOP_M		0xf
5948c2ecf20Sopenharmony_ci#define FW_RI_SEND_WR_SENDOP_V(x)	((x) << FW_RI_SEND_WR_SENDOP_S)
5958c2ecf20Sopenharmony_ci#define FW_RI_SEND_WR_SENDOP_G(x)	\
5968c2ecf20Sopenharmony_ci	(((x) >> FW_RI_SEND_WR_SENDOP_S) & FW_RI_SEND_WR_SENDOP_M)
5978c2ecf20Sopenharmony_ci
5988c2ecf20Sopenharmony_cistruct fw_ri_rdma_write_cmpl_wr {
5998c2ecf20Sopenharmony_ci	__u8   opcode;
6008c2ecf20Sopenharmony_ci	__u8   flags;
6018c2ecf20Sopenharmony_ci	__u16  wrid;
6028c2ecf20Sopenharmony_ci	__u8   r1[3];
6038c2ecf20Sopenharmony_ci	__u8   len16;
6048c2ecf20Sopenharmony_ci	__u8   r2;
6058c2ecf20Sopenharmony_ci	__u8   flags_send;
6068c2ecf20Sopenharmony_ci	__u16  wrid_send;
6078c2ecf20Sopenharmony_ci	__be32 stag_inv;
6088c2ecf20Sopenharmony_ci	__be32 plen;
6098c2ecf20Sopenharmony_ci	__be32 stag_sink;
6108c2ecf20Sopenharmony_ci	__be64 to_sink;
6118c2ecf20Sopenharmony_ci	union fw_ri_cmpl {
6128c2ecf20Sopenharmony_ci		struct fw_ri_immd_cmpl {
6138c2ecf20Sopenharmony_ci			__u8   op;
6148c2ecf20Sopenharmony_ci			__u8   r1[6];
6158c2ecf20Sopenharmony_ci			__u8   immdlen;
6168c2ecf20Sopenharmony_ci			__u8   data[16];
6178c2ecf20Sopenharmony_ci		} immd_src;
6188c2ecf20Sopenharmony_ci		struct fw_ri_isgl isgl_src;
6198c2ecf20Sopenharmony_ci	} u_cmpl;
6208c2ecf20Sopenharmony_ci	__be64 r3;
6218c2ecf20Sopenharmony_ci#ifndef C99_NOT_SUPPORTED
6228c2ecf20Sopenharmony_ci	union fw_ri_write {
6238c2ecf20Sopenharmony_ci		struct fw_ri_immd immd_src[0];
6248c2ecf20Sopenharmony_ci		struct fw_ri_isgl isgl_src[0];
6258c2ecf20Sopenharmony_ci	} u;
6268c2ecf20Sopenharmony_ci#endif
6278c2ecf20Sopenharmony_ci};
6288c2ecf20Sopenharmony_ci
6298c2ecf20Sopenharmony_cistruct fw_ri_rdma_read_wr {
6308c2ecf20Sopenharmony_ci	__u8   opcode;
6318c2ecf20Sopenharmony_ci	__u8   flags;
6328c2ecf20Sopenharmony_ci	__u16  wrid;
6338c2ecf20Sopenharmony_ci	__u8   r1[3];
6348c2ecf20Sopenharmony_ci	__u8   len16;
6358c2ecf20Sopenharmony_ci	__be64 r2;
6368c2ecf20Sopenharmony_ci	__be32 stag_sink;
6378c2ecf20Sopenharmony_ci	__be32 to_sink_hi;
6388c2ecf20Sopenharmony_ci	__be32 to_sink_lo;
6398c2ecf20Sopenharmony_ci	__be32 plen;
6408c2ecf20Sopenharmony_ci	__be32 stag_src;
6418c2ecf20Sopenharmony_ci	__be32 to_src_hi;
6428c2ecf20Sopenharmony_ci	__be32 to_src_lo;
6438c2ecf20Sopenharmony_ci	__be32 r5;
6448c2ecf20Sopenharmony_ci};
6458c2ecf20Sopenharmony_ci
6468c2ecf20Sopenharmony_cistruct fw_ri_recv_wr {
6478c2ecf20Sopenharmony_ci	__u8   opcode;
6488c2ecf20Sopenharmony_ci	__u8   r1;
6498c2ecf20Sopenharmony_ci	__u16  wrid;
6508c2ecf20Sopenharmony_ci	__u8   r2[3];
6518c2ecf20Sopenharmony_ci	__u8   len16;
6528c2ecf20Sopenharmony_ci	struct fw_ri_isgl isgl;
6538c2ecf20Sopenharmony_ci};
6548c2ecf20Sopenharmony_ci
6558c2ecf20Sopenharmony_cistruct fw_ri_bind_mw_wr {
6568c2ecf20Sopenharmony_ci	__u8   opcode;
6578c2ecf20Sopenharmony_ci	__u8   flags;
6588c2ecf20Sopenharmony_ci	__u16  wrid;
6598c2ecf20Sopenharmony_ci	__u8   r1[3];
6608c2ecf20Sopenharmony_ci	__u8   len16;
6618c2ecf20Sopenharmony_ci	__u8   qpbinde_to_dcacpu;
6628c2ecf20Sopenharmony_ci	__u8   pgsz_shift;
6638c2ecf20Sopenharmony_ci	__u8   addr_type;
6648c2ecf20Sopenharmony_ci	__u8   mem_perms;
6658c2ecf20Sopenharmony_ci	__be32 stag_mr;
6668c2ecf20Sopenharmony_ci	__be32 stag_mw;
6678c2ecf20Sopenharmony_ci	__be32 r3;
6688c2ecf20Sopenharmony_ci	__be64 len_mw;
6698c2ecf20Sopenharmony_ci	__be64 va_fbo;
6708c2ecf20Sopenharmony_ci	__be64 r4;
6718c2ecf20Sopenharmony_ci};
6728c2ecf20Sopenharmony_ci
6738c2ecf20Sopenharmony_ci#define FW_RI_BIND_MW_WR_QPBINDE_S	6
6748c2ecf20Sopenharmony_ci#define FW_RI_BIND_MW_WR_QPBINDE_M	0x1
6758c2ecf20Sopenharmony_ci#define FW_RI_BIND_MW_WR_QPBINDE_V(x)	((x) << FW_RI_BIND_MW_WR_QPBINDE_S)
6768c2ecf20Sopenharmony_ci#define FW_RI_BIND_MW_WR_QPBINDE_G(x)	\
6778c2ecf20Sopenharmony_ci	(((x) >> FW_RI_BIND_MW_WR_QPBINDE_S) & FW_RI_BIND_MW_WR_QPBINDE_M)
6788c2ecf20Sopenharmony_ci#define FW_RI_BIND_MW_WR_QPBINDE_F	FW_RI_BIND_MW_WR_QPBINDE_V(1U)
6798c2ecf20Sopenharmony_ci
6808c2ecf20Sopenharmony_ci#define FW_RI_BIND_MW_WR_NS_S		5
6818c2ecf20Sopenharmony_ci#define FW_RI_BIND_MW_WR_NS_M		0x1
6828c2ecf20Sopenharmony_ci#define FW_RI_BIND_MW_WR_NS_V(x)	((x) << FW_RI_BIND_MW_WR_NS_S)
6838c2ecf20Sopenharmony_ci#define FW_RI_BIND_MW_WR_NS_G(x)	\
6848c2ecf20Sopenharmony_ci	(((x) >> FW_RI_BIND_MW_WR_NS_S) & FW_RI_BIND_MW_WR_NS_M)
6858c2ecf20Sopenharmony_ci#define FW_RI_BIND_MW_WR_NS_F	FW_RI_BIND_MW_WR_NS_V(1U)
6868c2ecf20Sopenharmony_ci
6878c2ecf20Sopenharmony_ci#define FW_RI_BIND_MW_WR_DCACPU_S	0
6888c2ecf20Sopenharmony_ci#define FW_RI_BIND_MW_WR_DCACPU_M	0x1f
6898c2ecf20Sopenharmony_ci#define FW_RI_BIND_MW_WR_DCACPU_V(x)	((x) << FW_RI_BIND_MW_WR_DCACPU_S)
6908c2ecf20Sopenharmony_ci#define FW_RI_BIND_MW_WR_DCACPU_G(x)	\
6918c2ecf20Sopenharmony_ci	(((x) >> FW_RI_BIND_MW_WR_DCACPU_S) & FW_RI_BIND_MW_WR_DCACPU_M)
6928c2ecf20Sopenharmony_ci
6938c2ecf20Sopenharmony_cistruct fw_ri_fr_nsmr_wr {
6948c2ecf20Sopenharmony_ci	__u8   opcode;
6958c2ecf20Sopenharmony_ci	__u8   flags;
6968c2ecf20Sopenharmony_ci	__u16  wrid;
6978c2ecf20Sopenharmony_ci	__u8   r1[3];
6988c2ecf20Sopenharmony_ci	__u8   len16;
6998c2ecf20Sopenharmony_ci	__u8   qpbinde_to_dcacpu;
7008c2ecf20Sopenharmony_ci	__u8   pgsz_shift;
7018c2ecf20Sopenharmony_ci	__u8   addr_type;
7028c2ecf20Sopenharmony_ci	__u8   mem_perms;
7038c2ecf20Sopenharmony_ci	__be32 stag;
7048c2ecf20Sopenharmony_ci	__be32 len_hi;
7058c2ecf20Sopenharmony_ci	__be32 len_lo;
7068c2ecf20Sopenharmony_ci	__be32 va_hi;
7078c2ecf20Sopenharmony_ci	__be32 va_lo_fbo;
7088c2ecf20Sopenharmony_ci};
7098c2ecf20Sopenharmony_ci
7108c2ecf20Sopenharmony_ci#define FW_RI_FR_NSMR_WR_QPBINDE_S	6
7118c2ecf20Sopenharmony_ci#define FW_RI_FR_NSMR_WR_QPBINDE_M	0x1
7128c2ecf20Sopenharmony_ci#define FW_RI_FR_NSMR_WR_QPBINDE_V(x)	((x) << FW_RI_FR_NSMR_WR_QPBINDE_S)
7138c2ecf20Sopenharmony_ci#define FW_RI_FR_NSMR_WR_QPBINDE_G(x)	\
7148c2ecf20Sopenharmony_ci	(((x) >> FW_RI_FR_NSMR_WR_QPBINDE_S) & FW_RI_FR_NSMR_WR_QPBINDE_M)
7158c2ecf20Sopenharmony_ci#define FW_RI_FR_NSMR_WR_QPBINDE_F	FW_RI_FR_NSMR_WR_QPBINDE_V(1U)
7168c2ecf20Sopenharmony_ci
7178c2ecf20Sopenharmony_ci#define FW_RI_FR_NSMR_WR_NS_S		5
7188c2ecf20Sopenharmony_ci#define FW_RI_FR_NSMR_WR_NS_M		0x1
7198c2ecf20Sopenharmony_ci#define FW_RI_FR_NSMR_WR_NS_V(x)	((x) << FW_RI_FR_NSMR_WR_NS_S)
7208c2ecf20Sopenharmony_ci#define FW_RI_FR_NSMR_WR_NS_G(x)	\
7218c2ecf20Sopenharmony_ci	(((x) >> FW_RI_FR_NSMR_WR_NS_S) & FW_RI_FR_NSMR_WR_NS_M)
7228c2ecf20Sopenharmony_ci#define FW_RI_FR_NSMR_WR_NS_F	FW_RI_FR_NSMR_WR_NS_V(1U)
7238c2ecf20Sopenharmony_ci
7248c2ecf20Sopenharmony_ci#define FW_RI_FR_NSMR_WR_DCACPU_S	0
7258c2ecf20Sopenharmony_ci#define FW_RI_FR_NSMR_WR_DCACPU_M	0x1f
7268c2ecf20Sopenharmony_ci#define FW_RI_FR_NSMR_WR_DCACPU_V(x)	((x) << FW_RI_FR_NSMR_WR_DCACPU_S)
7278c2ecf20Sopenharmony_ci#define FW_RI_FR_NSMR_WR_DCACPU_G(x)	\
7288c2ecf20Sopenharmony_ci	(((x) >> FW_RI_FR_NSMR_WR_DCACPU_S) & FW_RI_FR_NSMR_WR_DCACPU_M)
7298c2ecf20Sopenharmony_ci
7308c2ecf20Sopenharmony_cistruct fw_ri_fr_nsmr_tpte_wr {
7318c2ecf20Sopenharmony_ci	__u8	opcode;
7328c2ecf20Sopenharmony_ci	__u8   flags;
7338c2ecf20Sopenharmony_ci	__u16  wrid;
7348c2ecf20Sopenharmony_ci	__u8   r1[3];
7358c2ecf20Sopenharmony_ci	__u8   len16;
7368c2ecf20Sopenharmony_ci	__be32  r2;
7378c2ecf20Sopenharmony_ci	__be32  stag;
7388c2ecf20Sopenharmony_ci	struct fw_ri_tpte tpte;
7398c2ecf20Sopenharmony_ci	__u64  pbl[2];
7408c2ecf20Sopenharmony_ci};
7418c2ecf20Sopenharmony_ci
7428c2ecf20Sopenharmony_cistruct fw_ri_inv_lstag_wr {
7438c2ecf20Sopenharmony_ci	__u8   opcode;
7448c2ecf20Sopenharmony_ci	__u8   flags;
7458c2ecf20Sopenharmony_ci	__u16  wrid;
7468c2ecf20Sopenharmony_ci	__u8   r1[3];
7478c2ecf20Sopenharmony_ci	__u8   len16;
7488c2ecf20Sopenharmony_ci	__be32 r2;
7498c2ecf20Sopenharmony_ci	__be32 stag_inv;
7508c2ecf20Sopenharmony_ci};
7518c2ecf20Sopenharmony_ci
7528c2ecf20Sopenharmony_cienum fw_ri_type {
7538c2ecf20Sopenharmony_ci	FW_RI_TYPE_INIT,
7548c2ecf20Sopenharmony_ci	FW_RI_TYPE_FINI,
7558c2ecf20Sopenharmony_ci	FW_RI_TYPE_TERMINATE
7568c2ecf20Sopenharmony_ci};
7578c2ecf20Sopenharmony_ci
7588c2ecf20Sopenharmony_cienum fw_ri_init_p2ptype {
7598c2ecf20Sopenharmony_ci	FW_RI_INIT_P2PTYPE_RDMA_WRITE		= FW_RI_RDMA_WRITE,
7608c2ecf20Sopenharmony_ci	FW_RI_INIT_P2PTYPE_READ_REQ		= FW_RI_READ_REQ,
7618c2ecf20Sopenharmony_ci	FW_RI_INIT_P2PTYPE_SEND			= FW_RI_SEND,
7628c2ecf20Sopenharmony_ci	FW_RI_INIT_P2PTYPE_SEND_WITH_INV	= FW_RI_SEND_WITH_INV,
7638c2ecf20Sopenharmony_ci	FW_RI_INIT_P2PTYPE_SEND_WITH_SE		= FW_RI_SEND_WITH_SE,
7648c2ecf20Sopenharmony_ci	FW_RI_INIT_P2PTYPE_SEND_WITH_SE_INV	= FW_RI_SEND_WITH_SE_INV,
7658c2ecf20Sopenharmony_ci	FW_RI_INIT_P2PTYPE_DISABLED		= 0xf,
7668c2ecf20Sopenharmony_ci};
7678c2ecf20Sopenharmony_ci
7688c2ecf20Sopenharmony_cienum fw_ri_init_rqeqid_srq {
7698c2ecf20Sopenharmony_ci	FW_RI_INIT_RQEQID_SRQ			= 1 << 31,
7708c2ecf20Sopenharmony_ci};
7718c2ecf20Sopenharmony_ci
7728c2ecf20Sopenharmony_cistruct fw_ri_wr {
7738c2ecf20Sopenharmony_ci	__be32 op_compl;
7748c2ecf20Sopenharmony_ci	__be32 flowid_len16;
7758c2ecf20Sopenharmony_ci	__u64  cookie;
7768c2ecf20Sopenharmony_ci	union fw_ri {
7778c2ecf20Sopenharmony_ci		struct fw_ri_init {
7788c2ecf20Sopenharmony_ci			__u8   type;
7798c2ecf20Sopenharmony_ci			__u8   mpareqbit_p2ptype;
7808c2ecf20Sopenharmony_ci			__u8   r4[2];
7818c2ecf20Sopenharmony_ci			__u8   mpa_attrs;
7828c2ecf20Sopenharmony_ci			__u8   qp_caps;
7838c2ecf20Sopenharmony_ci			__be16 nrqe;
7848c2ecf20Sopenharmony_ci			__be32 pdid;
7858c2ecf20Sopenharmony_ci			__be32 qpid;
7868c2ecf20Sopenharmony_ci			__be32 sq_eqid;
7878c2ecf20Sopenharmony_ci			__be32 rq_eqid;
7888c2ecf20Sopenharmony_ci			__be32 scqid;
7898c2ecf20Sopenharmony_ci			__be32 rcqid;
7908c2ecf20Sopenharmony_ci			__be32 ord_max;
7918c2ecf20Sopenharmony_ci			__be32 ird_max;
7928c2ecf20Sopenharmony_ci			__be32 iss;
7938c2ecf20Sopenharmony_ci			__be32 irs;
7948c2ecf20Sopenharmony_ci			__be32 hwrqsize;
7958c2ecf20Sopenharmony_ci			__be32 hwrqaddr;
7968c2ecf20Sopenharmony_ci			__be64 r5;
7978c2ecf20Sopenharmony_ci			union fw_ri_init_p2p {
7988c2ecf20Sopenharmony_ci				struct fw_ri_rdma_write_wr write;
7998c2ecf20Sopenharmony_ci				struct fw_ri_rdma_read_wr read;
8008c2ecf20Sopenharmony_ci				struct fw_ri_send_wr send;
8018c2ecf20Sopenharmony_ci			} u;
8028c2ecf20Sopenharmony_ci		} init;
8038c2ecf20Sopenharmony_ci		struct fw_ri_fini {
8048c2ecf20Sopenharmony_ci			__u8   type;
8058c2ecf20Sopenharmony_ci			__u8   r3[7];
8068c2ecf20Sopenharmony_ci			__be64 r4;
8078c2ecf20Sopenharmony_ci		} fini;
8088c2ecf20Sopenharmony_ci		struct fw_ri_terminate {
8098c2ecf20Sopenharmony_ci			__u8   type;
8108c2ecf20Sopenharmony_ci			__u8   r3[3];
8118c2ecf20Sopenharmony_ci			__be32 immdlen;
8128c2ecf20Sopenharmony_ci			__u8   termmsg[40];
8138c2ecf20Sopenharmony_ci		} terminate;
8148c2ecf20Sopenharmony_ci	} u;
8158c2ecf20Sopenharmony_ci};
8168c2ecf20Sopenharmony_ci
8178c2ecf20Sopenharmony_ci#define FW_RI_WR_MPAREQBIT_S	7
8188c2ecf20Sopenharmony_ci#define FW_RI_WR_MPAREQBIT_M	0x1
8198c2ecf20Sopenharmony_ci#define FW_RI_WR_MPAREQBIT_V(x)	((x) << FW_RI_WR_MPAREQBIT_S)
8208c2ecf20Sopenharmony_ci#define FW_RI_WR_MPAREQBIT_G(x)	\
8218c2ecf20Sopenharmony_ci	(((x) >> FW_RI_WR_MPAREQBIT_S) & FW_RI_WR_MPAREQBIT_M)
8228c2ecf20Sopenharmony_ci#define FW_RI_WR_MPAREQBIT_F	FW_RI_WR_MPAREQBIT_V(1U)
8238c2ecf20Sopenharmony_ci
8248c2ecf20Sopenharmony_ci#define FW_RI_WR_P2PTYPE_S	0
8258c2ecf20Sopenharmony_ci#define FW_RI_WR_P2PTYPE_M	0xf
8268c2ecf20Sopenharmony_ci#define FW_RI_WR_P2PTYPE_V(x)	((x) << FW_RI_WR_P2PTYPE_S)
8278c2ecf20Sopenharmony_ci#define FW_RI_WR_P2PTYPE_G(x)	\
8288c2ecf20Sopenharmony_ci	(((x) >> FW_RI_WR_P2PTYPE_S) & FW_RI_WR_P2PTYPE_M)
8298c2ecf20Sopenharmony_ci
8308c2ecf20Sopenharmony_ci#endif /* _T4FW_RI_API_H_ */
831