1*14b24e2bSVaishali Kulkarni /*
2*14b24e2bSVaishali Kulkarni * CDDL HEADER START
3*14b24e2bSVaishali Kulkarni *
4*14b24e2bSVaishali Kulkarni * The contents of this file are subject to the terms of the
5*14b24e2bSVaishali Kulkarni * Common Development and Distribution License, v.1,  (the "License").
6*14b24e2bSVaishali Kulkarni * You may not use this file except in compliance with the License.
7*14b24e2bSVaishali Kulkarni *
8*14b24e2bSVaishali Kulkarni * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*14b24e2bSVaishali Kulkarni * or http://opensource.org/licenses/CDDL-1.0.
10*14b24e2bSVaishali Kulkarni * See the License for the specific language governing permissions
11*14b24e2bSVaishali Kulkarni * and limitations under the License.
12*14b24e2bSVaishali Kulkarni *
13*14b24e2bSVaishali Kulkarni * When distributing Covered Code, include this CDDL HEADER in each
14*14b24e2bSVaishali Kulkarni * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*14b24e2bSVaishali Kulkarni * If applicable, add the following below this CDDL HEADER, with the
16*14b24e2bSVaishali Kulkarni * fields enclosed by brackets "[]" replaced with your own identifying
17*14b24e2bSVaishali Kulkarni * information: Portions Copyright [yyyy] [name of copyright owner]
18*14b24e2bSVaishali Kulkarni *
19*14b24e2bSVaishali Kulkarni * CDDL HEADER END
20*14b24e2bSVaishali Kulkarni */
21*14b24e2bSVaishali Kulkarni 
22*14b24e2bSVaishali Kulkarni /*
23*14b24e2bSVaishali Kulkarni * Copyright 2014-2017 Cavium, Inc.
24*14b24e2bSVaishali Kulkarni * The contents of this file are subject to the terms of the Common Development
25*14b24e2bSVaishali Kulkarni * and Distribution License, v.1,  (the "License").
26*14b24e2bSVaishali Kulkarni 
27*14b24e2bSVaishali Kulkarni * You may not use this file except in compliance with the License.
28*14b24e2bSVaishali Kulkarni 
29*14b24e2bSVaishali Kulkarni * You can obtain a copy of the License at available
30*14b24e2bSVaishali Kulkarni * at http://opensource.org/licenses/CDDL-1.0
31*14b24e2bSVaishali Kulkarni 
32*14b24e2bSVaishali Kulkarni * See the License for the specific language governing permissions and
33*14b24e2bSVaishali Kulkarni * limitations under the License.
34*14b24e2bSVaishali Kulkarni */
35*14b24e2bSVaishali Kulkarni 
36*14b24e2bSVaishali Kulkarni #ifndef __ISCSI_COMMON__
37*14b24e2bSVaishali Kulkarni #define __ISCSI_COMMON__
38*14b24e2bSVaishali Kulkarni /**********************/
39*14b24e2bSVaishali Kulkarni /* ISCSI FW CONSTANTS */
40*14b24e2bSVaishali Kulkarni /**********************/
41*14b24e2bSVaishali Kulkarni 
42*14b24e2bSVaishali Kulkarni /* iSCSI HSI constants */
43*14b24e2bSVaishali Kulkarni #define ISCSI_DEFAULT_MTU	(1500)
44*14b24e2bSVaishali Kulkarni 
45*14b24e2bSVaishali Kulkarni /* KWQ (kernel work queue) layer codes */
46*14b24e2bSVaishali Kulkarni #define ISCSI_SLOW_PATH_LAYER_CODE   (6)
47*14b24e2bSVaishali Kulkarni 
48*14b24e2bSVaishali Kulkarni /* iSCSI parameter defaults */
49*14b24e2bSVaishali Kulkarni #define ISCSI_DEFAULT_HEADER_DIGEST         (0)
50*14b24e2bSVaishali Kulkarni #define ISCSI_DEFAULT_DATA_DIGEST           (0)
51*14b24e2bSVaishali Kulkarni #define ISCSI_DEFAULT_INITIAL_R2T           (1)
52*14b24e2bSVaishali Kulkarni #define ISCSI_DEFAULT_IMMEDIATE_DATA        (1)
53*14b24e2bSVaishali Kulkarni #define ISCSI_DEFAULT_MAX_PDU_LENGTH        (0x2000)
54*14b24e2bSVaishali Kulkarni #define ISCSI_DEFAULT_FIRST_BURST_LENGTH    (0x10000)
55*14b24e2bSVaishali Kulkarni #define ISCSI_DEFAULT_MAX_BURST_LENGTH      (0x40000)
56*14b24e2bSVaishali Kulkarni #define ISCSI_DEFAULT_MAX_OUTSTANDING_R2T   (1)
57*14b24e2bSVaishali Kulkarni 
58*14b24e2bSVaishali Kulkarni /* iSCSI parameter limits */
59*14b24e2bSVaishali Kulkarni #define ISCSI_MIN_VAL_MAX_PDU_LENGTH        (0x200)
60*14b24e2bSVaishali Kulkarni #define ISCSI_MAX_VAL_MAX_PDU_LENGTH        (0xffffff)
61*14b24e2bSVaishali Kulkarni #define ISCSI_MIN_VAL_BURST_LENGTH          (0x200)
62*14b24e2bSVaishali Kulkarni #define ISCSI_MAX_VAL_BURST_LENGTH          (0xffffff)
63*14b24e2bSVaishali Kulkarni #define ISCSI_MIN_VAL_MAX_OUTSTANDING_R2T   (1)
64*14b24e2bSVaishali Kulkarni #define ISCSI_MAX_VAL_MAX_OUTSTANDING_R2T   (0xff) // 0x10000 according to RFC
65*14b24e2bSVaishali Kulkarni 
66*14b24e2bSVaishali Kulkarni #define ISCSI_AHS_CNTL_SIZE 4
67*14b24e2bSVaishali Kulkarni 
68*14b24e2bSVaishali Kulkarni #define ISCSI_WQE_NUM_SGES_SLOWIO           (0xf)
69*14b24e2bSVaishali Kulkarni 
70*14b24e2bSVaishali Kulkarni /* iSCSI reserved params */
71*14b24e2bSVaishali Kulkarni #define ISCSI_ITT_ALL_ONES					(0xffffffff)
72*14b24e2bSVaishali Kulkarni #define ISCSI_TTT_ALL_ONES					(0xffffffff)
73*14b24e2bSVaishali Kulkarni 
74*14b24e2bSVaishali Kulkarni #define ISCSI_OPTION_1_OFF_CHIP_TCP 1
75*14b24e2bSVaishali Kulkarni #define ISCSI_OPTION_2_ON_CHIP_TCP 2
76*14b24e2bSVaishali Kulkarni 
77*14b24e2bSVaishali Kulkarni #define ISCSI_INITIATOR_MODE 0
78*14b24e2bSVaishali Kulkarni #define ISCSI_TARGET_MODE 1
79*14b24e2bSVaishali Kulkarni 
80*14b24e2bSVaishali Kulkarni 
81*14b24e2bSVaishali Kulkarni /* iSCSI request op codes */
82*14b24e2bSVaishali Kulkarni #define ISCSI_OPCODE_NOP_OUT				(0)
83*14b24e2bSVaishali Kulkarni #define ISCSI_OPCODE_SCSI_CMD       		(1)
84*14b24e2bSVaishali Kulkarni #define ISCSI_OPCODE_TMF_REQUEST			(2)
85*14b24e2bSVaishali Kulkarni #define ISCSI_OPCODE_LOGIN_REQUEST			(3)
86*14b24e2bSVaishali Kulkarni #define ISCSI_OPCODE_TEXT_REQUEST       	(4)
87*14b24e2bSVaishali Kulkarni #define ISCSI_OPCODE_DATA_OUT				(5)
88*14b24e2bSVaishali Kulkarni #define ISCSI_OPCODE_LOGOUT_REQUEST     	(6)
89*14b24e2bSVaishali Kulkarni 
90*14b24e2bSVaishali Kulkarni /* iSCSI response/messages op codes */
91*14b24e2bSVaishali Kulkarni #define ISCSI_OPCODE_NOP_IN             (0x20)
92*14b24e2bSVaishali Kulkarni #define ISCSI_OPCODE_SCSI_RESPONSE      (0x21)
93*14b24e2bSVaishali Kulkarni #define ISCSI_OPCODE_TMF_RESPONSE       (0x22)
94*14b24e2bSVaishali Kulkarni #define ISCSI_OPCODE_LOGIN_RESPONSE     (0x23)
95*14b24e2bSVaishali Kulkarni #define ISCSI_OPCODE_TEXT_RESPONSE      (0x24)
96*14b24e2bSVaishali Kulkarni #define ISCSI_OPCODE_DATA_IN            (0x25)
97*14b24e2bSVaishali Kulkarni #define ISCSI_OPCODE_LOGOUT_RESPONSE    (0x26)
98*14b24e2bSVaishali Kulkarni #define ISCSI_OPCODE_R2T                (0x31)
99*14b24e2bSVaishali Kulkarni #define ISCSI_OPCODE_ASYNC_MSG          (0x32)
100*14b24e2bSVaishali Kulkarni #define ISCSI_OPCODE_REJECT             (0x3f)
101*14b24e2bSVaishali Kulkarni 
102*14b24e2bSVaishali Kulkarni /* iSCSI stages */
103*14b24e2bSVaishali Kulkarni #define ISCSI_STAGE_SECURITY_NEGOTIATION            (0)
104*14b24e2bSVaishali Kulkarni #define ISCSI_STAGE_LOGIN_OPERATIONAL_NEGOTIATION   (1)
105*14b24e2bSVaishali Kulkarni #define ISCSI_STAGE_FULL_FEATURE_PHASE              (3)
106*14b24e2bSVaishali Kulkarni 
107*14b24e2bSVaishali Kulkarni /* iSCSI CQE errors */
108*14b24e2bSVaishali Kulkarni #define CQE_ERROR_BITMAP_DATA_DIGEST          (0x08)
109*14b24e2bSVaishali Kulkarni #define CQE_ERROR_BITMAP_RCV_ON_INVALID_CONN  (0x10)
110*14b24e2bSVaishali Kulkarni #define CQE_ERROR_BITMAP_DATA_TRUNCATED       (0x20)
111*14b24e2bSVaishali Kulkarni 
112*14b24e2bSVaishali Kulkarni 
113*14b24e2bSVaishali Kulkarni /*
114*14b24e2bSVaishali Kulkarni  * ISCSI SGL entry
115*14b24e2bSVaishali Kulkarni  */
116*14b24e2bSVaishali Kulkarni struct cqe_error_bitmap
117*14b24e2bSVaishali Kulkarni {
118*14b24e2bSVaishali Kulkarni 	u8 cqe_error_status_bits;
119*14b24e2bSVaishali Kulkarni #define CQE_ERROR_BITMAP_DIF_ERR_BITS_MASK         0x7 /* Mark task with DIF error (3 bit): [0]-CRC/checksum, [1]-app tag, [2]-reference tag */
120*14b24e2bSVaishali Kulkarni #define CQE_ERROR_BITMAP_DIF_ERR_BITS_SHIFT        0
121*14b24e2bSVaishali Kulkarni #define CQE_ERROR_BITMAP_DATA_DIGEST_ERR_MASK      0x1 /* Mark task with data digest error (1 bit) */
122*14b24e2bSVaishali Kulkarni #define CQE_ERROR_BITMAP_DATA_DIGEST_ERR_SHIFT     3
123*14b24e2bSVaishali Kulkarni #define CQE_ERROR_BITMAP_RCV_ON_INVALID_CONN_MASK  0x1 /* Mark receive on invalid connection */
124*14b24e2bSVaishali Kulkarni #define CQE_ERROR_BITMAP_RCV_ON_INVALID_CONN_SHIFT 4
125*14b24e2bSVaishali Kulkarni #define CQE_ERROR_BITMAP_DATA_TRUNCATED_ERR_MASK   0x1 /* Target Mode - Mark middle task error, data truncated */
126*14b24e2bSVaishali Kulkarni #define CQE_ERROR_BITMAP_DATA_TRUNCATED_ERR_SHIFT  5
127*14b24e2bSVaishali Kulkarni #define CQE_ERROR_BITMAP_UNDER_RUN_ERR_MASK        0x1
128*14b24e2bSVaishali Kulkarni #define CQE_ERROR_BITMAP_UNDER_RUN_ERR_SHIFT       6
129*14b24e2bSVaishali Kulkarni #define CQE_ERROR_BITMAP_RESERVED2_MASK            0x1
130*14b24e2bSVaishali Kulkarni #define CQE_ERROR_BITMAP_RESERVED2_SHIFT           7
131*14b24e2bSVaishali Kulkarni };
132*14b24e2bSVaishali Kulkarni 
133*14b24e2bSVaishali Kulkarni 
134*14b24e2bSVaishali Kulkarni union cqe_error_status
135*14b24e2bSVaishali Kulkarni {
136*14b24e2bSVaishali Kulkarni 	u8 error_status /* all error bits as uint8 */;
137*14b24e2bSVaishali Kulkarni 	struct cqe_error_bitmap error_bits /* cqe errors bitmap */;
138*14b24e2bSVaishali Kulkarni };
139*14b24e2bSVaishali Kulkarni 
140*14b24e2bSVaishali Kulkarni 
141*14b24e2bSVaishali Kulkarni /*
142*14b24e2bSVaishali Kulkarni  * iSCSI Login Response PDU header
143*14b24e2bSVaishali Kulkarni  */
144*14b24e2bSVaishali Kulkarni struct data_hdr
145*14b24e2bSVaishali Kulkarni {
146*14b24e2bSVaishali Kulkarni 	__le32 data[12] /* iscsi header data */;
147*14b24e2bSVaishali Kulkarni };
148*14b24e2bSVaishali Kulkarni 
149*14b24e2bSVaishali Kulkarni 
150*14b24e2bSVaishali Kulkarni /*
151*14b24e2bSVaishali Kulkarni  * iSCSI Asynchronous Message PDU header
152*14b24e2bSVaishali Kulkarni  */
153*14b24e2bSVaishali Kulkarni struct iscsi_async_msg_hdr
154*14b24e2bSVaishali Kulkarni {
155*14b24e2bSVaishali Kulkarni 	__le16 reserved0 /* reserved */;
156*14b24e2bSVaishali Kulkarni 	u8 flags_attr;
157*14b24e2bSVaishali Kulkarni #define ISCSI_ASYNC_MSG_HDR_RSRV_MASK           0x7F /* reserved */
158*14b24e2bSVaishali Kulkarni #define ISCSI_ASYNC_MSG_HDR_RSRV_SHIFT          0
159*14b24e2bSVaishali Kulkarni #define ISCSI_ASYNC_MSG_HDR_CONST1_MASK         0x1 /* const1 */
160*14b24e2bSVaishali Kulkarni #define ISCSI_ASYNC_MSG_HDR_CONST1_SHIFT        7
161*14b24e2bSVaishali Kulkarni 	u8 opcode /* opcode */;
162*14b24e2bSVaishali Kulkarni 	__le32 hdr_second_dword;
163*14b24e2bSVaishali Kulkarni #define ISCSI_ASYNC_MSG_HDR_DATA_SEG_LEN_MASK   0xFFFFFF /* DataSegmentLength */
164*14b24e2bSVaishali Kulkarni #define ISCSI_ASYNC_MSG_HDR_DATA_SEG_LEN_SHIFT  0
165*14b24e2bSVaishali Kulkarni #define ISCSI_ASYNC_MSG_HDR_TOTAL_AHS_LEN_MASK  0xFF /* TotalAHSLength */
166*14b24e2bSVaishali Kulkarni #define ISCSI_ASYNC_MSG_HDR_TOTAL_AHS_LEN_SHIFT 24
167*14b24e2bSVaishali Kulkarni 	struct regpair lun /* Logical Unit Number */;
168*14b24e2bSVaishali Kulkarni 	__le32 all_ones /* should be 0xffffffff */;
169*14b24e2bSVaishali Kulkarni 	__le32 reserved1 /* reserved */;
170*14b24e2bSVaishali Kulkarni 	__le32 stat_sn /* stat_sn */;
171*14b24e2bSVaishali Kulkarni 	__le32 exp_cmd_sn /* exp_cmd_sn */;
172*14b24e2bSVaishali Kulkarni 	__le32 max_cmd_sn /* max_cmd_sn */;
173*14b24e2bSVaishali Kulkarni 	__le16 param1_rsrv /* Parameter1 or Reserved */;
174*14b24e2bSVaishali Kulkarni 	u8 async_vcode /* AsuncVCode */;
175*14b24e2bSVaishali Kulkarni 	u8 async_event /* AsyncEvent */;
176*14b24e2bSVaishali Kulkarni 	__le16 param3_rsrv /* Parameter3 or Reserved */;
177*14b24e2bSVaishali Kulkarni 	__le16 param2_rsrv /* Parameter2 or Reserved */;
178*14b24e2bSVaishali Kulkarni 	__le32 reserved7 /* reserved */;
179*14b24e2bSVaishali Kulkarni };
180*14b24e2bSVaishali Kulkarni 
181*14b24e2bSVaishali Kulkarni 
182*14b24e2bSVaishali Kulkarni /*
183*14b24e2bSVaishali Kulkarni  * iSCSI Command PDU header
184*14b24e2bSVaishali Kulkarni  */
185*14b24e2bSVaishali Kulkarni struct iscsi_cmd_hdr
186*14b24e2bSVaishali Kulkarni {
187*14b24e2bSVaishali Kulkarni 	__le16 reserved1 /* reserved */;
188*14b24e2bSVaishali Kulkarni 	u8 flags_attr;
189*14b24e2bSVaishali Kulkarni #define ISCSI_CMD_HDR_ATTR_MASK           0x7 /* attributes */
190*14b24e2bSVaishali Kulkarni #define ISCSI_CMD_HDR_ATTR_SHIFT          0
191*14b24e2bSVaishali Kulkarni #define ISCSI_CMD_HDR_RSRV_MASK           0x3 /* reserved */
192*14b24e2bSVaishali Kulkarni #define ISCSI_CMD_HDR_RSRV_SHIFT          3
193*14b24e2bSVaishali Kulkarni #define ISCSI_CMD_HDR_WRITE_MASK          0x1 /* write */
194*14b24e2bSVaishali Kulkarni #define ISCSI_CMD_HDR_WRITE_SHIFT         5
195*14b24e2bSVaishali Kulkarni #define ISCSI_CMD_HDR_READ_MASK           0x1 /* read */
196*14b24e2bSVaishali Kulkarni #define ISCSI_CMD_HDR_READ_SHIFT          6
197*14b24e2bSVaishali Kulkarni #define ISCSI_CMD_HDR_FINAL_MASK          0x1 /* final */
198*14b24e2bSVaishali Kulkarni #define ISCSI_CMD_HDR_FINAL_SHIFT         7
199*14b24e2bSVaishali Kulkarni 	u8 hdr_first_byte;
200*14b24e2bSVaishali Kulkarni #define ISCSI_CMD_HDR_OPCODE_MASK         0x3F /* Opcode */
201*14b24e2bSVaishali Kulkarni #define ISCSI_CMD_HDR_OPCODE_SHIFT        0
202*14b24e2bSVaishali Kulkarni #define ISCSI_CMD_HDR_IMM_MASK            0x1 /* Immediate delivery */
203*14b24e2bSVaishali Kulkarni #define ISCSI_CMD_HDR_IMM_SHIFT           6
204*14b24e2bSVaishali Kulkarni #define ISCSI_CMD_HDR_RSRV1_MASK          0x1 /* first bit of iSCSI PDU header */
205*14b24e2bSVaishali Kulkarni #define ISCSI_CMD_HDR_RSRV1_SHIFT         7
206*14b24e2bSVaishali Kulkarni 	__le32 hdr_second_dword;
207*14b24e2bSVaishali Kulkarni #define ISCSI_CMD_HDR_DATA_SEG_LEN_MASK   0xFFFFFF /* DataSegmentLength */
208*14b24e2bSVaishali Kulkarni #define ISCSI_CMD_HDR_DATA_SEG_LEN_SHIFT  0
209*14b24e2bSVaishali Kulkarni #define ISCSI_CMD_HDR_TOTAL_AHS_LEN_MASK  0xFF /* TotalAHSLength */
210*14b24e2bSVaishali Kulkarni #define ISCSI_CMD_HDR_TOTAL_AHS_LEN_SHIFT 24
211*14b24e2bSVaishali Kulkarni 	struct regpair lun /* Logical Unit Number. [constant, initialized] */;
212*14b24e2bSVaishali Kulkarni 	__le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */;
213*14b24e2bSVaishali Kulkarni 	__le32 expected_transfer_length /* Expected Data Transfer Length (only 3 bytes are significant) */;
214*14b24e2bSVaishali Kulkarni 	__le32 cmd_sn /* CmdSn. [constant, initialized] */;
215*14b24e2bSVaishali Kulkarni 	__le32 exp_stat_sn /* various fields for middle-path PDU. [constant, initialized] */;
216*14b24e2bSVaishali Kulkarni 	__le32 cdb[4] /* CDB. [constant, initialized] */;
217*14b24e2bSVaishali Kulkarni };
218*14b24e2bSVaishali Kulkarni 
219*14b24e2bSVaishali Kulkarni 
220*14b24e2bSVaishali Kulkarni /*
221*14b24e2bSVaishali Kulkarni  * iSCSI Common PDU header
222*14b24e2bSVaishali Kulkarni  */
223*14b24e2bSVaishali Kulkarni struct iscsi_common_hdr
224*14b24e2bSVaishali Kulkarni {
225*14b24e2bSVaishali Kulkarni 	u8 hdr_status /* Status field of ISCSI header */;
226*14b24e2bSVaishali Kulkarni 	u8 hdr_response /* Response field of ISCSI header for Responses / Reserved for Data-In */;
227*14b24e2bSVaishali Kulkarni 	u8 hdr_flags /* Flags field of ISCSI header */;
228*14b24e2bSVaishali Kulkarni 	u8 hdr_first_byte;
229*14b24e2bSVaishali Kulkarni #define ISCSI_COMMON_HDR_OPCODE_MASK         0x3F /* Opcode */
230*14b24e2bSVaishali Kulkarni #define ISCSI_COMMON_HDR_OPCODE_SHIFT        0
231*14b24e2bSVaishali Kulkarni #define ISCSI_COMMON_HDR_IMM_MASK            0x1 /* Immediate */
232*14b24e2bSVaishali Kulkarni #define ISCSI_COMMON_HDR_IMM_SHIFT           6
233*14b24e2bSVaishali Kulkarni #define ISCSI_COMMON_HDR_RSRV_MASK           0x1 /* first bit of iSCSI PDU header */
234*14b24e2bSVaishali Kulkarni #define ISCSI_COMMON_HDR_RSRV_SHIFT          7
235*14b24e2bSVaishali Kulkarni 	__le32 hdr_second_dword;
236*14b24e2bSVaishali Kulkarni #define ISCSI_COMMON_HDR_DATA_SEG_LEN_MASK   0xFFFFFF /* DataSegmentLength */
237*14b24e2bSVaishali Kulkarni #define ISCSI_COMMON_HDR_DATA_SEG_LEN_SHIFT  0
238*14b24e2bSVaishali Kulkarni #define ISCSI_COMMON_HDR_TOTAL_AHS_LEN_MASK  0xFF /* TotalAHSLength */
239*14b24e2bSVaishali Kulkarni #define ISCSI_COMMON_HDR_TOTAL_AHS_LEN_SHIFT 24
240*14b24e2bSVaishali Kulkarni 	struct regpair lun_reserved /* Bytes 8..15 : LUN (if PDU contains a LUN field) or reserved */;
241*14b24e2bSVaishali Kulkarni 	__le32 itt /* ITT - common to all headers */;
242*14b24e2bSVaishali Kulkarni 	__le32 ttt /* bytes 20 to 23 - common ttt to various PDU headers */;
243*14b24e2bSVaishali Kulkarni 	__le32 cmdstat_sn /* bytes 24 to 27 - common cmd_sn (initiator) or stat_sn (target) to various PDU headers */;
244*14b24e2bSVaishali Kulkarni 	__le32 exp_statcmd_sn /* bytes 28 to 31 - common expected stat_sn (initiator) or cmd_sn (target) to various PDU headers */;
245*14b24e2bSVaishali Kulkarni 	__le32 max_cmd_sn /* bytes 32 to 35 - common max cmd_sn to various PDU headers */;
246*14b24e2bSVaishali Kulkarni 	__le32 data[3] /* bytes 36 to 47 */;
247*14b24e2bSVaishali Kulkarni };
248*14b24e2bSVaishali Kulkarni 
249*14b24e2bSVaishali Kulkarni 
250*14b24e2bSVaishali Kulkarni /*
251*14b24e2bSVaishali Kulkarni  * ISCSI connection offload params passed by driver to FW in ISCSI offload ramrod
252*14b24e2bSVaishali Kulkarni  */
253*14b24e2bSVaishali Kulkarni struct iscsi_conn_offload_params
254*14b24e2bSVaishali Kulkarni {
255*14b24e2bSVaishali Kulkarni 	struct regpair sq_pbl_addr /* PBL SQ pointer */;
256*14b24e2bSVaishali Kulkarni 	struct regpair r2tq_pbl_addr /* PBL R2TQ pointer */;
257*14b24e2bSVaishali Kulkarni 	struct regpair xhq_pbl_addr /* PBL XHQ pointer */;
258*14b24e2bSVaishali Kulkarni 	struct regpair uhq_pbl_addr /* PBL UHQ pointer */;
259*14b24e2bSVaishali Kulkarni 	__le32 initial_ack /* Initial ack, received from TCP */;
260*14b24e2bSVaishali Kulkarni 	__le16 physical_q0 /* Physical QM queue to be tied to logical Q0 */;
261*14b24e2bSVaishali Kulkarni 	__le16 physical_q1 /* Physical QM queue to be tied to logical Q1 */;
262*14b24e2bSVaishali Kulkarni 	u8 flags;
263*14b24e2bSVaishali Kulkarni #define ISCSI_CONN_OFFLOAD_PARAMS_TCP_ON_CHIP_1B_MASK   0x1 /* TCP connect/terminate option. 0 - TCP on host (option-1); 1 - TCP on chip (option-2). */
264*14b24e2bSVaishali Kulkarni #define ISCSI_CONN_OFFLOAD_PARAMS_TCP_ON_CHIP_1B_SHIFT  0
265*14b24e2bSVaishali Kulkarni #define ISCSI_CONN_OFFLOAD_PARAMS_TARGET_MODE_MASK      0x1 /* iSCSI connect mode: 0-iSCSI Initiator, 1-iSCSI Target */
266*14b24e2bSVaishali Kulkarni #define ISCSI_CONN_OFFLOAD_PARAMS_TARGET_MODE_SHIFT     1
267*14b24e2bSVaishali Kulkarni #define ISCSI_CONN_OFFLOAD_PARAMS_RESTRICTED_MODE_MASK  0x1 /* Restricted mode: 0 - un-restricted (deviating from the RFC), 1 - restricted (according to the RFC) */
268*14b24e2bSVaishali Kulkarni #define ISCSI_CONN_OFFLOAD_PARAMS_RESTRICTED_MODE_SHIFT 2
269*14b24e2bSVaishali Kulkarni #define ISCSI_CONN_OFFLOAD_PARAMS_RESERVED1_MASK        0x1F /* reserved */
270*14b24e2bSVaishali Kulkarni #define ISCSI_CONN_OFFLOAD_PARAMS_RESERVED1_SHIFT       3
271*14b24e2bSVaishali Kulkarni 	u8 pbl_page_size_log /* Page size with PBEs log; Page Size = 2^(page_size_log+12) */;
272*14b24e2bSVaishali Kulkarni 	u8 pbe_page_size_log /* PBE page size with log; Page Size = 2^(page_size_log+12) */;
273*14b24e2bSVaishali Kulkarni 	u8 default_cq /* Default CQ used to write unsolicited data */;
274*14b24e2bSVaishali Kulkarni 	__le32 stat_sn /* StatSn for Target Mode only: the first Login Response StatSn value for Target mode */;
275*14b24e2bSVaishali Kulkarni };
276*14b24e2bSVaishali Kulkarni 
277*14b24e2bSVaishali Kulkarni 
278*14b24e2bSVaishali Kulkarni /*
279*14b24e2bSVaishali Kulkarni  * spe message header
280*14b24e2bSVaishali Kulkarni  */
281*14b24e2bSVaishali Kulkarni struct iscsi_slow_path_hdr
282*14b24e2bSVaishali Kulkarni {
283*14b24e2bSVaishali Kulkarni 	u8 op_code /* iscsi bus-drv message opcode */;
284*14b24e2bSVaishali Kulkarni 	u8 flags;
285*14b24e2bSVaishali Kulkarni #define ISCSI_SLOW_PATH_HDR_RESERVED0_MASK   0xF
286*14b24e2bSVaishali Kulkarni #define ISCSI_SLOW_PATH_HDR_RESERVED0_SHIFT  0
287*14b24e2bSVaishali Kulkarni #define ISCSI_SLOW_PATH_HDR_LAYER_CODE_MASK  0x7 /* protocol layer (L2,L3,L4,L5) */
288*14b24e2bSVaishali Kulkarni #define ISCSI_SLOW_PATH_HDR_LAYER_CODE_SHIFT 4
289*14b24e2bSVaishali Kulkarni #define ISCSI_SLOW_PATH_HDR_RESERVED1_MASK   0x1
290*14b24e2bSVaishali Kulkarni #define ISCSI_SLOW_PATH_HDR_RESERVED1_SHIFT  7
291*14b24e2bSVaishali Kulkarni };
292*14b24e2bSVaishali Kulkarni 
293*14b24e2bSVaishali Kulkarni /*
294*14b24e2bSVaishali Kulkarni  * ISCSI connection update params passed by driver to FW in ISCSI update ramrod
295*14b24e2bSVaishali Kulkarni  */
296*14b24e2bSVaishali Kulkarni struct iscsi_conn_update_ramrod_params
297*14b24e2bSVaishali Kulkarni {
298*14b24e2bSVaishali Kulkarni 	struct iscsi_slow_path_hdr hdr /* spe message header. */;
299*14b24e2bSVaishali Kulkarni 	__le16 conn_id /* ISCSI Connection ID. (MOTI_COHEN : draft for DrvSim sake) */;
300*14b24e2bSVaishali Kulkarni 	__le32 fw_cid /* Context ID (cid) of the connection. (MOTI_COHEN : draft for DrvSim sake) */;
301*14b24e2bSVaishali Kulkarni 	u8 flags;
302*14b24e2bSVaishali Kulkarni #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_HD_EN_MASK           0x1 /* Is header digest enabled */
303*14b24e2bSVaishali Kulkarni #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_HD_EN_SHIFT          0
304*14b24e2bSVaishali Kulkarni #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DD_EN_MASK           0x1 /* Is data digest enabled */
305*14b24e2bSVaishali Kulkarni #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DD_EN_SHIFT          1
306*14b24e2bSVaishali Kulkarni #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_INITIAL_R2T_MASK     0x1 /* Initial R2T */
307*14b24e2bSVaishali Kulkarni #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_INITIAL_R2T_SHIFT    2
308*14b24e2bSVaishali Kulkarni #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_IMMEDIATE_DATA_MASK  0x1 /* Immediate data */
310*14b24e2bSVaishali Kulkarni #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DIF_BLOCK_SIZE_MASK  0x1 /* 0 - 512B, 1 - 4K */
312*14b24e2bSVaishali Kulkarni #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DIF_ON_HOST_EN_MASK  0x1 /* 0 - no DIF, 1 - could be enabled per task */
313*14b24e2bSVaishali Kulkarni #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DIF_ON_HOST_EN_SHIFT 5
314*14b24e2bSVaishali Kulkarni #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_RESERVED1_MASK       0x3
315*14b24e2bSVaishali Kulkarni #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_RESERVED1_SHIFT      6
316*14b24e2bSVaishali Kulkarni 	u8 reserved0[3];
317*14b24e2bSVaishali Kulkarni 	__le32 max_seq_size /* Maximum sequence size. Valid for TX and RX */;
318*14b24e2bSVaishali Kulkarni 	__le32 max_send_pdu_length /* Maximum PDU size. Valid for the TX */;
319*14b24e2bSVaishali Kulkarni 	__le32 max_recv_pdu_length /* Maximum PDU size. Valid for the RX */;
320*14b24e2bSVaishali Kulkarni 	__le32 first_seq_length /* Initial sequence length */;
321*14b24e2bSVaishali Kulkarni 	__le32 exp_stat_sn /* ExpStatSn - Option1 Only */;
322*14b24e2bSVaishali Kulkarni };
323*14b24e2bSVaishali Kulkarni 
324*14b24e2bSVaishali Kulkarni 
325*14b24e2bSVaishali Kulkarni /*
326*14b24e2bSVaishali Kulkarni  * iSCSI Command PDU header with Extended CDB (Initiator Mode)
327*14b24e2bSVaishali Kulkarni  */
328*14b24e2bSVaishali Kulkarni struct iscsi_ext_cdb_cmd_hdr
329*14b24e2bSVaishali Kulkarni {
330*14b24e2bSVaishali Kulkarni 	__le16 reserved1 /* reserved */;
331*14b24e2bSVaishali Kulkarni 	u8 flags_attr;
332*14b24e2bSVaishali Kulkarni #define ISCSI_EXT_CDB_CMD_HDR_ATTR_MASK          0x7 /* attributes */
333*14b24e2bSVaishali Kulkarni #define ISCSI_EXT_CDB_CMD_HDR_ATTR_SHIFT         0
334*14b24e2bSVaishali Kulkarni #define ISCSI_EXT_CDB_CMD_HDR_RSRV_MASK          0x3 /* reserved */
335*14b24e2bSVaishali Kulkarni #define ISCSI_EXT_CDB_CMD_HDR_RSRV_SHIFT         3
336*14b24e2bSVaishali Kulkarni #define ISCSI_EXT_CDB_CMD_HDR_WRITE_MASK         0x1 /* write */
337*14b24e2bSVaishali Kulkarni #define ISCSI_EXT_CDB_CMD_HDR_WRITE_SHIFT        5
338*14b24e2bSVaishali Kulkarni #define ISCSI_EXT_CDB_CMD_HDR_READ_MASK          0x1 /* read */
339*14b24e2bSVaishali Kulkarni #define ISCSI_EXT_CDB_CMD_HDR_READ_SHIFT         6
340*14b24e2bSVaishali Kulkarni #define ISCSI_EXT_CDB_CMD_HDR_FINAL_MASK         0x1 /* final */
341*14b24e2bSVaishali Kulkarni #define ISCSI_EXT_CDB_CMD_HDR_FINAL_SHIFT        7
342*14b24e2bSVaishali Kulkarni 	u8 opcode /* opcode. [constant, initialized] */;
343*14b24e2bSVaishali Kulkarni 	__le32 hdr_second_dword;
344*14b24e2bSVaishali Kulkarni #define ISCSI_EXT_CDB_CMD_HDR_DATA_SEG_LEN_MASK  0xFFFFFF /* DataSegmentLength */
345*14b24e2bSVaishali Kulkarni #define ISCSI_EXT_CDB_CMD_HDR_DATA_SEG_LEN_SHIFT 0
346*14b24e2bSVaishali Kulkarni #define ISCSI_EXT_CDB_CMD_HDR_CDB_SIZE_MASK      0xFF /* The Extended CDB size in bytes. Maximum Extended CDB size supported is CDB 64B. */
347*14b24e2bSVaishali Kulkarni #define ISCSI_EXT_CDB_CMD_HDR_CDB_SIZE_SHIFT     24
348*14b24e2bSVaishali Kulkarni 	struct regpair lun /* Logical Unit Number. [constant, initialized] */;
349*14b24e2bSVaishali Kulkarni 	__le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */;
350*14b24e2bSVaishali Kulkarni 	__le32 expected_transfer_length /* Expected Data Transfer Length (only 3 bytes are significant) */;
351*14b24e2bSVaishali Kulkarni 	__le32 cmd_sn /* CmdSn. [constant, initialized] */;
352*14b24e2bSVaishali Kulkarni 	__le32 exp_stat_sn /* various fields for middle-path PDU. [constant, initialized] */;
353*14b24e2bSVaishali Kulkarni 	struct scsi_sge cdb_sge /* Extended CDBs dedicated SGE */;
354*14b24e2bSVaishali Kulkarni };
355*14b24e2bSVaishali Kulkarni 
356*14b24e2bSVaishali Kulkarni /*
357*14b24e2bSVaishali Kulkarni  * iSCSI login request PDU header
358*14b24e2bSVaishali Kulkarni  */
359*14b24e2bSVaishali Kulkarni struct iscsi_login_req_hdr
360*14b24e2bSVaishali Kulkarni {
361*14b24e2bSVaishali Kulkarni 	u8 version_min /* Version-min */;
362*14b24e2bSVaishali Kulkarni 	u8 version_max /* Version-max */;
363*14b24e2bSVaishali Kulkarni 	u8 flags_attr;
364*14b24e2bSVaishali Kulkarni #define ISCSI_LOGIN_REQ_HDR_NSG_MASK            0x3 /* Next Stage (NSG) */
365*14b24e2bSVaishali Kulkarni #define ISCSI_LOGIN_REQ_HDR_NSG_SHIFT           0
366*14b24e2bSVaishali Kulkarni #define ISCSI_LOGIN_REQ_HDR_CSG_MASK            0x3 /* Current stage (CSG) */
367*14b24e2bSVaishali Kulkarni #define ISCSI_LOGIN_REQ_HDR_CSG_SHIFT           2
368*14b24e2bSVaishali Kulkarni #define ISCSI_LOGIN_REQ_HDR_RSRV_MASK           0x3 /* reserved */
369*14b24e2bSVaishali Kulkarni #define ISCSI_LOGIN_REQ_HDR_RSRV_SHIFT          4
370*14b24e2bSVaishali Kulkarni #define ISCSI_LOGIN_REQ_HDR_C_MASK              0x1 /* C (Continue) bit */
371*14b24e2bSVaishali Kulkarni #define ISCSI_LOGIN_REQ_HDR_C_SHIFT             6
372*14b24e2bSVaishali Kulkarni #define ISCSI_LOGIN_REQ_HDR_T_MASK              0x1 /* T (Transit) bit */
373*14b24e2bSVaishali Kulkarni #define ISCSI_LOGIN_REQ_HDR_T_SHIFT             7
374*14b24e2bSVaishali Kulkarni 	u8 opcode /* opcode. [constant, initialized] */;
375*14b24e2bSVaishali Kulkarni 	__le32 hdr_second_dword;
376*14b24e2bSVaishali Kulkarni #define ISCSI_LOGIN_REQ_HDR_DATA_SEG_LEN_MASK   0xFFFFFF /* DataSegmentLength */
377*14b24e2bSVaishali Kulkarni #define ISCSI_LOGIN_REQ_HDR_DATA_SEG_LEN_SHIFT  0
378*14b24e2bSVaishali Kulkarni #define ISCSI_LOGIN_REQ_HDR_TOTAL_AHS_LEN_MASK  0xFF /* TotalAHSLength */
379*14b24e2bSVaishali Kulkarni #define ISCSI_LOGIN_REQ_HDR_TOTAL_AHS_LEN_SHIFT 24
380*14b24e2bSVaishali Kulkarni 	__le32 isid_tabc /* Session identifier high double word [constant, initialized] */;
381*14b24e2bSVaishali Kulkarni 	__le16 tsih /* TSIH */;
382*14b24e2bSVaishali Kulkarni 	__le16 isid_d /* Session identifier low word [constant, initialized] */;
383*14b24e2bSVaishali Kulkarni 	__le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */;
384*14b24e2bSVaishali Kulkarni 	__le16 reserved1;
385*14b24e2bSVaishali Kulkarni 	__le16 cid /* Unique Connection ID within the session [constant, initialized] */;
386*14b24e2bSVaishali Kulkarni 	__le32 cmd_sn /* CmdSn. [constant, initialized] */;
387*14b24e2bSVaishali Kulkarni 	__le32 exp_stat_sn /* various fields for middle-path PDU. [constant, initialized] */;
388*14b24e2bSVaishali Kulkarni 	__le32 reserved2[4];
389*14b24e2bSVaishali Kulkarni };
390*14b24e2bSVaishali Kulkarni 
391*14b24e2bSVaishali Kulkarni /*
392*14b24e2bSVaishali Kulkarni  * iSCSI logout request PDU header
393*14b24e2bSVaishali Kulkarni  */
394*14b24e2bSVaishali Kulkarni struct iscsi_logout_req_hdr
395*14b24e2bSVaishali Kulkarni {
396*14b24e2bSVaishali Kulkarni 	__le16 reserved0 /* reserved */;
397*14b24e2bSVaishali Kulkarni 	u8 reason_code /* Reason Code */;
398*14b24e2bSVaishali Kulkarni 	u8 opcode /* opcode. [constant, initialized] */;
399*14b24e2bSVaishali Kulkarni 	__le32 reserved1;
400*14b24e2bSVaishali Kulkarni 	__le32 reserved2[2] /* Reserved */;
401*14b24e2bSVaishali Kulkarni 	__le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */;
402*14b24e2bSVaishali Kulkarni 	__le16 reserved3 /* Reserved */;
403*14b24e2bSVaishali Kulkarni 	__le16 cid /* Unique Connection ID within the session [constant, initialized] */;
404*14b24e2bSVaishali Kulkarni 	__le32 cmd_sn /* CmdSn. [constant, initialized] */;
405*14b24e2bSVaishali Kulkarni 	__le32 exp_stat_sn /* various fields for middle-path PDU. [constant, initialized] */;
406*14b24e2bSVaishali Kulkarni 	__le32 reserved4[4] /* Reserved */;
407*14b24e2bSVaishali Kulkarni };
408*14b24e2bSVaishali Kulkarni 
409*14b24e2bSVaishali Kulkarni /*
410*14b24e2bSVaishali Kulkarni  * iSCSI Data-out PDU header
411*14b24e2bSVaishali Kulkarni  */
412*14b24e2bSVaishali Kulkarni struct iscsi_data_out_hdr
413*14b24e2bSVaishali Kulkarni {
414*14b24e2bSVaishali Kulkarni 	__le16 reserved1 /* reserved */;
415*14b24e2bSVaishali Kulkarni 	u8 flags_attr;
416*14b24e2bSVaishali Kulkarni #define ISCSI_DATA_OUT_HDR_RSRV_MASK   0x7F /* reserved */
417*14b24e2bSVaishali Kulkarni #define ISCSI_DATA_OUT_HDR_RSRV_SHIFT  0
418*14b24e2bSVaishali Kulkarni #define ISCSI_DATA_OUT_HDR_FINAL_MASK  0x1 /* final */
419*14b24e2bSVaishali Kulkarni #define ISCSI_DATA_OUT_HDR_FINAL_SHIFT 7
420*14b24e2bSVaishali Kulkarni 	u8 opcode /* opcode */;
421*14b24e2bSVaishali Kulkarni 	__le32 reserved2 /* reserved */;
422*14b24e2bSVaishali Kulkarni 	struct regpair lun /* Logical Unit Number */;
423*14b24e2bSVaishali Kulkarni 	__le32 itt /* Initiator Task Tag (only 2 bytes are significant) */;
424*14b24e2bSVaishali Kulkarni 	__le32 ttt /* Target Transfer Tag (from R2T) */;
425*14b24e2bSVaishali Kulkarni 	__le32 reserved3 /* resrved */;
426*14b24e2bSVaishali Kulkarni 	__le32 exp_stat_sn /* Expected StatSn */;
427*14b24e2bSVaishali Kulkarni 	__le32 reserved4 /* resrved */;
428*14b24e2bSVaishali Kulkarni 	__le32 data_sn /* DataSN - PDU index in sequnece */;
429*14b24e2bSVaishali Kulkarni 	__le32 buffer_offset /* Buffer Offset - offset in task */;
430*14b24e2bSVaishali Kulkarni 	__le32 reserved5 /* resrved */;
431*14b24e2bSVaishali Kulkarni };
432*14b24e2bSVaishali Kulkarni 
433*14b24e2bSVaishali Kulkarni /*
434*14b24e2bSVaishali Kulkarni  * iSCSI Data-in PDU header
435*14b24e2bSVaishali Kulkarni  */
436*14b24e2bSVaishali Kulkarni struct iscsi_data_in_hdr
437*14b24e2bSVaishali Kulkarni {
438*14b24e2bSVaishali Kulkarni 	u8 status_rsvd /* Status or reserved */;
439*14b24e2bSVaishali Kulkarni 	u8 reserved1 /* reserved */;
440*14b24e2bSVaishali Kulkarni 	u8 flags;
441*14b24e2bSVaishali Kulkarni #define ISCSI_DATA_IN_HDR_STATUS_MASK     0x1 /* Status */
442*14b24e2bSVaishali Kulkarni #define ISCSI_DATA_IN_HDR_STATUS_SHIFT    0
443*14b24e2bSVaishali Kulkarni #define ISCSI_DATA_IN_HDR_UNDERFLOW_MASK  0x1 /* Residual Underflow */
444*14b24e2bSVaishali Kulkarni #define ISCSI_DATA_IN_HDR_UNDERFLOW_SHIFT 1
445*14b24e2bSVaishali Kulkarni #define ISCSI_DATA_IN_HDR_OVERFLOW_MASK   0x1 /* Residual Overflow */
446*14b24e2bSVaishali Kulkarni #define ISCSI_DATA_IN_HDR_OVERFLOW_SHIFT  2
447*14b24e2bSVaishali Kulkarni #define ISCSI_DATA_IN_HDR_RSRV_MASK       0x7 /* reserved - 0 */
448*14b24e2bSVaishali Kulkarni #define ISCSI_DATA_IN_HDR_RSRV_SHIFT      3
449*14b24e2bSVaishali Kulkarni #define ISCSI_DATA_IN_HDR_ACK_MASK        0x1 /* Acknowledge */
450*14b24e2bSVaishali Kulkarni #define ISCSI_DATA_IN_HDR_ACK_SHIFT       6
451*14b24e2bSVaishali Kulkarni #define ISCSI_DATA_IN_HDR_FINAL_MASK      0x1 /* final */
452*14b24e2bSVaishali Kulkarni #define ISCSI_DATA_IN_HDR_FINAL_SHIFT     7
453*14b24e2bSVaishali Kulkarni 	u8 opcode /* opcode */;
454*14b24e2bSVaishali Kulkarni 	__le32 reserved2 /* reserved */;
455*14b24e2bSVaishali Kulkarni 	struct regpair lun /* Logical Unit Number */;
456*14b24e2bSVaishali Kulkarni 	__le32 itt /* Initiator Task Tag (only 2 bytes are significant) */;
457*14b24e2bSVaishali Kulkarni 	__le32 ttt /* Target Transfer Tag (from R2T) */;
458*14b24e2bSVaishali Kulkarni 	__le32 stat_sn /* StatSN or reserved */;
459*14b24e2bSVaishali Kulkarni 	__le32 exp_cmd_sn /* Expected CmdSn */;
460*14b24e2bSVaishali Kulkarni 	__le32 max_cmd_sn /* MaxCmdSn */;
461*14b24e2bSVaishali Kulkarni 	__le32 data_sn /* DataSN - PDU index in sequnece */;
462*14b24e2bSVaishali Kulkarni 	__le32 buffer_offset /* Buffer Offset - offset in task */;
463*14b24e2bSVaishali Kulkarni 	__le32 residual_count /* Residual Count */;
464*14b24e2bSVaishali Kulkarni };
465*14b24e2bSVaishali Kulkarni 
466*14b24e2bSVaishali Kulkarni /*
467*14b24e2bSVaishali Kulkarni  * iSCSI R2T PDU header
468*14b24e2bSVaishali Kulkarni  */
469*14b24e2bSVaishali Kulkarni struct iscsi_r2t_hdr
470*14b24e2bSVaishali Kulkarni {
471*14b24e2bSVaishali Kulkarni 	u8 reserved0[3] /* reserved */;
472*14b24e2bSVaishali Kulkarni 	u8 opcode /* opcode */;
473*14b24e2bSVaishali Kulkarni 	__le32 reserved2 /* reserved */;
474*14b24e2bSVaishali Kulkarni 	struct regpair lun /* Logical Unit Number */;
475*14b24e2bSVaishali Kulkarni 	__le32 itt /* Initiator Task Tag */;
476*14b24e2bSVaishali Kulkarni 	__le32 ttt /* Target Transfer Tag */;
477*14b24e2bSVaishali Kulkarni 	__le32 stat_sn /* stat sn */;
478*14b24e2bSVaishali Kulkarni 	__le32 exp_cmd_sn /* Expected CmdSn */;
479*14b24e2bSVaishali Kulkarni 	__le32 max_cmd_sn /* Max CmdSn */;
480*14b24e2bSVaishali Kulkarni 	__le32 r2t_sn /* DataSN - PDU index in sequnece */;
481*14b24e2bSVaishali Kulkarni 	__le32 buffer_offset /* Buffer Offset - offset in task */;
482*14b24e2bSVaishali Kulkarni 	__le32 desired_data_trns_len /* Desired data trnsfer len */;
483*14b24e2bSVaishali Kulkarni };
484*14b24e2bSVaishali Kulkarni 
485*14b24e2bSVaishali Kulkarni /*
486*14b24e2bSVaishali Kulkarni  * iSCSI NOP-out PDU header
487*14b24e2bSVaishali Kulkarni  */
488*14b24e2bSVaishali Kulkarni struct iscsi_nop_out_hdr
489*14b24e2bSVaishali Kulkarni {
490*14b24e2bSVaishali Kulkarni 	__le16 reserved1 /* reserved */;
491*14b24e2bSVaishali Kulkarni 	u8 flags_attr;
492*14b24e2bSVaishali Kulkarni #define ISCSI_NOP_OUT_HDR_RSRV_MASK    0x7F /* reserved */
493*14b24e2bSVaishali Kulkarni #define ISCSI_NOP_OUT_HDR_RSRV_SHIFT   0
494*14b24e2bSVaishali Kulkarni #define ISCSI_NOP_OUT_HDR_CONST1_MASK  0x1 /* const1 */
495*14b24e2bSVaishali Kulkarni #define ISCSI_NOP_OUT_HDR_CONST1_SHIFT 7
496*14b24e2bSVaishali Kulkarni 	u8 opcode /* opcode */;
497*14b24e2bSVaishali Kulkarni 	__le32 reserved2 /* reserved */;
498*14b24e2bSVaishali Kulkarni 	struct regpair lun /* Logical Unit Number */;
499*14b24e2bSVaishali Kulkarni 	__le32 itt /* Initiator Task Tag (only 2 bytes are significant) */;
500*14b24e2bSVaishali Kulkarni 	__le32 ttt /* Target Transfer Tag (from R2T) */;
501*14b24e2bSVaishali Kulkarni 	__le32 cmd_sn /* CmdSN */;
502*14b24e2bSVaishali Kulkarni 	__le32 exp_stat_sn /* Expected StatSn */;
503*14b24e2bSVaishali Kulkarni 	__le32 reserved3 /* reserved */;
504*14b24e2bSVaishali Kulkarni 	__le32 reserved4 /* reserved */;
505*14b24e2bSVaishali Kulkarni 	__le32 reserved5 /* reserved */;
506*14b24e2bSVaishali Kulkarni 	__le32 reserved6 /* reserved */;
507*14b24e2bSVaishali Kulkarni };
508*14b24e2bSVaishali Kulkarni 
509*14b24e2bSVaishali Kulkarni /*
510*14b24e2bSVaishali Kulkarni  * iSCSI NOP-in PDU header
511*14b24e2bSVaishali Kulkarni  */
512*14b24e2bSVaishali Kulkarni struct iscsi_nop_in_hdr
513*14b24e2bSVaishali Kulkarni {
514*14b24e2bSVaishali Kulkarni 	__le16 reserved0 /* reserved */;
515*14b24e2bSVaishali Kulkarni 	u8 flags_attr;
516*14b24e2bSVaishali Kulkarni #define ISCSI_NOP_IN_HDR_RSRV_MASK           0x7F /* reserved */
517*14b24e2bSVaishali Kulkarni #define ISCSI_NOP_IN_HDR_RSRV_SHIFT          0
518*14b24e2bSVaishali Kulkarni #define ISCSI_NOP_IN_HDR_CONST1_MASK         0x1 /* const1 */
519*14b24e2bSVaishali Kulkarni #define ISCSI_NOP_IN_HDR_CONST1_SHIFT        7
520*14b24e2bSVaishali Kulkarni 	u8 opcode /* opcode */;
521*14b24e2bSVaishali Kulkarni 	__le32 hdr_second_dword;
522*14b24e2bSVaishali Kulkarni #define ISCSI_NOP_IN_HDR_DATA_SEG_LEN_MASK   0xFFFFFF /* DataSegmentLength */
523*14b24e2bSVaishali Kulkarni #define ISCSI_NOP_IN_HDR_DATA_SEG_LEN_SHIFT  0
524*14b24e2bSVaishali Kulkarni #define ISCSI_NOP_IN_HDR_TOTAL_AHS_LEN_MASK  0xFF /* TotalAHSLength */
525*14b24e2bSVaishali Kulkarni #define ISCSI_NOP_IN_HDR_TOTAL_AHS_LEN_SHIFT 24
526*14b24e2bSVaishali Kulkarni 	struct regpair lun /* Logical Unit Number */;
527*14b24e2bSVaishali Kulkarni 	__le32 itt /* Initiator Task Tag (only 2 bytes are significant) */;
528*14b24e2bSVaishali Kulkarni 	__le32 ttt /* Target Transfer Tag */;
529*14b24e2bSVaishali Kulkarni 	__le32 stat_sn /* stat_sn */;
530*14b24e2bSVaishali Kulkarni 	__le32 exp_cmd_sn /* exp_cmd_sn */;
531*14b24e2bSVaishali Kulkarni 	__le32 max_cmd_sn /* max_cmd_sn */;
532*14b24e2bSVaishali Kulkarni 	__le32 reserved5 /* reserved */;
533*14b24e2bSVaishali Kulkarni 	__le32 reserved6 /* reserved */;
534*14b24e2bSVaishali Kulkarni 	__le32 reserved7 /* reserved */;
535*14b24e2bSVaishali Kulkarni };
536*14b24e2bSVaishali Kulkarni 
537*14b24e2bSVaishali Kulkarni /*
538*14b24e2bSVaishali Kulkarni  * iSCSI Login Response PDU header
539*14b24e2bSVaishali Kulkarni  */
540*14b24e2bSVaishali Kulkarni struct iscsi_login_response_hdr
541*14b24e2bSVaishali Kulkarni {
542*14b24e2bSVaishali Kulkarni 	u8 version_active /* Version-active */;
543*14b24e2bSVaishali Kulkarni 	u8 version_max /* Version-max */;
544*14b24e2bSVaishali Kulkarni 	u8 flags_attr;
545*14b24e2bSVaishali Kulkarni #define ISCSI_LOGIN_RESPONSE_HDR_NSG_MASK            0x3 /* Next Stage (NSG) */
546*14b24e2bSVaishali Kulkarni #define ISCSI_LOGIN_RESPONSE_HDR_NSG_SHIFT           0
547*14b24e2bSVaishali Kulkarni #define ISCSI_LOGIN_RESPONSE_HDR_CSG_MASK            0x3 /* Current stage (CSG) */
548*14b24e2bSVaishali Kulkarni #define ISCSI_LOGIN_RESPONSE_HDR_CSG_SHIFT           2
549*14b24e2bSVaishali Kulkarni #define ISCSI_LOGIN_RESPONSE_HDR_RSRV_MASK           0x3 /* reserved */
550*14b24e2bSVaishali Kulkarni #define ISCSI_LOGIN_RESPONSE_HDR_RSRV_SHIFT          4
551*14b24e2bSVaishali Kulkarni #define ISCSI_LOGIN_RESPONSE_HDR_C_MASK              0x1 /* C (Continue) bit */
552*14b24e2bSVaishali Kulkarni #define ISCSI_LOGIN_RESPONSE_HDR_C_SHIFT             6
553*14b24e2bSVaishali Kulkarni #define ISCSI_LOGIN_RESPONSE_HDR_T_MASK              0x1 /* T (Transit) bit */
554*14b24e2bSVaishali Kulkarni #define ISCSI_LOGIN_RESPONSE_HDR_T_SHIFT             7
555*14b24e2bSVaishali Kulkarni 	u8 opcode /* opcode. [constant, initialized] */;
556*14b24e2bSVaishali Kulkarni 	__le32 hdr_second_dword;
557*14b24e2bSVaishali Kulkarni #define ISCSI_LOGIN_RESPONSE_HDR_DATA_SEG_LEN_MASK   0xFFFFFF /* DataSegmentLength */
558*14b24e2bSVaishali Kulkarni #define ISCSI_LOGIN_RESPONSE_HDR_DATA_SEG_LEN_SHIFT  0
559*14b24e2bSVaishali Kulkarni #define ISCSI_LOGIN_RESPONSE_HDR_TOTAL_AHS_LEN_MASK  0xFF /* TotalAHSLength */
560*14b24e2bSVaishali Kulkarni #define ISCSI_LOGIN_RESPONSE_HDR_TOTAL_AHS_LEN_SHIFT 24
561*14b24e2bSVaishali Kulkarni 	__le32 isid_tabc /* Session identifier high double word [constant, initialized] */;
562*14b24e2bSVaishali Kulkarni 	__le16 tsih /* TSIH */;
563*14b24e2bSVaishali Kulkarni 	__le16 isid_d /* Session identifier low word [constant, initialized] */;
564*14b24e2bSVaishali Kulkarni 	__le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */;
565*14b24e2bSVaishali Kulkarni 	__le32 reserved1;
566*14b24e2bSVaishali Kulkarni 	__le32 stat_sn /* CmdSn. [constant, initialized] */;
567*14b24e2bSVaishali Kulkarni 	__le32 exp_cmd_sn /* various fields for middle-path PDU. [constant, initialized] */;
568*14b24e2bSVaishali Kulkarni 	__le32 max_cmd_sn /* max_cmd_sn */;
569*14b24e2bSVaishali Kulkarni 	__le16 reserved2;
570*14b24e2bSVaishali Kulkarni 	u8 status_detail /* status_detail */;
571*14b24e2bSVaishali Kulkarni 	u8 status_class /* status_class */;
572*14b24e2bSVaishali Kulkarni 	__le32 reserved4[2];
573*14b24e2bSVaishali Kulkarni };
574*14b24e2bSVaishali Kulkarni 
575*14b24e2bSVaishali Kulkarni /*
576*14b24e2bSVaishali Kulkarni  * iSCSI Logout Response PDU header
577*14b24e2bSVaishali Kulkarni  */
578*14b24e2bSVaishali Kulkarni struct iscsi_logout_response_hdr
579*14b24e2bSVaishali Kulkarni {
580*14b24e2bSVaishali Kulkarni 	u8 reserved1 /* reserved */;
581*14b24e2bSVaishali Kulkarni 	u8 response /* response */;
582*14b24e2bSVaishali Kulkarni 	u8 flags /* flags and attributes */;
583*14b24e2bSVaishali Kulkarni 	u8 opcode /* opcode. [constant, initialized] */;
584*14b24e2bSVaishali Kulkarni 	__le32 hdr_second_dword;
585*14b24e2bSVaishali Kulkarni #define ISCSI_LOGOUT_RESPONSE_HDR_DATA_SEG_LEN_MASK   0xFFFFFF /* DataSegmentLength */
586*14b24e2bSVaishali Kulkarni #define ISCSI_LOGOUT_RESPONSE_HDR_DATA_SEG_LEN_SHIFT  0
587*14b24e2bSVaishali Kulkarni #define ISCSI_LOGOUT_RESPONSE_HDR_TOTAL_AHS_LEN_MASK  0xFF /* TotalAHSLength */
588*14b24e2bSVaishali Kulkarni #define ISCSI_LOGOUT_RESPONSE_HDR_TOTAL_AHS_LEN_SHIFT 24
589*14b24e2bSVaishali Kulkarni 	__le32 reserved2[2] /* Reserved */;
590*14b24e2bSVaishali Kulkarni 	__le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */;
591*14b24e2bSVaishali Kulkarni 	__le32 reserved3 /* Reserved */;
592*14b24e2bSVaishali Kulkarni 	__le32 stat_sn /* CmdSN */;
593*14b24e2bSVaishali Kulkarni 	__le32 exp_cmd_sn /* Expected StatSn */;
594*14b24e2bSVaishali Kulkarni 	__le32 max_cmd_sn /* CmdSN */;
595*14b24e2bSVaishali Kulkarni 	__le32 reserved4 /* Reserved */;
596*14b24e2bSVaishali Kulkarni 	__le16 time_2_retain /* Time to Retain  */;
597*14b24e2bSVaishali Kulkarni 	__le16 time_2_wait /* Time to wait */;
598*14b24e2bSVaishali Kulkarni 	__le32 reserved5[1] /* Reserved */;
599*14b24e2bSVaishali Kulkarni };
600*14b24e2bSVaishali Kulkarni 
601*14b24e2bSVaishali Kulkarni /*
602*14b24e2bSVaishali Kulkarni  * iSCSI Text Request PDU header
603*14b24e2bSVaishali Kulkarni  */
604*14b24e2bSVaishali Kulkarni struct iscsi_text_request_hdr
605*14b24e2bSVaishali Kulkarni {
606*14b24e2bSVaishali Kulkarni 	__le16 reserved0 /* reserved */;
607*14b24e2bSVaishali Kulkarni 	u8 flags_attr;
608*14b24e2bSVaishali Kulkarni #define ISCSI_TEXT_REQUEST_HDR_RSRV_MASK           0x3F /* reserved */
609*14b24e2bSVaishali Kulkarni #define ISCSI_TEXT_REQUEST_HDR_RSRV_SHIFT          0
610*14b24e2bSVaishali Kulkarni #define ISCSI_TEXT_REQUEST_HDR_C_MASK              0x1 /* C (Continue) bit */
611*14b24e2bSVaishali Kulkarni #define ISCSI_TEXT_REQUEST_HDR_C_SHIFT             6
612*14b24e2bSVaishali Kulkarni #define ISCSI_TEXT_REQUEST_HDR_F_MASK              0x1 /* F (Final) bit */
613*14b24e2bSVaishali Kulkarni #define ISCSI_TEXT_REQUEST_HDR_F_SHIFT             7
614*14b24e2bSVaishali Kulkarni 	u8 opcode /* opcode. [constant, initialized] */;
615*14b24e2bSVaishali Kulkarni 	__le32 hdr_second_dword;
616*14b24e2bSVaishali Kulkarni #define ISCSI_TEXT_REQUEST_HDR_DATA_SEG_LEN_MASK   0xFFFFFF /* DataSegmentLength */
617*14b24e2bSVaishali Kulkarni #define ISCSI_TEXT_REQUEST_HDR_DATA_SEG_LEN_SHIFT  0
618*14b24e2bSVaishali Kulkarni #define ISCSI_TEXT_REQUEST_HDR_TOTAL_AHS_LEN_MASK  0xFF /* TotalAHSLength */
619*14b24e2bSVaishali Kulkarni #define ISCSI_TEXT_REQUEST_HDR_TOTAL_AHS_LEN_SHIFT 24
620*14b24e2bSVaishali Kulkarni 	struct regpair lun /* Logical Unit Number */;
621*14b24e2bSVaishali Kulkarni 	__le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */;
622*14b24e2bSVaishali Kulkarni 	__le32 ttt /* Referenced Task Tag or 0xffffffff */;
623*14b24e2bSVaishali Kulkarni 	__le32 cmd_sn /* cmd_sn */;
624*14b24e2bSVaishali Kulkarni 	__le32 exp_stat_sn /* exp_stat_sn */;
625*14b24e2bSVaishali Kulkarni 	__le32 reserved4[4] /* Reserved */;
626*14b24e2bSVaishali Kulkarni };
627*14b24e2bSVaishali Kulkarni 
628*14b24e2bSVaishali Kulkarni /*
629*14b24e2bSVaishali Kulkarni  * iSCSI Text Response PDU header
630*14b24e2bSVaishali Kulkarni  */
631*14b24e2bSVaishali Kulkarni struct iscsi_text_response_hdr
632*14b24e2bSVaishali Kulkarni {
633*14b24e2bSVaishali Kulkarni 	__le16 reserved1 /* reserved */;
634*14b24e2bSVaishali Kulkarni 	u8 flags;
635*14b24e2bSVaishali Kulkarni #define ISCSI_TEXT_RESPONSE_HDR_RSRV_MASK           0x3F /* reserved */
636*14b24e2bSVaishali Kulkarni #define ISCSI_TEXT_RESPONSE_HDR_RSRV_SHIFT          0
637*14b24e2bSVaishali Kulkarni #define ISCSI_TEXT_RESPONSE_HDR_C_MASK              0x1 /* C (Continue) bit */
638*14b24e2bSVaishali Kulkarni #define ISCSI_TEXT_RESPONSE_HDR_C_SHIFT             6
639*14b24e2bSVaishali Kulkarni #define ISCSI_TEXT_RESPONSE_HDR_F_MASK              0x1 /* F (Final) bit */
640*14b24e2bSVaishali Kulkarni #define ISCSI_TEXT_RESPONSE_HDR_F_SHIFT             7
641*14b24e2bSVaishali Kulkarni 	u8 opcode /* opcode. [constant, initialized] */;
642*14b24e2bSVaishali Kulkarni 	__le32 hdr_second_dword;
643*14b24e2bSVaishali Kulkarni #define ISCSI_TEXT_RESPONSE_HDR_DATA_SEG_LEN_MASK   0xFFFFFF /* DataSegmentLength */
644*14b24e2bSVaishali Kulkarni #define ISCSI_TEXT_RESPONSE_HDR_DATA_SEG_LEN_SHIFT  0
645*14b24e2bSVaishali Kulkarni #define ISCSI_TEXT_RESPONSE_HDR_TOTAL_AHS_LEN_MASK  0xFF /* TotalAHSLength */
646*14b24e2bSVaishali Kulkarni #define ISCSI_TEXT_RESPONSE_HDR_TOTAL_AHS_LEN_SHIFT 24
647*14b24e2bSVaishali Kulkarni 	struct regpair lun /* Logical Unit Number */;
648*14b24e2bSVaishali Kulkarni 	__le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */;
649*14b24e2bSVaishali Kulkarni 	__le32 ttt /* Target Task Tag */;
650*14b24e2bSVaishali Kulkarni 	__le32 stat_sn /* CmdSN */;
651*14b24e2bSVaishali Kulkarni 	__le32 exp_cmd_sn /* Expected StatSn */;
652*14b24e2bSVaishali Kulkarni 	__le32 max_cmd_sn /* CmdSN */;
653*14b24e2bSVaishali Kulkarni 	__le32 reserved4[3] /* Reserved */;
654*14b24e2bSVaishali Kulkarni };
655*14b24e2bSVaishali Kulkarni 
656*14b24e2bSVaishali Kulkarni /*
657*14b24e2bSVaishali Kulkarni  * iSCSI TMF Request PDU header
658*14b24e2bSVaishali Kulkarni  */
659*14b24e2bSVaishali Kulkarni struct iscsi_tmf_request_hdr
660*14b24e2bSVaishali Kulkarni {
661*14b24e2bSVaishali Kulkarni 	__le16 reserved0 /* reserved */;
662*14b24e2bSVaishali Kulkarni 	u8 function /* function */;
663*14b24e2bSVaishali Kulkarni 	u8 opcode /* opcode. [constant, initialized] */;
664*14b24e2bSVaishali Kulkarni 	__le32 hdr_second_dword;
665*14b24e2bSVaishali Kulkarni #define ISCSI_TMF_REQUEST_HDR_DATA_SEG_LEN_MASK   0xFFFFFF /* DataSegmentLength */
666*14b24e2bSVaishali Kulkarni #define ISCSI_TMF_REQUEST_HDR_DATA_SEG_LEN_SHIFT  0
667*14b24e2bSVaishali Kulkarni #define ISCSI_TMF_REQUEST_HDR_TOTAL_AHS_LEN_MASK  0xFF /* TotalAHSLength */
668*14b24e2bSVaishali Kulkarni #define ISCSI_TMF_REQUEST_HDR_TOTAL_AHS_LEN_SHIFT 24
669*14b24e2bSVaishali Kulkarni 	struct regpair lun /* Logical Unit Number */;
670*14b24e2bSVaishali Kulkarni 	__le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */;
671*14b24e2bSVaishali Kulkarni 	__le32 rtt /* Referenced Task Tag or 0xffffffff */;
672*14b24e2bSVaishali Kulkarni 	__le32 cmd_sn /* cmd_sn */;
673*14b24e2bSVaishali Kulkarni 	__le32 exp_stat_sn /* exp_stat_sn */;
674*14b24e2bSVaishali Kulkarni 	__le32 ref_cmd_sn /* ref_cmd_sn */;
675*14b24e2bSVaishali Kulkarni 	__le32 exp_data_sn /* exp_data_sn */;
676*14b24e2bSVaishali Kulkarni 	__le32 reserved4[2] /* Reserved */;
677*14b24e2bSVaishali Kulkarni };
678*14b24e2bSVaishali Kulkarni 
679*14b24e2bSVaishali Kulkarni struct iscsi_tmf_response_hdr
680*14b24e2bSVaishali Kulkarni {
681*14b24e2bSVaishali Kulkarni 	u8 reserved2 /* reserved2 */;
682*14b24e2bSVaishali Kulkarni 	u8 hdr_response /* Response field of ISCSI header for Responses / Reserved for Data-In */;
683*14b24e2bSVaishali Kulkarni 	u8 hdr_flags /* Flags field of ISCSI header */;
684*14b24e2bSVaishali Kulkarni 	u8 opcode /* opcode. [constant, initialized] */;
685*14b24e2bSVaishali Kulkarni 	__le32 hdr_second_dword;
686*14b24e2bSVaishali Kulkarni #define ISCSI_TMF_RESPONSE_HDR_DATA_SEG_LEN_MASK   0xFFFFFF /* DataSegmentLength */
687*14b24e2bSVaishali Kulkarni #define ISCSI_TMF_RESPONSE_HDR_DATA_SEG_LEN_SHIFT  0
688*14b24e2bSVaishali Kulkarni #define ISCSI_TMF_RESPONSE_HDR_TOTAL_AHS_LEN_MASK  0xFF /* TotalAHSLength */
689*14b24e2bSVaishali Kulkarni #define ISCSI_TMF_RESPONSE_HDR_TOTAL_AHS_LEN_SHIFT 24
690*14b24e2bSVaishali Kulkarni 	struct regpair reserved0;
691*14b24e2bSVaishali Kulkarni 	__le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */;
692*14b24e2bSVaishali Kulkarni 	__le32 reserved1 /* Reserved */;
693*14b24e2bSVaishali Kulkarni 	__le32 stat_sn /* stat_sn */;
694*14b24e2bSVaishali Kulkarni 	__le32 exp_cmd_sn /* exp_cmd_sn */;
695*14b24e2bSVaishali Kulkarni 	__le32 max_cmd_sn /* max_cmd_sn */;
696*14b24e2bSVaishali Kulkarni 	__le32 reserved4[3] /* Reserved */;
697*14b24e2bSVaishali Kulkarni };
698*14b24e2bSVaishali Kulkarni 
699*14b24e2bSVaishali Kulkarni /*
700*14b24e2bSVaishali Kulkarni  * iSCSI Response PDU header
701*14b24e2bSVaishali Kulkarni  */
702*14b24e2bSVaishali Kulkarni struct iscsi_response_hdr
703*14b24e2bSVaishali Kulkarni {
704*14b24e2bSVaishali Kulkarni 	u8 hdr_status /* Status field of ISCSI header */;
705*14b24e2bSVaishali Kulkarni 	u8 hdr_response /* Response field of ISCSI header for Responses / Reserved for Data-In */;
706*14b24e2bSVaishali Kulkarni 	u8 hdr_flags /* Flags field of ISCSI header */;
707*14b24e2bSVaishali Kulkarni 	u8 opcode /* opcode. [constant, initialized] */;
708*14b24e2bSVaishali Kulkarni 	__le32 hdr_second_dword;
709*14b24e2bSVaishali Kulkarni #define ISCSI_RESPONSE_HDR_DATA_SEG_LEN_MASK   0xFFFFFF /* DataSegmentLength */
710*14b24e2bSVaishali Kulkarni #define ISCSI_RESPONSE_HDR_DATA_SEG_LEN_SHIFT  0
711*14b24e2bSVaishali Kulkarni #define ISCSI_RESPONSE_HDR_TOTAL_AHS_LEN_MASK  0xFF /* TotalAHSLength */
712*14b24e2bSVaishali Kulkarni #define ISCSI_RESPONSE_HDR_TOTAL_AHS_LEN_SHIFT 24
713*14b24e2bSVaishali Kulkarni 	struct regpair lun /* Logical Unit Number */;
714*14b24e2bSVaishali Kulkarni 	__le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */;
715*14b24e2bSVaishali Kulkarni 	__le32 snack_tag /* Currently ERL>0 is not supported */;
716*14b24e2bSVaishali Kulkarni 	__le32 stat_sn /* CmdSN */;
717*14b24e2bSVaishali Kulkarni 	__le32 exp_cmd_sn /* Expected StatSn */;
718*14b24e2bSVaishali Kulkarni 	__le32 max_cmd_sn /* CmdSN */;
719*14b24e2bSVaishali Kulkarni 	__le32 exp_data_sn /* exp_data_sn */;
720*14b24e2bSVaishali Kulkarni 	__le32 bi_residual_count /* bi residual count */;
721*14b24e2bSVaishali Kulkarni 	__le32 residual_count /* residual count */;
722*14b24e2bSVaishali Kulkarni };
723*14b24e2bSVaishali Kulkarni 
724*14b24e2bSVaishali Kulkarni /*
725*14b24e2bSVaishali Kulkarni  * iSCSI Reject PDU header
726*14b24e2bSVaishali Kulkarni  */
727*14b24e2bSVaishali Kulkarni struct iscsi_reject_hdr
728*14b24e2bSVaishali Kulkarni {