162306a36Sopenharmony_ci/* 57xx_iscsi_hsi.h: QLogic NetXtreme II iSCSI HSI.
262306a36Sopenharmony_ci *
362306a36Sopenharmony_ci * Copyright (c) 2006 - 2013 Broadcom Corporation
462306a36Sopenharmony_ci * Copyright (c) 2014, QLogic Corporation
562306a36Sopenharmony_ci *
662306a36Sopenharmony_ci * This program is free software; you can redistribute it and/or modify
762306a36Sopenharmony_ci * it under the terms of the GNU General Public License as published by
862306a36Sopenharmony_ci * the Free Software Foundation.
962306a36Sopenharmony_ci *
1062306a36Sopenharmony_ci * Written by: Anil Veerabhadrappa (anilgv@broadcom.com)
1162306a36Sopenharmony_ci * Previously Maintained by: Eddie Wai (eddie.wai@broadcom.com)
1262306a36Sopenharmony_ci * Maintained by: QLogic-Storage-Upstream@qlogic.com
1362306a36Sopenharmony_ci */
1462306a36Sopenharmony_ci#ifndef __57XX_ISCSI_HSI_LINUX_LE__
1562306a36Sopenharmony_ci#define __57XX_ISCSI_HSI_LINUX_LE__
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ci/*
1862306a36Sopenharmony_ci * iSCSI Async CQE
1962306a36Sopenharmony_ci */
2062306a36Sopenharmony_cistruct bnx2i_async_msg {
2162306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
2262306a36Sopenharmony_ci	u8 op_code;
2362306a36Sopenharmony_ci	u8 reserved1;
2462306a36Sopenharmony_ci	u16 reserved0;
2562306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
2662306a36Sopenharmony_ci	u16 reserved0;
2762306a36Sopenharmony_ci	u8 reserved1;
2862306a36Sopenharmony_ci	u8 op_code;
2962306a36Sopenharmony_ci#endif
3062306a36Sopenharmony_ci	u32 reserved2;
3162306a36Sopenharmony_ci	u32 exp_cmd_sn;
3262306a36Sopenharmony_ci	u32 max_cmd_sn;
3362306a36Sopenharmony_ci	u32 reserved3[2];
3462306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
3562306a36Sopenharmony_ci	u16 reserved5;
3662306a36Sopenharmony_ci	u8 err_code;
3762306a36Sopenharmony_ci	u8 reserved4;
3862306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
3962306a36Sopenharmony_ci	u8 reserved4;
4062306a36Sopenharmony_ci	u8 err_code;
4162306a36Sopenharmony_ci	u16 reserved5;
4262306a36Sopenharmony_ci#endif
4362306a36Sopenharmony_ci	u32 reserved6;
4462306a36Sopenharmony_ci	u32 lun[2];
4562306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
4662306a36Sopenharmony_ci	u8 async_event;
4762306a36Sopenharmony_ci	u8 async_vcode;
4862306a36Sopenharmony_ci	u16 param1;
4962306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
5062306a36Sopenharmony_ci	u16 param1;
5162306a36Sopenharmony_ci	u8 async_vcode;
5262306a36Sopenharmony_ci	u8 async_event;
5362306a36Sopenharmony_ci#endif
5462306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
5562306a36Sopenharmony_ci	u16 param2;
5662306a36Sopenharmony_ci	u16 param3;
5762306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
5862306a36Sopenharmony_ci	u16 param3;
5962306a36Sopenharmony_ci	u16 param2;
6062306a36Sopenharmony_ci#endif
6162306a36Sopenharmony_ci	u32 reserved7[3];
6262306a36Sopenharmony_ci	u32 cq_req_sn;
6362306a36Sopenharmony_ci};
6462306a36Sopenharmony_ci
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_ci/*
6762306a36Sopenharmony_ci * iSCSI Buffer Descriptor (BD)
6862306a36Sopenharmony_ci */
6962306a36Sopenharmony_cistruct iscsi_bd {
7062306a36Sopenharmony_ci	u32 buffer_addr_hi;
7162306a36Sopenharmony_ci	u32 buffer_addr_lo;
7262306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
7362306a36Sopenharmony_ci	u16 reserved0;
7462306a36Sopenharmony_ci	u16 buffer_length;
7562306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
7662306a36Sopenharmony_ci	u16 buffer_length;
7762306a36Sopenharmony_ci	u16 reserved0;
7862306a36Sopenharmony_ci#endif
7962306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
8062306a36Sopenharmony_ci	u16 reserved3;
8162306a36Sopenharmony_ci	u16 flags;
8262306a36Sopenharmony_ci#define ISCSI_BD_RESERVED1 (0x3F<<0)
8362306a36Sopenharmony_ci#define ISCSI_BD_RESERVED1_SHIFT 0
8462306a36Sopenharmony_ci#define ISCSI_BD_LAST_IN_BD_CHAIN (0x1<<6)
8562306a36Sopenharmony_ci#define ISCSI_BD_LAST_IN_BD_CHAIN_SHIFT 6
8662306a36Sopenharmony_ci#define ISCSI_BD_FIRST_IN_BD_CHAIN (0x1<<7)
8762306a36Sopenharmony_ci#define ISCSI_BD_FIRST_IN_BD_CHAIN_SHIFT 7
8862306a36Sopenharmony_ci#define ISCSI_BD_RESERVED2 (0xFF<<8)
8962306a36Sopenharmony_ci#define ISCSI_BD_RESERVED2_SHIFT 8
9062306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
9162306a36Sopenharmony_ci	u16 flags;
9262306a36Sopenharmony_ci#define ISCSI_BD_RESERVED1 (0x3F<<0)
9362306a36Sopenharmony_ci#define ISCSI_BD_RESERVED1_SHIFT 0
9462306a36Sopenharmony_ci#define ISCSI_BD_LAST_IN_BD_CHAIN (0x1<<6)
9562306a36Sopenharmony_ci#define ISCSI_BD_LAST_IN_BD_CHAIN_SHIFT 6
9662306a36Sopenharmony_ci#define ISCSI_BD_FIRST_IN_BD_CHAIN (0x1<<7)
9762306a36Sopenharmony_ci#define ISCSI_BD_FIRST_IN_BD_CHAIN_SHIFT 7
9862306a36Sopenharmony_ci#define ISCSI_BD_RESERVED2 (0xFF<<8)
9962306a36Sopenharmony_ci#define ISCSI_BD_RESERVED2_SHIFT 8
10062306a36Sopenharmony_ci	u16 reserved3;
10162306a36Sopenharmony_ci#endif
10262306a36Sopenharmony_ci};
10362306a36Sopenharmony_ci
10462306a36Sopenharmony_ci
10562306a36Sopenharmony_ci/*
10662306a36Sopenharmony_ci * iSCSI Cleanup SQ WQE
10762306a36Sopenharmony_ci */
10862306a36Sopenharmony_cistruct bnx2i_cleanup_request {
10962306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
11062306a36Sopenharmony_ci	u8 op_code;
11162306a36Sopenharmony_ci	u8 reserved1;
11262306a36Sopenharmony_ci	u16 reserved0;
11362306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
11462306a36Sopenharmony_ci	u16 reserved0;
11562306a36Sopenharmony_ci	u8 reserved1;
11662306a36Sopenharmony_ci	u8 op_code;
11762306a36Sopenharmony_ci#endif
11862306a36Sopenharmony_ci	u32 reserved2[3];
11962306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
12062306a36Sopenharmony_ci	u16 reserved3;
12162306a36Sopenharmony_ci	u16 itt;
12262306a36Sopenharmony_ci#define ISCSI_CLEANUP_REQUEST_INDEX (0x3FFF<<0)
12362306a36Sopenharmony_ci#define ISCSI_CLEANUP_REQUEST_INDEX_SHIFT 0
12462306a36Sopenharmony_ci#define ISCSI_CLEANUP_REQUEST_TYPE (0x3<<14)
12562306a36Sopenharmony_ci#define ISCSI_CLEANUP_REQUEST_TYPE_SHIFT 14
12662306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
12762306a36Sopenharmony_ci	u16 itt;
12862306a36Sopenharmony_ci#define ISCSI_CLEANUP_REQUEST_INDEX (0x3FFF<<0)
12962306a36Sopenharmony_ci#define ISCSI_CLEANUP_REQUEST_INDEX_SHIFT 0
13062306a36Sopenharmony_ci#define ISCSI_CLEANUP_REQUEST_TYPE (0x3<<14)
13162306a36Sopenharmony_ci#define ISCSI_CLEANUP_REQUEST_TYPE_SHIFT 14
13262306a36Sopenharmony_ci	u16 reserved3;
13362306a36Sopenharmony_ci#endif
13462306a36Sopenharmony_ci	u32 reserved4[10];
13562306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
13662306a36Sopenharmony_ci	u8 cq_index;
13762306a36Sopenharmony_ci	u8 reserved6;
13862306a36Sopenharmony_ci	u16 reserved5;
13962306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
14062306a36Sopenharmony_ci	u16 reserved5;
14162306a36Sopenharmony_ci	u8 reserved6;
14262306a36Sopenharmony_ci	u8 cq_index;
14362306a36Sopenharmony_ci#endif
14462306a36Sopenharmony_ci};
14562306a36Sopenharmony_ci
14662306a36Sopenharmony_ci
14762306a36Sopenharmony_ci/*
14862306a36Sopenharmony_ci * iSCSI Cleanup CQE
14962306a36Sopenharmony_ci */
15062306a36Sopenharmony_cistruct bnx2i_cleanup_response {
15162306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
15262306a36Sopenharmony_ci	u8 op_code;
15362306a36Sopenharmony_ci	u8 status;
15462306a36Sopenharmony_ci	u16 reserved0;
15562306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
15662306a36Sopenharmony_ci	u16 reserved0;
15762306a36Sopenharmony_ci	u8 status;
15862306a36Sopenharmony_ci	u8 op_code;
15962306a36Sopenharmony_ci#endif
16062306a36Sopenharmony_ci	u32 reserved1[3];
16162306a36Sopenharmony_ci	u32 reserved2[2];
16262306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
16362306a36Sopenharmony_ci	u16 reserved4;
16462306a36Sopenharmony_ci	u8 err_code;
16562306a36Sopenharmony_ci	u8 reserved3;
16662306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
16762306a36Sopenharmony_ci	u8 reserved3;
16862306a36Sopenharmony_ci	u8 err_code;
16962306a36Sopenharmony_ci	u16 reserved4;
17062306a36Sopenharmony_ci#endif
17162306a36Sopenharmony_ci	u32 reserved5[7];
17262306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
17362306a36Sopenharmony_ci	u16 reserved6;
17462306a36Sopenharmony_ci	u16 itt;
17562306a36Sopenharmony_ci#define ISCSI_CLEANUP_RESPONSE_INDEX (0x3FFF<<0)
17662306a36Sopenharmony_ci#define ISCSI_CLEANUP_RESPONSE_INDEX_SHIFT 0
17762306a36Sopenharmony_ci#define ISCSI_CLEANUP_RESPONSE_TYPE (0x3<<14)
17862306a36Sopenharmony_ci#define ISCSI_CLEANUP_RESPONSE_TYPE_SHIFT 14
17962306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
18062306a36Sopenharmony_ci	u16 itt;
18162306a36Sopenharmony_ci#define ISCSI_CLEANUP_RESPONSE_INDEX (0x3FFF<<0)
18262306a36Sopenharmony_ci#define ISCSI_CLEANUP_RESPONSE_INDEX_SHIFT 0
18362306a36Sopenharmony_ci#define ISCSI_CLEANUP_RESPONSE_TYPE (0x3<<14)
18462306a36Sopenharmony_ci#define ISCSI_CLEANUP_RESPONSE_TYPE_SHIFT 14
18562306a36Sopenharmony_ci	u16 reserved6;
18662306a36Sopenharmony_ci#endif
18762306a36Sopenharmony_ci	u32 cq_req_sn;
18862306a36Sopenharmony_ci};
18962306a36Sopenharmony_ci
19062306a36Sopenharmony_ci
19162306a36Sopenharmony_ci/*
19262306a36Sopenharmony_ci * SCSI read/write SQ WQE
19362306a36Sopenharmony_ci */
19462306a36Sopenharmony_cistruct bnx2i_cmd_request {
19562306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
19662306a36Sopenharmony_ci	u8 op_code;
19762306a36Sopenharmony_ci	u8 op_attr;
19862306a36Sopenharmony_ci#define ISCSI_CMD_REQUEST_TASK_ATTR (0x7<<0)
19962306a36Sopenharmony_ci#define ISCSI_CMD_REQUEST_TASK_ATTR_SHIFT 0
20062306a36Sopenharmony_ci#define ISCSI_CMD_REQUEST_RESERVED1 (0x3<<3)
20162306a36Sopenharmony_ci#define ISCSI_CMD_REQUEST_RESERVED1_SHIFT 3
20262306a36Sopenharmony_ci#define ISCSI_CMD_REQUEST_WRITE (0x1<<5)
20362306a36Sopenharmony_ci#define ISCSI_CMD_REQUEST_WRITE_SHIFT 5
20462306a36Sopenharmony_ci#define ISCSI_CMD_REQUEST_READ (0x1<<6)
20562306a36Sopenharmony_ci#define ISCSI_CMD_REQUEST_READ_SHIFT 6
20662306a36Sopenharmony_ci#define ISCSI_CMD_REQUEST_FINAL (0x1<<7)
20762306a36Sopenharmony_ci#define ISCSI_CMD_REQUEST_FINAL_SHIFT 7
20862306a36Sopenharmony_ci	u16 reserved0;
20962306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
21062306a36Sopenharmony_ci	u16 reserved0;
21162306a36Sopenharmony_ci	u8 op_attr;
21262306a36Sopenharmony_ci#define ISCSI_CMD_REQUEST_TASK_ATTR (0x7<<0)
21362306a36Sopenharmony_ci#define ISCSI_CMD_REQUEST_TASK_ATTR_SHIFT 0
21462306a36Sopenharmony_ci#define ISCSI_CMD_REQUEST_RESERVED1 (0x3<<3)
21562306a36Sopenharmony_ci#define ISCSI_CMD_REQUEST_RESERVED1_SHIFT 3
21662306a36Sopenharmony_ci#define ISCSI_CMD_REQUEST_WRITE (0x1<<5)
21762306a36Sopenharmony_ci#define ISCSI_CMD_REQUEST_WRITE_SHIFT 5
21862306a36Sopenharmony_ci#define ISCSI_CMD_REQUEST_READ (0x1<<6)
21962306a36Sopenharmony_ci#define ISCSI_CMD_REQUEST_READ_SHIFT 6
22062306a36Sopenharmony_ci#define ISCSI_CMD_REQUEST_FINAL (0x1<<7)
22162306a36Sopenharmony_ci#define ISCSI_CMD_REQUEST_FINAL_SHIFT 7
22262306a36Sopenharmony_ci	u8 op_code;
22362306a36Sopenharmony_ci#endif
22462306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
22562306a36Sopenharmony_ci	u16 ud_buffer_offset;
22662306a36Sopenharmony_ci	u16 sd_buffer_offset;
22762306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
22862306a36Sopenharmony_ci	u16 sd_buffer_offset;
22962306a36Sopenharmony_ci	u16 ud_buffer_offset;
23062306a36Sopenharmony_ci#endif
23162306a36Sopenharmony_ci	u32 lun[2];
23262306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
23362306a36Sopenharmony_ci	u16 reserved2;
23462306a36Sopenharmony_ci	u16 itt;
23562306a36Sopenharmony_ci#define ISCSI_CMD_REQUEST_INDEX (0x3FFF<<0)
23662306a36Sopenharmony_ci#define ISCSI_CMD_REQUEST_INDEX_SHIFT 0
23762306a36Sopenharmony_ci#define ISCSI_CMD_REQUEST_TYPE (0x3<<14)
23862306a36Sopenharmony_ci#define ISCSI_CMD_REQUEST_TYPE_SHIFT 14
23962306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
24062306a36Sopenharmony_ci	u16 itt;
24162306a36Sopenharmony_ci#define ISCSI_CMD_REQUEST_INDEX (0x3FFF<<0)
24262306a36Sopenharmony_ci#define ISCSI_CMD_REQUEST_INDEX_SHIFT 0
24362306a36Sopenharmony_ci#define ISCSI_CMD_REQUEST_TYPE (0x3<<14)
24462306a36Sopenharmony_ci#define ISCSI_CMD_REQUEST_TYPE_SHIFT 14
24562306a36Sopenharmony_ci	u16 reserved2;
24662306a36Sopenharmony_ci#endif
24762306a36Sopenharmony_ci	u32 total_data_transfer_length;
24862306a36Sopenharmony_ci	u32 cmd_sn;
24962306a36Sopenharmony_ci	u32 reserved3;
25062306a36Sopenharmony_ci	u32 cdb[4];
25162306a36Sopenharmony_ci	u32 zero_fill;
25262306a36Sopenharmony_ci	u32 bd_list_addr_lo;
25362306a36Sopenharmony_ci	u32 bd_list_addr_hi;
25462306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
25562306a36Sopenharmony_ci	u8 cq_index;
25662306a36Sopenharmony_ci	u8 sd_start_bd_index;
25762306a36Sopenharmony_ci	u8 ud_start_bd_index;
25862306a36Sopenharmony_ci	u8 num_bds;
25962306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
26062306a36Sopenharmony_ci	u8 num_bds;
26162306a36Sopenharmony_ci	u8 ud_start_bd_index;
26262306a36Sopenharmony_ci	u8 sd_start_bd_index;
26362306a36Sopenharmony_ci	u8 cq_index;
26462306a36Sopenharmony_ci#endif
26562306a36Sopenharmony_ci};
26662306a36Sopenharmony_ci
26762306a36Sopenharmony_ci
26862306a36Sopenharmony_ci/*
26962306a36Sopenharmony_ci * task statistics for write response
27062306a36Sopenharmony_ci */
27162306a36Sopenharmony_cistruct bnx2i_write_resp_task_stat {
27262306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
27362306a36Sopenharmony_ci	u16 num_r2ts;
27462306a36Sopenharmony_ci	u16 num_data_outs;
27562306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
27662306a36Sopenharmony_ci	u16 num_data_outs;
27762306a36Sopenharmony_ci	u16 num_r2ts;
27862306a36Sopenharmony_ci#endif
27962306a36Sopenharmony_ci};
28062306a36Sopenharmony_ci
28162306a36Sopenharmony_ci/*
28262306a36Sopenharmony_ci * task statistics for read response
28362306a36Sopenharmony_ci */
28462306a36Sopenharmony_cistruct bnx2i_read_resp_task_stat {
28562306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
28662306a36Sopenharmony_ci	u16 reserved;
28762306a36Sopenharmony_ci	u16 num_data_ins;
28862306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
28962306a36Sopenharmony_ci	u16 num_data_ins;
29062306a36Sopenharmony_ci	u16 reserved;
29162306a36Sopenharmony_ci#endif
29262306a36Sopenharmony_ci};
29362306a36Sopenharmony_ci
29462306a36Sopenharmony_ci/*
29562306a36Sopenharmony_ci * task statistics for iSCSI cmd response
29662306a36Sopenharmony_ci */
29762306a36Sopenharmony_ciunion bnx2i_cmd_resp_task_stat {
29862306a36Sopenharmony_ci	struct bnx2i_write_resp_task_stat write_stat;
29962306a36Sopenharmony_ci	struct bnx2i_read_resp_task_stat read_stat;
30062306a36Sopenharmony_ci};
30162306a36Sopenharmony_ci
30262306a36Sopenharmony_ci/*
30362306a36Sopenharmony_ci * SCSI Command CQE
30462306a36Sopenharmony_ci */
30562306a36Sopenharmony_cistruct bnx2i_cmd_response {
30662306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
30762306a36Sopenharmony_ci	u8 op_code;
30862306a36Sopenharmony_ci	u8 response_flags;
30962306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_RESERVED0 (0x1<<0)
31062306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_RESERVED0_SHIFT 0
31162306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_RESIDUAL_UNDERFLOW (0x1<<1)
31262306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_RESIDUAL_UNDERFLOW_SHIFT 1
31362306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_RESIDUAL_OVERFLOW (0x1<<2)
31462306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_RESIDUAL_OVERFLOW_SHIFT 2
31562306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_BR_RESIDUAL_UNDERFLOW (0x1<<3)
31662306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_BR_RESIDUAL_UNDERFLOW_SHIFT 3
31762306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_BR_RESIDUAL_OVERFLOW (0x1<<4)
31862306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_BR_RESIDUAL_OVERFLOW_SHIFT 4
31962306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_RESERVED1 (0x7<<5)
32062306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_RESERVED1_SHIFT 5
32162306a36Sopenharmony_ci	u8 response;
32262306a36Sopenharmony_ci	u8 status;
32362306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
32462306a36Sopenharmony_ci	u8 status;
32562306a36Sopenharmony_ci	u8 response;
32662306a36Sopenharmony_ci	u8 response_flags;
32762306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_RESERVED0 (0x1<<0)
32862306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_RESERVED0_SHIFT 0
32962306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_RESIDUAL_UNDERFLOW (0x1<<1)
33062306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_RESIDUAL_UNDERFLOW_SHIFT 1
33162306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_RESIDUAL_OVERFLOW (0x1<<2)
33262306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_RESIDUAL_OVERFLOW_SHIFT 2
33362306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_BR_RESIDUAL_UNDERFLOW (0x1<<3)
33462306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_BR_RESIDUAL_UNDERFLOW_SHIFT 3
33562306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_BR_RESIDUAL_OVERFLOW (0x1<<4)
33662306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_BR_RESIDUAL_OVERFLOW_SHIFT 4
33762306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_RESERVED1 (0x7<<5)
33862306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_RESERVED1_SHIFT 5
33962306a36Sopenharmony_ci	u8 op_code;
34062306a36Sopenharmony_ci#endif
34162306a36Sopenharmony_ci	u32 data_length;
34262306a36Sopenharmony_ci	u32 exp_cmd_sn;
34362306a36Sopenharmony_ci	u32 max_cmd_sn;
34462306a36Sopenharmony_ci	u32 reserved2;
34562306a36Sopenharmony_ci	u32 residual_count;
34662306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
34762306a36Sopenharmony_ci	u16 reserved4;
34862306a36Sopenharmony_ci	u8 err_code;
34962306a36Sopenharmony_ci	u8 reserved3;
35062306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
35162306a36Sopenharmony_ci	u8 reserved3;
35262306a36Sopenharmony_ci	u8 err_code;
35362306a36Sopenharmony_ci	u16 reserved4;
35462306a36Sopenharmony_ci#endif
35562306a36Sopenharmony_ci	u32 reserved5[5];
35662306a36Sopenharmony_ci	union bnx2i_cmd_resp_task_stat task_stat;
35762306a36Sopenharmony_ci	u32 reserved6;
35862306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
35962306a36Sopenharmony_ci	u16 reserved7;
36062306a36Sopenharmony_ci	u16 itt;
36162306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_INDEX (0x3FFF<<0)
36262306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_INDEX_SHIFT 0
36362306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_TYPE (0x3<<14)
36462306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_TYPE_SHIFT 14
36562306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
36662306a36Sopenharmony_ci	u16 itt;
36762306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_INDEX (0x3FFF<<0)
36862306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_INDEX_SHIFT 0
36962306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_TYPE (0x3<<14)
37062306a36Sopenharmony_ci#define ISCSI_CMD_RESPONSE_TYPE_SHIFT 14
37162306a36Sopenharmony_ci	u16 reserved7;
37262306a36Sopenharmony_ci#endif
37362306a36Sopenharmony_ci	u32 cq_req_sn;
37462306a36Sopenharmony_ci};
37562306a36Sopenharmony_ci
37662306a36Sopenharmony_ci
37762306a36Sopenharmony_ci
37862306a36Sopenharmony_ci/*
37962306a36Sopenharmony_ci * firmware middle-path request SQ WQE
38062306a36Sopenharmony_ci */
38162306a36Sopenharmony_cistruct bnx2i_fw_mp_request {
38262306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
38362306a36Sopenharmony_ci	u8 op_code;
38462306a36Sopenharmony_ci	u8 op_attr;
38562306a36Sopenharmony_ci	u16 hdr_opaque1;
38662306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
38762306a36Sopenharmony_ci	u16 hdr_opaque1;
38862306a36Sopenharmony_ci	u8 op_attr;
38962306a36Sopenharmony_ci	u8 op_code;
39062306a36Sopenharmony_ci#endif
39162306a36Sopenharmony_ci	u32 data_length;
39262306a36Sopenharmony_ci	u32 hdr_opaque2[2];
39362306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
39462306a36Sopenharmony_ci	u16 reserved0;
39562306a36Sopenharmony_ci	u16 itt;
39662306a36Sopenharmony_ci#define ISCSI_FW_MP_REQUEST_INDEX (0x3FFF<<0)
39762306a36Sopenharmony_ci#define ISCSI_FW_MP_REQUEST_INDEX_SHIFT 0
39862306a36Sopenharmony_ci#define ISCSI_FW_MP_REQUEST_TYPE (0x3<<14)
39962306a36Sopenharmony_ci#define ISCSI_FW_MP_REQUEST_TYPE_SHIFT 14
40062306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
40162306a36Sopenharmony_ci	u16 itt;
40262306a36Sopenharmony_ci#define ISCSI_FW_MP_REQUEST_INDEX (0x3FFF<<0)
40362306a36Sopenharmony_ci#define ISCSI_FW_MP_REQUEST_INDEX_SHIFT 0
40462306a36Sopenharmony_ci#define ISCSI_FW_MP_REQUEST_TYPE (0x3<<14)
40562306a36Sopenharmony_ci#define ISCSI_FW_MP_REQUEST_TYPE_SHIFT 14
40662306a36Sopenharmony_ci	u16 reserved0;
40762306a36Sopenharmony_ci#endif
40862306a36Sopenharmony_ci	u32 hdr_opaque3[4];
40962306a36Sopenharmony_ci	u32 resp_bd_list_addr_lo;
41062306a36Sopenharmony_ci	u32 resp_bd_list_addr_hi;
41162306a36Sopenharmony_ci	u32 resp_buffer;
41262306a36Sopenharmony_ci#define ISCSI_FW_MP_REQUEST_RESP_BUFFER_LENGTH (0xFFFFFF<<0)
41362306a36Sopenharmony_ci#define ISCSI_FW_MP_REQUEST_RESP_BUFFER_LENGTH_SHIFT 0
41462306a36Sopenharmony_ci#define ISCSI_FW_MP_REQUEST_NUM_RESP_BDS (0xFF<<24)
41562306a36Sopenharmony_ci#define ISCSI_FW_MP_REQUEST_NUM_RESP_BDS_SHIFT 24
41662306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
41762306a36Sopenharmony_ci	u16 reserved4;
41862306a36Sopenharmony_ci	u8 reserved3;
41962306a36Sopenharmony_ci	u8 flags;
42062306a36Sopenharmony_ci#define ISCSI_FW_MP_REQUEST_RESERVED1 (0x1<<0)
42162306a36Sopenharmony_ci#define ISCSI_FW_MP_REQUEST_RESERVED1_SHIFT 0
42262306a36Sopenharmony_ci#define ISCSI_FW_MP_REQUEST_LOCAL_COMPLETION (0x1<<1)
42362306a36Sopenharmony_ci#define ISCSI_FW_MP_REQUEST_LOCAL_COMPLETION_SHIFT 1
42462306a36Sopenharmony_ci#define ISCSI_FW_MP_REQUEST_UPDATE_EXP_STAT_SN (0x1<<2)
42562306a36Sopenharmony_ci#define ISCSI_FW_MP_REQUEST_UPDATE_EXP_STAT_SN_SHIFT 2
42662306a36Sopenharmony_ci#define ISCSI_FW_MP_REQUEST_RESERVED2 (0x1F<<3)
42762306a36Sopenharmony_ci#define ISCSI_FW_MP_REQUEST_RESERVED2_SHIFT 3
42862306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
42962306a36Sopenharmony_ci	u8 flags;
43062306a36Sopenharmony_ci#define ISCSI_FW_MP_REQUEST_RESERVED1 (0x1<<0)
43162306a36Sopenharmony_ci#define ISCSI_FW_MP_REQUEST_RESERVED1_SHIFT 0
43262306a36Sopenharmony_ci#define ISCSI_FW_MP_REQUEST_LOCAL_COMPLETION (0x1<<1)
43362306a36Sopenharmony_ci#define ISCSI_FW_MP_REQUEST_LOCAL_COMPLETION_SHIFT 1
43462306a36Sopenharmony_ci#define ISCSI_FW_MP_REQUEST_UPDATE_EXP_STAT_SN (0x1<<2)
43562306a36Sopenharmony_ci#define ISCSI_FW_MP_REQUEST_UPDATE_EXP_STAT_SN_SHIFT 2
43662306a36Sopenharmony_ci#define ISCSI_FW_MP_REQUEST_RESERVED2 (0x1F<<3)
43762306a36Sopenharmony_ci#define ISCSI_FW_MP_REQUEST_RESERVED2_SHIFT 3
43862306a36Sopenharmony_ci	u8 reserved3;
43962306a36Sopenharmony_ci	u16 reserved4;
44062306a36Sopenharmony_ci#endif
44162306a36Sopenharmony_ci	u32 bd_list_addr_lo;
44262306a36Sopenharmony_ci	u32 bd_list_addr_hi;
44362306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
44462306a36Sopenharmony_ci	u8 cq_index;
44562306a36Sopenharmony_ci	u8 reserved6;
44662306a36Sopenharmony_ci	u8 reserved5;
44762306a36Sopenharmony_ci	u8 num_bds;
44862306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
44962306a36Sopenharmony_ci	u8 num_bds;
45062306a36Sopenharmony_ci	u8 reserved5;
45162306a36Sopenharmony_ci	u8 reserved6;
45262306a36Sopenharmony_ci	u8 cq_index;
45362306a36Sopenharmony_ci#endif
45462306a36Sopenharmony_ci};
45562306a36Sopenharmony_ci
45662306a36Sopenharmony_ci
45762306a36Sopenharmony_ci/*
45862306a36Sopenharmony_ci * firmware response - CQE: used only by firmware
45962306a36Sopenharmony_ci */
46062306a36Sopenharmony_cistruct bnx2i_fw_response {
46162306a36Sopenharmony_ci	u32 hdr_dword1[2];
46262306a36Sopenharmony_ci	u32 hdr_exp_cmd_sn;
46362306a36Sopenharmony_ci	u32 hdr_max_cmd_sn;
46462306a36Sopenharmony_ci	u32 hdr_ttt;
46562306a36Sopenharmony_ci	u32 hdr_res_cnt;
46662306a36Sopenharmony_ci	u32 cqe_flags;
46762306a36Sopenharmony_ci#define ISCSI_FW_RESPONSE_RESERVED2 (0xFF<<0)
46862306a36Sopenharmony_ci#define ISCSI_FW_RESPONSE_RESERVED2_SHIFT 0
46962306a36Sopenharmony_ci#define ISCSI_FW_RESPONSE_ERR_CODE (0xFF<<8)
47062306a36Sopenharmony_ci#define ISCSI_FW_RESPONSE_ERR_CODE_SHIFT 8
47162306a36Sopenharmony_ci#define ISCSI_FW_RESPONSE_RESERVED3 (0xFFFF<<16)
47262306a36Sopenharmony_ci#define ISCSI_FW_RESPONSE_RESERVED3_SHIFT 16
47362306a36Sopenharmony_ci	u32 stat_sn;
47462306a36Sopenharmony_ci	u32 hdr_dword2[2];
47562306a36Sopenharmony_ci	u32 hdr_dword3[2];
47662306a36Sopenharmony_ci	u32 task_stat;
47762306a36Sopenharmony_ci	u32 reserved0;
47862306a36Sopenharmony_ci	u32 hdr_itt;
47962306a36Sopenharmony_ci	u32 cq_req_sn;
48062306a36Sopenharmony_ci};
48162306a36Sopenharmony_ci
48262306a36Sopenharmony_ci
48362306a36Sopenharmony_ci/*
48462306a36Sopenharmony_ci * iSCSI KCQ CQE parameters
48562306a36Sopenharmony_ci */
48662306a36Sopenharmony_ciunion iscsi_kcqe_params {
48762306a36Sopenharmony_ci	u32 reserved0[4];
48862306a36Sopenharmony_ci};
48962306a36Sopenharmony_ci
49062306a36Sopenharmony_ci/*
49162306a36Sopenharmony_ci * iSCSI KCQ CQE
49262306a36Sopenharmony_ci */
49362306a36Sopenharmony_cistruct iscsi_kcqe {
49462306a36Sopenharmony_ci	u32 iscsi_conn_id;
49562306a36Sopenharmony_ci	u32 completion_status;
49662306a36Sopenharmony_ci	u32 iscsi_conn_context_id;
49762306a36Sopenharmony_ci	union iscsi_kcqe_params params;
49862306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
49962306a36Sopenharmony_ci	u8 flags;
50062306a36Sopenharmony_ci#define ISCSI_KCQE_RESERVED0 (0xF<<0)
50162306a36Sopenharmony_ci#define ISCSI_KCQE_RESERVED0_SHIFT 0
50262306a36Sopenharmony_ci#define ISCSI_KCQE_LAYER_CODE (0x7<<4)
50362306a36Sopenharmony_ci#define ISCSI_KCQE_LAYER_CODE_SHIFT 4
50462306a36Sopenharmony_ci#define ISCSI_KCQE_RESERVED1 (0x1<<7)
50562306a36Sopenharmony_ci#define ISCSI_KCQE_RESERVED1_SHIFT 7
50662306a36Sopenharmony_ci	u8 op_code;
50762306a36Sopenharmony_ci	u16 qe_self_seq;
50862306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
50962306a36Sopenharmony_ci	u16 qe_self_seq;
51062306a36Sopenharmony_ci	u8 op_code;
51162306a36Sopenharmony_ci	u8 flags;
51262306a36Sopenharmony_ci#define ISCSI_KCQE_RESERVED0 (0xF<<0)
51362306a36Sopenharmony_ci#define ISCSI_KCQE_RESERVED0_SHIFT 0
51462306a36Sopenharmony_ci#define ISCSI_KCQE_LAYER_CODE (0x7<<4)
51562306a36Sopenharmony_ci#define ISCSI_KCQE_LAYER_CODE_SHIFT 4
51662306a36Sopenharmony_ci#define ISCSI_KCQE_RESERVED1 (0x1<<7)
51762306a36Sopenharmony_ci#define ISCSI_KCQE_RESERVED1_SHIFT 7
51862306a36Sopenharmony_ci#endif
51962306a36Sopenharmony_ci};
52062306a36Sopenharmony_ci
52162306a36Sopenharmony_ci
52262306a36Sopenharmony_ci
52362306a36Sopenharmony_ci/*
52462306a36Sopenharmony_ci * iSCSI KWQE header
52562306a36Sopenharmony_ci */
52662306a36Sopenharmony_cistruct iscsi_kwqe_header {
52762306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
52862306a36Sopenharmony_ci	u8 flags;
52962306a36Sopenharmony_ci#define ISCSI_KWQE_HEADER_RESERVED0 (0xF<<0)
53062306a36Sopenharmony_ci#define ISCSI_KWQE_HEADER_RESERVED0_SHIFT 0
53162306a36Sopenharmony_ci#define ISCSI_KWQE_HEADER_LAYER_CODE (0x7<<4)
53262306a36Sopenharmony_ci#define ISCSI_KWQE_HEADER_LAYER_CODE_SHIFT 4
53362306a36Sopenharmony_ci#define ISCSI_KWQE_HEADER_RESERVED1 (0x1<<7)
53462306a36Sopenharmony_ci#define ISCSI_KWQE_HEADER_RESERVED1_SHIFT 7
53562306a36Sopenharmony_ci	u8 op_code;
53662306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
53762306a36Sopenharmony_ci	u8 op_code;
53862306a36Sopenharmony_ci	u8 flags;
53962306a36Sopenharmony_ci#define ISCSI_KWQE_HEADER_RESERVED0 (0xF<<0)
54062306a36Sopenharmony_ci#define ISCSI_KWQE_HEADER_RESERVED0_SHIFT 0
54162306a36Sopenharmony_ci#define ISCSI_KWQE_HEADER_LAYER_CODE (0x7<<4)
54262306a36Sopenharmony_ci#define ISCSI_KWQE_HEADER_LAYER_CODE_SHIFT 4
54362306a36Sopenharmony_ci#define ISCSI_KWQE_HEADER_RESERVED1 (0x1<<7)
54462306a36Sopenharmony_ci#define ISCSI_KWQE_HEADER_RESERVED1_SHIFT 7
54562306a36Sopenharmony_ci#endif
54662306a36Sopenharmony_ci};
54762306a36Sopenharmony_ci
54862306a36Sopenharmony_ci/*
54962306a36Sopenharmony_ci * iSCSI firmware init request 1
55062306a36Sopenharmony_ci */
55162306a36Sopenharmony_cistruct iscsi_kwqe_init1 {
55262306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
55362306a36Sopenharmony_ci	struct iscsi_kwqe_header hdr;
55462306a36Sopenharmony_ci	u8 reserved0;
55562306a36Sopenharmony_ci	u8 num_cqs;
55662306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
55762306a36Sopenharmony_ci	u8 num_cqs;
55862306a36Sopenharmony_ci	u8 reserved0;
55962306a36Sopenharmony_ci	struct iscsi_kwqe_header hdr;
56062306a36Sopenharmony_ci#endif
56162306a36Sopenharmony_ci	u32 dummy_buffer_addr_lo;
56262306a36Sopenharmony_ci	u32 dummy_buffer_addr_hi;
56362306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
56462306a36Sopenharmony_ci	u16 num_ccells_per_conn;
56562306a36Sopenharmony_ci	u16 num_tasks_per_conn;
56662306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
56762306a36Sopenharmony_ci	u16 num_tasks_per_conn;
56862306a36Sopenharmony_ci	u16 num_ccells_per_conn;
56962306a36Sopenharmony_ci#endif
57062306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
57162306a36Sopenharmony_ci	u16 sq_wqes_per_page;
57262306a36Sopenharmony_ci	u16 sq_num_wqes;
57362306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
57462306a36Sopenharmony_ci	u16 sq_num_wqes;
57562306a36Sopenharmony_ci	u16 sq_wqes_per_page;
57662306a36Sopenharmony_ci#endif
57762306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
57862306a36Sopenharmony_ci	u8 cq_log_wqes_per_page;
57962306a36Sopenharmony_ci	u8 flags;
58062306a36Sopenharmony_ci#define ISCSI_KWQE_INIT1_PAGE_SIZE (0xF<<0)
58162306a36Sopenharmony_ci#define ISCSI_KWQE_INIT1_PAGE_SIZE_SHIFT 0
58262306a36Sopenharmony_ci#define ISCSI_KWQE_INIT1_DELAYED_ACK_ENABLE (0x1<<4)
58362306a36Sopenharmony_ci#define ISCSI_KWQE_INIT1_DELAYED_ACK_ENABLE_SHIFT 4
58462306a36Sopenharmony_ci#define ISCSI_KWQE_INIT1_KEEP_ALIVE_ENABLE (0x1<<5)
58562306a36Sopenharmony_ci#define ISCSI_KWQE_INIT1_KEEP_ALIVE_ENABLE_SHIFT 5
58662306a36Sopenharmony_ci#define ISCSI_KWQE_INIT1_TIME_STAMPS_ENABLE (0x1<<6)
58762306a36Sopenharmony_ci#define ISCSI_KWQE_INIT1_TIME_STAMPS_ENABLE_SHIFT 6
58862306a36Sopenharmony_ci#define ISCSI_KWQE_INIT1_RESERVED1 (0x1<<7)
58962306a36Sopenharmony_ci#define ISCSI_KWQE_INIT1_RESERVED1_SHIFT 7
59062306a36Sopenharmony_ci	u16 cq_num_wqes;
59162306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
59262306a36Sopenharmony_ci	u16 cq_num_wqes;
59362306a36Sopenharmony_ci	u8 flags;
59462306a36Sopenharmony_ci#define ISCSI_KWQE_INIT1_PAGE_SIZE (0xF<<0)
59562306a36Sopenharmony_ci#define ISCSI_KWQE_INIT1_PAGE_SIZE_SHIFT 0
59662306a36Sopenharmony_ci#define ISCSI_KWQE_INIT1_DELAYED_ACK_ENABLE (0x1<<4)
59762306a36Sopenharmony_ci#define ISCSI_KWQE_INIT1_DELAYED_ACK_ENABLE_SHIFT 4
59862306a36Sopenharmony_ci#define ISCSI_KWQE_INIT1_KEEP_ALIVE_ENABLE (0x1<<5)
59962306a36Sopenharmony_ci#define ISCSI_KWQE_INIT1_KEEP_ALIVE_ENABLE_SHIFT 5
60062306a36Sopenharmony_ci#define ISCSI_KWQE_INIT1_TIME_STAMPS_ENABLE (0x1<<6)
60162306a36Sopenharmony_ci#define ISCSI_KWQE_INIT1_TIME_STAMPS_ENABLE_SHIFT 6
60262306a36Sopenharmony_ci#define ISCSI_KWQE_INIT1_RESERVED1 (0x1<<7)
60362306a36Sopenharmony_ci#define ISCSI_KWQE_INIT1_RESERVED1_SHIFT 7
60462306a36Sopenharmony_ci	u8 cq_log_wqes_per_page;
60562306a36Sopenharmony_ci#endif
60662306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
60762306a36Sopenharmony_ci	u16 cq_num_pages;
60862306a36Sopenharmony_ci	u16 sq_num_pages;
60962306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
61062306a36Sopenharmony_ci	u16 sq_num_pages;
61162306a36Sopenharmony_ci	u16 cq_num_pages;
61262306a36Sopenharmony_ci#endif
61362306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
61462306a36Sopenharmony_ci	u16 rq_buffer_size;
61562306a36Sopenharmony_ci	u16 rq_num_wqes;
61662306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
61762306a36Sopenharmony_ci	u16 rq_num_wqes;
61862306a36Sopenharmony_ci	u16 rq_buffer_size;
61962306a36Sopenharmony_ci#endif
62062306a36Sopenharmony_ci};
62162306a36Sopenharmony_ci
62262306a36Sopenharmony_ci/*
62362306a36Sopenharmony_ci * iSCSI firmware init request 2
62462306a36Sopenharmony_ci */
62562306a36Sopenharmony_cistruct iscsi_kwqe_init2 {
62662306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
62762306a36Sopenharmony_ci	struct iscsi_kwqe_header hdr;
62862306a36Sopenharmony_ci	u16 max_cq_sqn;
62962306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
63062306a36Sopenharmony_ci	u16 max_cq_sqn;
63162306a36Sopenharmony_ci	struct iscsi_kwqe_header hdr;
63262306a36Sopenharmony_ci#endif
63362306a36Sopenharmony_ci	u32 error_bit_map[2];
63462306a36Sopenharmony_ci	u32 reserved1[5];
63562306a36Sopenharmony_ci};
63662306a36Sopenharmony_ci
63762306a36Sopenharmony_ci/*
63862306a36Sopenharmony_ci * Initial iSCSI connection offload request 1
63962306a36Sopenharmony_ci */
64062306a36Sopenharmony_cistruct iscsi_kwqe_conn_offload1 {
64162306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
64262306a36Sopenharmony_ci	struct iscsi_kwqe_header hdr;
64362306a36Sopenharmony_ci	u16 iscsi_conn_id;
64462306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
64562306a36Sopenharmony_ci	u16 iscsi_conn_id;
64662306a36Sopenharmony_ci	struct iscsi_kwqe_header hdr;
64762306a36Sopenharmony_ci#endif
64862306a36Sopenharmony_ci	u32 sq_page_table_addr_lo;
64962306a36Sopenharmony_ci	u32 sq_page_table_addr_hi;
65062306a36Sopenharmony_ci	u32 cq_page_table_addr_lo;
65162306a36Sopenharmony_ci	u32 cq_page_table_addr_hi;
65262306a36Sopenharmony_ci	u32 reserved0[3];
65362306a36Sopenharmony_ci};
65462306a36Sopenharmony_ci
65562306a36Sopenharmony_ci/*
65662306a36Sopenharmony_ci * iSCSI Page Table Entry (PTE)
65762306a36Sopenharmony_ci */
65862306a36Sopenharmony_cistruct iscsi_pte {
65962306a36Sopenharmony_ci	u32 hi;
66062306a36Sopenharmony_ci	u32 lo;
66162306a36Sopenharmony_ci};
66262306a36Sopenharmony_ci
66362306a36Sopenharmony_ci/*
66462306a36Sopenharmony_ci * Initial iSCSI connection offload request 2
66562306a36Sopenharmony_ci */
66662306a36Sopenharmony_cistruct iscsi_kwqe_conn_offload2 {
66762306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
66862306a36Sopenharmony_ci	struct iscsi_kwqe_header hdr;
66962306a36Sopenharmony_ci	u16 reserved0;
67062306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
67162306a36Sopenharmony_ci	u16 reserved0;
67262306a36Sopenharmony_ci	struct iscsi_kwqe_header hdr;
67362306a36Sopenharmony_ci#endif
67462306a36Sopenharmony_ci	u32 rq_page_table_addr_lo;
67562306a36Sopenharmony_ci	u32 rq_page_table_addr_hi;
67662306a36Sopenharmony_ci	struct iscsi_pte sq_first_pte;
67762306a36Sopenharmony_ci	struct iscsi_pte cq_first_pte;
67862306a36Sopenharmony_ci	u32 num_additional_wqes;
67962306a36Sopenharmony_ci};
68062306a36Sopenharmony_ci
68162306a36Sopenharmony_ci
68262306a36Sopenharmony_ci/*
68362306a36Sopenharmony_ci * Initial iSCSI connection offload request 3
68462306a36Sopenharmony_ci */
68562306a36Sopenharmony_cistruct iscsi_kwqe_conn_offload3 {
68662306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
68762306a36Sopenharmony_ci	struct iscsi_kwqe_header hdr;
68862306a36Sopenharmony_ci	u16 reserved0;
68962306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
69062306a36Sopenharmony_ci	u16 reserved0;
69162306a36Sopenharmony_ci	struct iscsi_kwqe_header hdr;
69262306a36Sopenharmony_ci#endif
69362306a36Sopenharmony_ci	u32 reserved1;
69462306a36Sopenharmony_ci	struct iscsi_pte qp_first_pte[3];
69562306a36Sopenharmony_ci};
69662306a36Sopenharmony_ci
69762306a36Sopenharmony_ci
69862306a36Sopenharmony_ci/*
69962306a36Sopenharmony_ci * iSCSI connection update request
70062306a36Sopenharmony_ci */
70162306a36Sopenharmony_cistruct iscsi_kwqe_conn_update {
70262306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
70362306a36Sopenharmony_ci	struct iscsi_kwqe_header hdr;
70462306a36Sopenharmony_ci	u16 reserved0;
70562306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
70662306a36Sopenharmony_ci	u16 reserved0;
70762306a36Sopenharmony_ci	struct iscsi_kwqe_header hdr;
70862306a36Sopenharmony_ci#endif
70962306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
71062306a36Sopenharmony_ci	u8 session_error_recovery_level;
71162306a36Sopenharmony_ci	u8 max_outstanding_r2ts;
71262306a36Sopenharmony_ci	u8 reserved2;
71362306a36Sopenharmony_ci	u8 conn_flags;
71462306a36Sopenharmony_ci#define ISCSI_KWQE_CONN_UPDATE_HEADER_DIGEST (0x1<<0)
71562306a36Sopenharmony_ci#define ISCSI_KWQE_CONN_UPDATE_HEADER_DIGEST_SHIFT 0
71662306a36Sopenharmony_ci#define ISCSI_KWQE_CONN_UPDATE_DATA_DIGEST (0x1<<1)
71762306a36Sopenharmony_ci#define ISCSI_KWQE_CONN_UPDATE_DATA_DIGEST_SHIFT 1
71862306a36Sopenharmony_ci#define ISCSI_KWQE_CONN_UPDATE_INITIAL_R2T (0x1<<2)
71962306a36Sopenharmony_ci#define ISCSI_KWQE_CONN_UPDATE_INITIAL_R2T_SHIFT 2
72062306a36Sopenharmony_ci#define ISCSI_KWQE_CONN_UPDATE_IMMEDIATE_DATA (0x1<<3)
72162306a36Sopenharmony_ci#define ISCSI_KWQE_CONN_UPDATE_IMMEDIATE_DATA_SHIFT 3
72262306a36Sopenharmony_ci#define ISCSI_KWQE_CONN_UPDATE_OOO_SUPPORT_MODE (0x3<<4)
72362306a36Sopenharmony_ci#define ISCSI_KWQE_CONN_UPDATE_OOO_SUPPORT_MODE_SHIFT 4
72462306a36Sopenharmony_ci#define ISCSI_KWQE_CONN_UPDATE_RESERVED1 (0x3<<6)
72562306a36Sopenharmony_ci#define ISCSI_KWQE_CONN_UPDATE_RESERVED1_SHIFT 6
72662306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
72762306a36Sopenharmony_ci	u8 conn_flags;
72862306a36Sopenharmony_ci#define ISCSI_KWQE_CONN_UPDATE_HEADER_DIGEST (0x1<<0)
72962306a36Sopenharmony_ci#define ISCSI_KWQE_CONN_UPDATE_HEADER_DIGEST_SHIFT 0
73062306a36Sopenharmony_ci#define ISCSI_KWQE_CONN_UPDATE_DATA_DIGEST (0x1<<1)
73162306a36Sopenharmony_ci#define ISCSI_KWQE_CONN_UPDATE_DATA_DIGEST_SHIFT 1
73262306a36Sopenharmony_ci#define ISCSI_KWQE_CONN_UPDATE_INITIAL_R2T (0x1<<2)
73362306a36Sopenharmony_ci#define ISCSI_KWQE_CONN_UPDATE_INITIAL_R2T_SHIFT 2
73462306a36Sopenharmony_ci#define ISCSI_KWQE_CONN_UPDATE_IMMEDIATE_DATA (0x1<<3)
73562306a36Sopenharmony_ci#define ISCSI_KWQE_CONN_UPDATE_IMMEDIATE_DATA_SHIFT 3
73662306a36Sopenharmony_ci#define ISCSI_KWQE_CONN_UPDATE_OOO_SUPPORT_MODE (0x3<<4)
73762306a36Sopenharmony_ci#define ISCSI_KWQE_CONN_UPDATE_OOO_SUPPORT_MODE_SHIFT 4
73862306a36Sopenharmony_ci#define ISCSI_KWQE_CONN_UPDATE_RESERVED1 (0x3<<6)
73962306a36Sopenharmony_ci#define ISCSI_KWQE_CONN_UPDATE_RESERVED1_SHIFT 6
74062306a36Sopenharmony_ci	u8 reserved2;
74162306a36Sopenharmony_ci	u8 max_outstanding_r2ts;
74262306a36Sopenharmony_ci	u8 session_error_recovery_level;
74362306a36Sopenharmony_ci#endif
74462306a36Sopenharmony_ci	u32 context_id;
74562306a36Sopenharmony_ci	u32 max_send_pdu_length;
74662306a36Sopenharmony_ci	u32 max_recv_pdu_length;
74762306a36Sopenharmony_ci	u32 first_burst_length;
74862306a36Sopenharmony_ci	u32 max_burst_length;
74962306a36Sopenharmony_ci	u32 exp_stat_sn;
75062306a36Sopenharmony_ci};
75162306a36Sopenharmony_ci
75262306a36Sopenharmony_ci/*
75362306a36Sopenharmony_ci * iSCSI destroy connection request
75462306a36Sopenharmony_ci */
75562306a36Sopenharmony_cistruct iscsi_kwqe_conn_destroy {
75662306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
75762306a36Sopenharmony_ci	struct iscsi_kwqe_header hdr;
75862306a36Sopenharmony_ci	u16 reserved0;
75962306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
76062306a36Sopenharmony_ci	u16 reserved0;
76162306a36Sopenharmony_ci	struct iscsi_kwqe_header hdr;
76262306a36Sopenharmony_ci#endif
76362306a36Sopenharmony_ci	u32 context_id;
76462306a36Sopenharmony_ci	u32 reserved1[6];
76562306a36Sopenharmony_ci};
76662306a36Sopenharmony_ci
76762306a36Sopenharmony_ci/*
76862306a36Sopenharmony_ci * iSCSI KWQ WQE
76962306a36Sopenharmony_ci */
77062306a36Sopenharmony_ciunion iscsi_kwqe {
77162306a36Sopenharmony_ci	struct iscsi_kwqe_init1 init1;
77262306a36Sopenharmony_ci	struct iscsi_kwqe_init2 init2;
77362306a36Sopenharmony_ci	struct iscsi_kwqe_conn_offload1 conn_offload1;
77462306a36Sopenharmony_ci	struct iscsi_kwqe_conn_offload2 conn_offload2;
77562306a36Sopenharmony_ci	struct iscsi_kwqe_conn_update conn_update;
77662306a36Sopenharmony_ci	struct iscsi_kwqe_conn_destroy conn_destroy;
77762306a36Sopenharmony_ci};
77862306a36Sopenharmony_ci
77962306a36Sopenharmony_ci/*
78062306a36Sopenharmony_ci * iSCSI Login SQ WQE
78162306a36Sopenharmony_ci */
78262306a36Sopenharmony_cistruct bnx2i_login_request {
78362306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
78462306a36Sopenharmony_ci	u8 op_code;
78562306a36Sopenharmony_ci	u8 op_attr;
78662306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_NEXT_STAGE (0x3<<0)
78762306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_NEXT_STAGE_SHIFT 0
78862306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_CURRENT_STAGE (0x3<<2)
78962306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_CURRENT_STAGE_SHIFT 2
79062306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_RESERVED0 (0x3<<4)
79162306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_RESERVED0_SHIFT 4
79262306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_CONT (0x1<<6)
79362306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_CONT_SHIFT 6
79462306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_TRANSIT (0x1<<7)
79562306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_TRANSIT_SHIFT 7
79662306a36Sopenharmony_ci	u8 version_max;
79762306a36Sopenharmony_ci	u8 version_min;
79862306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
79962306a36Sopenharmony_ci	u8 version_min;
80062306a36Sopenharmony_ci	u8 version_max;
80162306a36Sopenharmony_ci	u8 op_attr;
80262306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_NEXT_STAGE (0x3<<0)
80362306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_NEXT_STAGE_SHIFT 0
80462306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_CURRENT_STAGE (0x3<<2)
80562306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_CURRENT_STAGE_SHIFT 2
80662306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_RESERVED0 (0x3<<4)
80762306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_RESERVED0_SHIFT 4
80862306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_CONT (0x1<<6)
80962306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_CONT_SHIFT 6
81062306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_TRANSIT (0x1<<7)
81162306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_TRANSIT_SHIFT 7
81262306a36Sopenharmony_ci	u8 op_code;
81362306a36Sopenharmony_ci#endif
81462306a36Sopenharmony_ci	u32 data_length;
81562306a36Sopenharmony_ci	u32 isid_lo;
81662306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
81762306a36Sopenharmony_ci	u16 isid_hi;
81862306a36Sopenharmony_ci	u16 tsih;
81962306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
82062306a36Sopenharmony_ci	u16 tsih;
82162306a36Sopenharmony_ci	u16 isid_hi;
82262306a36Sopenharmony_ci#endif
82362306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
82462306a36Sopenharmony_ci	u16 reserved2;
82562306a36Sopenharmony_ci	u16 itt;
82662306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_INDEX (0x3FFF<<0)
82762306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_INDEX_SHIFT 0
82862306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_TYPE (0x3<<14)
82962306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_TYPE_SHIFT 14
83062306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
83162306a36Sopenharmony_ci	u16 itt;
83262306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_INDEX (0x3FFF<<0)
83362306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_INDEX_SHIFT 0
83462306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_TYPE (0x3<<14)
83562306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_TYPE_SHIFT 14
83662306a36Sopenharmony_ci	u16 reserved2;
83762306a36Sopenharmony_ci#endif
83862306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
83962306a36Sopenharmony_ci	u16 cid;
84062306a36Sopenharmony_ci	u16 reserved3;
84162306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
84262306a36Sopenharmony_ci	u16 reserved3;
84362306a36Sopenharmony_ci	u16 cid;
84462306a36Sopenharmony_ci#endif
84562306a36Sopenharmony_ci	u32 cmd_sn;
84662306a36Sopenharmony_ci	u32 exp_stat_sn;
84762306a36Sopenharmony_ci	u32 reserved4;
84862306a36Sopenharmony_ci	u32 resp_bd_list_addr_lo;
84962306a36Sopenharmony_ci	u32 resp_bd_list_addr_hi;
85062306a36Sopenharmony_ci	u32 resp_buffer;
85162306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_RESP_BUFFER_LENGTH (0xFFFFFF<<0)
85262306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_RESP_BUFFER_LENGTH_SHIFT 0
85362306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_NUM_RESP_BDS (0xFF<<24)
85462306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_NUM_RESP_BDS_SHIFT 24
85562306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
85662306a36Sopenharmony_ci	u16 reserved8;
85762306a36Sopenharmony_ci	u8 reserved7;
85862306a36Sopenharmony_ci	u8 flags;
85962306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_RESERVED5 (0x3<<0)
86062306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_RESERVED5_SHIFT 0
86162306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_UPDATE_EXP_STAT_SN (0x1<<2)
86262306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_UPDATE_EXP_STAT_SN_SHIFT 2
86362306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_RESERVED6 (0x1F<<3)
86462306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_RESERVED6_SHIFT 3
86562306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
86662306a36Sopenharmony_ci	u8 flags;
86762306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_RESERVED5 (0x3<<0)
86862306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_RESERVED5_SHIFT 0
86962306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_UPDATE_EXP_STAT_SN (0x1<<2)
87062306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_UPDATE_EXP_STAT_SN_SHIFT 2
87162306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_RESERVED6 (0x1F<<3)
87262306a36Sopenharmony_ci#define ISCSI_LOGIN_REQUEST_RESERVED6_SHIFT 3
87362306a36Sopenharmony_ci	u8 reserved7;
87462306a36Sopenharmony_ci	u16 reserved8;
87562306a36Sopenharmony_ci#endif
87662306a36Sopenharmony_ci	u32 bd_list_addr_lo;
87762306a36Sopenharmony_ci	u32 bd_list_addr_hi;
87862306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
87962306a36Sopenharmony_ci	u8 cq_index;
88062306a36Sopenharmony_ci	u8 reserved10;
88162306a36Sopenharmony_ci	u8 reserved9;
88262306a36Sopenharmony_ci	u8 num_bds;
88362306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
88462306a36Sopenharmony_ci	u8 num_bds;
88562306a36Sopenharmony_ci	u8 reserved9;
88662306a36Sopenharmony_ci	u8 reserved10;
88762306a36Sopenharmony_ci	u8 cq_index;
88862306a36Sopenharmony_ci#endif
88962306a36Sopenharmony_ci};
89062306a36Sopenharmony_ci
89162306a36Sopenharmony_ci
89262306a36Sopenharmony_ci/*
89362306a36Sopenharmony_ci * iSCSI Login CQE
89462306a36Sopenharmony_ci */
89562306a36Sopenharmony_cistruct bnx2i_login_response {
89662306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
89762306a36Sopenharmony_ci	u8 op_code;
89862306a36Sopenharmony_ci	u8 response_flags;
89962306a36Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_NEXT_STAGE (0x3<<0)
90062306a36Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_NEXT_STAGE_SHIFT 0
90162306a36Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_CURRENT_STAGE (0x3<<2)
90262306a36Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_CURRENT_STAGE_SHIFT 2
90362306a36Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_RESERVED0 (0x3<<4)
90462306a36Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_RESERVED0_SHIFT 4
90562306a36Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_CONT (0x1<<6)
90662306a36Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_CONT_SHIFT 6
90762306a36Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_TRANSIT (0x1<<7)
90862306a36Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_TRANSIT_SHIFT 7
90962306a36Sopenharmony_ci	u8 version_max;
91062306a36Sopenharmony_ci	u8 version_active;
91162306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
91262306a36Sopenharmony_ci	u8 version_active;
91362306a36Sopenharmony_ci	u8 version_max;
91462306a36Sopenharmony_ci	u8 response_flags;
91562306a36Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_NEXT_STAGE (0x3<<0)
91662306a36Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_NEXT_STAGE_SHIFT 0
91762306a36Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_CURRENT_STAGE (0x3<<2)
91862306a36Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_CURRENT_STAGE_SHIFT 2
91962306a36Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_RESERVED0 (0x3<<4)
92062306a36Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_RESERVED0_SHIFT 4
92162306a36Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_CONT (0x1<<6)
92262306a36Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_CONT_SHIFT 6
92362306a36Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_TRANSIT (0x1<<7)
92462306a36Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_TRANSIT_SHIFT 7
92562306a36Sopenharmony_ci	u8 op_code;
92662306a36Sopenharmony_ci#endif
92762306a36Sopenharmony_ci	u32 data_length;
92862306a36Sopenharmony_ci	u32 exp_cmd_sn;
92962306a36Sopenharmony_ci	u32 max_cmd_sn;
93062306a36Sopenharmony_ci	u32 reserved1[2];
93162306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
93262306a36Sopenharmony_ci	u16 reserved3;
93362306a36Sopenharmony_ci	u8 err_code;
93462306a36Sopenharmony_ci	u8 reserved2;
93562306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
93662306a36Sopenharmony_ci	u8 reserved2;
93762306a36Sopenharmony_ci	u8 err_code;
93862306a36Sopenharmony_ci	u16 reserved3;
93962306a36Sopenharmony_ci#endif
94062306a36Sopenharmony_ci	u32 stat_sn;
94162306a36Sopenharmony_ci	u32 isid_lo;
94262306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
94362306a36Sopenharmony_ci	u16 isid_hi;
94462306a36Sopenharmony_ci	u16 tsih;
94562306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
94662306a36Sopenharmony_ci	u16 tsih;
94762306a36Sopenharmony_ci	u16 isid_hi;
94862306a36Sopenharmony_ci#endif
94962306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
95062306a36Sopenharmony_ci	u8 status_class;
95162306a36Sopenharmony_ci	u8 status_detail;
95262306a36Sopenharmony_ci	u16 reserved4;
95362306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
95462306a36Sopenharmony_ci	u16 reserved4;
95562306a36Sopenharmony_ci	u8 status_detail;
95662306a36Sopenharmony_ci	u8 status_class;
95762306a36Sopenharmony_ci#endif
95862306a36Sopenharmony_ci	u32 reserved5[3];
95962306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
96062306a36Sopenharmony_ci	u16 reserved6;
96162306a36Sopenharmony_ci	u16 itt;
96262306a36Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_INDEX (0x3FFF<<0)
96362306a36Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_INDEX_SHIFT 0
96462306a36Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_TYPE (0x3<<14)
96562306a36Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_TYPE_SHIFT 14
96662306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
96762306a36Sopenharmony_ci	u16 itt;
96862306a36Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_INDEX (0x3FFF<<0)
96962306a36Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_INDEX_SHIFT 0
97062306a36Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_TYPE (0x3<<14)
97162306a36Sopenharmony_ci#define ISCSI_LOGIN_RESPONSE_TYPE_SHIFT 14
97262306a36Sopenharmony_ci	u16 reserved6;
97362306a36Sopenharmony_ci#endif
97462306a36Sopenharmony_ci	u32 cq_req_sn;
97562306a36Sopenharmony_ci};
97662306a36Sopenharmony_ci
97762306a36Sopenharmony_ci
97862306a36Sopenharmony_ci/*
97962306a36Sopenharmony_ci * iSCSI Logout SQ WQE
98062306a36Sopenharmony_ci */
98162306a36Sopenharmony_cistruct bnx2i_logout_request {
98262306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
98362306a36Sopenharmony_ci	u8 op_code;
98462306a36Sopenharmony_ci	u8 op_attr;
98562306a36Sopenharmony_ci#define ISCSI_LOGOUT_REQUEST_REASON (0x7F<<0)
98662306a36Sopenharmony_ci#define ISCSI_LOGOUT_REQUEST_REASON_SHIFT 0
98762306a36Sopenharmony_ci#define ISCSI_LOGOUT_REQUEST_ALWAYS_ONE (0x1<<7)
98862306a36Sopenharmony_ci#define ISCSI_LOGOUT_REQUEST_ALWAYS_ONE_SHIFT 7
98962306a36Sopenharmony_ci	u16 reserved0;
99062306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
99162306a36Sopenharmony_ci	u16 reserved0;
99262306a36Sopenharmony_ci	u8 op_attr;
99362306a36Sopenharmony_ci#define ISCSI_LOGOUT_REQUEST_REASON (0x7F<<0)
99462306a36Sopenharmony_ci#define ISCSI_LOGOUT_REQUEST_REASON_SHIFT 0
99562306a36Sopenharmony_ci#define ISCSI_LOGOUT_REQUEST_ALWAYS_ONE (0x1<<7)
99662306a36Sopenharmony_ci#define ISCSI_LOGOUT_REQUEST_ALWAYS_ONE_SHIFT 7
99762306a36Sopenharmony_ci	u8 op_code;
99862306a36Sopenharmony_ci#endif
99962306a36Sopenharmony_ci	u32 data_length;
100062306a36Sopenharmony_ci	u32 reserved1[2];
100162306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
100262306a36Sopenharmony_ci	u16 reserved2;
100362306a36Sopenharmony_ci	u16 itt;
100462306a36Sopenharmony_ci#define ISCSI_LOGOUT_REQUEST_INDEX (0x3FFF<<0)
100562306a36Sopenharmony_ci#define ISCSI_LOGOUT_REQUEST_INDEX_SHIFT 0
100662306a36Sopenharmony_ci#define ISCSI_LOGOUT_REQUEST_TYPE (0x3<<14)
100762306a36Sopenharmony_ci#define ISCSI_LOGOUT_REQUEST_TYPE_SHIFT 14
100862306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
100962306a36Sopenharmony_ci	u16 itt;
101062306a36Sopenharmony_ci#define ISCSI_LOGOUT_REQUEST_INDEX (0x3FFF<<0)
101162306a36Sopenharmony_ci#define ISCSI_LOGOUT_REQUEST_INDEX_SHIFT 0
101262306a36Sopenharmony_ci#define ISCSI_LOGOUT_REQUEST_TYPE (0x3<<14)
101362306a36Sopenharmony_ci#define ISCSI_LOGOUT_REQUEST_TYPE_SHIFT 14
101462306a36Sopenharmony_ci	u16 reserved2;
101562306a36Sopenharmony_ci#endif
101662306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
101762306a36Sopenharmony_ci	u16 cid;
101862306a36Sopenharmony_ci	u16 reserved3;
101962306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
102062306a36Sopenharmony_ci	u16 reserved3;
102162306a36Sopenharmony_ci	u16 cid;
102262306a36Sopenharmony_ci#endif
102362306a36Sopenharmony_ci	u32 cmd_sn;
102462306a36Sopenharmony_ci	u32 reserved4[5];
102562306a36Sopenharmony_ci	u32 zero_fill;
102662306a36Sopenharmony_ci	u32 bd_list_addr_lo;
102762306a36Sopenharmony_ci	u32 bd_list_addr_hi;
102862306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
102962306a36Sopenharmony_ci	u8 cq_index;
103062306a36Sopenharmony_ci	u8 reserved6;
103162306a36Sopenharmony_ci	u8 reserved5;
103262306a36Sopenharmony_ci	u8 num_bds;
103362306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
103462306a36Sopenharmony_ci	u8 num_bds;
103562306a36Sopenharmony_ci	u8 reserved5;
103662306a36Sopenharmony_ci	u8 reserved6;
103762306a36Sopenharmony_ci	u8 cq_index;
103862306a36Sopenharmony_ci#endif
103962306a36Sopenharmony_ci};
104062306a36Sopenharmony_ci
104162306a36Sopenharmony_ci
104262306a36Sopenharmony_ci/*
104362306a36Sopenharmony_ci * iSCSI Logout CQE
104462306a36Sopenharmony_ci */
104562306a36Sopenharmony_cistruct bnx2i_logout_response {
104662306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
104762306a36Sopenharmony_ci	u8 op_code;
104862306a36Sopenharmony_ci	u8 reserved1;
104962306a36Sopenharmony_ci	u8 response;
105062306a36Sopenharmony_ci	u8 reserved0;
105162306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
105262306a36Sopenharmony_ci	u8 reserved0;
105362306a36Sopenharmony_ci	u8 response;
105462306a36Sopenharmony_ci	u8 reserved1;
105562306a36Sopenharmony_ci	u8 op_code;
105662306a36Sopenharmony_ci#endif
105762306a36Sopenharmony_ci	u32 reserved2;
105862306a36Sopenharmony_ci	u32 exp_cmd_sn;
105962306a36Sopenharmony_ci	u32 max_cmd_sn;
106062306a36Sopenharmony_ci	u32 reserved3[2];
106162306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
106262306a36Sopenharmony_ci	u16 reserved5;
106362306a36Sopenharmony_ci	u8 err_code;
106462306a36Sopenharmony_ci	u8 reserved4;
106562306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
106662306a36Sopenharmony_ci	u8 reserved4;
106762306a36Sopenharmony_ci	u8 err_code;
106862306a36Sopenharmony_ci	u16 reserved5;
106962306a36Sopenharmony_ci#endif
107062306a36Sopenharmony_ci	u32 reserved6[3];
107162306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
107262306a36Sopenharmony_ci	u16 time_to_wait;
107362306a36Sopenharmony_ci	u16 time_to_retain;
107462306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
107562306a36Sopenharmony_ci	u16 time_to_retain;
107662306a36Sopenharmony_ci	u16 time_to_wait;
107762306a36Sopenharmony_ci#endif
107862306a36Sopenharmony_ci	u32 reserved7[3];
107962306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
108062306a36Sopenharmony_ci	u16 reserved8;
108162306a36Sopenharmony_ci	u16 itt;
108262306a36Sopenharmony_ci#define ISCSI_LOGOUT_RESPONSE_INDEX (0x3FFF<<0)
108362306a36Sopenharmony_ci#define ISCSI_LOGOUT_RESPONSE_INDEX_SHIFT 0
108462306a36Sopenharmony_ci#define ISCSI_LOGOUT_RESPONSE_TYPE (0x3<<14)
108562306a36Sopenharmony_ci#define ISCSI_LOGOUT_RESPONSE_TYPE_SHIFT 14
108662306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
108762306a36Sopenharmony_ci	u16 itt;
108862306a36Sopenharmony_ci#define ISCSI_LOGOUT_RESPONSE_INDEX (0x3FFF<<0)
108962306a36Sopenharmony_ci#define ISCSI_LOGOUT_RESPONSE_INDEX_SHIFT 0
109062306a36Sopenharmony_ci#define ISCSI_LOGOUT_RESPONSE_TYPE (0x3<<14)
109162306a36Sopenharmony_ci#define ISCSI_LOGOUT_RESPONSE_TYPE_SHIFT 14
109262306a36Sopenharmony_ci	u16 reserved8;
109362306a36Sopenharmony_ci#endif
109462306a36Sopenharmony_ci	u32 cq_req_sn;
109562306a36Sopenharmony_ci};
109662306a36Sopenharmony_ci
109762306a36Sopenharmony_ci
109862306a36Sopenharmony_ci/*
109962306a36Sopenharmony_ci * iSCSI Nop-In CQE
110062306a36Sopenharmony_ci */
110162306a36Sopenharmony_cistruct bnx2i_nop_in_msg {
110262306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
110362306a36Sopenharmony_ci	u8 op_code;
110462306a36Sopenharmony_ci	u8 reserved1;
110562306a36Sopenharmony_ci	u16 reserved0;
110662306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
110762306a36Sopenharmony_ci	u16 reserved0;
110862306a36Sopenharmony_ci	u8 reserved1;
110962306a36Sopenharmony_ci	u8 op_code;
111062306a36Sopenharmony_ci#endif
111162306a36Sopenharmony_ci	u32 data_length;
111262306a36Sopenharmony_ci	u32 exp_cmd_sn;
111362306a36Sopenharmony_ci	u32 max_cmd_sn;
111462306a36Sopenharmony_ci	u32 ttt;
111562306a36Sopenharmony_ci	u32 reserved2;
111662306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
111762306a36Sopenharmony_ci	u16 reserved4;
111862306a36Sopenharmony_ci	u8 err_code;
111962306a36Sopenharmony_ci	u8 reserved3;
112062306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
112162306a36Sopenharmony_ci	u8 reserved3;
112262306a36Sopenharmony_ci	u8 err_code;
112362306a36Sopenharmony_ci	u16 reserved4;
112462306a36Sopenharmony_ci#endif
112562306a36Sopenharmony_ci	u32 reserved5;
112662306a36Sopenharmony_ci	u32 lun[2];
112762306a36Sopenharmony_ci	u32 reserved6[4];
112862306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
112962306a36Sopenharmony_ci	u16 reserved7;
113062306a36Sopenharmony_ci	u16 itt;
113162306a36Sopenharmony_ci#define ISCSI_NOP_IN_MSG_INDEX (0x3FFF<<0)
113262306a36Sopenharmony_ci#define ISCSI_NOP_IN_MSG_INDEX_SHIFT 0
113362306a36Sopenharmony_ci#define ISCSI_NOP_IN_MSG_TYPE (0x3<<14)
113462306a36Sopenharmony_ci#define ISCSI_NOP_IN_MSG_TYPE_SHIFT 14
113562306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
113662306a36Sopenharmony_ci	u16 itt;
113762306a36Sopenharmony_ci#define ISCSI_NOP_IN_MSG_INDEX (0x3FFF<<0)
113862306a36Sopenharmony_ci#define ISCSI_NOP_IN_MSG_INDEX_SHIFT 0
113962306a36Sopenharmony_ci#define ISCSI_NOP_IN_MSG_TYPE (0x3<<14)
114062306a36Sopenharmony_ci#define ISCSI_NOP_IN_MSG_TYPE_SHIFT 14
114162306a36Sopenharmony_ci	u16 reserved7;
114262306a36Sopenharmony_ci#endif
114362306a36Sopenharmony_ci	u32 cq_req_sn;
114462306a36Sopenharmony_ci};
114562306a36Sopenharmony_ci
114662306a36Sopenharmony_ci
114762306a36Sopenharmony_ci/*
114862306a36Sopenharmony_ci * iSCSI NOP-OUT SQ WQE
114962306a36Sopenharmony_ci */
115062306a36Sopenharmony_cistruct bnx2i_nop_out_request {
115162306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
115262306a36Sopenharmony_ci	u8 op_code;
115362306a36Sopenharmony_ci	u8 op_attr;
115462306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_RESERVED1 (0x7F<<0)
115562306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_RESERVED1_SHIFT 0
115662306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_ALWAYS_ONE (0x1<<7)
115762306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_ALWAYS_ONE_SHIFT 7
115862306a36Sopenharmony_ci	u16 reserved0;
115962306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
116062306a36Sopenharmony_ci	u16 reserved0;
116162306a36Sopenharmony_ci	u8 op_attr;
116262306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_RESERVED1 (0x7F<<0)
116362306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_RESERVED1_SHIFT 0
116462306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_ALWAYS_ONE (0x1<<7)
116562306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_ALWAYS_ONE_SHIFT 7
116662306a36Sopenharmony_ci	u8 op_code;
116762306a36Sopenharmony_ci#endif
116862306a36Sopenharmony_ci	u32 data_length;
116962306a36Sopenharmony_ci	u32 lun[2];
117062306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
117162306a36Sopenharmony_ci	u16 reserved2;
117262306a36Sopenharmony_ci	u16 itt;
117362306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_INDEX (0x3FFF<<0)
117462306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_INDEX_SHIFT 0
117562306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_TYPE (0x3<<14)
117662306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_TYPE_SHIFT 14
117762306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
117862306a36Sopenharmony_ci	u16 itt;
117962306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_INDEX (0x3FFF<<0)
118062306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_INDEX_SHIFT 0
118162306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_TYPE (0x3<<14)
118262306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_TYPE_SHIFT 14
118362306a36Sopenharmony_ci	u16 reserved2;
118462306a36Sopenharmony_ci#endif
118562306a36Sopenharmony_ci	u32 ttt;
118662306a36Sopenharmony_ci	u32 cmd_sn;
118762306a36Sopenharmony_ci	u32 reserved3[2];
118862306a36Sopenharmony_ci	u32 resp_bd_list_addr_lo;
118962306a36Sopenharmony_ci	u32 resp_bd_list_addr_hi;
119062306a36Sopenharmony_ci	u32 resp_buffer;
119162306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_RESP_BUFFER_LENGTH (0xFFFFFF<<0)
119262306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_RESP_BUFFER_LENGTH_SHIFT 0
119362306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_NUM_RESP_BDS (0xFF<<24)
119462306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_NUM_RESP_BDS_SHIFT 24
119562306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
119662306a36Sopenharmony_ci	u16 reserved7;
119762306a36Sopenharmony_ci	u8 reserved6;
119862306a36Sopenharmony_ci	u8 flags;
119962306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_RESERVED4 (0x1<<0)
120062306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_RESERVED4_SHIFT 0
120162306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_LOCAL_COMPLETION (0x1<<1)
120262306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_LOCAL_COMPLETION_SHIFT 1
120362306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_ZERO_FILL (0x3F<<2)
120462306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_ZERO_FILL_SHIFT 2
120562306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
120662306a36Sopenharmony_ci	u8 flags;
120762306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_RESERVED4 (0x1<<0)
120862306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_RESERVED4_SHIFT 0
120962306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_LOCAL_COMPLETION (0x1<<1)
121062306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_LOCAL_COMPLETION_SHIFT 1
121162306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_ZERO_FILL (0x3F<<2)
121262306a36Sopenharmony_ci#define ISCSI_NOP_OUT_REQUEST_ZERO_FILL_SHIFT 2
121362306a36Sopenharmony_ci	u8 reserved6;
121462306a36Sopenharmony_ci	u16 reserved7;
121562306a36Sopenharmony_ci#endif
121662306a36Sopenharmony_ci	u32 bd_list_addr_lo;
121762306a36Sopenharmony_ci	u32 bd_list_addr_hi;
121862306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
121962306a36Sopenharmony_ci	u8 cq_index;
122062306a36Sopenharmony_ci	u8 reserved9;
122162306a36Sopenharmony_ci	u8 reserved8;
122262306a36Sopenharmony_ci	u8 num_bds;
122362306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
122462306a36Sopenharmony_ci	u8 num_bds;
122562306a36Sopenharmony_ci	u8 reserved8;
122662306a36Sopenharmony_ci	u8 reserved9;
122762306a36Sopenharmony_ci	u8 cq_index;
122862306a36Sopenharmony_ci#endif
122962306a36Sopenharmony_ci};
123062306a36Sopenharmony_ci
123162306a36Sopenharmony_ci/*
123262306a36Sopenharmony_ci * iSCSI Reject CQE
123362306a36Sopenharmony_ci */
123462306a36Sopenharmony_cistruct bnx2i_reject_msg {
123562306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
123662306a36Sopenharmony_ci	u8 op_code;
123762306a36Sopenharmony_ci	u8 reserved1;
123862306a36Sopenharmony_ci	u8 reason;
123962306a36Sopenharmony_ci	u8 reserved0;
124062306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
124162306a36Sopenharmony_ci	u8 reserved0;
124262306a36Sopenharmony_ci	u8 reason;
124362306a36Sopenharmony_ci	u8 reserved1;
124462306a36Sopenharmony_ci	u8 op_code;
124562306a36Sopenharmony_ci#endif
124662306a36Sopenharmony_ci	u32 data_length;
124762306a36Sopenharmony_ci	u32 exp_cmd_sn;
124862306a36Sopenharmony_ci	u32 max_cmd_sn;
124962306a36Sopenharmony_ci	u32 reserved2[2];
125062306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
125162306a36Sopenharmony_ci	u16 reserved4;
125262306a36Sopenharmony_ci	u8 err_code;
125362306a36Sopenharmony_ci	u8 reserved3;
125462306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
125562306a36Sopenharmony_ci	u8 reserved3;
125662306a36Sopenharmony_ci	u8 err_code;
125762306a36Sopenharmony_ci	u16 reserved4;
125862306a36Sopenharmony_ci#endif
125962306a36Sopenharmony_ci	u32 reserved5[8];
126062306a36Sopenharmony_ci	u32 cq_req_sn;
126162306a36Sopenharmony_ci};
126262306a36Sopenharmony_ci
126362306a36Sopenharmony_ci/*
126462306a36Sopenharmony_ci * bnx2i iSCSI TMF SQ WQE
126562306a36Sopenharmony_ci */
126662306a36Sopenharmony_cistruct bnx2i_tmf_request {
126762306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
126862306a36Sopenharmony_ci	u8 op_code;
126962306a36Sopenharmony_ci	u8 op_attr;
127062306a36Sopenharmony_ci#define ISCSI_TMF_REQUEST_FUNCTION (0x7F<<0)
127162306a36Sopenharmony_ci#define ISCSI_TMF_REQUEST_FUNCTION_SHIFT 0
127262306a36Sopenharmony_ci#define ISCSI_TMF_REQUEST_ALWAYS_ONE (0x1<<7)
127362306a36Sopenharmony_ci#define ISCSI_TMF_REQUEST_ALWAYS_ONE_SHIFT 7
127462306a36Sopenharmony_ci	u16 reserved0;
127562306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
127662306a36Sopenharmony_ci	u16 reserved0;
127762306a36Sopenharmony_ci	u8 op_attr;
127862306a36Sopenharmony_ci#define ISCSI_TMF_REQUEST_FUNCTION (0x7F<<0)
127962306a36Sopenharmony_ci#define ISCSI_TMF_REQUEST_FUNCTION_SHIFT 0
128062306a36Sopenharmony_ci#define ISCSI_TMF_REQUEST_ALWAYS_ONE (0x1<<7)
128162306a36Sopenharmony_ci#define ISCSI_TMF_REQUEST_ALWAYS_ONE_SHIFT 7
128262306a36Sopenharmony_ci	u8 op_code;
128362306a36Sopenharmony_ci#endif
128462306a36Sopenharmony_ci	u32 data_length;
128562306a36Sopenharmony_ci	u32 lun[2];
128662306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
128762306a36Sopenharmony_ci	u16 reserved1;
128862306a36Sopenharmony_ci	u16 itt;
128962306a36Sopenharmony_ci#define ISCSI_TMF_REQUEST_INDEX (0x3FFF<<0)
129062306a36Sopenharmony_ci#define ISCSI_TMF_REQUEST_INDEX_SHIFT 0
129162306a36Sopenharmony_ci#define ISCSI_TMF_REQUEST_TYPE (0x3<<14)
129262306a36Sopenharmony_ci#define ISCSI_TMF_REQUEST_TYPE_SHIFT 14
129362306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
129462306a36Sopenharmony_ci	u16 itt;
129562306a36Sopenharmony_ci#define ISCSI_TMF_REQUEST_INDEX (0x3FFF<<0)
129662306a36Sopenharmony_ci#define ISCSI_TMF_REQUEST_INDEX_SHIFT 0
129762306a36Sopenharmony_ci#define ISCSI_TMF_REQUEST_TYPE (0x3<<14)
129862306a36Sopenharmony_ci#define ISCSI_TMF_REQUEST_TYPE_SHIFT 14
129962306a36Sopenharmony_ci	u16 reserved1;
130062306a36Sopenharmony_ci#endif
130162306a36Sopenharmony_ci	u32 ref_itt;
130262306a36Sopenharmony_ci	u32 cmd_sn;
130362306a36Sopenharmony_ci	u32 reserved2;
130462306a36Sopenharmony_ci	u32 ref_cmd_sn;
130562306a36Sopenharmony_ci	u32 reserved3[3];
130662306a36Sopenharmony_ci	u32 zero_fill;
130762306a36Sopenharmony_ci	u32 bd_list_addr_lo;
130862306a36Sopenharmony_ci	u32 bd_list_addr_hi;
130962306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
131062306a36Sopenharmony_ci	u8 cq_index;
131162306a36Sopenharmony_ci	u8 reserved5;
131262306a36Sopenharmony_ci	u8 reserved4;
131362306a36Sopenharmony_ci	u8 num_bds;
131462306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
131562306a36Sopenharmony_ci	u8 num_bds;
131662306a36Sopenharmony_ci	u8 reserved4;
131762306a36Sopenharmony_ci	u8 reserved5;
131862306a36Sopenharmony_ci	u8 cq_index;
131962306a36Sopenharmony_ci#endif
132062306a36Sopenharmony_ci};
132162306a36Sopenharmony_ci
132262306a36Sopenharmony_ci/*
132362306a36Sopenharmony_ci * iSCSI Text SQ WQE
132462306a36Sopenharmony_ci */
132562306a36Sopenharmony_cistruct bnx2i_text_request {
132662306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
132762306a36Sopenharmony_ci	u8 op_code;
132862306a36Sopenharmony_ci	u8 op_attr;
132962306a36Sopenharmony_ci#define ISCSI_TEXT_REQUEST_RESERVED1 (0x3F<<0)
133062306a36Sopenharmony_ci#define ISCSI_TEXT_REQUEST_RESERVED1_SHIFT 0
133162306a36Sopenharmony_ci#define ISCSI_TEXT_REQUEST_CONT (0x1<<6)
133262306a36Sopenharmony_ci#define ISCSI_TEXT_REQUEST_CONT_SHIFT 6
133362306a36Sopenharmony_ci#define ISCSI_TEXT_REQUEST_FINAL (0x1<<7)
133462306a36Sopenharmony_ci#define ISCSI_TEXT_REQUEST_FINAL_SHIFT 7
133562306a36Sopenharmony_ci	u16 reserved0;
133662306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
133762306a36Sopenharmony_ci	u16 reserved0;
133862306a36Sopenharmony_ci	u8 op_attr;
133962306a36Sopenharmony_ci#define ISCSI_TEXT_REQUEST_RESERVED1 (0x3F<<0)
134062306a36Sopenharmony_ci#define ISCSI_TEXT_REQUEST_RESERVED1_SHIFT 0
134162306a36Sopenharmony_ci#define ISCSI_TEXT_REQUEST_CONT (0x1<<6)
134262306a36Sopenharmony_ci#define ISCSI_TEXT_REQUEST_CONT_SHIFT 6
134362306a36Sopenharmony_ci#define ISCSI_TEXT_REQUEST_FINAL (0x1<<7)
134462306a36Sopenharmony_ci#define ISCSI_TEXT_REQUEST_FINAL_SHIFT 7
134562306a36Sopenharmony_ci	u8 op_code;
134662306a36Sopenharmony_ci#endif
134762306a36Sopenharmony_ci	u32 data_length;
134862306a36Sopenharmony_ci	u32 lun[2];
134962306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
135062306a36Sopenharmony_ci	u16 reserved3;
135162306a36Sopenharmony_ci	u16 itt;
135262306a36Sopenharmony_ci#define ISCSI_TEXT_REQUEST_INDEX (0x3FFF<<0)
135362306a36Sopenharmony_ci#define ISCSI_TEXT_REQUEST_INDEX_SHIFT 0
135462306a36Sopenharmony_ci#define ISCSI_TEXT_REQUEST_TYPE (0x3<<14)
135562306a36Sopenharmony_ci#define ISCSI_TEXT_REQUEST_TYPE_SHIFT 14
135662306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
135762306a36Sopenharmony_ci	u16 itt;
135862306a36Sopenharmony_ci#define ISCSI_TEXT_REQUEST_INDEX (0x3FFF<<0)
135962306a36Sopenharmony_ci#define ISCSI_TEXT_REQUEST_INDEX_SHIFT 0
136062306a36Sopenharmony_ci#define ISCSI_TEXT_REQUEST_TYPE (0x3<<14)
136162306a36Sopenharmony_ci#define ISCSI_TEXT_REQUEST_TYPE_SHIFT 14
136262306a36Sopenharmony_ci	u16 reserved3;
136362306a36Sopenharmony_ci#endif
136462306a36Sopenharmony_ci	u32 ttt;
136562306a36Sopenharmony_ci	u32 cmd_sn;
136662306a36Sopenharmony_ci	u32 reserved4[2];
136762306a36Sopenharmony_ci	u32 resp_bd_list_addr_lo;
136862306a36Sopenharmony_ci	u32 resp_bd_list_addr_hi;
136962306a36Sopenharmony_ci	u32 resp_buffer;
137062306a36Sopenharmony_ci#define ISCSI_TEXT_REQUEST_RESP_BUFFER_LENGTH (0xFFFFFF<<0)
137162306a36Sopenharmony_ci#define ISCSI_TEXT_REQUEST_RESP_BUFFER_LENGTH_SHIFT 0
137262306a36Sopenharmony_ci#define ISCSI_TEXT_REQUEST_NUM_RESP_BDS (0xFF<<24)
137362306a36Sopenharmony_ci#define ISCSI_TEXT_REQUEST_NUM_RESP_BDS_SHIFT 24
137462306a36Sopenharmony_ci	u32 zero_fill;
137562306a36Sopenharmony_ci	u32 bd_list_addr_lo;
137662306a36Sopenharmony_ci	u32 bd_list_addr_hi;
137762306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
137862306a36Sopenharmony_ci	u8 cq_index;
137962306a36Sopenharmony_ci	u8 reserved7;
138062306a36Sopenharmony_ci	u8 reserved6;
138162306a36Sopenharmony_ci	u8 num_bds;
138262306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
138362306a36Sopenharmony_ci	u8 num_bds;
138462306a36Sopenharmony_ci	u8 reserved6;
138562306a36Sopenharmony_ci	u8 reserved7;
138662306a36Sopenharmony_ci	u8 cq_index;
138762306a36Sopenharmony_ci#endif
138862306a36Sopenharmony_ci};
138962306a36Sopenharmony_ci
139062306a36Sopenharmony_ci/*
139162306a36Sopenharmony_ci * iSCSI SQ WQE
139262306a36Sopenharmony_ci */
139362306a36Sopenharmony_ciunion iscsi_request {
139462306a36Sopenharmony_ci	struct bnx2i_cmd_request cmd;
139562306a36Sopenharmony_ci	struct bnx2i_tmf_request tmf;
139662306a36Sopenharmony_ci	struct bnx2i_nop_out_request nop_out;
139762306a36Sopenharmony_ci	struct bnx2i_login_request login_req;
139862306a36Sopenharmony_ci	struct bnx2i_text_request text;
139962306a36Sopenharmony_ci	struct bnx2i_logout_request logout_req;
140062306a36Sopenharmony_ci	struct bnx2i_cleanup_request cleanup;
140162306a36Sopenharmony_ci};
140262306a36Sopenharmony_ci
140362306a36Sopenharmony_ci
140462306a36Sopenharmony_ci/*
140562306a36Sopenharmony_ci * iSCSI TMF CQE
140662306a36Sopenharmony_ci */
140762306a36Sopenharmony_cistruct bnx2i_tmf_response {
140862306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
140962306a36Sopenharmony_ci	u8 op_code;
141062306a36Sopenharmony_ci	u8 reserved1;
141162306a36Sopenharmony_ci	u8 response;
141262306a36Sopenharmony_ci	u8 reserved0;
141362306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
141462306a36Sopenharmony_ci	u8 reserved0;
141562306a36Sopenharmony_ci	u8 response;
141662306a36Sopenharmony_ci	u8 reserved1;
141762306a36Sopenharmony_ci	u8 op_code;
141862306a36Sopenharmony_ci#endif
141962306a36Sopenharmony_ci	u32 reserved2;
142062306a36Sopenharmony_ci	u32 exp_cmd_sn;
142162306a36Sopenharmony_ci	u32 max_cmd_sn;
142262306a36Sopenharmony_ci	u32 reserved3[2];
142362306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
142462306a36Sopenharmony_ci	u16 reserved5;
142562306a36Sopenharmony_ci	u8 err_code;
142662306a36Sopenharmony_ci	u8 reserved4;
142762306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
142862306a36Sopenharmony_ci	u8 reserved4;
142962306a36Sopenharmony_ci	u8 err_code;
143062306a36Sopenharmony_ci	u16 reserved5;
143162306a36Sopenharmony_ci#endif
143262306a36Sopenharmony_ci	u32 reserved6[7];
143362306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
143462306a36Sopenharmony_ci	u16 reserved7;
143562306a36Sopenharmony_ci	u16 itt;
143662306a36Sopenharmony_ci#define ISCSI_TMF_RESPONSE_INDEX (0x3FFF<<0)
143762306a36Sopenharmony_ci#define ISCSI_TMF_RESPONSE_INDEX_SHIFT 0
143862306a36Sopenharmony_ci#define ISCSI_TMF_RESPONSE_TYPE (0x3<<14)
143962306a36Sopenharmony_ci#define ISCSI_TMF_RESPONSE_TYPE_SHIFT 14
144062306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
144162306a36Sopenharmony_ci	u16 itt;
144262306a36Sopenharmony_ci#define ISCSI_TMF_RESPONSE_INDEX (0x3FFF<<0)
144362306a36Sopenharmony_ci#define ISCSI_TMF_RESPONSE_INDEX_SHIFT 0
144462306a36Sopenharmony_ci#define ISCSI_TMF_RESPONSE_TYPE (0x3<<14)
144562306a36Sopenharmony_ci#define ISCSI_TMF_RESPONSE_TYPE_SHIFT 14
144662306a36Sopenharmony_ci	u16 reserved7;
144762306a36Sopenharmony_ci#endif
144862306a36Sopenharmony_ci	u32 cq_req_sn;
144962306a36Sopenharmony_ci};
145062306a36Sopenharmony_ci
145162306a36Sopenharmony_ci/*
145262306a36Sopenharmony_ci * iSCSI Text CQE
145362306a36Sopenharmony_ci */
145462306a36Sopenharmony_cistruct bnx2i_text_response {
145562306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
145662306a36Sopenharmony_ci	u8 op_code;
145762306a36Sopenharmony_ci	u8 response_flags;
145862306a36Sopenharmony_ci#define ISCSI_TEXT_RESPONSE_RESERVED1 (0x3F<<0)
145962306a36Sopenharmony_ci#define ISCSI_TEXT_RESPONSE_RESERVED1_SHIFT 0
146062306a36Sopenharmony_ci#define ISCSI_TEXT_RESPONSE_CONT (0x1<<6)
146162306a36Sopenharmony_ci#define ISCSI_TEXT_RESPONSE_CONT_SHIFT 6
146262306a36Sopenharmony_ci#define ISCSI_TEXT_RESPONSE_FINAL (0x1<<7)
146362306a36Sopenharmony_ci#define ISCSI_TEXT_RESPONSE_FINAL_SHIFT 7
146462306a36Sopenharmony_ci	u16 reserved0;
146562306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
146662306a36Sopenharmony_ci	u16 reserved0;
146762306a36Sopenharmony_ci	u8 response_flags;
146862306a36Sopenharmony_ci#define ISCSI_TEXT_RESPONSE_RESERVED1 (0x3F<<0)
146962306a36Sopenharmony_ci#define ISCSI_TEXT_RESPONSE_RESERVED1_SHIFT 0
147062306a36Sopenharmony_ci#define ISCSI_TEXT_RESPONSE_CONT (0x1<<6)
147162306a36Sopenharmony_ci#define ISCSI_TEXT_RESPONSE_CONT_SHIFT 6
147262306a36Sopenharmony_ci#define ISCSI_TEXT_RESPONSE_FINAL (0x1<<7)
147362306a36Sopenharmony_ci#define ISCSI_TEXT_RESPONSE_FINAL_SHIFT 7
147462306a36Sopenharmony_ci	u8 op_code;
147562306a36Sopenharmony_ci#endif
147662306a36Sopenharmony_ci	u32 data_length;
147762306a36Sopenharmony_ci	u32 exp_cmd_sn;
147862306a36Sopenharmony_ci	u32 max_cmd_sn;
147962306a36Sopenharmony_ci	u32 ttt;
148062306a36Sopenharmony_ci	u32 reserved2;
148162306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
148262306a36Sopenharmony_ci	u16 reserved4;
148362306a36Sopenharmony_ci	u8 err_code;
148462306a36Sopenharmony_ci	u8 reserved3;
148562306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
148662306a36Sopenharmony_ci	u8 reserved3;
148762306a36Sopenharmony_ci	u8 err_code;
148862306a36Sopenharmony_ci	u16 reserved4;
148962306a36Sopenharmony_ci#endif
149062306a36Sopenharmony_ci	u32 reserved5;
149162306a36Sopenharmony_ci	u32 lun[2];
149262306a36Sopenharmony_ci	u32 reserved6[4];
149362306a36Sopenharmony_ci#if defined(__BIG_ENDIAN)
149462306a36Sopenharmony_ci	u16 reserved7;
149562306a36Sopenharmony_ci	u16 itt;
149662306a36Sopenharmony_ci#define ISCSI_TEXT_RESPONSE_INDEX (0x3FFF<<0)
149762306a36Sopenharmony_ci#define ISCSI_TEXT_RESPONSE_INDEX_SHIFT 0
149862306a36Sopenharmony_ci#define ISCSI_TEXT_RESPONSE_TYPE (0x3<<14)
149962306a36Sopenharmony_ci#define ISCSI_TEXT_RESPONSE_TYPE_SHIFT 14
150062306a36Sopenharmony_ci#elif defined(__LITTLE_ENDIAN)
150162306a36Sopenharmony_ci	u16 itt;
150262306a36Sopenharmony_ci#define ISCSI_TEXT_RESPONSE_INDEX (0x3FFF<<0)
150362306a36Sopenharmony_ci#define ISCSI_TEXT_RESPONSE_INDEX_SHIFT 0
150462306a36Sopenharmony_ci#define ISCSI_TEXT_RESPONSE_TYPE (0x3<<14)
150562306a36Sopenharmony_ci#define ISCSI_TEXT_RESPONSE_TYPE_SHIFT 14
150662306a36Sopenharmony_ci	u16 reserved7;
150762306a36Sopenharmony_ci#endif
150862306a36Sopenharmony_ci	u32 cq_req_sn;
150962306a36Sopenharmony_ci};
151062306a36Sopenharmony_ci
151162306a36Sopenharmony_ci/*
151262306a36Sopenharmony_ci * iSCSI CQE
151362306a36Sopenharmony_ci */
151462306a36Sopenharmony_ciunion iscsi_response {
151562306a36Sopenharmony_ci	struct bnx2i_cmd_response cmd;
151662306a36Sopenharmony_ci	struct bnx2i_tmf_response tmf;
151762306a36Sopenharmony_ci	struct bnx2i_login_response login_resp;
151862306a36Sopenharmony_ci	struct bnx2i_text_response text;
151962306a36Sopenharmony_ci	struct bnx2i_logout_response logout_resp;
152062306a36Sopenharmony_ci	struct bnx2i_cleanup_response cleanup;
152162306a36Sopenharmony_ci	struct bnx2i_reject_msg reject;
152262306a36Sopenharmony_ci	struct bnx2i_async_msg async;
152362306a36Sopenharmony_ci	struct bnx2i_nop_in_msg nop_in;
152462306a36Sopenharmony_ci};
152562306a36Sopenharmony_ci
152662306a36Sopenharmony_ci#endif /* __57XX_ISCSI_HSI_LINUX_LE__ */
1527