1 /* 2 * Copyright (c) 2017-2018 Cavium, Inc. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * 15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 * POSSIBILITY OF SUCH DAMAGE. 26 * 27 * $FreeBSD$ 28 * 29 */ 30 31 32 #ifndef __ISCSI_COMMON__ 33 #define __ISCSI_COMMON__ 34 /**********************/ 35 /* ISCSI FW CONSTANTS */ 36 /**********************/ 37 38 /* iSCSI HSI constants */ 39 #define ISCSI_DEFAULT_MTU (1500) 40 41 /* KWQ (kernel work queue) layer codes */ 42 #define ISCSI_SLOW_PATH_LAYER_CODE (6) 43 44 /* iSCSI parameter defaults */ 45 #define ISCSI_DEFAULT_HEADER_DIGEST (0) 46 #define ISCSI_DEFAULT_DATA_DIGEST (0) 47 #define ISCSI_DEFAULT_INITIAL_R2T (1) 48 #define ISCSI_DEFAULT_IMMEDIATE_DATA (1) 49 #define ISCSI_DEFAULT_MAX_PDU_LENGTH (0x2000) 50 #define ISCSI_DEFAULT_FIRST_BURST_LENGTH (0x10000) 51 #define ISCSI_DEFAULT_MAX_BURST_LENGTH (0x40000) 52 #define ISCSI_DEFAULT_MAX_OUTSTANDING_R2T (1) 53 54 /* iSCSI parameter limits */ 55 #define ISCSI_MIN_VAL_MAX_PDU_LENGTH (0x200) 56 #define ISCSI_MAX_VAL_MAX_PDU_LENGTH (0xffffff) 57 #define ISCSI_MIN_VAL_BURST_LENGTH (0x200) 58 #define ISCSI_MAX_VAL_BURST_LENGTH (0xffffff) 59 #define ISCSI_MIN_VAL_MAX_OUTSTANDING_R2T (1) 60 #define ISCSI_MAX_VAL_MAX_OUTSTANDING_R2T (0xff) // 0x10000 according to RFC 61 62 #define ISCSI_AHS_CNTL_SIZE 4 63 64 #define ISCSI_WQE_NUM_SGES_SLOWIO (0xf) 65 66 /* iSCSI reserved params */ 67 #define ISCSI_ITT_ALL_ONES (0xffffffff) 68 #define ISCSI_TTT_ALL_ONES (0xffffffff) 69 70 #define ISCSI_OPTION_1_OFF_CHIP_TCP 1 71 #define ISCSI_OPTION_2_ON_CHIP_TCP 2 72 73 #define ISCSI_INITIATOR_MODE 0 74 #define ISCSI_TARGET_MODE 1 75 76 77 /* iSCSI request op codes */ 78 #define ISCSI_OPCODE_NOP_OUT (0) 79 #define ISCSI_OPCODE_SCSI_CMD (1) 80 #define ISCSI_OPCODE_TMF_REQUEST (2) 81 #define ISCSI_OPCODE_LOGIN_REQUEST (3) 82 #define ISCSI_OPCODE_TEXT_REQUEST (4) 83 #define ISCSI_OPCODE_DATA_OUT (5) 84 #define ISCSI_OPCODE_LOGOUT_REQUEST (6) 85 86 /* iSCSI response/messages op codes */ 87 #define ISCSI_OPCODE_NOP_IN (0x20) 88 #define ISCSI_OPCODE_SCSI_RESPONSE (0x21) 89 #define ISCSI_OPCODE_TMF_RESPONSE (0x22) 90 #define ISCSI_OPCODE_LOGIN_RESPONSE (0x23) 91 #define ISCSI_OPCODE_TEXT_RESPONSE (0x24) 92 #define ISCSI_OPCODE_DATA_IN (0x25) 93 #define ISCSI_OPCODE_LOGOUT_RESPONSE (0x26) 94 #define ISCSI_OPCODE_R2T (0x31) 95 #define ISCSI_OPCODE_ASYNC_MSG (0x32) 96 #define ISCSI_OPCODE_REJECT (0x3f) 97 98 /* iSCSI stages */ 99 #define ISCSI_STAGE_SECURITY_NEGOTIATION (0) 100 #define ISCSI_STAGE_LOGIN_OPERATIONAL_NEGOTIATION (1) 101 #define ISCSI_STAGE_FULL_FEATURE_PHASE (3) 102 103 /* iSCSI CQE errors */ 104 #define CQE_ERROR_BITMAP_DATA_DIGEST (0x08) 105 #define CQE_ERROR_BITMAP_RCV_ON_INVALID_CONN (0x10) 106 #define CQE_ERROR_BITMAP_DATA_TRUNCATED (0x20) 107 108 109 /* 110 * Union of data bd_opaque/ tq_tid 111 */ 112 union bd_opaque_tq_union 113 { 114 __le16 bd_opaque /* BDs opaque data */; 115 __le16 tq_tid /* Immediate Data with DIF TQe TID */; 116 }; 117 118 119 /* 120 * ISCSI SGL entry 121 */ 122 struct cqe_error_bitmap 123 { 124 u8 cqe_error_status_bits; 125 #define CQE_ERROR_BITMAP_DIF_ERR_BITS_MASK 0x7 /* Mark task with DIF error (3 bit): [0]-CRC/checksum, [1]-app tag, [2]-reference tag */ 126 #define CQE_ERROR_BITMAP_DIF_ERR_BITS_SHIFT 0 127 #define CQE_ERROR_BITMAP_DATA_DIGEST_ERR_MASK 0x1 /* Mark task with data digest error (1 bit) */ 128 #define CQE_ERROR_BITMAP_DATA_DIGEST_ERR_SHIFT 3 129 #define CQE_ERROR_BITMAP_RCV_ON_INVALID_CONN_MASK 0x1 /* Mark receive on invalid connection */ 130 #define CQE_ERROR_BITMAP_RCV_ON_INVALID_CONN_SHIFT 4 131 #define CQE_ERROR_BITMAP_DATA_TRUNCATED_ERR_MASK 0x1 /* Target Mode - Mark middle task error, data truncated */ 132 #define CQE_ERROR_BITMAP_DATA_TRUNCATED_ERR_SHIFT 5 133 #define CQE_ERROR_BITMAP_UNDER_RUN_ERR_MASK 0x1 134 #define CQE_ERROR_BITMAP_UNDER_RUN_ERR_SHIFT 6 135 #define CQE_ERROR_BITMAP_RESERVED2_MASK 0x1 136 #define CQE_ERROR_BITMAP_RESERVED2_SHIFT 7 137 }; 138 139 140 union cqe_error_status 141 { 142 u8 error_status /* all error bits as uint8 */; 143 struct cqe_error_bitmap error_bits /* cqe errors bitmap */; 144 }; 145 146 147 /* 148 * iSCSI Login Response PDU header 149 */ 150 struct data_hdr 151 { 152 __le32 data[12] /* iscsi header data */; 153 }; 154 155 156 struct lun_mapper_addr_reserved 157 { 158 struct regpair lun_mapper_addr /* Lun mapper address */; 159 u8 reserved0[8]; 160 }; 161 162 /* 163 * rdif conetxt for dif on immediate 164 */ 165 struct dif_on_immediate_params 166 { 167 __le32 initial_ref_tag; 168 __le16 application_tag; 169 __le16 application_tag_mask; 170 __le16 flags1; 171 #define DIF_ON_IMMEDIATE_PARAMS_VALIDATE_GUARD_MASK 0x1 172 #define DIF_ON_IMMEDIATE_PARAMS_VALIDATE_GUARD_SHIFT 0 173 #define DIF_ON_IMMEDIATE_PARAMS_VALIDATE_APP_TAG_MASK 0x1 174 #define DIF_ON_IMMEDIATE_PARAMS_VALIDATE_APP_TAG_SHIFT 1 175 #define DIF_ON_IMMEDIATE_PARAMS_VALIDATE_REF_TAG_MASK 0x1 176 #define DIF_ON_IMMEDIATE_PARAMS_VALIDATE_REF_TAG_SHIFT 2 177 #define DIF_ON_IMMEDIATE_PARAMS_FORWARD_GUARD_MASK 0x1 178 #define DIF_ON_IMMEDIATE_PARAMS_FORWARD_GUARD_SHIFT 3 179 #define DIF_ON_IMMEDIATE_PARAMS_FORWARD_APP_TAG_MASK 0x1 180 #define DIF_ON_IMMEDIATE_PARAMS_FORWARD_APP_TAG_SHIFT 4 181 #define DIF_ON_IMMEDIATE_PARAMS_FORWARD_REF_TAG_MASK 0x1 182 #define DIF_ON_IMMEDIATE_PARAMS_FORWARD_REF_TAG_SHIFT 5 183 #define DIF_ON_IMMEDIATE_PARAMS_INTERVAL_SIZE_MASK 0x1 /* 0=512B, 1=4KB */ 184 #define DIF_ON_IMMEDIATE_PARAMS_INTERVAL_SIZE_SHIFT 6 185 #define DIF_ON_IMMEDIATE_PARAMS_NETWORK_INTERFACE_MASK 0x1 /* 0=None, 1=DIF */ 186 #define DIF_ON_IMMEDIATE_PARAMS_NETWORK_INTERFACE_SHIFT 7 187 #define DIF_ON_IMMEDIATE_PARAMS_HOST_INTERFACE_MASK 0x3 /* 0=None, 1=DIF, 2=DIX */ 188 #define DIF_ON_IMMEDIATE_PARAMS_HOST_INTERFACE_SHIFT 8 189 #define DIF_ON_IMMEDIATE_PARAMS_REF_TAG_MASK_MASK 0xF /* mask for refernce tag handling */ 190 #define DIF_ON_IMMEDIATE_PARAMS_REF_TAG_MASK_SHIFT 10 191 #define DIF_ON_IMMEDIATE_PARAMS_FORWARD_APP_TAG_WITH_MASK_MASK 0x1 /* Forward application tag with mask */ 192 #define DIF_ON_IMMEDIATE_PARAMS_FORWARD_APP_TAG_WITH_MASK_SHIFT 14 193 #define DIF_ON_IMMEDIATE_PARAMS_FORWARD_REF_TAG_WITH_MASK_MASK 0x1 /* Forward reference tag with mask */ 194 #define DIF_ON_IMMEDIATE_PARAMS_FORWARD_REF_TAG_WITH_MASK_SHIFT 15 195 u8 flags0; 196 #define DIF_ON_IMMEDIATE_PARAMS_RESERVED_MASK 0x1 197 #define DIF_ON_IMMEDIATE_PARAMS_RESERVED_SHIFT 0 198 #define DIF_ON_IMMEDIATE_PARAMS_IGNORE_APP_TAG_MASK 0x1 199 #define DIF_ON_IMMEDIATE_PARAMS_IGNORE_APP_TAG_SHIFT 1 200 #define DIF_ON_IMMEDIATE_PARAMS_INITIAL_REF_TAG_IS_VALID_MASK 0x1 201 #define DIF_ON_IMMEDIATE_PARAMS_INITIAL_REF_TAG_IS_VALID_SHIFT 2 202 #define DIF_ON_IMMEDIATE_PARAMS_HOST_GUARD_TYPE_MASK 0x1 /* 0 = IP checksum, 1 = CRC */ 203 #define DIF_ON_IMMEDIATE_PARAMS_HOST_GUARD_TYPE_SHIFT 3 204 #define DIF_ON_IMMEDIATE_PARAMS_PROTECTION_TYPE_MASK 0x3 /* 1/2/3 - Protection Type */ 205 #define DIF_ON_IMMEDIATE_PARAMS_PROTECTION_TYPE_SHIFT 4 206 #define DIF_ON_IMMEDIATE_PARAMS_CRC_SEED_MASK 0x1 /* 0=0x0000, 1=0xffff */ 207 #define DIF_ON_IMMEDIATE_PARAMS_CRC_SEED_SHIFT 6 208 #define DIF_ON_IMMEDIATE_PARAMS_KEEP_REF_TAG_CONST_MASK 0x1 /* Keep reference tag constant */ 209 #define DIF_ON_IMMEDIATE_PARAMS_KEEP_REF_TAG_CONST_SHIFT 7 210 u8 reserved_zero[5]; 211 }; 212 213 /* 214 * iSCSI dif on immediate mode attributes union 215 */ 216 union dif_configuration_params 217 { 218 struct lun_mapper_addr_reserved lun_mapper_address /* lun mapper address */; 219 struct dif_on_immediate_params def_dif_conf /* default dif on immediate rdif configuration */; 220 }; 221 222 223 224 /* 225 * Union of data/r2t sequence number 226 */ 227 union iscsi_seq_num 228 { 229 __le16 data_sn /* data-in sequence number */; 230 __le16 r2t_sn /* r2t pdu sequence number */; 231 }; 232 233 /* 234 * iSCSI DIF flags 235 */ 236 struct iscsi_dif_flags 237 { 238 u8 flags; 239 #define ISCSI_DIF_FLAGS_PROT_INTERVAL_SIZE_LOG_MASK 0xF /* Protection log interval (9=512 10=1024 11=2048 12=4096 13=8192) */ 240 #define ISCSI_DIF_FLAGS_PROT_INTERVAL_SIZE_LOG_SHIFT 0 241 #define ISCSI_DIF_FLAGS_DIF_TO_PEER_MASK 0x1 /* If DIF protection is configured against target (0=no, 1=yes) */ 242 #define ISCSI_DIF_FLAGS_DIF_TO_PEER_SHIFT 4 243 #define ISCSI_DIF_FLAGS_HOST_INTERFACE_MASK 0x7 /* If DIF/DIX protection is configured against the host (0=none, 1=DIF, 2=DIX 2 bytes, 3=DIX 4 bytes, 4=DIX 8 bytes) */ 244 #define ISCSI_DIF_FLAGS_HOST_INTERFACE_SHIFT 5 245 }; 246 247 /* 248 * The iscsi storm task context of Ystorm 249 */ 250 struct ystorm_iscsi_task_state 251 { 252 struct scsi_cached_sges data_desc; 253 struct scsi_sgl_params sgl_params; 254 __le32 exp_r2t_sn /* Initiator mode - Expected R2T PDU index in sequence. [variable, initialized 0] */; 255 __le32 buffer_offset /* Payload data offset */; 256 union iscsi_seq_num seq_num /* PDU index in sequence */; 257 struct iscsi_dif_flags dif_flags /* Dif flags */; 258 u8 flags; 259 #define YSTORM_ISCSI_TASK_STATE_LOCAL_COMP_MASK 0x1 /* local_completion */ 260 #define YSTORM_ISCSI_TASK_STATE_LOCAL_COMP_SHIFT 0 261 #define YSTORM_ISCSI_TASK_STATE_SLOW_IO_MASK 0x1 /* Equals 1 if SGL is predicted and 0 otherwise. */ 262 #define YSTORM_ISCSI_TASK_STATE_SLOW_IO_SHIFT 1 263 #define YSTORM_ISCSI_TASK_STATE_RESERVED0_MASK 0x3F 264 #define YSTORM_ISCSI_TASK_STATE_RESERVED0_SHIFT 2 265 }; 266 267 /* 268 * The iscsi storm task context of Ystorm 269 */ 270 struct ystorm_iscsi_task_rxmit_opt 271 { 272 __le32 fast_rxmit_sge_offset /* SGE offset from which to continue dummy-read or start fast retransmit */; 273 __le32 scan_start_buffer_offset /* Starting buffer offset of next retransmit SGL scan */; 274 __le32 fast_rxmit_buffer_offset /* Buffer offset from which to continue dummy-read or start fast retransmit */; 275 u8 scan_start_sgl_index /* Starting SGL index of next retransmit SGL scan */; 276 u8 fast_rxmit_sgl_index /* SGL index from which to continue dummy-read or start fast retransmit */; 277 __le16 reserved /* reserved */; 278 }; 279 280 /* 281 * iSCSI Common PDU header 282 */ 283 struct iscsi_common_hdr 284 { 285 u8 hdr_status /* Status field of ISCSI header */; 286 u8 hdr_response /* Response field of ISCSI header for Responses / Reserved for Data-In */; 287 u8 hdr_flags /* Flags field of ISCSI header */; 288 u8 hdr_first_byte; 289 #define ISCSI_COMMON_HDR_OPCODE_MASK 0x3F /* Opcode */ 290 #define ISCSI_COMMON_HDR_OPCODE_SHIFT 0 291 #define ISCSI_COMMON_HDR_IMM_MASK 0x1 /* Immediate */ 292 #define ISCSI_COMMON_HDR_IMM_SHIFT 6 293 #define ISCSI_COMMON_HDR_RSRV_MASK 0x1 /* first bit of iSCSI PDU header */ 294 #define ISCSI_COMMON_HDR_RSRV_SHIFT 7 295 __le32 hdr_second_dword; 296 #define ISCSI_COMMON_HDR_DATA_SEG_LEN_MASK 0xFFFFFF /* DataSegmentLength */ 297 #define ISCSI_COMMON_HDR_DATA_SEG_LEN_SHIFT 0 298 #define ISCSI_COMMON_HDR_TOTAL_AHS_LEN_MASK 0xFF /* TotalAHSLength */ 299 #define ISCSI_COMMON_HDR_TOTAL_AHS_LEN_SHIFT 24 300 struct regpair lun_reserved /* Bytes 8..15 : LUN (if PDU contains a LUN field) or reserved */; 301 __le32 itt /* ITT - common to all headers */; 302 __le32 ttt /* bytes 20 to 23 - common ttt to various PDU headers */; 303 __le32 cmdstat_sn /* bytes 24 to 27 - common cmd_sn (initiator) or stat_sn (target) to various PDU headers */; 304 __le32 exp_statcmd_sn /* bytes 28 to 31 - common expected stat_sn (initiator) or cmd_sn (target) to various PDU headers */; 305 __le32 max_cmd_sn /* bytes 32 to 35 - common max cmd_sn to various PDU headers */; 306 __le32 data[3] /* bytes 36 to 47 */; 307 }; 308 309 /* 310 * iSCSI Command PDU header 311 */ 312 struct iscsi_cmd_hdr 313 { 314 __le16 reserved1 /* reserved */; 315 u8 flags_attr; 316 #define ISCSI_CMD_HDR_ATTR_MASK 0x7 /* attributes */ 317 #define ISCSI_CMD_HDR_ATTR_SHIFT 0 318 #define ISCSI_CMD_HDR_RSRV_MASK 0x3 /* reserved */ 319 #define ISCSI_CMD_HDR_RSRV_SHIFT 3 320 #define ISCSI_CMD_HDR_WRITE_MASK 0x1 /* write */ 321 #define ISCSI_CMD_HDR_WRITE_SHIFT 5 322 #define ISCSI_CMD_HDR_READ_MASK 0x1 /* read */ 323 #define ISCSI_CMD_HDR_READ_SHIFT 6 324 #define ISCSI_CMD_HDR_FINAL_MASK 0x1 /* final */ 325 #define ISCSI_CMD_HDR_FINAL_SHIFT 7 326 u8 hdr_first_byte; 327 #define ISCSI_CMD_HDR_OPCODE_MASK 0x3F /* Opcode */ 328 #define ISCSI_CMD_HDR_OPCODE_SHIFT 0 329 #define ISCSI_CMD_HDR_IMM_MASK 0x1 /* Immediate delivery */ 330 #define ISCSI_CMD_HDR_IMM_SHIFT 6 331 #define ISCSI_CMD_HDR_RSRV1_MASK 0x1 /* first bit of iSCSI PDU header */ 332 #define ISCSI_CMD_HDR_RSRV1_SHIFT 7 333 __le32 hdr_second_dword; 334 #define ISCSI_CMD_HDR_DATA_SEG_LEN_MASK 0xFFFFFF /* DataSegmentLength */ 335 #define ISCSI_CMD_HDR_DATA_SEG_LEN_SHIFT 0 336 #define ISCSI_CMD_HDR_TOTAL_AHS_LEN_MASK 0xFF /* TotalAHSLength */ 337 #define ISCSI_CMD_HDR_TOTAL_AHS_LEN_SHIFT 24 338 struct regpair lun /* Logical Unit Number. [constant, initialized] */; 339 __le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */; 340 __le32 expected_transfer_length /* Expected Data Transfer Length (only 3 bytes are significant) */; 341 __le32 cmd_sn /* CmdSn. [constant, initialized] */; 342 __le32 exp_stat_sn /* various fields for middle-path PDU. [constant, initialized] */; 343 __le32 cdb[4] /* CDB. [constant, initialized] */; 344 }; 345 346 /* 347 * iSCSI Command PDU header with Extended CDB (Initiator Mode) 348 */ 349 struct iscsi_ext_cdb_cmd_hdr 350 { 351 __le16 reserved1 /* reserved */; 352 u8 flags_attr; 353 #define ISCSI_EXT_CDB_CMD_HDR_ATTR_MASK 0x7 /* attributes */ 354 #define ISCSI_EXT_CDB_CMD_HDR_ATTR_SHIFT 0 355 #define ISCSI_EXT_CDB_CMD_HDR_RSRV_MASK 0x3 /* reserved */ 356 #define ISCSI_EXT_CDB_CMD_HDR_RSRV_SHIFT 3 357 #define ISCSI_EXT_CDB_CMD_HDR_WRITE_MASK 0x1 /* write */ 358 #define ISCSI_EXT_CDB_CMD_HDR_WRITE_SHIFT 5 359 #define ISCSI_EXT_CDB_CMD_HDR_READ_MASK 0x1 /* read */ 360 #define ISCSI_EXT_CDB_CMD_HDR_READ_SHIFT 6 361 #define ISCSI_EXT_CDB_CMD_HDR_FINAL_MASK 0x1 /* final */ 362 #define ISCSI_EXT_CDB_CMD_HDR_FINAL_SHIFT 7 363 u8 opcode /* opcode. [constant, initialized] */; 364 __le32 hdr_second_dword; 365 #define ISCSI_EXT_CDB_CMD_HDR_DATA_SEG_LEN_MASK 0xFFFFFF /* DataSegmentLength */ 366 #define ISCSI_EXT_CDB_CMD_HDR_DATA_SEG_LEN_SHIFT 0 367 #define ISCSI_EXT_CDB_CMD_HDR_CDB_SIZE_MASK 0xFF /* The Extended CDB size in bytes. Maximum Extended CDB size supported is CDB 64B. */ 368 #define ISCSI_EXT_CDB_CMD_HDR_CDB_SIZE_SHIFT 24 369 struct regpair lun /* Logical Unit Number. [constant, initialized] */; 370 __le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */; 371 __le32 expected_transfer_length /* Expected Data Transfer Length (only 3 bytes are significant) */; 372 __le32 cmd_sn /* CmdSn. [constant, initialized] */; 373 __le32 exp_stat_sn /* various fields for middle-path PDU. [constant, initialized] */; 374 struct scsi_sge cdb_sge /* Extended CDBs dedicated SGE */; 375 }; 376 377 /* 378 * iSCSI login request PDU header 379 */ 380 struct iscsi_login_req_hdr 381 { 382 u8 version_min /* Version-min */; 383 u8 version_max /* Version-max */; 384 u8 flags_attr; 385 #define ISCSI_LOGIN_REQ_HDR_NSG_MASK 0x3 /* Next Stage (NSG) */ 386 #define ISCSI_LOGIN_REQ_HDR_NSG_SHIFT 0 387 #define ISCSI_LOGIN_REQ_HDR_CSG_MASK 0x3 /* Current stage (CSG) */ 388 #define ISCSI_LOGIN_REQ_HDR_CSG_SHIFT 2 389 #define ISCSI_LOGIN_REQ_HDR_RSRV_MASK 0x3 /* reserved */ 390 #define ISCSI_LOGIN_REQ_HDR_RSRV_SHIFT 4 391 #define ISCSI_LOGIN_REQ_HDR_C_MASK 0x1 /* C (Continue) bit */ 392 #define ISCSI_LOGIN_REQ_HDR_C_SHIFT 6 393 #define ISCSI_LOGIN_REQ_HDR_T_MASK 0x1 /* T (Transit) bit */ 394 #define ISCSI_LOGIN_REQ_HDR_T_SHIFT 7 395 u8 opcode /* opcode. [constant, initialized] */; 396 __le32 hdr_second_dword; 397 #define ISCSI_LOGIN_REQ_HDR_DATA_SEG_LEN_MASK 0xFFFFFF /* DataSegmentLength */ 398 #define ISCSI_LOGIN_REQ_HDR_DATA_SEG_LEN_SHIFT 0 399 #define ISCSI_LOGIN_REQ_HDR_TOTAL_AHS_LEN_MASK 0xFF /* TotalAHSLength */ 400 #define ISCSI_LOGIN_REQ_HDR_TOTAL_AHS_LEN_SHIFT 24 401 __le32 isid_tabc /* Session identifier high double word [constant, initialized] */; 402 __le16 tsih /* TSIH */; 403 __le16 isid_d /* Session identifier low word [constant, initialized] */; 404 __le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */; 405 __le16 reserved1; 406 __le16 cid /* Unique Connection ID within the session [constant, initialized] */; 407 __le32 cmd_sn /* CmdSn. [constant, initialized] */; 408 __le32 exp_stat_sn /* various fields for middle-path PDU. [constant, initialized] */; 409 __le32 reserved2[4]; 410 }; 411 412 /* 413 * iSCSI logout request PDU header 414 */ 415 struct iscsi_logout_req_hdr 416 { 417 __le16 reserved0 /* reserved */; 418 u8 reason_code /* Reason Code */; 419 u8 opcode /* opcode. [constant, initialized] */; 420 __le32 reserved1; 421 __le32 reserved2[2] /* Reserved */; 422 __le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */; 423 __le16 reserved3 /* Reserved */; 424 __le16 cid /* Unique Connection ID within the session [constant, initialized] */; 425 __le32 cmd_sn /* CmdSn. [constant, initialized] */; 426 __le32 exp_stat_sn /* various fields for middle-path PDU. [constant, initialized] */; 427 __le32 reserved4[4] /* Reserved */; 428 }; 429 430 /* 431 * iSCSI Data-out PDU header 432 */ 433 struct iscsi_data_out_hdr 434 { 435 __le16 reserved1 /* reserved */; 436 u8 flags_attr; 437 #define ISCSI_DATA_OUT_HDR_RSRV_MASK 0x7F /* reserved */ 438 #define ISCSI_DATA_OUT_HDR_RSRV_SHIFT 0 439 #define ISCSI_DATA_OUT_HDR_FINAL_MASK 0x1 /* final */ 440 #define ISCSI_DATA_OUT_HDR_FINAL_SHIFT 7 441 u8 opcode /* opcode */; 442 __le32 reserved2 /* reserved */; 443 struct regpair lun /* Logical Unit Number */; 444 __le32 itt /* Initiator Task Tag (only 2 bytes are significant) */; 445 __le32 ttt /* Target Transfer Tag (from R2T) */; 446 __le32 reserved3 /* resrved */; 447 __le32 exp_stat_sn /* Expected StatSn */; 448 __le32 reserved4 /* resrved */; 449 __le32 data_sn /* DataSN - PDU index in sequnece */; 450 __le32 buffer_offset /* Buffer Offset - offset in task */; 451 __le32 reserved5 /* resrved */; 452 }; 453 454 /* 455 * iSCSI Data-in PDU header 456 */ 457 struct iscsi_data_in_hdr 458 { 459 u8 status_rsvd /* Status or reserved */; 460 u8 reserved1 /* reserved */; 461 u8 flags; 462 #define ISCSI_DATA_IN_HDR_STATUS_MASK 0x1 /* Status */ 463 #define ISCSI_DATA_IN_HDR_STATUS_SHIFT 0 464 #define ISCSI_DATA_IN_HDR_UNDERFLOW_MASK 0x1 /* Residual Underflow */ 465 #define ISCSI_DATA_IN_HDR_UNDERFLOW_SHIFT 1 466 #define ISCSI_DATA_IN_HDR_OVERFLOW_MASK 0x1 /* Residual Overflow */ 467 #define ISCSI_DATA_IN_HDR_OVERFLOW_SHIFT 2 468 #define ISCSI_DATA_IN_HDR_RSRV_MASK 0x7 /* reserved - 0 */ 469 #define ISCSI_DATA_IN_HDR_RSRV_SHIFT 3 470 #define ISCSI_DATA_IN_HDR_ACK_MASK 0x1 /* Acknowledge */ 471 #define ISCSI_DATA_IN_HDR_ACK_SHIFT 6 472 #define ISCSI_DATA_IN_HDR_FINAL_MASK 0x1 /* final */ 473 #define ISCSI_DATA_IN_HDR_FINAL_SHIFT 7 474 u8 opcode /* opcode */; 475 __le32 reserved2 /* reserved */; 476 struct regpair lun /* Logical Unit Number */; 477 __le32 itt /* Initiator Task Tag (only 2 bytes are significant) */; 478 __le32 ttt /* Target Transfer Tag (from R2T) */; 479 __le32 stat_sn /* StatSN or reserved */; 480 __le32 exp_cmd_sn /* Expected CmdSn */; 481 __le32 max_cmd_sn /* MaxCmdSn */; 482 __le32 data_sn /* DataSN - PDU index in sequnece */; 483 __le32 buffer_offset /* Buffer Offset - offset in task */; 484 __le32 residual_count /* Residual Count */; 485 }; 486 487 /* 488 * iSCSI R2T PDU header 489 */ 490 struct iscsi_r2t_hdr 491 { 492 u8 reserved0[3] /* reserved */; 493 u8 opcode /* opcode */; 494 __le32 reserved2 /* reserved */; 495 struct regpair lun /* Logical Unit Number */; 496 __le32 itt /* Initiator Task Tag */; 497 __le32 ttt /* Target Transfer Tag */; 498 __le32 stat_sn /* stat sn */; 499 __le32 exp_cmd_sn /* Expected CmdSn */; 500 __le32 max_cmd_sn /* Max CmdSn */; 501 __le32 r2t_sn /* DataSN - PDU index in sequnece */; 502 __le32 buffer_offset /* Buffer Offset - offset in task */; 503 __le32 desired_data_trns_len /* Desired data trnsfer len */; 504 }; 505 506 /* 507 * iSCSI NOP-out PDU header 508 */ 509 struct iscsi_nop_out_hdr 510 { 511 __le16 reserved1 /* reserved */; 512 u8 flags_attr; 513 #define ISCSI_NOP_OUT_HDR_RSRV_MASK 0x7F /* reserved */ 514 #define ISCSI_NOP_OUT_HDR_RSRV_SHIFT 0 515 #define ISCSI_NOP_OUT_HDR_CONST1_MASK 0x1 /* const1 */ 516 #define ISCSI_NOP_OUT_HDR_CONST1_SHIFT 7 517 u8 opcode /* opcode */; 518 __le32 reserved2 /* reserved */; 519 struct regpair lun /* Logical Unit Number */; 520 __le32 itt /* Initiator Task Tag (only 2 bytes are significant) */; 521 __le32 ttt /* Target Transfer Tag (from R2T) */; 522 __le32 cmd_sn /* CmdSN */; 523 __le32 exp_stat_sn /* Expected StatSn */; 524 __le32 reserved3 /* reserved */; 525 __le32 reserved4 /* reserved */; 526 __le32 reserved5 /* reserved */; 527 __le32 reserved6 /* reserved */; 528 }; 529 530 /* 531 * iSCSI NOP-in PDU header 532 */ 533 struct iscsi_nop_in_hdr 534 { 535 __le16 reserved0 /* reserved */; 536 u8 flags_attr; 537 #define ISCSI_NOP_IN_HDR_RSRV_MASK 0x7F /* reserved */ 538 #define ISCSI_NOP_IN_HDR_RSRV_SHIFT 0 539 #define ISCSI_NOP_IN_HDR_CONST1_MASK 0x1 /* const1 */ 540 #define ISCSI_NOP_IN_HDR_CONST1_SHIFT 7 541 u8 opcode /* opcode */; 542 __le32 hdr_second_dword; 543 #define ISCSI_NOP_IN_HDR_DATA_SEG_LEN_MASK 0xFFFFFF /* DataSegmentLength */ 544 #define ISCSI_NOP_IN_HDR_DATA_SEG_LEN_SHIFT 0 545 #define ISCSI_NOP_IN_HDR_TOTAL_AHS_LEN_MASK 0xFF /* TotalAHSLength */ 546 #define ISCSI_NOP_IN_HDR_TOTAL_AHS_LEN_SHIFT 24 547 struct regpair lun /* Logical Unit Number */; 548 __le32 itt /* Initiator Task Tag (only 2 bytes are significant) */; 549 __le32 ttt /* Target Transfer Tag */; 550 __le32 stat_sn /* stat_sn */; 551 __le32 exp_cmd_sn /* exp_cmd_sn */; 552 __le32 max_cmd_sn /* max_cmd_sn */; 553 __le32 reserved5 /* reserved */; 554 __le32 reserved6 /* reserved */; 555 __le32 reserved7 /* reserved */; 556 }; 557 558 /* 559 * iSCSI Login Response PDU header 560 */ 561 struct iscsi_login_response_hdr 562 { 563 u8 version_active /* Version-active */; 564 u8 version_max /* Version-max */; 565 u8 flags_attr; 566 #define ISCSI_LOGIN_RESPONSE_HDR_NSG_MASK 0x3 /* Next Stage (NSG) */ 567 #define ISCSI_LOGIN_RESPONSE_HDR_NSG_SHIFT 0 568 #define ISCSI_LOGIN_RESPONSE_HDR_CSG_MASK 0x3 /* Current stage (CSG) */ 569 #define ISCSI_LOGIN_RESPONSE_HDR_CSG_SHIFT 2 570 #define ISCSI_LOGIN_RESPONSE_HDR_RSRV_MASK 0x3 /* reserved */ 571 #define ISCSI_LOGIN_RESPONSE_HDR_RSRV_SHIFT 4 572 #define ISCSI_LOGIN_RESPONSE_HDR_C_MASK 0x1 /* C (Continue) bit */ 573 #define ISCSI_LOGIN_RESPONSE_HDR_C_SHIFT 6 574 #define ISCSI_LOGIN_RESPONSE_HDR_T_MASK 0x1 /* T (Transit) bit */ 575 #define ISCSI_LOGIN_RESPONSE_HDR_T_SHIFT 7 576 u8 opcode /* opcode. [constant, initialized] */; 577 __le32 hdr_second_dword; 578 #define ISCSI_LOGIN_RESPONSE_HDR_DATA_SEG_LEN_MASK 0xFFFFFF /* DataSegmentLength */ 579 #define ISCSI_LOGIN_RESPONSE_HDR_DATA_SEG_LEN_SHIFT 0 580 #define ISCSI_LOGIN_RESPONSE_HDR_TOTAL_AHS_LEN_MASK 0xFF /* TotalAHSLength */ 581 #define ISCSI_LOGIN_RESPONSE_HDR_TOTAL_AHS_LEN_SHIFT 24 582 __le32 isid_tabc /* Session identifier high double word [constant, initialized] */; 583 __le16 tsih /* TSIH */; 584 __le16 isid_d /* Session identifier low word [constant, initialized] */; 585 __le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */; 586 __le32 reserved1; 587 __le32 stat_sn /* CmdSn. [constant, initialized] */; 588 __le32 exp_cmd_sn /* various fields for middle-path PDU. [constant, initialized] */; 589 __le32 max_cmd_sn /* max_cmd_sn */; 590 __le16 reserved2; 591 u8 status_detail /* status_detail */; 592 u8 status_class /* status_class */; 593 __le32 reserved4[2]; 594 }; 595 596 /* 597 * iSCSI Logout Response PDU header 598 */ 599 struct iscsi_logout_response_hdr 600 { 601 u8 reserved1 /* reserved */; 602 u8 response /* response */; 603 u8 flags /* flags and attributes */; 604 u8 opcode /* opcode. [constant, initialized] */; 605 __le32 hdr_second_dword; 606 #define ISCSI_LOGOUT_RESPONSE_HDR_DATA_SEG_LEN_MASK 0xFFFFFF /* DataSegmentLength */ 607 #define ISCSI_LOGOUT_RESPONSE_HDR_DATA_SEG_LEN_SHIFT 0 608 #define ISCSI_LOGOUT_RESPONSE_HDR_TOTAL_AHS_LEN_MASK 0xFF /* TotalAHSLength */ 609 #define ISCSI_LOGOUT_RESPONSE_HDR_TOTAL_AHS_LEN_SHIFT 24 610 __le32 reserved2[2] /* Reserved */; 611 __le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */; 612 __le32 reserved3 /* Reserved */; 613 __le32 stat_sn /* CmdSN */; 614 __le32 exp_cmd_sn /* Expected StatSn */; 615 __le32 max_cmd_sn /* CmdSN */; 616 __le32 reserved4 /* Reserved */; 617 __le16 time_2_retain /* Time to Retain */; 618 __le16 time_2_wait /* Time to wait */; 619 __le32 reserved5[1] /* Reserved */; 620 }; 621 622 /* 623 * iSCSI Text Request PDU header 624 */ 625 struct iscsi_text_request_hdr 626 { 627 __le16 reserved0 /* reserved */; 628 u8 flags_attr; 629 #define ISCSI_TEXT_REQUEST_HDR_RSRV_MASK 0x3F /* reserved */ 630 #define ISCSI_TEXT_REQUEST_HDR_RSRV_SHIFT 0 631 #define ISCSI_TEXT_REQUEST_HDR_C_MASK 0x1 /* C (Continue) bit */ 632 #define ISCSI_TEXT_REQUEST_HDR_C_SHIFT 6 633 #define ISCSI_TEXT_REQUEST_HDR_F_MASK 0x1 /* F (Final) bit */ 634 #define ISCSI_TEXT_REQUEST_HDR_F_SHIFT 7 635 u8 opcode /* opcode. [constant, initialized] */; 636 __le32 hdr_second_dword; 637 #define ISCSI_TEXT_REQUEST_HDR_DATA_SEG_LEN_MASK 0xFFFFFF /* DataSegmentLength */ 638 #define ISCSI_TEXT_REQUEST_HDR_DATA_SEG_LEN_SHIFT 0 639 #define ISCSI_TEXT_REQUEST_HDR_TOTAL_AHS_LEN_MASK 0xFF /* TotalAHSLength */ 640 #define ISCSI_TEXT_REQUEST_HDR_TOTAL_AHS_LEN_SHIFT 24 641 struct regpair lun /* Logical Unit Number */; 642 __le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */; 643 __le32 ttt /* Referenced Task Tag or 0xffffffff */; 644 __le32 cmd_sn /* cmd_sn */; 645 __le32 exp_stat_sn /* exp_stat_sn */; 646 __le32 reserved4[4] /* Reserved */; 647 }; 648 649 /* 650 * iSCSI Text Response PDU header 651 */ 652 struct iscsi_text_response_hdr 653 { 654 __le16 reserved1 /* reserved */; 655 u8 flags; 656 #define ISCSI_TEXT_RESPONSE_HDR_RSRV_MASK 0x3F /* reserved */ 657 #define ISCSI_TEXT_RESPONSE_HDR_RSRV_SHIFT 0 658 #define ISCSI_TEXT_RESPONSE_HDR_C_MASK 0x1 /* C (Continue) bit */ 659 #define ISCSI_TEXT_RESPONSE_HDR_C_SHIFT 6 660 #define ISCSI_TEXT_RESPONSE_HDR_F_MASK 0x1 /* F (Final) bit */ 661 #define ISCSI_TEXT_RESPONSE_HDR_F_SHIFT 7 662 u8 opcode /* opcode. [constant, initialized] */; 663 __le32 hdr_second_dword; 664 #define ISCSI_TEXT_RESPONSE_HDR_DATA_SEG_LEN_MASK 0xFFFFFF /* DataSegmentLength */ 665 #define ISCSI_TEXT_RESPONSE_HDR_DATA_SEG_LEN_SHIFT 0 666 #define ISCSI_TEXT_RESPONSE_HDR_TOTAL_AHS_LEN_MASK 0xFF /* TotalAHSLength */ 667 #define ISCSI_TEXT_RESPONSE_HDR_TOTAL_AHS_LEN_SHIFT 24 668 struct regpair lun /* Logical Unit Number */; 669 __le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */; 670 __le32 ttt /* Target Task Tag */; 671 __le32 stat_sn /* CmdSN */; 672 __le32 exp_cmd_sn /* Expected StatSn */; 673 __le32 max_cmd_sn /* CmdSN */; 674 __le32 reserved4[3] /* Reserved */; 675 }; 676 677 /* 678 * iSCSI TMF Request PDU header 679 */ 680 struct iscsi_tmf_request_hdr 681 { 682 __le16 reserved0 /* reserved */; 683 u8 function /* function */; 684 u8 opcode /* opcode. [constant, initialized] */; 685 __le32 hdr_second_dword; 686 #define ISCSI_TMF_REQUEST_HDR_DATA_SEG_LEN_MASK 0xFFFFFF /* DataSegmentLength */ 687 #define ISCSI_TMF_REQUEST_HDR_DATA_SEG_LEN_SHIFT 0 688 #define ISCSI_TMF_REQUEST_HDR_TOTAL_AHS_LEN_MASK 0xFF /* TotalAHSLength */ 689 #define ISCSI_TMF_REQUEST_HDR_TOTAL_AHS_LEN_SHIFT 24 690 struct regpair lun /* Logical Unit Number */; 691 __le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */; 692 __le32 rtt /* Referenced Task Tag or 0xffffffff */; 693 __le32 cmd_sn /* cmd_sn */; 694 __le32 exp_stat_sn /* exp_stat_sn */; 695 __le32 ref_cmd_sn /* ref_cmd_sn */; 696 __le32 exp_data_sn /* exp_data_sn */; 697 __le32 reserved4[2] /* Reserved */; 698 }; 699 700 struct iscsi_tmf_response_hdr 701 { 702 u8 reserved2 /* reserved2 */; 703 u8 hdr_response /* Response field of ISCSI header for Responses / Reserved for Data-In */; 704 u8 hdr_flags /* Flags field of ISCSI header */; 705 u8 opcode /* opcode. [constant, initialized] */; 706 __le32 hdr_second_dword; 707 #define ISCSI_TMF_RESPONSE_HDR_DATA_SEG_LEN_MASK 0xFFFFFF /* DataSegmentLength */ 708 #define ISCSI_TMF_RESPONSE_HDR_DATA_SEG_LEN_SHIFT 0 709 #define ISCSI_TMF_RESPONSE_HDR_TOTAL_AHS_LEN_MASK 0xFF /* TotalAHSLength */ 710 #define ISCSI_TMF_RESPONSE_HDR_TOTAL_AHS_LEN_SHIFT 24 711 struct regpair reserved0; 712 __le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */; 713 __le32 reserved1 /* Reserved */; 714 __le32 stat_sn /* stat_sn */; 715 __le32 exp_cmd_sn /* exp_cmd_sn */; 716 __le32 max_cmd_sn /* max_cmd_sn */; 717 __le32 reserved4[3] /* Reserved */; 718 }; 719 720 /* 721 * iSCSI Response PDU header 722 */ 723 struct iscsi_response_hdr 724 { 725 u8 hdr_status /* Status field of ISCSI header */; 726 u8 hdr_response /* Response field of ISCSI header for Responses / Reserved for Data-In */; 727 u8 hdr_flags /* Flags field of ISCSI header */; 728 u8 opcode /* opcode. [constant, initialized] */; 729 __le32 hdr_second_dword; 730 #define ISCSI_RESPONSE_HDR_DATA_SEG_LEN_MASK 0xFFFFFF /* DataSegmentLength */ 731 #define ISCSI_RESPONSE_HDR_DATA_SEG_LEN_SHIFT 0 732 #define ISCSI_RESPONSE_HDR_TOTAL_AHS_LEN_MASK 0xFF /* TotalAHSLength */ 733 #define ISCSI_RESPONSE_HDR_TOTAL_AHS_LEN_SHIFT 24 734 struct regpair lun /* Logical Unit Number */; 735 __le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */; 736 __le32 snack_tag /* Currently ERL>0 is not supported */; 737 __le32 stat_sn /* CmdSN */; 738 __le32 exp_cmd_sn /* Expected StatSn */; 739 __le32 max_cmd_sn /* CmdSN */; 740 __le32 exp_data_sn /* exp_data_sn */; 741 __le32 bi_residual_count /* bi residual count */; 742 __le32 residual_count /* residual count */; 743 }; 744 745 /* 746 * iSCSI Reject PDU header 747 */ 748 struct iscsi_reject_hdr 749 { 750 u8 reserved4 /* Reserved */; 751 u8 hdr_reason /* The reject reason */; 752 u8 hdr_flags /* Flags field of ISCSI header */; 753 u8 opcode /* opcode. [constant, initialized] */; 754 __le32 hdr_second_dword; 755 #define ISCSI_REJECT_HDR_DATA_SEG_LEN_MASK 0xFFFFFF /* DataSegmentLength */ 756 #define ISCSI_REJECT_HDR_DATA_SEG_LEN_SHIFT 0 757 #define ISCSI_REJECT_HDR_TOTAL_AHS_LEN_MASK 0xFF /* TotalAHSLength */ 758 #define ISCSI_REJECT_HDR_TOTAL_AHS_LEN_SHIFT 24 759 struct regpair reserved0; 760 __le32 all_ones; 761 __le32 reserved2; 762 __le32 stat_sn /* stat_sn */; 763 __le32 exp_cmd_sn /* exp_cmd_sn */; 764 __le32 max_cmd_sn /* max_cmd_sn */; 765 __le32 data_sn /* data_sn */; 766 __le32 reserved3[2] /* reserved3 */; 767 }; 768 769 /* 770 * iSCSI Asynchronous Message PDU header 771 */ 772 struct iscsi_async_msg_hdr 773 { 774 __le16 reserved0 /* reserved */; 775 u8 flags_attr; 776 #define ISCSI_ASYNC_MSG_HDR_RSRV_MASK 0x7F /* reserved */ 777 #define ISCSI_ASYNC_MSG_HDR_RSRV_SHIFT 0 778 #define ISCSI_ASYNC_MSG_HDR_CONST1_MASK 0x1 /* const1 */ 779 #define ISCSI_ASYNC_MSG_HDR_CONST1_SHIFT 7 780 u8 opcode /* opcode */; 781 __le32 hdr_second_dword; 782 #define ISCSI_ASYNC_MSG_HDR_DATA_SEG_LEN_MASK 0xFFFFFF /* DataSegmentLength */ 783 #define ISCSI_ASYNC_MSG_HDR_DATA_SEG_LEN_SHIFT 0 784 #define ISCSI_ASYNC_MSG_HDR_TOTAL_AHS_LEN_MASK 0xFF /* TotalAHSLength */ 785 #define ISCSI_ASYNC_MSG_HDR_TOTAL_AHS_LEN_SHIFT 24 786 struct regpair lun /* Logical Unit Number */; 787 __le32 all_ones /* should be 0xffffffff */; 788 __le32 reserved1 /* reserved */; 789 __le32 stat_sn /* stat_sn */; 790 __le32 exp_cmd_sn /* exp_cmd_sn */; 791 __le32 max_cmd_sn /* max_cmd_sn */; 792 __le16 param1_rsrv /* Parameter1 or Reserved */; 793 u8 async_vcode /* AsuncVCode */; 794 u8 async_event /* AsyncEvent */; 795 __le16 param3_rsrv /* Parameter3 or Reserved */; 796 __le16 param2_rsrv /* Parameter2 or Reserved */; 797 __le32 reserved7 /* reserved */; 798 }; 799 800 /* 801 * PDU header part of Ystorm task context 802 */ 803 union iscsi_task_hdr 804 { 805 struct iscsi_common_hdr common /* Command PDU header */; 806 struct data_hdr data /* Command PDU header */; 807 struct iscsi_cmd_hdr cmd /* Command PDU header */; 808 struct iscsi_ext_cdb_cmd_hdr ext_cdb_cmd /* Command PDU header with extended CDB - Initiator Mode */; 809 struct iscsi_login_req_hdr login_req /* Login request PDU header */; 810 struct iscsi_logout_req_hdr logout_req /* Logout request PDU header */; 811 struct iscsi_data_out_hdr data_out /* Data-out PDU header */; 812 struct iscsi_data_in_hdr data_in /* Data-in PDU header */; 813 struct iscsi_r2t_hdr r2t /* R2T PDU header */; 814 struct iscsi_nop_out_hdr nop_out /* NOP-out PDU header */; 815 struct iscsi_nop_in_hdr nop_in /* NOP-in PDU header */; 816 struct iscsi_login_response_hdr login_response /* Login response PDU header */; 817 struct iscsi_logout_response_hdr logout_response /* Logout response PDU header */; 818 struct iscsi_text_request_hdr text_request /* Text request PDU header */; 819 struct iscsi_text_response_hdr text_response /* Text response PDU header */; 820 struct iscsi_tmf_request_hdr tmf_request /* TMF request PDU header */; 821 struct iscsi_tmf_response_hdr tmf_response /* TMF response PDU header */; 822 struct iscsi_response_hdr response /* Text response PDU header */; 823 struct iscsi_reject_hdr reject /* Reject PDU header */; 824 struct iscsi_async_msg_hdr async_msg /* Asynchronous Message PDU header */; 825 }; 826 827 /* 828 * The iscsi storm task context of Ystorm 829 */ 830 struct ystorm_iscsi_task_st_ctx 831 { 832 struct ystorm_iscsi_task_state state /* iSCSI task parameters and state */; 833 struct ystorm_iscsi_task_rxmit_opt rxmit_opt /* iSCSI retransmit optimizations parameters */; 834 union iscsi_task_hdr pdu_hdr /* PDU header - [constant initialized] */; 835 }; 836 837 struct e4_ystorm_iscsi_task_ag_ctx 838 { 839 u8 reserved /* cdu_validation */; 840 u8 byte1 /* state */; 841 __le16 word0 /* icid */; 842 u8 flags0; 843 #define E4_YSTORM_ISCSI_TASK_AG_CTX_NIBBLE0_MASK 0xF /* connection_type */ 844 #define E4_YSTORM_ISCSI_TASK_AG_CTX_NIBBLE0_SHIFT 0 845 #define E4_YSTORM_ISCSI_TASK_AG_CTX_BIT0_MASK 0x1 /* exist_in_qm0 */ 846 #define E4_YSTORM_ISCSI_TASK_AG_CTX_BIT0_SHIFT 4 847 #define E4_YSTORM_ISCSI_TASK_AG_CTX_BIT1_MASK 0x1 /* exist_in_qm1 */ 848 #define E4_YSTORM_ISCSI_TASK_AG_CTX_BIT1_SHIFT 5 849 #define E4_YSTORM_ISCSI_TASK_AG_CTX_VALID_MASK 0x1 /* bit2 */ 850 #define E4_YSTORM_ISCSI_TASK_AG_CTX_VALID_SHIFT 6 851 #define E4_YSTORM_ISCSI_TASK_AG_CTX_BIT3_MASK 0x1 /* bit3 */ 852 #define E4_YSTORM_ISCSI_TASK_AG_CTX_BIT3_SHIFT 7 853 u8 flags1; 854 #define E4_YSTORM_ISCSI_TASK_AG_CTX_CF0_MASK 0x3 /* cf0 */ 855 #define E4_YSTORM_ISCSI_TASK_AG_CTX_CF0_SHIFT 0 856 #define E4_YSTORM_ISCSI_TASK_AG_CTX_CF1_MASK 0x3 /* cf1 */ 857 #define E4_YSTORM_ISCSI_TASK_AG_CTX_CF1_SHIFT 2 858 #define E4_YSTORM_ISCSI_TASK_AG_CTX_CF2SPECIAL_MASK 0x3 /* cf2special */ 859 #define E4_YSTORM_ISCSI_TASK_AG_CTX_CF2SPECIAL_SHIFT 4 860 #define E4_YSTORM_ISCSI_TASK_AG_CTX_CF0EN_MASK 0x1 /* cf0en */ 861 #define E4_YSTORM_ISCSI_TASK_AG_CTX_CF0EN_SHIFT 6 862 #define E4_YSTORM_ISCSI_TASK_AG_CTX_CF1EN_MASK 0x1 /* cf1en */ 863 #define E4_YSTORM_ISCSI_TASK_AG_CTX_CF1EN_SHIFT 7 864 u8 flags2; 865 #define E4_YSTORM_ISCSI_TASK_AG_CTX_BIT4_MASK 0x1 /* bit4 */ 866 #define E4_YSTORM_ISCSI_TASK_AG_CTX_BIT4_SHIFT 0 867 #define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE0EN_MASK 0x1 /* rule0en */ 868 #define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE0EN_SHIFT 1 869 #define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE1EN_MASK 0x1 /* rule1en */ 870 #define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE1EN_SHIFT 2 871 #define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE2EN_MASK 0x1 /* rule2en */ 872 #define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE2EN_SHIFT 3 873 #define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE3EN_MASK 0x1 /* rule3en */ 874 #define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE3EN_SHIFT 4 875 #define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE4EN_MASK 0x1 /* rule4en */ 876 #define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE4EN_SHIFT 5 877 #define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE5EN_MASK 0x1 /* rule5en */ 878 #define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE5EN_SHIFT 6 879 #define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE6EN_MASK 0x1 /* rule6en */ 880 #define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE6EN_SHIFT 7 881 u8 byte2 /* byte2 */; 882 __le32 TTT /* reg0 */; 883 u8 byte3 /* byte3 */; 884 u8 byte4 /* byte4 */; 885 __le16 word1 /* word1 */; 886 }; 887 888 struct e4_mstorm_iscsi_task_ag_ctx 889 { 890 u8 cdu_validation /* cdu_validation */; 891 u8 byte1 /* state */; 892 __le16 task_cid /* icid */; 893 u8 flags0; 894 #define E4_MSTORM_ISCSI_TASK_AG_CTX_CONNECTION_TYPE_MASK 0xF /* connection_type */ 895 #define E4_MSTORM_ISCSI_TASK_AG_CTX_CONNECTION_TYPE_SHIFT 0 896 #define E4_MSTORM_ISCSI_TASK_AG_CTX_EXIST_IN_QM0_MASK 0x1 /* exist_in_qm0 */ 897 #define E4_MSTORM_ISCSI_TASK_AG_CTX_EXIST_IN_QM0_SHIFT 4 898 #define E4_MSTORM_ISCSI_TASK_AG_CTX_BIT1_MASK 0x1 /* exist_in_qm1 */ 899 #define E4_MSTORM_ISCSI_TASK_AG_CTX_BIT1_SHIFT 5 900 #define E4_MSTORM_ISCSI_TASK_AG_CTX_VALID_MASK 0x1 /* bit2 */ 901 #define E4_MSTORM_ISCSI_TASK_AG_CTX_VALID_SHIFT 6 902 #define E4_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_FLAG_MASK 0x1 /* bit3 */ 903 #define E4_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_FLAG_SHIFT 7 904 u8 flags1; 905 #define E4_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_CF_MASK 0x3 /* cf0 */ 906 #define E4_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_CF_SHIFT 0 907 #define E4_MSTORM_ISCSI_TASK_AG_CTX_CF1_MASK 0x3 /* cf1 */ 908 #define E4_MSTORM_ISCSI_TASK_AG_CTX_CF1_SHIFT 2 909 #define E4_MSTORM_ISCSI_TASK_AG_CTX_CF2_MASK 0x3 /* cf2 */ 910 #define E4_MSTORM_ISCSI_TASK_AG_CTX_CF2_SHIFT 4 911 #define E4_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_CF_EN_MASK 0x1 /* cf0en */ 912 #define E4_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_CF_EN_SHIFT 6 913 #define E4_MSTORM_ISCSI_TASK_AG_CTX_CF1EN_MASK 0x1 /* cf1en */ 914 #define E4_MSTORM_ISCSI_TASK_AG_CTX_CF1EN_SHIFT 7 915 u8 flags2; 916 #define E4_MSTORM_ISCSI_TASK_AG_CTX_CF2EN_MASK 0x1 /* cf2en */ 917 #define E4_MSTORM_ISCSI_TASK_AG_CTX_CF2EN_SHIFT 0 918 #define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE0EN_MASK 0x1 /* rule0en */ 919 #define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE0EN_SHIFT 1 920 #define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE1EN_MASK 0x1 /* rule1en */ 921 #define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE1EN_SHIFT 2 922 #define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE2EN_MASK 0x1 /* rule2en */ 923 #define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE2EN_SHIFT 3 924 #define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE3EN_MASK 0x1 /* rule3en */ 925 #define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE3EN_SHIFT 4 926 #define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE4EN_MASK 0x1 /* rule4en */ 927 #define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE4EN_SHIFT 5 928 #define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE5EN_MASK 0x1 /* rule5en */ 929 #define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE5EN_SHIFT 6 930 #define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE6EN_MASK 0x1 /* rule6en */ 931 #define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE6EN_SHIFT 7 932 u8 byte2 /* byte2 */; 933 __le32 reg0 /* reg0 */; 934 u8 byte3 /* byte3 */; 935 u8 byte4 /* byte4 */; 936 __le16 word1 /* word1 */; 937 }; 938 939 struct e4_ustorm_iscsi_task_ag_ctx 940 { 941 u8 reserved /* cdu_validation */; 942 u8 state /* state */; 943 __le16 icid /* icid */; 944 u8 flags0; 945 #define E4_USTORM_ISCSI_TASK_AG_CTX_CONNECTION_TYPE_MASK 0xF /* connection_type */ 946 #define E4_USTORM_ISCSI_TASK_AG_CTX_CONNECTION_TYPE_SHIFT 0 947 #define E4_USTORM_ISCSI_TASK_AG_CTX_EXIST_IN_QM0_MASK 0x1 /* exist_in_qm0 */ 948 #define E4_USTORM_ISCSI_TASK_AG_CTX_EXIST_IN_QM0_SHIFT 4 949 #define E4_USTORM_ISCSI_TASK_AG_CTX_BIT1_MASK 0x1 /* exist_in_qm1 */ 950 #define E4_USTORM_ISCSI_TASK_AG_CTX_BIT1_SHIFT 5 951 #define E4_USTORM_ISCSI_TASK_AG_CTX_HQ_SCANNED_CF_MASK 0x3 /* timer0cf */ 952 #define E4_USTORM_ISCSI_TASK_AG_CTX_HQ_SCANNED_CF_SHIFT 6 953 u8 flags1; 954 #define E4_USTORM_ISCSI_TASK_AG_CTX_RESERVED1_MASK 0x3 /* timer1cf */ 955 #define E4_USTORM_ISCSI_TASK_AG_CTX_RESERVED1_SHIFT 0 956 #define E4_USTORM_ISCSI_TASK_AG_CTX_R2T2RECV_MASK 0x3 /* timer2cf */ 957 #define E4_USTORM_ISCSI_TASK_AG_CTX_R2T2RECV_SHIFT 2 958 #define E4_USTORM_ISCSI_TASK_AG_CTX_CF3_MASK 0x3 /* timer_stop_all */ 959 #define E4_USTORM_ISCSI_TASK_AG_CTX_CF3_SHIFT 4 960 #define E4_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_CF_MASK 0x3 /* cf4 */ 961 #define E4_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_CF_SHIFT 6 962 u8 flags2; 963 #define E4_USTORM_ISCSI_TASK_AG_CTX_HQ_SCANNED_CF_EN_MASK 0x1 /* cf0en */ 964 #define E4_USTORM_ISCSI_TASK_AG_CTX_HQ_SCANNED_CF_EN_SHIFT 0 965 #define E4_USTORM_ISCSI_TASK_AG_CTX_DISABLE_DATA_ACKED_MASK 0x1 /* cf1en */ 966 #define E4_USTORM_ISCSI_TASK_AG_CTX_DISABLE_DATA_ACKED_SHIFT 1 967 #define E4_USTORM_ISCSI_TASK_AG_CTX_R2T2RECV_EN_MASK 0x1 /* cf2en */ 968 #define E4_USTORM_ISCSI_TASK_AG_CTX_R2T2RECV_EN_SHIFT 2 969 #define E4_USTORM_ISCSI_TASK_AG_CTX_CF3EN_MASK 0x1 /* cf3en */ 970 #define E4_USTORM_ISCSI_TASK_AG_CTX_CF3EN_SHIFT 3 971 #define E4_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_CF_EN_MASK 0x1 /* cf4en */ 972 #define E4_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_CF_EN_SHIFT 4 973 #define E4_USTORM_ISCSI_TASK_AG_CTX_CMP_DATA_TOTAL_EXP_EN_MASK 0x1 /* rule0en */ 974 #define E4_USTORM_ISCSI_TASK_AG_CTX_CMP_DATA_TOTAL_EXP_EN_SHIFT 5 975 #define E4_USTORM_ISCSI_TASK_AG_CTX_RULE1EN_MASK 0x1 /* rule1en */ 976 #define E4_USTORM_ISCSI_TASK_AG_CTX_RULE1EN_SHIFT 6 977 #define E4_USTORM_ISCSI_TASK_AG_CTX_CMP_CONT_RCV_EXP_EN_MASK 0x1 /* rule2en */ 978 #define E4_USTORM_ISCSI_TASK_AG_CTX_CMP_CONT_RCV_EXP_EN_SHIFT 7 979 u8 flags3; 980 #define E4_USTORM_ISCSI_TASK_AG_CTX_RULE3EN_MASK 0x1 /* rule3en */ 981 #define E4_USTORM_ISCSI_TASK_AG_CTX_RULE3EN_SHIFT 0 982 #define E4_USTORM_ISCSI_TASK_AG_CTX_RULE4EN_MASK 0x1 /* rule4en */ 983 #define E4_USTORM_ISCSI_TASK_AG_CTX_RULE4EN_SHIFT 1 984 #define E4_USTORM_ISCSI_TASK_AG_CTX_RULE5EN_MASK 0x1 /* rule5en */ 985 #define E4_USTORM_ISCSI_TASK_AG_CTX_RULE5EN_SHIFT 2 986 #define E4_USTORM_ISCSI_TASK_AG_CTX_RULE6EN_MASK 0x1 /* rule6en */ 987 #define E4_USTORM_ISCSI_TASK_AG_CTX_RULE6EN_SHIFT 3 988 #define E4_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_TYPE_MASK 0xF /* nibble1 */ 989 #define E4_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_TYPE_SHIFT 4 990 __le32 dif_err_intervals /* reg0 */; 991 __le32 dif_error_1st_interval /* reg1 */; 992 __le32 rcv_cont_len /* reg2 */; 993 __le32 exp_cont_len /* reg3 */; 994 __le32 total_data_acked /* reg4 */; 995 __le32 exp_data_acked /* reg5 */; 996 u8 next_tid_valid /* byte2 */; 997 u8 byte3 /* byte3 */; 998 __le16 word1 /* word1 */; 999 __le16 next_tid /* word2 */; 1000 __le16 word3 /* word3 */; 1001 __le32 hdr_residual_count /* reg6 */; 1002 __le32 exp_r2t_sn /* reg7 */; 1003 }; 1004 1005 /* 1006 * The iscsi storm task context of Mstorm 1007 */ 1008 struct mstorm_iscsi_task_st_ctx 1009 { 1010 struct scsi_cached_sges data_desc /* Union of Data SGL / cached sge */; 1011 struct scsi_sgl_params sgl_params; 1012 __le32 rem_task_size /* Remaining task size, used for placement verification */; 1013 __le32 data_buffer_offset /* Buffer offset */; 1014 u8 task_type /* Task type, (use: iscsi_task_type enum) */; 1015 struct iscsi_dif_flags dif_flags /* sizes of host/peer protection intervals + protection log interval */; 1016 __le16 dif_task_icid /* save tasks CID for validation - dif on immediate flow */; 1017 struct regpair sense_db /* Pointer to sense data buffer */; 1018 __le32 expected_itt /* ITT - for target mode validations */; 1019 __le32 reserved1 /* reserved1 */; 1020 }; 1021 1022 struct iscsi_reg1 1023 { 1024 __le32 reg1_map; 1025 #define ISCSI_REG1_NUM_SGES_MASK 0xF /* Written to R2tQE */ 1026 #define ISCSI_REG1_NUM_SGES_SHIFT 0 1027 #define ISCSI_REG1_RESERVED1_MASK 0xFFFFFFF /* reserved */ 1028 #define ISCSI_REG1_RESERVED1_SHIFT 4 1029 }; 1030 1031 struct tqe_opaque 1032 { 1033 __le16 opaque[2] /* TQe opaque */; 1034 }; 1035 1036 /* 1037 * The iscsi storm task context of Ustorm 1038 */ 1039 struct ustorm_iscsi_task_st_ctx 1040 { 1041 __le32 rem_rcv_len /* Remaining data to be received in bytes. Used in validations */; 1042 __le32 exp_data_transfer_len /* iSCSI Initiator - The size of the transmitted task, iSCSI Target - the size of the Rx continuation */; 1043 __le32 exp_data_sn /* Expected data SN */; 1044 struct regpair lun /* LUN */; 1045 struct iscsi_reg1 reg1; 1046 u8 flags2; 1047 #define USTORM_ISCSI_TASK_ST_CTX_AHS_EXIST_MASK 0x1 /* Initiator Mode - Mark AHS exist */ 1048 #define USTORM_ISCSI_TASK_ST_CTX_AHS_EXIST_SHIFT 0 1049 #define USTORM_ISCSI_TASK_ST_CTX_RESERVED1_MASK 0x7F 1050 #define USTORM_ISCSI_TASK_ST_CTX_RESERVED1_SHIFT 1 1051 struct iscsi_dif_flags dif_flags /* Dif flags (written to R2T WQE) */; 1052 __le16 reserved3; 1053 struct tqe_opaque tqe_opaque_list; 1054 __le32 reserved5; 1055 __le32 reserved6; 1056 __le32 reserved7; 1057 u8 task_type /* Task Type */; 1058 u8 error_flags; 1059 #define USTORM_ISCSI_TASK_ST_CTX_DATA_DIGEST_ERROR_MASK 0x1 /* Mark task with data digest error (1 bit) */ 1060 #define USTORM_ISCSI_TASK_ST_CTX_DATA_DIGEST_ERROR_SHIFT 0 1061 #define USTORM_ISCSI_TASK_ST_CTX_DATA_TRUNCATED_ERROR_MASK 0x1 /* Target Mode - Mark middle task error, data truncated */ 1062 #define USTORM_ISCSI_TASK_ST_CTX_DATA_TRUNCATED_ERROR_SHIFT 1 1063 #define USTORM_ISCSI_TASK_ST_CTX_UNDER_RUN_ERROR_MASK 0x1 1064 #define USTORM_ISCSI_TASK_ST_CTX_UNDER_RUN_ERROR_SHIFT 2 1065 #define USTORM_ISCSI_TASK_ST_CTX_RESERVED8_MASK 0x1F 1066 #define USTORM_ISCSI_TASK_ST_CTX_RESERVED8_SHIFT 3 1067 u8 flags; 1068 #define USTORM_ISCSI_TASK_ST_CTX_CQE_WRITE_MASK 0x3 /* mark task cqe write (for cleanup flow) */ 1069 #define USTORM_ISCSI_TASK_ST_CTX_CQE_WRITE_SHIFT 0 1070 #define USTORM_ISCSI_TASK_ST_CTX_LOCAL_COMP_MASK 0x1 /* local completion bit */ 1071 #define USTORM_ISCSI_TASK_ST_CTX_LOCAL_COMP_SHIFT 2 1072 #define USTORM_ISCSI_TASK_ST_CTX_Q0_R2TQE_WRITE_MASK 0x1 /* write R2TQE from Q0 flow */ 1073 #define USTORM_ISCSI_TASK_ST_CTX_Q0_R2TQE_WRITE_SHIFT 3 1074 #define USTORM_ISCSI_TASK_ST_CTX_TOTAL_DATA_ACKED_DONE_MASK 0x1 /* Mark total data acked or disabled */ 1075 #define USTORM_ISCSI_TASK_ST_CTX_TOTAL_DATA_ACKED_DONE_SHIFT 4 1076 #define USTORM_ISCSI_TASK_ST_CTX_HQ_SCANNED_DONE_MASK 0x1 /* Mark HQ scanned or disabled */ 1077 #define USTORM_ISCSI_TASK_ST_CTX_HQ_SCANNED_DONE_SHIFT 5 1078 #define USTORM_ISCSI_TASK_ST_CTX_R2T2RECV_DONE_MASK 0x1 /* Mark HQ scanned or disabled */ 1079 #define USTORM_ISCSI_TASK_ST_CTX_R2T2RECV_DONE_SHIFT 6 1080 #define USTORM_ISCSI_TASK_ST_CTX_RESERVED0_MASK 0x1 1081 #define USTORM_ISCSI_TASK_ST_CTX_RESERVED0_SHIFT 7 1082 u8 cq_rss_number /* Task CQ_RSS number 0.63 */; 1083 }; 1084 1085 /* 1086 * iscsi task context 1087 */ 1088 struct e4_iscsi_task_context 1089 { 1090 struct ystorm_iscsi_task_st_ctx ystorm_st_context /* ystorm storm context */; 1091 struct e4_ystorm_iscsi_task_ag_ctx ystorm_ag_context /* ystorm aggregative context */; 1092 struct regpair ystorm_ag_padding[2] /* padding */; 1093 struct tdif_task_context tdif_context /* tdif context */; 1094 struct e4_mstorm_iscsi_task_ag_ctx mstorm_ag_context /* mstorm aggregative context */; 1095 struct regpair mstorm_ag_padding[2] /* padding */; 1096 struct e4_ustorm_iscsi_task_ag_ctx ustorm_ag_context /* ustorm aggregative context */; 1097 struct mstorm_iscsi_task_st_ctx mstorm_st_context /* mstorm storm context */; 1098 struct ustorm_iscsi_task_st_ctx ustorm_st_context /* ustorm storm context */; 1099 struct rdif_task_context rdif_context /* rdif context */; 1100 }; 1101 1102 1103 struct e5_ystorm_iscsi_task_ag_ctx 1104 { 1105 u8 reserved /* cdu_validation */; 1106 u8 byte1 /* state_and_core_id */; 1107 __le16 word0 /* icid */; 1108 u8 flags0; 1109 #define E5_YSTORM_ISCSI_TASK_AG_CTX_NIBBLE0_MASK 0xF /* connection_type */ 1110 #define E5_YSTORM_ISCSI_TASK_AG_CTX_NIBBLE0_SHIFT 0 1111 #define E5_YSTORM_ISCSI_TASK_AG_CTX_BIT0_MASK 0x1 /* exist_in_qm0 */ 1112 #define E5_YSTORM_ISCSI_TASK_AG_CTX_BIT0_SHIFT 4 1113 #define E5_YSTORM_ISCSI_TASK_AG_CTX_BIT1_MASK 0x1 /* exist_in_qm1 */ 1114 #define E5_YSTORM_ISCSI_TASK_AG_CTX_BIT1_SHIFT 5 1115 #define E5_YSTORM_ISCSI_TASK_AG_CTX_VALID_MASK 0x1 /* bit2 */ 1116 #define E5_YSTORM_ISCSI_TASK_AG_CTX_VALID_SHIFT 6 1117 #define E5_YSTORM_ISCSI_TASK_AG_CTX_BIT3_MASK 0x1 /* bit3 */ 1118 #define E5_YSTORM_ISCSI_TASK_AG_CTX_BIT3_SHIFT 7 1119 u8 flags1; 1120 #define E5_YSTORM_ISCSI_TASK_AG_CTX_CF0_MASK 0x3 /* cf0 */ 1121 #define E5_YSTORM_ISCSI_TASK_AG_CTX_CF0_SHIFT 0 1122 #define E5_YSTORM_ISCSI_TASK_AG_CTX_CF1_MASK 0x3 /* cf1 */ 1123 #define E5_YSTORM_ISCSI_TASK_AG_CTX_CF1_SHIFT 2 1124 #define E5_YSTORM_ISCSI_TASK_AG_CTX_CF2SPECIAL_MASK 0x3 /* cf2special */ 1125 #define E5_YSTORM_ISCSI_TASK_AG_CTX_CF2SPECIAL_SHIFT 4 1126 #define E5_YSTORM_ISCSI_TASK_AG_CTX_CF0EN_MASK 0x1 /* cf0en */ 1127 #define E5_YSTORM_ISCSI_TASK_AG_CTX_CF0EN_SHIFT 6 1128 #define E5_YSTORM_ISCSI_TASK_AG_CTX_CF1EN_MASK 0x1 /* cf1en */ 1129 #define E5_YSTORM_ISCSI_TASK_AG_CTX_CF1EN_SHIFT 7 1130 u8 flags2; 1131 #define E5_YSTORM_ISCSI_TASK_AG_CTX_BIT4_MASK 0x1 /* bit4 */ 1132 #define E5_YSTORM_ISCSI_TASK_AG_CTX_BIT4_SHIFT 0 1133 #define E5_YSTORM_ISCSI_TASK_AG_CTX_RULE0EN_MASK 0x1 /* rule0en */ 1134 #define E5_YSTORM_ISCSI_TASK_AG_CTX_RULE0EN_SHIFT 1 1135 #define E5_YSTORM_ISCSI_TASK_AG_CTX_RULE1EN_MASK 0x1 /* rule1en */ 1136 #define E5_YSTORM_ISCSI_TASK_AG_CTX_RULE1EN_SHIFT 2 1137 #define E5_YSTORM_ISCSI_TASK_AG_CTX_RULE2EN_MASK 0x1 /* rule2en */ 1138 #define E5_YSTORM_ISCSI_TASK_AG_CTX_RULE2EN_SHIFT 3 1139 #define E5_YSTORM_ISCSI_TASK_AG_CTX_RULE3EN_MASK 0x1 /* rule3en */ 1140 #define E5_YSTORM_ISCSI_TASK_AG_CTX_RULE3EN_SHIFT 4 1141 #define E5_YSTORM_ISCSI_TASK_AG_CTX_RULE4EN_MASK 0x1 /* rule4en */ 1142 #define E5_YSTORM_ISCSI_TASK_AG_CTX_RULE4EN_SHIFT 5 1143 #define E5_YSTORM_ISCSI_TASK_AG_CTX_RULE5EN_MASK 0x1 /* rule5en */ 1144 #define E5_YSTORM_ISCSI_TASK_AG_CTX_RULE5EN_SHIFT 6 1145 #define E5_YSTORM_ISCSI_TASK_AG_CTX_RULE6EN_MASK 0x1 /* rule6en */ 1146 #define E5_YSTORM_ISCSI_TASK_AG_CTX_RULE6EN_SHIFT 7 1147 u8 flags3; 1148 #define E5_YSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED1_MASK 0x1 /* bit5 */ 1149 #define E5_YSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED1_SHIFT 0 1150 #define E5_YSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED2_MASK 0x3 /* cf3 */ 1151 #define E5_YSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED2_SHIFT 1 1152 #define E5_YSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED3_MASK 0x3 /* cf4 */ 1153 #define E5_YSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED3_SHIFT 3 1154 #define E5_YSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED4_MASK 0x1 /* cf3en */ 1155 #define E5_YSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED4_SHIFT 5 1156 #define E5_YSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED5_MASK 0x1 /* cf4en */ 1157 #define E5_YSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED5_SHIFT 6 1158 #define E5_YSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED6_MASK 0x1 /* rule7en */ 1159 #define E5_YSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED6_SHIFT 7 1160 __le32 TTT /* reg0 */; 1161 u8 byte2 /* byte2 */; 1162 u8 byte3 /* byte3 */; 1163 u8 byte4 /* byte4 */; 1164 u8 e4_reserved7 /* byte5 */; 1165 }; 1166 1167 struct e5_mstorm_iscsi_task_ag_ctx 1168 { 1169 u8 cdu_validation /* cdu_validation */; 1170 u8 byte1 /* state_and_core_id */; 1171 __le16 task_cid /* icid */; 1172 u8 flags0; 1173 #define E5_MSTORM_ISCSI_TASK_AG_CTX_CONNECTION_TYPE_MASK 0xF /* connection_type */ 1174 #define E5_MSTORM_ISCSI_TASK_AG_CTX_CONNECTION_TYPE_SHIFT 0 1175 #define E5_MSTORM_ISCSI_TASK_AG_CTX_EXIST_IN_QM0_MASK 0x1 /* exist_in_qm0 */ 1176 #define E5_MSTORM_ISCSI_TASK_AG_CTX_EXIST_IN_QM0_SHIFT 4 1177 #define E5_MSTORM_ISCSI_TASK_AG_CTX_BIT1_MASK 0x1 /* exist_in_qm1 */ 1178 #define E5_MSTORM_ISCSI_TASK_AG_CTX_BIT1_SHIFT 5 1179 #define E5_MSTORM_ISCSI_TASK_AG_CTX_VALID_MASK 0x1 /* bit2 */ 1180 #define E5_MSTORM_ISCSI_TASK_AG_CTX_VALID_SHIFT 6 1181 #define E5_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_FLAG_MASK 0x1 /* bit3 */ 1182 #define E5_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_FLAG_SHIFT 7 1183 u8 flags1; 1184 #define E5_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_CF_MASK 0x3 /* cf0 */ 1185 #define E5_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_CF_SHIFT 0 1186 #define E5_MSTORM_ISCSI_TASK_AG_CTX_CF1_MASK 0x3 /* cf1 */ 1187 #define E5_MSTORM_ISCSI_TASK_AG_CTX_CF1_SHIFT 2 1188 #define E5_MSTORM_ISCSI_TASK_AG_CTX_CF2_MASK 0x3 /* cf2 */ 1189 #define E5_MSTORM_ISCSI_TASK_AG_CTX_CF2_SHIFT 4 1190 #define E5_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_CF_EN_MASK 0x1 /* cf0en */ 1191 #define E5_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_CF_EN_SHIFT 6 1192 #define E5_MSTORM_ISCSI_TASK_AG_CTX_CF1EN_MASK 0x1 /* cf1en */ 1193 #define E5_MSTORM_ISCSI_TASK_AG_CTX_CF1EN_SHIFT 7 1194 u8 flags2; 1195 #define E5_MSTORM_ISCSI_TASK_AG_CTX_CF2EN_MASK 0x1 /* cf2en */ 1196 #define E5_MSTORM_ISCSI_TASK_AG_CTX_CF2EN_SHIFT 0 1197 #define E5_MSTORM_ISCSI_TASK_AG_CTX_RULE0EN_MASK 0x1 /* rule0en */ 1198 #define E5_MSTORM_ISCSI_TASK_AG_CTX_RULE0EN_SHIFT 1 1199 #define E5_MSTORM_ISCSI_TASK_AG_CTX_RULE1EN_MASK 0x1 /* rule1en */ 1200 #define E5_MSTORM_ISCSI_TASK_AG_CTX_RULE1EN_SHIFT 2 1201 #define E5_MSTORM_ISCSI_TASK_AG_CTX_RULE2EN_MASK 0x1 /* rule2en */ 1202 #define E5_MSTORM_ISCSI_TASK_AG_CTX_RULE2EN_SHIFT 3 1203 #define E5_MSTORM_ISCSI_TASK_AG_CTX_RULE3EN_MASK 0x1 /* rule3en */ 1204 #define E5_MSTORM_ISCSI_TASK_AG_CTX_RULE3EN_SHIFT 4 1205 #define E5_MSTORM_ISCSI_TASK_AG_CTX_RULE4EN_MASK 0x1 /* rule4en */ 1206 #define E5_MSTORM_ISCSI_TASK_AG_CTX_RULE4EN_SHIFT 5 1207 #define E5_MSTORM_ISCSI_TASK_AG_CTX_RULE5EN_MASK 0x1 /* rule5en */ 1208 #define E5_MSTORM_ISCSI_TASK_AG_CTX_RULE5EN_SHIFT 6 1209 #define E5_MSTORM_ISCSI_TASK_AG_CTX_RULE6EN_MASK 0x1 /* rule6en */ 1210 #define E5_MSTORM_ISCSI_TASK_AG_CTX_RULE6EN_SHIFT 7 1211 u8 flags3; 1212 #define E5_MSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED1_MASK 0x1 /* bit4 */ 1213 #define E5_MSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED1_SHIFT 0 1214 #define E5_MSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED2_MASK 0x3 /* cf3 */ 1215 #define E5_MSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED2_SHIFT 1 1216 #define E5_MSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED3_MASK 0x3 /* cf4 */ 1217 #define E5_MSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED3_SHIFT 3 1218 #define E5_MSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED4_MASK 0x1 /* cf3en */ 1219 #define E5_MSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED4_SHIFT 5 1220 #define E5_MSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED5_MASK 0x1 /* cf4en */ 1221 #define E5_MSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED5_SHIFT 6 1222 #define E5_MSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED6_MASK 0x1 /* rule7en */ 1223 #define E5_MSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED6_SHIFT 7 1224 __le32 reg0 /* reg0 */; 1225 u8 byte2 /* byte2 */; 1226 u8 byte3 /* byte3 */; 1227 u8 byte4 /* byte4 */; 1228 u8 e4_reserved7 /* byte5 */; 1229 }; 1230 1231 struct e5_ustorm_iscsi_task_ag_ctx 1232 { 1233 u8 reserved /* cdu_validation */; 1234 u8 state_and_core_id /* state_and_core_id */; 1235 __le16 icid /* icid */; 1236 u8 flags0; 1237 #define E5_USTORM_ISCSI_TASK_AG_CTX_CONNECTION_TYPE_MASK 0xF /* connection_type */ 1238 #define E5_USTORM_ISCSI_TASK_AG_CTX_CONNECTION_TYPE_SHIFT 0 1239 #define E5_USTORM_ISCSI_TASK_AG_CTX_EXIST_IN_QM0_MASK 0x1 /* exist_in_qm0 */ 1240 #define E5_USTORM_ISCSI_TASK_AG_CTX_EXIST_IN_QM0_SHIFT 4 1241 #define E5_USTORM_ISCSI_TASK_AG_CTX_BIT1_MASK 0x1 /* exist_in_qm1 */ 1242 #define E5_USTORM_ISCSI_TASK_AG_CTX_BIT1_SHIFT 5 1243 #define E5_USTORM_ISCSI_TASK_AG_CTX_HQ_SCANNED_CF_MASK 0x3 /* timer0cf */ 1244 #define E5_USTORM_ISCSI_TASK_AG_CTX_HQ_SCANNED_CF_SHIFT 6 1245 u8 flags1; 1246 #define E5_USTORM_ISCSI_TASK_AG_CTX_RESERVED1_MASK 0x3 /* timer1cf */ 1247 #define E5_USTORM_ISCSI_TASK_AG_CTX_RESERVED1_SHIFT 0 1248 #define E5_USTORM_ISCSI_TASK_AG_CTX_R2T2RECV_MASK 0x3 /* timer2cf */ 1249 #define E5_USTORM_ISCSI_TASK_AG_CTX_R2T2RECV_SHIFT 2 1250 #define E5_USTORM_ISCSI_TASK_AG_CTX_CF3_MASK 0x3 /* timer_stop_all */ 1251 #define E5_USTORM_ISCSI_TASK_AG_CTX_CF3_SHIFT 4 1252 #define E5_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_CF_MASK 0x3 /* dif_error_cf */ 1253 #define E5_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_CF_SHIFT 6 1254 u8 flags2; 1255 #define E5_USTORM_ISCSI_TASK_AG_CTX_HQ_SCANNED_CF_EN_MASK 0x1 /* cf0en */ 1256 #define E5_USTORM_ISCSI_TASK_AG_CTX_HQ_SCANNED_CF_EN_SHIFT 0 1257 #define E5_USTORM_ISCSI_TASK_AG_CTX_DISABLE_DATA_ACKED_MASK 0x1 /* cf1en */ 1258 #define E5_USTORM_ISCSI_TASK_AG_CTX_DISABLE_DATA_ACKED_SHIFT 1 1259 #define E5_USTORM_ISCSI_TASK_AG_CTX_R2T2RECV_EN_MASK 0x1 /* cf2en */ 1260 #define E5_USTORM_ISCSI_TASK_AG_CTX_R2T2RECV_EN_SHIFT 2 1261 #define E5_USTORM_ISCSI_TASK_AG_CTX_CF3EN_MASK 0x1 /* cf3en */ 1262 #define E5_USTORM_ISCSI_TASK_AG_CTX_CF3EN_SHIFT 3 1263 #define E5_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_CF_EN_MASK 0x1 /* cf4en */ 1264 #define E5_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_CF_EN_SHIFT 4 1265 #define E5_USTORM_ISCSI_TASK_AG_CTX_CMP_DATA_TOTAL_EXP_EN_MASK 0x1 /* rule0en */ 1266 #define E5_USTORM_ISCSI_TASK_AG_CTX_CMP_DATA_TOTAL_EXP_EN_SHIFT 5 1267 #define E5_USTORM_ISCSI_TASK_AG_CTX_RULE1EN_MASK 0x1 /* rule1en */ 1268 #define E5_USTORM_ISCSI_TASK_AG_CTX_RULE1EN_SHIFT 6 1269 #define E5_USTORM_ISCSI_TASK_AG_CTX_CMP_CONT_RCV_EXP_EN_MASK 0x1 /* rule2en */ 1270 #define E5_USTORM_ISCSI_TASK_AG_CTX_CMP_CONT_RCV_EXP_EN_SHIFT 7 1271 u8 flags3; 1272 #define E5_USTORM_ISCSI_TASK_AG_CTX_RULE3EN_MASK 0x1 /* rule3en */ 1273 #define E5_USTORM_ISCSI_TASK_AG_CTX_RULE3EN_SHIFT 0 1274 #define E5_USTORM_ISCSI_TASK_AG_CTX_RULE4EN_MASK 0x1 /* rule4en */ 1275 #define E5_USTORM_ISCSI_TASK_AG_CTX_RULE4EN_SHIFT 1 1276 #define E5_USTORM_ISCSI_TASK_AG_CTX_RULE5EN_MASK 0x1 /* rule5en */ 1277 #define E5_USTORM_ISCSI_TASK_AG_CTX_RULE5EN_SHIFT 2 1278 #define E5_USTORM_ISCSI_TASK_AG_CTX_RULE6EN_MASK 0x1 /* rule6en */ 1279 #define E5_USTORM_ISCSI_TASK_AG_CTX_RULE6EN_SHIFT 3 1280 #define E5_USTORM_ISCSI_TASK_AG_CTX_E4_RESERVED1_MASK 0x1 /* bit2 */ 1281 #define E5_USTORM_ISCSI_TASK_AG_CTX_E4_RESERVED1_SHIFT 4 1282 #define E5_USTORM_ISCSI_TASK_AG_CTX_E4_RESERVED2_MASK 0x1 /* bit3 */ 1283 #define E5_USTORM_ISCSI_TASK_AG_CTX_E4_RESERVED2_SHIFT 5 1284 #define E5_USTORM_ISCSI_TASK_AG_CTX_E4_RESERVED3_MASK 0x1 /* bit4 */ 1285 #define E5_USTORM_ISCSI_TASK_AG_CTX_E4_RESERVED3_SHIFT 6 1286 #define E5_USTORM_ISCSI_TASK_AG_CTX_E4_RESERVED4_MASK 0x1 /* rule7en */ 1287 #define E5_USTORM_ISCSI_TASK_AG_CTX_E4_RESERVED4_SHIFT 7 1288 u8 flags4; 1289 #define E5_USTORM_ISCSI_TASK_AG_CTX_E4_RESERVED5_MASK 0x3 /* cf5 */ 1290 #define E5_USTORM_ISCSI_TASK_AG_CTX_E4_RESERVED5_SHIFT 0 1291 #define E5_USTORM_ISCSI_TASK_AG_CTX_E4_RESERVED6_MASK 0x1 /* cf5en */ 1292 #define E5_USTORM_ISCSI_TASK_AG_CTX_E4_RESERVED6_SHIFT 2 1293 #define E5_USTORM_ISCSI_TASK_AG_CTX_E4_RESERVED7_MASK 0x1 /* rule8en */ 1294 #define E5_USTORM_ISCSI_TASK_AG_CTX_E4_RESERVED7_SHIFT 3 1295 #define E5_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_TYPE_MASK 0xF /* dif_error_type */ 1296 #define E5_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_TYPE_SHIFT 4 1297 u8 next_tid_valid /* byte2 */; 1298 u8 byte3 /* byte3 */; 1299 u8 e4_reserved8 /* byte4 */; 1300 __le32 dif_err_intervals /* dif_err_intervals */; 1301 __le32 dif_error_1st_interval /* dif_error_1st_interval */; 1302 __le32 rcv_cont_len /* reg2 */; 1303 __le32 exp_cont_len /* reg3 */; 1304 __le32 total_data_acked /* reg4 */; 1305 __le32 exp_data_acked /* reg5 */; 1306 __le16 word1 /* word1 */; 1307 __le16 next_tid /* word2 */; 1308 __le32 hdr_residual_count /* reg6 */; 1309 __le32 exp_r2t_sn /* reg7 */; 1310 }; 1311 1312 /* 1313 * iscsi task context 1314 */ 1315 struct e5_iscsi_task_context 1316 { 1317 struct ystorm_iscsi_task_st_ctx ystorm_st_context /* ystorm storm context */; 1318 struct e5_ystorm_iscsi_task_ag_ctx ystorm_ag_context /* ystorm aggregative context */; 1319 struct regpair ystorm_ag_padding[2] /* padding */; 1320 struct tdif_task_context tdif_context /* tdif context */; 1321 struct e5_mstorm_iscsi_task_ag_ctx mstorm_ag_context /* mstorm aggregative context */; 1322 struct regpair mstorm_ag_padding[2] /* padding */; 1323 struct e5_ustorm_iscsi_task_ag_ctx ustorm_ag_context /* ustorm aggregative context */; 1324 struct mstorm_iscsi_task_st_ctx mstorm_st_context /* mstorm storm context */; 1325 struct ustorm_iscsi_task_st_ctx ustorm_st_context /* ustorm storm context */; 1326 struct rdif_task_context rdif_context /* rdif context */; 1327 }; 1328 1329 1330 1331 1332 1333 /* 1334 * ISCSI connection offload params passed by driver to FW in ISCSI offload ramrod 1335 */ 1336 struct iscsi_conn_offload_params 1337 { 1338 struct regpair sq_pbl_addr /* PBL SQ pointer */; 1339 struct regpair r2tq_pbl_addr /* PBL R2TQ pointer */; 1340 struct regpair xhq_pbl_addr /* PBL XHQ pointer */; 1341 struct regpair uhq_pbl_addr /* PBL UHQ pointer */; 1342 __le32 initial_ack /* Initial ack, received from TCP */; 1343 __le16 physical_q0 /* Physical QM queue to be tied to logical Q0 */; 1344 __le16 physical_q1 /* Physical QM queue to be tied to logical Q1 */; 1345 u8 flags; 1346 #define ISCSI_CONN_OFFLOAD_PARAMS_TCP_ON_CHIP_1B_MASK 0x1 /* TCP connect/terminate option. 0 - TCP on host (option-1); 1 - TCP on chip (option-2). */ 1347 #define ISCSI_CONN_OFFLOAD_PARAMS_TCP_ON_CHIP_1B_SHIFT 0 1348 #define ISCSI_CONN_OFFLOAD_PARAMS_TARGET_MODE_MASK 0x1 /* iSCSI connect mode: 0-iSCSI Initiator, 1-iSCSI Target */ 1349 #define ISCSI_CONN_OFFLOAD_PARAMS_TARGET_MODE_SHIFT 1 1350 #define ISCSI_CONN_OFFLOAD_PARAMS_RESTRICTED_MODE_MASK 0x1 /* Restricted mode: 0 - un-restricted (deviating from the RFC), 1 - restricted (according to the RFC) */ 1351 #define ISCSI_CONN_OFFLOAD_PARAMS_RESTRICTED_MODE_SHIFT 2 1352 #define ISCSI_CONN_OFFLOAD_PARAMS_RESERVED1_MASK 0x1F /* reserved */ 1353 #define ISCSI_CONN_OFFLOAD_PARAMS_RESERVED1_SHIFT 3 1354 u8 pbl_page_size_log /* Page size with PBEs log; Page Size = 2^(page_size_log+12) */; 1355 u8 pbe_page_size_log /* PBE page size with log; Page Size = 2^(page_size_log+12) */; 1356 u8 default_cq /* Default CQ used to write unsolicited data */; 1357 __le32 stat_sn /* StatSn for Target Mode only: the first Login Response StatSn value for Target mode */; 1358 }; 1359 1360 1361 /* 1362 * spe message header 1363 */ 1364 struct iscsi_slow_path_hdr 1365 { 1366 u8 op_code /* iscsi bus-drv message opcode */; 1367 u8 flags; 1368 #define ISCSI_SLOW_PATH_HDR_RESERVED0_MASK 0xF 1369 #define ISCSI_SLOW_PATH_HDR_RESERVED0_SHIFT 0 1370 #define ISCSI_SLOW_PATH_HDR_LAYER_CODE_MASK 0x7 /* protocol layer (L2,L3,L4,L5) */ 1371 #define ISCSI_SLOW_PATH_HDR_LAYER_CODE_SHIFT 4 1372 #define ISCSI_SLOW_PATH_HDR_RESERVED1_MASK 0x1 1373 #define ISCSI_SLOW_PATH_HDR_RESERVED1_SHIFT 7 1374 }; 1375 1376 /* 1377 * ISCSI connection update params passed by driver to FW in ISCSI update ramrod 1378 */ 1379 struct iscsi_conn_update_ramrod_params 1380 { 1381 struct iscsi_slow_path_hdr hdr /* spe message header. */; 1382 __le16 conn_id /* ISCSI Connection ID. (MOTI_COHEN : draft for DrvSim sake) */; 1383 __le32 fw_cid /* Context ID (cid) of the connection. (MOTI_COHEN : draft for DrvSim sake) */; 1384 u8 flags; 1385 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_HD_EN_MASK 0x1 /* Is header digest enabled */ 1386 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_HD_EN_SHIFT 0 1387 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DD_EN_MASK 0x1 /* Is data digest enabled */ 1388 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DD_EN_SHIFT 1 1389 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_INITIAL_R2T_MASK 0x1 /* Initial R2T */ 1390 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_INITIAL_R2T_SHIFT 2 1391 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_IMMEDIATE_DATA_MASK 0x1 /* Immediate data */ 1392 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_IMMEDIATE_DATA_SHIFT 3 1393 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DIF_BLOCK_SIZE_MASK 0x1 /* 0 - 512B, 1 - 4K */ 1394 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DIF_BLOCK_SIZE_SHIFT 4 1395 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DIF_ON_HOST_EN_MASK 0x1 /* 0 - no DIF, 1 - could be enabled per task */ 1396 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DIF_ON_HOST_EN_SHIFT 5 1397 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DIF_ON_IMM_EN_MASK 0x1 /* Support DIF on immediate, 1-Yes, 0-No */ 1398 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DIF_ON_IMM_EN_SHIFT 6 1399 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_LUN_MAPPER_EN_MASK 0x1 /* valid only if dif_on_imm_en=1 Does this connection has dif configuration per Lun or Default dif configuration */ 1400 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_LUN_MAPPER_EN_SHIFT 7 1401 u8 reserved0[3]; 1402 __le32 max_seq_size /* Maximum sequence size. Valid for TX and RX */; 1403 __le32 max_send_pdu_length /* Maximum PDU size. Valid for the TX */; 1404 __le32 max_recv_pdu_length /* Maximum PDU size. Valid for the RX */; 1405 __le32 first_seq_length /* Initial sequence length */; 1406 __le32 exp_stat_sn /* ExpStatSn - Option1 Only */; 1407 union dif_configuration_params dif_on_imme_params /* dif on immmediate params - Target mode Only */; 1408 }; 1409 1410 1411 /* 1412 * iSCSI CQ element 1413 */ 1414 struct iscsi_cqe_common 1415 { 1416 __le16 conn_id /* Drivers connection Id */; 1417 u8 cqe_type /* Indicates CQE type */; 1418 union cqe_error_status error_bitmap /* CQE error status */; 1419 __le32 reserved[3]; 1420 union iscsi_task_hdr iscsi_hdr /* iscsi header union */; 1421 }; 1422 1423 /* 1424 * iSCSI CQ element 1425 */ 1426 struct iscsi_cqe_solicited 1427 { 1428 __le16 conn_id /* Drivers connection Id */; 1429 u8 cqe_type /* Indicates CQE type */; 1430 union cqe_error_status error_bitmap /* CQE error status */; 1431 __le16 itid /* initiator itt (Initiator mode) or target ttt (Target mode) */; 1432 u8 task_type /* Task type */; 1433 u8 fw_dbg_field /* FW debug params */; 1434 u8 caused_conn_err /* Equals 1 if this TID caused the connection error, otherwise equals 0. */; 1435 u8 reserved0[3]; 1436 __le32 reserved1[1]; 1437 union iscsi_task_hdr iscsi_hdr /* iscsi header union */; 1438 }; 1439 1440 /* 1441 * iSCSI CQ element 1442 */ 1443 struct iscsi_cqe_unsolicited 1444 { 1445 __le16 conn_id /* Drivers connection Id */; 1446 u8 cqe_type /* Indicates CQE type */; 1447 union cqe_error_status error_bitmap /* CQE error status */; 1448 __le16 reserved0 /* Reserved */; 1449 u8 reserved1 /* Reserved */; 1450 u8 unsol_cqe_type /* Represent this unsolicited CQE position in a sequence of packets belonging to the same unsolicited PDU */; 1451 __le16 rqe_opaque /* Relevant for Unsolicited CQE only: The opaque data of RQ BDQ */; 1452 __le16 reserved2[3] /* Reserved */; 1453 union iscsi_task_hdr iscsi_hdr /* iscsi header union */; 1454 }; 1455 1456 /* 1457 * iSCSI CQ element 1458 */ 1459 union iscsi_cqe 1460 { 1461 struct iscsi_cqe_common cqe_common /* Common CQE */; 1462 struct iscsi_cqe_solicited cqe_solicited /* Solicited CQE */; 1463 struct iscsi_cqe_unsolicited cqe_unsolicited /* Unsolicited CQE. relevant only when cqe_opcode == ISCSI_CQE_TYPE_UNSOLICITED */; 1464 }; 1465 1466 1467 /* 1468 * iSCSI CQE type 1469 */ 1470 enum iscsi_cqes_type 1471 { 1472 ISCSI_CQE_TYPE_SOLICITED=1 /* iSCSI CQE with solicited data */, 1473 ISCSI_CQE_TYPE_UNSOLICITED /* iSCSI CQE with unsolicited data */, 1474 ISCSI_CQE_TYPE_SOLICITED_WITH_SENSE /* iSCSI CQE with solicited with sense data */, 1475 ISCSI_CQE_TYPE_TASK_CLEANUP /* iSCSI CQE task cleanup */, 1476 ISCSI_CQE_TYPE_DUMMY /* iSCSI Dummy CQE */, 1477 MAX_ISCSI_CQES_TYPE 1478 }; 1479 1480 1481 1482 1483 1484 /* 1485 * iSCSI CQE type 1486 */ 1487 enum iscsi_cqe_unsolicited_type 1488 { 1489 ISCSI_CQE_UNSOLICITED_NONE /* iSCSI CQE with unsolicited data */, 1490 ISCSI_CQE_UNSOLICITED_SINGLE /* iSCSI CQE with unsolicited data */, 1491 ISCSI_CQE_UNSOLICITED_FIRST /* iSCSI CQE with unsolicited data */, 1492 ISCSI_CQE_UNSOLICITED_MIDDLE /* iSCSI CQE with unsolicited data */, 1493 ISCSI_CQE_UNSOLICITED_LAST /* iSCSI CQE with unsolicited data */, 1494 MAX_ISCSI_CQE_UNSOLICITED_TYPE 1495 }; 1496 1497 1498 1499 1500 /* 1501 * iscsi debug modes 1502 */ 1503 struct iscsi_debug_modes 1504 { 1505 u8 flags; 1506 #define ISCSI_DEBUG_MODES_ASSERT_IF_RX_CONN_ERROR_MASK 0x1 /* Assert on Rx connection error */ 1507 #define ISCSI_DEBUG_MODES_ASSERT_IF_RX_CONN_ERROR_SHIFT 0 1508 #define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_RESET_MASK 0x1 /* Assert if TCP RESET arrived */ 1509 #define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_RESET_SHIFT 1 1510 #define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_FIN_MASK 0x1 /* Assert if TCP FIN arrived */ 1511 #define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_FIN_SHIFT 2 1512 #define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_CLEANUP_MASK 0x1 /* Assert if cleanup flow */ 1513 #define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_CLEANUP_SHIFT 3 1514 #define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_REJECT_OR_ASYNC_MASK 0x1 /* Assert if REJECT PDU or ASYNC PDU arrived */ 1515 #define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_REJECT_OR_ASYNC_SHIFT 4 1516 #define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_NOP_MASK 0x1 /* Assert if NOP IN PDU or NOP OUT PDU arrived */ 1517 #define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_NOP_SHIFT 5 1518 #define ISCSI_DEBUG_MODES_ASSERT_IF_DATA_DIGEST_ERROR_MASK 0x1 /* Assert if data digest error */ 1519 #define ISCSI_DEBUG_MODES_ASSERT_IF_DATA_DIGEST_ERROR_SHIFT 6 1520 #define ISCSI_DEBUG_MODES_ASSERT_IF_DIF_ERROR_MASK 0x1 /* Assert if DIF error */ 1521 #define ISCSI_DEBUG_MODES_ASSERT_IF_DIF_ERROR_SHIFT 7 1522 }; 1523 1524 1525 1526 /* 1527 * iSCSI kernel completion queue IDs 1528 */ 1529 enum iscsi_eqe_opcode 1530 { 1531 ISCSI_EVENT_TYPE_INIT_FUNC=0 /* iSCSI response after init Ramrod */, 1532 ISCSI_EVENT_TYPE_DESTROY_FUNC /* iSCSI response after destroy Ramrod */, 1533 ISCSI_EVENT_TYPE_OFFLOAD_CONN /* iSCSI response after option 2 offload Ramrod */, 1534 ISCSI_EVENT_TYPE_UPDATE_CONN /* iSCSI response after update Ramrod */, 1535 ISCSI_EVENT_TYPE_CLEAR_SQ /* iSCSI response after clear sq Ramrod */, 1536 ISCSI_EVENT_TYPE_TERMINATE_CONN /* iSCSI response after termination Ramrod */, 1537 ISCSI_EVENT_TYPE_MAC_UPDATE_CONN /* iSCSI response after MAC address update Ramrod */, 1538 ISCSI_EVENT_TYPE_ASYN_CONNECT_COMPLETE /* iSCSI response after option 2 connect completed (A-syn EQE) */, 1539 ISCSI_EVENT_TYPE_ASYN_TERMINATE_DONE /* iSCSI response after option 2 termination completed (A-syn EQE) */, 1540 RESERVED9 /* reserved9 */, 1541 ISCSI_EVENT_TYPE_START_OF_ERROR_TYPES=10 /* Never returned in EQE, used to separate Regular event types from Error event types */, 1542 ISCSI_EVENT_TYPE_ASYN_ABORT_RCVD /* iSCSI abort response after TCP RST packet recieve (A-syn EQE) */, 1543 ISCSI_EVENT_TYPE_ASYN_CLOSE_RCVD /* iSCSI response after close receive (A-syn EQE) */, 1544 ISCSI_EVENT_TYPE_ASYN_SYN_RCVD /* iSCSI response after TCP SYN+ACK packet receive (A-syn EQE) */, 1545 ISCSI_EVENT_TYPE_ASYN_MAX_RT_TIME /* iSCSI error - tcp max retransmit time (A-syn EQE) */, 1546 ISCSI_EVENT_TYPE_ASYN_MAX_RT_CNT /* iSCSI error - tcp max retransmit count (A-syn EQE) */, 1547 ISCSI_EVENT_TYPE_ASYN_MAX_KA_PROBES_CNT /* iSCSI error - tcp ka probes count (A-syn EQE) */, 1548 ISCSI_EVENT_TYPE_ASYN_FIN_WAIT2 /* iSCSI error - tcp fin wait 2 (A-syn EQE) */, 1549 ISCSI_EVENT_TYPE_ISCSI_CONN_ERROR /* iSCSI error response (A-syn EQE) */, 1550 ISCSI_EVENT_TYPE_TCP_CONN_ERROR /* iSCSI error - tcp error (A-syn EQE) */, 1551 MAX_ISCSI_EQE_OPCODE 1552 }; 1553 1554 1555 /* 1556 * iSCSI EQE and CQE completion status 1557 */ 1558 enum iscsi_error_types 1559 { 1560 ISCSI_STATUS_NONE=0, 1561 ISCSI_CQE_ERROR_UNSOLICITED_RCV_ON_INVALID_CONN=1, 1562 ISCSI_CONN_ERROR_TASK_CID_MISMATCH /* iSCSI connection error - Corrupted Task context */, 1563 ISCSI_CONN_ERROR_TASK_NOT_VALID /* iSCSI connection error - The task is not valid */, 1564 ISCSI_CONN_ERROR_RQ_RING_IS_FULL /* iSCSI connection error - RQ full */, 1565 ISCSI_CONN_ERROR_CMDQ_RING_IS_FULL /* iSCSI connection error - CMDQ full (Target only) */, 1566 ISCSI_CONN_ERROR_HQE_CACHING_FAILED /* iSCSI connection error - HQ error */, 1567 ISCSI_CONN_ERROR_HEADER_DIGEST_ERROR /* iSCSI connection error - Header digest error */, 1568 ISCSI_CONN_ERROR_LOCAL_COMPLETION_ERROR /* iSCSI connection error - Local completion bit is not correct (A-syn EQE) */, 1569 ISCSI_CONN_ERROR_DATA_OVERRUN /* iSCSI connection error - data overrun */, 1570 ISCSI_CONN_ERROR_OUT_OF_SGES_ERROR /* iSCSI connection error - out of sges in task context */, 1571 ISCSI_CONN_ERROR_IP_OPTIONS_ERROR /* TCP connection error - IP option error */, 1572 ISCSI_CONN_ERROR_PRS_ERRORS /* TCP connection error - error indication form parser */, 1573 ISCSI_CONN_ERROR_CONNECT_INVALID_TCP_OPTION /* TCP connection error - tcp options error(option 2 only) */, 1574 ISCSI_CONN_ERROR_TCP_IP_FRAGMENT_ERROR /* TCP connection error - IP fragmentation error */, 1575 ISCSI_CONN_ERROR_PROTOCOL_ERR_AHS_LEN /* iSCSI connection error - invalid AHS length (Target only) */, 1576 ISCSI_CONN_ERROR_PROTOCOL_ERR_AHS_TYPE /* iSCSI connection error - invalid AHS type (Target only) */, 1577 ISCSI_CONN_ERROR_PROTOCOL_ERR_ITT_OUT_OF_RANGE /* iSCSI connection error - invalid ITT */, 1578 ISCSI_CONN_ERROR_PROTOCOL_ERR_TTT_OUT_OF_RANGE /* iSCSI connection error - invalid TTT (Target only) */, 1579 ISCSI_CONN_ERROR_PROTOCOL_ERR_DATA_SEG_LEN_EXCEEDS_PDU_SIZE /* iSCSI connection error - PDU data_seg_len > max receive pdu size */, 1580 ISCSI_CONN_ERROR_PROTOCOL_ERR_INVALID_OPCODE /* iSCSI connection error - invalid PDU opcode */, 1581 ISCSI_CONN_ERROR_PROTOCOL_ERR_INVALID_OPCODE_BEFORE_UPDATE /* iSCSI connection error - invalid PDU opcode before update ramrod (Option 2 only) */, 1582 ISCSI_CONN_ERROR_UNVALID_NOPIN_DSL /* iSCSI connection error - NOPIN dsl > 0 and ITT = 0xffffffff (Initiator only) */, 1583 ISCSI_CONN_ERROR_PROTOCOL_ERR_R2T_CARRIES_NO_DATA /* iSCSI connection error - R2T dsl > 0 (Initiator only) */, 1584 ISCSI_CONN_ERROR_PROTOCOL_ERR_DATA_SN /* iSCSI connection error - DATA-SN error */, 1585 ISCSI_CONN_ERROR_PROTOCOL_ERR_DATA_IN_TTT /* iSCSI connection error - DATA-IN TTT error (Initiator only) */, 1586 ISCSI_CONN_ERROR_PROTOCOL_ERR_DATA_OUT_ITT /* iSCSI connection error - DATA-OUT ITT error (Target only) */, 1587 ISCSI_CONN_ERROR_PROTOCOL_ERR_R2T_TTT /* iSCSI connection error - R2T TTT error (Initiator only) */, 1588 ISCSI_CONN_ERROR_PROTOCOL_ERR_R2T_BUFFER_OFFSET /* iSCSI connection error - R2T buffer offset error (Initiator only) */, 1589 ISCSI_CONN_ERROR_PROTOCOL_ERR_BUFFER_OFFSET_OOO /* iSCSI connection error - DATA PDU buffer offset error */, 1590 ISCSI_CONN_ERROR_PROTOCOL_ERR_R2T_SN /* iSCSI connection error - R2T SN error (Initiator only) */, 1591 ISCSI_CONN_ERROR_PROTOCOL_ERR_DESIRED_DATA_TRNS_LEN_0 /* iSCSI connection error - R2T desired data transfer length = 0 (Initiator only) */, 1592 ISCSI_CONN_ERROR_PROTOCOL_ERR_DESIRED_DATA_TRNS_LEN_1 /* iSCSI connection error - R2T desired data transfer length less then max burst size (Initiator only) */, 1593 ISCSI_CONN_ERROR_PROTOCOL_ERR_DESIRED_DATA_TRNS_LEN_2 /* iSCSI connection error - R2T desired data transfer length + buffer offset > task size (Initiator only) */, 1594 ISCSI_CONN_ERROR_PROTOCOL_ERR_LUN /* iSCSI connection error - R2T unvalid LUN (Initiator only) */, 1595 ISCSI_CONN_ERROR_PROTOCOL_ERR_F_BIT_ZERO /* iSCSI connection error - All data has been already received, however it is not the end of sequence (Initiator only) */, 1596 ISCSI_CONN_ERROR_PROTOCOL_ERR_F_BIT_ZERO_S_BIT_ONE /* iSCSI connection error - S-bit and final bit = 1 (Initiator only) */, 1597 ISCSI_CONN_ERROR_PROTOCOL_ERR_EXP_STAT_SN /* iSCSI connection error - STAT SN error (Initiator only) */, 1598 ISCSI_CONN_ERROR_PROTOCOL_ERR_DSL_NOT_ZERO /* iSCSI connection error - TMF or LOGOUT PDUs dsl > 0 (Initiator only) */, 1599 ISCSI_CONN_ERROR_PROTOCOL_ERR_INVALID_DSL /* iSCSI connection error - CMD PDU dsl>0 while immediate data is disabled (Target only) */, 1600 ISCSI_CONN_ERROR_PROTOCOL_ERR_DATA_SEG_LEN_TOO_BIG /* iSCSI connection error - Data In overrun (Initiator only) */, 1601 ISCSI_CONN_ERROR_PROTOCOL_ERR_OUTSTANDING_R2T_COUNT /* iSCSI connection error - >1 outstanding R2T (Initiator only) */, 1602 ISCSI_CONN_ERROR_PROTOCOL_ERR_DIF_TX /* iSCSI connection error - DIF Tx error + DIF error drop is enabled (Target only) */, 1603 ISCSI_CONN_ERROR_SENSE_DATA_LENGTH /* iSCSI connection error - Sense data length > 256 (Initiator only) */, 1604 ISCSI_CONN_ERROR_DATA_PLACEMENT_ERROR /* iSCSI connection error - Data placement error */, 1605 ISCSI_CONN_ERROR_INVALID_ITT /* iSCSI connection error - Invalid ITT (Target Only) */, 1606 ISCSI_ERROR_UNKNOWN /* iSCSI connection error */, 1607 MAX_ISCSI_ERROR_TYPES 1608 }; 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 /* 1620 * iSCSI Ramrod Command IDs 1621 */ 1622 enum iscsi_ramrod_cmd_id 1623 { 1624 ISCSI_RAMROD_CMD_ID_UNUSED=0, 1625 ISCSI_RAMROD_CMD_ID_INIT_FUNC=1 /* iSCSI function init Ramrod */, 1626 ISCSI_RAMROD_CMD_ID_DESTROY_FUNC=2 /* iSCSI function destroy Ramrod */, 1627 ISCSI_RAMROD_CMD_ID_OFFLOAD_CONN=3 /* iSCSI connection offload Ramrod */, 1628 ISCSI_RAMROD_CMD_ID_UPDATE_CONN=4 /* iSCSI connection update Ramrod */, 1629 ISCSI_RAMROD_CMD_ID_TERMINATION_CONN=5 /* iSCSI connection offload Ramrod. Command ID known only to FW and VBD */, 1630 ISCSI_RAMROD_CMD_ID_CLEAR_SQ=6 /* iSCSI connection clear-sq ramrod. */, 1631 ISCSI_RAMROD_CMD_ID_MAC_UPDATE=7 /* iSCSI connection update MAC address ramrod. */, 1632 MAX_ISCSI_RAMROD_CMD_ID 1633 }; 1634 1635 1636 1637 1638 1639 1640 1641 /* 1642 * ISCSI connection termination request 1643 */ 1644 struct iscsi_spe_conn_mac_update 1645 { 1646 struct iscsi_slow_path_hdr hdr /* spe message header. */; 1647 __le16 conn_id /* ISCSI Connection ID. */; 1648 __le32 fw_cid /* Context ID (cid) of the connection. */; 1649 __le16 remote_mac_addr_lo /* new remote mac address lo */; 1650 __le16 remote_mac_addr_mid /* new remote mac address mid */; 1651 __le16 remote_mac_addr_hi /* new remote mac address hi */; 1652 u8 reserved0[2]; 1653 }; 1654 1655 1656 /* 1657 * ISCSI and TCP connection(Option 1) offload params passed by driver to FW in ISCSI offload ramrod 1658 */ 1659 struct iscsi_spe_conn_offload 1660 { 1661 struct iscsi_slow_path_hdr hdr /* spe message header. */; 1662 __le16 conn_id /* ISCSI Connection ID. */; 1663 __le32 fw_cid; 1664 struct iscsi_conn_offload_params iscsi /* iSCSI session offload params */; 1665 struct tcp_offload_params tcp /* iSCSI session offload params */; 1666 }; 1667 1668 1669 /* 1670 * ISCSI and TCP connection(Option 2) offload params passed by driver to FW in ISCSI offload ramrod 1671 */ 1672 struct iscsi_spe_conn_offload_option2 1673 { 1674 struct iscsi_slow_path_hdr hdr /* spe message header. */; 1675 __le16 conn_id /* ISCSI Connection ID. */; 1676 __le32 fw_cid; 1677 struct iscsi_conn_offload_params iscsi /* iSCSI session offload params */; 1678 struct tcp_offload_params_opt2 tcp /* iSCSI session offload params */; 1679 }; 1680 1681 1682 /* 1683 * ISCSI connection termination request 1684 */ 1685 struct iscsi_spe_conn_termination 1686 { 1687 struct iscsi_slow_path_hdr hdr /* spe message header. */; 1688 __le16 conn_id /* ISCSI Connection ID. */; 1689 __le32 fw_cid /* Context ID (cid) of the connection. */; 1690 u8 abortive /* Mark termination as abort(reset) flow */; 1691 u8 reserved0[7]; 1692 struct regpair queue_cnts_addr /* cmdq and unsolicited counters termination params */; 1693 struct regpair query_params_addr /* query_params_ptr */; 1694 }; 1695 1696 1697 /* 1698 * iSCSI firmware function destroy parameters 1699 */ 1700 struct iscsi_spe_func_dstry 1701 { 1702 struct iscsi_slow_path_hdr hdr /* spe message header. */; 1703 __le16 reserved0; 1704 __le32 reserved1; 1705 }; 1706 1707 1708 /* 1709 * iSCSI firmware function init parameters 1710 */ 1711 struct iscsi_spe_func_init 1712 { 1713 struct iscsi_slow_path_hdr hdr /* spe message header. */; 1714 __le16 half_way_close_timeout /* Half Way Close Timeout in Option 2 Close */; 1715 u8 num_sq_pages_in_ring /* Number of entries in the SQ PBL. Provided by driver at function init spe */; 1716 u8 num_r2tq_pages_in_ring /* Number of entries in the R2TQ PBL. Provided by driver at function init spe */; 1717 u8 num_uhq_pages_in_ring /* Number of entries in the uHQ PBL (xHQ entries is X2). Provided by driver at function init spe */; 1718 u8 ll2_rx_queue_id /* Queue ID of the Light-L2 Rx Queue */; 1719 u8 ooo_enable /* Enable Out Of Order mode (enable = 1) */; 1720 struct iscsi_debug_modes debug_mode /* Use iscsi_debug_mode flags */; 1721 __le16 reserved1; 1722 __le32 reserved2; 1723 struct scsi_init_func_params func_params /* Common SCSI init params passed by driver to FW in function init ramrod */; 1724 struct scsi_init_func_queues q_params /* SCSI RQ/CQ firmware function init parameters */; 1725 }; 1726 1727 1728 1729 /* 1730 * iSCSI task type 1731 */ 1732 enum iscsi_task_type 1733 { 1734 ISCSI_TASK_TYPE_INITIATOR_WRITE, 1735 ISCSI_TASK_TYPE_INITIATOR_READ, 1736 ISCSI_TASK_TYPE_MIDPATH, 1737 ISCSI_TASK_TYPE_UNSOLIC, 1738 ISCSI_TASK_TYPE_EXCHCLEANUP, 1739 ISCSI_TASK_TYPE_IRRELEVANT, 1740 ISCSI_TASK_TYPE_TARGET_WRITE, 1741 ISCSI_TASK_TYPE_TARGET_READ, 1742 ISCSI_TASK_TYPE_TARGET_RESPONSE, 1743 ISCSI_TASK_TYPE_LOGIN_RESPONSE, 1744 ISCSI_TASK_TYPE_TARGET_IMM_W_DIF, 1745 MAX_ISCSI_TASK_TYPE 1746 }; 1747 1748 1749 1750 1751 1752 1753 /* 1754 * iSCSI DesiredDataTransferLength/ttt union 1755 */ 1756 union iscsi_ttt_txlen_union 1757 { 1758 __le32 desired_tx_len /* desired data transfer length */; 1759 __le32 ttt /* target transfer tag */; 1760 }; 1761 1762 1763 /* 1764 * iSCSI uHQ element 1765 */ 1766 struct iscsi_uhqe 1767 { 1768 __le32 reg1; 1769 #define ISCSI_UHQE_PDU_PAYLOAD_LEN_MASK 0xFFFFF /* iSCSI payload (doesnt include padding or digest) or AHS length */ 1770 #define ISCSI_UHQE_PDU_PAYLOAD_LEN_SHIFT 0 1771 #define ISCSI_UHQE_LOCAL_COMP_MASK 0x1 /* local compleiton flag */ 1772 #define ISCSI_UHQE_LOCAL_COMP_SHIFT 20 1773 #define ISCSI_UHQE_TOGGLE_BIT_MASK 0x1 /* toggle bit to protect from uHQ full */ 1774 #define ISCSI_UHQE_TOGGLE_BIT_SHIFT 21 1775 #define ISCSI_UHQE_PURE_PAYLOAD_MASK 0x1 /* indicates whether pdu_payload_len contains pure payload length. if not, pdu_payload_len is AHS length */ 1776 #define ISCSI_UHQE_PURE_PAYLOAD_SHIFT 22 1777 #define ISCSI_UHQE_LOGIN_RESPONSE_PDU_MASK 0x1 /* indicates login pdu */ 1778 #define ISCSI_UHQE_LOGIN_RESPONSE_PDU_SHIFT 23 1779 #define ISCSI_UHQE_TASK_ID_HI_MASK 0xFF /* most significant byte of task_id */ 1780 #define ISCSI_UHQE_TASK_ID_HI_SHIFT 24 1781 __le32 reg2; 1782 #define ISCSI_UHQE_BUFFER_OFFSET_MASK 0xFFFFFF /* absolute offset in task */ 1783 #define ISCSI_UHQE_BUFFER_OFFSET_SHIFT 0 1784 #define ISCSI_UHQE_TASK_ID_LO_MASK 0xFF /* least significant byte of task_id */ 1785 #define ISCSI_UHQE_TASK_ID_LO_SHIFT 24 1786 }; 1787 1788 1789 /* 1790 * iSCSI WQ element 1791 */ 1792 struct iscsi_wqe 1793 { 1794 __le16 task_id /* The task identifier (itt) includes all the relevant information required for the task processing */; 1795 u8 flags; 1796 #define ISCSI_WQE_WQE_TYPE_MASK 0x7 /* Wqe type [use iscsi_wqe_type] */ 1797 #define ISCSI_WQE_WQE_TYPE_SHIFT 0 1798 #define ISCSI_WQE_NUM_SGES_MASK 0xF /* The driver will give a hint about sizes of SGEs for better credits evaluation at Xstorm */ 1799 #define ISCSI_WQE_NUM_SGES_SHIFT 3 1800 #define ISCSI_WQE_RESPONSE_MASK 0x1 /* 1 if this Wqe triggers a response and advances stat_sn, 0 otherwise */ 1801 #define ISCSI_WQE_RESPONSE_SHIFT 7 1802 struct iscsi_dif_flags prot_flags /* Task data-integrity flags (protection) */; 1803 __le32 contlen_cdbsize; 1804 #define ISCSI_WQE_CONT_LEN_MASK 0xFFFFFF /* expected/desired data transfer length */ 1805 #define ISCSI_WQE_CONT_LEN_SHIFT 0 1806 #define ISCSI_WQE_CDB_SIZE_MASK 0xFF /* Initiator mode only: equals SCSI command CDB size if extended CDB is used, otherwise equals zero. */ 1807 #define ISCSI_WQE_CDB_SIZE_SHIFT 24 1808 }; 1809 1810 1811 /* 1812 * iSCSI wqe type 1813 */ 1814 enum iscsi_wqe_type 1815 { 1816 ISCSI_WQE_TYPE_NORMAL /* iSCSI WQE type normal. excluding status bit in target mode. */, 1817 ISCSI_WQE_TYPE_TASK_CLEANUP /* iSCSI WQE type task cleanup */, 1818 ISCSI_WQE_TYPE_MIDDLE_PATH /* iSCSI WQE type middle path */, 1819 ISCSI_WQE_TYPE_LOGIN /* iSCSI WQE type login */, 1820 ISCSI_WQE_TYPE_FIRST_R2T_CONT /* iSCSI WQE type First Write Continuation (Target) */, 1821 ISCSI_WQE_TYPE_NONFIRST_R2T_CONT /* iSCSI WQE type Non-First Write Continuation (Target) */, 1822 ISCSI_WQE_TYPE_RESPONSE /* iSCSI WQE type SCSI response */, 1823 MAX_ISCSI_WQE_TYPE 1824 }; 1825 1826 1827 /* 1828 * iSCSI xHQ element 1829 */ 1830 struct iscsi_xhqe 1831 { 1832 union iscsi_ttt_txlen_union ttt_or_txlen /* iSCSI DesiredDataTransferLength/ttt union */; 1833 __le32 exp_stat_sn /* expected StatSn */; 1834 struct iscsi_dif_flags prot_flags /* Task data-integrity flags (protection) */; 1835 u8 total_ahs_length /* Initiator mode only: Total AHS Length. greater than zero if and only if PDU is SCSI command and CDB > 16 */; 1836 u8 opcode /* Type opcode for command PDU */; 1837 u8 flags; 1838 #define ISCSI_XHQE_FINAL_MASK 0x1 /* The Final(F) for this PDU */ 1839 #define ISCSI_XHQE_FINAL_SHIFT 0 1840 #define ISCSI_XHQE_STATUS_BIT_MASK 0x1 /* Whether this PDU is Data-In PDU with status_bit = 1 */ 1841 #define ISCSI_XHQE_STATUS_BIT_SHIFT 1 1842 #define ISCSI_XHQE_NUM_SGES_MASK 0xF /* If Predicted IO equals Min(8, number of SGEs in SGL), otherwise equals 0 */ 1843 #define ISCSI_XHQE_NUM_SGES_SHIFT 2 1844 #define ISCSI_XHQE_RESERVED0_MASK 0x3 /* reserved */ 1845 #define ISCSI_XHQE_RESERVED0_SHIFT 6 1846 union iscsi_seq_num seq_num /* R2T/DataSN sequence number */; 1847 __le16 reserved1; 1848 }; 1849 1850 1851 1852 /* 1853 * Per PF iSCSI receive path statistics - mStorm RAM structure 1854 */ 1855 struct mstorm_iscsi_stats_drv 1856 { 1857 struct regpair iscsi_rx_dropped_PDUs_task_not_valid /* Number of Rx silently dropped PDUs due to task not valid */; 1858 }; 1859 1860 1861 1862 /* 1863 * Per PF iSCSI transmit path statistics - pStorm RAM structure 1864 */ 1865 struct pstorm_iscsi_stats_drv 1866 { 1867 struct regpair iscsi_tx_bytes_cnt /* Counts the number of tx bytes that were transmitted */; 1868 struct regpair iscsi_tx_packet_cnt /* Counts the number of tx packets that were transmitted */; 1869 }; 1870 1871 1872 1873 /* 1874 * Per PF iSCSI receive path statistics - tStorm RAM structure 1875 */ 1876 struct tstorm_iscsi_stats_drv 1877 { 1878 struct regpair iscsi_rx_bytes_cnt /* Counts the number of rx bytes that were received */; 1879 struct regpair iscsi_rx_packet_cnt /* Counts the number of rx packets that were received */; 1880 struct regpair iscsi_rx_new_ooo_isle_events_cnt /* Counts the number of new out-of-order isle event */; 1881 __le32 iscsi_cmdq_threshold_cnt /* Counts the number of times elements in cmdQ reached threshold */; 1882 __le32 iscsi_rq_threshold_cnt /* Counts the number of times elements in RQQ reached threshold */; 1883 __le32 iscsi_immq_threshold_cnt /* Counts the number of times elements in immQ reached threshold */; 1884 }; 1885 1886 1887 /* 1888 * Per PF iSCSI receive path statistics - uStorm RAM structure 1889 */ 1890 struct ustorm_iscsi_stats_drv 1891 { 1892 struct regpair iscsi_rx_data_pdu_cnt /* Number of data PDUs that were received */; 1893 struct regpair iscsi_rx_r2t_pdu_cnt /* Number of R2T PDUs that were received */; 1894 struct regpair iscsi_rx_total_pdu_cnt /* Number of total PDUs that were received */; 1895 }; 1896 1897 1898 1899 /* 1900 * Per PF iSCSI transmit path statistics - xStorm RAM structure 1901 */ 1902 struct xstorm_iscsi_stats_drv 1903 { 1904 struct regpair iscsi_tx_go_to_slow_start_event_cnt /* Number of times slow start event occurred */; 1905 struct regpair iscsi_tx_fast_retransmit_event_cnt /* Number of times fast retransmit event occurred */; 1906 }; 1907 1908 1909 /* 1910 * Per PF iSCSI transmit path statistics - yStorm RAM structure 1911 */ 1912 struct ystorm_iscsi_stats_drv 1913 { 1914 struct regpair iscsi_tx_data_pdu_cnt /* Number of data PDUs that were transmitted */; 1915 struct regpair iscsi_tx_r2t_pdu_cnt /* Number of R2T PDUs that were transmitted */; 1916 struct regpair iscsi_tx_total_pdu_cnt /* Number of total PDUs that were transmitted */; 1917 }; 1918 1919 1920 1921 1922 1923 1924 struct e4_tstorm_iscsi_task_ag_ctx 1925 { 1926 u8 byte0 /* cdu_validation */; 1927 u8 byte1 /* state */; 1928 __le16 word0 /* icid */; 1929 u8 flags0; 1930 #define E4_TSTORM_ISCSI_TASK_AG_CTX_NIBBLE0_MASK 0xF /* connection_type */ 1931 #define E4_TSTORM_ISCSI_TASK_AG_CTX_NIBBLE0_SHIFT 0 1932 #define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT0_MASK 0x1 /* exist_in_qm0 */ 1933 #define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT0_SHIFT 4 1934 #define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT1_MASK 0x1 /* exist_in_qm1 */ 1935 #define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT1_SHIFT 5 1936 #define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT2_MASK 0x1 /* bit2 */ 1937 #define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT2_SHIFT 6 1938 #define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT3_MASK 0x1 /* bit3 */ 1939 #define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT3_SHIFT 7 1940 u8 flags1; 1941 #define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT4_MASK 0x1 /* bit4 */ 1942 #define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT4_SHIFT 0 1943 #define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT5_MASK 0x1 /* bit5 */ 1944 #define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT5_SHIFT 1 1945 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF0_MASK 0x3 /* timer0cf */ 1946 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF0_SHIFT 2 1947 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF1_MASK 0x3 /* timer1cf */ 1948 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF1_SHIFT 4 1949 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF2_MASK 0x3 /* timer2cf */ 1950 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF2_SHIFT 6 1951 u8 flags2; 1952 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF3_MASK 0x3 /* timer_stop_all */ 1953 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF3_SHIFT 0 1954 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF4_MASK 0x3 /* cf4 */ 1955 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF4_SHIFT 2 1956 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF5_MASK 0x3 /* cf5 */ 1957 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF5_SHIFT 4 1958 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF6_MASK 0x3 /* cf6 */ 1959 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF6_SHIFT 6 1960 u8 flags3; 1961 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF7_MASK 0x3 /* cf7 */ 1962 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF7_SHIFT 0 1963 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF0EN_MASK 0x1 /* cf0en */ 1964 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF0EN_SHIFT 2 1965 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF1EN_MASK 0x1 /* cf1en */ 1966 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF1EN_SHIFT 3 1967 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF2EN_MASK 0x1 /* cf2en */ 1968 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF2EN_SHIFT 4 1969 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF3EN_MASK 0x1 /* cf3en */ 1970 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF3EN_SHIFT 5 1971 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF4EN_MASK 0x1 /* cf4en */ 1972 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF4EN_SHIFT 6 1973 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF5EN_MASK 0x1 /* cf5en */ 1974 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF5EN_SHIFT 7 1975 u8 flags4; 1976 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF6EN_MASK 0x1 /* cf6en */ 1977 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF6EN_SHIFT 0 1978 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF7EN_MASK 0x1 /* cf7en */ 1979 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF7EN_SHIFT 1 1980 #define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE0EN_MASK 0x1 /* rule0en */ 1981 #define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE0EN_SHIFT 2 1982 #define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE1EN_MASK 0x1 /* rule1en */ 1983 #define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE1EN_SHIFT 3 1984 #define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE2EN_MASK 0x1 /* rule2en */ 1985 #define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE2EN_SHIFT 4 1986 #define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE3EN_MASK 0x1 /* rule3en */ 1987 #define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE3EN_SHIFT 5 1988 #define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE4EN_MASK 0x1 /* rule4en */ 1989 #define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE4EN_SHIFT 6 1990 #define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE5EN_MASK 0x1 /* rule5en */ 1991 #define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE5EN_SHIFT 7 1992 u8 byte2 /* byte2 */; 1993 __le16 word1 /* word1 */; 1994 __le32 reg0 /* reg0 */; 1995 u8 byte3 /* byte3 */; 1996 u8 byte4 /* byte4 */; 1997 __le16 word2 /* word2 */; 1998 __le16 word3 /* word3 */; 1999 __le16 word4 /* word4 */; 2000 __le32 reg1 /* reg1 */; 2001 __le32 reg2 /* reg2 */; 2002 }; 2003 2004 2005 2006 2007 2008 struct e5_tstorm_iscsi_task_ag_ctx 2009 { 2010 u8 byte0 /* cdu_validation */; 2011 u8 byte1 /* state_and_core_id */; 2012 __le16 word0 /* icid */; 2013 u8 flags0; 2014 #define E5_TSTORM_ISCSI_TASK_AG_CTX_NIBBLE0_MASK 0xF /* connection_type */ 2015 #define E5_TSTORM_ISCSI_TASK_AG_CTX_NIBBLE0_SHIFT 0 2016 #define E5_TSTORM_ISCSI_TASK_AG_CTX_BIT0_MASK 0x1 /* exist_in_qm0 */ 2017 #define E5_TSTORM_ISCSI_TASK_AG_CTX_BIT0_SHIFT 4 2018 #define E5_TSTORM_ISCSI_TASK_AG_CTX_BIT1_MASK 0x1 /* exist_in_qm1 */ 2019 #define E5_TSTORM_ISCSI_TASK_AG_CTX_BIT1_SHIFT 5 2020 #define E5_TSTORM_ISCSI_TASK_AG_CTX_BIT2_MASK 0x1 /* bit2 */ 2021 #define E5_TSTORM_ISCSI_TASK_AG_CTX_BIT2_SHIFT 6 2022 #define E5_TSTORM_ISCSI_TASK_AG_CTX_BIT3_MASK 0x1 /* bit3 */ 2023 #define E5_TSTORM_ISCSI_TASK_AG_CTX_BIT3_SHIFT 7 2024 u8 flags1; 2025 #define E5_TSTORM_ISCSI_TASK_AG_CTX_BIT4_MASK 0x1 /* bit4 */ 2026 #define E5_TSTORM_ISCSI_TASK_AG_CTX_BIT4_SHIFT 0 2027 #define E5_TSTORM_ISCSI_TASK_AG_CTX_BIT5_MASK 0x1 /* bit5 */ 2028 #define E5_TSTORM_ISCSI_TASK_AG_CTX_BIT5_SHIFT 1 2029 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF0_MASK 0x3 /* timer0cf */ 2030 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF0_SHIFT 2 2031 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF1_MASK 0x3 /* timer1cf */ 2032 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF1_SHIFT 4 2033 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF2_MASK 0x3 /* timer2cf */ 2034 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF2_SHIFT 6 2035 u8 flags2; 2036 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF3_MASK 0x3 /* timer_stop_all */ 2037 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF3_SHIFT 0 2038 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF4_MASK 0x3 /* cf4 */ 2039 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF4_SHIFT 2 2040 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF5_MASK 0x3 /* cf5 */ 2041 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF5_SHIFT 4 2042 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF6_MASK 0x3 /* cf6 */ 2043 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF6_SHIFT 6 2044 u8 flags3; 2045 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF7_MASK 0x3 /* cf7 */ 2046 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF7_SHIFT 0 2047 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF0EN_MASK 0x1 /* cf0en */ 2048 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF0EN_SHIFT 2 2049 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF1EN_MASK 0x1 /* cf1en */ 2050 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF1EN_SHIFT 3 2051 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF2EN_MASK 0x1 /* cf2en */ 2052 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF2EN_SHIFT 4 2053 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF3EN_MASK 0x1 /* cf3en */ 2054 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF3EN_SHIFT 5 2055 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF4EN_MASK 0x1 /* cf4en */ 2056 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF4EN_SHIFT 6 2057 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF5EN_MASK 0x1 /* cf5en */ 2058 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF5EN_SHIFT 7 2059 u8 flags4; 2060 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF6EN_MASK 0x1 /* cf6en */ 2061 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF6EN_SHIFT 0 2062 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF7EN_MASK 0x1 /* cf7en */ 2063 #define E5_TSTORM_ISCSI_TASK_AG_CTX_CF7EN_SHIFT 1 2064 #define E5_TSTORM_ISCSI_TASK_AG_CTX_RULE0EN_MASK 0x1 /* rule0en */ 2065 #define E5_TSTORM_ISCSI_TASK_AG_CTX_RULE0EN_SHIFT 2 2066 #define E5_TSTORM_ISCSI_TASK_AG_CTX_RULE1EN_MASK 0x1 /* rule1en */ 2067 #define E5_TSTORM_ISCSI_TASK_AG_CTX_RULE1EN_SHIFT 3 2068 #define E5_TSTORM_ISCSI_TASK_AG_CTX_RULE2EN_MASK 0x1 /* rule2en */ 2069 #define E5_TSTORM_ISCSI_TASK_AG_CTX_RULE2EN_SHIFT 4 2070 #define E5_TSTORM_ISCSI_TASK_AG_CTX_RULE3EN_MASK 0x1 /* rule3en */ 2071 #define E5_TSTORM_ISCSI_TASK_AG_CTX_RULE3EN_SHIFT 5 2072 #define E5_TSTORM_ISCSI_TASK_AG_CTX_RULE4EN_MASK 0x1 /* rule4en */ 2073 #define E5_TSTORM_ISCSI_TASK_AG_CTX_RULE4EN_SHIFT 6 2074 #define E5_TSTORM_ISCSI_TASK_AG_CTX_RULE5EN_MASK 0x1 /* rule5en */ 2075 #define E5_TSTORM_ISCSI_TASK_AG_CTX_RULE5EN_SHIFT 7 2076 u8 byte2 /* byte2 */; 2077 __le16 word1 /* word1 */; 2078 __le32 reg0 /* reg0 */; 2079 u8 byte3 /* regpair0 */; 2080 u8 byte4 /* byte4 */; 2081 __le16 word2 /* word2 */; 2082 __le16 word3 /* word3 */; 2083 __le16 word4 /* word4 */; 2084 __le32 reg1 /* regpair1 */; 2085 __le32 reg2 /* reg2 */; 2086 }; 2087 2088 2089 2090 2091 /* 2092 * iSCSI doorbell data 2093 */ 2094 struct iscsi_db_data 2095 { 2096 u8 params; 2097 #define ISCSI_DB_DATA_DEST_MASK 0x3 /* destination of doorbell (use enum db_dest) */ 2098 #define ISCSI_DB_DATA_DEST_SHIFT 0 2099 #define ISCSI_DB_DATA_AGG_CMD_MASK 0x3 /* aggregative command to CM (use enum db_agg_cmd_sel) */ 2100 #define ISCSI_DB_DATA_AGG_CMD_SHIFT 2 2101 #define ISCSI_DB_DATA_BYPASS_EN_MASK 0x1 /* enable QM bypass */ 2102 #define ISCSI_DB_DATA_BYPASS_EN_SHIFT 4 2103 #define ISCSI_DB_DATA_RESERVED_MASK 0x1 2104 #define ISCSI_DB_DATA_RESERVED_SHIFT 5 2105 #define ISCSI_DB_DATA_AGG_VAL_SEL_MASK 0x3 /* aggregative value selection */ 2106 #define ISCSI_DB_DATA_AGG_VAL_SEL_SHIFT 6 2107 u8 agg_flags /* bit for every DQ counter flags in CM context that DQ can increment */; 2108 __le16 sq_prod; 2109 }; 2110 2111 #endif /* __ISCSI_COMMON__ */ 2112