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