blob: b3c0feb15ae918147190ace46924cbf76734bf6f [file] [log] [blame]
Yuval Mintz7a9b6b82016-06-03 14:35:33 +03001/* QLogic qed NIC Driver
2 * Copyright (c) 2015 QLogic Corporation
3 *
4 * This software is available under the terms of the GNU General Public License
5 * (GPL) Version 2, available from the file COPYING in the main directory of
6 * this source tree.
7 */
8
9#ifndef __ISCSI_COMMON__
10#define __ISCSI_COMMON__
11/**********************/
12/* ISCSI FW CONSTANTS */
13/**********************/
14
15/* iSCSI HSI constants */
16#define ISCSI_DEFAULT_MTU (1500)
17
18/* Current iSCSI HSI version number composed of two fields (16 bit) */
19#define ISCSI_HSI_MAJOR_VERSION (0)
20#define ISCSI_HSI_MINOR_VERSION (0)
21
22/* KWQ (kernel work queue) layer codes */
23#define ISCSI_SLOW_PATH_LAYER_CODE (6)
24
25/* CQE completion status */
26#define ISCSI_EQE_COMPLETION_SUCCESS (0x0)
27#define ISCSI_EQE_RST_CONN_RCVD (0x1)
28
29/* iSCSI parameter defaults */
30#define ISCSI_DEFAULT_HEADER_DIGEST (0)
31#define ISCSI_DEFAULT_DATA_DIGEST (0)
32#define ISCSI_DEFAULT_INITIAL_R2T (1)
33#define ISCSI_DEFAULT_IMMEDIATE_DATA (1)
34#define ISCSI_DEFAULT_MAX_PDU_LENGTH (0x2000)
35#define ISCSI_DEFAULT_FIRST_BURST_LENGTH (0x10000)
36#define ISCSI_DEFAULT_MAX_BURST_LENGTH (0x40000)
37#define ISCSI_DEFAULT_MAX_OUTSTANDING_R2T (1)
38
39/* iSCSI parameter limits */
40#define ISCSI_MIN_VAL_MAX_PDU_LENGTH (0x200)
41#define ISCSI_MAX_VAL_MAX_PDU_LENGTH (0xffffff)
42#define ISCSI_MIN_VAL_BURST_LENGTH (0x200)
43#define ISCSI_MAX_VAL_BURST_LENGTH (0xffffff)
44#define ISCSI_MIN_VAL_MAX_OUTSTANDING_R2T (1)
45#define ISCSI_MAX_VAL_MAX_OUTSTANDING_R2T (0xff)
46
47/* iSCSI reserved params */
48#define ISCSI_ITT_ALL_ONES (0xffffffff)
49#define ISCSI_TTT_ALL_ONES (0xffffffff)
50
51#define ISCSI_OPTION_1_OFF_CHIP_TCP 1
52#define ISCSI_OPTION_2_ON_CHIP_TCP 2
53
54#define ISCSI_INITIATOR_MODE 0
55#define ISCSI_TARGET_MODE 1
56
57/* iSCSI request op codes */
58#define ISCSI_OPCODE_NOP_OUT_NO_IMM (0)
59#define ISCSI_OPCODE_NOP_OUT ( \
60 ISCSI_OPCODE_NOP_OUT_NO_IMM | 0x40)
61#define ISCSI_OPCODE_SCSI_CMD_NO_IMM (1)
62#define ISCSI_OPCODE_SCSI_CMD ( \
63 ISCSI_OPCODE_SCSI_CMD_NO_IMM | 0x40)
64#define ISCSI_OPCODE_TMF_REQUEST_NO_IMM (2)
65#define ISCSI_OPCODE_TMF_REQUEST ( \
66 ISCSI_OPCODE_TMF_REQUEST_NO_IMM | 0x40)
67#define ISCSI_OPCODE_LOGIN_REQUEST_NO_IMM (3)
68#define ISCSI_OPCODE_LOGIN_REQUEST ( \
69 ISCSI_OPCODE_LOGIN_REQUEST_NO_IMM | 0x40)
70#define ISCSI_OPCODE_TEXT_REQUEST_NO_IMM (4)
71#define ISCSI_OPCODE_TEXT_REQUEST ( \
72 ISCSI_OPCODE_TEXT_REQUEST_NO_IMM | 0x40)
73#define ISCSI_OPCODE_DATA_OUT (5)
74#define ISCSI_OPCODE_LOGOUT_REQUEST_NO_IMM (6)
75#define ISCSI_OPCODE_LOGOUT_REQUEST ( \
76 ISCSI_OPCODE_LOGOUT_REQUEST_NO_IMM | 0x40)
77
78/* iSCSI response/messages op codes */
79#define ISCSI_OPCODE_NOP_IN (0x20)
80#define ISCSI_OPCODE_SCSI_RESPONSE (0x21)
81#define ISCSI_OPCODE_TMF_RESPONSE (0x22)
82#define ISCSI_OPCODE_LOGIN_RESPONSE (0x23)
83#define ISCSI_OPCODE_TEXT_RESPONSE (0x24)
84#define ISCSI_OPCODE_DATA_IN (0x25)
85#define ISCSI_OPCODE_LOGOUT_RESPONSE (0x26)
86#define ISCSI_OPCODE_R2T (0x31)
87#define ISCSI_OPCODE_ASYNC_MSG (0x32)
88#define ISCSI_OPCODE_REJECT (0x3f)
89
90/* iSCSI stages */
91#define ISCSI_STAGE_SECURITY_NEGOTIATION (0)
92#define ISCSI_STAGE_LOGIN_OPERATIONAL_NEGOTIATION (1)
93#define ISCSI_STAGE_FULL_FEATURE_PHASE (3)
94
95/* iSCSI CQE errors */
96#define CQE_ERROR_BITMAP_DATA_DIGEST (0x08)
97#define CQE_ERROR_BITMAP_RCV_ON_INVALID_CONN (0x10)
98#define CQE_ERROR_BITMAP_DATA_TRUNCATED (0x20)
99
100struct cqe_error_bitmap {
101 u8 cqe_error_status_bits;
102#define CQE_ERROR_BITMAP_DIF_ERR_BITS_MASK 0x7
103#define CQE_ERROR_BITMAP_DIF_ERR_BITS_SHIFT 0
104#define CQE_ERROR_BITMAP_DATA_DIGEST_ERR_MASK 0x1
105#define CQE_ERROR_BITMAP_DATA_DIGEST_ERR_SHIFT 3
106#define CQE_ERROR_BITMAP_RCV_ON_INVALID_CONN_MASK 0x1
107#define CQE_ERROR_BITMAP_RCV_ON_INVALID_CONN_SHIFT 4
108#define CQE_ERROR_BITMAP_DATA_TRUNCATED_ERR_MASK 0x1
109#define CQE_ERROR_BITMAP_DATA_TRUNCATED_ERR_SHIFT 5
110#define CQE_ERROR_BITMAP_UNDER_RUN_ERR_MASK 0x1
111#define CQE_ERROR_BITMAP_UNDER_RUN_ERR_SHIFT 6
112#define CQE_ERROR_BITMAP_RESERVED2_MASK 0x1
113#define CQE_ERROR_BITMAP_RESERVED2_SHIFT 7
114};
115
116union cqe_error_status {
117 u8 error_status;
118 struct cqe_error_bitmap error_bits;
119};
120
121struct data_hdr {
122 __le32 data[12];
123};
124
125struct iscsi_async_msg_hdr {
126 __le16 reserved0;
127 u8 flags_attr;
128#define ISCSI_ASYNC_MSG_HDR_RSRV_MASK 0x7F
129#define ISCSI_ASYNC_MSG_HDR_RSRV_SHIFT 0
130#define ISCSI_ASYNC_MSG_HDR_CONST1_MASK 0x1
131#define ISCSI_ASYNC_MSG_HDR_CONST1_SHIFT 7
132 u8 opcode;
133 __le32 hdr_second_dword;
134#define ISCSI_ASYNC_MSG_HDR_DATA_SEG_LEN_MASK 0xFFFFFF
135#define ISCSI_ASYNC_MSG_HDR_DATA_SEG_LEN_SHIFT 0
136#define ISCSI_ASYNC_MSG_HDR_TOTAL_AHS_LEN_MASK 0xFF
137#define ISCSI_ASYNC_MSG_HDR_TOTAL_AHS_LEN_SHIFT 24
138 struct regpair lun;
139 __le32 all_ones;
140 __le32 reserved1;
141 __le32 stat_sn;
142 __le32 exp_cmd_sn;
143 __le32 max_cmd_sn;
144 __le16 param1_rsrv;
145 u8 async_vcode;
146 u8 async_event;
147 __le16 param3_rsrv;
148 __le16 param2_rsrv;
149 __le32 reserved7;
150};
151
152struct iscsi_sge {
153 struct regpair sge_addr;
154 __le16 sge_len;
155 __le16 reserved0;
156 __le32 reserved1;
157};
158
159struct iscsi_cached_sge_ctx {
160 struct iscsi_sge sge;
161 struct regpair reserved;
162 __le32 dsgl_curr_offset[2];
163};
164
165struct iscsi_cmd_hdr {
166 __le16 reserved1;
167 u8 flags_attr;
168#define ISCSI_CMD_HDR_ATTR_MASK 0x7
169#define ISCSI_CMD_HDR_ATTR_SHIFT 0
170#define ISCSI_CMD_HDR_RSRV_MASK 0x3
171#define ISCSI_CMD_HDR_RSRV_SHIFT 3
172#define ISCSI_CMD_HDR_WRITE_MASK 0x1
173#define ISCSI_CMD_HDR_WRITE_SHIFT 5
174#define ISCSI_CMD_HDR_READ_MASK 0x1
175#define ISCSI_CMD_HDR_READ_SHIFT 6
176#define ISCSI_CMD_HDR_FINAL_MASK 0x1
177#define ISCSI_CMD_HDR_FINAL_SHIFT 7
178 u8 opcode;
179 __le32 hdr_second_dword;
180#define ISCSI_CMD_HDR_DATA_SEG_LEN_MASK 0xFFFFFF
181#define ISCSI_CMD_HDR_DATA_SEG_LEN_SHIFT 0
182#define ISCSI_CMD_HDR_TOTAL_AHS_LEN_MASK 0xFF
183#define ISCSI_CMD_HDR_TOTAL_AHS_LEN_SHIFT 24
184 struct regpair lun;
185 __le32 itt;
186 __le32 expected_transfer_length;
187 __le32 cmd_sn;
188 __le32 exp_stat_sn;
189 __le32 cdb[4];
190};
191
192struct iscsi_common_hdr {
193 u8 hdr_status;
194 u8 hdr_response;
195 u8 hdr_flags;
196 u8 hdr_first_byte;
197#define ISCSI_COMMON_HDR_OPCODE_MASK 0x3F
198#define ISCSI_COMMON_HDR_OPCODE_SHIFT 0
199#define ISCSI_COMMON_HDR_IMM_MASK 0x1
200#define ISCSI_COMMON_HDR_IMM_SHIFT 6
201#define ISCSI_COMMON_HDR_RSRV_MASK 0x1
202#define ISCSI_COMMON_HDR_RSRV_SHIFT 7
203 __le32 hdr_second_dword;
204#define ISCSI_COMMON_HDR_DATA_SEG_LEN_MASK 0xFFFFFF
205#define ISCSI_COMMON_HDR_DATA_SEG_LEN_SHIFT 0
206#define ISCSI_COMMON_HDR_TOTAL_AHS_LEN_MASK 0xFF
207#define ISCSI_COMMON_HDR_TOTAL_AHS_LEN_SHIFT 24
208 __le32 lun_reserved[4];
209 __le32 data[6];
210};
211
212struct iscsi_conn_offload_params {
213 struct regpair sq_pbl_addr;
214 struct regpair r2tq_pbl_addr;
215 struct regpair xhq_pbl_addr;
216 struct regpair uhq_pbl_addr;
217 __le32 initial_ack;
218 __le16 physical_q0;
219 __le16 physical_q1;
220 u8 flags;
221#define ISCSI_CONN_OFFLOAD_PARAMS_TCP_ON_CHIP_1B_MASK 0x1
222#define ISCSI_CONN_OFFLOAD_PARAMS_TCP_ON_CHIP_1B_SHIFT 0
223#define ISCSI_CONN_OFFLOAD_PARAMS_TARGET_MODE_MASK 0x1
224#define ISCSI_CONN_OFFLOAD_PARAMS_TARGET_MODE_SHIFT 1
225#define ISCSI_CONN_OFFLOAD_PARAMS_RESERVED1_MASK 0x3F
226#define ISCSI_CONN_OFFLOAD_PARAMS_RESERVED1_SHIFT 2
227 u8 pbl_page_size_log;
228 u8 pbe_page_size_log;
229 u8 default_cq;
230 __le32 stat_sn;
231};
232
233struct iscsi_slow_path_hdr {
234 u8 op_code;
235 u8 flags;
236#define ISCSI_SLOW_PATH_HDR_RESERVED0_MASK 0xF
237#define ISCSI_SLOW_PATH_HDR_RESERVED0_SHIFT 0
238#define ISCSI_SLOW_PATH_HDR_LAYER_CODE_MASK 0x7
239#define ISCSI_SLOW_PATH_HDR_LAYER_CODE_SHIFT 4
240#define ISCSI_SLOW_PATH_HDR_RESERVED1_MASK 0x1
241#define ISCSI_SLOW_PATH_HDR_RESERVED1_SHIFT 7
242};
243
244struct iscsi_conn_update_ramrod_params {
245 struct iscsi_slow_path_hdr hdr;
246 __le16 conn_id;
247 __le32 fw_cid;
248 u8 flags;
249#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_HD_EN_MASK 0x1
250#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_HD_EN_SHIFT 0
251#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DD_EN_MASK 0x1
252#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DD_EN_SHIFT 1
253#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_INITIAL_R2T_MASK 0x1
254#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_INITIAL_R2T_SHIFT 2
255#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_IMMEDIATE_DATA_MASK 0x1
256#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_IMMEDIATE_DATA_SHIFT 3
257#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_RESERVED1_MASK 0xF
258#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_RESERVED1_SHIFT 4
259 u8 reserved0[3];
260 __le32 max_seq_size;
261 __le32 max_send_pdu_length;
262 __le32 max_recv_pdu_length;
263 __le32 first_seq_length;
264 __le32 exp_stat_sn;
265};
266
267struct iscsi_ext_cdb_cmd_hdr {
268 __le16 reserved1;
269 u8 flags_attr;
270#define ISCSI_EXT_CDB_CMD_HDR_ATTR_MASK 0x7
271#define ISCSI_EXT_CDB_CMD_HDR_ATTR_SHIFT 0
272#define ISCSI_EXT_CDB_CMD_HDR_RSRV_MASK 0x3
273#define ISCSI_EXT_CDB_CMD_HDR_RSRV_SHIFT 3
274#define ISCSI_EXT_CDB_CMD_HDR_WRITE_MASK 0x1
275#define ISCSI_EXT_CDB_CMD_HDR_WRITE_SHIFT 5
276#define ISCSI_EXT_CDB_CMD_HDR_READ_MASK 0x1
277#define ISCSI_EXT_CDB_CMD_HDR_READ_SHIFT 6
278#define ISCSI_EXT_CDB_CMD_HDR_FINAL_MASK 0x1
279#define ISCSI_EXT_CDB_CMD_HDR_FINAL_SHIFT 7
280 u8 opcode;
281 __le32 hdr_second_dword;
282#define ISCSI_EXT_CDB_CMD_HDR_DATA_SEG_LEN_MASK 0xFFFFFF
283#define ISCSI_EXT_CDB_CMD_HDR_DATA_SEG_LEN_SHIFT 0
284#define ISCSI_EXT_CDB_CMD_HDR_CDB_SIZE_MASK 0xFF
285#define ISCSI_EXT_CDB_CMD_HDR_CDB_SIZE_SHIFT 24
286 struct regpair lun;
287 __le32 itt;
288 __le32 expected_transfer_length;
289 __le32 cmd_sn;
290 __le32 exp_stat_sn;
291 struct iscsi_sge cdb_sge;
292};
293
294struct iscsi_login_req_hdr {
295 u8 version_min;
296 u8 version_max;
297 u8 flags_attr;
298#define ISCSI_LOGIN_REQ_HDR_NSG_MASK 0x3
299#define ISCSI_LOGIN_REQ_HDR_NSG_SHIFT 0
300#define ISCSI_LOGIN_REQ_HDR_CSG_MASK 0x3
301#define ISCSI_LOGIN_REQ_HDR_CSG_SHIFT 2
302#define ISCSI_LOGIN_REQ_HDR_RSRV_MASK 0x3
303#define ISCSI_LOGIN_REQ_HDR_RSRV_SHIFT 4
304#define ISCSI_LOGIN_REQ_HDR_C_MASK 0x1
305#define ISCSI_LOGIN_REQ_HDR_C_SHIFT 6
306#define ISCSI_LOGIN_REQ_HDR_T_MASK 0x1
307#define ISCSI_LOGIN_REQ_HDR_T_SHIFT 7
308 u8 opcode;
309 __le32 hdr_second_dword;
310#define ISCSI_LOGIN_REQ_HDR_DATA_SEG_LEN_MASK 0xFFFFFF
311#define ISCSI_LOGIN_REQ_HDR_DATA_SEG_LEN_SHIFT 0
312#define ISCSI_LOGIN_REQ_HDR_TOTAL_AHS_LEN_MASK 0xFF
313#define ISCSI_LOGIN_REQ_HDR_TOTAL_AHS_LEN_SHIFT 24
314 __le32 isid_TABC;
315 __le16 tsih;
316 __le16 isid_d;
317 __le32 itt;
318 __le16 reserved1;
319 __le16 cid;
320 __le32 cmd_sn;
321 __le32 exp_stat_sn;
322 __le32 reserved2[4];
323};
324
325struct iscsi_logout_req_hdr {
326 __le16 reserved0;
327 u8 reason_code;
328 u8 opcode;
329 __le32 reserved1;
330 __le32 reserved2[2];
331 __le32 itt;
332 __le16 reserved3;
333 __le16 cid;
334 __le32 cmd_sn;
335 __le32 exp_stat_sn;
336 __le32 reserved4[4];
337};
338
339struct iscsi_data_out_hdr {
340 __le16 reserved1;
341 u8 flags_attr;
342#define ISCSI_DATA_OUT_HDR_RSRV_MASK 0x7F
343#define ISCSI_DATA_OUT_HDR_RSRV_SHIFT 0
344#define ISCSI_DATA_OUT_HDR_FINAL_MASK 0x1
345#define ISCSI_DATA_OUT_HDR_FINAL_SHIFT 7
346 u8 opcode;
347 __le32 reserved2;
348 struct regpair lun;
349 __le32 itt;
350 __le32 ttt;
351 __le32 reserved3;
352 __le32 exp_stat_sn;
353 __le32 reserved4;
354 __le32 data_sn;
355 __le32 buffer_offset;
356 __le32 reserved5;
357};
358
359struct iscsi_data_in_hdr {
360 u8 status_rsvd;
361 u8 reserved1;
362 u8 flags;
363#define ISCSI_DATA_IN_HDR_STATUS_MASK 0x1
364#define ISCSI_DATA_IN_HDR_STATUS_SHIFT 0
365#define ISCSI_DATA_IN_HDR_UNDERFLOW_MASK 0x1
366#define ISCSI_DATA_IN_HDR_UNDERFLOW_SHIFT 1
367#define ISCSI_DATA_IN_HDR_OVERFLOW_MASK 0x1
368#define ISCSI_DATA_IN_HDR_OVERFLOW_SHIFT 2
369#define ISCSI_DATA_IN_HDR_RSRV_MASK 0x7
370#define ISCSI_DATA_IN_HDR_RSRV_SHIFT 3
371#define ISCSI_DATA_IN_HDR_ACK_MASK 0x1
372#define ISCSI_DATA_IN_HDR_ACK_SHIFT 6
373#define ISCSI_DATA_IN_HDR_FINAL_MASK 0x1
374#define ISCSI_DATA_IN_HDR_FINAL_SHIFT 7
375 u8 opcode;
376 __le32 reserved2;
377 struct regpair lun;
378 __le32 itt;
379 __le32 ttt;
380 __le32 stat_sn;
381 __le32 exp_cmd_sn;
382 __le32 max_cmd_sn;
383 __le32 data_sn;
384 __le32 buffer_offset;
385 __le32 residual_count;
386};
387
388struct iscsi_r2t_hdr {
389 u8 reserved0[3];
390 u8 opcode;
391 __le32 reserved2;
392 struct regpair lun;
393 __le32 itt;
394 __le32 ttt;
395 __le32 stat_sn;
396 __le32 exp_cmd_sn;
397 __le32 max_cmd_sn;
398 __le32 r2t_sn;
399 __le32 buffer_offset;
400 __le32 desired_data_trns_len;
401};
402
403struct iscsi_nop_out_hdr {
404 __le16 reserved1;
405 u8 flags_attr;
406#define ISCSI_NOP_OUT_HDR_RSRV_MASK 0x7F
407#define ISCSI_NOP_OUT_HDR_RSRV_SHIFT 0
408#define ISCSI_NOP_OUT_HDR_CONST1_MASK 0x1
409#define ISCSI_NOP_OUT_HDR_CONST1_SHIFT 7
410 u8 opcode;
411 __le32 reserved2;
412 struct regpair lun;
413 __le32 itt;
414 __le32 ttt;
415 __le32 cmd_sn;
416 __le32 exp_stat_sn;
417 __le32 reserved3;
418 __le32 reserved4;
419 __le32 reserved5;
420 __le32 reserved6;
421};
422
423struct iscsi_nop_in_hdr {
424 __le16 reserved0;
425 u8 flags_attr;
426#define ISCSI_NOP_IN_HDR_RSRV_MASK 0x7F
427#define ISCSI_NOP_IN_HDR_RSRV_SHIFT 0
428#define ISCSI_NOP_IN_HDR_CONST1_MASK 0x1
429#define ISCSI_NOP_IN_HDR_CONST1_SHIFT 7
430 u8 opcode;
431 __le32 hdr_second_dword;
432#define ISCSI_NOP_IN_HDR_DATA_SEG_LEN_MASK 0xFFFFFF
433#define ISCSI_NOP_IN_HDR_DATA_SEG_LEN_SHIFT 0
434#define ISCSI_NOP_IN_HDR_TOTAL_AHS_LEN_MASK 0xFF
435#define ISCSI_NOP_IN_HDR_TOTAL_AHS_LEN_SHIFT 24
436 struct regpair lun;
437 __le32 itt;
438 __le32 ttt;
439 __le32 stat_sn;
440 __le32 exp_cmd_sn;
441 __le32 max_cmd_sn;
442 __le32 reserved5;
443 __le32 reserved6;
444 __le32 reserved7;
445};
446
447struct iscsi_login_response_hdr {
448 u8 version_active;
449 u8 version_max;
450 u8 flags_attr;
451#define ISCSI_LOGIN_RESPONSE_HDR_NSG_MASK 0x3
452#define ISCSI_LOGIN_RESPONSE_HDR_NSG_SHIFT 0
453#define ISCSI_LOGIN_RESPONSE_HDR_CSG_MASK 0x3
454#define ISCSI_LOGIN_RESPONSE_HDR_CSG_SHIFT 2
455#define ISCSI_LOGIN_RESPONSE_HDR_RSRV_MASK 0x3
456#define ISCSI_LOGIN_RESPONSE_HDR_RSRV_SHIFT 4
457#define ISCSI_LOGIN_RESPONSE_HDR_C_MASK 0x1
458#define ISCSI_LOGIN_RESPONSE_HDR_C_SHIFT 6
459#define ISCSI_LOGIN_RESPONSE_HDR_T_MASK 0x1
460#define ISCSI_LOGIN_RESPONSE_HDR_T_SHIFT 7
461 u8 opcode;
462 __le32 hdr_second_dword;
463#define ISCSI_LOGIN_RESPONSE_HDR_DATA_SEG_LEN_MASK 0xFFFFFF
464#define ISCSI_LOGIN_RESPONSE_HDR_DATA_SEG_LEN_SHIFT 0
465#define ISCSI_LOGIN_RESPONSE_HDR_TOTAL_AHS_LEN_MASK 0xFF
466#define ISCSI_LOGIN_RESPONSE_HDR_TOTAL_AHS_LEN_SHIFT 24
467 __le32 isid_TABC;
468 __le16 tsih;
469 __le16 isid_d;
470 __le32 itt;
471 __le32 reserved1;
472 __le32 stat_sn;
473 __le32 exp_cmd_sn;
474 __le32 max_cmd_sn;
475 __le16 reserved2;
476 u8 status_detail;
477 u8 status_class;
478 __le32 reserved4[2];
479};
480
481struct iscsi_logout_response_hdr {
482 u8 reserved1;
483 u8 response;
484 u8 flags;
485 u8 opcode;
486 __le32 hdr_second_dword;
487#define ISCSI_LOGOUT_RESPONSE_HDR_DATA_SEG_LEN_MASK 0xFFFFFF
488#define ISCSI_LOGOUT_RESPONSE_HDR_DATA_SEG_LEN_SHIFT 0
489#define ISCSI_LOGOUT_RESPONSE_HDR_TOTAL_AHS_LEN_MASK 0xFF
490#define ISCSI_LOGOUT_RESPONSE_HDR_TOTAL_AHS_LEN_SHIFT 24
491 __le32 reserved2[2];
492 __le32 itt;
493 __le32 reserved3;
494 __le32 stat_sn;
495 __le32 exp_cmd_sn;
496 __le32 max_cmd_sn;
497 __le32 reserved4;
498 __le16 time2retain;
499 __le16 time2wait;
500 __le32 reserved5[1];
501};
502
503struct iscsi_text_request_hdr {
504 __le16 reserved0;
505 u8 flags_attr;
506#define ISCSI_TEXT_REQUEST_HDR_RSRV_MASK 0x3F
507#define ISCSI_TEXT_REQUEST_HDR_RSRV_SHIFT 0
508#define ISCSI_TEXT_REQUEST_HDR_C_MASK 0x1
509#define ISCSI_TEXT_REQUEST_HDR_C_SHIFT 6
510#define ISCSI_TEXT_REQUEST_HDR_F_MASK 0x1
511#define ISCSI_TEXT_REQUEST_HDR_F_SHIFT 7
512 u8 opcode;
513 __le32 hdr_second_dword;
514#define ISCSI_TEXT_REQUEST_HDR_DATA_SEG_LEN_MASK 0xFFFFFF
515#define ISCSI_TEXT_REQUEST_HDR_DATA_SEG_LEN_SHIFT 0
516#define ISCSI_TEXT_REQUEST_HDR_TOTAL_AHS_LEN_MASK 0xFF
517#define ISCSI_TEXT_REQUEST_HDR_TOTAL_AHS_LEN_SHIFT 24
518 struct regpair lun;
519 __le32 itt;
520 __le32 ttt;
521 __le32 cmd_sn;
522 __le32 exp_stat_sn;
523 __le32 reserved4[4];
524};
525
526struct iscsi_text_response_hdr {
527 __le16 reserved1;
528 u8 flags;
529#define ISCSI_TEXT_RESPONSE_HDR_RSRV_MASK 0x3F
530#define ISCSI_TEXT_RESPONSE_HDR_RSRV_SHIFT 0
531#define ISCSI_TEXT_RESPONSE_HDR_C_MASK 0x1
532#define ISCSI_TEXT_RESPONSE_HDR_C_SHIFT 6
533#define ISCSI_TEXT_RESPONSE_HDR_F_MASK 0x1
534#define ISCSI_TEXT_RESPONSE_HDR_F_SHIFT 7
535 u8 opcode;
536 __le32 hdr_second_dword;
537#define ISCSI_TEXT_RESPONSE_HDR_DATA_SEG_LEN_MASK 0xFFFFFF
538#define ISCSI_TEXT_RESPONSE_HDR_DATA_SEG_LEN_SHIFT 0
539#define ISCSI_TEXT_RESPONSE_HDR_TOTAL_AHS_LEN_MASK 0xFF
540#define ISCSI_TEXT_RESPONSE_HDR_TOTAL_AHS_LEN_SHIFT 24
541 struct regpair lun;
542 __le32 itt;
543 __le32 ttt;
544 __le32 stat_sn;
545 __le32 exp_cmd_sn;
546 __le32 max_cmd_sn;
547 __le32 reserved4[3];
548};
549
550struct iscsi_tmf_request_hdr {
551 __le16 reserved0;
552 u8 function;
553 u8 opcode;
554 __le32 hdr_second_dword;
555#define ISCSI_TMF_REQUEST_HDR_DATA_SEG_LEN_MASK 0xFFFFFF
556#define ISCSI_TMF_REQUEST_HDR_DATA_SEG_LEN_SHIFT 0
557#define ISCSI_TMF_REQUEST_HDR_TOTAL_AHS_LEN_MASK 0xFF
558#define ISCSI_TMF_REQUEST_HDR_TOTAL_AHS_LEN_SHIFT 24
559 struct regpair lun;
560 __le32 itt;
561 __le32 rtt;
562 __le32 cmd_sn;
563 __le32 exp_stat_sn;
564 __le32 ref_cmd_sn;
565 __le32 exp_data_sn;
566 __le32 reserved4[2];
567};
568
569struct iscsi_tmf_response_hdr {
570 u8 reserved2;
571 u8 hdr_response;
572 u8 hdr_flags;
573 u8 opcode;
574 __le32 hdr_second_dword;
575#define ISCSI_TMF_RESPONSE_HDR_DATA_SEG_LEN_MASK 0xFFFFFF
576#define ISCSI_TMF_RESPONSE_HDR_DATA_SEG_LEN_SHIFT 0
577#define ISCSI_TMF_RESPONSE_HDR_TOTAL_AHS_LEN_MASK 0xFF
578#define ISCSI_TMF_RESPONSE_HDR_TOTAL_AHS_LEN_SHIFT 24
579 struct regpair reserved0;
580 __le32 itt;
581 __le32 rtt;
582 __le32 stat_sn;
583 __le32 exp_cmd_sn;
584 __le32 max_cmd_sn;
585 __le32 reserved4[3];
586};
587
588struct iscsi_response_hdr {
589 u8 hdr_status;
590 u8 hdr_response;
591 u8 hdr_flags;
592 u8 opcode;
593 __le32 hdr_second_dword;
594#define ISCSI_RESPONSE_HDR_DATA_SEG_LEN_MASK 0xFFFFFF
595#define ISCSI_RESPONSE_HDR_DATA_SEG_LEN_SHIFT 0
596#define ISCSI_RESPONSE_HDR_TOTAL_AHS_LEN_MASK 0xFF
597#define ISCSI_RESPONSE_HDR_TOTAL_AHS_LEN_SHIFT 24
598 struct regpair lun;
599 __le32 itt;
600 __le32 snack_tag;
601 __le32 stat_sn;
602 __le32 exp_cmd_sn;
603 __le32 max_cmd_sn;
604 __le32 exp_data_sn;
605 __le32 bi_residual_count;
606 __le32 residual_count;
607};
608
609struct iscsi_reject_hdr {
610 u8 reserved4;
611 u8 hdr_reason;
612 u8 hdr_flags;
613 u8 opcode;
614 __le32 hdr_second_dword;
615#define ISCSI_REJECT_HDR_DATA_SEG_LEN_MASK 0xFFFFFF
616#define ISCSI_REJECT_HDR_DATA_SEG_LEN_SHIFT 0
617#define ISCSI_REJECT_HDR_TOTAL_AHS_LEN_MASK 0xFF
618#define ISCSI_REJECT_HDR_TOTAL_AHS_LEN_SHIFT 24
619 struct regpair reserved0;
620 __le32 reserved1;
621 __le32 reserved2;
622 __le32 stat_sn;
623 __le32 exp_cmd_sn;
624 __le32 max_cmd_sn;
625 __le32 data_sn;
626 __le32 reserved3[2];
627};
628
629union iscsi_task_hdr {
630 struct iscsi_common_hdr common;
631 struct data_hdr data;
632 struct iscsi_cmd_hdr cmd;
633 struct iscsi_ext_cdb_cmd_hdr ext_cdb_cmd;
634 struct iscsi_login_req_hdr login_req;
635 struct iscsi_logout_req_hdr logout_req;
636 struct iscsi_data_out_hdr data_out;
637 struct iscsi_data_in_hdr data_in;
638 struct iscsi_r2t_hdr r2t;
639 struct iscsi_nop_out_hdr nop_out;
640 struct iscsi_nop_in_hdr nop_in;
641 struct iscsi_login_response_hdr login_response;
642 struct iscsi_logout_response_hdr logout_response;
643 struct iscsi_text_request_hdr text_request;
644 struct iscsi_text_response_hdr text_response;
645 struct iscsi_tmf_request_hdr tmf_request;
646 struct iscsi_tmf_response_hdr tmf_response;
647 struct iscsi_response_hdr response;
648 struct iscsi_reject_hdr reject;
649 struct iscsi_async_msg_hdr async_msg;
650};
651
652struct iscsi_cqe_common {
653 __le16 conn_id;
654 u8 cqe_type;
655 union cqe_error_status error_bitmap;
656 __le32 reserved[3];
657 union iscsi_task_hdr iscsi_hdr;
658};
659
660struct iscsi_cqe_solicited {
661 __le16 conn_id;
662 u8 cqe_type;
663 union cqe_error_status error_bitmap;
664 __le16 itid;
665 u8 task_type;
666 u8 fw_dbg_field;
667 __le32 reserved1[2];
668 union iscsi_task_hdr iscsi_hdr;
669};
670
671struct iscsi_cqe_unsolicited {
672 __le16 conn_id;
673 u8 cqe_type;
674 union cqe_error_status error_bitmap;
675 __le16 reserved0;
676 u8 reserved1;
677 u8 unsol_cqe_type;
678 struct regpair rqe_opaque;
679 union iscsi_task_hdr iscsi_hdr;
680};
681
682union iscsi_cqe {
683 struct iscsi_cqe_common cqe_common;
684 struct iscsi_cqe_solicited cqe_solicited;
685 struct iscsi_cqe_unsolicited cqe_unsolicited;
686};
687
688enum iscsi_cqes_type {
689 ISCSI_CQE_TYPE_SOLICITED = 1,
690 ISCSI_CQE_TYPE_UNSOLICITED,
691 ISCSI_CQE_TYPE_SOLICITED_WITH_SENSE
692 ,
693 ISCSI_CQE_TYPE_TASK_CLEANUP,
694 ISCSI_CQE_TYPE_DUMMY,
695 MAX_ISCSI_CQES_TYPE
696};
697
698enum iscsi_cqe_unsolicited_type {
699 ISCSI_CQE_UNSOLICITED_NONE,
700 ISCSI_CQE_UNSOLICITED_SINGLE,
701 ISCSI_CQE_UNSOLICITED_FIRST,
702 ISCSI_CQE_UNSOLICITED_MIDDLE,
703 ISCSI_CQE_UNSOLICITED_LAST,
704 MAX_ISCSI_CQE_UNSOLICITED_TYPE
705};
706
707struct iscsi_virt_sgl_ctx {
708 struct regpair sgl_base;
709 struct regpair dsgl_base;
710 __le32 sgl_initial_offset;
711 __le32 dsgl_initial_offset;
712 __le32 dsgl_curr_offset[2];
713};
714
715struct iscsi_sgl_var_params {
716 u8 sgl_ptr;
717 u8 dsgl_ptr;
718 __le16 sge_offset;
719 __le16 dsge_offset;
720};
721
722struct iscsi_phys_sgl_ctx {
723 struct regpair sgl_base;
724 struct regpair dsgl_base;
725 u8 sgl_size;
726 u8 dsgl_size;
727 __le16 reserved;
728 struct iscsi_sgl_var_params var_params[2];
729};
730
731union iscsi_data_desc_ctx {
732 struct iscsi_virt_sgl_ctx virt_sgl;
733 struct iscsi_phys_sgl_ctx phys_sgl;
734 struct iscsi_cached_sge_ctx cached_sge;
735};
736
737struct iscsi_debug_modes {
738 u8 flags;
739#define ISCSI_DEBUG_MODES_ASSERT_IF_RX_CONN_ERROR_MASK 0x1
740#define ISCSI_DEBUG_MODES_ASSERT_IF_RX_CONN_ERROR_SHIFT 0
741#define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_RESET_MASK 0x1
742#define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_RESET_SHIFT 1
743#define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_FIN_MASK 0x1
744#define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_FIN_SHIFT 2
745#define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_CLEANUP_MASK 0x1
746#define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_CLEANUP_SHIFT 3
747#define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_REJECT_OR_ASYNC_MASK 0x1
748#define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_REJECT_OR_ASYNC_SHIFT 4
749#define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_NOP_MASK 0x1
750#define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_NOP_SHIFT 5
751#define ISCSI_DEBUG_MODES_RESERVED0_MASK 0x3
752#define ISCSI_DEBUG_MODES_RESERVED0_SHIFT 6
753};
754
755struct iscsi_dif_flags {
756 u8 flags;
757#define ISCSI_DIF_FLAGS_PROT_INTERVAL_SIZE_LOG_MASK 0xF
758#define ISCSI_DIF_FLAGS_PROT_INTERVAL_SIZE_LOG_SHIFT 0
759#define ISCSI_DIF_FLAGS_DIF_TO_PEER_MASK 0x1
760#define ISCSI_DIF_FLAGS_DIF_TO_PEER_SHIFT 4
761#define ISCSI_DIF_FLAGS_HOST_INTERFACE_MASK 0x7
762#define ISCSI_DIF_FLAGS_HOST_INTERFACE_SHIFT 5
763};
764
765enum iscsi_eqe_opcode {
766 ISCSI_EVENT_TYPE_INIT_FUNC = 0,
767 ISCSI_EVENT_TYPE_DESTROY_FUNC,
768 ISCSI_EVENT_TYPE_OFFLOAD_CONN,
769 ISCSI_EVENT_TYPE_UPDATE_CONN,
770 ISCSI_EVENT_TYPE_CLEAR_SQ,
771 ISCSI_EVENT_TYPE_TERMINATE_CONN,
772 ISCSI_EVENT_TYPE_ASYN_CONNECT_COMPLETE,
773 ISCSI_EVENT_TYPE_ASYN_TERMINATE_DONE,
774 RESERVED8,
775 RESERVED9,
776 ISCSI_EVENT_TYPE_START_OF_ERROR_TYPES = 10,
777 ISCSI_EVENT_TYPE_ASYN_ABORT_RCVD,
778 ISCSI_EVENT_TYPE_ASYN_CLOSE_RCVD,
779 ISCSI_EVENT_TYPE_ASYN_SYN_RCVD,
780 ISCSI_EVENT_TYPE_ASYN_MAX_RT_TIME,
781 ISCSI_EVENT_TYPE_ASYN_MAX_RT_CNT,
782 ISCSI_EVENT_TYPE_ASYN_MAX_KA_PROBES_CNT,
783 ISCSI_EVENT_TYPE_ASYN_FIN_WAIT2,
784 ISCSI_EVENT_TYPE_ISCSI_CONN_ERROR,
785 ISCSI_EVENT_TYPE_TCP_CONN_ERROR,
786 ISCSI_EVENT_TYPE_ASYN_DELETE_OOO_ISLES,
787 MAX_ISCSI_EQE_OPCODE
788};
789
790enum iscsi_error_types {
791 ISCSI_STATUS_NONE = 0,
792 ISCSI_CQE_ERROR_UNSOLICITED_RCV_ON_INVALID_CONN = 1,
793 ISCSI_CONN_ERROR_TASK_CID_MISMATCH,
794 ISCSI_CONN_ERROR_TASK_NOT_VALID,
795 ISCSI_CONN_ERROR_RQ_RING_IS_FULL,
796 ISCSI_CONN_ERROR_CMDQ_RING_IS_FULL,
797 ISCSI_CONN_ERROR_HQE_CACHING_FAILED,
798 ISCSI_CONN_ERROR_HEADER_DIGEST_ERROR,
799 ISCSI_CONN_ERROR_LOCAL_COMPLETION_ERROR,
800 ISCSI_CONN_ERROR_DATA_OVERRUN,
801 ISCSI_CONN_ERROR_OUT_OF_SGES_ERROR,
802 ISCSI_CONN_ERROR_TCP_SEG_PROC_URG_ERROR,
803 ISCSI_CONN_ERROR_TCP_SEG_PROC_IP_OPTIONS_ERROR,
804 ISCSI_CONN_ERROR_TCP_SEG_PROC_CONNECT_INVALID_WS_OPTION,
805 ISCSI_CONN_ERROR_TCP_IP_FRAGMENT_ERROR,
806 ISCSI_CONN_ERROR_PROTOCOL_ERR_AHS_LEN,
807 ISCSI_CONN_ERROR_PROTOCOL_ERR_AHS_TYPE,
808 ISCSI_CONN_ERROR_PROTOCOL_ERR_ITT_OUT_OF_RANGE,
809 ISCSI_CONN_ERROR_PROTOCOL_ERR_TTT_OUT_OF_RANGE,
810 ISCSI_CONN_ERROR_PROTOCOL_ERR_DATA_SEG_LEN_EXCEEDS_PDU_SIZE,
811 ISCSI_CONN_ERROR_PROTOCOL_ERR_INVALID_OPCODE,
812 ISCSI_CONN_ERROR_PROTOCOL_ERR_INVALID_OPCODE_BEFORE_UPDATE,
813 ISCSI_CONN_ERROR_UNVALID_NOPIN_DSL,
814 ISCSI_CONN_ERROR_PROTOCOL_ERR_R2T_CARRIES_NO_DATA,
815 ISCSI_CONN_ERROR_PROTOCOL_ERR_DATA_SN,
816 ISCSI_CONN_ERROR_PROTOCOL_ERR_DATA_IN_TTT,
817 ISCSI_CONN_ERROR_PROTOCOL_ERR_DATA_OUT_ITT,
818 ISCSI_CONN_ERROR_PROTOCOL_ERR_R2T_TTT,
819 ISCSI_CONN_ERROR_PROTOCOL_ERR_R2T_BUFFER_OFFSET,
820 ISCSI_CONN_ERROR_PROTOCOL_ERR_BUFFER_OFFSET_OOO,
821 ISCSI_CONN_ERROR_PROTOCOL_ERR_R2T_SN,
822 ISCSI_CONN_ERROR_PROTOCOL_ERR_DESIRED_DATA_TRNS_LEN_0,
823 ISCSI_CONN_ERROR_PROTOCOL_ERR_DESIRED_DATA_TRNS_LEN_1,
824 ISCSI_CONN_ERROR_PROTOCOL_ERR_DESIRED_DATA_TRNS_LEN_2,
825 ISCSI_CONN_ERROR_PROTOCOL_ERR_LUN,
826 ISCSI_CONN_ERROR_PROTOCOL_ERR_F_BIT_ZERO,
827 ISCSI_CONN_ERROR_PROTOCOL_ERR_F_BIT_ZERO_S_BIT_ONE,
828 ISCSI_CONN_ERROR_PROTOCOL_ERR_EXP_STAT_SN,
829 ISCSI_CONN_ERROR_PROTOCOL_ERR_DSL_NOT_ZERO,
830 ISCSI_CONN_ERROR_PROTOCOL_ERR_INVALID_DSL,
831 ISCSI_CONN_ERROR_PROTOCOL_ERR_DATA_SEG_LEN_TOO_BIG,
832 ISCSI_CONN_ERROR_PROTOCOL_ERR_OUTSTANDING_R2T_COUNT,
833 ISCSI_CONN_ERROR_PROTOCOL_ERR_DIF_TX,
834 ISCSI_CONN_ERROR_SENSE_DATA_LENGTH,
835 ISCSI_CONN_ERROR_DATA_PLACEMENT_ERROR,
836 ISCSI_ERROR_UNKNOWN,
837 MAX_ISCSI_ERROR_TYPES
838};
839
840struct iscsi_mflags {
841 u8 mflags;
842#define ISCSI_MFLAGS_SLOW_IO_MASK 0x1
843#define ISCSI_MFLAGS_SLOW_IO_SHIFT 0
844#define ISCSI_MFLAGS_SINGLE_SGE_MASK 0x1
845#define ISCSI_MFLAGS_SINGLE_SGE_SHIFT 1
846#define ISCSI_MFLAGS_RESERVED_MASK 0x3F
847#define ISCSI_MFLAGS_RESERVED_SHIFT 2
848};
849
850struct iscsi_sgl {
851 struct regpair sgl_addr;
852 __le16 updated_sge_size;
853 __le16 updated_sge_offset;
854 __le32 byte_offset;
855};
856
857union iscsi_mstorm_sgl {
858 struct iscsi_sgl sgl_struct;
859 struct iscsi_sge single_sge;
860};
861
862enum iscsi_ramrod_cmd_id {
863 ISCSI_RAMROD_CMD_ID_UNUSED = 0,
864 ISCSI_RAMROD_CMD_ID_INIT_FUNC = 1,
865 ISCSI_RAMROD_CMD_ID_DESTROY_FUNC = 2,
866 ISCSI_RAMROD_CMD_ID_OFFLOAD_CONN = 3,
867 ISCSI_RAMROD_CMD_ID_UPDATE_CONN = 4,
868 ISCSI_RAMROD_CMD_ID_TERMINATION_CONN = 5,
869 ISCSI_RAMROD_CMD_ID_CLEAR_SQ = 6,
870 MAX_ISCSI_RAMROD_CMD_ID
871};
872
873struct iscsi_reg1 {
874 __le32 reg1_map;
875#define ISCSI_REG1_NUM_FAST_SGES_MASK 0x7
876#define ISCSI_REG1_NUM_FAST_SGES_SHIFT 0
877#define ISCSI_REG1_RESERVED1_MASK 0x1FFFFFFF
878#define ISCSI_REG1_RESERVED1_SHIFT 3
879};
880
881union iscsi_seq_num {
882 __le16 data_sn;
883 __le16 r2t_sn;
884};
885
886struct iscsi_spe_conn_offload {
887 struct iscsi_slow_path_hdr hdr;
888 __le16 conn_id;
889 __le32 fw_cid;
890 struct iscsi_conn_offload_params iscsi;
891 struct tcp_offload_params tcp;
892};
893
894struct iscsi_spe_conn_offload_option2 {
895 struct iscsi_slow_path_hdr hdr;
896 __le16 conn_id;
897 __le32 fw_cid;
898 struct iscsi_conn_offload_params iscsi;
899 struct tcp_offload_params_opt2 tcp;
900};
901
902struct iscsi_spe_conn_termination {
903 struct iscsi_slow_path_hdr hdr;
904 __le16 conn_id;
905 __le32 fw_cid;
906 u8 abortive;
907 u8 reserved0[7];
908 struct regpair queue_cnts_addr;
909 struct regpair query_params_addr;
910};
911
912struct iscsi_spe_func_dstry {
913 struct iscsi_slow_path_hdr hdr;
914 __le16 reserved0;
915 __le32 reserved1;
916};
917
918struct iscsi_spe_func_init {
919 struct iscsi_slow_path_hdr hdr;
920 __le16 half_way_close_timeout;
921 u8 num_sq_pages_in_ring;
922 u8 num_r2tq_pages_in_ring;
923 u8 num_uhq_pages_in_ring;
924 u8 ll2_rx_queue_id;
925 u8 ooo_enable;
926 struct iscsi_debug_modes debug_mode;
927 __le16 reserved1;
928 __le32 reserved2;
929 __le32 reserved3;
930 __le32 reserved4;
931 struct scsi_init_func_params func_params;
932 struct scsi_init_func_queues q_params;
933};
934
935struct ystorm_iscsi_task_state {
936 union iscsi_data_desc_ctx sgl_ctx_union;
937 __le32 buffer_offset[2];
938 __le16 bytes_nxt_dif;
939 __le16 rxmit_bytes_nxt_dif;
940 union iscsi_seq_num seq_num_union;
941 u8 dif_bytes_leftover;
942 u8 rxmit_dif_bytes_leftover;
943 __le16 reuse_count;
944 struct iscsi_dif_flags dif_flags;
945 u8 local_comp;
946 __le32 exp_r2t_sn;
947 __le32 sgl_offset[2];
948};
949
950struct ystorm_iscsi_task_st_ctx {
951 struct ystorm_iscsi_task_state state;
952 union iscsi_task_hdr pdu_hdr;
953};
954
955struct ystorm_iscsi_task_ag_ctx {
956 u8 reserved;
957 u8 byte1;
958 __le16 word0;
959 u8 flags0;
960#define YSTORM_ISCSI_TASK_AG_CTX_NIBBLE0_MASK 0xF
961#define YSTORM_ISCSI_TASK_AG_CTX_NIBBLE0_SHIFT 0
962#define YSTORM_ISCSI_TASK_AG_CTX_BIT0_MASK 0x1
963#define YSTORM_ISCSI_TASK_AG_CTX_BIT0_SHIFT 4
964#define YSTORM_ISCSI_TASK_AG_CTX_BIT1_MASK 0x1
965#define YSTORM_ISCSI_TASK_AG_CTX_BIT1_SHIFT 5
966#define YSTORM_ISCSI_TASK_AG_CTX_VALID_MASK 0x1
967#define YSTORM_ISCSI_TASK_AG_CTX_VALID_SHIFT 6
968#define YSTORM_ISCSI_TASK_AG_CTX_BIT3_MASK 0x1
969#define YSTORM_ISCSI_TASK_AG_CTX_BIT3_SHIFT 7
970 u8 flags1;
971#define YSTORM_ISCSI_TASK_AG_CTX_CF0_MASK 0x3
972#define YSTORM_ISCSI_TASK_AG_CTX_CF0_SHIFT 0
973#define YSTORM_ISCSI_TASK_AG_CTX_CF1_MASK 0x3
974#define YSTORM_ISCSI_TASK_AG_CTX_CF1_SHIFT 2
975#define YSTORM_ISCSI_TASK_AG_CTX_CF2SPECIAL_MASK 0x3
976#define YSTORM_ISCSI_TASK_AG_CTX_CF2SPECIAL_SHIFT 4
977#define YSTORM_ISCSI_TASK_AG_CTX_CF0EN_MASK 0x1
978#define YSTORM_ISCSI_TASK_AG_CTX_CF0EN_SHIFT 6
979#define YSTORM_ISCSI_TASK_AG_CTX_CF1EN_MASK 0x1
980#define YSTORM_ISCSI_TASK_AG_CTX_CF1EN_SHIFT 7
981 u8 flags2;
982#define YSTORM_ISCSI_TASK_AG_CTX_BIT4_MASK 0x1
983#define YSTORM_ISCSI_TASK_AG_CTX_BIT4_SHIFT 0
984#define YSTORM_ISCSI_TASK_AG_CTX_RULE0EN_MASK 0x1
985#define YSTORM_ISCSI_TASK_AG_CTX_RULE0EN_SHIFT 1
986#define YSTORM_ISCSI_TASK_AG_CTX_RULE1EN_MASK 0x1
987#define YSTORM_ISCSI_TASK_AG_CTX_RULE1EN_SHIFT 2
988#define YSTORM_ISCSI_TASK_AG_CTX_RULE2EN_MASK 0x1
989#define YSTORM_ISCSI_TASK_AG_CTX_RULE2EN_SHIFT 3
990#define YSTORM_ISCSI_TASK_AG_CTX_RULE3EN_MASK 0x1
991#define YSTORM_ISCSI_TASK_AG_CTX_RULE3EN_SHIFT 4
992#define YSTORM_ISCSI_TASK_AG_CTX_RULE4EN_MASK 0x1
993#define YSTORM_ISCSI_TASK_AG_CTX_RULE4EN_SHIFT 5
994#define YSTORM_ISCSI_TASK_AG_CTX_RULE5EN_MASK 0x1
995#define YSTORM_ISCSI_TASK_AG_CTX_RULE5EN_SHIFT 6
996#define YSTORM_ISCSI_TASK_AG_CTX_RULE6EN_MASK 0x1
997#define YSTORM_ISCSI_TASK_AG_CTX_RULE6EN_SHIFT 7
998 u8 byte2;
999 __le32 TTT;
1000 u8 byte3;
1001 u8 byte4;
1002 __le16 word1;
1003};
1004
1005struct mstorm_iscsi_task_ag_ctx {
1006 u8 cdu_validation;
1007 u8 byte1;
1008 __le16 task_cid;
1009 u8 flags0;
1010#define MSTORM_ISCSI_TASK_AG_CTX_CONNECTION_TYPE_MASK 0xF
1011#define MSTORM_ISCSI_TASK_AG_CTX_CONNECTION_TYPE_SHIFT 0
1012#define MSTORM_ISCSI_TASK_AG_CTX_EXIST_IN_QM0_MASK 0x1
1013#define MSTORM_ISCSI_TASK_AG_CTX_EXIST_IN_QM0_SHIFT 4
1014#define MSTORM_ISCSI_TASK_AG_CTX_BIT1_MASK 0x1
1015#define MSTORM_ISCSI_TASK_AG_CTX_BIT1_SHIFT 5
1016#define MSTORM_ISCSI_TASK_AG_CTX_VALID_MASK 0x1
1017#define MSTORM_ISCSI_TASK_AG_CTX_VALID_SHIFT 6
1018#define MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_FLAG_MASK 0x1
1019#define MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_FLAG_SHIFT 7
1020 u8 flags1;
1021#define MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_CF_MASK 0x3
1022#define MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_CF_SHIFT 0
1023#define MSTORM_ISCSI_TASK_AG_CTX_CF1_MASK 0x3
1024#define MSTORM_ISCSI_TASK_AG_CTX_CF1_SHIFT 2
1025#define MSTORM_ISCSI_TASK_AG_CTX_CF2_MASK 0x3
1026#define MSTORM_ISCSI_TASK_AG_CTX_CF2_SHIFT 4
1027#define MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_CF_EN_MASK 0x1
1028#define MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_CF_EN_SHIFT 6
1029#define MSTORM_ISCSI_TASK_AG_CTX_CF1EN_MASK 0x1
1030#define MSTORM_ISCSI_TASK_AG_CTX_CF1EN_SHIFT 7
1031 u8 flags2;
1032#define MSTORM_ISCSI_TASK_AG_CTX_CF2EN_MASK 0x1
1033#define MSTORM_ISCSI_TASK_AG_CTX_CF2EN_SHIFT 0
1034#define MSTORM_ISCSI_TASK_AG_CTX_RULE0EN_MASK 0x1
1035#define MSTORM_ISCSI_TASK_AG_CTX_RULE0EN_SHIFT 1
1036#define MSTORM_ISCSI_TASK_AG_CTX_RULE1EN_MASK 0x1
1037#define MSTORM_ISCSI_TASK_AG_CTX_RULE1EN_SHIFT 2
1038#define MSTORM_ISCSI_TASK_AG_CTX_RULE2EN_MASK 0x1
1039#define MSTORM_ISCSI_TASK_AG_CTX_RULE2EN_SHIFT 3
1040#define MSTORM_ISCSI_TASK_AG_CTX_RULE3EN_MASK 0x1
1041#define MSTORM_ISCSI_TASK_AG_CTX_RULE3EN_SHIFT 4
1042#define MSTORM_ISCSI_TASK_AG_CTX_RULE4EN_MASK 0x1
1043#define MSTORM_ISCSI_TASK_AG_CTX_RULE4EN_SHIFT 5
1044#define MSTORM_ISCSI_TASK_AG_CTX_RULE5EN_MASK 0x1
1045#define MSTORM_ISCSI_TASK_AG_CTX_RULE5EN_SHIFT 6
1046#define MSTORM_ISCSI_TASK_AG_CTX_RULE6EN_MASK 0x1
1047#define MSTORM_ISCSI_TASK_AG_CTX_RULE6EN_SHIFT 7
1048 u8 byte2;
1049 __le32 reg0;
1050 u8 byte3;
1051 u8 byte4;
1052 __le16 word1;
1053};
1054
1055struct ustorm_iscsi_task_ag_ctx {
1056 u8 reserved;
1057 u8 state;
1058 __le16 icid;
1059 u8 flags0;
1060#define USTORM_ISCSI_TASK_AG_CTX_CONNECTION_TYPE_MASK 0xF
1061#define USTORM_ISCSI_TASK_AG_CTX_CONNECTION_TYPE_SHIFT 0
1062#define USTORM_ISCSI_TASK_AG_CTX_EXIST_IN_QM0_MASK 0x1
1063#define USTORM_ISCSI_TASK_AG_CTX_EXIST_IN_QM0_SHIFT 4
1064#define USTORM_ISCSI_TASK_AG_CTX_BIT1_MASK 0x1
1065#define USTORM_ISCSI_TASK_AG_CTX_BIT1_SHIFT 5
1066#define USTORM_ISCSI_TASK_AG_CTX_HQ_SCANNED_CF_MASK 0x3
1067#define USTORM_ISCSI_TASK_AG_CTX_HQ_SCANNED_CF_SHIFT 6
1068 u8 flags1;
1069#define USTORM_ISCSI_TASK_AG_CTX_RESERVED1_MASK 0x3
1070#define USTORM_ISCSI_TASK_AG_CTX_RESERVED1_SHIFT 0
1071#define USTORM_ISCSI_TASK_AG_CTX_R2T2RECV_MASK 0x3
1072#define USTORM_ISCSI_TASK_AG_CTX_R2T2RECV_SHIFT 2
1073#define USTORM_ISCSI_TASK_AG_CTX_CF3_MASK 0x3
1074#define USTORM_ISCSI_TASK_AG_CTX_CF3_SHIFT 4
1075#define USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_CF_MASK 0x3
1076#define USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_CF_SHIFT 6
1077 u8 flags2;
1078#define USTORM_ISCSI_TASK_AG_CTX_HQ_SCANNED_CF_EN_MASK 0x1
1079#define USTORM_ISCSI_TASK_AG_CTX_HQ_SCANNED_CF_EN_SHIFT 0
1080#define USTORM_ISCSI_TASK_AG_CTX_DISABLE_DATA_ACKED_MASK 0x1
1081#define USTORM_ISCSI_TASK_AG_CTX_DISABLE_DATA_ACKED_SHIFT 1
1082#define USTORM_ISCSI_TASK_AG_CTX_R2T2RECV_EN_MASK 0x1
1083#define USTORM_ISCSI_TASK_AG_CTX_R2T2RECV_EN_SHIFT 2
1084#define USTORM_ISCSI_TASK_AG_CTX_CF3EN_MASK 0x1
1085#define USTORM_ISCSI_TASK_AG_CTX_CF3EN_SHIFT 3
1086#define USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_CF_EN_MASK 0x1
1087#define USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_CF_EN_SHIFT 4
1088#define USTORM_ISCSI_TASK_AG_CTX_CMP_DATA_TOTAL_EXP_EN_MASK 0x1
1089#define USTORM_ISCSI_TASK_AG_CTX_CMP_DATA_TOTAL_EXP_EN_SHIFT 5
1090#define USTORM_ISCSI_TASK_AG_CTX_RULE1EN_MASK 0x1
1091#define USTORM_ISCSI_TASK_AG_CTX_RULE1EN_SHIFT 6
1092#define USTORM_ISCSI_TASK_AG_CTX_CMP_CONT_RCV_EXP_EN_MASK 0x1
1093#define USTORM_ISCSI_TASK_AG_CTX_CMP_CONT_RCV_EXP_EN_SHIFT 7
1094 u8 flags3;
1095#define USTORM_ISCSI_TASK_AG_CTX_RULE3EN_MASK 0x1
1096#define USTORM_ISCSI_TASK_AG_CTX_RULE3EN_SHIFT 0
1097#define USTORM_ISCSI_TASK_AG_CTX_RULE4EN_MASK 0x1
1098#define USTORM_ISCSI_TASK_AG_CTX_RULE4EN_SHIFT 1
1099#define USTORM_ISCSI_TASK_AG_CTX_RULE5EN_MASK 0x1
1100#define USTORM_ISCSI_TASK_AG_CTX_RULE5EN_SHIFT 2
1101#define USTORM_ISCSI_TASK_AG_CTX_RULE6EN_MASK 0x1
1102#define USTORM_ISCSI_TASK_AG_CTX_RULE6EN_SHIFT 3
1103#define USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_TYPE_MASK 0xF
1104#define USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_TYPE_SHIFT 4
1105 __le32 dif_err_intervals;
1106 __le32 dif_error_1st_interval;
1107 __le32 rcv_cont_len;
1108 __le32 exp_cont_len;
1109 __le32 total_data_acked;
1110 __le32 exp_data_acked;
1111 u8 next_tid_valid;
1112 u8 byte3;
1113 __le16 word1;
1114 __le16 next_tid;
1115 __le16 word3;
1116 __le32 hdr_residual_count;
1117 __le32 exp_r2t_sn;
1118};
1119
1120struct mstorm_iscsi_task_st_ctx {
1121 union iscsi_mstorm_sgl sgl_union;
1122 struct iscsi_dif_flags dif_flags;
1123 struct iscsi_mflags flags;
1124 u8 sgl_size;
1125 u8 host_sge_index;
1126 __le16 dix_cur_sge_offset;
1127 __le16 dix_cur_sge_size;
1128 __le32 data_offset_rtid;
1129 u8 dif_offset;
1130 u8 dix_sgl_size;
1131 u8 dix_sge_index;
1132 u8 task_type;
1133 struct regpair sense_db;
1134 struct regpair dix_sgl_cur_sge;
1135 __le32 rem_task_size;
1136 __le16 reuse_count;
1137 __le16 dif_data_residue;
1138 u8 reserved0[4];
1139 __le32 reserved1[1];
1140};
1141
1142struct ustorm_iscsi_task_st_ctx {
1143 __le32 rem_rcv_len;
1144 __le32 exp_data_transfer_len;
1145 __le32 exp_data_sn;
1146 struct regpair lun;
1147 struct iscsi_reg1 reg1;
1148 u8 flags2;
1149#define USTORM_ISCSI_TASK_ST_CTX_AHS_EXIST_MASK 0x1
1150#define USTORM_ISCSI_TASK_ST_CTX_AHS_EXIST_SHIFT 0
1151#define USTORM_ISCSI_TASK_ST_CTX_RESERVED1_MASK 0x7F
1152#define USTORM_ISCSI_TASK_ST_CTX_RESERVED1_SHIFT 1
1153 u8 reserved2;
1154 __le16 reserved3;
1155 __le32 reserved4;
1156 __le32 reserved5;
1157 __le32 reserved6;
1158 __le32 reserved7;
1159 u8 task_type;
1160 u8 error_flags;
1161#define USTORM_ISCSI_TASK_ST_CTX_DATA_DIGEST_ERROR_MASK 0x1
1162#define USTORM_ISCSI_TASK_ST_CTX_DATA_DIGEST_ERROR_SHIFT 0
1163#define USTORM_ISCSI_TASK_ST_CTX_DATA_TRUNCATED_ERROR_MASK 0x1
1164#define USTORM_ISCSI_TASK_ST_CTX_DATA_TRUNCATED_ERROR_SHIFT 1
1165#define USTORM_ISCSI_TASK_ST_CTX_UNDER_RUN_ERROR_MASK 0x1
1166#define USTORM_ISCSI_TASK_ST_CTX_UNDER_RUN_ERROR_SHIFT 2
1167#define USTORM_ISCSI_TASK_ST_CTX_RESERVED8_MASK 0x1F
1168#define USTORM_ISCSI_TASK_ST_CTX_RESERVED8_SHIFT 3
1169 u8 flags;
1170#define USTORM_ISCSI_TASK_ST_CTX_CQE_WRITE_MASK 0x3
1171#define USTORM_ISCSI_TASK_ST_CTX_CQE_WRITE_SHIFT 0
1172#define USTORM_ISCSI_TASK_ST_CTX_LOCAL_COMP_MASK 0x1
1173#define USTORM_ISCSI_TASK_ST_CTX_LOCAL_COMP_SHIFT 2
1174#define USTORM_ISCSI_TASK_ST_CTX_Q0_R2TQE_WRITE_MASK 0x1
1175#define USTORM_ISCSI_TASK_ST_CTX_Q0_R2TQE_WRITE_SHIFT 3
1176#define USTORM_ISCSI_TASK_ST_CTX_TOTALDATAACKED_DONE_MASK 0x1
1177#define USTORM_ISCSI_TASK_ST_CTX_TOTALDATAACKED_DONE_SHIFT 4
1178#define USTORM_ISCSI_TASK_ST_CTX_HQSCANNED_DONE_MASK 0x1
1179#define USTORM_ISCSI_TASK_ST_CTX_HQSCANNED_DONE_SHIFT 5
1180#define USTORM_ISCSI_TASK_ST_CTX_R2T2RECV_DONE_MASK 0x1
1181#define USTORM_ISCSI_TASK_ST_CTX_R2T2RECV_DONE_SHIFT 6
1182#define USTORM_ISCSI_TASK_ST_CTX_RESERVED0_MASK 0x1
1183#define USTORM_ISCSI_TASK_ST_CTX_RESERVED0_SHIFT 7
1184 u8 cq_rss_number;
1185};
1186
1187struct iscsi_task_context {
1188 struct ystorm_iscsi_task_st_ctx ystorm_st_context;
1189 struct regpair ystorm_st_padding[2];
1190 struct ystorm_iscsi_task_ag_ctx ystorm_ag_context;
1191 struct regpair ystorm_ag_padding[2];
1192 struct tdif_task_context tdif_context;
1193 struct mstorm_iscsi_task_ag_ctx mstorm_ag_context;
1194 struct regpair mstorm_ag_padding[2];
1195 struct ustorm_iscsi_task_ag_ctx ustorm_ag_context;
1196 struct mstorm_iscsi_task_st_ctx mstorm_st_context;
1197 struct ustorm_iscsi_task_st_ctx ustorm_st_context;
1198 struct rdif_task_context rdif_context;
1199};
1200
1201enum iscsi_task_type {
1202 ISCSI_TASK_TYPE_INITIATOR_WRITE,
1203 ISCSI_TASK_TYPE_INITIATOR_READ,
1204 ISCSI_TASK_TYPE_MIDPATH,
1205 ISCSI_TASK_TYPE_UNSOLIC,
1206 ISCSI_TASK_TYPE_EXCHCLEANUP,
1207 ISCSI_TASK_TYPE_IRRELEVANT,
1208 ISCSI_TASK_TYPE_TARGET_WRITE,
1209 ISCSI_TASK_TYPE_TARGET_READ,
1210 ISCSI_TASK_TYPE_TARGET_RESPONSE,
1211 ISCSI_TASK_TYPE_LOGIN_RESPONSE,
1212 MAX_ISCSI_TASK_TYPE
1213};
1214
1215union iscsi_ttt_txlen_union {
1216 __le32 desired_tx_len;
1217 __le32 ttt;
1218};
1219
1220struct iscsi_uhqe {
1221 __le32 reg1;
1222#define ISCSI_UHQE_PDU_PAYLOAD_LEN_MASK 0xFFFFF
1223#define ISCSI_UHQE_PDU_PAYLOAD_LEN_SHIFT 0
1224#define ISCSI_UHQE_LOCAL_COMP_MASK 0x1
1225#define ISCSI_UHQE_LOCAL_COMP_SHIFT 20
1226#define ISCSI_UHQE_TOGGLE_BIT_MASK 0x1
1227#define ISCSI_UHQE_TOGGLE_BIT_SHIFT 21
1228#define ISCSI_UHQE_PURE_PAYLOAD_MASK 0x1
1229#define ISCSI_UHQE_PURE_PAYLOAD_SHIFT 22
1230#define ISCSI_UHQE_LOGIN_RESPONSE_PDU_MASK 0x1
1231#define ISCSI_UHQE_LOGIN_RESPONSE_PDU_SHIFT 23
1232#define ISCSI_UHQE_TASK_ID_HI_MASK 0xFF
1233#define ISCSI_UHQE_TASK_ID_HI_SHIFT 24
1234 __le32 reg2;
1235#define ISCSI_UHQE_BUFFER_OFFSET_MASK 0xFFFFFF
1236#define ISCSI_UHQE_BUFFER_OFFSET_SHIFT 0
1237#define ISCSI_UHQE_TASK_ID_LO_MASK 0xFF
1238#define ISCSI_UHQE_TASK_ID_LO_SHIFT 24
1239};
1240
1241struct iscsi_wqe_field {
1242 __le32 contlen_cdbsize_field;
1243#define ISCSI_WQE_FIELD_CONT_LEN_MASK 0xFFFFFF
1244#define ISCSI_WQE_FIELD_CONT_LEN_SHIFT 0
1245#define ISCSI_WQE_FIELD_CDB_SIZE_MASK 0xFF
1246#define ISCSI_WQE_FIELD_CDB_SIZE_SHIFT 24
1247};
1248
1249union iscsi_wqe_field_union {
1250 struct iscsi_wqe_field cont_field;
1251 __le32 prev_tid;
1252};
1253
1254struct iscsi_wqe {
1255 __le16 task_id;
1256 u8 flags;
1257#define ISCSI_WQE_WQE_TYPE_MASK 0x7
1258#define ISCSI_WQE_WQE_TYPE_SHIFT 0
1259#define ISCSI_WQE_NUM_FAST_SGES_MASK 0x7
1260#define ISCSI_WQE_NUM_FAST_SGES_SHIFT 3
1261#define ISCSI_WQE_PTU_INVALIDATE_MASK 0x1
1262#define ISCSI_WQE_PTU_INVALIDATE_SHIFT 6
1263#define ISCSI_WQE_RESPONSE_MASK 0x1
1264#define ISCSI_WQE_RESPONSE_SHIFT 7
1265 struct iscsi_dif_flags prot_flags;
1266 union iscsi_wqe_field_union cont_prevtid_union;
1267};
1268
1269enum iscsi_wqe_type {
1270 ISCSI_WQE_TYPE_NORMAL,
1271 ISCSI_WQE_TYPE_TASK_CLEANUP,
1272 ISCSI_WQE_TYPE_MIDDLE_PATH,
1273 ISCSI_WQE_TYPE_LOGIN,
1274 ISCSI_WQE_TYPE_FIRST_R2T_CONT,
1275 ISCSI_WQE_TYPE_NONFIRST_R2T_CONT,
1276 ISCSI_WQE_TYPE_RESPONSE,
1277 MAX_ISCSI_WQE_TYPE
1278};
1279
1280struct iscsi_xhqe {
1281 union iscsi_ttt_txlen_union ttt_or_txlen;
1282 __le32 exp_stat_sn;
1283 struct iscsi_dif_flags prot_flags;
1284 u8 total_ahs_length;
1285 u8 opcode;
1286 u8 flags;
1287#define ISCSI_XHQE_NUM_FAST_SGES_MASK 0x7
1288#define ISCSI_XHQE_NUM_FAST_SGES_SHIFT 0
1289#define ISCSI_XHQE_FINAL_MASK 0x1
1290#define ISCSI_XHQE_FINAL_SHIFT 3
1291#define ISCSI_XHQE_SUPER_IO_MASK 0x1
1292#define ISCSI_XHQE_SUPER_IO_SHIFT 4
1293#define ISCSI_XHQE_STATUS_BIT_MASK 0x1
1294#define ISCSI_XHQE_STATUS_BIT_SHIFT 5
1295#define ISCSI_XHQE_RESERVED_MASK 0x3
1296#define ISCSI_XHQE_RESERVED_SHIFT 6
1297 union iscsi_seq_num seq_num_union;
1298 __le16 reserved1;
1299};
1300
1301struct mstorm_iscsi_stats_drv {
1302 struct regpair iscsi_rx_dropped_pdus_task_not_valid;
1303};
1304
1305struct ooo_opaque {
1306 __le32 cid;
1307 u8 drop_isle;
1308 u8 drop_size;
1309 u8 ooo_opcode;
1310 u8 ooo_isle;
1311};
1312
1313struct pstorm_iscsi_stats_drv {
1314 struct regpair iscsi_tx_bytes_cnt;
1315 struct regpair iscsi_tx_packet_cnt;
1316};
1317
1318struct tstorm_iscsi_stats_drv {
1319 struct regpair iscsi_rx_bytes_cnt;
1320 struct regpair iscsi_rx_packet_cnt;
1321 struct regpair iscsi_rx_new_ooo_isle_events_cnt;
1322 __le32 iscsi_cmdq_threshold_cnt;
1323 __le32 iscsi_rq_threshold_cnt;
1324 __le32 iscsi_immq_threshold_cnt;
1325};
1326
1327struct ustorm_iscsi_stats_drv {
1328 struct regpair iscsi_rx_data_pdu_cnt;
1329 struct regpair iscsi_rx_r2t_pdu_cnt;
1330 struct regpair iscsi_rx_total_pdu_cnt;
1331};
1332
1333struct xstorm_iscsi_stats_drv {
1334 struct regpair iscsi_tx_go_to_slow_start_event_cnt;
1335 struct regpair iscsi_tx_fast_retransmit_event_cnt;
1336};
1337
1338struct ystorm_iscsi_stats_drv {
1339 struct regpair iscsi_tx_data_pdu_cnt;
1340 struct regpair iscsi_tx_r2t_pdu_cnt;
1341 struct regpair iscsi_tx_total_pdu_cnt;
1342};
1343
1344struct iscsi_db_data {
1345 u8 params;
1346#define ISCSI_DB_DATA_DEST_MASK 0x3
1347#define ISCSI_DB_DATA_DEST_SHIFT 0
1348#define ISCSI_DB_DATA_AGG_CMD_MASK 0x3
1349#define ISCSI_DB_DATA_AGG_CMD_SHIFT 2
1350#define ISCSI_DB_DATA_BYPASS_EN_MASK 0x1
1351#define ISCSI_DB_DATA_BYPASS_EN_SHIFT 4
1352#define ISCSI_DB_DATA_RESERVED_MASK 0x1
1353#define ISCSI_DB_DATA_RESERVED_SHIFT 5
1354#define ISCSI_DB_DATA_AGG_VAL_SEL_MASK 0x3
1355#define ISCSI_DB_DATA_AGG_VAL_SEL_SHIFT 6
1356 u8 agg_flags;
1357 __le16 sq_prod;
1358};
1359
1360struct tstorm_iscsi_task_ag_ctx {
1361 u8 byte0;
1362 u8 byte1;
1363 __le16 word0;
1364 u8 flags0;
1365#define TSTORM_ISCSI_TASK_AG_CTX_NIBBLE0_MASK 0xF
1366#define TSTORM_ISCSI_TASK_AG_CTX_NIBBLE0_SHIFT 0
1367#define TSTORM_ISCSI_TASK_AG_CTX_BIT0_MASK 0x1
1368#define TSTORM_ISCSI_TASK_AG_CTX_BIT0_SHIFT 4
1369#define TSTORM_ISCSI_TASK_AG_CTX_BIT1_MASK 0x1
1370#define TSTORM_ISCSI_TASK_AG_CTX_BIT1_SHIFT 5
1371#define TSTORM_ISCSI_TASK_AG_CTX_BIT2_MASK 0x1
1372#define TSTORM_ISCSI_TASK_AG_CTX_BIT2_SHIFT 6
1373#define TSTORM_ISCSI_TASK_AG_CTX_BIT3_MASK 0x1
1374#define TSTORM_ISCSI_TASK_AG_CTX_BIT3_SHIFT 7
1375 u8 flags1;
1376#define TSTORM_ISCSI_TASK_AG_CTX_BIT4_MASK 0x1
1377#define TSTORM_ISCSI_TASK_AG_CTX_BIT4_SHIFT 0
1378#define TSTORM_ISCSI_TASK_AG_CTX_BIT5_MASK 0x1
1379#define TSTORM_ISCSI_TASK_AG_CTX_BIT5_SHIFT 1
1380#define TSTORM_ISCSI_TASK_AG_CTX_CF0_MASK 0x3
1381#define TSTORM_ISCSI_TASK_AG_CTX_CF0_SHIFT 2
1382#define TSTORM_ISCSI_TASK_AG_CTX_CF1_MASK 0x3
1383#define TSTORM_ISCSI_TASK_AG_CTX_CF1_SHIFT 4
1384#define TSTORM_ISCSI_TASK_AG_CTX_CF2_MASK 0x3
1385#define TSTORM_ISCSI_TASK_AG_CTX_CF2_SHIFT 6
1386 u8 flags2;
1387#define TSTORM_ISCSI_TASK_AG_CTX_CF3_MASK 0x3
1388#define TSTORM_ISCSI_TASK_AG_CTX_CF3_SHIFT 0
1389#define TSTORM_ISCSI_TASK_AG_CTX_CF4_MASK 0x3
1390#define TSTORM_ISCSI_TASK_AG_CTX_CF4_SHIFT 2
1391#define TSTORM_ISCSI_TASK_AG_CTX_CF5_MASK 0x3
1392#define TSTORM_ISCSI_TASK_AG_CTX_CF5_SHIFT 4
1393#define TSTORM_ISCSI_TASK_AG_CTX_CF6_MASK 0x3
1394#define TSTORM_ISCSI_TASK_AG_CTX_CF6_SHIFT 6
1395 u8 flags3;
1396#define TSTORM_ISCSI_TASK_AG_CTX_CF7_MASK 0x3
1397#define TSTORM_ISCSI_TASK_AG_CTX_CF7_SHIFT 0
1398#define TSTORM_ISCSI_TASK_AG_CTX_CF0EN_MASK 0x1
1399#define TSTORM_ISCSI_TASK_AG_CTX_CF0EN_SHIFT 2
1400#define TSTORM_ISCSI_TASK_AG_CTX_CF1EN_MASK 0x1
1401#define TSTORM_ISCSI_TASK_AG_CTX_CF1EN_SHIFT 3
1402#define TSTORM_ISCSI_TASK_AG_CTX_CF2EN_MASK 0x1
1403#define TSTORM_ISCSI_TASK_AG_CTX_CF2EN_SHIFT 4
1404#define TSTORM_ISCSI_TASK_AG_CTX_CF3EN_MASK 0x1
1405#define TSTORM_ISCSI_TASK_AG_CTX_CF3EN_SHIFT 5
1406#define TSTORM_ISCSI_TASK_AG_CTX_CF4EN_MASK 0x1
1407#define TSTORM_ISCSI_TASK_AG_CTX_CF4EN_SHIFT 6
1408#define TSTORM_ISCSI_TASK_AG_CTX_CF5EN_MASK 0x1
1409#define TSTORM_ISCSI_TASK_AG_CTX_CF5EN_SHIFT 7
1410 u8 flags4;
1411#define TSTORM_ISCSI_TASK_AG_CTX_CF6EN_MASK 0x1
1412#define TSTORM_ISCSI_TASK_AG_CTX_CF6EN_SHIFT 0
1413#define TSTORM_ISCSI_TASK_AG_CTX_CF7EN_MASK 0x1
1414#define TSTORM_ISCSI_TASK_AG_CTX_CF7EN_SHIFT 1
1415#define TSTORM_ISCSI_TASK_AG_CTX_RULE0EN_MASK 0x1
1416#define TSTORM_ISCSI_TASK_AG_CTX_RULE0EN_SHIFT 2
1417#define TSTORM_ISCSI_TASK_AG_CTX_RULE1EN_MASK 0x1
1418#define TSTORM_ISCSI_TASK_AG_CTX_RULE1EN_SHIFT 3
1419#define TSTORM_ISCSI_TASK_AG_CTX_RULE2EN_MASK 0x1
1420#define TSTORM_ISCSI_TASK_AG_CTX_RULE2EN_SHIFT 4
1421#define TSTORM_ISCSI_TASK_AG_CTX_RULE3EN_MASK 0x1
1422#define TSTORM_ISCSI_TASK_AG_CTX_RULE3EN_SHIFT 5
1423#define TSTORM_ISCSI_TASK_AG_CTX_RULE4EN_MASK 0x1
1424#define TSTORM_ISCSI_TASK_AG_CTX_RULE4EN_SHIFT 6
1425#define TSTORM_ISCSI_TASK_AG_CTX_RULE5EN_MASK 0x1
1426#define TSTORM_ISCSI_TASK_AG_CTX_RULE5EN_SHIFT 7
1427 u8 byte2;
1428 __le16 word1;
1429 __le32 reg0;
1430 u8 byte3;
1431 u8 byte4;
1432 __le16 word2;
1433 __le16 word3;
1434 __le16 word4;
1435 __le32 reg1;
1436 __le32 reg2;
1437};
1438
1439#endif /* __ISCSI_COMMON__ */