18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */ 28c2ecf20Sopenharmony_ci/* QLogic qed NIC Driver 38c2ecf20Sopenharmony_ci * Copyright (c) 2015-2017 QLogic Corporation 48c2ecf20Sopenharmony_ci * Copyright (c) 2019-2020 Marvell International Ltd. 58c2ecf20Sopenharmony_ci */ 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci#ifndef __ISCSI_COMMON__ 88c2ecf20Sopenharmony_ci#define __ISCSI_COMMON__ 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ci/**********************/ 118c2ecf20Sopenharmony_ci/* ISCSI FW CONSTANTS */ 128c2ecf20Sopenharmony_ci/**********************/ 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci/* iSCSI HSI constants */ 158c2ecf20Sopenharmony_ci#define ISCSI_DEFAULT_MTU (1500) 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ci/* KWQ (kernel work queue) layer codes */ 188c2ecf20Sopenharmony_ci#define ISCSI_SLOW_PATH_LAYER_CODE (6) 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci/* iSCSI parameter defaults */ 218c2ecf20Sopenharmony_ci#define ISCSI_DEFAULT_HEADER_DIGEST (0) 228c2ecf20Sopenharmony_ci#define ISCSI_DEFAULT_DATA_DIGEST (0) 238c2ecf20Sopenharmony_ci#define ISCSI_DEFAULT_INITIAL_R2T (1) 248c2ecf20Sopenharmony_ci#define ISCSI_DEFAULT_IMMEDIATE_DATA (1) 258c2ecf20Sopenharmony_ci#define ISCSI_DEFAULT_MAX_PDU_LENGTH (0x2000) 268c2ecf20Sopenharmony_ci#define ISCSI_DEFAULT_FIRST_BURST_LENGTH (0x10000) 278c2ecf20Sopenharmony_ci#define ISCSI_DEFAULT_MAX_BURST_LENGTH (0x40000) 288c2ecf20Sopenharmony_ci#define ISCSI_DEFAULT_MAX_OUTSTANDING_R2T (1) 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci/* iSCSI parameter limits */ 318c2ecf20Sopenharmony_ci#define ISCSI_MIN_VAL_MAX_PDU_LENGTH (0x200) 328c2ecf20Sopenharmony_ci#define ISCSI_MAX_VAL_MAX_PDU_LENGTH (0xffffff) 338c2ecf20Sopenharmony_ci#define ISCSI_MIN_VAL_BURST_LENGTH (0x200) 348c2ecf20Sopenharmony_ci#define ISCSI_MAX_VAL_BURST_LENGTH (0xffffff) 358c2ecf20Sopenharmony_ci#define ISCSI_MIN_VAL_MAX_OUTSTANDING_R2T (1) 368c2ecf20Sopenharmony_ci#define ISCSI_MAX_VAL_MAX_OUTSTANDING_R2T (0xff) 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_ci#define ISCSI_AHS_CNTL_SIZE 4 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_ci#define ISCSI_WQE_NUM_SGES_SLOWIO (0xf) 418c2ecf20Sopenharmony_ci 428c2ecf20Sopenharmony_ci/* iSCSI reserved params */ 438c2ecf20Sopenharmony_ci#define ISCSI_ITT_ALL_ONES (0xffffffff) 448c2ecf20Sopenharmony_ci#define ISCSI_TTT_ALL_ONES (0xffffffff) 458c2ecf20Sopenharmony_ci 468c2ecf20Sopenharmony_ci#define ISCSI_OPTION_1_OFF_CHIP_TCP 1 478c2ecf20Sopenharmony_ci#define ISCSI_OPTION_2_ON_CHIP_TCP 2 488c2ecf20Sopenharmony_ci 498c2ecf20Sopenharmony_ci#define ISCSI_INITIATOR_MODE 0 508c2ecf20Sopenharmony_ci#define ISCSI_TARGET_MODE 1 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_ci/* iSCSI request op codes */ 538c2ecf20Sopenharmony_ci#define ISCSI_OPCODE_NOP_OUT (0) 548c2ecf20Sopenharmony_ci#define ISCSI_OPCODE_SCSI_CMD (1) 558c2ecf20Sopenharmony_ci#define ISCSI_OPCODE_TMF_REQUEST (2) 568c2ecf20Sopenharmony_ci#define ISCSI_OPCODE_LOGIN_REQUEST (3) 578c2ecf20Sopenharmony_ci#define ISCSI_OPCODE_TEXT_REQUEST (4) 588c2ecf20Sopenharmony_ci#define ISCSI_OPCODE_DATA_OUT (5) 598c2ecf20Sopenharmony_ci#define ISCSI_OPCODE_LOGOUT_REQUEST (6) 608c2ecf20Sopenharmony_ci 618c2ecf20Sopenharmony_ci/* iSCSI response/messages op codes */ 628c2ecf20Sopenharmony_ci#define ISCSI_OPCODE_NOP_IN (0x20) 638c2ecf20Sopenharmony_ci#define ISCSI_OPCODE_SCSI_RESPONSE (0x21) 648c2ecf20Sopenharmony_ci#define ISCSI_OPCODE_TMF_RESPONSE (0x22) 658c2ecf20Sopenharmony_ci#define ISCSI_OPCODE_LOGIN_RESPONSE (0x23) 668c2ecf20Sopenharmony_ci#define ISCSI_OPCODE_TEXT_RESPONSE (0x24) 678c2ecf20Sopenharmony_ci#define ISCSI_OPCODE_DATA_IN (0x25) 688c2ecf20Sopenharmony_ci#define ISCSI_OPCODE_LOGOUT_RESPONSE (0x26) 698c2ecf20Sopenharmony_ci#define ISCSI_OPCODE_R2T (0x31) 708c2ecf20Sopenharmony_ci#define ISCSI_OPCODE_ASYNC_MSG (0x32) 718c2ecf20Sopenharmony_ci#define ISCSI_OPCODE_REJECT (0x3f) 728c2ecf20Sopenharmony_ci 738c2ecf20Sopenharmony_ci/* iSCSI stages */ 748c2ecf20Sopenharmony_ci#define ISCSI_STAGE_SECURITY_NEGOTIATION (0) 758c2ecf20Sopenharmony_ci#define ISCSI_STAGE_LOGIN_OPERATIONAL_NEGOTIATION (1) 768c2ecf20Sopenharmony_ci#define ISCSI_STAGE_FULL_FEATURE_PHASE (3) 778c2ecf20Sopenharmony_ci 788c2ecf20Sopenharmony_ci/* iSCSI CQE errors */ 798c2ecf20Sopenharmony_ci#define CQE_ERROR_BITMAP_DATA_DIGEST (0x08) 808c2ecf20Sopenharmony_ci#define CQE_ERROR_BITMAP_RCV_ON_INVALID_CONN (0x10) 818c2ecf20Sopenharmony_ci#define CQE_ERROR_BITMAP_DATA_TRUNCATED (0x20) 828c2ecf20Sopenharmony_ci 838c2ecf20Sopenharmony_ci/* Union of data bd_opaque/ tq_tid */ 848c2ecf20Sopenharmony_ciunion bd_opaque_tq_union { 858c2ecf20Sopenharmony_ci __le16 bd_opaque; 868c2ecf20Sopenharmony_ci __le16 tq_tid; 878c2ecf20Sopenharmony_ci}; 888c2ecf20Sopenharmony_ci 898c2ecf20Sopenharmony_ci/* ISCSI SGL entry */ 908c2ecf20Sopenharmony_cistruct cqe_error_bitmap { 918c2ecf20Sopenharmony_ci u8 cqe_error_status_bits; 928c2ecf20Sopenharmony_ci#define CQE_ERROR_BITMAP_DIF_ERR_BITS_MASK 0x7 938c2ecf20Sopenharmony_ci#define CQE_ERROR_BITMAP_DIF_ERR_BITS_SHIFT 0 948c2ecf20Sopenharmony_ci#define CQE_ERROR_BITMAP_DATA_DIGEST_ERR_MASK 0x1 958c2ecf20Sopenharmony_ci#define CQE_ERROR_BITMAP_DATA_DIGEST_ERR_SHIFT 3 968c2ecf20Sopenharmony_ci#define CQE_ERROR_BITMAP_RCV_ON_INVALID_CONN_MASK 0x1 978c2ecf20Sopenharmony_ci#define CQE_ERROR_BITMAP_RCV_ON_INVALID_CONN_SHIFT 4 988c2ecf20Sopenharmony_ci#define CQE_ERROR_BITMAP_DATA_TRUNCATED_ERR_MASK 0x1 998c2ecf20Sopenharmony_ci#define CQE_ERROR_BITMAP_DATA_TRUNCATED_ERR_SHIFT 5 1008c2ecf20Sopenharmony_ci#define CQE_ERROR_BITMAP_UNDER_RUN_ERR_MASK 0x1 1018c2ecf20Sopenharmony_ci#define CQE_ERROR_BITMAP_UNDER_RUN_ERR_SHIFT 6 1028c2ecf20Sopenharmony_ci#define CQE_ERROR_BITMAP_RESERVED2_MASK 0x1 1038c2ecf20Sopenharmony_ci#define CQE_ERROR_BITMAP_RESERVED2_SHIFT 7 1048c2ecf20Sopenharmony_ci}; 1058c2ecf20Sopenharmony_ci 1068c2ecf20Sopenharmony_ciunion cqe_error_status { 1078c2ecf20Sopenharmony_ci u8 error_status; 1088c2ecf20Sopenharmony_ci struct cqe_error_bitmap error_bits; 1098c2ecf20Sopenharmony_ci}; 1108c2ecf20Sopenharmony_ci 1118c2ecf20Sopenharmony_ci/* iSCSI Login Response PDU header */ 1128c2ecf20Sopenharmony_cistruct data_hdr { 1138c2ecf20Sopenharmony_ci __le32 data[12]; 1148c2ecf20Sopenharmony_ci}; 1158c2ecf20Sopenharmony_ci 1168c2ecf20Sopenharmony_cistruct lun_mapper_addr_reserved { 1178c2ecf20Sopenharmony_ci struct regpair lun_mapper_addr; 1188c2ecf20Sopenharmony_ci u8 reserved0[8]; 1198c2ecf20Sopenharmony_ci}; 1208c2ecf20Sopenharmony_ci 1218c2ecf20Sopenharmony_ci/* rdif conetxt for dif on immediate */ 1228c2ecf20Sopenharmony_cistruct dif_on_immediate_params { 1238c2ecf20Sopenharmony_ci __le32 initial_ref_tag; 1248c2ecf20Sopenharmony_ci __le16 application_tag; 1258c2ecf20Sopenharmony_ci __le16 application_tag_mask; 1268c2ecf20Sopenharmony_ci __le16 flags1; 1278c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_VALIDATE_GUARD_MASK 0x1 1288c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_VALIDATE_GUARD_SHIFT 0 1298c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_VALIDATE_APP_TAG_MASK 0x1 1308c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_VALIDATE_APP_TAG_SHIFT 1 1318c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_VALIDATE_REF_TAG_MASK 0x1 1328c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_VALIDATE_REF_TAG_SHIFT 2 1338c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_FORWARD_GUARD_MASK 0x1 1348c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_FORWARD_GUARD_SHIFT 3 1358c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_FORWARD_APP_TAG_MASK 0x1 1368c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_FORWARD_APP_TAG_SHIFT 4 1378c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_FORWARD_REF_TAG_MASK 0x1 1388c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_FORWARD_REF_TAG_SHIFT 5 1398c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_INTERVAL_SIZE_MASK 0x1 1408c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_INTERVAL_SIZE_SHIFT 6 1418c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_NETWORK_INTERFACE_MASK 0x1 1428c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_NETWORK_INTERFACE_SHIFT 7 1438c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_HOST_INTERFACE_MASK 0x3 1448c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_HOST_INTERFACE_SHIFT 8 1458c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_REF_TAG_MASK_MASK 0xF 1468c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_REF_TAG_MASK_SHIFT 10 1478c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_FORWARD_APP_TAG_WITH_MASK_MASK 0x1 1488c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_FORWARD_APP_TAG_WITH_MASK_SHIFT 14 1498c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_FORWARD_REF_TAG_WITH_MASK_MASK 0x1 1508c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_FORWARD_REF_TAG_WITH_MASK_SHIFT 15 1518c2ecf20Sopenharmony_ci u8 flags0; 1528c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_RESERVED_MASK 0x1 1538c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_RESERVED_SHIFT 0 1548c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_IGNORE_APP_TAG_MASK 0x1 1558c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_IGNORE_APP_TAG_SHIFT 1 1568c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_INITIAL_REF_TAG_IS_VALID_MASK 0x1 1578c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_INITIAL_REF_TAG_IS_VALID_SHIFT 2 1588c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_HOST_GUARD_TYPE_MASK 0x1 1598c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_HOST_GUARD_TYPE_SHIFT 3 1608c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_PROTECTION_TYPE_MASK 0x3 1618c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_PROTECTION_TYPE_SHIFT 4 1628c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_CRC_SEED_MASK 0x1 1638c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_CRC_SEED_SHIFT 6 1648c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_KEEP_REF_TAG_CONST_MASK 0x1 1658c2ecf20Sopenharmony_ci#define DIF_ON_IMMEDIATE_PARAMS_KEEP_REF_TAG_CONST_SHIFT 7 1668c2ecf20Sopenharmony_ci u8 reserved_zero[5]; 1678c2ecf20Sopenharmony_ci}; 1688c2ecf20Sopenharmony_ci 1698c2ecf20Sopenharmony_ci/* iSCSI dif on immediate mode attributes union */ 1708c2ecf20Sopenharmony_ciunion dif_configuration_params { 1718c2ecf20Sopenharmony_ci struct lun_mapper_addr_reserved lun_mapper_address; 1728c2ecf20Sopenharmony_ci struct dif_on_immediate_params def_dif_conf; 1738c2ecf20Sopenharmony_ci}; 1748c2ecf20Sopenharmony_ci 1758c2ecf20Sopenharmony_ci/* Union of data/r2t sequence number */ 1768c2ecf20Sopenharmony_ciunion iscsi_seq_num { 1778c2ecf20Sopenharmony_ci __le16 data_sn; 1788c2ecf20Sopenharmony_ci __le16 r2t_sn; 1798c2ecf20Sopenharmony_ci}; 1808c2ecf20Sopenharmony_ci 1818c2ecf20Sopenharmony_ci/* iSCSI DIF flags */ 1828c2ecf20Sopenharmony_cistruct iscsi_dif_flags { 1838c2ecf20Sopenharmony_ci u8 flags; 1848c2ecf20Sopenharmony_ci#define ISCSI_DIF_FLAGS_PROT_INTERVAL_SIZE_LOG_MASK 0xF 1858c2ecf20Sopenharmony_ci#define ISCSI_DIF_FLAGS_PROT_INTERVAL_SIZE_LOG_SHIFT 0 1868c2ecf20Sopenharmony_ci#define ISCSI_DIF_FLAGS_DIF_TO_PEER_MASK 0x1 1878c2ecf20Sopenharmony_ci#define ISCSI_DIF_FLAGS_DIF_TO_PEER_SHIFT 4 1888c2ecf20Sopenharmony_ci#define ISCSI_DIF_FLAGS_HOST_INTERFACE_MASK 0x7 1898c2ecf20Sopenharmony_ci#define ISCSI_DIF_FLAGS_HOST_INTERFACE_SHIFT 5 1908c2ecf20Sopenharmony_ci}; 1918c2ecf20Sopenharmony_ci 1928c2ecf20Sopenharmony_ci/* The iscsi storm task context of Ystorm */ 1938c2ecf20Sopenharmony_cistruct ystorm_iscsi_task_state { 1948c2ecf20Sopenharmony_ci struct scsi_cached_sges data_desc; 1958c2ecf20Sopenharmony_ci struct scsi_sgl_params sgl_params; 1968c2ecf20Sopenharmony_ci __le32 exp_r2t_sn; 1978c2ecf20Sopenharmony_ci __le32 buffer_offset; 1988c2ecf20Sopenharmony_ci union iscsi_seq_num seq_num; 1998c2ecf20Sopenharmony_ci struct iscsi_dif_flags dif_flags; 2008c2ecf20Sopenharmony_ci u8 flags; 2018c2ecf20Sopenharmony_ci#define YSTORM_ISCSI_TASK_STATE_LOCAL_COMP_MASK 0x1 2028c2ecf20Sopenharmony_ci#define YSTORM_ISCSI_TASK_STATE_LOCAL_COMP_SHIFT 0 2038c2ecf20Sopenharmony_ci#define YSTORM_ISCSI_TASK_STATE_SLOW_IO_MASK 0x1 2048c2ecf20Sopenharmony_ci#define YSTORM_ISCSI_TASK_STATE_SLOW_IO_SHIFT 1 2058c2ecf20Sopenharmony_ci#define YSTORM_ISCSI_TASK_STATE_SET_DIF_OFFSET_MASK 0x1 2068c2ecf20Sopenharmony_ci#define YSTORM_ISCSI_TASK_STATE_SET_DIF_OFFSET_SHIFT 2 2078c2ecf20Sopenharmony_ci#define YSTORM_ISCSI_TASK_STATE_RESERVED0_MASK 0x1F 2088c2ecf20Sopenharmony_ci#define YSTORM_ISCSI_TASK_STATE_RESERVED0_SHIFT 3 2098c2ecf20Sopenharmony_ci}; 2108c2ecf20Sopenharmony_ci 2118c2ecf20Sopenharmony_ci/* The iscsi storm task context of Ystorm */ 2128c2ecf20Sopenharmony_cistruct ystorm_iscsi_task_rxmit_opt { 2138c2ecf20Sopenharmony_ci __le32 fast_rxmit_sge_offset; 2148c2ecf20Sopenharmony_ci __le32 scan_start_buffer_offset; 2158c2ecf20Sopenharmony_ci __le32 fast_rxmit_buffer_offset; 2168c2ecf20Sopenharmony_ci u8 scan_start_sgl_index; 2178c2ecf20Sopenharmony_ci u8 fast_rxmit_sgl_index; 2188c2ecf20Sopenharmony_ci __le16 reserved; 2198c2ecf20Sopenharmony_ci}; 2208c2ecf20Sopenharmony_ci 2218c2ecf20Sopenharmony_ci/* iSCSI Common PDU header */ 2228c2ecf20Sopenharmony_cistruct iscsi_common_hdr { 2238c2ecf20Sopenharmony_ci u8 hdr_status; 2248c2ecf20Sopenharmony_ci u8 hdr_response; 2258c2ecf20Sopenharmony_ci u8 hdr_flags; 2268c2ecf20Sopenharmony_ci u8 hdr_first_byte; 2278c2ecf20Sopenharmony_ci#define ISCSI_COMMON_HDR_OPCODE_MASK 0x3F 2288c2ecf20Sopenharmony_ci#define ISCSI_COMMON_HDR_OPCODE_SHIFT 0 2298c2ecf20Sopenharmony_ci#define ISCSI_COMMON_HDR_IMM_MASK 0x1 2308c2ecf20Sopenharmony_ci#define ISCSI_COMMON_HDR_IMM_SHIFT 6 2318c2ecf20Sopenharmony_ci#define ISCSI_COMMON_HDR_RSRV_MASK 0x1 2328c2ecf20Sopenharmony_ci#define ISCSI_COMMON_HDR_RSRV_SHIFT 7 2338c2ecf20Sopenharmony_ci __le32 hdr_second_dword; 2348c2ecf20Sopenharmony_ci#define ISCSI_COMMON_HDR_DATA_SEG_LEN_MASK 0xFFFFFF 2358c2ecf20Sopenharmony_ci#define ISCSI_COMMON_HDR_DATA_SEG_LEN_SHIFT 0 2368c2ecf20Sopenharmony_ci#define ISCSI_COMMON_HDR_TOTAL_AHS_LEN_MASK 0xFF 2378c2ecf20Sopenharmony_ci#define ISCSI_COMMON_HDR_TOTAL_AHS_LEN_SHIFT 24 2388c2ecf20Sopenharmony_ci struct regpair lun_reserved; 2398c2ecf20Sopenharmony_ci __le32 itt; 2408c2ecf20Sopenharmony_ci __le32 ttt; 2418c2ecf20Sopenharmony_ci __le32 cmdstat_sn; 2428c2ecf20Sopenharmony_ci __le32 exp_statcmd_sn; 2438c2ecf20Sopenharmony_ci __le32 max_cmd_sn; 2448c2ecf20Sopenharmony_ci __le32 data[3]; 2458c2ecf20Sopenharmony_ci}; 2468c2ecf20Sopenharmony_ci 2478c2ecf20Sopenharmony_ci/* iSCSI Command PDU header */ 2488c2ecf20Sopenharmony_cistruct iscsi_cmd_hdr { 2498c2ecf20Sopenharmony_ci __le16 reserved1; 2508c2ecf20Sopenharmony_ci u8 flags_attr; 2518c2ecf20Sopenharmony_ci#define ISCSI_CMD_HDR_ATTR_MASK 0x7 2528c2ecf20Sopenharmony_ci#define ISCSI_CMD_HDR_ATTR_SHIFT 0 2538c2ecf20Sopenharmony_ci#define ISCSI_CMD_HDR_RSRV_MASK 0x3 2548c2ecf20Sopenharmony_ci#define ISCSI_CMD_HDR_RSRV_SHIFT 3 2558c2ecf20Sopenharmony_ci#define ISCSI_CMD_HDR_WRITE_MASK 0x1 2568c2ecf20Sopenharmony_ci#define ISCSI_CMD_HDR_WRITE_SHIFT 5 2578c2ecf20Sopenharmony_ci#define ISCSI_CMD_HDR_READ_MASK 0x1 2588c2ecf20Sopenharmony_ci#define ISCSI_CMD_HDR_READ_SHIFT 6 2598c2ecf20Sopenharmony_ci#define ISCSI_CMD_HDR_FINAL_MASK 0x1 2608c2ecf20Sopenharmony_ci#define ISCSI_CMD_HDR_FINAL_SHIFT 7 2618c2ecf20Sopenharmony_ci u8 hdr_first_byte; 2628c2ecf20Sopenharmony_ci#define ISCSI_CMD_HDR_OPCODE_MASK 0x3F 2638c2ecf20Sopenharmony_ci#define ISCSI_CMD_HDR_OPCODE_SHIFT 0 2648c2ecf20Sopenharmony_ci#define ISCSI_CMD_HDR_IMM_MASK 0x1 2658c2ecf20Sopenharmony_ci#define ISCSI_CMD_HDR_IMM_SHIFT 6 2668c2ecf20Sopenharmony_ci#define ISCSI_CMD_HDR_RSRV1_MASK 0x1 2678c2ecf20Sopenharmony_ci#define ISCSI_CMD_HDR_RSRV1_SHIFT 7 2688c2ecf20Sopenharmony_ci __le32 hdr_second_dword; 2698c2ecf20Sopenharmony_ci#define ISCSI_CMD_HDR_DATA_SEG_LEN_MASK 0xFFFFFF 2708c2ecf20Sopenharmony_ci#define ISCSI_CMD_HDR_DATA_SEG_LEN_SHIFT 0 2718c2ecf20Sopenharmony_ci#define ISCSI_CMD_HDR_TOTAL_AHS_LEN_MASK 0xFF 2728c2ecf20Sopenharmony_ci#define ISCSI_CMD_HDR_TOTAL_AHS_LEN_SHIFT 24 2738c2ecf20Sopenharmony_ci struct regpair lun; 2748c2ecf20Sopenharmony_ci __le32 itt; 2758c2ecf20Sopenharmony_ci __le32 expected_transfer_length; 2768c2ecf20Sopenharmony_ci __le32 cmd_sn; 2778c2ecf20Sopenharmony_ci __le32 exp_stat_sn; 2788c2ecf20Sopenharmony_ci __le32 cdb[4]; 2798c2ecf20Sopenharmony_ci}; 2808c2ecf20Sopenharmony_ci 2818c2ecf20Sopenharmony_ci/* iSCSI Command PDU header with Extended CDB (Initiator Mode) */ 2828c2ecf20Sopenharmony_cistruct iscsi_ext_cdb_cmd_hdr { 2838c2ecf20Sopenharmony_ci __le16 reserved1; 2848c2ecf20Sopenharmony_ci u8 flags_attr; 2858c2ecf20Sopenharmony_ci#define ISCSI_EXT_CDB_CMD_HDR_ATTR_MASK 0x7 2868c2ecf20Sopenharmony_ci#define ISCSI_EXT_CDB_CMD_HDR_ATTR_SHIFT 0 2878c2ecf20Sopenharmony_ci#define ISCSI_EXT_CDB_CMD_HDR_RSRV_MASK 0x3 2888c2ecf20Sopenharmony_ci#define ISCSI_EXT_CDB_CMD_HDR_RSRV_SHIFT 3 2898c2ecf20Sopenharmony_ci#define ISCSI_EXT_CDB_CMD_HDR_WRITE_MASK 0x1 2908c2ecf20Sopenharmony_ci#define ISCSI_EXT_CDB_CMD_HDR_WRITE_SHIFT 5 2918c2ecf20Sopenharmony_ci#define ISCSI_EXT_CDB_CMD_HDR_READ_MASK 0x1 2928c2ecf20Sopenharmony_ci#define ISCSI_EXT_CDB_CMD_HDR_READ_SHIFT 6 2938c2ecf20Sopenharmony_ci#define ISCSI_EXT_CDB_CMD_HDR_FINAL_MASK 0x1 2948c2ecf20Sopenharmony_ci#define ISCSI_EXT_CDB_CMD_HDR_FINAL_SHIFT 7 2958c2ecf20Sopenharmony_ci u8 opcode; 2968c2ecf20Sopenharmony_ci __le32 hdr_second_dword; 2978c2ecf20Sopenharmony_ci#define ISCSI_EXT_CDB_CMD_HDR_DATA_SEG_LEN_MASK 0xFFFFFF 2988c2ecf20Sopenharmony_ci#define ISCSI_EXT_CDB_CMD_HDR_DATA_SEG_LEN_SHIFT 0 2998c2ecf20Sopenharmony_ci#define ISCSI_EXT_CDB_CMD_HDR_CDB_SIZE_MASK 0xFF 3008c2ecf20Sopenharmony_ci#define ISCSI_EXT_CDB_CMD_HDR_CDB_SIZE_SHIFT 24 3018c2ecf20Sopenharmony_ci struct regpair lun; 3028c2ecf20Sopenharmony_ci __le32 itt; 3038c2ecf20Sopenharmony_ci __le32 expected_transfer_length; 3048c2ecf20Sopenharmony_ci __le32 cmd_sn; 3058c2ecf20Sopenharmony_ci __le32 exp_stat_sn; 3068c2ecf20Sopenharmony_ci struct scsi_sge cdb_sge; 3078c2ecf20Sopenharmony_ci}; 3088c2ecf20Sopenharmony_ci 3098c2ecf20Sopenharmony_ci/* iSCSI login request PDU header */ 3108c2ecf20Sopenharmony_cistruct iscsi_login_req_hdr { 3118c2ecf20Sopenharmony_ci u8 version_min; 3128c2ecf20Sopenharmony_ci u8 version_max; 3138c2ecf20Sopenharmony_ci u8 flags_attr; 3148c2ecf20Sopenharmony_ci#define ISCSI_LOGIN_REQ_HDR_NSG_MASK 0x3 3158c2ecf20Sopenharmony_ci#define ISCSI_LOGIN_REQ_HDR_NSG_SHIFT 0 3168c2ecf20Sopenharmony_ci#define ISCSI_LOGIN_REQ_HDR_CSG_MASK 0x3 3178c2ecf20Sopenharmony_ci#define ISCSI_LOGIN_REQ_HDR_CSG_SHIFT 2 3188c2ecf20Sopenharmony_ci#define ISCSI_LOGIN_REQ_HDR_RSRV_MASK 0x3 3198c2ecf20Sopenharmony_ci#define ISCSI_LOGIN_REQ_HDR_RSRV_SHIFT 4 3208c2ecf20Sopenharmony_ci#define ISCSI_LOGIN_REQ_HDR_C_MASK 0x1 3218c2ecf20Sopenharmony_ci#define ISCSI_LOGIN_REQ_HDR_C_SHIFT 6 3228c2ecf20Sopenharmony_ci#define ISCSI_LOGIN_REQ_HDR_T_MASK 0x1 3238c2ecf20Sopenharmony_ci#define ISCSI_LOGIN_REQ_HDR_T_SHIFT 7 3248c2ecf20Sopenharmony_ci u8 opcode; 3258c2ecf20Sopenharmony_ci __le32 hdr_second_dword; 3268c2ecf20Sopenharmony_ci#define ISCSI_LOGIN_REQ_HDR_DATA_SEG_LEN_MASK 0xFFFFFF 3278c2ecf20Sopenharmony_ci#define ISCSI_LOGIN_REQ_HDR_DATA_SEG_LEN_SHIFT 0 3288c2ecf20Sopenharmony_ci#define ISCSI_LOGIN_REQ_HDR_TOTAL_AHS_LEN_MASK 0xFF 3298c2ecf20Sopenharmony_ci#define ISCSI_LOGIN_REQ_HDR_TOTAL_AHS_LEN_SHIFT 24 3308c2ecf20Sopenharmony_ci __le32 isid_tabc; 3318c2ecf20Sopenharmony_ci __le16 tsih; 3328c2ecf20Sopenharmony_ci __le16 isid_d; 3338c2ecf20Sopenharmony_ci __le32 itt; 3348c2ecf20Sopenharmony_ci __le16 reserved1; 3358c2ecf20Sopenharmony_ci __le16 cid; 3368c2ecf20Sopenharmony_ci __le32 cmd_sn; 3378c2ecf20Sopenharmony_ci __le32 exp_stat_sn; 3388c2ecf20Sopenharmony_ci __le32 reserved2[4]; 3398c2ecf20Sopenharmony_ci}; 3408c2ecf20Sopenharmony_ci 3418c2ecf20Sopenharmony_ci/* iSCSI logout request PDU header */ 3428c2ecf20Sopenharmony_cistruct iscsi_logout_req_hdr { 3438c2ecf20Sopenharmony_ci __le16 reserved0; 3448c2ecf20Sopenharmony_ci u8 reason_code; 3458c2ecf20Sopenharmony_ci u8 opcode; 3468c2ecf20Sopenharmony_ci __le32 reserved1; 3478c2ecf20Sopenharmony_ci __le32 reserved2[2]; 3488c2ecf20Sopenharmony_ci __le32 itt; 3498c2ecf20Sopenharmony_ci __le16 reserved3; 3508c2ecf20Sopenharmony_ci __le16 cid; 3518c2ecf20Sopenharmony_ci __le32 cmd_sn; 3528c2ecf20Sopenharmony_ci __le32 exp_stat_sn; 3538c2ecf20Sopenharmony_ci __le32 reserved4[4]; 3548c2ecf20Sopenharmony_ci}; 3558c2ecf20Sopenharmony_ci 3568c2ecf20Sopenharmony_ci/* iSCSI Data-out PDU header */ 3578c2ecf20Sopenharmony_cistruct iscsi_data_out_hdr { 3588c2ecf20Sopenharmony_ci __le16 reserved1; 3598c2ecf20Sopenharmony_ci u8 flags_attr; 3608c2ecf20Sopenharmony_ci#define ISCSI_DATA_OUT_HDR_RSRV_MASK 0x7F 3618c2ecf20Sopenharmony_ci#define ISCSI_DATA_OUT_HDR_RSRV_SHIFT 0 3628c2ecf20Sopenharmony_ci#define ISCSI_DATA_OUT_HDR_FINAL_MASK 0x1 3638c2ecf20Sopenharmony_ci#define ISCSI_DATA_OUT_HDR_FINAL_SHIFT 7 3648c2ecf20Sopenharmony_ci u8 opcode; 3658c2ecf20Sopenharmony_ci __le32 reserved2; 3668c2ecf20Sopenharmony_ci struct regpair lun; 3678c2ecf20Sopenharmony_ci __le32 itt; 3688c2ecf20Sopenharmony_ci __le32 ttt; 3698c2ecf20Sopenharmony_ci __le32 reserved3; 3708c2ecf20Sopenharmony_ci __le32 exp_stat_sn; 3718c2ecf20Sopenharmony_ci __le32 reserved4; 3728c2ecf20Sopenharmony_ci __le32 data_sn; 3738c2ecf20Sopenharmony_ci __le32 buffer_offset; 3748c2ecf20Sopenharmony_ci __le32 reserved5; 3758c2ecf20Sopenharmony_ci}; 3768c2ecf20Sopenharmony_ci 3778c2ecf20Sopenharmony_ci/* iSCSI Data-in PDU header */ 3788c2ecf20Sopenharmony_cistruct iscsi_data_in_hdr { 3798c2ecf20Sopenharmony_ci u8 status_rsvd; 3808c2ecf20Sopenharmony_ci u8 reserved1; 3818c2ecf20Sopenharmony_ci u8 flags; 3828c2ecf20Sopenharmony_ci#define ISCSI_DATA_IN_HDR_STATUS_MASK 0x1 3838c2ecf20Sopenharmony_ci#define ISCSI_DATA_IN_HDR_STATUS_SHIFT 0 3848c2ecf20Sopenharmony_ci#define ISCSI_DATA_IN_HDR_UNDERFLOW_MASK 0x1 3858c2ecf20Sopenharmony_ci#define ISCSI_DATA_IN_HDR_UNDERFLOW_SHIFT 1 3868c2ecf20Sopenharmony_ci#define ISCSI_DATA_IN_HDR_OVERFLOW_MASK 0x1 3878c2ecf20Sopenharmony_ci#define ISCSI_DATA_IN_HDR_OVERFLOW_SHIFT 2 3888c2ecf20Sopenharmony_ci#define ISCSI_DATA_IN_HDR_RSRV_MASK 0x7 3898c2ecf20Sopenharmony_ci#define ISCSI_DATA_IN_HDR_RSRV_SHIFT 3 3908c2ecf20Sopenharmony_ci#define ISCSI_DATA_IN_HDR_ACK_MASK 0x1 3918c2ecf20Sopenharmony_ci#define ISCSI_DATA_IN_HDR_ACK_SHIFT 6 3928c2ecf20Sopenharmony_ci#define ISCSI_DATA_IN_HDR_FINAL_MASK 0x1 3938c2ecf20Sopenharmony_ci#define ISCSI_DATA_IN_HDR_FINAL_SHIFT 7 3948c2ecf20Sopenharmony_ci u8 opcode; 3958c2ecf20Sopenharmony_ci __le32 reserved2; 3968c2ecf20Sopenharmony_ci struct regpair lun; 3978c2ecf20Sopenharmony_ci __le32 itt; 3988c2ecf20Sopenharmony_ci __le32 ttt; 3998c2ecf20Sopenharmony_ci __le32 stat_sn; 4008c2ecf20Sopenharmony_ci __le32 exp_cmd_sn; 4018c2ecf20Sopenharmony_ci __le32 max_cmd_sn; 4028c2ecf20Sopenharmony_ci __le32 data_sn; 4038c2ecf20Sopenharmony_ci __le32 buffer_offset; 4048c2ecf20Sopenharmony_ci __le32 residual_count; 4058c2ecf20Sopenharmony_ci}; 4068c2ecf20Sopenharmony_ci 4078c2ecf20Sopenharmony_ci/* iSCSI R2T PDU header */ 4088c2ecf20Sopenharmony_cistruct iscsi_r2t_hdr { 4098c2ecf20Sopenharmony_ci u8 reserved0[3]; 4108c2ecf20Sopenharmony_ci u8 opcode; 4118c2ecf20Sopenharmony_ci __le32 reserved2; 4128c2ecf20Sopenharmony_ci struct regpair lun; 4138c2ecf20Sopenharmony_ci __le32 itt; 4148c2ecf20Sopenharmony_ci __le32 ttt; 4158c2ecf20Sopenharmony_ci __le32 stat_sn; 4168c2ecf20Sopenharmony_ci __le32 exp_cmd_sn; 4178c2ecf20Sopenharmony_ci __le32 max_cmd_sn; 4188c2ecf20Sopenharmony_ci __le32 r2t_sn; 4198c2ecf20Sopenharmony_ci __le32 buffer_offset; 4208c2ecf20Sopenharmony_ci __le32 desired_data_trns_len; 4218c2ecf20Sopenharmony_ci}; 4228c2ecf20Sopenharmony_ci 4238c2ecf20Sopenharmony_ci/* iSCSI NOP-out PDU header */ 4248c2ecf20Sopenharmony_cistruct iscsi_nop_out_hdr { 4258c2ecf20Sopenharmony_ci __le16 reserved1; 4268c2ecf20Sopenharmony_ci u8 flags_attr; 4278c2ecf20Sopenharmony_ci#define ISCSI_NOP_OUT_HDR_RSRV_MASK 0x7F 4288c2ecf20Sopenharmony_ci#define ISCSI_NOP_OUT_HDR_RSRV_SHIFT 0 4298c2ecf20Sopenharmony_ci#define ISCSI_NOP_OUT_HDR_CONST1_MASK 0x1 4308c2ecf20Sopenharmony_ci#define ISCSI_NOP_OUT_HDR_CONST1_SHIFT 7 4318c2ecf20Sopenharmony_ci u8 opcode; 4328c2ecf20Sopenharmony_ci __le32 reserved2; 4338c2ecf20Sopenharmony_ci struct regpair lun; 4348c2ecf20Sopenharmony_ci __le32 itt; 4358c2ecf20Sopenharmony_ci __le32 ttt; 4368c2ecf20Sopenharmony_ci __le32 cmd_sn; 4378c2ecf20Sopenharmony_ci __le32 exp_stat_sn; 4388c2ecf20Sopenharmony_ci __le32 reserved3; 4398c2ecf20Sopenharmony_ci __le32 reserved4; 4408c2ecf20Sopenharmony_ci __le32 reserved5; 4418c2ecf20Sopenharmony_ci __le32 reserved6; 4428c2ecf20Sopenharmony_ci}; 4438c2ecf20Sopenharmony_ci 4448c2ecf20Sopenharmony_ci/* iSCSI NOP-in PDU header */ 4458c2ecf20Sopenharmony_cistruct iscsi_nop_in_hdr { 4468c2ecf20Sopenharmony_ci __le16 reserved0; 4478c2ecf20Sopenharmony_ci u8 flags_attr; 4488c2ecf20Sopenharmony_ci#define ISCSI_NOP_IN_HDR_RSRV_MASK 0x7F 4498c2ecf20Sopenharmony_ci#define ISCSI_NOP_IN_HDR_RSRV_SHIFT 0 4508c2ecf20Sopenharmony_ci#define ISCSI_NOP_IN_HDR_CONST1_MASK 0x1 4518c2ecf20Sopenharmony_ci#define ISCSI_NOP_IN_HDR_CONST1_SHIFT 7 4528c2ecf20Sopenharmony_ci u8 opcode; 4538c2ecf20Sopenharmony_ci __le32 hdr_second_dword; 4548c2ecf20Sopenharmony_ci#define ISCSI_NOP_IN_HDR_DATA_SEG_LEN_MASK 0xFFFFFF 4558c2ecf20Sopenharmony_ci#define ISCSI_NOP_IN_HDR_DATA_SEG_LEN_SHIFT 0 4568c2ecf20Sopenharmony_ci#define ISCSI_NOP_IN_HDR_TOTAL_AHS_LEN_MASK 0xFF 4578c2ecf20Sopenharmony_ci#define ISCSI_NOP_IN_HDR_TOTAL_AHS_LEN_SHIFT 24 4588c2ecf20Sopenharmony_ci struct regpair lun; 4598c2ecf20Sopenharmony_ci __le32 itt; 4608c2ecf20Sopenharmony_ci __le32 ttt; 4618c2ecf20Sopenharmony_ci __le32 stat_sn; 4628c2ecf20Sopenharmony_ci __le32 exp_cmd_sn; 4638c2ecf20Sopenharmony_ci __le32 max_cmd_sn; 4648c2ecf20Sopenharmony_ci __le32 reserved5; 4658c2ecf20Sopenharmony_ci __le32 reserved6; 4668c2ecf20Sopenharmony_ci __le32 reserved7; 4678c2ecf20Sopenharmony_ci}; 4688c2ecf20Sopenharmony_ci 4698c2ecf20Sopenharmony_ci/* iSCSI Login Response PDU header */ 4708c2ecf20Sopenharmony_cistruct iscsi_login_response_hdr { 4718c2ecf20Sopenharmony_ci u8 version_active; 4728c2ecf20Sopenharmony_ci u8 version_max; 4738c2ecf20Sopenharmony_ci u8 flags_attr; 4748c2ecf20Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_HDR_NSG_MASK 0x3 4758c2ecf20Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_HDR_NSG_SHIFT 0 4768c2ecf20Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_HDR_CSG_MASK 0x3 4778c2ecf20Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_HDR_CSG_SHIFT 2 4788c2ecf20Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_HDR_RSRV_MASK 0x3 4798c2ecf20Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_HDR_RSRV_SHIFT 4 4808c2ecf20Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_HDR_C_MASK 0x1 4818c2ecf20Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_HDR_C_SHIFT 6 4828c2ecf20Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_HDR_T_MASK 0x1 4838c2ecf20Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_HDR_T_SHIFT 7 4848c2ecf20Sopenharmony_ci u8 opcode; 4858c2ecf20Sopenharmony_ci __le32 hdr_second_dword; 4868c2ecf20Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_HDR_DATA_SEG_LEN_MASK 0xFFFFFF 4878c2ecf20Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_HDR_DATA_SEG_LEN_SHIFT 0 4888c2ecf20Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_HDR_TOTAL_AHS_LEN_MASK 0xFF 4898c2ecf20Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_HDR_TOTAL_AHS_LEN_SHIFT 24 4908c2ecf20Sopenharmony_ci __le32 isid_tabc; 4918c2ecf20Sopenharmony_ci __le16 tsih; 4928c2ecf20Sopenharmony_ci __le16 isid_d; 4938c2ecf20Sopenharmony_ci __le32 itt; 4948c2ecf20Sopenharmony_ci __le32 reserved1; 4958c2ecf20Sopenharmony_ci __le32 stat_sn; 4968c2ecf20Sopenharmony_ci __le32 exp_cmd_sn; 4978c2ecf20Sopenharmony_ci __le32 max_cmd_sn; 4988c2ecf20Sopenharmony_ci __le16 reserved2; 4998c2ecf20Sopenharmony_ci u8 status_detail; 5008c2ecf20Sopenharmony_ci u8 status_class; 5018c2ecf20Sopenharmony_ci __le32 reserved4[2]; 5028c2ecf20Sopenharmony_ci}; 5038c2ecf20Sopenharmony_ci 5048c2ecf20Sopenharmony_ci/* iSCSI Logout Response PDU header */ 5058c2ecf20Sopenharmony_cistruct iscsi_logout_response_hdr { 5068c2ecf20Sopenharmony_ci u8 reserved1; 5078c2ecf20Sopenharmony_ci u8 response; 5088c2ecf20Sopenharmony_ci u8 flags; 5098c2ecf20Sopenharmony_ci u8 opcode; 5108c2ecf20Sopenharmony_ci __le32 hdr_second_dword; 5118c2ecf20Sopenharmony_ci#define ISCSI_LOGOUT_RESPONSE_HDR_DATA_SEG_LEN_MASK 0xFFFFFF 5128c2ecf20Sopenharmony_ci#define ISCSI_LOGOUT_RESPONSE_HDR_DATA_SEG_LEN_SHIFT 0 5138c2ecf20Sopenharmony_ci#define ISCSI_LOGOUT_RESPONSE_HDR_TOTAL_AHS_LEN_MASK 0xFF 5148c2ecf20Sopenharmony_ci#define ISCSI_LOGOUT_RESPONSE_HDR_TOTAL_AHS_LEN_SHIFT 24 5158c2ecf20Sopenharmony_ci __le32 reserved2[2]; 5168c2ecf20Sopenharmony_ci __le32 itt; 5178c2ecf20Sopenharmony_ci __le32 reserved3; 5188c2ecf20Sopenharmony_ci __le32 stat_sn; 5198c2ecf20Sopenharmony_ci __le32 exp_cmd_sn; 5208c2ecf20Sopenharmony_ci __le32 max_cmd_sn; 5218c2ecf20Sopenharmony_ci __le32 reserved4; 5228c2ecf20Sopenharmony_ci __le16 time_2_retain; 5238c2ecf20Sopenharmony_ci __le16 time_2_wait; 5248c2ecf20Sopenharmony_ci __le32 reserved5[1]; 5258c2ecf20Sopenharmony_ci}; 5268c2ecf20Sopenharmony_ci 5278c2ecf20Sopenharmony_ci/* iSCSI Text Request PDU header */ 5288c2ecf20Sopenharmony_cistruct iscsi_text_request_hdr { 5298c2ecf20Sopenharmony_ci __le16 reserved0; 5308c2ecf20Sopenharmony_ci u8 flags_attr; 5318c2ecf20Sopenharmony_ci#define ISCSI_TEXT_REQUEST_HDR_RSRV_MASK 0x3F 5328c2ecf20Sopenharmony_ci#define ISCSI_TEXT_REQUEST_HDR_RSRV_SHIFT 0 5338c2ecf20Sopenharmony_ci#define ISCSI_TEXT_REQUEST_HDR_C_MASK 0x1 5348c2ecf20Sopenharmony_ci#define ISCSI_TEXT_REQUEST_HDR_C_SHIFT 6 5358c2ecf20Sopenharmony_ci#define ISCSI_TEXT_REQUEST_HDR_F_MASK 0x1 5368c2ecf20Sopenharmony_ci#define ISCSI_TEXT_REQUEST_HDR_F_SHIFT 7 5378c2ecf20Sopenharmony_ci u8 opcode; 5388c2ecf20Sopenharmony_ci __le32 hdr_second_dword; 5398c2ecf20Sopenharmony_ci#define ISCSI_TEXT_REQUEST_HDR_DATA_SEG_LEN_MASK 0xFFFFFF 5408c2ecf20Sopenharmony_ci#define ISCSI_TEXT_REQUEST_HDR_DATA_SEG_LEN_SHIFT 0 5418c2ecf20Sopenharmony_ci#define ISCSI_TEXT_REQUEST_HDR_TOTAL_AHS_LEN_MASK 0xFF 5428c2ecf20Sopenharmony_ci#define ISCSI_TEXT_REQUEST_HDR_TOTAL_AHS_LEN_SHIFT 24 5438c2ecf20Sopenharmony_ci struct regpair lun; 5448c2ecf20Sopenharmony_ci __le32 itt; 5458c2ecf20Sopenharmony_ci __le32 ttt; 5468c2ecf20Sopenharmony_ci __le32 cmd_sn; 5478c2ecf20Sopenharmony_ci __le32 exp_stat_sn; 5488c2ecf20Sopenharmony_ci __le32 reserved4[4]; 5498c2ecf20Sopenharmony_ci}; 5508c2ecf20Sopenharmony_ci 5518c2ecf20Sopenharmony_ci/* iSCSI Text Response PDU header */ 5528c2ecf20Sopenharmony_cistruct iscsi_text_response_hdr { 5538c2ecf20Sopenharmony_ci __le16 reserved1; 5548c2ecf20Sopenharmony_ci u8 flags; 5558c2ecf20Sopenharmony_ci#define ISCSI_TEXT_RESPONSE_HDR_RSRV_MASK 0x3F 5568c2ecf20Sopenharmony_ci#define ISCSI_TEXT_RESPONSE_HDR_RSRV_SHIFT 0 5578c2ecf20Sopenharmony_ci#define ISCSI_TEXT_RESPONSE_HDR_C_MASK 0x1 5588c2ecf20Sopenharmony_ci#define ISCSI_TEXT_RESPONSE_HDR_C_SHIFT 6 5598c2ecf20Sopenharmony_ci#define ISCSI_TEXT_RESPONSE_HDR_F_MASK 0x1 5608c2ecf20Sopenharmony_ci#define ISCSI_TEXT_RESPONSE_HDR_F_SHIFT 7 5618c2ecf20Sopenharmony_ci u8 opcode; 5628c2ecf20Sopenharmony_ci __le32 hdr_second_dword; 5638c2ecf20Sopenharmony_ci#define ISCSI_TEXT_RESPONSE_HDR_DATA_SEG_LEN_MASK 0xFFFFFF 5648c2ecf20Sopenharmony_ci#define ISCSI_TEXT_RESPONSE_HDR_DATA_SEG_LEN_SHIFT 0 5658c2ecf20Sopenharmony_ci#define ISCSI_TEXT_RESPONSE_HDR_TOTAL_AHS_LEN_MASK 0xFF 5668c2ecf20Sopenharmony_ci#define ISCSI_TEXT_RESPONSE_HDR_TOTAL_AHS_LEN_SHIFT 24 5678c2ecf20Sopenharmony_ci struct regpair lun; 5688c2ecf20Sopenharmony_ci __le32 itt; 5698c2ecf20Sopenharmony_ci __le32 ttt; 5708c2ecf20Sopenharmony_ci __le32 stat_sn; 5718c2ecf20Sopenharmony_ci __le32 exp_cmd_sn; 5728c2ecf20Sopenharmony_ci __le32 max_cmd_sn; 5738c2ecf20Sopenharmony_ci __le32 reserved4[3]; 5748c2ecf20Sopenharmony_ci}; 5758c2ecf20Sopenharmony_ci 5768c2ecf20Sopenharmony_ci/* iSCSI TMF Request PDU header */ 5778c2ecf20Sopenharmony_cistruct iscsi_tmf_request_hdr { 5788c2ecf20Sopenharmony_ci __le16 reserved0; 5798c2ecf20Sopenharmony_ci u8 function; 5808c2ecf20Sopenharmony_ci u8 opcode; 5818c2ecf20Sopenharmony_ci __le32 hdr_second_dword; 5828c2ecf20Sopenharmony_ci#define ISCSI_TMF_REQUEST_HDR_DATA_SEG_LEN_MASK 0xFFFFFF 5838c2ecf20Sopenharmony_ci#define ISCSI_TMF_REQUEST_HDR_DATA_SEG_LEN_SHIFT 0 5848c2ecf20Sopenharmony_ci#define ISCSI_TMF_REQUEST_HDR_TOTAL_AHS_LEN_MASK 0xFF 5858c2ecf20Sopenharmony_ci#define ISCSI_TMF_REQUEST_HDR_TOTAL_AHS_LEN_SHIFT 24 5868c2ecf20Sopenharmony_ci struct regpair lun; 5878c2ecf20Sopenharmony_ci __le32 itt; 5888c2ecf20Sopenharmony_ci __le32 rtt; 5898c2ecf20Sopenharmony_ci __le32 cmd_sn; 5908c2ecf20Sopenharmony_ci __le32 exp_stat_sn; 5918c2ecf20Sopenharmony_ci __le32 ref_cmd_sn; 5928c2ecf20Sopenharmony_ci __le32 exp_data_sn; 5938c2ecf20Sopenharmony_ci __le32 reserved4[2]; 5948c2ecf20Sopenharmony_ci}; 5958c2ecf20Sopenharmony_ci 5968c2ecf20Sopenharmony_cistruct iscsi_tmf_response_hdr { 5978c2ecf20Sopenharmony_ci u8 reserved2; 5988c2ecf20Sopenharmony_ci u8 hdr_response; 5998c2ecf20Sopenharmony_ci u8 hdr_flags; 6008c2ecf20Sopenharmony_ci u8 opcode; 6018c2ecf20Sopenharmony_ci __le32 hdr_second_dword; 6028c2ecf20Sopenharmony_ci#define ISCSI_TMF_RESPONSE_HDR_DATA_SEG_LEN_MASK 0xFFFFFF 6038c2ecf20Sopenharmony_ci#define ISCSI_TMF_RESPONSE_HDR_DATA_SEG_LEN_SHIFT 0 6048c2ecf20Sopenharmony_ci#define ISCSI_TMF_RESPONSE_HDR_TOTAL_AHS_LEN_MASK 0xFF 6058c2ecf20Sopenharmony_ci#define ISCSI_TMF_RESPONSE_HDR_TOTAL_AHS_LEN_SHIFT 24 6068c2ecf20Sopenharmony_ci struct regpair reserved0; 6078c2ecf20Sopenharmony_ci __le32 itt; 6088c2ecf20Sopenharmony_ci __le32 reserved1; 6098c2ecf20Sopenharmony_ci __le32 stat_sn; 6108c2ecf20Sopenharmony_ci __le32 exp_cmd_sn; 6118c2ecf20Sopenharmony_ci __le32 max_cmd_sn; 6128c2ecf20Sopenharmony_ci __le32 reserved4[3]; 6138c2ecf20Sopenharmony_ci}; 6148c2ecf20Sopenharmony_ci 6158c2ecf20Sopenharmony_ci/* iSCSI Response PDU header */ 6168c2ecf20Sopenharmony_cistruct iscsi_response_hdr { 6178c2ecf20Sopenharmony_ci u8 hdr_status; 6188c2ecf20Sopenharmony_ci u8 hdr_response; 6198c2ecf20Sopenharmony_ci u8 hdr_flags; 6208c2ecf20Sopenharmony_ci u8 opcode; 6218c2ecf20Sopenharmony_ci __le32 hdr_second_dword; 6228c2ecf20Sopenharmony_ci#define ISCSI_RESPONSE_HDR_DATA_SEG_LEN_MASK 0xFFFFFF 6238c2ecf20Sopenharmony_ci#define ISCSI_RESPONSE_HDR_DATA_SEG_LEN_SHIFT 0 6248c2ecf20Sopenharmony_ci#define ISCSI_RESPONSE_HDR_TOTAL_AHS_LEN_MASK 0xFF 6258c2ecf20Sopenharmony_ci#define ISCSI_RESPONSE_HDR_TOTAL_AHS_LEN_SHIFT 24 6268c2ecf20Sopenharmony_ci struct regpair lun; 6278c2ecf20Sopenharmony_ci __le32 itt; 6288c2ecf20Sopenharmony_ci __le32 snack_tag; 6298c2ecf20Sopenharmony_ci __le32 stat_sn; 6308c2ecf20Sopenharmony_ci __le32 exp_cmd_sn; 6318c2ecf20Sopenharmony_ci __le32 max_cmd_sn; 6328c2ecf20Sopenharmony_ci __le32 exp_data_sn; 6338c2ecf20Sopenharmony_ci __le32 bi_residual_count; 6348c2ecf20Sopenharmony_ci __le32 residual_count; 6358c2ecf20Sopenharmony_ci}; 6368c2ecf20Sopenharmony_ci 6378c2ecf20Sopenharmony_ci/* iSCSI Reject PDU header */ 6388c2ecf20Sopenharmony_cistruct iscsi_reject_hdr { 6398c2ecf20Sopenharmony_ci u8 reserved4; 6408c2ecf20Sopenharmony_ci u8 hdr_reason; 6418c2ecf20Sopenharmony_ci u8 hdr_flags; 6428c2ecf20Sopenharmony_ci u8 opcode; 6438c2ecf20Sopenharmony_ci __le32 hdr_second_dword; 6448c2ecf20Sopenharmony_ci#define ISCSI_REJECT_HDR_DATA_SEG_LEN_MASK 0xFFFFFF 6458c2ecf20Sopenharmony_ci#define ISCSI_REJECT_HDR_DATA_SEG_LEN_SHIFT 0 6468c2ecf20Sopenharmony_ci#define ISCSI_REJECT_HDR_TOTAL_AHS_LEN_MASK 0xFF 6478c2ecf20Sopenharmony_ci#define ISCSI_REJECT_HDR_TOTAL_AHS_LEN_SHIFT 24 6488c2ecf20Sopenharmony_ci struct regpair reserved0; 6498c2ecf20Sopenharmony_ci __le32 all_ones; 6508c2ecf20Sopenharmony_ci __le32 reserved2; 6518c2ecf20Sopenharmony_ci __le32 stat_sn; 6528c2ecf20Sopenharmony_ci __le32 exp_cmd_sn; 6538c2ecf20Sopenharmony_ci __le32 max_cmd_sn; 6548c2ecf20Sopenharmony_ci __le32 data_sn; 6558c2ecf20Sopenharmony_ci __le32 reserved3[2]; 6568c2ecf20Sopenharmony_ci}; 6578c2ecf20Sopenharmony_ci 6588c2ecf20Sopenharmony_ci/* iSCSI Asynchronous Message PDU header */ 6598c2ecf20Sopenharmony_cistruct iscsi_async_msg_hdr { 6608c2ecf20Sopenharmony_ci __le16 reserved0; 6618c2ecf20Sopenharmony_ci u8 flags_attr; 6628c2ecf20Sopenharmony_ci#define ISCSI_ASYNC_MSG_HDR_RSRV_MASK 0x7F 6638c2ecf20Sopenharmony_ci#define ISCSI_ASYNC_MSG_HDR_RSRV_SHIFT 0 6648c2ecf20Sopenharmony_ci#define ISCSI_ASYNC_MSG_HDR_CONST1_MASK 0x1 6658c2ecf20Sopenharmony_ci#define ISCSI_ASYNC_MSG_HDR_CONST1_SHIFT 7 6668c2ecf20Sopenharmony_ci u8 opcode; 6678c2ecf20Sopenharmony_ci __le32 hdr_second_dword; 6688c2ecf20Sopenharmony_ci#define ISCSI_ASYNC_MSG_HDR_DATA_SEG_LEN_MASK 0xFFFFFF 6698c2ecf20Sopenharmony_ci#define ISCSI_ASYNC_MSG_HDR_DATA_SEG_LEN_SHIFT 0 6708c2ecf20Sopenharmony_ci#define ISCSI_ASYNC_MSG_HDR_TOTAL_AHS_LEN_MASK 0xFF 6718c2ecf20Sopenharmony_ci#define ISCSI_ASYNC_MSG_HDR_TOTAL_AHS_LEN_SHIFT 24 6728c2ecf20Sopenharmony_ci struct regpair lun; 6738c2ecf20Sopenharmony_ci __le32 all_ones; 6748c2ecf20Sopenharmony_ci __le32 reserved1; 6758c2ecf20Sopenharmony_ci __le32 stat_sn; 6768c2ecf20Sopenharmony_ci __le32 exp_cmd_sn; 6778c2ecf20Sopenharmony_ci __le32 max_cmd_sn; 6788c2ecf20Sopenharmony_ci __le16 param1_rsrv; 6798c2ecf20Sopenharmony_ci u8 async_vcode; 6808c2ecf20Sopenharmony_ci u8 async_event; 6818c2ecf20Sopenharmony_ci __le16 param3_rsrv; 6828c2ecf20Sopenharmony_ci __le16 param2_rsrv; 6838c2ecf20Sopenharmony_ci __le32 reserved7; 6848c2ecf20Sopenharmony_ci}; 6858c2ecf20Sopenharmony_ci 6868c2ecf20Sopenharmony_ci/* PDU header part of Ystorm task context */ 6878c2ecf20Sopenharmony_ciunion iscsi_task_hdr { 6888c2ecf20Sopenharmony_ci struct iscsi_common_hdr common; 6898c2ecf20Sopenharmony_ci struct data_hdr data; 6908c2ecf20Sopenharmony_ci struct iscsi_cmd_hdr cmd; 6918c2ecf20Sopenharmony_ci struct iscsi_ext_cdb_cmd_hdr ext_cdb_cmd; 6928c2ecf20Sopenharmony_ci struct iscsi_login_req_hdr login_req; 6938c2ecf20Sopenharmony_ci struct iscsi_logout_req_hdr logout_req; 6948c2ecf20Sopenharmony_ci struct iscsi_data_out_hdr data_out; 6958c2ecf20Sopenharmony_ci struct iscsi_data_in_hdr data_in; 6968c2ecf20Sopenharmony_ci struct iscsi_r2t_hdr r2t; 6978c2ecf20Sopenharmony_ci struct iscsi_nop_out_hdr nop_out; 6988c2ecf20Sopenharmony_ci struct iscsi_nop_in_hdr nop_in; 6998c2ecf20Sopenharmony_ci struct iscsi_login_response_hdr login_response; 7008c2ecf20Sopenharmony_ci struct iscsi_logout_response_hdr logout_response; 7018c2ecf20Sopenharmony_ci struct iscsi_text_request_hdr text_request; 7028c2ecf20Sopenharmony_ci struct iscsi_text_response_hdr text_response; 7038c2ecf20Sopenharmony_ci struct iscsi_tmf_request_hdr tmf_request; 7048c2ecf20Sopenharmony_ci struct iscsi_tmf_response_hdr tmf_response; 7058c2ecf20Sopenharmony_ci struct iscsi_response_hdr response; 7068c2ecf20Sopenharmony_ci struct iscsi_reject_hdr reject; 7078c2ecf20Sopenharmony_ci struct iscsi_async_msg_hdr async_msg; 7088c2ecf20Sopenharmony_ci}; 7098c2ecf20Sopenharmony_ci 7108c2ecf20Sopenharmony_ci/* The iscsi storm task context of Ystorm */ 7118c2ecf20Sopenharmony_cistruct ystorm_iscsi_task_st_ctx { 7128c2ecf20Sopenharmony_ci struct ystorm_iscsi_task_state state; 7138c2ecf20Sopenharmony_ci struct ystorm_iscsi_task_rxmit_opt rxmit_opt; 7148c2ecf20Sopenharmony_ci union iscsi_task_hdr pdu_hdr; 7158c2ecf20Sopenharmony_ci}; 7168c2ecf20Sopenharmony_ci 7178c2ecf20Sopenharmony_cistruct e4_ystorm_iscsi_task_ag_ctx { 7188c2ecf20Sopenharmony_ci u8 reserved; 7198c2ecf20Sopenharmony_ci u8 byte1; 7208c2ecf20Sopenharmony_ci __le16 word0; 7218c2ecf20Sopenharmony_ci u8 flags0; 7228c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_NIBBLE0_MASK 0xF 7238c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_NIBBLE0_SHIFT 0 7248c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_BIT0_MASK 0x1 7258c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_BIT0_SHIFT 4 7268c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_BIT1_MASK 0x1 7278c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_BIT1_SHIFT 5 7288c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_VALID_MASK 0x1 7298c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_VALID_SHIFT 6 7308c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_TTT_VALID_MASK 0x1 /* bit3 */ 7318c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_TTT_VALID_SHIFT 7 7328c2ecf20Sopenharmony_ci u8 flags1; 7338c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_CF0_MASK 0x3 7348c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_CF0_SHIFT 0 7358c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_CF1_MASK 0x3 7368c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_CF1_SHIFT 2 7378c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_CF2SPECIAL_MASK 0x3 7388c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_CF2SPECIAL_SHIFT 4 7398c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_CF0EN_MASK 0x1 7408c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_CF0EN_SHIFT 6 7418c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_CF1EN_MASK 0x1 7428c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_CF1EN_SHIFT 7 7438c2ecf20Sopenharmony_ci u8 flags2; 7448c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_BIT4_MASK 0x1 7458c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_BIT4_SHIFT 0 7468c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE0EN_MASK 0x1 7478c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE0EN_SHIFT 1 7488c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE1EN_MASK 0x1 7498c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE1EN_SHIFT 2 7508c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE2EN_MASK 0x1 7518c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE2EN_SHIFT 3 7528c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE3EN_MASK 0x1 7538c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE3EN_SHIFT 4 7548c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE4EN_MASK 0x1 7558c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE4EN_SHIFT 5 7568c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE5EN_MASK 0x1 7578c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE5EN_SHIFT 6 7588c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE6EN_MASK 0x1 7598c2ecf20Sopenharmony_ci#define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE6EN_SHIFT 7 7608c2ecf20Sopenharmony_ci u8 byte2; 7618c2ecf20Sopenharmony_ci __le32 TTT; 7628c2ecf20Sopenharmony_ci u8 byte3; 7638c2ecf20Sopenharmony_ci u8 byte4; 7648c2ecf20Sopenharmony_ci __le16 word1; 7658c2ecf20Sopenharmony_ci}; 7668c2ecf20Sopenharmony_ci 7678c2ecf20Sopenharmony_cistruct e4_mstorm_iscsi_task_ag_ctx { 7688c2ecf20Sopenharmony_ci u8 cdu_validation; 7698c2ecf20Sopenharmony_ci u8 byte1; 7708c2ecf20Sopenharmony_ci __le16 task_cid; 7718c2ecf20Sopenharmony_ci u8 flags0; 7728c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_CONNECTION_TYPE_MASK 0xF 7738c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_CONNECTION_TYPE_SHIFT 0 7748c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_EXIST_IN_QM0_MASK 0x1 7758c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_EXIST_IN_QM0_SHIFT 4 7768c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_CONN_CLEAR_SQ_FLAG_MASK 0x1 7778c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_CONN_CLEAR_SQ_FLAG_SHIFT 5 7788c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_VALID_MASK 0x1 7798c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_VALID_SHIFT 6 7808c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_FLAG_MASK 0x1 7818c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_FLAG_SHIFT 7 7828c2ecf20Sopenharmony_ci u8 flags1; 7838c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_CF_MASK 0x3 7848c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_CF_SHIFT 0 7858c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_CF1_MASK 0x3 7868c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_CF1_SHIFT 2 7878c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_CF2_MASK 0x3 7888c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_CF2_SHIFT 4 7898c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_CF_EN_MASK 0x1 7908c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_CF_EN_SHIFT 6 7918c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_CF1EN_MASK 0x1 7928c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_CF1EN_SHIFT 7 7938c2ecf20Sopenharmony_ci u8 flags2; 7948c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_CF2EN_MASK 0x1 7958c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_CF2EN_SHIFT 0 7968c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE0EN_MASK 0x1 7978c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE0EN_SHIFT 1 7988c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE1EN_MASK 0x1 7998c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE1EN_SHIFT 2 8008c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE2EN_MASK 0x1 8018c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE2EN_SHIFT 3 8028c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE3EN_MASK 0x1 8038c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE3EN_SHIFT 4 8048c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE4EN_MASK 0x1 8058c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE4EN_SHIFT 5 8068c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE5EN_MASK 0x1 8078c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE5EN_SHIFT 6 8088c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE6EN_MASK 0x1 8098c2ecf20Sopenharmony_ci#define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE6EN_SHIFT 7 8108c2ecf20Sopenharmony_ci u8 byte2; 8118c2ecf20Sopenharmony_ci __le32 reg0; 8128c2ecf20Sopenharmony_ci u8 byte3; 8138c2ecf20Sopenharmony_ci u8 byte4; 8148c2ecf20Sopenharmony_ci __le16 word1; 8158c2ecf20Sopenharmony_ci}; 8168c2ecf20Sopenharmony_ci 8178c2ecf20Sopenharmony_cistruct e4_ustorm_iscsi_task_ag_ctx { 8188c2ecf20Sopenharmony_ci u8 reserved; 8198c2ecf20Sopenharmony_ci u8 state; 8208c2ecf20Sopenharmony_ci __le16 icid; 8218c2ecf20Sopenharmony_ci u8 flags0; 8228c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_CONNECTION_TYPE_MASK 0xF 8238c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_CONNECTION_TYPE_SHIFT 0 8248c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_EXIST_IN_QM0_MASK 0x1 8258c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_EXIST_IN_QM0_SHIFT 4 8268c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_CONN_CLEAR_SQ_FLAG_MASK 0x1 8278c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_CONN_CLEAR_SQ_FLAG_SHIFT 5 8288c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_HQ_SCANNED_CF_MASK 0x3 8298c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_HQ_SCANNED_CF_SHIFT 6 8308c2ecf20Sopenharmony_ci u8 flags1; 8318c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_RESERVED1_MASK 0x3 8328c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_RESERVED1_SHIFT 0 8338c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_R2T2RECV_MASK 0x3 8348c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_R2T2RECV_SHIFT 2 8358c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_CF3_MASK 0x3 8368c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_CF3_SHIFT 4 8378c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_CF_MASK 0x3 8388c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_CF_SHIFT 6 8398c2ecf20Sopenharmony_ci u8 flags2; 8408c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_HQ_SCANNED_CF_EN_MASK 0x1 8418c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_HQ_SCANNED_CF_EN_SHIFT 0 8428c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_DISABLE_DATA_ACKED_MASK 0x1 8438c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_DISABLE_DATA_ACKED_SHIFT 1 8448c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_R2T2RECV_EN_MASK 0x1 8458c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_R2T2RECV_EN_SHIFT 2 8468c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_CF3EN_MASK 0x1 8478c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_CF3EN_SHIFT 3 8488c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_CF_EN_MASK 0x1 8498c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_CF_EN_SHIFT 4 8508c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_CMP_DATA_TOTAL_EXP_EN_MASK 0x1 8518c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_CMP_DATA_TOTAL_EXP_EN_SHIFT 5 8528c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_RULE1EN_MASK 0x1 8538c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_RULE1EN_SHIFT 6 8548c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_CMP_CONT_RCV_EXP_EN_MASK 0x1 8558c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_CMP_CONT_RCV_EXP_EN_SHIFT 7 8568c2ecf20Sopenharmony_ci u8 flags3; 8578c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_RULE3EN_MASK 0x1 8588c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_RULE3EN_SHIFT 0 8598c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_RULE4EN_MASK 0x1 8608c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_RULE4EN_SHIFT 1 8618c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_RULE5EN_MASK 0x1 8628c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_RULE5EN_SHIFT 2 8638c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_RULE6EN_MASK 0x1 8648c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_RULE6EN_SHIFT 3 8658c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_TYPE_MASK 0xF 8668c2ecf20Sopenharmony_ci#define E4_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_TYPE_SHIFT 4 8678c2ecf20Sopenharmony_ci __le32 dif_err_intervals; 8688c2ecf20Sopenharmony_ci __le32 dif_error_1st_interval; 8698c2ecf20Sopenharmony_ci __le32 rcv_cont_len; 8708c2ecf20Sopenharmony_ci __le32 exp_cont_len; 8718c2ecf20Sopenharmony_ci __le32 total_data_acked; 8728c2ecf20Sopenharmony_ci __le32 exp_data_acked; 8738c2ecf20Sopenharmony_ci u8 byte2; 8748c2ecf20Sopenharmony_ci u8 byte3; 8758c2ecf20Sopenharmony_ci __le16 word1; 8768c2ecf20Sopenharmony_ci __le16 next_tid; 8778c2ecf20Sopenharmony_ci __le16 word3; 8788c2ecf20Sopenharmony_ci __le32 hdr_residual_count; 8798c2ecf20Sopenharmony_ci __le32 exp_r2t_sn; 8808c2ecf20Sopenharmony_ci}; 8818c2ecf20Sopenharmony_ci 8828c2ecf20Sopenharmony_ci/* The iscsi storm task context of Mstorm */ 8838c2ecf20Sopenharmony_cistruct mstorm_iscsi_task_st_ctx { 8848c2ecf20Sopenharmony_ci struct scsi_cached_sges data_desc; 8858c2ecf20Sopenharmony_ci struct scsi_sgl_params sgl_params; 8868c2ecf20Sopenharmony_ci __le32 rem_task_size; 8878c2ecf20Sopenharmony_ci __le32 data_buffer_offset; 8888c2ecf20Sopenharmony_ci u8 task_type; 8898c2ecf20Sopenharmony_ci struct iscsi_dif_flags dif_flags; 8908c2ecf20Sopenharmony_ci __le16 dif_task_icid; 8918c2ecf20Sopenharmony_ci struct regpair sense_db; 8928c2ecf20Sopenharmony_ci __le32 expected_itt; 8938c2ecf20Sopenharmony_ci __le32 reserved1; 8948c2ecf20Sopenharmony_ci}; 8958c2ecf20Sopenharmony_ci 8968c2ecf20Sopenharmony_cistruct iscsi_reg1 { 8978c2ecf20Sopenharmony_ci __le32 reg1_map; 8988c2ecf20Sopenharmony_ci#define ISCSI_REG1_NUM_SGES_MASK 0xF 8998c2ecf20Sopenharmony_ci#define ISCSI_REG1_NUM_SGES_SHIFT 0 9008c2ecf20Sopenharmony_ci#define ISCSI_REG1_RESERVED1_MASK 0xFFFFFFF 9018c2ecf20Sopenharmony_ci#define ISCSI_REG1_RESERVED1_SHIFT 4 9028c2ecf20Sopenharmony_ci}; 9038c2ecf20Sopenharmony_ci 9048c2ecf20Sopenharmony_cistruct tqe_opaque { 9058c2ecf20Sopenharmony_ci __le16 opaque[2]; 9068c2ecf20Sopenharmony_ci}; 9078c2ecf20Sopenharmony_ci 9088c2ecf20Sopenharmony_ci/* The iscsi storm task context of Ustorm */ 9098c2ecf20Sopenharmony_cistruct ustorm_iscsi_task_st_ctx { 9108c2ecf20Sopenharmony_ci __le32 rem_rcv_len; 9118c2ecf20Sopenharmony_ci __le32 exp_data_transfer_len; 9128c2ecf20Sopenharmony_ci __le32 exp_data_sn; 9138c2ecf20Sopenharmony_ci struct regpair lun; 9148c2ecf20Sopenharmony_ci struct iscsi_reg1 reg1; 9158c2ecf20Sopenharmony_ci u8 flags2; 9168c2ecf20Sopenharmony_ci#define USTORM_ISCSI_TASK_ST_CTX_AHS_EXIST_MASK 0x1 9178c2ecf20Sopenharmony_ci#define USTORM_ISCSI_TASK_ST_CTX_AHS_EXIST_SHIFT 0 9188c2ecf20Sopenharmony_ci#define USTORM_ISCSI_TASK_ST_CTX_RESERVED1_MASK 0x7F 9198c2ecf20Sopenharmony_ci#define USTORM_ISCSI_TASK_ST_CTX_RESERVED1_SHIFT 1 9208c2ecf20Sopenharmony_ci struct iscsi_dif_flags dif_flags; 9218c2ecf20Sopenharmony_ci __le16 reserved3; 9228c2ecf20Sopenharmony_ci struct tqe_opaque tqe_opaque_list; 9238c2ecf20Sopenharmony_ci __le32 reserved5; 9248c2ecf20Sopenharmony_ci __le32 reserved6; 9258c2ecf20Sopenharmony_ci __le32 reserved7; 9268c2ecf20Sopenharmony_ci u8 task_type; 9278c2ecf20Sopenharmony_ci u8 error_flags; 9288c2ecf20Sopenharmony_ci#define USTORM_ISCSI_TASK_ST_CTX_DATA_DIGEST_ERROR_MASK 0x1 9298c2ecf20Sopenharmony_ci#define USTORM_ISCSI_TASK_ST_CTX_DATA_DIGEST_ERROR_SHIFT 0 9308c2ecf20Sopenharmony_ci#define USTORM_ISCSI_TASK_ST_CTX_DATA_TRUNCATED_ERROR_MASK 0x1 9318c2ecf20Sopenharmony_ci#define USTORM_ISCSI_TASK_ST_CTX_DATA_TRUNCATED_ERROR_SHIFT 1 9328c2ecf20Sopenharmony_ci#define USTORM_ISCSI_TASK_ST_CTX_UNDER_RUN_ERROR_MASK 0x1 9338c2ecf20Sopenharmony_ci#define USTORM_ISCSI_TASK_ST_CTX_UNDER_RUN_ERROR_SHIFT 2 9348c2ecf20Sopenharmony_ci#define USTORM_ISCSI_TASK_ST_CTX_RESERVED8_MASK 0x1F 9358c2ecf20Sopenharmony_ci#define USTORM_ISCSI_TASK_ST_CTX_RESERVED8_SHIFT 3 9368c2ecf20Sopenharmony_ci u8 flags; 9378c2ecf20Sopenharmony_ci#define USTORM_ISCSI_TASK_ST_CTX_CQE_WRITE_MASK 0x3 9388c2ecf20Sopenharmony_ci#define USTORM_ISCSI_TASK_ST_CTX_CQE_WRITE_SHIFT 0 9398c2ecf20Sopenharmony_ci#define USTORM_ISCSI_TASK_ST_CTX_LOCAL_COMP_MASK 0x1 9408c2ecf20Sopenharmony_ci#define USTORM_ISCSI_TASK_ST_CTX_LOCAL_COMP_SHIFT 2 9418c2ecf20Sopenharmony_ci#define USTORM_ISCSI_TASK_ST_CTX_Q0_R2TQE_WRITE_MASK 0x1 9428c2ecf20Sopenharmony_ci#define USTORM_ISCSI_TASK_ST_CTX_Q0_R2TQE_WRITE_SHIFT 3 9438c2ecf20Sopenharmony_ci#define USTORM_ISCSI_TASK_ST_CTX_TOTAL_DATA_ACKED_DONE_MASK 0x1 9448c2ecf20Sopenharmony_ci#define USTORM_ISCSI_TASK_ST_CTX_TOTAL_DATA_ACKED_DONE_SHIFT 4 9458c2ecf20Sopenharmony_ci#define USTORM_ISCSI_TASK_ST_CTX_HQ_SCANNED_DONE_MASK 0x1 9468c2ecf20Sopenharmony_ci#define USTORM_ISCSI_TASK_ST_CTX_HQ_SCANNED_DONE_SHIFT 5 9478c2ecf20Sopenharmony_ci#define USTORM_ISCSI_TASK_ST_CTX_R2T2RECV_DONE_MASK 0x1 9488c2ecf20Sopenharmony_ci#define USTORM_ISCSI_TASK_ST_CTX_R2T2RECV_DONE_SHIFT 6 9498c2ecf20Sopenharmony_ci#define USTORM_ISCSI_TASK_ST_CTX_RESERVED0_MASK 0x1 9508c2ecf20Sopenharmony_ci#define USTORM_ISCSI_TASK_ST_CTX_RESERVED0_SHIFT 7 9518c2ecf20Sopenharmony_ci u8 cq_rss_number; 9528c2ecf20Sopenharmony_ci}; 9538c2ecf20Sopenharmony_ci 9548c2ecf20Sopenharmony_ci/* iscsi task context */ 9558c2ecf20Sopenharmony_cistruct e4_iscsi_task_context { 9568c2ecf20Sopenharmony_ci struct ystorm_iscsi_task_st_ctx ystorm_st_context; 9578c2ecf20Sopenharmony_ci struct e4_ystorm_iscsi_task_ag_ctx ystorm_ag_context; 9588c2ecf20Sopenharmony_ci struct regpair ystorm_ag_padding[2]; 9598c2ecf20Sopenharmony_ci struct tdif_task_context tdif_context; 9608c2ecf20Sopenharmony_ci struct e4_mstorm_iscsi_task_ag_ctx mstorm_ag_context; 9618c2ecf20Sopenharmony_ci struct regpair mstorm_ag_padding[2]; 9628c2ecf20Sopenharmony_ci struct e4_ustorm_iscsi_task_ag_ctx ustorm_ag_context; 9638c2ecf20Sopenharmony_ci struct mstorm_iscsi_task_st_ctx mstorm_st_context; 9648c2ecf20Sopenharmony_ci struct ustorm_iscsi_task_st_ctx ustorm_st_context; 9658c2ecf20Sopenharmony_ci struct rdif_task_context rdif_context; 9668c2ecf20Sopenharmony_ci}; 9678c2ecf20Sopenharmony_ci 9688c2ecf20Sopenharmony_ci/* iSCSI connection offload params passed by driver to FW in ISCSI offload 9698c2ecf20Sopenharmony_ci * ramrod. 9708c2ecf20Sopenharmony_ci */ 9718c2ecf20Sopenharmony_cistruct iscsi_conn_offload_params { 9728c2ecf20Sopenharmony_ci struct regpair sq_pbl_addr; 9738c2ecf20Sopenharmony_ci struct regpair r2tq_pbl_addr; 9748c2ecf20Sopenharmony_ci struct regpair xhq_pbl_addr; 9758c2ecf20Sopenharmony_ci struct regpair uhq_pbl_addr; 9768c2ecf20Sopenharmony_ci __le16 physical_q0; 9778c2ecf20Sopenharmony_ci __le16 physical_q1; 9788c2ecf20Sopenharmony_ci u8 flags; 9798c2ecf20Sopenharmony_ci#define ISCSI_CONN_OFFLOAD_PARAMS_TCP_ON_CHIP_1B_MASK 0x1 9808c2ecf20Sopenharmony_ci#define ISCSI_CONN_OFFLOAD_PARAMS_TCP_ON_CHIP_1B_SHIFT 0 9818c2ecf20Sopenharmony_ci#define ISCSI_CONN_OFFLOAD_PARAMS_TARGET_MODE_MASK 0x1 9828c2ecf20Sopenharmony_ci#define ISCSI_CONN_OFFLOAD_PARAMS_TARGET_MODE_SHIFT 1 9838c2ecf20Sopenharmony_ci#define ISCSI_CONN_OFFLOAD_PARAMS_RESTRICTED_MODE_MASK 0x1 9848c2ecf20Sopenharmony_ci#define ISCSI_CONN_OFFLOAD_PARAMS_RESTRICTED_MODE_SHIFT 2 9858c2ecf20Sopenharmony_ci#define ISCSI_CONN_OFFLOAD_PARAMS_RESERVED1_MASK 0x1F 9868c2ecf20Sopenharmony_ci#define ISCSI_CONN_OFFLOAD_PARAMS_RESERVED1_SHIFT 3 9878c2ecf20Sopenharmony_ci u8 default_cq; 9888c2ecf20Sopenharmony_ci __le16 reserved0; 9898c2ecf20Sopenharmony_ci __le32 stat_sn; 9908c2ecf20Sopenharmony_ci __le32 initial_ack; 9918c2ecf20Sopenharmony_ci}; 9928c2ecf20Sopenharmony_ci 9938c2ecf20Sopenharmony_ci/* iSCSI connection statistics */ 9948c2ecf20Sopenharmony_cistruct iscsi_conn_stats_params { 9958c2ecf20Sopenharmony_ci struct regpair iscsi_tcp_tx_packets_cnt; 9968c2ecf20Sopenharmony_ci struct regpair iscsi_tcp_tx_bytes_cnt; 9978c2ecf20Sopenharmony_ci struct regpair iscsi_tcp_tx_rxmit_cnt; 9988c2ecf20Sopenharmony_ci struct regpair iscsi_tcp_rx_packets_cnt; 9998c2ecf20Sopenharmony_ci struct regpair iscsi_tcp_rx_bytes_cnt; 10008c2ecf20Sopenharmony_ci struct regpair iscsi_tcp_rx_dup_ack_cnt; 10018c2ecf20Sopenharmony_ci __le32 iscsi_tcp_rx_chksum_err_cnt; 10028c2ecf20Sopenharmony_ci __le32 reserved; 10038c2ecf20Sopenharmony_ci}; 10048c2ecf20Sopenharmony_ci 10058c2ecf20Sopenharmony_ci 10068c2ecf20Sopenharmony_ci/* iSCSI connection update params passed by driver to FW in ISCSI update 10078c2ecf20Sopenharmony_ci *ramrod. 10088c2ecf20Sopenharmony_ci */ 10098c2ecf20Sopenharmony_cistruct iscsi_conn_update_ramrod_params { 10108c2ecf20Sopenharmony_ci __le16 reserved0; 10118c2ecf20Sopenharmony_ci __le16 conn_id; 10128c2ecf20Sopenharmony_ci __le32 reserved1; 10138c2ecf20Sopenharmony_ci u8 flags; 10148c2ecf20Sopenharmony_ci#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_HD_EN_MASK 0x1 10158c2ecf20Sopenharmony_ci#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_HD_EN_SHIFT 0 10168c2ecf20Sopenharmony_ci#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DD_EN_MASK 0x1 10178c2ecf20Sopenharmony_ci#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DD_EN_SHIFT 1 10188c2ecf20Sopenharmony_ci#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_INITIAL_R2T_MASK 0x1 10198c2ecf20Sopenharmony_ci#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_INITIAL_R2T_SHIFT 2 10208c2ecf20Sopenharmony_ci#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_IMMEDIATE_DATA_MASK 0x1 10218c2ecf20Sopenharmony_ci#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_IMMEDIATE_DATA_SHIFT 3 10228c2ecf20Sopenharmony_ci#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DIF_BLOCK_SIZE_MASK 0x1 10238c2ecf20Sopenharmony_ci#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DIF_BLOCK_SIZE_SHIFT 4 10248c2ecf20Sopenharmony_ci#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DIF_ON_HOST_EN_MASK 0x1 10258c2ecf20Sopenharmony_ci#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DIF_ON_HOST_EN_SHIFT 5 10268c2ecf20Sopenharmony_ci#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DIF_ON_IMM_EN_MASK 0x1 10278c2ecf20Sopenharmony_ci#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DIF_ON_IMM_EN_SHIFT 6 10288c2ecf20Sopenharmony_ci#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_LUN_MAPPER_EN_MASK 0x1 10298c2ecf20Sopenharmony_ci#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_LUN_MAPPER_EN_SHIFT 7 10308c2ecf20Sopenharmony_ci u8 reserved3[3]; 10318c2ecf20Sopenharmony_ci __le32 max_seq_size; 10328c2ecf20Sopenharmony_ci __le32 max_send_pdu_length; 10338c2ecf20Sopenharmony_ci __le32 max_recv_pdu_length; 10348c2ecf20Sopenharmony_ci __le32 first_seq_length; 10358c2ecf20Sopenharmony_ci __le32 exp_stat_sn; 10368c2ecf20Sopenharmony_ci union dif_configuration_params dif_on_imme_params; 10378c2ecf20Sopenharmony_ci}; 10388c2ecf20Sopenharmony_ci 10398c2ecf20Sopenharmony_ci/* iSCSI CQ element */ 10408c2ecf20Sopenharmony_cistruct iscsi_cqe_common { 10418c2ecf20Sopenharmony_ci __le16 conn_id; 10428c2ecf20Sopenharmony_ci u8 cqe_type; 10438c2ecf20Sopenharmony_ci union cqe_error_status error_bitmap; 10448c2ecf20Sopenharmony_ci __le32 reserved[3]; 10458c2ecf20Sopenharmony_ci union iscsi_task_hdr iscsi_hdr; 10468c2ecf20Sopenharmony_ci}; 10478c2ecf20Sopenharmony_ci 10488c2ecf20Sopenharmony_ci/* iSCSI CQ element */ 10498c2ecf20Sopenharmony_cistruct iscsi_cqe_solicited { 10508c2ecf20Sopenharmony_ci __le16 conn_id; 10518c2ecf20Sopenharmony_ci u8 cqe_type; 10528c2ecf20Sopenharmony_ci union cqe_error_status error_bitmap; 10538c2ecf20Sopenharmony_ci __le16 itid; 10548c2ecf20Sopenharmony_ci u8 task_type; 10558c2ecf20Sopenharmony_ci u8 fw_dbg_field; 10568c2ecf20Sopenharmony_ci u8 caused_conn_err; 10578c2ecf20Sopenharmony_ci u8 reserved0[3]; 10588c2ecf20Sopenharmony_ci __le32 data_truncated_bytes; 10598c2ecf20Sopenharmony_ci union iscsi_task_hdr iscsi_hdr; 10608c2ecf20Sopenharmony_ci}; 10618c2ecf20Sopenharmony_ci 10628c2ecf20Sopenharmony_ci/* iSCSI CQ element */ 10638c2ecf20Sopenharmony_cistruct iscsi_cqe_unsolicited { 10648c2ecf20Sopenharmony_ci __le16 conn_id; 10658c2ecf20Sopenharmony_ci u8 cqe_type; 10668c2ecf20Sopenharmony_ci union cqe_error_status error_bitmap; 10678c2ecf20Sopenharmony_ci __le16 reserved0; 10688c2ecf20Sopenharmony_ci u8 reserved1; 10698c2ecf20Sopenharmony_ci u8 unsol_cqe_type; 10708c2ecf20Sopenharmony_ci __le16 rqe_opaque; 10718c2ecf20Sopenharmony_ci __le16 reserved2[3]; 10728c2ecf20Sopenharmony_ci union iscsi_task_hdr iscsi_hdr; 10738c2ecf20Sopenharmony_ci}; 10748c2ecf20Sopenharmony_ci 10758c2ecf20Sopenharmony_ci/* iSCSI CQ element */ 10768c2ecf20Sopenharmony_ciunion iscsi_cqe { 10778c2ecf20Sopenharmony_ci struct iscsi_cqe_common cqe_common; 10788c2ecf20Sopenharmony_ci struct iscsi_cqe_solicited cqe_solicited; 10798c2ecf20Sopenharmony_ci struct iscsi_cqe_unsolicited cqe_unsolicited; 10808c2ecf20Sopenharmony_ci}; 10818c2ecf20Sopenharmony_ci 10828c2ecf20Sopenharmony_ci/* iSCSI CQE type */ 10838c2ecf20Sopenharmony_cienum iscsi_cqes_type { 10848c2ecf20Sopenharmony_ci ISCSI_CQE_TYPE_SOLICITED = 1, 10858c2ecf20Sopenharmony_ci ISCSI_CQE_TYPE_UNSOLICITED, 10868c2ecf20Sopenharmony_ci ISCSI_CQE_TYPE_SOLICITED_WITH_SENSE, 10878c2ecf20Sopenharmony_ci ISCSI_CQE_TYPE_TASK_CLEANUP, 10888c2ecf20Sopenharmony_ci ISCSI_CQE_TYPE_DUMMY, 10898c2ecf20Sopenharmony_ci MAX_ISCSI_CQES_TYPE 10908c2ecf20Sopenharmony_ci}; 10918c2ecf20Sopenharmony_ci 10928c2ecf20Sopenharmony_ci/* iSCSI CQE type */ 10938c2ecf20Sopenharmony_cienum iscsi_cqe_unsolicited_type { 10948c2ecf20Sopenharmony_ci ISCSI_CQE_UNSOLICITED_NONE, 10958c2ecf20Sopenharmony_ci ISCSI_CQE_UNSOLICITED_SINGLE, 10968c2ecf20Sopenharmony_ci ISCSI_CQE_UNSOLICITED_FIRST, 10978c2ecf20Sopenharmony_ci ISCSI_CQE_UNSOLICITED_MIDDLE, 10988c2ecf20Sopenharmony_ci ISCSI_CQE_UNSOLICITED_LAST, 10998c2ecf20Sopenharmony_ci MAX_ISCSI_CQE_UNSOLICITED_TYPE 11008c2ecf20Sopenharmony_ci}; 11018c2ecf20Sopenharmony_ci 11028c2ecf20Sopenharmony_ci/* iscsi debug modes */ 11038c2ecf20Sopenharmony_cistruct iscsi_debug_modes { 11048c2ecf20Sopenharmony_ci u8 flags; 11058c2ecf20Sopenharmony_ci#define ISCSI_DEBUG_MODES_ASSERT_IF_RX_CONN_ERROR_MASK 0x1 11068c2ecf20Sopenharmony_ci#define ISCSI_DEBUG_MODES_ASSERT_IF_RX_CONN_ERROR_SHIFT 0 11078c2ecf20Sopenharmony_ci#define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_RESET_MASK 0x1 11088c2ecf20Sopenharmony_ci#define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_RESET_SHIFT 1 11098c2ecf20Sopenharmony_ci#define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_FIN_MASK 0x1 11108c2ecf20Sopenharmony_ci#define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_FIN_SHIFT 2 11118c2ecf20Sopenharmony_ci#define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_CLEANUP_MASK 0x1 11128c2ecf20Sopenharmony_ci#define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_CLEANUP_SHIFT 3 11138c2ecf20Sopenharmony_ci#define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_REJECT_OR_ASYNC_MASK 0x1 11148c2ecf20Sopenharmony_ci#define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_REJECT_OR_ASYNC_SHIFT 4 11158c2ecf20Sopenharmony_ci#define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_NOP_MASK 0x1 11168c2ecf20Sopenharmony_ci#define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_NOP_SHIFT 5 11178c2ecf20Sopenharmony_ci#define ISCSI_DEBUG_MODES_ASSERT_IF_DIF_OR_DATA_DIGEST_ERROR_MASK 0x1 11188c2ecf20Sopenharmony_ci#define ISCSI_DEBUG_MODES_ASSERT_IF_DIF_OR_DATA_DIGEST_ERROR_SHIFT 6 11198c2ecf20Sopenharmony_ci#define ISCSI_DEBUG_MODES_ASSERT_IF_HQ_CORRUPT_MASK 0x1 11208c2ecf20Sopenharmony_ci#define ISCSI_DEBUG_MODES_ASSERT_IF_HQ_CORRUPT_SHIFT 7 11218c2ecf20Sopenharmony_ci}; 11228c2ecf20Sopenharmony_ci 11238c2ecf20Sopenharmony_ci/* iSCSI kernel completion queue IDs */ 11248c2ecf20Sopenharmony_cienum iscsi_eqe_opcode { 11258c2ecf20Sopenharmony_ci ISCSI_EVENT_TYPE_INIT_FUNC = 0, 11268c2ecf20Sopenharmony_ci ISCSI_EVENT_TYPE_DESTROY_FUNC, 11278c2ecf20Sopenharmony_ci ISCSI_EVENT_TYPE_OFFLOAD_CONN, 11288c2ecf20Sopenharmony_ci ISCSI_EVENT_TYPE_UPDATE_CONN, 11298c2ecf20Sopenharmony_ci ISCSI_EVENT_TYPE_CLEAR_SQ, 11308c2ecf20Sopenharmony_ci ISCSI_EVENT_TYPE_TERMINATE_CONN, 11318c2ecf20Sopenharmony_ci ISCSI_EVENT_TYPE_MAC_UPDATE_CONN, 11328c2ecf20Sopenharmony_ci ISCSI_EVENT_TYPE_COLLECT_STATS_CONN, 11338c2ecf20Sopenharmony_ci ISCSI_EVENT_TYPE_ASYN_CONNECT_COMPLETE, 11348c2ecf20Sopenharmony_ci ISCSI_EVENT_TYPE_ASYN_TERMINATE_DONE, 11358c2ecf20Sopenharmony_ci ISCSI_EVENT_TYPE_START_OF_ERROR_TYPES = 10, 11368c2ecf20Sopenharmony_ci ISCSI_EVENT_TYPE_ASYN_ABORT_RCVD, 11378c2ecf20Sopenharmony_ci ISCSI_EVENT_TYPE_ASYN_CLOSE_RCVD, 11388c2ecf20Sopenharmony_ci ISCSI_EVENT_TYPE_ASYN_SYN_RCVD, 11398c2ecf20Sopenharmony_ci ISCSI_EVENT_TYPE_ASYN_MAX_RT_TIME, 11408c2ecf20Sopenharmony_ci ISCSI_EVENT_TYPE_ASYN_MAX_RT_CNT, 11418c2ecf20Sopenharmony_ci ISCSI_EVENT_TYPE_ASYN_MAX_KA_PROBES_CNT, 11428c2ecf20Sopenharmony_ci ISCSI_EVENT_TYPE_ASYN_FIN_WAIT2, 11438c2ecf20Sopenharmony_ci ISCSI_EVENT_TYPE_ISCSI_CONN_ERROR, 11448c2ecf20Sopenharmony_ci ISCSI_EVENT_TYPE_TCP_CONN_ERROR, 11458c2ecf20Sopenharmony_ci MAX_ISCSI_EQE_OPCODE 11468c2ecf20Sopenharmony_ci}; 11478c2ecf20Sopenharmony_ci 11488c2ecf20Sopenharmony_ci/* iSCSI EQE and CQE completion status */ 11498c2ecf20Sopenharmony_cienum iscsi_error_types { 11508c2ecf20Sopenharmony_ci ISCSI_STATUS_NONE = 0, 11518c2ecf20Sopenharmony_ci ISCSI_CQE_ERROR_UNSOLICITED_RCV_ON_INVALID_CONN = 1, 11528c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_TASK_CID_MISMATCH, 11538c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_TASK_NOT_VALID, 11548c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_RQ_RING_IS_FULL, 11558c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_CMDQ_RING_IS_FULL, 11568c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_HQE_CACHING_FAILED, 11578c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_HEADER_DIGEST_ERROR, 11588c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_LOCAL_COMPLETION_ERROR, 11598c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_DATA_OVERRUN, 11608c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_OUT_OF_SGES_ERROR, 11618c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_IP_OPTIONS_ERROR, 11628c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_PRS_ERRORS, 11638c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_CONNECT_INVALID_TCP_OPTION, 11648c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_TCP_IP_FRAGMENT_ERROR, 11658c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_PROTOCOL_ERR_AHS_LEN, 11668c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_PROTOCOL_ERR_AHS_TYPE, 11678c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_PROTOCOL_ERR_ITT_OUT_OF_RANGE, 11688c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_PROTOCOL_ERR_TTT_OUT_OF_RANGE, 11698c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_PROTOCOL_ERR_DATA_SEG_LEN_EXCEEDS_PDU_SIZE, 11708c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_PROTOCOL_ERR_INVALID_OPCODE, 11718c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_PROTOCOL_ERR_INVALID_OPCODE_BEFORE_UPDATE, 11728c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_UNVALID_NOPIN_DSL, 11738c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_PROTOCOL_ERR_R2T_CARRIES_NO_DATA, 11748c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_PROTOCOL_ERR_DATA_SN, 11758c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_PROTOCOL_ERR_DATA_IN_TTT, 11768c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_PROTOCOL_ERR_DATA_OUT_ITT, 11778c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_PROTOCOL_ERR_R2T_TTT, 11788c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_PROTOCOL_ERR_R2T_BUFFER_OFFSET, 11798c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_PROTOCOL_ERR_BUFFER_OFFSET_OOO, 11808c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_PROTOCOL_ERR_R2T_SN, 11818c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_PROTOCOL_ERR_DESIRED_DATA_TRNS_LEN_0, 11828c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_PROTOCOL_ERR_DESIRED_DATA_TRNS_LEN_1, 11838c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_PROTOCOL_ERR_DESIRED_DATA_TRNS_LEN_2, 11848c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_PROTOCOL_ERR_LUN, 11858c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_PROTOCOL_ERR_F_BIT_ZERO, 11868c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_PROTOCOL_ERR_F_BIT_ZERO_S_BIT_ONE, 11878c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_PROTOCOL_ERR_EXP_STAT_SN, 11888c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_PROTOCOL_ERR_DSL_NOT_ZERO, 11898c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_PROTOCOL_ERR_INVALID_DSL, 11908c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_PROTOCOL_ERR_DATA_SEG_LEN_TOO_BIG, 11918c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_PROTOCOL_ERR_OUTSTANDING_R2T_COUNT, 11928c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_PROTOCOL_ERR_DIF_TX, 11938c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_SENSE_DATA_LENGTH, 11948c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_DATA_PLACEMENT_ERROR, 11958c2ecf20Sopenharmony_ci ISCSI_CONN_ERROR_INVALID_ITT, 11968c2ecf20Sopenharmony_ci ISCSI_ERROR_UNKNOWN, 11978c2ecf20Sopenharmony_ci MAX_ISCSI_ERROR_TYPES 11988c2ecf20Sopenharmony_ci}; 11998c2ecf20Sopenharmony_ci 12008c2ecf20Sopenharmony_ci/* iSCSI Ramrod Command IDs */ 12018c2ecf20Sopenharmony_cienum iscsi_ramrod_cmd_id { 12028c2ecf20Sopenharmony_ci ISCSI_RAMROD_CMD_ID_UNUSED = 0, 12038c2ecf20Sopenharmony_ci ISCSI_RAMROD_CMD_ID_INIT_FUNC = 1, 12048c2ecf20Sopenharmony_ci ISCSI_RAMROD_CMD_ID_DESTROY_FUNC = 2, 12058c2ecf20Sopenharmony_ci ISCSI_RAMROD_CMD_ID_OFFLOAD_CONN = 3, 12068c2ecf20Sopenharmony_ci ISCSI_RAMROD_CMD_ID_UPDATE_CONN = 4, 12078c2ecf20Sopenharmony_ci ISCSI_RAMROD_CMD_ID_TERMINATION_CONN = 5, 12088c2ecf20Sopenharmony_ci ISCSI_RAMROD_CMD_ID_CLEAR_SQ = 6, 12098c2ecf20Sopenharmony_ci ISCSI_RAMROD_CMD_ID_MAC_UPDATE = 7, 12108c2ecf20Sopenharmony_ci ISCSI_RAMROD_CMD_ID_CONN_STATS = 8, 12118c2ecf20Sopenharmony_ci MAX_ISCSI_RAMROD_CMD_ID 12128c2ecf20Sopenharmony_ci}; 12138c2ecf20Sopenharmony_ci 12148c2ecf20Sopenharmony_ci/* iSCSI connection termination request */ 12158c2ecf20Sopenharmony_cistruct iscsi_spe_conn_mac_update { 12168c2ecf20Sopenharmony_ci __le16 reserved0; 12178c2ecf20Sopenharmony_ci __le16 conn_id; 12188c2ecf20Sopenharmony_ci __le32 reserved1; 12198c2ecf20Sopenharmony_ci __le16 remote_mac_addr_lo; 12208c2ecf20Sopenharmony_ci __le16 remote_mac_addr_mid; 12218c2ecf20Sopenharmony_ci __le16 remote_mac_addr_hi; 12228c2ecf20Sopenharmony_ci u8 reserved2[2]; 12238c2ecf20Sopenharmony_ci}; 12248c2ecf20Sopenharmony_ci 12258c2ecf20Sopenharmony_ci/* iSCSI and TCP connection (Option 1) offload params passed by driver to FW in 12268c2ecf20Sopenharmony_ci * iSCSI offload ramrod. 12278c2ecf20Sopenharmony_ci */ 12288c2ecf20Sopenharmony_cistruct iscsi_spe_conn_offload { 12298c2ecf20Sopenharmony_ci __le16 reserved0; 12308c2ecf20Sopenharmony_ci __le16 conn_id; 12318c2ecf20Sopenharmony_ci __le32 reserved1; 12328c2ecf20Sopenharmony_ci struct iscsi_conn_offload_params iscsi; 12338c2ecf20Sopenharmony_ci struct tcp_offload_params tcp; 12348c2ecf20Sopenharmony_ci}; 12358c2ecf20Sopenharmony_ci 12368c2ecf20Sopenharmony_ci/* iSCSI and TCP connection(Option 2) offload params passed by driver to FW in 12378c2ecf20Sopenharmony_ci * iSCSI offload ramrod. 12388c2ecf20Sopenharmony_ci */ 12398c2ecf20Sopenharmony_cistruct iscsi_spe_conn_offload_option2 { 12408c2ecf20Sopenharmony_ci __le16 reserved0; 12418c2ecf20Sopenharmony_ci __le16 conn_id; 12428c2ecf20Sopenharmony_ci __le32 reserved1; 12438c2ecf20Sopenharmony_ci struct iscsi_conn_offload_params iscsi; 12448c2ecf20Sopenharmony_ci struct tcp_offload_params_opt2 tcp; 12458c2ecf20Sopenharmony_ci}; 12468c2ecf20Sopenharmony_ci 12478c2ecf20Sopenharmony_ci/* iSCSI collect connection statistics request */ 12488c2ecf20Sopenharmony_cistruct iscsi_spe_conn_statistics { 12498c2ecf20Sopenharmony_ci __le16 reserved0; 12508c2ecf20Sopenharmony_ci __le16 conn_id; 12518c2ecf20Sopenharmony_ci __le32 reserved1; 12528c2ecf20Sopenharmony_ci u8 reset_stats; 12538c2ecf20Sopenharmony_ci u8 reserved2[7]; 12548c2ecf20Sopenharmony_ci struct regpair stats_cnts_addr; 12558c2ecf20Sopenharmony_ci}; 12568c2ecf20Sopenharmony_ci 12578c2ecf20Sopenharmony_ci/* iSCSI connection termination request */ 12588c2ecf20Sopenharmony_cistruct iscsi_spe_conn_termination { 12598c2ecf20Sopenharmony_ci __le16 reserved0; 12608c2ecf20Sopenharmony_ci __le16 conn_id; 12618c2ecf20Sopenharmony_ci __le32 reserved1; 12628c2ecf20Sopenharmony_ci u8 abortive; 12638c2ecf20Sopenharmony_ci u8 reserved2[7]; 12648c2ecf20Sopenharmony_ci struct regpair queue_cnts_addr; 12658c2ecf20Sopenharmony_ci struct regpair query_params_addr; 12668c2ecf20Sopenharmony_ci}; 12678c2ecf20Sopenharmony_ci 12688c2ecf20Sopenharmony_ci/* iSCSI firmware function init parameters */ 12698c2ecf20Sopenharmony_cistruct iscsi_spe_func_init { 12708c2ecf20Sopenharmony_ci __le16 half_way_close_timeout; 12718c2ecf20Sopenharmony_ci u8 num_sq_pages_in_ring; 12728c2ecf20Sopenharmony_ci u8 num_r2tq_pages_in_ring; 12738c2ecf20Sopenharmony_ci u8 num_uhq_pages_in_ring; 12748c2ecf20Sopenharmony_ci u8 ll2_rx_queue_id; 12758c2ecf20Sopenharmony_ci u8 flags; 12768c2ecf20Sopenharmony_ci#define ISCSI_SPE_FUNC_INIT_COUNTERS_EN_MASK 0x1 12778c2ecf20Sopenharmony_ci#define ISCSI_SPE_FUNC_INIT_COUNTERS_EN_SHIFT 0 12788c2ecf20Sopenharmony_ci#define ISCSI_SPE_FUNC_INIT_RESERVED0_MASK 0x7F 12798c2ecf20Sopenharmony_ci#define ISCSI_SPE_FUNC_INIT_RESERVED0_SHIFT 1 12808c2ecf20Sopenharmony_ci struct iscsi_debug_modes debug_mode; 12818c2ecf20Sopenharmony_ci u8 params; 12828c2ecf20Sopenharmony_ci#define ISCSI_SPE_FUNC_INIT_MAX_SYN_RT_MASK 0xF 12838c2ecf20Sopenharmony_ci#define ISCSI_SPE_FUNC_INIT_MAX_SYN_RT_SHIFT 0 12848c2ecf20Sopenharmony_ci#define ISCSI_SPE_FUNC_INIT_RESERVED1_MASK 0xF 12858c2ecf20Sopenharmony_ci#define ISCSI_SPE_FUNC_INIT_RESERVED1_SHIFT 4 12868c2ecf20Sopenharmony_ci u8 reserved2[7]; 12878c2ecf20Sopenharmony_ci struct scsi_init_func_params func_params; 12888c2ecf20Sopenharmony_ci struct scsi_init_func_queues q_params; 12898c2ecf20Sopenharmony_ci}; 12908c2ecf20Sopenharmony_ci 12918c2ecf20Sopenharmony_ci/* iSCSI task type */ 12928c2ecf20Sopenharmony_cienum iscsi_task_type { 12938c2ecf20Sopenharmony_ci ISCSI_TASK_TYPE_INITIATOR_WRITE, 12948c2ecf20Sopenharmony_ci ISCSI_TASK_TYPE_INITIATOR_READ, 12958c2ecf20Sopenharmony_ci ISCSI_TASK_TYPE_MIDPATH, 12968c2ecf20Sopenharmony_ci ISCSI_TASK_TYPE_UNSOLIC, 12978c2ecf20Sopenharmony_ci ISCSI_TASK_TYPE_EXCHCLEANUP, 12988c2ecf20Sopenharmony_ci ISCSI_TASK_TYPE_IRRELEVANT, 12998c2ecf20Sopenharmony_ci ISCSI_TASK_TYPE_TARGET_WRITE, 13008c2ecf20Sopenharmony_ci ISCSI_TASK_TYPE_TARGET_READ, 13018c2ecf20Sopenharmony_ci ISCSI_TASK_TYPE_TARGET_RESPONSE, 13028c2ecf20Sopenharmony_ci ISCSI_TASK_TYPE_LOGIN_RESPONSE, 13038c2ecf20Sopenharmony_ci ISCSI_TASK_TYPE_TARGET_IMM_W_DIF, 13048c2ecf20Sopenharmony_ci MAX_ISCSI_TASK_TYPE 13058c2ecf20Sopenharmony_ci}; 13068c2ecf20Sopenharmony_ci 13078c2ecf20Sopenharmony_ci/* iSCSI DesiredDataTransferLength/ttt union */ 13088c2ecf20Sopenharmony_ciunion iscsi_ttt_txlen_union { 13098c2ecf20Sopenharmony_ci __le32 desired_tx_len; 13108c2ecf20Sopenharmony_ci __le32 ttt; 13118c2ecf20Sopenharmony_ci}; 13128c2ecf20Sopenharmony_ci 13138c2ecf20Sopenharmony_ci/* iSCSI uHQ element */ 13148c2ecf20Sopenharmony_cistruct iscsi_uhqe { 13158c2ecf20Sopenharmony_ci __le32 reg1; 13168c2ecf20Sopenharmony_ci#define ISCSI_UHQE_PDU_PAYLOAD_LEN_MASK 0xFFFFF 13178c2ecf20Sopenharmony_ci#define ISCSI_UHQE_PDU_PAYLOAD_LEN_SHIFT 0 13188c2ecf20Sopenharmony_ci#define ISCSI_UHQE_LOCAL_COMP_MASK 0x1 13198c2ecf20Sopenharmony_ci#define ISCSI_UHQE_LOCAL_COMP_SHIFT 20 13208c2ecf20Sopenharmony_ci#define ISCSI_UHQE_TOGGLE_BIT_MASK 0x1 13218c2ecf20Sopenharmony_ci#define ISCSI_UHQE_TOGGLE_BIT_SHIFT 21 13228c2ecf20Sopenharmony_ci#define ISCSI_UHQE_PURE_PAYLOAD_MASK 0x1 13238c2ecf20Sopenharmony_ci#define ISCSI_UHQE_PURE_PAYLOAD_SHIFT 22 13248c2ecf20Sopenharmony_ci#define ISCSI_UHQE_LOGIN_RESPONSE_PDU_MASK 0x1 13258c2ecf20Sopenharmony_ci#define ISCSI_UHQE_LOGIN_RESPONSE_PDU_SHIFT 23 13268c2ecf20Sopenharmony_ci#define ISCSI_UHQE_TASK_ID_HI_MASK 0xFF 13278c2ecf20Sopenharmony_ci#define ISCSI_UHQE_TASK_ID_HI_SHIFT 24 13288c2ecf20Sopenharmony_ci __le32 reg2; 13298c2ecf20Sopenharmony_ci#define ISCSI_UHQE_BUFFER_OFFSET_MASK 0xFFFFFF 13308c2ecf20Sopenharmony_ci#define ISCSI_UHQE_BUFFER_OFFSET_SHIFT 0 13318c2ecf20Sopenharmony_ci#define ISCSI_UHQE_TASK_ID_LO_MASK 0xFF 13328c2ecf20Sopenharmony_ci#define ISCSI_UHQE_TASK_ID_LO_SHIFT 24 13338c2ecf20Sopenharmony_ci}; 13348c2ecf20Sopenharmony_ci 13358c2ecf20Sopenharmony_ci/* iSCSI WQ element */ 13368c2ecf20Sopenharmony_cistruct iscsi_wqe { 13378c2ecf20Sopenharmony_ci __le16 task_id; 13388c2ecf20Sopenharmony_ci u8 flags; 13398c2ecf20Sopenharmony_ci#define ISCSI_WQE_WQE_TYPE_MASK 0x7 13408c2ecf20Sopenharmony_ci#define ISCSI_WQE_WQE_TYPE_SHIFT 0 13418c2ecf20Sopenharmony_ci#define ISCSI_WQE_NUM_SGES_MASK 0xF 13428c2ecf20Sopenharmony_ci#define ISCSI_WQE_NUM_SGES_SHIFT 3 13438c2ecf20Sopenharmony_ci#define ISCSI_WQE_RESPONSE_MASK 0x1 13448c2ecf20Sopenharmony_ci#define ISCSI_WQE_RESPONSE_SHIFT 7 13458c2ecf20Sopenharmony_ci struct iscsi_dif_flags prot_flags; 13468c2ecf20Sopenharmony_ci __le32 contlen_cdbsize; 13478c2ecf20Sopenharmony_ci#define ISCSI_WQE_CONT_LEN_MASK 0xFFFFFF 13488c2ecf20Sopenharmony_ci#define ISCSI_WQE_CONT_LEN_SHIFT 0 13498c2ecf20Sopenharmony_ci#define ISCSI_WQE_CDB_SIZE_MASK 0xFF 13508c2ecf20Sopenharmony_ci#define ISCSI_WQE_CDB_SIZE_SHIFT 24 13518c2ecf20Sopenharmony_ci}; 13528c2ecf20Sopenharmony_ci 13538c2ecf20Sopenharmony_ci/* iSCSI wqe type */ 13548c2ecf20Sopenharmony_cienum iscsi_wqe_type { 13558c2ecf20Sopenharmony_ci ISCSI_WQE_TYPE_NORMAL, 13568c2ecf20Sopenharmony_ci ISCSI_WQE_TYPE_TASK_CLEANUP, 13578c2ecf20Sopenharmony_ci ISCSI_WQE_TYPE_MIDDLE_PATH, 13588c2ecf20Sopenharmony_ci ISCSI_WQE_TYPE_LOGIN, 13598c2ecf20Sopenharmony_ci ISCSI_WQE_TYPE_FIRST_R2T_CONT, 13608c2ecf20Sopenharmony_ci ISCSI_WQE_TYPE_NONFIRST_R2T_CONT, 13618c2ecf20Sopenharmony_ci ISCSI_WQE_TYPE_RESPONSE, 13628c2ecf20Sopenharmony_ci MAX_ISCSI_WQE_TYPE 13638c2ecf20Sopenharmony_ci}; 13648c2ecf20Sopenharmony_ci 13658c2ecf20Sopenharmony_ci/* iSCSI xHQ element */ 13668c2ecf20Sopenharmony_cistruct iscsi_xhqe { 13678c2ecf20Sopenharmony_ci union iscsi_ttt_txlen_union ttt_or_txlen; 13688c2ecf20Sopenharmony_ci __le32 exp_stat_sn; 13698c2ecf20Sopenharmony_ci struct iscsi_dif_flags prot_flags; 13708c2ecf20Sopenharmony_ci u8 total_ahs_length; 13718c2ecf20Sopenharmony_ci u8 opcode; 13728c2ecf20Sopenharmony_ci u8 flags; 13738c2ecf20Sopenharmony_ci#define ISCSI_XHQE_FINAL_MASK 0x1 13748c2ecf20Sopenharmony_ci#define ISCSI_XHQE_FINAL_SHIFT 0 13758c2ecf20Sopenharmony_ci#define ISCSI_XHQE_STATUS_BIT_MASK 0x1 13768c2ecf20Sopenharmony_ci#define ISCSI_XHQE_STATUS_BIT_SHIFT 1 13778c2ecf20Sopenharmony_ci#define ISCSI_XHQE_NUM_SGES_MASK 0xF 13788c2ecf20Sopenharmony_ci#define ISCSI_XHQE_NUM_SGES_SHIFT 2 13798c2ecf20Sopenharmony_ci#define ISCSI_XHQE_RESERVED0_MASK 0x3 13808c2ecf20Sopenharmony_ci#define ISCSI_XHQE_RESERVED0_SHIFT 6 13818c2ecf20Sopenharmony_ci union iscsi_seq_num seq_num; 13828c2ecf20Sopenharmony_ci __le16 reserved1; 13838c2ecf20Sopenharmony_ci}; 13848c2ecf20Sopenharmony_ci 13858c2ecf20Sopenharmony_ci/* Per PF iSCSI receive path statistics - mStorm RAM structure */ 13868c2ecf20Sopenharmony_cistruct mstorm_iscsi_stats_drv { 13878c2ecf20Sopenharmony_ci struct regpair iscsi_rx_dropped_pdus_task_not_valid; 13888c2ecf20Sopenharmony_ci struct regpair iscsi_rx_dup_ack_cnt; 13898c2ecf20Sopenharmony_ci}; 13908c2ecf20Sopenharmony_ci 13918c2ecf20Sopenharmony_ci/* Per PF iSCSI transmit path statistics - pStorm RAM structure */ 13928c2ecf20Sopenharmony_cistruct pstorm_iscsi_stats_drv { 13938c2ecf20Sopenharmony_ci struct regpair iscsi_tx_bytes_cnt; 13948c2ecf20Sopenharmony_ci struct regpair iscsi_tx_packet_cnt; 13958c2ecf20Sopenharmony_ci}; 13968c2ecf20Sopenharmony_ci 13978c2ecf20Sopenharmony_ci/* Per PF iSCSI receive path statistics - tStorm RAM structure */ 13988c2ecf20Sopenharmony_cistruct tstorm_iscsi_stats_drv { 13998c2ecf20Sopenharmony_ci struct regpair iscsi_rx_bytes_cnt; 14008c2ecf20Sopenharmony_ci struct regpair iscsi_rx_packet_cnt; 14018c2ecf20Sopenharmony_ci struct regpair iscsi_rx_new_ooo_isle_events_cnt; 14028c2ecf20Sopenharmony_ci struct regpair iscsi_rx_tcp_payload_bytes_cnt; 14038c2ecf20Sopenharmony_ci struct regpair iscsi_rx_tcp_pkt_cnt; 14048c2ecf20Sopenharmony_ci struct regpair iscsi_rx_pure_ack_cnt; 14058c2ecf20Sopenharmony_ci __le32 iscsi_cmdq_threshold_cnt; 14068c2ecf20Sopenharmony_ci __le32 iscsi_rq_threshold_cnt; 14078c2ecf20Sopenharmony_ci __le32 iscsi_immq_threshold_cnt; 14088c2ecf20Sopenharmony_ci}; 14098c2ecf20Sopenharmony_ci 14108c2ecf20Sopenharmony_ci/* Per PF iSCSI receive path statistics - uStorm RAM structure */ 14118c2ecf20Sopenharmony_cistruct ustorm_iscsi_stats_drv { 14128c2ecf20Sopenharmony_ci struct regpair iscsi_rx_data_pdu_cnt; 14138c2ecf20Sopenharmony_ci struct regpair iscsi_rx_r2t_pdu_cnt; 14148c2ecf20Sopenharmony_ci struct regpair iscsi_rx_total_pdu_cnt; 14158c2ecf20Sopenharmony_ci}; 14168c2ecf20Sopenharmony_ci 14178c2ecf20Sopenharmony_ci/* Per PF iSCSI transmit path statistics - xStorm RAM structure */ 14188c2ecf20Sopenharmony_cistruct xstorm_iscsi_stats_drv { 14198c2ecf20Sopenharmony_ci struct regpair iscsi_tx_go_to_slow_start_event_cnt; 14208c2ecf20Sopenharmony_ci struct regpair iscsi_tx_fast_retransmit_event_cnt; 14218c2ecf20Sopenharmony_ci struct regpair iscsi_tx_pure_ack_cnt; 14228c2ecf20Sopenharmony_ci struct regpair iscsi_tx_delayed_ack_cnt; 14238c2ecf20Sopenharmony_ci}; 14248c2ecf20Sopenharmony_ci 14258c2ecf20Sopenharmony_ci/* Per PF iSCSI transmit path statistics - yStorm RAM structure */ 14268c2ecf20Sopenharmony_cistruct ystorm_iscsi_stats_drv { 14278c2ecf20Sopenharmony_ci struct regpair iscsi_tx_data_pdu_cnt; 14288c2ecf20Sopenharmony_ci struct regpair iscsi_tx_r2t_pdu_cnt; 14298c2ecf20Sopenharmony_ci struct regpair iscsi_tx_total_pdu_cnt; 14308c2ecf20Sopenharmony_ci struct regpair iscsi_tx_tcp_payload_bytes_cnt; 14318c2ecf20Sopenharmony_ci struct regpair iscsi_tx_tcp_pkt_cnt; 14328c2ecf20Sopenharmony_ci}; 14338c2ecf20Sopenharmony_ci 14348c2ecf20Sopenharmony_cistruct e4_tstorm_iscsi_task_ag_ctx { 14358c2ecf20Sopenharmony_ci u8 byte0; 14368c2ecf20Sopenharmony_ci u8 byte1; 14378c2ecf20Sopenharmony_ci __le16 word0; 14388c2ecf20Sopenharmony_ci u8 flags0; 14398c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_NIBBLE0_MASK 0xF 14408c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_NIBBLE0_SHIFT 0 14418c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT0_MASK 0x1 14428c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT0_SHIFT 4 14438c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT1_MASK 0x1 14448c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT1_SHIFT 5 14458c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT2_MASK 0x1 14468c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT2_SHIFT 6 14478c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT3_MASK 0x1 14488c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT3_SHIFT 7 14498c2ecf20Sopenharmony_ci u8 flags1; 14508c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT4_MASK 0x1 14518c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT4_SHIFT 0 14528c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT5_MASK 0x1 14538c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT5_SHIFT 1 14548c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF0_MASK 0x3 14558c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF0_SHIFT 2 14568c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF1_MASK 0x3 14578c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF1_SHIFT 4 14588c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF2_MASK 0x3 14598c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF2_SHIFT 6 14608c2ecf20Sopenharmony_ci u8 flags2; 14618c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF3_MASK 0x3 14628c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF3_SHIFT 0 14638c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF4_MASK 0x3 14648c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF4_SHIFT 2 14658c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF5_MASK 0x3 14668c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF5_SHIFT 4 14678c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF6_MASK 0x3 14688c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF6_SHIFT 6 14698c2ecf20Sopenharmony_ci u8 flags3; 14708c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF7_MASK 0x3 14718c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF7_SHIFT 0 14728c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF0EN_MASK 0x1 14738c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF0EN_SHIFT 2 14748c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF1EN_MASK 0x1 14758c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF1EN_SHIFT 3 14768c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF2EN_MASK 0x1 14778c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF2EN_SHIFT 4 14788c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF3EN_MASK 0x1 14798c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF3EN_SHIFT 5 14808c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF4EN_MASK 0x1 14818c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF4EN_SHIFT 6 14828c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF5EN_MASK 0x1 14838c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF5EN_SHIFT 7 14848c2ecf20Sopenharmony_ci u8 flags4; 14858c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF6EN_MASK 0x1 14868c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF6EN_SHIFT 0 14878c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF7EN_MASK 0x1 14888c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF7EN_SHIFT 1 14898c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE0EN_MASK 0x1 14908c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE0EN_SHIFT 2 14918c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE1EN_MASK 0x1 14928c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE1EN_SHIFT 3 14938c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE2EN_MASK 0x1 14948c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE2EN_SHIFT 4 14958c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE3EN_MASK 0x1 14968c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE3EN_SHIFT 5 14978c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE4EN_MASK 0x1 14988c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE4EN_SHIFT 6 14998c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE5EN_MASK 0x1 15008c2ecf20Sopenharmony_ci#define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE5EN_SHIFT 7 15018c2ecf20Sopenharmony_ci u8 byte2; 15028c2ecf20Sopenharmony_ci __le16 word1; 15038c2ecf20Sopenharmony_ci __le32 reg0; 15048c2ecf20Sopenharmony_ci u8 byte3; 15058c2ecf20Sopenharmony_ci u8 byte4; 15068c2ecf20Sopenharmony_ci __le16 word2; 15078c2ecf20Sopenharmony_ci __le16 word3; 15088c2ecf20Sopenharmony_ci __le16 word4; 15098c2ecf20Sopenharmony_ci __le32 reg1; 15108c2ecf20Sopenharmony_ci __le32 reg2; 15118c2ecf20Sopenharmony_ci}; 15128c2ecf20Sopenharmony_ci 15138c2ecf20Sopenharmony_ci/* iSCSI doorbell data */ 15148c2ecf20Sopenharmony_cistruct iscsi_db_data { 15158c2ecf20Sopenharmony_ci u8 params; 15168c2ecf20Sopenharmony_ci#define ISCSI_DB_DATA_DEST_MASK 0x3 15178c2ecf20Sopenharmony_ci#define ISCSI_DB_DATA_DEST_SHIFT 0 15188c2ecf20Sopenharmony_ci#define ISCSI_DB_DATA_AGG_CMD_MASK 0x3 15198c2ecf20Sopenharmony_ci#define ISCSI_DB_DATA_AGG_CMD_SHIFT 2 15208c2ecf20Sopenharmony_ci#define ISCSI_DB_DATA_BYPASS_EN_MASK 0x1 15218c2ecf20Sopenharmony_ci#define ISCSI_DB_DATA_BYPASS_EN_SHIFT 4 15228c2ecf20Sopenharmony_ci#define ISCSI_DB_DATA_RESERVED_MASK 0x1 15238c2ecf20Sopenharmony_ci#define ISCSI_DB_DATA_RESERVED_SHIFT 5 15248c2ecf20Sopenharmony_ci#define ISCSI_DB_DATA_AGG_VAL_SEL_MASK 0x3 15258c2ecf20Sopenharmony_ci#define ISCSI_DB_DATA_AGG_VAL_SEL_SHIFT 6 15268c2ecf20Sopenharmony_ci u8 agg_flags; 15278c2ecf20Sopenharmony_ci __le16 sq_prod; 15288c2ecf20Sopenharmony_ci}; 15298c2ecf20Sopenharmony_ci 15308c2ecf20Sopenharmony_ci#endif /* __ISCSI_COMMON__ */ 1531