Back to home page

OSCL-LXR

 
 

    


0001 /* 57xx_iscsi_constants.h: QLogic NetXtreme II iSCSI HSI
0002  *
0003  * Copyright (c) 2006 - 2013 Broadcom Corporation
0004  * Copyright (c) 2014, QLogic Corporation
0005  *
0006  * This program is free software; you can redistribute it and/or modify
0007  * it under the terms of the GNU General Public License as published by
0008  * the Free Software Foundation.
0009  *
0010  * Written by: Anil Veerabhadrappa (anilgv@broadcom.com)
0011  * Previously Maintained by: Eddie Wai (eddie.wai@broadcom.com)
0012  * Maintained by: QLogic-Storage-Upstream@qlogic.com
0013  */
0014 #ifndef __57XX_ISCSI_CONSTANTS_H_
0015 #define __57XX_ISCSI_CONSTANTS_H_
0016 
0017 /**
0018 * This file defines HSI constants for the iSCSI flows
0019 */
0020 
0021 /* iSCSI request op codes */
0022 #define ISCSI_OPCODE_CLEANUP_REQUEST    (7)
0023 
0024 /* iSCSI response/messages op codes */
0025 #define ISCSI_OPCODE_CLEANUP_RESPONSE       (0x27)
0026 #define ISCSI_OPCODE_NOPOUT_LOCAL_COMPLETION    (0)
0027 
0028 /* iSCSI task types */
0029 #define ISCSI_TASK_TYPE_READ    (0)
0030 #define ISCSI_TASK_TYPE_WRITE   (1)
0031 #define ISCSI_TASK_TYPE_MPATH   (2)
0032 
0033 /* initial CQ sequence numbers */
0034 #define ISCSI_INITIAL_SN    (1)
0035 
0036 /* KWQ (kernel work queue) layer codes */
0037 #define ISCSI_KWQE_LAYER_CODE   (6)
0038 
0039 /* KWQ (kernel work queue) request op codes */
0040 #define ISCSI_KWQE_OPCODE_OFFLOAD_CONN1 (0)
0041 #define ISCSI_KWQE_OPCODE_OFFLOAD_CONN2 (1)
0042 #define ISCSI_KWQE_OPCODE_UPDATE_CONN   (2)
0043 #define ISCSI_KWQE_OPCODE_DESTROY_CONN  (3)
0044 #define ISCSI_KWQE_OPCODE_INIT1         (4)
0045 #define ISCSI_KWQE_OPCODE_INIT2         (5)
0046 
0047 /* KCQ (kernel completion queue) response op codes */
0048 #define ISCSI_KCQE_OPCODE_OFFLOAD_CONN  (0x10)
0049 #define ISCSI_KCQE_OPCODE_UPDATE_CONN   (0x12)
0050 #define ISCSI_KCQE_OPCODE_DESTROY_CONN  (0x13)
0051 #define ISCSI_KCQE_OPCODE_INIT          (0x14)
0052 #define ISCSI_KCQE_OPCODE_FW_CLEAN_TASK (0x15)
0053 #define ISCSI_KCQE_OPCODE_TCP_RESET     (0x16)
0054 #define ISCSI_KCQE_OPCODE_TCP_SYN       (0x17)
0055 #define ISCSI_KCQE_OPCODE_TCP_FIN       (0X18)
0056 #define ISCSI_KCQE_OPCODE_TCP_ERROR     (0x19)
0057 #define ISCSI_KCQE_OPCODE_CQ_EVENT_NOTIFICATION (0x20)
0058 #define ISCSI_KCQE_OPCODE_ISCSI_ERROR   (0x21)
0059 
0060 /* KCQ (kernel completion queue) completion status */
0061 #define ISCSI_KCQE_COMPLETION_STATUS_SUCCESS                            (0x0)
0062 #define ISCSI_KCQE_COMPLETION_STATUS_INVALID_OPCODE                     (0x1)
0063 #define ISCSI_KCQE_COMPLETION_STATUS_CTX_ALLOC_FAILURE                  (0x2)
0064 #define ISCSI_KCQE_COMPLETION_STATUS_CTX_FREE_FAILURE                   (0x3)
0065 #define ISCSI_KCQE_COMPLETION_STATUS_NIC_ERROR                          (0x4)
0066 
0067 #define ISCSI_KCQE_COMPLETION_STATUS_HDR_DIG_ERR                        (0x5)
0068 #define ISCSI_KCQE_COMPLETION_STATUS_DATA_DIG_ERR                       (0x6)
0069 
0070 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_UNEXPECTED_OPCODE     (0xa)
0071 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_OPCODE                (0xb)
0072 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_AHS_LEN               (0xc)
0073 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_ITT                   (0xd)
0074 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_STATSN                (0xe)
0075 
0076 /* Response */
0077 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_EXP_DATASN            (0xf)
0078 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_PEND_R2T              (0x10)
0079 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_DATA_SEG_LEN_IS_ZERO  (0x2c)
0080 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_DATA_SEG_LEN_TOO_BIG  (0x2d)
0081 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_O_U_0                 (0x11)
0082 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_O_U_1                 (0x12)
0083 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_O_U_2                 (0x13)
0084 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_O_U_3                 (0x14)
0085 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_O_U_4                 (0x15)
0086 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_O_U_5                 (0x16)
0087 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_O_U_6                 (0x17)
0088 
0089 /* Data-In */
0090 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_REMAIN_RCV_LEN        (0x18)
0091 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_MAX_RCV_PDU_LEN       (0x19)
0092 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_F_BIT_ZERO            (0x1a)
0093 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_TTT_NOT_RSRV          (0x1b)
0094 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_DATASN                (0x1c)
0095 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_REMAIN_BURST_LEN      (0x1d)
0096 
0097 /* R2T */
0098 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_BUFFER_OFF            (0x1f)
0099 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_LUN                   (0x20)
0100 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_R2TSN                 (0x21)
0101 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_DESIRED_DATA_TRNS_LEN_0 (0x22)
0102 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_DESIRED_DATA_TRNS_LEN_1 (0x23)
0103 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_PEND_R2T_EXCEED       (0x24)
0104 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_TTT_IS_RSRV           (0x25)
0105 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_MAX_BURST_LEN         (0x26)
0106 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_DATA_SEG_LEN_NOT_ZERO (0x27)
0107 
0108 /* TMF */
0109 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_REJECT_PDU_LEN        (0x28)
0110 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_ASYNC_PDU_LEN         (0x29)
0111 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_NOPIN_PDU_LEN         (0x2a)
0112 #define ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_PEND_R2T_IN_CLEANUP   (0x2b)
0113 
0114 /* IP/TCP processing errors: */
0115 #define ISCI_KCQE_COMPLETION_STATUS_TCP_ERROR_IP_FRAGMENT               (0x40)
0116 #define ISCI_KCQE_COMPLETION_STATUS_TCP_ERROR_IP_OPTIONS                (0x41)
0117 #define ISCI_KCQE_COMPLETION_STATUS_TCP_ERROR_URGENT_FLAG               (0x42)
0118 #define ISCI_KCQE_COMPLETION_STATUS_TCP_ERROR_MAX_RTRANS                (0x43)
0119 
0120 /* iSCSI licensing errors */
0121 /* general iSCSI license not installed */
0122 #define ISCSI_KCQE_COMPLETION_STATUS_ISCSI_NOT_SUPPORTED                (0x50)
0123 /* additional LOM specific iSCSI license not installed */
0124 #define ISCSI_KCQE_COMPLETION_STATUS_LOM_ISCSI_NOT_ENABLED              (0x51)
0125 
0126 #define ISCSI_KCQE_COMPLETION_STATUS_CID_BUSY               (0x80)
0127 #define ISCSI_KCQE_COMPLETION_STATUS_PARITY_ERR                         (0x81)
0128 
0129 /* SQ/RQ/CQ DB structure sizes */
0130 #define ISCSI_SQ_DB_SIZE    (16)
0131 #define ISCSI_RQ_DB_SIZE    (64)
0132 #define ISCSI_CQ_DB_SIZE    (80)
0133 
0134 #define ISCSI_SQN_TO_NOTIFY_NOT_VALID                                   0xFFFF
0135 
0136 /* Page size codes (for flags field in connection offload request) */
0137 #define ISCSI_PAGE_SIZE_256     (0)
0138 #define ISCSI_PAGE_SIZE_512     (1)
0139 #define ISCSI_PAGE_SIZE_1K      (2)
0140 #define ISCSI_PAGE_SIZE_2K      (3)
0141 #define ISCSI_PAGE_SIZE_4K      (4)
0142 #define ISCSI_PAGE_SIZE_8K      (5)
0143 #define ISCSI_PAGE_SIZE_16K     (6)
0144 #define ISCSI_PAGE_SIZE_32K     (7)
0145 #define ISCSI_PAGE_SIZE_64K     (8)
0146 #define ISCSI_PAGE_SIZE_128K    (9)
0147 #define ISCSI_PAGE_SIZE_256K    (10)
0148 #define ISCSI_PAGE_SIZE_512K    (11)
0149 #define ISCSI_PAGE_SIZE_1M      (12)
0150 #define ISCSI_PAGE_SIZE_2M      (13)
0151 #define ISCSI_PAGE_SIZE_4M      (14)
0152 #define ISCSI_PAGE_SIZE_8M      (15)
0153 
0154 /* Iscsi PDU related defines */
0155 #define ISCSI_HEADER_SIZE   (48)
0156 #define ISCSI_DIGEST_SHIFT  (2)
0157 #define ISCSI_DIGEST_SIZE   (4)
0158 
0159 #define B577XX_ISCSI_CONNECTION_TYPE    3
0160 
0161 #endif /*__57XX_ISCSI_CONSTANTS_H_ */