1 /* QLogic qed NIC Driver
2 * Copyright (c) 2015-2017 QLogic Corporation
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
18 * - Redistributions in binary form must reproduce the above
19 * copyright notice, this list of conditions and the following
20 * disclaimer in the documentation and /or other materials
21 * provided with the distribution.
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33 #ifndef __ISCSI_COMMON__
34 #define __ISCSI_COMMON__
36 /**********************/
37 /* ISCSI FW CONSTANTS */
38 /**********************/
40 /* iSCSI HSI constants */
41 #define ISCSI_DEFAULT_MTU (1500)
43 /* KWQ (kernel work queue) layer codes */
44 #define ISCSI_SLOW_PATH_LAYER_CODE (6)
46 /* iSCSI parameter defaults */
47 #define ISCSI_DEFAULT_HEADER_DIGEST (0)
48 #define ISCSI_DEFAULT_DATA_DIGEST (0)
49 #define ISCSI_DEFAULT_INITIAL_R2T (1)
50 #define ISCSI_DEFAULT_IMMEDIATE_DATA (1)
51 #define ISCSI_DEFAULT_MAX_PDU_LENGTH (0x2000)
52 #define ISCSI_DEFAULT_FIRST_BURST_LENGTH (0x10000)
53 #define ISCSI_DEFAULT_MAX_BURST_LENGTH (0x40000)
54 #define ISCSI_DEFAULT_MAX_OUTSTANDING_R2T (1)
56 /* iSCSI parameter limits */
57 #define ISCSI_MIN_VAL_MAX_PDU_LENGTH (0x200)
58 #define ISCSI_MAX_VAL_MAX_PDU_LENGTH (0xffffff)
59 #define ISCSI_MIN_VAL_BURST_LENGTH (0x200)
60 #define ISCSI_MAX_VAL_BURST_LENGTH (0xffffff)
61 #define ISCSI_MIN_VAL_MAX_OUTSTANDING_R2T (1)
62 #define ISCSI_MAX_VAL_MAX_OUTSTANDING_R2T (0xff)
64 #define ISCSI_AHS_CNTL_SIZE 4
66 #define ISCSI_WQE_NUM_SGES_SLOWIO (0xf)
68 /* iSCSI reserved params */
69 #define ISCSI_ITT_ALL_ONES (0xffffffff)
70 #define ISCSI_TTT_ALL_ONES (0xffffffff)
72 #define ISCSI_OPTION_1_OFF_CHIP_TCP 1
73 #define ISCSI_OPTION_2_ON_CHIP_TCP 2
75 #define ISCSI_INITIATOR_MODE 0
76 #define ISCSI_TARGET_MODE 1
78 /* iSCSI request op codes */
79 #define ISCSI_OPCODE_NOP_OUT (0)
80 #define ISCSI_OPCODE_SCSI_CMD (1)
81 #define ISCSI_OPCODE_TMF_REQUEST (2)
82 #define ISCSI_OPCODE_LOGIN_REQUEST (3)
83 #define ISCSI_OPCODE_TEXT_REQUEST (4)
84 #define ISCSI_OPCODE_DATA_OUT (5)
85 #define ISCSI_OPCODE_LOGOUT_REQUEST (6)
87 /* iSCSI response/messages op codes */
88 #define ISCSI_OPCODE_NOP_IN (0x20)
89 #define ISCSI_OPCODE_SCSI_RESPONSE (0x21)
90 #define ISCSI_OPCODE_TMF_RESPONSE (0x22)
91 #define ISCSI_OPCODE_LOGIN_RESPONSE (0x23)
92 #define ISCSI_OPCODE_TEXT_RESPONSE (0x24)
93 #define ISCSI_OPCODE_DATA_IN (0x25)
94 #define ISCSI_OPCODE_LOGOUT_RESPONSE (0x26)
95 #define ISCSI_OPCODE_R2T (0x31)
96 #define ISCSI_OPCODE_ASYNC_MSG (0x32)
97 #define ISCSI_OPCODE_REJECT (0x3f)
100 #define ISCSI_STAGE_SECURITY_NEGOTIATION (0)
101 #define ISCSI_STAGE_LOGIN_OPERATIONAL_NEGOTIATION (1)
102 #define ISCSI_STAGE_FULL_FEATURE_PHASE (3)
104 /* iSCSI CQE errors */
105 #define CQE_ERROR_BITMAP_DATA_DIGEST (0x08)
106 #define CQE_ERROR_BITMAP_RCV_ON_INVALID_CONN (0x10)
107 #define CQE_ERROR_BITMAP_DATA_TRUNCATED (0x20)
109 /* Union of data bd_opaque/ tq_tid */
110 union bd_opaque_tq_union
{
115 /* ISCSI SGL entry */
116 struct cqe_error_bitmap
{
117 u8 cqe_error_status_bits
;
118 #define CQE_ERROR_BITMAP_DIF_ERR_BITS_MASK 0x7
119 #define CQE_ERROR_BITMAP_DIF_ERR_BITS_SHIFT 0
120 #define CQE_ERROR_BITMAP_DATA_DIGEST_ERR_MASK 0x1
121 #define CQE_ERROR_BITMAP_DATA_DIGEST_ERR_SHIFT 3
122 #define CQE_ERROR_BITMAP_RCV_ON_INVALID_CONN_MASK 0x1
123 #define CQE_ERROR_BITMAP_RCV_ON_INVALID_CONN_SHIFT 4
124 #define CQE_ERROR_BITMAP_DATA_TRUNCATED_ERR_MASK 0x1
125 #define CQE_ERROR_BITMAP_DATA_TRUNCATED_ERR_SHIFT 5
126 #define CQE_ERROR_BITMAP_UNDER_RUN_ERR_MASK 0x1
127 #define CQE_ERROR_BITMAP_UNDER_RUN_ERR_SHIFT 6
128 #define CQE_ERROR_BITMAP_RESERVED2_MASK 0x1
129 #define CQE_ERROR_BITMAP_RESERVED2_SHIFT 7
132 union cqe_error_status
{
134 struct cqe_error_bitmap error_bits
;
137 /* iSCSI Login Response PDU header */
142 struct lun_mapper_addr_reserved
{
143 struct regpair lun_mapper_addr
;
147 /* rdif conetxt for dif on immediate */
148 struct dif_on_immediate_params
{
149 __le32 initial_ref_tag
;
150 __le16 application_tag
;
151 __le16 application_tag_mask
;
153 #define DIF_ON_IMMEDIATE_PARAMS_VALIDATE_GUARD_MASK 0x1
154 #define DIF_ON_IMMEDIATE_PARAMS_VALIDATE_GUARD_SHIFT 0
155 #define DIF_ON_IMMEDIATE_PARAMS_VALIDATE_APP_TAG_MASK 0x1
156 #define DIF_ON_IMMEDIATE_PARAMS_VALIDATE_APP_TAG_SHIFT 1
157 #define DIF_ON_IMMEDIATE_PARAMS_VALIDATE_REF_TAG_MASK 0x1
158 #define DIF_ON_IMMEDIATE_PARAMS_VALIDATE_REF_TAG_SHIFT 2
159 #define DIF_ON_IMMEDIATE_PARAMS_FORWARD_GUARD_MASK 0x1
160 #define DIF_ON_IMMEDIATE_PARAMS_FORWARD_GUARD_SHIFT 3
161 #define DIF_ON_IMMEDIATE_PARAMS_FORWARD_APP_TAG_MASK 0x1
162 #define DIF_ON_IMMEDIATE_PARAMS_FORWARD_APP_TAG_SHIFT 4
163 #define DIF_ON_IMMEDIATE_PARAMS_FORWARD_REF_TAG_MASK 0x1
164 #define DIF_ON_IMMEDIATE_PARAMS_FORWARD_REF_TAG_SHIFT 5
165 #define DIF_ON_IMMEDIATE_PARAMS_INTERVAL_SIZE_MASK 0x1
166 #define DIF_ON_IMMEDIATE_PARAMS_INTERVAL_SIZE_SHIFT 6
167 #define DIF_ON_IMMEDIATE_PARAMS_NETWORK_INTERFACE_MASK 0x1
168 #define DIF_ON_IMMEDIATE_PARAMS_NETWORK_INTERFACE_SHIFT 7
169 #define DIF_ON_IMMEDIATE_PARAMS_HOST_INTERFACE_MASK 0x3
170 #define DIF_ON_IMMEDIATE_PARAMS_HOST_INTERFACE_SHIFT 8
171 #define DIF_ON_IMMEDIATE_PARAMS_REF_TAG_MASK_MASK 0xF
172 #define DIF_ON_IMMEDIATE_PARAMS_REF_TAG_MASK_SHIFT 10
173 #define DIF_ON_IMMEDIATE_PARAMS_FORWARD_APP_TAG_WITH_MASK_MASK 0x1
174 #define DIF_ON_IMMEDIATE_PARAMS_FORWARD_APP_TAG_WITH_MASK_SHIFT 14
175 #define DIF_ON_IMMEDIATE_PARAMS_FORWARD_REF_TAG_WITH_MASK_MASK 0x1
176 #define DIF_ON_IMMEDIATE_PARAMS_FORWARD_REF_TAG_WITH_MASK_SHIFT 15
178 #define DIF_ON_IMMEDIATE_PARAMS_RESERVED_MASK 0x1
179 #define DIF_ON_IMMEDIATE_PARAMS_RESERVED_SHIFT 0
180 #define DIF_ON_IMMEDIATE_PARAMS_IGNORE_APP_TAG_MASK 0x1
181 #define DIF_ON_IMMEDIATE_PARAMS_IGNORE_APP_TAG_SHIFT 1
182 #define DIF_ON_IMMEDIATE_PARAMS_INITIAL_REF_TAG_IS_VALID_MASK 0x1
183 #define DIF_ON_IMMEDIATE_PARAMS_INITIAL_REF_TAG_IS_VALID_SHIFT 2
184 #define DIF_ON_IMMEDIATE_PARAMS_HOST_GUARD_TYPE_MASK 0x1
185 #define DIF_ON_IMMEDIATE_PARAMS_HOST_GUARD_TYPE_SHIFT 3
186 #define DIF_ON_IMMEDIATE_PARAMS_PROTECTION_TYPE_MASK 0x3
187 #define DIF_ON_IMMEDIATE_PARAMS_PROTECTION_TYPE_SHIFT 4
188 #define DIF_ON_IMMEDIATE_PARAMS_CRC_SEED_MASK 0x1
189 #define DIF_ON_IMMEDIATE_PARAMS_CRC_SEED_SHIFT 6
190 #define DIF_ON_IMMEDIATE_PARAMS_KEEP_REF_TAG_CONST_MASK 0x1
191 #define DIF_ON_IMMEDIATE_PARAMS_KEEP_REF_TAG_CONST_SHIFT 7
195 /* iSCSI dif on immediate mode attributes union */
196 union dif_configuration_params
{
197 struct lun_mapper_addr_reserved lun_mapper_address
;
198 struct dif_on_immediate_params def_dif_conf
;
201 /* Union of data/r2t sequence number */
202 union iscsi_seq_num
{
207 /* iSCSI DIF flags */
208 struct iscsi_dif_flags
{
210 #define ISCSI_DIF_FLAGS_PROT_INTERVAL_SIZE_LOG_MASK 0xF
211 #define ISCSI_DIF_FLAGS_PROT_INTERVAL_SIZE_LOG_SHIFT 0
212 #define ISCSI_DIF_FLAGS_DIF_TO_PEER_MASK 0x1
213 #define ISCSI_DIF_FLAGS_DIF_TO_PEER_SHIFT 4
214 #define ISCSI_DIF_FLAGS_HOST_INTERFACE_MASK 0x7
215 #define ISCSI_DIF_FLAGS_HOST_INTERFACE_SHIFT 5
218 /* The iscsi storm task context of Ystorm */
219 struct ystorm_iscsi_task_state
{
220 struct scsi_cached_sges data_desc
;
221 struct scsi_sgl_params sgl_params
;
223 __le32 buffer_offset
;
224 union iscsi_seq_num seq_num
;
225 struct iscsi_dif_flags dif_flags
;
227 #define YSTORM_ISCSI_TASK_STATE_LOCAL_COMP_MASK 0x1
228 #define YSTORM_ISCSI_TASK_STATE_LOCAL_COMP_SHIFT 0
229 #define YSTORM_ISCSI_TASK_STATE_SLOW_IO_MASK 0x1
230 #define YSTORM_ISCSI_TASK_STATE_SLOW_IO_SHIFT 1
231 #define YSTORM_ISCSI_TASK_STATE_SET_DIF_OFFSET_MASK 0x1
232 #define YSTORM_ISCSI_TASK_STATE_SET_DIF_OFFSET_SHIFT 2
233 #define YSTORM_ISCSI_TASK_STATE_RESERVED0_MASK 0x1F
234 #define YSTORM_ISCSI_TASK_STATE_RESERVED0_SHIFT 3
237 /* The iscsi storm task context of Ystorm */
238 struct ystorm_iscsi_task_rxmit_opt
{
239 __le32 fast_rxmit_sge_offset
;
240 __le32 scan_start_buffer_offset
;
241 __le32 fast_rxmit_buffer_offset
;
242 u8 scan_start_sgl_index
;
243 u8 fast_rxmit_sgl_index
;
247 /* iSCSI Common PDU header */
248 struct iscsi_common_hdr
{
253 #define ISCSI_COMMON_HDR_OPCODE_MASK 0x3F
254 #define ISCSI_COMMON_HDR_OPCODE_SHIFT 0
255 #define ISCSI_COMMON_HDR_IMM_MASK 0x1
256 #define ISCSI_COMMON_HDR_IMM_SHIFT 6
257 #define ISCSI_COMMON_HDR_RSRV_MASK 0x1
258 #define ISCSI_COMMON_HDR_RSRV_SHIFT 7
259 __le32 hdr_second_dword
;
260 #define ISCSI_COMMON_HDR_DATA_SEG_LEN_MASK 0xFFFFFF
261 #define ISCSI_COMMON_HDR_DATA_SEG_LEN_SHIFT 0
262 #define ISCSI_COMMON_HDR_TOTAL_AHS_LEN_MASK 0xFF
263 #define ISCSI_COMMON_HDR_TOTAL_AHS_LEN_SHIFT 24
264 struct regpair lun_reserved
;
268 __le32 exp_statcmd_sn
;
273 /* iSCSI Command PDU header */
274 struct iscsi_cmd_hdr
{
277 #define ISCSI_CMD_HDR_ATTR_MASK 0x7
278 #define ISCSI_CMD_HDR_ATTR_SHIFT 0
279 #define ISCSI_CMD_HDR_RSRV_MASK 0x3
280 #define ISCSI_CMD_HDR_RSRV_SHIFT 3
281 #define ISCSI_CMD_HDR_WRITE_MASK 0x1
282 #define ISCSI_CMD_HDR_WRITE_SHIFT 5
283 #define ISCSI_CMD_HDR_READ_MASK 0x1
284 #define ISCSI_CMD_HDR_READ_SHIFT 6
285 #define ISCSI_CMD_HDR_FINAL_MASK 0x1
286 #define ISCSI_CMD_HDR_FINAL_SHIFT 7
288 #define ISCSI_CMD_HDR_OPCODE_MASK 0x3F
289 #define ISCSI_CMD_HDR_OPCODE_SHIFT 0
290 #define ISCSI_CMD_HDR_IMM_MASK 0x1
291 #define ISCSI_CMD_HDR_IMM_SHIFT 6
292 #define ISCSI_CMD_HDR_RSRV1_MASK 0x1
293 #define ISCSI_CMD_HDR_RSRV1_SHIFT 7
294 __le32 hdr_second_dword
;
295 #define ISCSI_CMD_HDR_DATA_SEG_LEN_MASK 0xFFFFFF
296 #define ISCSI_CMD_HDR_DATA_SEG_LEN_SHIFT 0
297 #define ISCSI_CMD_HDR_TOTAL_AHS_LEN_MASK 0xFF
298 #define ISCSI_CMD_HDR_TOTAL_AHS_LEN_SHIFT 24
301 __le32 expected_transfer_length
;
307 /* iSCSI Command PDU header with Extended CDB (Initiator Mode) */
308 struct iscsi_ext_cdb_cmd_hdr
{
311 #define ISCSI_EXT_CDB_CMD_HDR_ATTR_MASK 0x7
312 #define ISCSI_EXT_CDB_CMD_HDR_ATTR_SHIFT 0
313 #define ISCSI_EXT_CDB_CMD_HDR_RSRV_MASK 0x3
314 #define ISCSI_EXT_CDB_CMD_HDR_RSRV_SHIFT 3
315 #define ISCSI_EXT_CDB_CMD_HDR_WRITE_MASK 0x1
316 #define ISCSI_EXT_CDB_CMD_HDR_WRITE_SHIFT 5
317 #define ISCSI_EXT_CDB_CMD_HDR_READ_MASK 0x1
318 #define ISCSI_EXT_CDB_CMD_HDR_READ_SHIFT 6
319 #define ISCSI_EXT_CDB_CMD_HDR_FINAL_MASK 0x1
320 #define ISCSI_EXT_CDB_CMD_HDR_FINAL_SHIFT 7
322 __le32 hdr_second_dword
;
323 #define ISCSI_EXT_CDB_CMD_HDR_DATA_SEG_LEN_MASK 0xFFFFFF
324 #define ISCSI_EXT_CDB_CMD_HDR_DATA_SEG_LEN_SHIFT 0
325 #define ISCSI_EXT_CDB_CMD_HDR_CDB_SIZE_MASK 0xFF
326 #define ISCSI_EXT_CDB_CMD_HDR_CDB_SIZE_SHIFT 24
329 __le32 expected_transfer_length
;
332 struct scsi_sge cdb_sge
;
335 /* iSCSI login request PDU header */
336 struct iscsi_login_req_hdr
{
340 #define ISCSI_LOGIN_REQ_HDR_NSG_MASK 0x3
341 #define ISCSI_LOGIN_REQ_HDR_NSG_SHIFT 0
342 #define ISCSI_LOGIN_REQ_HDR_CSG_MASK 0x3
343 #define ISCSI_LOGIN_REQ_HDR_CSG_SHIFT 2
344 #define ISCSI_LOGIN_REQ_HDR_RSRV_MASK 0x3
345 #define ISCSI_LOGIN_REQ_HDR_RSRV_SHIFT 4
346 #define ISCSI_LOGIN_REQ_HDR_C_MASK 0x1
347 #define ISCSI_LOGIN_REQ_HDR_C_SHIFT 6
348 #define ISCSI_LOGIN_REQ_HDR_T_MASK 0x1
349 #define ISCSI_LOGIN_REQ_HDR_T_SHIFT 7
351 __le32 hdr_second_dword
;
352 #define ISCSI_LOGIN_REQ_HDR_DATA_SEG_LEN_MASK 0xFFFFFF
353 #define ISCSI_LOGIN_REQ_HDR_DATA_SEG_LEN_SHIFT 0
354 #define ISCSI_LOGIN_REQ_HDR_TOTAL_AHS_LEN_MASK 0xFF
355 #define ISCSI_LOGIN_REQ_HDR_TOTAL_AHS_LEN_SHIFT 24
367 /* iSCSI logout request PDU header */
368 struct iscsi_logout_req_hdr
{
382 /* iSCSI Data-out PDU header */
383 struct iscsi_data_out_hdr
{
386 #define ISCSI_DATA_OUT_HDR_RSRV_MASK 0x7F
387 #define ISCSI_DATA_OUT_HDR_RSRV_SHIFT 0
388 #define ISCSI_DATA_OUT_HDR_FINAL_MASK 0x1
389 #define ISCSI_DATA_OUT_HDR_FINAL_SHIFT 7
399 __le32 buffer_offset
;
403 /* iSCSI Data-in PDU header */
404 struct iscsi_data_in_hdr
{
408 #define ISCSI_DATA_IN_HDR_STATUS_MASK 0x1
409 #define ISCSI_DATA_IN_HDR_STATUS_SHIFT 0
410 #define ISCSI_DATA_IN_HDR_UNDERFLOW_MASK 0x1
411 #define ISCSI_DATA_IN_HDR_UNDERFLOW_SHIFT 1
412 #define ISCSI_DATA_IN_HDR_OVERFLOW_MASK 0x1
413 #define ISCSI_DATA_IN_HDR_OVERFLOW_SHIFT 2
414 #define ISCSI_DATA_IN_HDR_RSRV_MASK 0x7
415 #define ISCSI_DATA_IN_HDR_RSRV_SHIFT 3
416 #define ISCSI_DATA_IN_HDR_ACK_MASK 0x1
417 #define ISCSI_DATA_IN_HDR_ACK_SHIFT 6
418 #define ISCSI_DATA_IN_HDR_FINAL_MASK 0x1
419 #define ISCSI_DATA_IN_HDR_FINAL_SHIFT 7
429 __le32 buffer_offset
;
430 __le32 residual_count
;
433 /* iSCSI R2T PDU header */
434 struct iscsi_r2t_hdr
{
445 __le32 buffer_offset
;
446 __le32 desired_data_trns_len
;
449 /* iSCSI NOP-out PDU header */
450 struct iscsi_nop_out_hdr
{
453 #define ISCSI_NOP_OUT_HDR_RSRV_MASK 0x7F
454 #define ISCSI_NOP_OUT_HDR_RSRV_SHIFT 0
455 #define ISCSI_NOP_OUT_HDR_CONST1_MASK 0x1
456 #define ISCSI_NOP_OUT_HDR_CONST1_SHIFT 7
470 /* iSCSI NOP-in PDU header */
471 struct iscsi_nop_in_hdr
{
474 #define ISCSI_NOP_IN_HDR_RSRV_MASK 0x7F
475 #define ISCSI_NOP_IN_HDR_RSRV_SHIFT 0
476 #define ISCSI_NOP_IN_HDR_CONST1_MASK 0x1
477 #define ISCSI_NOP_IN_HDR_CONST1_SHIFT 7
479 __le32 hdr_second_dword
;
480 #define ISCSI_NOP_IN_HDR_DATA_SEG_LEN_MASK 0xFFFFFF
481 #define ISCSI_NOP_IN_HDR_DATA_SEG_LEN_SHIFT 0
482 #define ISCSI_NOP_IN_HDR_TOTAL_AHS_LEN_MASK 0xFF
483 #define ISCSI_NOP_IN_HDR_TOTAL_AHS_LEN_SHIFT 24
495 /* iSCSI Login Response PDU header */
496 struct iscsi_login_response_hdr
{
500 #define ISCSI_LOGIN_RESPONSE_HDR_NSG_MASK 0x3
501 #define ISCSI_LOGIN_RESPONSE_HDR_NSG_SHIFT 0
502 #define ISCSI_LOGIN_RESPONSE_HDR_CSG_MASK 0x3
503 #define ISCSI_LOGIN_RESPONSE_HDR_CSG_SHIFT 2
504 #define ISCSI_LOGIN_RESPONSE_HDR_RSRV_MASK 0x3
505 #define ISCSI_LOGIN_RESPONSE_HDR_RSRV_SHIFT 4
506 #define ISCSI_LOGIN_RESPONSE_HDR_C_MASK 0x1
507 #define ISCSI_LOGIN_RESPONSE_HDR_C_SHIFT 6
508 #define ISCSI_LOGIN_RESPONSE_HDR_T_MASK 0x1
509 #define ISCSI_LOGIN_RESPONSE_HDR_T_SHIFT 7
511 __le32 hdr_second_dword
;
512 #define ISCSI_LOGIN_RESPONSE_HDR_DATA_SEG_LEN_MASK 0xFFFFFF
513 #define ISCSI_LOGIN_RESPONSE_HDR_DATA_SEG_LEN_SHIFT 0
514 #define ISCSI_LOGIN_RESPONSE_HDR_TOTAL_AHS_LEN_MASK 0xFF
515 #define ISCSI_LOGIN_RESPONSE_HDR_TOTAL_AHS_LEN_SHIFT 24
530 /* iSCSI Logout Response PDU header */
531 struct iscsi_logout_response_hdr
{
536 __le32 hdr_second_dword
;
537 #define ISCSI_LOGOUT_RESPONSE_HDR_DATA_SEG_LEN_MASK 0xFFFFFF
538 #define ISCSI_LOGOUT_RESPONSE_HDR_DATA_SEG_LEN_SHIFT 0
539 #define ISCSI_LOGOUT_RESPONSE_HDR_TOTAL_AHS_LEN_MASK 0xFF
540 #define ISCSI_LOGOUT_RESPONSE_HDR_TOTAL_AHS_LEN_SHIFT 24
548 __le16 time_2_retain
;
553 /* iSCSI Text Request PDU header */
554 struct iscsi_text_request_hdr
{
557 #define ISCSI_TEXT_REQUEST_HDR_RSRV_MASK 0x3F
558 #define ISCSI_TEXT_REQUEST_HDR_RSRV_SHIFT 0
559 #define ISCSI_TEXT_REQUEST_HDR_C_MASK 0x1
560 #define ISCSI_TEXT_REQUEST_HDR_C_SHIFT 6
561 #define ISCSI_TEXT_REQUEST_HDR_F_MASK 0x1
562 #define ISCSI_TEXT_REQUEST_HDR_F_SHIFT 7
564 __le32 hdr_second_dword
;
565 #define ISCSI_TEXT_REQUEST_HDR_DATA_SEG_LEN_MASK 0xFFFFFF
566 #define ISCSI_TEXT_REQUEST_HDR_DATA_SEG_LEN_SHIFT 0
567 #define ISCSI_TEXT_REQUEST_HDR_TOTAL_AHS_LEN_MASK 0xFF
568 #define ISCSI_TEXT_REQUEST_HDR_TOTAL_AHS_LEN_SHIFT 24
577 /* iSCSI Text Response PDU header */
578 struct iscsi_text_response_hdr
{
581 #define ISCSI_TEXT_RESPONSE_HDR_RSRV_MASK 0x3F
582 #define ISCSI_TEXT_RESPONSE_HDR_RSRV_SHIFT 0
583 #define ISCSI_TEXT_RESPONSE_HDR_C_MASK 0x1
584 #define ISCSI_TEXT_RESPONSE_HDR_C_SHIFT 6
585 #define ISCSI_TEXT_RESPONSE_HDR_F_MASK 0x1
586 #define ISCSI_TEXT_RESPONSE_HDR_F_SHIFT 7
588 __le32 hdr_second_dword
;
589 #define ISCSI_TEXT_RESPONSE_HDR_DATA_SEG_LEN_MASK 0xFFFFFF
590 #define ISCSI_TEXT_RESPONSE_HDR_DATA_SEG_LEN_SHIFT 0
591 #define ISCSI_TEXT_RESPONSE_HDR_TOTAL_AHS_LEN_MASK 0xFF
592 #define ISCSI_TEXT_RESPONSE_HDR_TOTAL_AHS_LEN_SHIFT 24
602 /* iSCSI TMF Request PDU header */
603 struct iscsi_tmf_request_hdr
{
607 __le32 hdr_second_dword
;
608 #define ISCSI_TMF_REQUEST_HDR_DATA_SEG_LEN_MASK 0xFFFFFF
609 #define ISCSI_TMF_REQUEST_HDR_DATA_SEG_LEN_SHIFT 0
610 #define ISCSI_TMF_REQUEST_HDR_TOTAL_AHS_LEN_MASK 0xFF
611 #define ISCSI_TMF_REQUEST_HDR_TOTAL_AHS_LEN_SHIFT 24
622 struct iscsi_tmf_response_hdr
{
627 __le32 hdr_second_dword
;
628 #define ISCSI_TMF_RESPONSE_HDR_DATA_SEG_LEN_MASK 0xFFFFFF
629 #define ISCSI_TMF_RESPONSE_HDR_DATA_SEG_LEN_SHIFT 0
630 #define ISCSI_TMF_RESPONSE_HDR_TOTAL_AHS_LEN_MASK 0xFF
631 #define ISCSI_TMF_RESPONSE_HDR_TOTAL_AHS_LEN_SHIFT 24
632 struct regpair reserved0
;
641 /* iSCSI Response PDU header */
642 struct iscsi_response_hdr
{
647 __le32 hdr_second_dword
;
648 #define ISCSI_RESPONSE_HDR_DATA_SEG_LEN_MASK 0xFFFFFF
649 #define ISCSI_RESPONSE_HDR_DATA_SEG_LEN_SHIFT 0
650 #define ISCSI_RESPONSE_HDR_TOTAL_AHS_LEN_MASK 0xFF
651 #define ISCSI_RESPONSE_HDR_TOTAL_AHS_LEN_SHIFT 24
659 __le32 bi_residual_count
;
660 __le32 residual_count
;
663 /* iSCSI Reject PDU header */
664 struct iscsi_reject_hdr
{
669 __le32 hdr_second_dword
;
670 #define ISCSI_REJECT_HDR_DATA_SEG_LEN_MASK 0xFFFFFF
671 #define ISCSI_REJECT_HDR_DATA_SEG_LEN_SHIFT 0
672 #define ISCSI_REJECT_HDR_TOTAL_AHS_LEN_MASK 0xFF
673 #define ISCSI_REJECT_HDR_TOTAL_AHS_LEN_SHIFT 24
674 struct regpair reserved0
;
684 /* iSCSI Asynchronous Message PDU header */
685 struct iscsi_async_msg_hdr
{
688 #define ISCSI_ASYNC_MSG_HDR_RSRV_MASK 0x7F
689 #define ISCSI_ASYNC_MSG_HDR_RSRV_SHIFT 0
690 #define ISCSI_ASYNC_MSG_HDR_CONST1_MASK 0x1
691 #define ISCSI_ASYNC_MSG_HDR_CONST1_SHIFT 7
693 __le32 hdr_second_dword
;
694 #define ISCSI_ASYNC_MSG_HDR_DATA_SEG_LEN_MASK 0xFFFFFF
695 #define ISCSI_ASYNC_MSG_HDR_DATA_SEG_LEN_SHIFT 0
696 #define ISCSI_ASYNC_MSG_HDR_TOTAL_AHS_LEN_MASK 0xFF
697 #define ISCSI_ASYNC_MSG_HDR_TOTAL_AHS_LEN_SHIFT 24
712 /* PDU header part of Ystorm task context */
713 union iscsi_task_hdr
{
714 struct iscsi_common_hdr common
;
715 struct data_hdr data
;
716 struct iscsi_cmd_hdr cmd
;
717 struct iscsi_ext_cdb_cmd_hdr ext_cdb_cmd
;
718 struct iscsi_login_req_hdr login_req
;
719 struct iscsi_logout_req_hdr logout_req
;
720 struct iscsi_data_out_hdr data_out
;
721 struct iscsi_data_in_hdr data_in
;
722 struct iscsi_r2t_hdr r2t
;
723 struct iscsi_nop_out_hdr nop_out
;
724 struct iscsi_nop_in_hdr nop_in
;
725 struct iscsi_login_response_hdr login_response
;
726 struct iscsi_logout_response_hdr logout_response
;
727 struct iscsi_text_request_hdr text_request
;
728 struct iscsi_text_response_hdr text_response
;
729 struct iscsi_tmf_request_hdr tmf_request
;
730 struct iscsi_tmf_response_hdr tmf_response
;
731 struct iscsi_response_hdr response
;
732 struct iscsi_reject_hdr reject
;
733 struct iscsi_async_msg_hdr async_msg
;
736 /* The iscsi storm task context of Ystorm */
737 struct ystorm_iscsi_task_st_ctx
{
738 struct ystorm_iscsi_task_state state
;
739 struct ystorm_iscsi_task_rxmit_opt rxmit_opt
;
740 union iscsi_task_hdr pdu_hdr
;
743 struct e4_ystorm_iscsi_task_ag_ctx
{
748 #define E4_YSTORM_ISCSI_TASK_AG_CTX_NIBBLE0_MASK 0xF
749 #define E4_YSTORM_ISCSI_TASK_AG_CTX_NIBBLE0_SHIFT 0
750 #define E4_YSTORM_ISCSI_TASK_AG_CTX_BIT0_MASK 0x1
751 #define E4_YSTORM_ISCSI_TASK_AG_CTX_BIT0_SHIFT 4
752 #define E4_YSTORM_ISCSI_TASK_AG_CTX_BIT1_MASK 0x1
753 #define E4_YSTORM_ISCSI_TASK_AG_CTX_BIT1_SHIFT 5
754 #define E4_YSTORM_ISCSI_TASK_AG_CTX_VALID_MASK 0x1
755 #define E4_YSTORM_ISCSI_TASK_AG_CTX_VALID_SHIFT 6
756 #define E4_YSTORM_ISCSI_TASK_AG_CTX_BIT3_MASK 0x1
757 #define E4_YSTORM_ISCSI_TASK_AG_CTX_BIT3_SHIFT 7
759 #define E4_YSTORM_ISCSI_TASK_AG_CTX_CF0_MASK 0x3
760 #define E4_YSTORM_ISCSI_TASK_AG_CTX_CF0_SHIFT 0
761 #define E4_YSTORM_ISCSI_TASK_AG_CTX_CF1_MASK 0x3
762 #define E4_YSTORM_ISCSI_TASK_AG_CTX_CF1_SHIFT 2
763 #define E4_YSTORM_ISCSI_TASK_AG_CTX_CF2SPECIAL_MASK 0x3
764 #define E4_YSTORM_ISCSI_TASK_AG_CTX_CF2SPECIAL_SHIFT 4
765 #define E4_YSTORM_ISCSI_TASK_AG_CTX_CF0EN_MASK 0x1
766 #define E4_YSTORM_ISCSI_TASK_AG_CTX_CF0EN_SHIFT 6
767 #define E4_YSTORM_ISCSI_TASK_AG_CTX_CF1EN_MASK 0x1
768 #define E4_YSTORM_ISCSI_TASK_AG_CTX_CF1EN_SHIFT 7
770 #define E4_YSTORM_ISCSI_TASK_AG_CTX_BIT4_MASK 0x1
771 #define E4_YSTORM_ISCSI_TASK_AG_CTX_BIT4_SHIFT 0
772 #define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE0EN_MASK 0x1
773 #define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE0EN_SHIFT 1
774 #define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE1EN_MASK 0x1
775 #define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE1EN_SHIFT 2
776 #define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE2EN_MASK 0x1
777 #define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE2EN_SHIFT 3
778 #define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE3EN_MASK 0x1
779 #define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE3EN_SHIFT 4
780 #define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE4EN_MASK 0x1
781 #define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE4EN_SHIFT 5
782 #define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE5EN_MASK 0x1
783 #define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE5EN_SHIFT 6
784 #define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE6EN_MASK 0x1
785 #define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE6EN_SHIFT 7
793 struct e4_mstorm_iscsi_task_ag_ctx
{
798 #define E4_MSTORM_ISCSI_TASK_AG_CTX_CONNECTION_TYPE_MASK 0xF
799 #define E4_MSTORM_ISCSI_TASK_AG_CTX_CONNECTION_TYPE_SHIFT 0
800 #define E4_MSTORM_ISCSI_TASK_AG_CTX_EXIST_IN_QM0_MASK 0x1
801 #define E4_MSTORM_ISCSI_TASK_AG_CTX_EXIST_IN_QM0_SHIFT 4
802 #define E4_MSTORM_ISCSI_TASK_AG_CTX_BIT1_MASK 0x1
803 #define E4_MSTORM_ISCSI_TASK_AG_CTX_BIT1_SHIFT 5
804 #define E4_MSTORM_ISCSI_TASK_AG_CTX_VALID_MASK 0x1
805 #define E4_MSTORM_ISCSI_TASK_AG_CTX_VALID_SHIFT 6
806 #define E4_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_FLAG_MASK 0x1
807 #define E4_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_FLAG_SHIFT 7
809 #define E4_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_CF_MASK 0x3
810 #define E4_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_CF_SHIFT 0
811 #define E4_MSTORM_ISCSI_TASK_AG_CTX_CF1_MASK 0x3
812 #define E4_MSTORM_ISCSI_TASK_AG_CTX_CF1_SHIFT 2
813 #define E4_MSTORM_ISCSI_TASK_AG_CTX_CF2_MASK 0x3
814 #define E4_MSTORM_ISCSI_TASK_AG_CTX_CF2_SHIFT 4
815 #define E4_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_CF_EN_MASK 0x1
816 #define E4_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_CF_EN_SHIFT 6
817 #define E4_MSTORM_ISCSI_TASK_AG_CTX_CF1EN_MASK 0x1
818 #define E4_MSTORM_ISCSI_TASK_AG_CTX_CF1EN_SHIFT 7
820 #define E4_MSTORM_ISCSI_TASK_AG_CTX_CF2EN_MASK 0x1
821 #define E4_MSTORM_ISCSI_TASK_AG_CTX_CF2EN_SHIFT 0
822 #define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE0EN_MASK 0x1
823 #define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE0EN_SHIFT 1
824 #define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE1EN_MASK 0x1
825 #define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE1EN_SHIFT 2
826 #define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE2EN_MASK 0x1
827 #define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE2EN_SHIFT 3
828 #define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE3EN_MASK 0x1
829 #define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE3EN_SHIFT 4
830 #define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE4EN_MASK 0x1
831 #define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE4EN_SHIFT 5
832 #define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE5EN_MASK 0x1
833 #define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE5EN_SHIFT 6
834 #define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE6EN_MASK 0x1
835 #define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE6EN_SHIFT 7
843 struct e4_ustorm_iscsi_task_ag_ctx
{
848 #define E4_USTORM_ISCSI_TASK_AG_CTX_CONNECTION_TYPE_MASK 0xF
849 #define E4_USTORM_ISCSI_TASK_AG_CTX_CONNECTION_TYPE_SHIFT 0
850 #define E4_USTORM_ISCSI_TASK_AG_CTX_EXIST_IN_QM0_MASK 0x1
851 #define E4_USTORM_ISCSI_TASK_AG_CTX_EXIST_IN_QM0_SHIFT 4
852 #define E4_USTORM_ISCSI_TASK_AG_CTX_BIT1_MASK 0x1
853 #define E4_USTORM_ISCSI_TASK_AG_CTX_BIT1_SHIFT 5
854 #define E4_USTORM_ISCSI_TASK_AG_CTX_HQ_SCANNED_CF_MASK 0x3
855 #define E4_USTORM_ISCSI_TASK_AG_CTX_HQ_SCANNED_CF_SHIFT 6
857 #define E4_USTORM_ISCSI_TASK_AG_CTX_RESERVED1_MASK 0x3
858 #define E4_USTORM_ISCSI_TASK_AG_CTX_RESERVED1_SHIFT 0
859 #define E4_USTORM_ISCSI_TASK_AG_CTX_R2T2RECV_MASK 0x3
860 #define E4_USTORM_ISCSI_TASK_AG_CTX_R2T2RECV_SHIFT 2
861 #define E4_USTORM_ISCSI_TASK_AG_CTX_CF3_MASK 0x3
862 #define E4_USTORM_ISCSI_TASK_AG_CTX_CF3_SHIFT 4
863 #define E4_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_CF_MASK 0x3
864 #define E4_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_CF_SHIFT 6
866 #define E4_USTORM_ISCSI_TASK_AG_CTX_HQ_SCANNED_CF_EN_MASK 0x1
867 #define E4_USTORM_ISCSI_TASK_AG_CTX_HQ_SCANNED_CF_EN_SHIFT 0
868 #define E4_USTORM_ISCSI_TASK_AG_CTX_DISABLE_DATA_ACKED_MASK 0x1
869 #define E4_USTORM_ISCSI_TASK_AG_CTX_DISABLE_DATA_ACKED_SHIFT 1
870 #define E4_USTORM_ISCSI_TASK_AG_CTX_R2T2RECV_EN_MASK 0x1
871 #define E4_USTORM_ISCSI_TASK_AG_CTX_R2T2RECV_EN_SHIFT 2
872 #define E4_USTORM_ISCSI_TASK_AG_CTX_CF3EN_MASK 0x1
873 #define E4_USTORM_ISCSI_TASK_AG_CTX_CF3EN_SHIFT 3
874 #define E4_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_CF_EN_MASK 0x1
875 #define E4_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_CF_EN_SHIFT 4
876 #define E4_USTORM_ISCSI_TASK_AG_CTX_CMP_DATA_TOTAL_EXP_EN_MASK 0x1
877 #define E4_USTORM_ISCSI_TASK_AG_CTX_CMP_DATA_TOTAL_EXP_EN_SHIFT 5
878 #define E4_USTORM_ISCSI_TASK_AG_CTX_RULE1EN_MASK 0x1
879 #define E4_USTORM_ISCSI_TASK_AG_CTX_RULE1EN_SHIFT 6
880 #define E4_USTORM_ISCSI_TASK_AG_CTX_CMP_CONT_RCV_EXP_EN_MASK 0x1
881 #define E4_USTORM_ISCSI_TASK_AG_CTX_CMP_CONT_RCV_EXP_EN_SHIFT 7
883 #define E4_USTORM_ISCSI_TASK_AG_CTX_RULE3EN_MASK 0x1
884 #define E4_USTORM_ISCSI_TASK_AG_CTX_RULE3EN_SHIFT 0
885 #define E4_USTORM_ISCSI_TASK_AG_CTX_RULE4EN_MASK 0x1
886 #define E4_USTORM_ISCSI_TASK_AG_CTX_RULE4EN_SHIFT 1
887 #define E4_USTORM_ISCSI_TASK_AG_CTX_RULE5EN_MASK 0x1
888 #define E4_USTORM_ISCSI_TASK_AG_CTX_RULE5EN_SHIFT 2
889 #define E4_USTORM_ISCSI_TASK_AG_CTX_RULE6EN_MASK 0x1
890 #define E4_USTORM_ISCSI_TASK_AG_CTX_RULE6EN_SHIFT 3
891 #define E4_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_TYPE_MASK 0xF
892 #define E4_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_TYPE_SHIFT 4
893 __le32 dif_err_intervals
;
894 __le32 dif_error_1st_interval
;
897 __le32 total_data_acked
;
898 __le32 exp_data_acked
;
904 __le32 hdr_residual_count
;
908 /* The iscsi storm task context of Mstorm */
909 struct mstorm_iscsi_task_st_ctx
{
910 struct scsi_cached_sges data_desc
;
911 struct scsi_sgl_params sgl_params
;
912 __le32 rem_task_size
;
913 __le32 data_buffer_offset
;
915 struct iscsi_dif_flags dif_flags
;
916 __le16 dif_task_icid
;
917 struct regpair sense_db
;
924 #define ISCSI_REG1_NUM_SGES_MASK 0xF
925 #define ISCSI_REG1_NUM_SGES_SHIFT 0
926 #define ISCSI_REG1_RESERVED1_MASK 0xFFFFFFF
927 #define ISCSI_REG1_RESERVED1_SHIFT 4
934 /* The iscsi storm task context of Ustorm */
935 struct ustorm_iscsi_task_st_ctx
{
937 __le32 exp_data_transfer_len
;
940 struct iscsi_reg1 reg1
;
942 #define USTORM_ISCSI_TASK_ST_CTX_AHS_EXIST_MASK 0x1
943 #define USTORM_ISCSI_TASK_ST_CTX_AHS_EXIST_SHIFT 0
944 #define USTORM_ISCSI_TASK_ST_CTX_RESERVED1_MASK 0x7F
945 #define USTORM_ISCSI_TASK_ST_CTX_RESERVED1_SHIFT 1
946 struct iscsi_dif_flags dif_flags
;
948 struct tqe_opaque tqe_opaque_list
;
954 #define USTORM_ISCSI_TASK_ST_CTX_DATA_DIGEST_ERROR_MASK 0x1
955 #define USTORM_ISCSI_TASK_ST_CTX_DATA_DIGEST_ERROR_SHIFT 0
956 #define USTORM_ISCSI_TASK_ST_CTX_DATA_TRUNCATED_ERROR_MASK 0x1
957 #define USTORM_ISCSI_TASK_ST_CTX_DATA_TRUNCATED_ERROR_SHIFT 1
958 #define USTORM_ISCSI_TASK_ST_CTX_UNDER_RUN_ERROR_MASK 0x1
959 #define USTORM_ISCSI_TASK_ST_CTX_UNDER_RUN_ERROR_SHIFT 2
960 #define USTORM_ISCSI_TASK_ST_CTX_RESERVED8_MASK 0x1F
961 #define USTORM_ISCSI_TASK_ST_CTX_RESERVED8_SHIFT 3
963 #define USTORM_ISCSI_TASK_ST_CTX_CQE_WRITE_MASK 0x3
964 #define USTORM_ISCSI_TASK_ST_CTX_CQE_WRITE_SHIFT 0
965 #define USTORM_ISCSI_TASK_ST_CTX_LOCAL_COMP_MASK 0x1
966 #define USTORM_ISCSI_TASK_ST_CTX_LOCAL_COMP_SHIFT 2
967 #define USTORM_ISCSI_TASK_ST_CTX_Q0_R2TQE_WRITE_MASK 0x1
968 #define USTORM_ISCSI_TASK_ST_CTX_Q0_R2TQE_WRITE_SHIFT 3
969 #define USTORM_ISCSI_TASK_ST_CTX_TOTAL_DATA_ACKED_DONE_MASK 0x1
970 #define USTORM_ISCSI_TASK_ST_CTX_TOTAL_DATA_ACKED_DONE_SHIFT 4
971 #define USTORM_ISCSI_TASK_ST_CTX_HQ_SCANNED_DONE_MASK 0x1
972 #define USTORM_ISCSI_TASK_ST_CTX_HQ_SCANNED_DONE_SHIFT 5
973 #define USTORM_ISCSI_TASK_ST_CTX_R2T2RECV_DONE_MASK 0x1
974 #define USTORM_ISCSI_TASK_ST_CTX_R2T2RECV_DONE_SHIFT 6
975 #define USTORM_ISCSI_TASK_ST_CTX_RESERVED0_MASK 0x1
976 #define USTORM_ISCSI_TASK_ST_CTX_RESERVED0_SHIFT 7
980 /* iscsi task context */
981 struct e4_iscsi_task_context
{
982 struct ystorm_iscsi_task_st_ctx ystorm_st_context
;
983 struct e4_ystorm_iscsi_task_ag_ctx ystorm_ag_context
;
984 struct regpair ystorm_ag_padding
[2];
985 struct tdif_task_context tdif_context
;
986 struct e4_mstorm_iscsi_task_ag_ctx mstorm_ag_context
;
987 struct regpair mstorm_ag_padding
[2];
988 struct e4_ustorm_iscsi_task_ag_ctx ustorm_ag_context
;
989 struct mstorm_iscsi_task_st_ctx mstorm_st_context
;
990 struct ustorm_iscsi_task_st_ctx ustorm_st_context
;
991 struct rdif_task_context rdif_context
;
994 /* iSCSI connection offload params passed by driver to FW in ISCSI offload
997 struct iscsi_conn_offload_params
{
998 struct regpair sq_pbl_addr
;
999 struct regpair r2tq_pbl_addr
;
1000 struct regpair xhq_pbl_addr
;
1001 struct regpair uhq_pbl_addr
;
1006 #define ISCSI_CONN_OFFLOAD_PARAMS_TCP_ON_CHIP_1B_MASK 0x1
1007 #define ISCSI_CONN_OFFLOAD_PARAMS_TCP_ON_CHIP_1B_SHIFT 0
1008 #define ISCSI_CONN_OFFLOAD_PARAMS_TARGET_MODE_MASK 0x1
1009 #define ISCSI_CONN_OFFLOAD_PARAMS_TARGET_MODE_SHIFT 1
1010 #define ISCSI_CONN_OFFLOAD_PARAMS_RESTRICTED_MODE_MASK 0x1
1011 #define ISCSI_CONN_OFFLOAD_PARAMS_RESTRICTED_MODE_SHIFT 2
1012 #define ISCSI_CONN_OFFLOAD_PARAMS_RESERVED1_MASK 0x1F
1013 #define ISCSI_CONN_OFFLOAD_PARAMS_RESERVED1_SHIFT 3
1014 u8 pbl_page_size_log
;
1015 u8 pbe_page_size_log
;
1020 /* iSCSI connection statistics */
1021 struct iscsi_conn_stats_params
{
1022 struct regpair iscsi_tcp_tx_packets_cnt
;
1023 struct regpair iscsi_tcp_tx_bytes_cnt
;
1024 struct regpair iscsi_tcp_tx_rxmit_cnt
;
1025 struct regpair iscsi_tcp_rx_packets_cnt
;
1026 struct regpair iscsi_tcp_rx_bytes_cnt
;
1027 struct regpair iscsi_tcp_rx_dup_ack_cnt
;
1028 __le32 iscsi_tcp_rx_chksum_err_cnt
;
1032 /* spe message header */
1033 struct iscsi_slow_path_hdr
{
1036 #define ISCSI_SLOW_PATH_HDR_RESERVED0_MASK 0xF
1037 #define ISCSI_SLOW_PATH_HDR_RESERVED0_SHIFT 0
1038 #define ISCSI_SLOW_PATH_HDR_LAYER_CODE_MASK 0x7
1039 #define ISCSI_SLOW_PATH_HDR_LAYER_CODE_SHIFT 4
1040 #define ISCSI_SLOW_PATH_HDR_RESERVED1_MASK 0x1
1041 #define ISCSI_SLOW_PATH_HDR_RESERVED1_SHIFT 7
1044 /* iSCSI connection update params passed by driver to FW in ISCSI update
1047 struct iscsi_conn_update_ramrod_params
{
1048 struct iscsi_slow_path_hdr hdr
;
1052 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_HD_EN_MASK 0x1
1053 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_HD_EN_SHIFT 0
1054 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DD_EN_MASK 0x1
1055 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DD_EN_SHIFT 1
1056 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_INITIAL_R2T_MASK 0x1
1057 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_INITIAL_R2T_SHIFT 2
1058 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_IMMEDIATE_DATA_MASK 0x1
1059 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_IMMEDIATE_DATA_SHIFT 3
1060 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DIF_BLOCK_SIZE_MASK 0x1
1061 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DIF_BLOCK_SIZE_SHIFT 4
1062 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DIF_ON_HOST_EN_MASK 0x1
1063 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DIF_ON_HOST_EN_SHIFT 5
1064 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DIF_ON_IMM_EN_MASK 0x1
1065 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DIF_ON_IMM_EN_SHIFT 6
1066 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_LUN_MAPPER_EN_MASK 0x1
1067 #define ISCSI_CONN_UPDATE_RAMROD_PARAMS_LUN_MAPPER_EN_SHIFT 7
1069 __le32 max_seq_size
;
1070 __le32 max_send_pdu_length
;
1071 __le32 max_recv_pdu_length
;
1072 __le32 first_seq_length
;
1074 union dif_configuration_params dif_on_imme_params
;
1077 /* iSCSI CQ element */
1078 struct iscsi_cqe_common
{
1081 union cqe_error_status error_bitmap
;
1083 union iscsi_task_hdr iscsi_hdr
;
1086 /* iSCSI CQ element */
1087 struct iscsi_cqe_solicited
{
1090 union cqe_error_status error_bitmap
;
1096 __le32 data_truncated_bytes
;
1097 union iscsi_task_hdr iscsi_hdr
;
1100 /* iSCSI CQ element */
1101 struct iscsi_cqe_unsolicited
{
1104 union cqe_error_status error_bitmap
;
1109 __le16 reserved2
[3];
1110 union iscsi_task_hdr iscsi_hdr
;
1113 /* iSCSI CQ element */
1115 struct iscsi_cqe_common cqe_common
;
1116 struct iscsi_cqe_solicited cqe_solicited
;
1117 struct iscsi_cqe_unsolicited cqe_unsolicited
;
1120 /* iSCSI CQE type */
1121 enum iscsi_cqes_type
{
1122 ISCSI_CQE_TYPE_SOLICITED
= 1,
1123 ISCSI_CQE_TYPE_UNSOLICITED
,
1124 ISCSI_CQE_TYPE_SOLICITED_WITH_SENSE
,
1125 ISCSI_CQE_TYPE_TASK_CLEANUP
,
1126 ISCSI_CQE_TYPE_DUMMY
,
1130 /* iSCSI CQE type */
1131 enum iscsi_cqe_unsolicited_type
{
1132 ISCSI_CQE_UNSOLICITED_NONE
,
1133 ISCSI_CQE_UNSOLICITED_SINGLE
,
1134 ISCSI_CQE_UNSOLICITED_FIRST
,
1135 ISCSI_CQE_UNSOLICITED_MIDDLE
,
1136 ISCSI_CQE_UNSOLICITED_LAST
,
1137 MAX_ISCSI_CQE_UNSOLICITED_TYPE
1140 /* iscsi debug modes */
1141 struct iscsi_debug_modes
{
1143 #define ISCSI_DEBUG_MODES_ASSERT_IF_RX_CONN_ERROR_MASK 0x1
1144 #define ISCSI_DEBUG_MODES_ASSERT_IF_RX_CONN_ERROR_SHIFT 0
1145 #define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_RESET_MASK 0x1
1146 #define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_RESET_SHIFT 1
1147 #define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_FIN_MASK 0x1
1148 #define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_FIN_SHIFT 2
1149 #define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_CLEANUP_MASK 0x1
1150 #define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_CLEANUP_SHIFT 3
1151 #define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_REJECT_OR_ASYNC_MASK 0x1
1152 #define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_REJECT_OR_ASYNC_SHIFT 4
1153 #define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_NOP_MASK 0x1
1154 #define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_NOP_SHIFT 5
1155 #define ISCSI_DEBUG_MODES_ASSERT_IF_DIF_OR_DATA_DIGEST_ERROR_MASK 0x1
1156 #define ISCSI_DEBUG_MODES_ASSERT_IF_DIF_OR_DATA_DIGEST_ERROR_SHIFT 6
1157 #define ISCSI_DEBUG_MODES_ASSERT_IF_HQ_CORRUPT_MASK 0x1
1158 #define ISCSI_DEBUG_MODES_ASSERT_IF_HQ_CORRUPT_SHIFT 7
1161 /* iSCSI kernel completion queue IDs */
1162 enum iscsi_eqe_opcode
{
1163 ISCSI_EVENT_TYPE_INIT_FUNC
= 0,
1164 ISCSI_EVENT_TYPE_DESTROY_FUNC
,
1165 ISCSI_EVENT_TYPE_OFFLOAD_CONN
,
1166 ISCSI_EVENT_TYPE_UPDATE_CONN
,
1167 ISCSI_EVENT_TYPE_CLEAR_SQ
,
1168 ISCSI_EVENT_TYPE_TERMINATE_CONN
,
1169 ISCSI_EVENT_TYPE_MAC_UPDATE_CONN
,
1170 ISCSI_EVENT_TYPE_COLLECT_STATS_CONN
,
1171 ISCSI_EVENT_TYPE_ASYN_CONNECT_COMPLETE
,
1172 ISCSI_EVENT_TYPE_ASYN_TERMINATE_DONE
,
1173 ISCSI_EVENT_TYPE_START_OF_ERROR_TYPES
= 10,
1174 ISCSI_EVENT_TYPE_ASYN_ABORT_RCVD
,
1175 ISCSI_EVENT_TYPE_ASYN_CLOSE_RCVD
,
1176 ISCSI_EVENT_TYPE_ASYN_SYN_RCVD
,
1177 ISCSI_EVENT_TYPE_ASYN_MAX_RT_TIME
,
1178 ISCSI_EVENT_TYPE_ASYN_MAX_RT_CNT
,
1179 ISCSI_EVENT_TYPE_ASYN_MAX_KA_PROBES_CNT
,
1180 ISCSI_EVENT_TYPE_ASYN_FIN_WAIT2
,
1181 ISCSI_EVENT_TYPE_ISCSI_CONN_ERROR
,
1182 ISCSI_EVENT_TYPE_TCP_CONN_ERROR
,
1183 MAX_ISCSI_EQE_OPCODE
1186 /* iSCSI EQE and CQE completion status */
1187 enum iscsi_error_types
{
1188 ISCSI_STATUS_NONE
= 0,
1189 ISCSI_CQE_ERROR_UNSOLICITED_RCV_ON_INVALID_CONN
= 1,
1190 ISCSI_CONN_ERROR_TASK_CID_MISMATCH
,
1191 ISCSI_CONN_ERROR_TASK_NOT_VALID
,
1192 ISCSI_CONN_ERROR_RQ_RING_IS_FULL
,
1193 ISCSI_CONN_ERROR_CMDQ_RING_IS_FULL
,
1194 ISCSI_CONN_ERROR_HQE_CACHING_FAILED
,
1195 ISCSI_CONN_ERROR_HEADER_DIGEST_ERROR
,
1196 ISCSI_CONN_ERROR_LOCAL_COMPLETION_ERROR
,
1197 ISCSI_CONN_ERROR_DATA_OVERRUN
,
1198 ISCSI_CONN_ERROR_OUT_OF_SGES_ERROR
,
1199 ISCSI_CONN_ERROR_IP_OPTIONS_ERROR
,
1200 ISCSI_CONN_ERROR_PRS_ERRORS
,
1201 ISCSI_CONN_ERROR_CONNECT_INVALID_TCP_OPTION
,
1202 ISCSI_CONN_ERROR_TCP_IP_FRAGMENT_ERROR
,
1203 ISCSI_CONN_ERROR_PROTOCOL_ERR_AHS_LEN
,
1204 ISCSI_CONN_ERROR_PROTOCOL_ERR_AHS_TYPE
,
1205 ISCSI_CONN_ERROR_PROTOCOL_ERR_ITT_OUT_OF_RANGE
,
1206 ISCSI_CONN_ERROR_PROTOCOL_ERR_TTT_OUT_OF_RANGE
,
1207 ISCSI_CONN_ERROR_PROTOCOL_ERR_DATA_SEG_LEN_EXCEEDS_PDU_SIZE
,
1208 ISCSI_CONN_ERROR_PROTOCOL_ERR_INVALID_OPCODE
,
1209 ISCSI_CONN_ERROR_PROTOCOL_ERR_INVALID_OPCODE_BEFORE_UPDATE
,
1210 ISCSI_CONN_ERROR_UNVALID_NOPIN_DSL
,
1211 ISCSI_CONN_ERROR_PROTOCOL_ERR_R2T_CARRIES_NO_DATA
,
1212 ISCSI_CONN_ERROR_PROTOCOL_ERR_DATA_SN
,
1213 ISCSI_CONN_ERROR_PROTOCOL_ERR_DATA_IN_TTT
,
1214 ISCSI_CONN_ERROR_PROTOCOL_ERR_DATA_OUT_ITT
,
1215 ISCSI_CONN_ERROR_PROTOCOL_ERR_R2T_TTT
,
1216 ISCSI_CONN_ERROR_PROTOCOL_ERR_R2T_BUFFER_OFFSET
,
1217 ISCSI_CONN_ERROR_PROTOCOL_ERR_BUFFER_OFFSET_OOO
,
1218 ISCSI_CONN_ERROR_PROTOCOL_ERR_R2T_SN
,
1219 ISCSI_CONN_ERROR_PROTOCOL_ERR_DESIRED_DATA_TRNS_LEN_0
,
1220 ISCSI_CONN_ERROR_PROTOCOL_ERR_DESIRED_DATA_TRNS_LEN_1
,
1221 ISCSI_CONN_ERROR_PROTOCOL_ERR_DESIRED_DATA_TRNS_LEN_2
,
1222 ISCSI_CONN_ERROR_PROTOCOL_ERR_LUN
,
1223 ISCSI_CONN_ERROR_PROTOCOL_ERR_F_BIT_ZERO
,
1224 ISCSI_CONN_ERROR_PROTOCOL_ERR_F_BIT_ZERO_S_BIT_ONE
,
1225 ISCSI_CONN_ERROR_PROTOCOL_ERR_EXP_STAT_SN
,
1226 ISCSI_CONN_ERROR_PROTOCOL_ERR_DSL_NOT_ZERO
,
1227 ISCSI_CONN_ERROR_PROTOCOL_ERR_INVALID_DSL
,
1228 ISCSI_CONN_ERROR_PROTOCOL_ERR_DATA_SEG_LEN_TOO_BIG
,
1229 ISCSI_CONN_ERROR_PROTOCOL_ERR_OUTSTANDING_R2T_COUNT
,
1230 ISCSI_CONN_ERROR_PROTOCOL_ERR_DIF_TX
,
1231 ISCSI_CONN_ERROR_SENSE_DATA_LENGTH
,
1232 ISCSI_CONN_ERROR_DATA_PLACEMENT_ERROR
,
1233 ISCSI_CONN_ERROR_INVALID_ITT
,
1234 ISCSI_ERROR_UNKNOWN
,
1235 MAX_ISCSI_ERROR_TYPES
1238 /* iSCSI Ramrod Command IDs */
1239 enum iscsi_ramrod_cmd_id
{
1240 ISCSI_RAMROD_CMD_ID_UNUSED
= 0,
1241 ISCSI_RAMROD_CMD_ID_INIT_FUNC
= 1,
1242 ISCSI_RAMROD_CMD_ID_DESTROY_FUNC
= 2,
1243 ISCSI_RAMROD_CMD_ID_OFFLOAD_CONN
= 3,
1244 ISCSI_RAMROD_CMD_ID_UPDATE_CONN
= 4,
1245 ISCSI_RAMROD_CMD_ID_TERMINATION_CONN
= 5,
1246 ISCSI_RAMROD_CMD_ID_CLEAR_SQ
= 6,
1247 ISCSI_RAMROD_CMD_ID_MAC_UPDATE
= 7,
1248 ISCSI_RAMROD_CMD_ID_CONN_STATS
= 8,
1249 MAX_ISCSI_RAMROD_CMD_ID
1252 /* iSCSI connection termination request */
1253 struct iscsi_spe_conn_mac_update
{
1254 struct iscsi_slow_path_hdr hdr
;
1257 __le16 remote_mac_addr_lo
;
1258 __le16 remote_mac_addr_mid
;
1259 __le16 remote_mac_addr_hi
;
1263 /* iSCSI and TCP connection (Option 1) offload params passed by driver to FW in
1264 * iSCSI offload ramrod.
1266 struct iscsi_spe_conn_offload
{
1267 struct iscsi_slow_path_hdr hdr
;
1270 struct iscsi_conn_offload_params iscsi
;
1271 struct tcp_offload_params tcp
;
1274 /* iSCSI and TCP connection(Option 2) offload params passed by driver to FW in
1275 * iSCSI offload ramrod.
1277 struct iscsi_spe_conn_offload_option2
{
1278 struct iscsi_slow_path_hdr hdr
;
1281 struct iscsi_conn_offload_params iscsi
;
1282 struct tcp_offload_params_opt2 tcp
;
1285 /* iSCSI collect connection statistics request */
1286 struct iscsi_spe_conn_statistics
{
1287 struct iscsi_slow_path_hdr hdr
;
1292 struct regpair stats_cnts_addr
;
1295 /* iSCSI connection termination request */
1296 struct iscsi_spe_conn_termination
{
1297 struct iscsi_slow_path_hdr hdr
;
1302 struct regpair queue_cnts_addr
;
1303 struct regpair query_params_addr
;
1306 /* iSCSI firmware function destroy parameters */
1307 struct iscsi_spe_func_dstry
{
1308 struct iscsi_slow_path_hdr hdr
;
1313 /* iSCSI firmware function init parameters */
1314 struct iscsi_spe_func_init
{
1315 struct iscsi_slow_path_hdr hdr
;
1316 __le16 half_way_close_timeout
;
1317 u8 num_sq_pages_in_ring
;
1318 u8 num_r2tq_pages_in_ring
;
1319 u8 num_uhq_pages_in_ring
;
1322 #define ISCSI_SPE_FUNC_INIT_COUNTERS_EN_MASK 0x1
1323 #define ISCSI_SPE_FUNC_INIT_COUNTERS_EN_SHIFT 0
1324 #define ISCSI_SPE_FUNC_INIT_RESERVED0_MASK 0x7F
1325 #define ISCSI_SPE_FUNC_INIT_RESERVED0_SHIFT 1
1326 struct iscsi_debug_modes debug_mode
;
1329 struct scsi_init_func_params func_params
;
1330 struct scsi_init_func_queues q_params
;
1333 /* iSCSI task type */
1334 enum iscsi_task_type
{
1335 ISCSI_TASK_TYPE_INITIATOR_WRITE
,
1336 ISCSI_TASK_TYPE_INITIATOR_READ
,
1337 ISCSI_TASK_TYPE_MIDPATH
,
1338 ISCSI_TASK_TYPE_UNSOLIC
,
1339 ISCSI_TASK_TYPE_EXCHCLEANUP
,
1340 ISCSI_TASK_TYPE_IRRELEVANT
,
1341 ISCSI_TASK_TYPE_TARGET_WRITE
,
1342 ISCSI_TASK_TYPE_TARGET_READ
,
1343 ISCSI_TASK_TYPE_TARGET_RESPONSE
,
1344 ISCSI_TASK_TYPE_LOGIN_RESPONSE
,
1345 ISCSI_TASK_TYPE_TARGET_IMM_W_DIF
,
1349 /* iSCSI DesiredDataTransferLength/ttt union */
1350 union iscsi_ttt_txlen_union
{
1351 __le32 desired_tx_len
;
1355 /* iSCSI uHQ element */
1358 #define ISCSI_UHQE_PDU_PAYLOAD_LEN_MASK 0xFFFFF
1359 #define ISCSI_UHQE_PDU_PAYLOAD_LEN_SHIFT 0
1360 #define ISCSI_UHQE_LOCAL_COMP_MASK 0x1
1361 #define ISCSI_UHQE_LOCAL_COMP_SHIFT 20
1362 #define ISCSI_UHQE_TOGGLE_BIT_MASK 0x1
1363 #define ISCSI_UHQE_TOGGLE_BIT_SHIFT 21
1364 #define ISCSI_UHQE_PURE_PAYLOAD_MASK 0x1
1365 #define ISCSI_UHQE_PURE_PAYLOAD_SHIFT 22
1366 #define ISCSI_UHQE_LOGIN_RESPONSE_PDU_MASK 0x1
1367 #define ISCSI_UHQE_LOGIN_RESPONSE_PDU_SHIFT 23
1368 #define ISCSI_UHQE_TASK_ID_HI_MASK 0xFF
1369 #define ISCSI_UHQE_TASK_ID_HI_SHIFT 24
1371 #define ISCSI_UHQE_BUFFER_OFFSET_MASK 0xFFFFFF
1372 #define ISCSI_UHQE_BUFFER_OFFSET_SHIFT 0
1373 #define ISCSI_UHQE_TASK_ID_LO_MASK 0xFF
1374 #define ISCSI_UHQE_TASK_ID_LO_SHIFT 24
1377 /* iSCSI WQ element */
1381 #define ISCSI_WQE_WQE_TYPE_MASK 0x7
1382 #define ISCSI_WQE_WQE_TYPE_SHIFT 0
1383 #define ISCSI_WQE_NUM_SGES_MASK 0xF
1384 #define ISCSI_WQE_NUM_SGES_SHIFT 3
1385 #define ISCSI_WQE_RESPONSE_MASK 0x1
1386 #define ISCSI_WQE_RESPONSE_SHIFT 7
1387 struct iscsi_dif_flags prot_flags
;
1388 __le32 contlen_cdbsize
;
1389 #define ISCSI_WQE_CONT_LEN_MASK 0xFFFFFF
1390 #define ISCSI_WQE_CONT_LEN_SHIFT 0
1391 #define ISCSI_WQE_CDB_SIZE_MASK 0xFF
1392 #define ISCSI_WQE_CDB_SIZE_SHIFT 24
1395 /* iSCSI wqe type */
1396 enum iscsi_wqe_type
{
1397 ISCSI_WQE_TYPE_NORMAL
,
1398 ISCSI_WQE_TYPE_TASK_CLEANUP
,
1399 ISCSI_WQE_TYPE_MIDDLE_PATH
,
1400 ISCSI_WQE_TYPE_LOGIN
,
1401 ISCSI_WQE_TYPE_FIRST_R2T_CONT
,
1402 ISCSI_WQE_TYPE_NONFIRST_R2T_CONT
,
1403 ISCSI_WQE_TYPE_RESPONSE
,
1407 /* iSCSI xHQ element */
1409 union iscsi_ttt_txlen_union ttt_or_txlen
;
1411 struct iscsi_dif_flags prot_flags
;
1412 u8 total_ahs_length
;
1415 #define ISCSI_XHQE_FINAL_MASK 0x1
1416 #define ISCSI_XHQE_FINAL_SHIFT 0
1417 #define ISCSI_XHQE_STATUS_BIT_MASK 0x1
1418 #define ISCSI_XHQE_STATUS_BIT_SHIFT 1
1419 #define ISCSI_XHQE_NUM_SGES_MASK 0xF
1420 #define ISCSI_XHQE_NUM_SGES_SHIFT 2
1421 #define ISCSI_XHQE_RESERVED0_MASK 0x3
1422 #define ISCSI_XHQE_RESERVED0_SHIFT 6
1423 union iscsi_seq_num seq_num
;
1427 /* Per PF iSCSI receive path statistics - mStorm RAM structure */
1428 struct mstorm_iscsi_stats_drv
{
1429 struct regpair iscsi_rx_dropped_pdus_task_not_valid
;
1430 struct regpair iscsi_rx_dup_ack_cnt
;
1433 /* Per PF iSCSI transmit path statistics - pStorm RAM structure */
1434 struct pstorm_iscsi_stats_drv
{
1435 struct regpair iscsi_tx_bytes_cnt
;
1436 struct regpair iscsi_tx_packet_cnt
;
1439 /* Per PF iSCSI receive path statistics - tStorm RAM structure */
1440 struct tstorm_iscsi_stats_drv
{
1441 struct regpair iscsi_rx_bytes_cnt
;
1442 struct regpair iscsi_rx_packet_cnt
;
1443 struct regpair iscsi_rx_new_ooo_isle_events_cnt
;
1444 struct regpair iscsi_rx_tcp_payload_bytes_cnt
;
1445 struct regpair iscsi_rx_tcp_pkt_cnt
;
1446 struct regpair iscsi_rx_pure_ack_cnt
;
1447 __le32 iscsi_cmdq_threshold_cnt
;
1448 __le32 iscsi_rq_threshold_cnt
;
1449 __le32 iscsi_immq_threshold_cnt
;
1452 /* Per PF iSCSI receive path statistics - uStorm RAM structure */
1453 struct ustorm_iscsi_stats_drv
{
1454 struct regpair iscsi_rx_data_pdu_cnt
;
1455 struct regpair iscsi_rx_r2t_pdu_cnt
;
1456 struct regpair iscsi_rx_total_pdu_cnt
;
1459 /* Per PF iSCSI transmit path statistics - xStorm RAM structure */
1460 struct xstorm_iscsi_stats_drv
{
1461 struct regpair iscsi_tx_go_to_slow_start_event_cnt
;
1462 struct regpair iscsi_tx_fast_retransmit_event_cnt
;
1463 struct regpair iscsi_tx_pure_ack_cnt
;
1464 struct regpair iscsi_tx_delayed_ack_cnt
;
1467 /* Per PF iSCSI transmit path statistics - yStorm RAM structure */
1468 struct ystorm_iscsi_stats_drv
{
1469 struct regpair iscsi_tx_data_pdu_cnt
;
1470 struct regpair iscsi_tx_r2t_pdu_cnt
;
1471 struct regpair iscsi_tx_total_pdu_cnt
;
1472 struct regpair iscsi_tx_tcp_payload_bytes_cnt
;
1473 struct regpair iscsi_tx_tcp_pkt_cnt
;
1476 struct e4_tstorm_iscsi_task_ag_ctx
{
1481 #define E4_TSTORM_ISCSI_TASK_AG_CTX_NIBBLE0_MASK 0xF
1482 #define E4_TSTORM_ISCSI_TASK_AG_CTX_NIBBLE0_SHIFT 0
1483 #define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT0_MASK 0x1
1484 #define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT0_SHIFT 4
1485 #define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT1_MASK 0x1
1486 #define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT1_SHIFT 5
1487 #define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT2_MASK 0x1
1488 #define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT2_SHIFT 6
1489 #define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT3_MASK 0x1
1490 #define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT3_SHIFT 7
1492 #define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT4_MASK 0x1
1493 #define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT4_SHIFT 0
1494 #define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT5_MASK 0x1
1495 #define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT5_SHIFT 1
1496 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF0_MASK 0x3
1497 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF0_SHIFT 2
1498 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF1_MASK 0x3
1499 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF1_SHIFT 4
1500 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF2_MASK 0x3
1501 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF2_SHIFT 6
1503 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF3_MASK 0x3
1504 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF3_SHIFT 0
1505 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF4_MASK 0x3
1506 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF4_SHIFT 2
1507 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF5_MASK 0x3
1508 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF5_SHIFT 4
1509 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF6_MASK 0x3
1510 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF6_SHIFT 6
1512 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF7_MASK 0x3
1513 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF7_SHIFT 0
1514 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF0EN_MASK 0x1
1515 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF0EN_SHIFT 2
1516 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF1EN_MASK 0x1
1517 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF1EN_SHIFT 3
1518 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF2EN_MASK 0x1
1519 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF2EN_SHIFT 4
1520 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF3EN_MASK 0x1
1521 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF3EN_SHIFT 5
1522 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF4EN_MASK 0x1
1523 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF4EN_SHIFT 6
1524 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF5EN_MASK 0x1
1525 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF5EN_SHIFT 7
1527 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF6EN_MASK 0x1
1528 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF6EN_SHIFT 0
1529 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF7EN_MASK 0x1
1530 #define E4_TSTORM_ISCSI_TASK_AG_CTX_CF7EN_SHIFT 1
1531 #define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE0EN_MASK 0x1
1532 #define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE0EN_SHIFT 2
1533 #define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE1EN_MASK 0x1
1534 #define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE1EN_SHIFT 3
1535 #define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE2EN_MASK 0x1
1536 #define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE2EN_SHIFT 4
1537 #define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE3EN_MASK 0x1
1538 #define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE3EN_SHIFT 5
1539 #define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE4EN_MASK 0x1
1540 #define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE4EN_SHIFT 6
1541 #define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE5EN_MASK 0x1
1542 #define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE5EN_SHIFT 7
1555 /* iSCSI doorbell data */
1556 struct iscsi_db_data
{
1558 #define ISCSI_DB_DATA_DEST_MASK 0x3
1559 #define ISCSI_DB_DATA_DEST_SHIFT 0
1560 #define ISCSI_DB_DATA_AGG_CMD_MASK 0x3
1561 #define ISCSI_DB_DATA_AGG_CMD_SHIFT 2
1562 #define ISCSI_DB_DATA_BYPASS_EN_MASK 0x1
1563 #define ISCSI_DB_DATA_BYPASS_EN_SHIFT 4
1564 #define ISCSI_DB_DATA_RESERVED_MASK 0x1
1565 #define ISCSI_DB_DATA_RESERVED_SHIFT 5
1566 #define ISCSI_DB_DATA_AGG_VAL_SEL_MASK 0x3
1567 #define ISCSI_DB_DATA_AGG_VAL_SEL_SHIFT 6
1572 #endif /* __ISCSI_COMMON__ */