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