Files
@ d0a14f973771
Branch filter:
Location: vmkdrivers/vmkdrivers/src_9/drivers/net/bnx2/57xx_iscsi_constants.h
d0a14f973771
8.7 KiB
text/x-chdr
ESXi-5.0-U1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | #ifndef __57XX_ISCSI_CONSTANTS_H_
#define __57XX_ISCSI_CONSTANTS_H_
/**
* This file defines HSI constants for the iSCSI flows
*/
/* iSCSI request op codes */
#define ISCSI_OPCODE_NOP_OUT (0 | 0x40)
#define ISCSI_OPCODE_SCSI_CMD (1)
#define ISCSI_OPCODE_TMF_REQUEST (2 | 0x40)
#define ISCSI_OPCODE_LOGIN_REQUEST (3 | 0x40)
#define ISCSI_OPCODE_TEXT_REQUEST (4 | 0x40)
#define ISCSI_OPCODE_DATA_OUT (5)
#define ISCSI_OPCODE_LOGOUT_REQUEST (6 | 0x00)
#define ISCSI_OPCODE_CLEANUP_REQUEST (7)
/* iSCSI response/messages op codes */
#define ISCSI_OPCODE_NOP_IN (0x20)
#define ISCSI_OPCODE_SCSI_RESPONSE (0x21)
#define ISCSI_OPCODE_TMF_RESPONSE (0x22)
#define ISCSI_OPCODE_LOGIN_RESPONSE (0x23)
#define ISCSI_OPCODE_TEXT_RESPONSE (0x24)
#define ISCSI_OPCODE_DATA_IN (0x25)
#define ISCSI_OPCODE_LOGOUT_RESPONSE (0x26)
#define ISCSI_OPCODE_CLEANUP_RESPONSE (0x27)
#define ISCSI_OPCODE_R2T (0x31)
#define ISCSI_OPCODE_ASYNC_MSG (0x32)
#define ISCSI_OPCODE_REJECT (0x3f)
#define ISCSI_OPCODE_NOPOUT_LOCAL_COMPLETION (0)
/* iSCSI stages */
#define ISCSI_STAGE_SECURITY_NEGOTIATION (0)
#define ISCSI_STAGE_LOGIN_OPERATIONAL_NEGOTIATION (1)
#define ISCSI_STAGE_FULL_FEATURE_PHASE (3)
/* iSCSI parameter defaults */
#define ISCSI_DEFAULT_HEADER_DIGEST (0)
#define ISCSI_DEFAULT_DATA_DIGEST (0)
#define ISCSI_DEFAULT_INITIAL_R2T (1)
#define ISCSI_DEFAULT_IMMEDIATE_DATA (1)
#define ISCSI_DEFAULT_MAX_PDU_LENGTH (0x2000)
#define ISCSI_DEFAULT_FIRST_BURST_LENGTH (0x10000)
#define ISCSI_DEFAULT_MAX_BURST_LENGTH (0x40000)
#define ISCSI_DEFAULT_MAX_OUTSTANDING_R2T (1)
/* iSCSI parameter limits */
#define ISCSI_MIN_VAL_MAX_PDU_LENGTH (0x200)
#define ISCSI_MAX_VAL_MAX_PDU_LENGTH (0xffffff)
#define ISCSI_MIN_VAL_BURST_LENGTH (0x200)
#define ISCSI_MAX_VAL_BURST_LENGTH (0xffffff)
#define ISCSI_MIN_VAL_MAX_OUTSTANDING_R2T (1)
#define ISCSI_MAX_VAL_MAX_OUTSTANDING_R2T (0xff) /* 0x10000 according to RFC */
/* SCSI command response codes */
#define ISCSI_SCSI_CMD_RESPONSE_CMD_COMPLETED (0x00)
#define ISCSI_SCSI_CMD_RESPONSE_TARGET_FAILURE (0x01)
/* SCSI command status codes */
#define ISCSI_SCSI_CMD_STATUS_GOOD (0x00)
#define ISCSI_SCSI_CMD_STATUS_CHECK_CONDITION (0x02)
#define ISCSI_SCSI_CMD_STATUS_INTERMIDIATE (0x10)
/* TMF codes */
#define ISCSI_TMF_ABORT_TASK (1)
#define ISCSI_TMF_LOGICAL_UNIT_RESET (5)
/* TMF response codes */
#define ISCSI_TMF_RESPONSE_FUNCTION_COMPLETE (0x00)
#define ISCSI_TMF_RESPONSE_TASK_DOESNT_EXIST (0x01)
#define ISCSI_TMF_RESPONSE_LUN_DOESNT_EXIST (0x02)
#define ISCSI_TMF_RESPONSE_TASK_STILL_ALLEGIANT (0x03)
#define ISCSI_TMF_RESPONSE_FUNCTION_NOT_SUPPORTED (0x05)
#define ISCSI_TMF_RESPONSE_FUNCTION_AUTHORIZATION_FAILED (0x06)
#define ISCSI_TMF_RESPONSE_FUNCTION_REJECTED (0xff)
/* Logout reason codes */
/*#define ISCSI_LOGOUT_REASON_CLOSE_CONNECTION (1) */
/* Logout response codes */
#define ISCSI_LOGOUT_RESPONSE_CONNECTION_CLOSED (0)
#define ISCSI_LOGOUT_RESPONSE_CID_NOT_FOUND (1)
#define ISCSI_LOGOUT_RESPONSE_CLEANUP_FAILED (3)
/* iSCSI task types */
#define ISCSI_TASK_TYPE_READ (0)
#define ISCSI_TASK_TYPE_WRITE (1)
#define ISCSI_TASK_TYPE_MPATH (2)
/* initial CQ sequence numbers */
#define ISCSI_INITIAL_SN (1)
/* KWQ (kernel work queue) layer codes */
#define ISCSI_KWQE_LAYER_CODE (6)
/* KWQ (kernel work queue) request op codes */
#define ISCSI_KWQE_OPCODE_OFFLOAD_CONN1 (0)
#define ISCSI_KWQE_OPCODE_OFFLOAD_CONN2 (1)
#define ISCSI_KWQE_OPCODE_UPDATE_CONN (2)
#define ISCSI_KWQE_OPCODE_DESTROY_CONN (3)
#define ISCSI_KWQE_OPCODE_INIT1 (4)
#define ISCSI_KWQE_OPCODE_INIT2 (5)
/* KCQ (kernel completion queue) response op codes */
#define ISCSI_KCQE_OPCODE_OFFLOAD_CONN (0x10)
#define ISCSI_KCQE_OPCODE_UPDATE_CONN (0x12)
#define ISCSI_KCQE_OPCODE_DESTROY_CONN (0x13)
#define ISCSI_KCQE_OPCODE_INIT (0x14)
#define ISCSI_KCQE_OPCODE_CLEAN_TASK (0x15)
#define ISCSI_KCQE_OPCODE_TCP_RESET (0x16)
#define ISCSI_KCQE_OPCODE_TCP_SYN (0x17)
#define ISCSI_KCQE_OPCODE_TCP_FIN (0X18)
#define ISCSI_KCQE_OPCODE_TCP_ERROR (0x19)
#define ISCSI_KCQE_OPCODE_CQ_EVENT_NOTIFICATION (0x20)
#define ISCSI_KCQE_OPCODE_ISCSI_ERROR (0x21)
/* KCQ (kernel completion queue) completion status */
#define ISCSI_KCQE_COMPLETION_STATUS_SUCCESS (0)
#define ISCSI_KCQE_COMPLETION_STATUS_INVALID_OPCODE (1)
#define ISCSI_KCQE_COMPLETION_STATUS_CTX_ALLOC_FAILURE (2)
#define ISCSI_KCQE_COMPLETION_STATUS_CTX_FREE_FAILURE (3)
#define ISCSI_KCQE_COMPLETION_STATUS_NIC_ERROR (4)
#define ISCSI_KCQE_COMPLETION_STATUS_HDR_DIG_ERR (0x5)
#define ISCSI_KCQE_COMPLETION_STATUS_DATA_DIG_ERR (0x6)
/*#define ISCSI_KCQE_COMPLETION_STATUS_DATA_DIG_ERR_DATA_IN (0x6) */
/*#define ISCSI_KCQE_COMPLETION_STATUS_DATA_DIG_ERR_RESPONSE (0x7) */
/*#define ISCSI_KCQE_COMPLETION_STATUS_DATA_DIG_ERR_REJECT (0x8) */
/*#define ISCSI_KCQE_COMPLETION_STATUS_DATA_DIG_ERR_ASYNC (0x9) */
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_UNEXPECTED_OPCODE (0xa)
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_OPCODE (0xb)
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_AHS_LEN (0xc)
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_ITT (0xd)
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_STATSN (0xe)
/* Response */
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_EXP_DATASN (0xf)
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_PEND_R2T (0x10)
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_DATA_SEG_LEN_IS_ZERO (0x2c)
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_DATA_SEG_LEN_TOO_BIG (0x2d)
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_O_U_0 (0x11)
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_O_U_1 (0x12)
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_O_U_2 (0x13)
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_O_U_3 (0x14)
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_O_U_4 (0x15)
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_O_U_5 (0x16)
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_O_U_6 (0x17)
/* Data-In */
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_REMAIN_RCV_LEN (0x18)
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_MAX_RCV_PDU_LEN (0x19)
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_F_BIT_ZERO (0x1a)
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_TTT_NOT_RSRV (0x1b)
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_DATASN (0x1c)
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_REMAIN_BURST_LEN (0x1d)
/* R2T */
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_BUFFER_OFF (0x1f)
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_LUN (0x20)
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_R2TSN (0x21)
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_DESIRED_DATA_TRNS_LEN_0 (0x22)
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_DESIRED_DATA_TRNS_LEN_1 (0x23)
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_PEND_R2T_EXCEED (0x24)
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_TTT_IS_RSRV (0x25)
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_MAX_BURST_LEN (0x26)
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_DATA_SEG_LEN_NOT_ZERO (0x27)
/* TMF */
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_REJECT_PDU_LEN (0x28)
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_ASYNC_PDU_LEN (0x29)
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_NOPIN_PDU_LEN (0x2a)
#define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_PEND_R2T_IN_CLEANUP (0x2b)
/* IP/TCP processing errors: */
#define ISCI_KCQE_COMPLETION_STATUS_TCP_ERROR_IP_FRAGMENT (0x40)
#define ISCI_KCQE_COMPLETION_STATUS_TCP_ERROR_IP_OPTIONS (0x41)
#define ISCI_KCQE_COMPLETION_STATUS_TCP_ERROR_URGENT_FLAG (0x42)
#define ISCI_KCQE_COMPLETION_STATUS_TCP_ERROR_MAX_RTRANS (0x43)
/* iSCSI licensing errors */
/* general iSCSI license not installed */
#define ISCSI_KCQE_COMPLETION_STATUS_ISCSI_NOT_SUPPORTED (0x50)
/* additional LOM specific iSCSI license not installed */
#define ISCSI_KCQE_COMPLETION_STATUS_LOM_ISCSI_NOT_ENABLED (0x51)
#define ISCSI_KCQE_COMPLETION_STATUS_CID_BUSY (0x80)
/* SQ/RQ/CQ DB structure sizes */
#define ISCSI_SQ_DB_SIZE (16)
#define ISCSI_RQ_DB_SIZE (16)
#define ISCSI_CQ_DB_SIZE (80)
/* Page size codes (for l5_wqe_flags in connection offload request) */
#define ISCSI_PAGE_SIZE_256 (0)
#define ISCSI_PAGE_SIZE_512 (1)
#define ISCSI_PAGE_SIZE_1K (2)
#define ISCSI_PAGE_SIZE_2K (3)
#define ISCSI_PAGE_SIZE_4K (4)
#define ISCSI_PAGE_SIZE_8K (5)
#define ISCSI_PAGE_SIZE_16K (6)
#define ISCSI_PAGE_SIZE_32K (7)
#define ISCSI_PAGE_SIZE_64K (8)
#define ISCSI_PAGE_SIZE_128K (9)
#define ISCSI_PAGE_SIZE_256K (10)
#define ISCSI_PAGE_SIZE_512K (11)
#define ISCSI_PAGE_SIZE_1M (12)
#define ISCSI_PAGE_SIZE_2M (13)
#define ISCSI_PAGE_SIZE_4M (14)
#define ISCSI_PAGE_SIZE_8M (15)
/* Iscsi PDU related defines */
#define ISCSI_HEADER_SIZE (48)
#define ISCSI_DIGEST_SHIFT (2)
#define ISCSI_DIGEST_SIZE (4)
#endif /*__57XX_ISCSI_CONSTANTS_H_ */
|