xref: /freebsd/sys/dev/qlnx/qlnxe/fcoe_common.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
111e25f0dSDavid C Somayajulu /*
211e25f0dSDavid C Somayajulu  * Copyright (c) 2017-2018 Cavium, Inc.
311e25f0dSDavid C Somayajulu  * All rights reserved.
411e25f0dSDavid C Somayajulu  *
511e25f0dSDavid C Somayajulu  *  Redistribution and use in source and binary forms, with or without
611e25f0dSDavid C Somayajulu  *  modification, are permitted provided that the following conditions
711e25f0dSDavid C Somayajulu  *  are met:
811e25f0dSDavid C Somayajulu  *
911e25f0dSDavid C Somayajulu  *  1. Redistributions of source code must retain the above copyright
1011e25f0dSDavid C Somayajulu  *     notice, this list of conditions and the following disclaimer.
1111e25f0dSDavid C Somayajulu  *  2. Redistributions in binary form must reproduce the above copyright
1211e25f0dSDavid C Somayajulu  *     notice, this list of conditions and the following disclaimer in the
1311e25f0dSDavid C Somayajulu  *     documentation and/or other materials provided with the distribution.
1411e25f0dSDavid C Somayajulu  *
1511e25f0dSDavid C Somayajulu  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
1611e25f0dSDavid C Somayajulu  *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1711e25f0dSDavid C Somayajulu  *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1811e25f0dSDavid C Somayajulu  *  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
1911e25f0dSDavid C Somayajulu  *  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2011e25f0dSDavid C Somayajulu  *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2111e25f0dSDavid C Somayajulu  *  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2211e25f0dSDavid C Somayajulu  *  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2311e25f0dSDavid C Somayajulu  *  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2411e25f0dSDavid C Somayajulu  *  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2511e25f0dSDavid C Somayajulu  *  POSSIBILITY OF SUCH DAMAGE.
2611e25f0dSDavid C Somayajulu  *
2711e25f0dSDavid C Somayajulu  */
2811e25f0dSDavid C Somayajulu 
2911e25f0dSDavid C Somayajulu #ifndef __FCOE_COMMON__
3011e25f0dSDavid C Somayajulu #define __FCOE_COMMON__
3111e25f0dSDavid C Somayajulu /*********************/
3211e25f0dSDavid C Somayajulu /* FCOE FW CONSTANTS */
3311e25f0dSDavid C Somayajulu /*********************/
3411e25f0dSDavid C Somayajulu 
3511e25f0dSDavid C Somayajulu #define FC_ABTS_REPLY_MAX_PAYLOAD_LEN	12
3611e25f0dSDavid C Somayajulu 
3711e25f0dSDavid C Somayajulu /*
3811e25f0dSDavid C Somayajulu  * The fcoe storm task context protection-information of Ystorm
3911e25f0dSDavid C Somayajulu  */
4011e25f0dSDavid C Somayajulu struct protection_info_ctx
4111e25f0dSDavid C Somayajulu {
4211e25f0dSDavid C Somayajulu 	__le16 flags;
4311e25f0dSDavid C Somayajulu #define PROTECTION_INFO_CTX_HOST_INTERFACE_MASK        0x3 /* 0=none, 1=DIF, 2=DIX */
4411e25f0dSDavid C Somayajulu #define PROTECTION_INFO_CTX_HOST_INTERFACE_SHIFT       0
4511e25f0dSDavid C Somayajulu #define PROTECTION_INFO_CTX_DIF_TO_PEER_MASK           0x1 /* 0=no, 1=yes */
4611e25f0dSDavid C Somayajulu #define PROTECTION_INFO_CTX_DIF_TO_PEER_SHIFT          2
4711e25f0dSDavid C Somayajulu #define PROTECTION_INFO_CTX_VALIDATE_DIX_APP_TAG_MASK  0x1 /* 0=no, 1=yes */
4811e25f0dSDavid C Somayajulu #define PROTECTION_INFO_CTX_VALIDATE_DIX_APP_TAG_SHIFT 3
4911e25f0dSDavid C Somayajulu #define PROTECTION_INFO_CTX_INTERVAL_SIZE_LOG_MASK     0xF /* Protection log interval (9=512 10=1024  11=2048 12=4096 13=8192) */
5011e25f0dSDavid C Somayajulu #define PROTECTION_INFO_CTX_INTERVAL_SIZE_LOG_SHIFT    4
5111e25f0dSDavid C Somayajulu #define PROTECTION_INFO_CTX_VALIDATE_DIX_REF_TAG_MASK  0x1 /* 0=no, 1=yes */
5211e25f0dSDavid C Somayajulu #define PROTECTION_INFO_CTX_VALIDATE_DIX_REF_TAG_SHIFT 8
5311e25f0dSDavid C Somayajulu #define PROTECTION_INFO_CTX_RESERVED0_MASK             0x7F
5411e25f0dSDavid C Somayajulu #define PROTECTION_INFO_CTX_RESERVED0_SHIFT            9
5511e25f0dSDavid C Somayajulu 	u8 dix_block_size /* Source protection data size */;
5611e25f0dSDavid C Somayajulu 	u8 dst_size /* Destination protection data size */;
5711e25f0dSDavid C Somayajulu };
5811e25f0dSDavid C Somayajulu 
5911e25f0dSDavid C Somayajulu /*
6011e25f0dSDavid C Somayajulu  * The fcoe storm task context protection-information of Ystorm
6111e25f0dSDavid C Somayajulu  */
6211e25f0dSDavid C Somayajulu union protection_info_union_ctx
6311e25f0dSDavid C Somayajulu {
6411e25f0dSDavid C Somayajulu 	struct protection_info_ctx info;
6511e25f0dSDavid C Somayajulu 	__le32 value /* If and only if this field is not 0 then protection is set */;
6611e25f0dSDavid C Somayajulu };
6711e25f0dSDavid C Somayajulu 
6811e25f0dSDavid C Somayajulu /*
699efd0ba7SDavid C Somayajulu  * FCP CMD payload
709efd0ba7SDavid C Somayajulu  */
719efd0ba7SDavid C Somayajulu struct fcoe_fcp_cmd_payload
729efd0ba7SDavid C Somayajulu {
739efd0ba7SDavid C Somayajulu 	__le32 opaque[8] /* The FCP_CMD payload */;
749efd0ba7SDavid C Somayajulu };
759efd0ba7SDavid C Somayajulu 
769efd0ba7SDavid C Somayajulu /*
779efd0ba7SDavid C Somayajulu  * FCP RSP payload
789efd0ba7SDavid C Somayajulu  */
799efd0ba7SDavid C Somayajulu struct fcoe_fcp_rsp_payload
809efd0ba7SDavid C Somayajulu {
819efd0ba7SDavid C Somayajulu 	__le32 opaque[6] /* The FCP_RSP payload */;
829efd0ba7SDavid C Somayajulu };
839efd0ba7SDavid C Somayajulu 
849efd0ba7SDavid C Somayajulu /*
8511e25f0dSDavid C Somayajulu  * FCP RSP payload
8611e25f0dSDavid C Somayajulu  */
8711e25f0dSDavid C Somayajulu struct fcp_rsp_payload_padded
8811e25f0dSDavid C Somayajulu {
8911e25f0dSDavid C Somayajulu 	struct fcoe_fcp_rsp_payload rsp_payload /* The FCP_RSP payload */;
9011e25f0dSDavid C Somayajulu 	__le32 reserved[2];
9111e25f0dSDavid C Somayajulu };
9211e25f0dSDavid C Somayajulu 
9311e25f0dSDavid C Somayajulu /*
9411e25f0dSDavid C Somayajulu  * FCP RSP payload
9511e25f0dSDavid C Somayajulu  */
969efd0ba7SDavid C Somayajulu struct fcoe_fcp_xfer_payload
979efd0ba7SDavid C Somayajulu {
989efd0ba7SDavid C Somayajulu 	__le32 opaque[3] /* The FCP_XFER payload */;
999efd0ba7SDavid C Somayajulu };
1009efd0ba7SDavid C Somayajulu 
1019efd0ba7SDavid C Somayajulu /*
1029efd0ba7SDavid C Somayajulu  * FCP RSP payload
1039efd0ba7SDavid C Somayajulu  */
10411e25f0dSDavid C Somayajulu struct fcp_xfer_payload_padded
10511e25f0dSDavid C Somayajulu {
10611e25f0dSDavid C Somayajulu 	struct fcoe_fcp_xfer_payload xfer_payload /* The FCP_XFER payload */;
10711e25f0dSDavid C Somayajulu 	__le32 reserved[5];
10811e25f0dSDavid C Somayajulu };
10911e25f0dSDavid C Somayajulu 
11011e25f0dSDavid C Somayajulu /*
11111e25f0dSDavid C Somayajulu  * Task params
11211e25f0dSDavid C Somayajulu  */
11311e25f0dSDavid C Somayajulu struct fcoe_tx_data_params
11411e25f0dSDavid C Somayajulu {
11511e25f0dSDavid C Somayajulu 	__le32 data_offset /* Data offset */;
11611e25f0dSDavid C Somayajulu 	__le32 offset_in_io /* For sequence cleanup */;
11711e25f0dSDavid C Somayajulu 	u8 flags;
11811e25f0dSDavid C Somayajulu #define FCOE_TX_DATA_PARAMS_OFFSET_IN_IO_VALID_MASK  0x1 /* Should we send offset in IO */
11911e25f0dSDavid C Somayajulu #define FCOE_TX_DATA_PARAMS_OFFSET_IN_IO_VALID_SHIFT 0
12011e25f0dSDavid C Somayajulu #define FCOE_TX_DATA_PARAMS_DROP_DATA_MASK           0x1 /* Should the PBF drop this data */
12111e25f0dSDavid C Somayajulu #define FCOE_TX_DATA_PARAMS_DROP_DATA_SHIFT          1
12211e25f0dSDavid C Somayajulu #define FCOE_TX_DATA_PARAMS_AFTER_SEQ_REC_MASK       0x1 /* Indication if the task after seqqence recovery flow */
12311e25f0dSDavid C Somayajulu #define FCOE_TX_DATA_PARAMS_AFTER_SEQ_REC_SHIFT      2
12411e25f0dSDavid C Somayajulu #define FCOE_TX_DATA_PARAMS_RESERVED0_MASK           0x1F
12511e25f0dSDavid C Somayajulu #define FCOE_TX_DATA_PARAMS_RESERVED0_SHIFT          3
12611e25f0dSDavid C Somayajulu 	u8 dif_residual /* Residual from protection interval */;
12711e25f0dSDavid C Somayajulu 	__le16 seq_cnt /* Sequence counter */;
12811e25f0dSDavid C Somayajulu 	__le16 single_sge_saved_offset /* Saved SGE length for single SGE case */;
12911e25f0dSDavid C Somayajulu 	__le16 next_dif_offset /* Tracking next DIF offset in FC payload */;
13011e25f0dSDavid C Somayajulu 	__le16 seq_id /* Sequence ID (Set [saved] upon seq_cnt==0 (start of sequence) and used throughout sequence) */;
13111e25f0dSDavid C Somayajulu 	__le16 reserved3;
13211e25f0dSDavid C Somayajulu };
13311e25f0dSDavid C Somayajulu 
13411e25f0dSDavid C Somayajulu /*
13511e25f0dSDavid C Somayajulu  * Middle path parameters: FC header fields provided by the driver
13611e25f0dSDavid C Somayajulu  */
13711e25f0dSDavid C Somayajulu struct fcoe_tx_mid_path_params
13811e25f0dSDavid C Somayajulu {
13911e25f0dSDavid C Somayajulu 	__le32 parameter;
14011e25f0dSDavid C Somayajulu 	u8 r_ctl;
14111e25f0dSDavid C Somayajulu 	u8 type;
14211e25f0dSDavid C Somayajulu 	u8 cs_ctl;
14311e25f0dSDavid C Somayajulu 	u8 df_ctl;
14411e25f0dSDavid C Somayajulu 	__le16 rx_id;
14511e25f0dSDavid C Somayajulu 	__le16 ox_id;
14611e25f0dSDavid C Somayajulu };
14711e25f0dSDavid C Somayajulu 
14811e25f0dSDavid C Somayajulu /*
14911e25f0dSDavid C Somayajulu  * Task params
15011e25f0dSDavid C Somayajulu  */
15111e25f0dSDavid C Somayajulu struct fcoe_tx_params
15211e25f0dSDavid C Somayajulu {
15311e25f0dSDavid C Somayajulu 	struct fcoe_tx_data_params data /* Data offset */;
15411e25f0dSDavid C Somayajulu 	struct fcoe_tx_mid_path_params mid_path;
15511e25f0dSDavid C Somayajulu };
15611e25f0dSDavid C Somayajulu 
15711e25f0dSDavid C Somayajulu /*
15811e25f0dSDavid C Somayajulu  * Union of FCP CMD payload \ TX params \ ABTS \ Cleanup
15911e25f0dSDavid C Somayajulu  */
16011e25f0dSDavid C Somayajulu union fcoe_tx_info_union_ctx
16111e25f0dSDavid C Somayajulu {
16211e25f0dSDavid C Somayajulu 	struct fcoe_fcp_cmd_payload fcp_cmd_payload /* FCP CMD payload */;
16311e25f0dSDavid C Somayajulu 	struct fcp_rsp_payload_padded fcp_rsp_payload /* FCP RSP payload */;
16411e25f0dSDavid C Somayajulu 	struct fcp_xfer_payload_padded fcp_xfer_payload /* FCP XFER payload */;
16511e25f0dSDavid C Somayajulu 	struct fcoe_tx_params tx_params /* Task TX params */;
16611e25f0dSDavid C Somayajulu };
16711e25f0dSDavid C Somayajulu 
16811e25f0dSDavid C Somayajulu /*
1699efd0ba7SDavid C Somayajulu  * Data sgl
1709efd0ba7SDavid C Somayajulu  */
1719efd0ba7SDavid C Somayajulu struct fcoe_slow_sgl_ctx
1729efd0ba7SDavid C Somayajulu {
1739efd0ba7SDavid C Somayajulu 	struct regpair base_sgl_addr /* Address of first SGE in SGL */;
1749efd0ba7SDavid C Somayajulu 	__le16 curr_sge_off /* Offset in current BD (in bytes) */;
1759efd0ba7SDavid C Somayajulu 	__le16 remainder_num_sges /* Number of BDs */;
1769efd0ba7SDavid C Somayajulu 	__le16 curr_sgl_index /* Index of current SGE */;
1779efd0ba7SDavid C Somayajulu 	__le16 reserved;
1789efd0ba7SDavid C Somayajulu };
1799efd0ba7SDavid C Somayajulu 
1809efd0ba7SDavid C Somayajulu /*
1819efd0ba7SDavid C Somayajulu  * Union of DIX SGL \ cached DIX sges
1829efd0ba7SDavid C Somayajulu  */
1839efd0ba7SDavid C Somayajulu union fcoe_dix_desc_ctx
1849efd0ba7SDavid C Somayajulu {
1859efd0ba7SDavid C Somayajulu 	struct fcoe_slow_sgl_ctx dix_sgl /* DIX slow-SGL data base */;
1869efd0ba7SDavid C Somayajulu 	struct scsi_sge cached_dix_sge /* Cached DIX sge */;
1879efd0ba7SDavid C Somayajulu };
1889efd0ba7SDavid C Somayajulu 
1899efd0ba7SDavid C Somayajulu /*
19011e25f0dSDavid C Somayajulu  * The fcoe storm task context of Ystorm
19111e25f0dSDavid C Somayajulu  */
19211e25f0dSDavid C Somayajulu struct ystorm_fcoe_task_st_ctx
19311e25f0dSDavid C Somayajulu {
194*217ec208SDavid C Somayajulu 	u8 task_type /* Task type. use enum fcoe_task_type  (use enum fcoe_task_type) */;
19511e25f0dSDavid C Somayajulu 	u8 sgl_mode;
19611e25f0dSDavid C Somayajulu #define YSTORM_FCOE_TASK_ST_CTX_TX_SGL_MODE_MASK  0x1 /* use enum scsi_sgl_mode (use enum scsi_sgl_mode) */
19711e25f0dSDavid C Somayajulu #define YSTORM_FCOE_TASK_ST_CTX_TX_SGL_MODE_SHIFT 0
19811e25f0dSDavid C Somayajulu #define YSTORM_FCOE_TASK_ST_CTX_RSRV_MASK         0x7F
19911e25f0dSDavid C Somayajulu #define YSTORM_FCOE_TASK_ST_CTX_RSRV_SHIFT        1
20011e25f0dSDavid C Somayajulu 	u8 cached_dix_sge /* Dix sge is cached on task context */;
20111e25f0dSDavid C Somayajulu 	u8 expect_first_xfer /* Will let Ystorm know when it should initialize fcp_cmd_payload_params_union.params */;
20211e25f0dSDavid C Somayajulu 	__le32 num_pbf_zero_write /* The amount of bytes that PBF should dummy write - Relevant for protection only. */;
20311e25f0dSDavid C Somayajulu 	union protection_info_union_ctx protection_info_union /* Protection information */;
20411e25f0dSDavid C Somayajulu 	__le32 data_2_trns_rem /* Entire SGL-buffer remainder */;
20511e25f0dSDavid C Somayajulu 	struct scsi_sgl_params sgl_params;
20611e25f0dSDavid C Somayajulu 	u8 reserved1[12];
20711e25f0dSDavid C Somayajulu 	union fcoe_tx_info_union_ctx tx_info_union /* Union of FCP CMD payload / TX params / ABTS / Cleanup */;
20811e25f0dSDavid C Somayajulu 	union fcoe_dix_desc_ctx dix_desc /* Union of DIX SGL / cached DIX sges */;
20911e25f0dSDavid C Somayajulu 	struct scsi_cached_sges data_desc /* Data cached SGEs */;
21011e25f0dSDavid C Somayajulu 	__le16 ox_id /* OX-ID. Used in Target mode only */;
21111e25f0dSDavid C Somayajulu 	__le16 rx_id /* RX-ID. Used in Target mode only */;
21211e25f0dSDavid C Somayajulu 	__le32 task_rety_identifier /* Parameter field of the FCP CMDs FC header */;
21311e25f0dSDavid C Somayajulu 	u8 reserved2[8];
21411e25f0dSDavid C Somayajulu };
21511e25f0dSDavid C Somayajulu 
21611e25f0dSDavid C Somayajulu struct e4_ystorm_fcoe_task_ag_ctx
21711e25f0dSDavid C Somayajulu {
21811e25f0dSDavid C Somayajulu 	u8 byte0 /* cdu_validation */;
21911e25f0dSDavid C Somayajulu 	u8 byte1 /* state */;
22011e25f0dSDavid C Somayajulu 	__le16 word0 /* icid */;
22111e25f0dSDavid C Somayajulu 	u8 flags0;
22211e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_NIBBLE0_MASK     0xF /* connection_type */
22311e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_NIBBLE0_SHIFT    0
22411e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_BIT0_MASK        0x1 /* exist_in_qm0 */
22511e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_BIT0_SHIFT       4
22611e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_BIT1_MASK        0x1 /* exist_in_qm1 */
22711e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_BIT1_SHIFT       5
22811e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_BIT2_MASK        0x1 /* bit2 */
22911e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_BIT2_SHIFT       6
23011e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_BIT3_MASK        0x1 /* bit3 */
23111e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_BIT3_SHIFT       7
23211e25f0dSDavid C Somayajulu 	u8 flags1;
23311e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_CF0_MASK         0x3 /* cf0 */
23411e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_CF0_SHIFT        0
23511e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_CF1_MASK         0x3 /* cf1 */
23611e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_CF1_SHIFT        2
23711e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_CF2SPECIAL_MASK  0x3 /* cf2special */
23811e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_CF2SPECIAL_SHIFT 4
23911e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_CF0EN_MASK       0x1 /* cf0en */
24011e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_CF0EN_SHIFT      6
24111e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_CF1EN_MASK       0x1 /* cf1en */
24211e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_CF1EN_SHIFT      7
24311e25f0dSDavid C Somayajulu 	u8 flags2;
24411e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_BIT4_MASK        0x1 /* bit4 */
24511e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_BIT4_SHIFT       0
24611e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_RULE0EN_MASK     0x1 /* rule0en */
24711e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_RULE0EN_SHIFT    1
24811e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_RULE1EN_MASK     0x1 /* rule1en */
24911e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_RULE1EN_SHIFT    2
25011e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_RULE2EN_MASK     0x1 /* rule2en */
25111e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_RULE2EN_SHIFT    3
25211e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_RULE3EN_MASK     0x1 /* rule3en */
25311e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_RULE3EN_SHIFT    4
25411e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_RULE4EN_MASK     0x1 /* rule4en */
25511e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_RULE4EN_SHIFT    5
25611e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_RULE5EN_MASK     0x1 /* rule5en */
25711e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_RULE5EN_SHIFT    6
25811e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_RULE6EN_MASK     0x1 /* rule6en */
25911e25f0dSDavid C Somayajulu #define E4_YSTORM_FCOE_TASK_AG_CTX_RULE6EN_SHIFT    7
26011e25f0dSDavid C Somayajulu 	u8 byte2 /* byte2 */;
26111e25f0dSDavid C Somayajulu 	__le32 reg0 /* reg0 */;
26211e25f0dSDavid C Somayajulu 	u8 byte3 /* byte3 */;
26311e25f0dSDavid C Somayajulu 	u8 byte4 /* byte4 */;
26411e25f0dSDavid C Somayajulu 	__le16 rx_id /* word1 */;
26511e25f0dSDavid C Somayajulu 	__le16 word2 /* word2 */;
26611e25f0dSDavid C Somayajulu 	__le16 word3 /* word3 */;
26711e25f0dSDavid C Somayajulu 	__le16 word4 /* word4 */;
26811e25f0dSDavid C Somayajulu 	__le16 word5 /* word5 */;
26911e25f0dSDavid C Somayajulu 	__le32 reg1 /* reg1 */;
27011e25f0dSDavid C Somayajulu 	__le32 reg2 /* reg2 */;
27111e25f0dSDavid C Somayajulu };
27211e25f0dSDavid C Somayajulu 
27311e25f0dSDavid C Somayajulu struct e4_tstorm_fcoe_task_ag_ctx
27411e25f0dSDavid C Somayajulu {
27511e25f0dSDavid C Somayajulu 	u8 reserved /* cdu_validation */;
27611e25f0dSDavid C Somayajulu 	u8 byte1 /* state */;
27711e25f0dSDavid C Somayajulu 	__le16 icid /* icid */;
27811e25f0dSDavid C Somayajulu 	u8 flags0;
27911e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_CONNECTION_TYPE_MASK     0xF /* connection_type */
28011e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_CONNECTION_TYPE_SHIFT    0
28111e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_EXIST_IN_QM0_MASK        0x1 /* exist_in_qm0 */
28211e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_EXIST_IN_QM0_SHIFT       4
28311e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_BIT1_MASK                0x1 /* exist_in_qm1 */
28411e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_BIT1_SHIFT               5
28511e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_WAIT_ABTS_RSP_F_MASK     0x1 /* bit2 */
28611e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_WAIT_ABTS_RSP_F_SHIFT    6
28711e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_VALID_MASK               0x1 /* bit3 */
28811e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_VALID_SHIFT              7
28911e25f0dSDavid C Somayajulu 	u8 flags1;
29011e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_FALSE_RR_TOV_MASK        0x1 /* bit4 */
29111e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_FALSE_RR_TOV_SHIFT       0
29211e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_BIT5_MASK                0x1 /* bit5 */
29311e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_BIT5_SHIFT               1
29411e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_REC_RR_TOV_CF_MASK       0x3 /* timer0cf */
29511e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_REC_RR_TOV_CF_SHIFT      2
29611e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_ED_TOV_CF_MASK           0x3 /* timer1cf */
29711e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_ED_TOV_CF_SHIFT          4
29811e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_CF2_MASK                 0x3 /* timer2cf */
29911e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_CF2_SHIFT                6
30011e25f0dSDavid C Somayajulu 	u8 flags2;
30111e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_TIMER_STOP_ALL_MASK      0x3 /* timer_stop_all */
30211e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_TIMER_STOP_ALL_SHIFT     0
30311e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_EX_CLEANUP_CF_MASK       0x3 /* cf4 */
30411e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_EX_CLEANUP_CF_SHIFT      2
30511e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_SEQ_INIT_CF_MASK         0x3 /* cf5 */
30611e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_SEQ_INIT_CF_SHIFT        4
30711e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_SEQ_RECOVERY_CF_MASK     0x3 /* cf6 */
30811e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_SEQ_RECOVERY_CF_SHIFT    6
30911e25f0dSDavid C Somayajulu 	u8 flags3;
31011e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_UNSOL_COMP_CF_MASK       0x3 /* cf7 */
31111e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_UNSOL_COMP_CF_SHIFT      0
31211e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_REC_RR_TOV_CF_EN_MASK    0x1 /* cf0en */
31311e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_REC_RR_TOV_CF_EN_SHIFT   2
31411e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_ED_TOV_CF_EN_MASK        0x1 /* cf1en */
31511e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_ED_TOV_CF_EN_SHIFT       3
31611e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_CF2EN_MASK               0x1 /* cf2en */
31711e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_CF2EN_SHIFT              4
31811e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_TIMER_STOP_ALL_EN_MASK   0x1 /* cf3en */
31911e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_TIMER_STOP_ALL_EN_SHIFT  5
32011e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_EX_CLEANUP_CF_EN_MASK    0x1 /* cf4en */
32111e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_EX_CLEANUP_CF_EN_SHIFT   6
32211e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_SEQ_INIT_CF_EN_MASK      0x1 /* cf5en */
32311e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_SEQ_INIT_CF_EN_SHIFT     7
32411e25f0dSDavid C Somayajulu 	u8 flags4;
32511e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_SEQ_RECOVERY_CF_EN_MASK  0x1 /* cf6en */
32611e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_SEQ_RECOVERY_CF_EN_SHIFT 0
32711e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_UNSOL_COMP_CF_EN_MASK    0x1 /* cf7en */
32811e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_UNSOL_COMP_CF_EN_SHIFT   1
32911e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_RULE0EN_MASK             0x1 /* rule0en */
33011e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_RULE0EN_SHIFT            2
33111e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_RULE1EN_MASK             0x1 /* rule1en */
33211e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_RULE1EN_SHIFT            3
33311e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_RULE2EN_MASK             0x1 /* rule2en */
33411e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_RULE2EN_SHIFT            4
33511e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_RULE3EN_MASK             0x1 /* rule3en */
33611e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_RULE3EN_SHIFT            5
33711e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_RULE4EN_MASK             0x1 /* rule4en */
33811e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_RULE4EN_SHIFT            6
33911e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_RULE5EN_MASK             0x1 /* rule5en */
34011e25f0dSDavid C Somayajulu #define E4_TSTORM_FCOE_TASK_AG_CTX_RULE5EN_SHIFT            7
34111e25f0dSDavid C Somayajulu 	u8 cleanup_state /* byte2 */;
34211e25f0dSDavid C Somayajulu 	__le16 last_sent_tid /* word1 */;
34311e25f0dSDavid C Somayajulu 	__le32 rec_rr_tov_exp_timeout /* reg0 */;
34411e25f0dSDavid C Somayajulu 	u8 byte3 /* byte3 */;
34511e25f0dSDavid C Somayajulu 	u8 byte4 /* byte4 */;
34611e25f0dSDavid C Somayajulu 	__le16 word2 /* word2 */;
34711e25f0dSDavid C Somayajulu 	__le16 word3 /* word3 */;
34811e25f0dSDavid C Somayajulu 	__le16 word4 /* word4 */;
34911e25f0dSDavid C Somayajulu 	__le32 data_offset_end_of_seq /* reg1 */;
35011e25f0dSDavid C Somayajulu 	__le32 data_offset_next /* reg2 */;
35111e25f0dSDavid C Somayajulu };
35211e25f0dSDavid C Somayajulu 
35311e25f0dSDavid C Somayajulu /*
3549efd0ba7SDavid C Somayajulu  * Cached data sges
3559efd0ba7SDavid C Somayajulu  */
3569efd0ba7SDavid C Somayajulu struct fcoe_exp_ro
3579efd0ba7SDavid C Somayajulu {
3589efd0ba7SDavid C Somayajulu 	__le32 data_offset /* data-offset */;
3599efd0ba7SDavid C Somayajulu 	__le32 reserved /* High data-offset */;
3609efd0ba7SDavid C Somayajulu };
3619efd0ba7SDavid C Somayajulu 
3629efd0ba7SDavid C Somayajulu /*
3639efd0ba7SDavid C Somayajulu  * Union of Cleanup address \ expected relative offsets
3649efd0ba7SDavid C Somayajulu  */
3659efd0ba7SDavid C Somayajulu union fcoe_cleanup_addr_exp_ro_union
3669efd0ba7SDavid C Somayajulu {
3679efd0ba7SDavid C Somayajulu 	struct regpair abts_rsp_fc_payload_hi /* Abts flow: first 64 bits of fcPayload, out of 96 */;
3689efd0ba7SDavid C Somayajulu 	struct fcoe_exp_ro exp_ro /* Expected relative offsets */;
3699efd0ba7SDavid C Somayajulu };
3709efd0ba7SDavid C Somayajulu 
3719efd0ba7SDavid C Somayajulu /*
3729efd0ba7SDavid C Somayajulu  * fields coppied from ABTSrsp pckt
3739efd0ba7SDavid C Somayajulu  */
3749efd0ba7SDavid C Somayajulu struct fcoe_abts_pkt
3759efd0ba7SDavid C Somayajulu {
3769efd0ba7SDavid C Somayajulu 	__le32 abts_rsp_fc_payload_lo /* Abts flow: last 32 bits of fcPayload, out of 96 */;
3779efd0ba7SDavid C Somayajulu 	__le16 abts_rsp_rx_id /* Abts flow: rxId parameter of the abts packet */;
3789efd0ba7SDavid C Somayajulu 	u8 abts_rsp_rctl /* Abts flow: rctl parameter of the abts packet */;
3799efd0ba7SDavid C Somayajulu 	u8 reserved2;
3809efd0ba7SDavid C Somayajulu };
3819efd0ba7SDavid C Somayajulu 
3829efd0ba7SDavid C Somayajulu /*
38311e25f0dSDavid C Somayajulu  * FW read- write (modifyable) part The fcoe task storm context of Tstorm
38411e25f0dSDavid C Somayajulu  */
38511e25f0dSDavid C Somayajulu struct fcoe_tstorm_fcoe_task_st_ctx_read_write
38611e25f0dSDavid C Somayajulu {
38711e25f0dSDavid C Somayajulu 	union fcoe_cleanup_addr_exp_ro_union cleanup_addr_exp_ro_union /* Union of Cleanup address / expected relative offsets */;
38811e25f0dSDavid C Somayajulu 	__le16 flags;
38911e25f0dSDavid C Somayajulu #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_RX_SGL_MODE_MASK       0x1 /* Rx SGL type. use enum scsi_sgl_mode  (use enum scsi_sgl_mode) */
39011e25f0dSDavid C Somayajulu #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_RX_SGL_MODE_SHIFT      0
39111e25f0dSDavid C Somayajulu #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_EXP_FIRST_FRAME_MASK   0x1 /* Expected first frame flag */
39211e25f0dSDavid C Somayajulu #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_EXP_FIRST_FRAME_SHIFT  1
39311e25f0dSDavid C Somayajulu #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_SEQ_ACTIVE_MASK        0x1 /* Sequence active */
39411e25f0dSDavid C Somayajulu #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_SEQ_ACTIVE_SHIFT       2
39511e25f0dSDavid C Somayajulu #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_SEQ_TIMEOUT_MASK       0x1 /* Sequence timeout for an active Sequence */
39611e25f0dSDavid C Somayajulu #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_SEQ_TIMEOUT_SHIFT      3
39711e25f0dSDavid C Somayajulu #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_SINGLE_PKT_IN_EX_MASK  0x1 /* Set by Data-in flow. Indicate that this exchange contains a single FCP DATA packet */
39811e25f0dSDavid C Somayajulu #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_SINGLE_PKT_IN_EX_SHIFT 4
39911e25f0dSDavid C Somayajulu #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_OOO_RX_SEQ_STAT_MASK   0x1 /* The status of the current out of order received Sequence */
40011e25f0dSDavid C Somayajulu #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_OOO_RX_SEQ_STAT_SHIFT  5
40111e25f0dSDavid C Somayajulu #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_CQ_ADD_ADV_MASK        0x3 /* number of additional CQE that will be produced for this task completion */
40211e25f0dSDavid C Somayajulu #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_CQ_ADD_ADV_SHIFT       6
40311e25f0dSDavid C Somayajulu #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_RSRV1_MASK             0xFF
40411e25f0dSDavid C Somayajulu #define FCOE_TSTORM_FCOE_TASK_ST_CTX_READ_WRITE_RSRV1_SHIFT            8
40511e25f0dSDavid C Somayajulu 	__le16 seq_cnt /* Sequence counter */;
40611e25f0dSDavid C Somayajulu 	u8 seq_id /* Sequence id */;
40711e25f0dSDavid C Somayajulu 	u8 ooo_rx_seq_id /* The last out of order received SEQ_ID */;
40811e25f0dSDavid C Somayajulu 	__le16 rx_id /* RX_ID of the exchange - should match each packet expect for the first */;
40911e25f0dSDavid C Somayajulu 	struct fcoe_abts_pkt abts_data /* The last out of order received SEQ_CNT */;
41011e25f0dSDavid C Somayajulu 	__le32 e_d_tov_exp_timeout_val /* E_D_TOV timer val (in msec) */;
41111e25f0dSDavid C Somayajulu 	__le16 ooo_rx_seq_cnt /* The last out of order received SEQ_CNT */;
41211e25f0dSDavid C Somayajulu 	__le16 reserved1;
41311e25f0dSDavid C Somayajulu };
41411e25f0dSDavid C Somayajulu 
41511e25f0dSDavid C Somayajulu /*
41611e25f0dSDavid C Somayajulu  * FW read only part The fcoe task storm context of Tstorm
41711e25f0dSDavid C Somayajulu  */
41811e25f0dSDavid C Somayajulu struct fcoe_tstorm_fcoe_task_st_ctx_read_only
41911e25f0dSDavid C Somayajulu {
420*217ec208SDavid C Somayajulu 	u8 task_type /* Task type. use enum fcoe_task_type (use enum fcoe_task_type) */;
421*217ec208SDavid C Somayajulu 	u8 dev_type /* Device type (disk or tape). use enum fcoe_device_type (use enum fcoe_device_type) */;
42211e25f0dSDavid C Somayajulu 	u8 conf_supported /* Confirmation supported indication */;
42311e25f0dSDavid C Somayajulu 	u8 glbl_q_num /* Global RQ/CQ num to be used for sense data placement/completion */;
42411e25f0dSDavid C Somayajulu 	__le32 cid /* CID which that tasks associated to */;
42511e25f0dSDavid C Somayajulu 	__le32 fcp_cmd_trns_size /* IO size as reflected in FCP CMD */;
42611e25f0dSDavid C Somayajulu 	__le32 rsrv;
42711e25f0dSDavid C Somayajulu };
42811e25f0dSDavid C Somayajulu 
42911e25f0dSDavid C Somayajulu /*
43011e25f0dSDavid C Somayajulu  * The fcoe task storm context of Tstorm
43111e25f0dSDavid C Somayajulu  */
43211e25f0dSDavid C Somayajulu struct tstorm_fcoe_task_st_ctx
43311e25f0dSDavid C Somayajulu {
43411e25f0dSDavid C Somayajulu 	struct fcoe_tstorm_fcoe_task_st_ctx_read_write read_write /* FW read- write (modifyable) part The fcoe task storm context of Tstorm */;
43511e25f0dSDavid C Somayajulu 	struct fcoe_tstorm_fcoe_task_st_ctx_read_only read_only /* FW read only part The fcoe task storm context of Tstorm */;
43611e25f0dSDavid C Somayajulu };
43711e25f0dSDavid C Somayajulu 
43811e25f0dSDavid C Somayajulu struct e4_mstorm_fcoe_task_ag_ctx
43911e25f0dSDavid C Somayajulu {
44011e25f0dSDavid C Somayajulu 	u8 byte0 /* cdu_validation */;
44111e25f0dSDavid C Somayajulu 	u8 byte1 /* state */;
44211e25f0dSDavid C Somayajulu 	__le16 icid /* icid */;
44311e25f0dSDavid C Somayajulu 	u8 flags0;
44411e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_CONNECTION_TYPE_MASK    0xF /* connection_type */
44511e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_CONNECTION_TYPE_SHIFT   0
44611e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_EXIST_IN_QM0_MASK       0x1 /* exist_in_qm0 */
44711e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_EXIST_IN_QM0_SHIFT      4
44811e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_CQE_PLACED_MASK         0x1 /* exist_in_qm1 */
44911e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_CQE_PLACED_SHIFT        5
45011e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_BIT2_MASK               0x1 /* bit2 */
45111e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_BIT2_SHIFT              6
45211e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_BIT3_MASK               0x1 /* bit3 */
45311e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_BIT3_SHIFT              7
45411e25f0dSDavid C Somayajulu 	u8 flags1;
45511e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_EX_CLEANUP_CF_MASK      0x3 /* cf0 */
45611e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_EX_CLEANUP_CF_SHIFT     0
45711e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_CF1_MASK                0x3 /* cf1 */
45811e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_CF1_SHIFT               2
45911e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_CF2_MASK                0x3 /* cf2 */
46011e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_CF2_SHIFT               4
46111e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_EX_CLEANUP_CF_EN_MASK   0x1 /* cf0en */
46211e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_EX_CLEANUP_CF_EN_SHIFT  6
46311e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_CF1EN_MASK              0x1 /* cf1en */
46411e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_CF1EN_SHIFT             7
46511e25f0dSDavid C Somayajulu 	u8 flags2;
46611e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_CF2EN_MASK              0x1 /* cf2en */
46711e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_CF2EN_SHIFT             0
46811e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_RULE0EN_MASK            0x1 /* rule0en */
46911e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_RULE0EN_SHIFT           1
47011e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_RULE1EN_MASK            0x1 /* rule1en */
47111e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_RULE1EN_SHIFT           2
47211e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_RULE2EN_MASK            0x1 /* rule2en */
47311e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_RULE2EN_SHIFT           3
47411e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_RULE3EN_MASK            0x1 /* rule3en */
47511e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_RULE3EN_SHIFT           4
47611e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_RULE4EN_MASK            0x1 /* rule4en */
47711e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_RULE4EN_SHIFT           5
47811e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_XFER_PLACEMENT_EN_MASK  0x1 /* rule5en */
47911e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_XFER_PLACEMENT_EN_SHIFT 6
48011e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_RULE6EN_MASK            0x1 /* rule6en */
48111e25f0dSDavid C Somayajulu #define E4_MSTORM_FCOE_TASK_AG_CTX_RULE6EN_SHIFT           7
48211e25f0dSDavid C Somayajulu 	u8 cleanup_state /* byte2 */;
48311e25f0dSDavid C Somayajulu 	__le32 received_bytes /* reg0 */;
48411e25f0dSDavid C Somayajulu 	u8 byte3 /* byte3 */;
48511e25f0dSDavid C Somayajulu 	u8 glbl_q_num /* byte4 */;
48611e25f0dSDavid C Somayajulu 	__le16 word1 /* word1 */;
48711e25f0dSDavid C Somayajulu 	__le16 tid_to_xfer /* word2 */;
48811e25f0dSDavid C Somayajulu 	__le16 word3 /* word3 */;
48911e25f0dSDavid C Somayajulu 	__le16 word4 /* word4 */;
49011e25f0dSDavid C Somayajulu 	__le16 word5 /* word5 */;
49111e25f0dSDavid C Somayajulu 	__le32 expected_bytes /* reg1 */;
49211e25f0dSDavid C Somayajulu 	__le32 reg2 /* reg2 */;
49311e25f0dSDavid C Somayajulu };
49411e25f0dSDavid C Somayajulu 
49511e25f0dSDavid C Somayajulu /*
49611e25f0dSDavid C Somayajulu  * The fcoe task storm context of Mstorm
49711e25f0dSDavid C Somayajulu  */
49811e25f0dSDavid C Somayajulu struct mstorm_fcoe_task_st_ctx
49911e25f0dSDavid C Somayajulu {
50011e25f0dSDavid C Somayajulu 	struct regpair rsp_buf_addr /* Buffer to place the sense/response data attached to FCP_RSP frame */;
50111e25f0dSDavid C Somayajulu 	__le32 rsrv[2];
50211e25f0dSDavid C Somayajulu 	struct scsi_sgl_params sgl_params;
50311e25f0dSDavid C Somayajulu 	__le32 data_2_trns_rem /* Entire SGL buffer size remainder */;
50411e25f0dSDavid C Somayajulu 	__le32 data_buffer_offset /* Buffer offset */;
50511e25f0dSDavid C Somayajulu 	__le16 parent_id /* Used for multiple continuation in Target mode */;
50611e25f0dSDavid C Somayajulu 	__le16 flags;
50711e25f0dSDavid C Somayajulu #define MSTORM_FCOE_TASK_ST_CTX_INTERVAL_SIZE_LOG_MASK     0xF /* Protection log interval (9=512 10=1024  11=2048 12=4096 13=8192) */
50811e25f0dSDavid C Somayajulu #define MSTORM_FCOE_TASK_ST_CTX_INTERVAL_SIZE_LOG_SHIFT    0
50911e25f0dSDavid C Somayajulu #define MSTORM_FCOE_TASK_ST_CTX_HOST_INTERFACE_MASK        0x3 /* 0=none, 1=DIF, 2=DIX */
51011e25f0dSDavid C Somayajulu #define MSTORM_FCOE_TASK_ST_CTX_HOST_INTERFACE_SHIFT       4
51111e25f0dSDavid C Somayajulu #define MSTORM_FCOE_TASK_ST_CTX_DIF_TO_PEER_MASK           0x1 /* 0=no, 1=yes */
51211e25f0dSDavid C Somayajulu #define MSTORM_FCOE_TASK_ST_CTX_DIF_TO_PEER_SHIFT          6
51311e25f0dSDavid C Somayajulu #define MSTORM_FCOE_TASK_ST_CTX_MP_INCLUDE_FC_HEADER_MASK  0x1 /* 0 = 24 Bytes FC Header not included in Middle-Path placement, 1 = 24 Bytes FC Header included in MP placement */
51411e25f0dSDavid C Somayajulu #define MSTORM_FCOE_TASK_ST_CTX_MP_INCLUDE_FC_HEADER_SHIFT 7
51511e25f0dSDavid C Somayajulu #define MSTORM_FCOE_TASK_ST_CTX_DIX_BLOCK_SIZE_MASK        0x3 /* DIX block size: can be 0:2B, 1:4B, 2:8B */
51611e25f0dSDavid C Somayajulu #define MSTORM_FCOE_TASK_ST_CTX_DIX_BLOCK_SIZE_SHIFT       8
51711e25f0dSDavid C Somayajulu #define MSTORM_FCOE_TASK_ST_CTX_VALIDATE_DIX_REF_TAG_MASK  0x1 /* 0=no, 1=yes */
51811e25f0dSDavid C Somayajulu #define MSTORM_FCOE_TASK_ST_CTX_VALIDATE_DIX_REF_TAG_SHIFT 10
51911e25f0dSDavid C Somayajulu #define MSTORM_FCOE_TASK_ST_CTX_DIX_CACHED_SGE_FLG_MASK    0x1 /* Indication to a single cached DIX SGE instead of SGL */
52011e25f0dSDavid C Somayajulu #define MSTORM_FCOE_TASK_ST_CTX_DIX_CACHED_SGE_FLG_SHIFT   11
52111e25f0dSDavid C Somayajulu #define MSTORM_FCOE_TASK_ST_CTX_DIF_SUPPORTED_MASK         0x1
52211e25f0dSDavid C Somayajulu #define MSTORM_FCOE_TASK_ST_CTX_DIF_SUPPORTED_SHIFT        12
52311e25f0dSDavid C Somayajulu #define MSTORM_FCOE_TASK_ST_CTX_TX_SGL_MODE_MASK           0x1 /* use_enum scsi_sgl_mode (use enum scsi_sgl_mode) */
52411e25f0dSDavid C Somayajulu #define MSTORM_FCOE_TASK_ST_CTX_TX_SGL_MODE_SHIFT          13
52511e25f0dSDavid C Somayajulu #define MSTORM_FCOE_TASK_ST_CTX_RESERVED_MASK              0x3
52611e25f0dSDavid C Somayajulu #define MSTORM_FCOE_TASK_ST_CTX_RESERVED_SHIFT             14
52711e25f0dSDavid C Somayajulu 	struct scsi_cached_sges data_desc /* Union of Data SGL / cached sge */;
52811e25f0dSDavid C Somayajulu };
52911e25f0dSDavid C Somayajulu 
53011e25f0dSDavid C Somayajulu struct e4_ustorm_fcoe_task_ag_ctx
53111e25f0dSDavid C Somayajulu {
53211e25f0dSDavid C Somayajulu 	u8 reserved /* cdu_validation */;
53311e25f0dSDavid C Somayajulu 	u8 byte1 /* state */;
53411e25f0dSDavid C Somayajulu 	__le16 icid /* icid */;
53511e25f0dSDavid C Somayajulu 	u8 flags0;
53611e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_CONNECTION_TYPE_MASK  0xF /* connection_type */
53711e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_CONNECTION_TYPE_SHIFT 0
53811e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_EXIST_IN_QM0_MASK     0x1 /* exist_in_qm0 */
53911e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_EXIST_IN_QM0_SHIFT    4
54011e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_BIT1_MASK             0x1 /* exist_in_qm1 */
54111e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_BIT1_SHIFT            5
54211e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_CF0_MASK              0x3 /* timer0cf */
54311e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_CF0_SHIFT             6
54411e25f0dSDavid C Somayajulu 	u8 flags1;
54511e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_CF1_MASK              0x3 /* timer1cf */
54611e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_CF1_SHIFT             0
54711e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_CF2_MASK              0x3 /* timer2cf */
54811e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_CF2_SHIFT             2
54911e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_CF3_MASK              0x3 /* timer_stop_all */
55011e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_CF3_SHIFT             4
55111e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_DIF_ERROR_CF_MASK     0x3 /* cf4 */
55211e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_DIF_ERROR_CF_SHIFT    6
55311e25f0dSDavid C Somayajulu 	u8 flags2;
55411e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_CF0EN_MASK            0x1 /* cf0en */
55511e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_CF0EN_SHIFT           0
55611e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_CF1EN_MASK            0x1 /* cf1en */
55711e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_CF1EN_SHIFT           1
55811e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_CF2EN_MASK            0x1 /* cf2en */
55911e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_CF2EN_SHIFT           2
56011e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_CF3EN_MASK            0x1 /* cf3en */
56111e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_CF3EN_SHIFT           3
56211e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_DIF_ERROR_CF_EN_MASK  0x1 /* cf4en */
56311e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_DIF_ERROR_CF_EN_SHIFT 4
56411e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_RULE0EN_MASK          0x1 /* rule0en */
56511e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_RULE0EN_SHIFT         5
56611e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_RULE1EN_MASK          0x1 /* rule1en */
56711e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_RULE1EN_SHIFT         6
56811e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_RULE2EN_MASK          0x1 /* rule2en */
56911e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_RULE2EN_SHIFT         7
57011e25f0dSDavid C Somayajulu 	u8 flags3;
57111e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_RULE3EN_MASK          0x1 /* rule3en */
57211e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_RULE3EN_SHIFT         0
57311e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_RULE4EN_MASK          0x1 /* rule4en */
57411e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_RULE4EN_SHIFT         1
57511e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_RULE5EN_MASK          0x1 /* rule5en */
57611e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_RULE5EN_SHIFT         2
57711e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_RULE6EN_MASK          0x1 /* rule6en */
57811e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_RULE6EN_SHIFT         3
57911e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_DIF_ERROR_TYPE_MASK   0xF /* nibble1 */
58011e25f0dSDavid C Somayajulu #define E4_USTORM_FCOE_TASK_AG_CTX_DIF_ERROR_TYPE_SHIFT  4
58111e25f0dSDavid C Somayajulu 	__le32 dif_err_intervals /* reg0 */;
58211e25f0dSDavid C Somayajulu 	__le32 dif_error_1st_interval /* reg1 */;
58311e25f0dSDavid C Somayajulu 	__le32 global_cq_num /* reg2 */;
58411e25f0dSDavid C Somayajulu 	__le32 reg3 /* reg3 */;
58511e25f0dSDavid C Somayajulu 	__le32 reg4 /* reg4 */;
58611e25f0dSDavid C Somayajulu 	__le32 reg5 /* reg5 */;
58711e25f0dSDavid C Somayajulu };
58811e25f0dSDavid C Somayajulu 
58911e25f0dSDavid C Somayajulu /*
59011e25f0dSDavid C Somayajulu  * fcoe task context
59111e25f0dSDavid C Somayajulu  */
5929efd0ba7SDavid C Somayajulu struct e4_fcoe_task_context
59311e25f0dSDavid C Somayajulu {
59411e25f0dSDavid C Somayajulu 	struct ystorm_fcoe_task_st_ctx ystorm_st_context /* ystorm storm context */;
59511e25f0dSDavid C Somayajulu 	struct regpair ystorm_st_padding[2] /* padding */;
59611e25f0dSDavid C Somayajulu 	struct tdif_task_context tdif_context /* tdif context */;
59711e25f0dSDavid C Somayajulu 	struct e4_ystorm_fcoe_task_ag_ctx ystorm_ag_context /* ystorm aggregative context */;
59811e25f0dSDavid C Somayajulu 	struct e4_tstorm_fcoe_task_ag_ctx tstorm_ag_context /* tstorm aggregative context */;
59911e25f0dSDavid C Somayajulu 	struct timers_context timer_context /* timer context */;
60011e25f0dSDavid C Somayajulu 	struct tstorm_fcoe_task_st_ctx tstorm_st_context /* tstorm storm context */;
60111e25f0dSDavid C Somayajulu 	struct regpair tstorm_st_padding[2] /* padding */;
60211e25f0dSDavid C Somayajulu 	struct e4_mstorm_fcoe_task_ag_ctx mstorm_ag_context /* mstorm aggregative context */;
60311e25f0dSDavid C Somayajulu 	struct mstorm_fcoe_task_st_ctx mstorm_st_context /* mstorm storm context */;
60411e25f0dSDavid C Somayajulu 	struct e4_ustorm_fcoe_task_ag_ctx ustorm_ag_context /* ustorm aggregative context */;
60511e25f0dSDavid C Somayajulu 	struct rdif_task_context rdif_context /* rdif context */;
60611e25f0dSDavid C Somayajulu };
60711e25f0dSDavid C Somayajulu 
6089efd0ba7SDavid C Somayajulu struct e5_ystorm_fcoe_task_ag_ctx
60911e25f0dSDavid C Somayajulu {
61011e25f0dSDavid C Somayajulu 	u8 byte0 /* cdu_validation */;
61111e25f0dSDavid C Somayajulu 	u8 byte1 /* state_and_core_id */;
6129efd0ba7SDavid C Somayajulu 	__le16 word0 /* icid */;
61311e25f0dSDavid C Somayajulu 	u8 flags0;
6149efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_NIBBLE0_MASK       0xF /* connection_type */
6159efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_NIBBLE0_SHIFT      0
6169efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_BIT0_MASK          0x1 /* exist_in_qm0 */
6179efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_BIT0_SHIFT         4
6189efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_BIT1_MASK          0x1 /* exist_in_qm1 */
6199efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_BIT1_SHIFT         5
6209efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_BIT2_MASK          0x1 /* bit2 */
6219efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_BIT2_SHIFT         6
6229efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_BIT3_MASK          0x1 /* bit3 */
6239efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_BIT3_SHIFT         7
62411e25f0dSDavid C Somayajulu 	u8 flags1;
6259efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_CF0_MASK           0x3 /* cf0 */
6269efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_CF0_SHIFT          0
6279efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_CF1_MASK           0x3 /* cf1 */
6289efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_CF1_SHIFT          2
6299efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_CF2SPECIAL_MASK    0x3 /* cf2special */
6309efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_CF2SPECIAL_SHIFT   4
6319efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_CF0EN_MASK         0x1 /* cf0en */
6329efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_CF0EN_SHIFT        6
6339efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_CF1EN_MASK         0x1 /* cf1en */
6349efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_CF1EN_SHIFT        7
63511e25f0dSDavid C Somayajulu 	u8 flags2;
6369efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_BIT4_MASK          0x1 /* bit4 */
6379efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_BIT4_SHIFT         0
6389efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_RULE0EN_MASK       0x1 /* rule0en */
6399efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_RULE0EN_SHIFT      1
6409efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_RULE1EN_MASK       0x1 /* rule1en */
6419efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_RULE1EN_SHIFT      2
6429efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_RULE2EN_MASK       0x1 /* rule2en */
6439efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_RULE2EN_SHIFT      3
6449efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_RULE3EN_MASK       0x1 /* rule3en */
6459efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_RULE3EN_SHIFT      4
6469efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_RULE4EN_MASK       0x1 /* rule4en */
6479efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_RULE4EN_SHIFT      5
6489efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_RULE5EN_MASK       0x1 /* rule5en */
6499efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_RULE5EN_SHIFT      6
6509efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_RULE6EN_MASK       0x1 /* rule6en */
6519efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_RULE6EN_SHIFT      7
65211e25f0dSDavid C Somayajulu 	u8 flags3;
6539efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_E4_RESERVED1_MASK  0x1 /* bit5 */
6549efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_E4_RESERVED1_SHIFT 0
6559efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_E4_RESERVED2_MASK  0x3 /* cf3 */
6569efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_E4_RESERVED2_SHIFT 1
6579efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_E4_RESERVED3_MASK  0x3 /* cf4 */
6589efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_E4_RESERVED3_SHIFT 3
6599efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_E4_RESERVED4_MASK  0x1 /* cf3en */
6609efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_E4_RESERVED4_SHIFT 5
6619efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_E4_RESERVED5_MASK  0x1 /* cf4en */
6629efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_E4_RESERVED5_SHIFT 6
6639efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_E4_RESERVED6_MASK  0x1 /* rule7en */
6649efd0ba7SDavid C Somayajulu #define E5_YSTORM_FCOE_TASK_AG_CTX_E4_RESERVED6_SHIFT 7
6659efd0ba7SDavid C Somayajulu 	__le32 reg0 /* reg0 */;
6669efd0ba7SDavid C Somayajulu 	u8 byte2 /* byte2 */;
66711e25f0dSDavid C Somayajulu 	u8 byte3 /* byte3 */;
6689efd0ba7SDavid C Somayajulu 	u8 byte4 /* byte4 */;
66911e25f0dSDavid C Somayajulu 	u8 e4_reserved7 /* byte5 */;
6709efd0ba7SDavid C Somayajulu 	__le16 rx_id /* word1 */;
6719efd0ba7SDavid C Somayajulu 	__le16 word2 /* word2 */;
67211e25f0dSDavid C Somayajulu 	__le16 word3 /* word3 */;
67311e25f0dSDavid C Somayajulu 	__le16 word4 /* word4 */;
6749efd0ba7SDavid C Somayajulu 	__le16 word5 /* word5 */;
67511e25f0dSDavid C Somayajulu 	__le16 e4_reserved8 /* word6 */;
6769efd0ba7SDavid C Somayajulu 	__le32 reg1 /* reg1 */;
67711e25f0dSDavid C Somayajulu };
67811e25f0dSDavid C Somayajulu 
67911e25f0dSDavid C Somayajulu struct e5_tstorm_fcoe_task_ag_ctx
68011e25f0dSDavid C Somayajulu {
68111e25f0dSDavid C Somayajulu 	u8 reserved /* cdu_validation */;
68211e25f0dSDavid C Somayajulu 	u8 byte1 /* state_and_core_id */;
68311e25f0dSDavid C Somayajulu 	__le16 icid /* icid */;
68411e25f0dSDavid C Somayajulu 	u8 flags0;
68511e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_CONNECTION_TYPE_MASK     0xF /* connection_type */
68611e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_CONNECTION_TYPE_SHIFT    0
68711e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_EXIST_IN_QM0_MASK        0x1 /* exist_in_qm0 */
68811e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_EXIST_IN_QM0_SHIFT       4
68911e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_BIT1_MASK                0x1 /* exist_in_qm1 */
69011e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_BIT1_SHIFT               5
69111e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_WAIT_ABTS_RSP_F_MASK     0x1 /* bit2 */
69211e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_WAIT_ABTS_RSP_F_SHIFT    6
69311e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_VALID_MASK               0x1 /* bit3 */
69411e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_VALID_SHIFT              7
69511e25f0dSDavid C Somayajulu 	u8 flags1;
69611e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_FALSE_RR_TOV_MASK        0x1 /* bit4 */
69711e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_FALSE_RR_TOV_SHIFT       0
69811e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_BIT5_MASK                0x1 /* bit5 */
69911e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_BIT5_SHIFT               1
70011e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_REC_RR_TOV_CF_MASK       0x3 /* timer0cf */
70111e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_REC_RR_TOV_CF_SHIFT      2
70211e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_ED_TOV_CF_MASK           0x3 /* timer1cf */
70311e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_ED_TOV_CF_SHIFT          4
70411e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_CF2_MASK                 0x3 /* timer2cf */
70511e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_CF2_SHIFT                6
70611e25f0dSDavid C Somayajulu 	u8 flags2;
70711e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_TIMER_STOP_ALL_MASK      0x3 /* timer_stop_all */
70811e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_TIMER_STOP_ALL_SHIFT     0
70911e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_EX_CLEANUP_CF_MASK       0x3 /* cf4 */
71011e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_EX_CLEANUP_CF_SHIFT      2
71111e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_SEQ_INIT_CF_MASK         0x3 /* cf5 */
71211e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_SEQ_INIT_CF_SHIFT        4
71311e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_SEQ_RECOVERY_CF_MASK     0x3 /* cf6 */
71411e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_SEQ_RECOVERY_CF_SHIFT    6
71511e25f0dSDavid C Somayajulu 	u8 flags3;
71611e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_UNSOL_COMP_CF_MASK       0x3 /* cf7 */
71711e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_UNSOL_COMP_CF_SHIFT      0
71811e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_REC_RR_TOV_CF_EN_MASK    0x1 /* cf0en */
71911e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_REC_RR_TOV_CF_EN_SHIFT   2
72011e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_ED_TOV_CF_EN_MASK        0x1 /* cf1en */
72111e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_ED_TOV_CF_EN_SHIFT       3
72211e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_CF2EN_MASK               0x1 /* cf2en */
72311e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_CF2EN_SHIFT              4
72411e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_TIMER_STOP_ALL_EN_MASK   0x1 /* cf3en */
72511e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_TIMER_STOP_ALL_EN_SHIFT  5
72611e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_EX_CLEANUP_CF_EN_MASK    0x1 /* cf4en */
72711e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_EX_CLEANUP_CF_EN_SHIFT   6
72811e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_SEQ_INIT_CF_EN_MASK      0x1 /* cf5en */
72911e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_SEQ_INIT_CF_EN_SHIFT     7
73011e25f0dSDavid C Somayajulu 	u8 flags4;
73111e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_SEQ_RECOVERY_CF_EN_MASK  0x1 /* cf6en */
73211e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_SEQ_RECOVERY_CF_EN_SHIFT 0
73311e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_UNSOL_COMP_CF_EN_MASK    0x1 /* cf7en */
73411e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_UNSOL_COMP_CF_EN_SHIFT   1
73511e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_RULE0EN_MASK             0x1 /* rule0en */
73611e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_RULE0EN_SHIFT            2
73711e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_RULE1EN_MASK             0x1 /* rule1en */
73811e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_RULE1EN_SHIFT            3
73911e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_RULE2EN_MASK             0x1 /* rule2en */
74011e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_RULE2EN_SHIFT            4
74111e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_RULE3EN_MASK             0x1 /* rule3en */
74211e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_RULE3EN_SHIFT            5
74311e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_RULE4EN_MASK             0x1 /* rule4en */
74411e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_RULE4EN_SHIFT            6
74511e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_RULE5EN_MASK             0x1 /* rule5en */
74611e25f0dSDavid C Somayajulu #define E5_TSTORM_FCOE_TASK_AG_CTX_RULE5EN_SHIFT            7
74711e25f0dSDavid C Somayajulu 	u8 cleanup_state /* byte2 */;
74811e25f0dSDavid C Somayajulu 	__le16 last_sent_tid /* word1 */;
74911e25f0dSDavid C Somayajulu 	__le32 rec_rr_tov_exp_timeout /* reg0 */;
75011e25f0dSDavid C Somayajulu 	u8 byte3 /* regpair0 */;
75111e25f0dSDavid C Somayajulu 	u8 byte4 /* byte4 */;
75211e25f0dSDavid C Somayajulu 	__le16 word2 /* word2 */;
75311e25f0dSDavid C Somayajulu 	__le16 word3 /* word3 */;
75411e25f0dSDavid C Somayajulu 	__le16 word4 /* word4 */;
75511e25f0dSDavid C Somayajulu 	__le32 data_offset_end_of_seq /* regpair1 */;
75611e25f0dSDavid C Somayajulu 	__le32 data_offset_next /* reg2 */;
75711e25f0dSDavid C Somayajulu };
75811e25f0dSDavid C Somayajulu 
7599efd0ba7SDavid C Somayajulu struct e5_mstorm_fcoe_task_ag_ctx
7609efd0ba7SDavid C Somayajulu {
7619efd0ba7SDavid C Somayajulu 	u8 byte0 /* cdu_validation */;
7629efd0ba7SDavid C Somayajulu 	u8 byte1 /* state_and_core_id */;
7639efd0ba7SDavid C Somayajulu 	__le16 icid /* icid */;
7649efd0ba7SDavid C Somayajulu 	u8 flags0;
7659efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_CONNECTION_TYPE_MASK    0xF /* connection_type */
7669efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_CONNECTION_TYPE_SHIFT   0
7679efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_EXIST_IN_QM0_MASK       0x1 /* exist_in_qm0 */
7689efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_EXIST_IN_QM0_SHIFT      4
7699efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_CQE_PLACED_MASK         0x1 /* exist_in_qm1 */
7709efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_CQE_PLACED_SHIFT        5
7719efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_BIT2_MASK               0x1 /* bit2 */
7729efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_BIT2_SHIFT              6
7739efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_BIT3_MASK               0x1 /* bit3 */
7749efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_BIT3_SHIFT              7
7759efd0ba7SDavid C Somayajulu 	u8 flags1;
7769efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_EX_CLEANUP_CF_MASK      0x3 /* cf0 */
7779efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_EX_CLEANUP_CF_SHIFT     0
7789efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_CF1_MASK                0x3 /* cf1 */
7799efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_CF1_SHIFT               2
7809efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_CF2_MASK                0x3 /* cf2 */
7819efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_CF2_SHIFT               4
7829efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_EX_CLEANUP_CF_EN_MASK   0x1 /* cf0en */
7839efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_EX_CLEANUP_CF_EN_SHIFT  6
7849efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_CF1EN_MASK              0x1 /* cf1en */
7859efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_CF1EN_SHIFT             7
7869efd0ba7SDavid C Somayajulu 	u8 flags2;
7879efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_CF2EN_MASK              0x1 /* cf2en */
7889efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_CF2EN_SHIFT             0
7899efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_RULE0EN_MASK            0x1 /* rule0en */
7909efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_RULE0EN_SHIFT           1
7919efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_RULE1EN_MASK            0x1 /* rule1en */
7929efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_RULE1EN_SHIFT           2
7939efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_RULE2EN_MASK            0x1 /* rule2en */
7949efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_RULE2EN_SHIFT           3
7959efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_RULE3EN_MASK            0x1 /* rule3en */
7969efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_RULE3EN_SHIFT           4
7979efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_RULE4EN_MASK            0x1 /* rule4en */
7989efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_RULE4EN_SHIFT           5
7999efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_XFER_PLACEMENT_EN_MASK  0x1 /* rule5en */
8009efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_XFER_PLACEMENT_EN_SHIFT 6
8019efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_RULE6EN_MASK            0x1 /* rule6en */
8029efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_RULE6EN_SHIFT           7
8039efd0ba7SDavid C Somayajulu 	u8 flags3;
8049efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_E4_RESERVED1_MASK       0x1 /* bit4 */
8059efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_E4_RESERVED1_SHIFT      0
8069efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_E4_RESERVED2_MASK       0x3 /* cf3 */
8079efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_E4_RESERVED2_SHIFT      1
8089efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_E4_RESERVED3_MASK       0x3 /* cf4 */
8099efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_E4_RESERVED3_SHIFT      3
8109efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_E4_RESERVED4_MASK       0x1 /* cf3en */
8119efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_E4_RESERVED4_SHIFT      5
8129efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_E4_RESERVED5_MASK       0x1 /* cf4en */
8139efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_E4_RESERVED5_SHIFT      6
8149efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_E4_RESERVED6_MASK       0x1 /* rule7en */
8159efd0ba7SDavid C Somayajulu #define E5_MSTORM_FCOE_TASK_AG_CTX_E4_RESERVED6_SHIFT      7
8169efd0ba7SDavid C Somayajulu 	__le32 received_bytes /* reg0 */;
8179efd0ba7SDavid C Somayajulu 	u8 cleanup_state /* byte2 */;
8189efd0ba7SDavid C Somayajulu 	u8 byte3 /* byte3 */;
8199efd0ba7SDavid C Somayajulu 	u8 glbl_q_num /* byte4 */;
8209efd0ba7SDavid C Somayajulu 	u8 e4_reserved7 /* byte5 */;
8219efd0ba7SDavid C Somayajulu 	__le16 word1 /* regpair0 */;
8229efd0ba7SDavid C Somayajulu 	__le16 tid_to_xfer /* word2 */;
8239efd0ba7SDavid C Somayajulu 	__le16 word3 /* word3 */;
8249efd0ba7SDavid C Somayajulu 	__le16 word4 /* word4 */;
8259efd0ba7SDavid C Somayajulu 	__le16 word5 /* regpair1 */;
8269efd0ba7SDavid C Somayajulu 	__le16 e4_reserved8 /* word6 */;
8279efd0ba7SDavid C Somayajulu 	__le32 expected_bytes /* reg1 */;
8289efd0ba7SDavid C Somayajulu };
82911e25f0dSDavid C Somayajulu 
83011e25f0dSDavid C Somayajulu struct e5_ustorm_fcoe_task_ag_ctx
83111e25f0dSDavid C Somayajulu {
83211e25f0dSDavid C Somayajulu 	u8 reserved /* cdu_validation */;
83311e25f0dSDavid C Somayajulu 	u8 byte1 /* state_and_core_id */;
83411e25f0dSDavid C Somayajulu 	__le16 icid /* icid */;
83511e25f0dSDavid C Somayajulu 	u8 flags0;
83611e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_CONNECTION_TYPE_MASK  0xF /* connection_type */
83711e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_CONNECTION_TYPE_SHIFT 0
83811e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_EXIST_IN_QM0_MASK     0x1 /* exist_in_qm0 */
83911e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_EXIST_IN_QM0_SHIFT    4
84011e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_BIT1_MASK             0x1 /* exist_in_qm1 */
84111e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_BIT1_SHIFT            5
84211e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_CF0_MASK              0x3 /* timer0cf */
84311e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_CF0_SHIFT             6
84411e25f0dSDavid C Somayajulu 	u8 flags1;
84511e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_CF1_MASK              0x3 /* timer1cf */
84611e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_CF1_SHIFT             0
84711e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_CF2_MASK              0x3 /* timer2cf */
84811e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_CF2_SHIFT             2
84911e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_CF3_MASK              0x3 /* timer_stop_all */
85011e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_CF3_SHIFT             4
85111e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_DIF_ERROR_CF_MASK     0x3 /* dif_error_cf */
85211e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_DIF_ERROR_CF_SHIFT    6
85311e25f0dSDavid C Somayajulu 	u8 flags2;
85411e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_CF0EN_MASK            0x1 /* cf0en */
85511e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_CF0EN_SHIFT           0
85611e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_CF1EN_MASK            0x1 /* cf1en */
85711e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_CF1EN_SHIFT           1
85811e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_CF2EN_MASK            0x1 /* cf2en */
85911e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_CF2EN_SHIFT           2
86011e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_CF3EN_MASK            0x1 /* cf3en */
86111e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_CF3EN_SHIFT           3
86211e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_DIF_ERROR_CF_EN_MASK  0x1 /* cf4en */
86311e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_DIF_ERROR_CF_EN_SHIFT 4
86411e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_RULE0EN_MASK          0x1 /* rule0en */
86511e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_RULE0EN_SHIFT         5
86611e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_RULE1EN_MASK          0x1 /* rule1en */
86711e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_RULE1EN_SHIFT         6
86811e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_RULE2EN_MASK          0x1 /* rule2en */
86911e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_RULE2EN_SHIFT         7
87011e25f0dSDavid C Somayajulu 	u8 flags3;
87111e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_RULE3EN_MASK          0x1 /* rule3en */
87211e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_RULE3EN_SHIFT         0
87311e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_RULE4EN_MASK          0x1 /* rule4en */
87411e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_RULE4EN_SHIFT         1
87511e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_RULE5EN_MASK          0x1 /* rule5en */
87611e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_RULE5EN_SHIFT         2
87711e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_RULE6EN_MASK          0x1 /* rule6en */
87811e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_RULE6EN_SHIFT         3
87911e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_E4_RESERVED1_MASK     0x1 /* bit2 */
88011e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_E4_RESERVED1_SHIFT    4
88111e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_E4_RESERVED2_MASK     0x1 /* bit3 */
88211e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_E4_RESERVED2_SHIFT    5
88311e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_E4_RESERVED3_MASK     0x1 /* bit4 */
88411e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_E4_RESERVED3_SHIFT    6
88511e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_E4_RESERVED4_MASK     0x1 /* rule7en */
88611e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_E4_RESERVED4_SHIFT    7
88711e25f0dSDavid C Somayajulu 	u8 flags4;
88811e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_E4_RESERVED5_MASK     0x3 /* cf5 */
88911e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_E4_RESERVED5_SHIFT    0
89011e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_E4_RESERVED6_MASK     0x1 /* cf5en */
89111e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_E4_RESERVED6_SHIFT    2
89211e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_E4_RESERVED7_MASK     0x1 /* rule8en */
89311e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_E4_RESERVED7_SHIFT    3
89411e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_DIF_ERROR_TYPE_MASK   0xF /* dif_error_type */
89511e25f0dSDavid C Somayajulu #define E5_USTORM_FCOE_TASK_AG_CTX_DIF_ERROR_TYPE_SHIFT  4
89611e25f0dSDavid C Somayajulu 	u8 byte2 /* byte2 */;
89711e25f0dSDavid C Somayajulu 	u8 byte3 /* byte3 */;
89811e25f0dSDavid C Somayajulu 	u8 e4_reserved8 /* byte4 */;
89911e25f0dSDavid C Somayajulu 	__le32 dif_err_intervals /* dif_err_intervals */;
90011e25f0dSDavid C Somayajulu 	__le32 dif_error_1st_interval /* dif_error_1st_interval */;
90111e25f0dSDavid C Somayajulu 	__le32 global_cq_num /* reg2 */;
90211e25f0dSDavid C Somayajulu 	__le32 reg3 /* reg3 */;
90311e25f0dSDavid C Somayajulu 	__le32 reg4 /* reg4 */;
90411e25f0dSDavid C Somayajulu };
90511e25f0dSDavid C Somayajulu 
9069efd0ba7SDavid C Somayajulu /*
9079efd0ba7SDavid C Somayajulu  * fcoe task context
9089efd0ba7SDavid C Somayajulu  */
9099efd0ba7SDavid C Somayajulu struct e5_fcoe_task_context
91011e25f0dSDavid C Somayajulu {
9119efd0ba7SDavid C Somayajulu 	struct ystorm_fcoe_task_st_ctx ystorm_st_context /* ystorm storm context */;
9129efd0ba7SDavid C Somayajulu 	struct regpair ystorm_st_padding[2] /* padding */;
9139efd0ba7SDavid C Somayajulu 	struct tdif_task_context tdif_context /* tdif context */;
9149efd0ba7SDavid C Somayajulu 	struct e5_ystorm_fcoe_task_ag_ctx ystorm_ag_context /* ystorm aggregative context */;
9159efd0ba7SDavid C Somayajulu 	struct e5_tstorm_fcoe_task_ag_ctx tstorm_ag_context /* tstorm aggregative context */;
9169efd0ba7SDavid C Somayajulu 	struct timers_context timer_context /* timer context */;
9179efd0ba7SDavid C Somayajulu 	struct tstorm_fcoe_task_st_ctx tstorm_st_context /* tstorm storm context */;
9189efd0ba7SDavid C Somayajulu 	struct regpair tstorm_st_padding[2] /* padding */;
9199efd0ba7SDavid C Somayajulu 	struct e5_mstorm_fcoe_task_ag_ctx mstorm_ag_context /* mstorm aggregative context */;
9209efd0ba7SDavid C Somayajulu 	struct mstorm_fcoe_task_st_ctx mstorm_st_context /* mstorm storm context */;
9219efd0ba7SDavid C Somayajulu 	struct e5_ustorm_fcoe_task_ag_ctx ustorm_ag_context /* ustorm aggregative context */;
9229efd0ba7SDavid C Somayajulu 	struct rdif_task_context rdif_context /* rdif context */;
92311e25f0dSDavid C Somayajulu };
92411e25f0dSDavid C Somayajulu 
9259efd0ba7SDavid C Somayajulu /*
9269efd0ba7SDavid C Somayajulu  * FCoE additional WQE (Sq/ XferQ) information
9279efd0ba7SDavid C Somayajulu  */
9289efd0ba7SDavid C Somayajulu union fcoe_additional_info_union
9299efd0ba7SDavid C Somayajulu {
9309efd0ba7SDavid C Somayajulu 	__le32 previous_tid /* Previous tid. Used for Send XFER WQEs in Multiple continuation mode - Target only. */;
9319efd0ba7SDavid C Somayajulu 	__le32 parent_tid /* Parent tid. Used for write tasks in a continuation mode - Target only */;
9329efd0ba7SDavid C Somayajulu 	__le32 burst_length /* The desired burst length. */;
9339efd0ba7SDavid C Somayajulu 	__le32 seq_rec_updated_offset /* The updated offset in SGL - Used in sequence recovery */;
9349efd0ba7SDavid C Somayajulu };
9359efd0ba7SDavid C Somayajulu 
9369efd0ba7SDavid C Somayajulu /*
9379efd0ba7SDavid C Somayajulu  * FCoE Ramrod Command IDs
9389efd0ba7SDavid C Somayajulu  */
9399efd0ba7SDavid C Somayajulu enum fcoe_completion_status
9409efd0ba7SDavid C Somayajulu {
9419efd0ba7SDavid C Somayajulu 	FCOE_COMPLETION_STATUS_SUCCESS /* FCoE ramrod completed successfully */,
9429efd0ba7SDavid C Somayajulu 	FCOE_COMPLETION_STATUS_FCOE_VER_ERR /* Wrong FCoE version */,
9439efd0ba7SDavid C Somayajulu 	FCOE_COMPLETION_STATUS_SRC_MAC_ADD_ARR_ERR /* src_mac_arr for the current physical port is full- allocation failed */,
9449efd0ba7SDavid C Somayajulu 	MAX_FCOE_COMPLETION_STATUS
9459efd0ba7SDavid C Somayajulu };
9469efd0ba7SDavid C Somayajulu 
9479efd0ba7SDavid C Somayajulu /*
9489efd0ba7SDavid C Somayajulu  * FC address (SID/DID) network presentation
9499efd0ba7SDavid C Somayajulu  */
9509efd0ba7SDavid C Somayajulu struct fc_addr_nw
9519efd0ba7SDavid C Somayajulu {
9529efd0ba7SDavid C Somayajulu 	u8 addr_lo /* First byte of the SID/DID address that comes/goes from/to the NW (for example if SID is 11:22:33 - this is 0x11) */;
9539efd0ba7SDavid C Somayajulu 	u8 addr_mid;
9549efd0ba7SDavid C Somayajulu 	u8 addr_hi;
9559efd0ba7SDavid C Somayajulu };
9569efd0ba7SDavid C Somayajulu 
9579efd0ba7SDavid C Somayajulu /*
9589efd0ba7SDavid C Somayajulu  * FCoE connection offload
9599efd0ba7SDavid C Somayajulu  */
9609efd0ba7SDavid C Somayajulu struct fcoe_conn_offload_ramrod_data
9619efd0ba7SDavid C Somayajulu {
9629efd0ba7SDavid C Somayajulu 	struct regpair sq_pbl_addr /* SQ Pbl base address */;
9639efd0ba7SDavid C Somayajulu 	struct regpair sq_curr_page_addr /* SQ current page address */;
9649efd0ba7SDavid C Somayajulu 	struct regpair sq_next_page_addr /* SQ next page address */;
9659efd0ba7SDavid C Somayajulu 	struct regpair xferq_pbl_addr /* XFERQ Pbl base address */;
9669efd0ba7SDavid C Somayajulu 	struct regpair xferq_curr_page_addr /* XFERQ current page address */;
9679efd0ba7SDavid C Somayajulu 	struct regpair xferq_next_page_addr /* XFERQ next page address */;
9689efd0ba7SDavid C Somayajulu 	struct regpair respq_pbl_addr /* RESPQ Pbl base address */;
9699efd0ba7SDavid C Somayajulu 	struct regpair respq_curr_page_addr /* RESPQ current page address */;
9709efd0ba7SDavid C Somayajulu 	struct regpair respq_next_page_addr /* RESPQ next page address */;
9719efd0ba7SDavid C Somayajulu 	__le16 dst_mac_addr_lo /* First word of the MAC address that comes/goes from/to the NW (for example if MAC is 11:22:33:44:55:66 - this is 0x2211) */;
9729efd0ba7SDavid C Somayajulu 	__le16 dst_mac_addr_mid;
9739efd0ba7SDavid C Somayajulu 	__le16 dst_mac_addr_hi;
9749efd0ba7SDavid C Somayajulu 	__le16 src_mac_addr_lo /* Source MAC address in NW order - First word of the MAC address that comes/goes from/to the NW (for example if MAC is 11:22:33:44:55:66 - this is 0x2211) */;
9759efd0ba7SDavid C Somayajulu 	__le16 src_mac_addr_mid;
9769efd0ba7SDavid C Somayajulu 	__le16 src_mac_addr_hi;
9779efd0ba7SDavid C Somayajulu 	__le16 tx_max_fc_pay_len /* The maximum acceptable FC payload size (Buffer-to-buffer Receive Data_Field size) supported by target, received during both FLOGI and PLOGI, minimum value should be taken */;
9789efd0ba7SDavid C Somayajulu 	__le16 e_d_tov_timer_val /* E_D_TOV timeout value in resolution of 1 msec */;
9799efd0ba7SDavid C Somayajulu 	__le16 rx_max_fc_pay_len /* Maximum acceptable FC payload size supported by us */;
9809efd0ba7SDavid C Somayajulu 	__le16 vlan_tag;
9819efd0ba7SDavid C Somayajulu #define FCOE_CONN_OFFLOAD_RAMROD_DATA_VLAN_ID_MASK              0xFFF /* Vlan id */
9829efd0ba7SDavid C Somayajulu #define FCOE_CONN_OFFLOAD_RAMROD_DATA_VLAN_ID_SHIFT             0
9839efd0ba7SDavid C Somayajulu #define FCOE_CONN_OFFLOAD_RAMROD_DATA_CFI_MASK                  0x1 /* Canonical format indicator */
9849efd0ba7SDavid C Somayajulu #define FCOE_CONN_OFFLOAD_RAMROD_DATA_CFI_SHIFT                 12
9859efd0ba7SDavid C Somayajulu #define FCOE_CONN_OFFLOAD_RAMROD_DATA_PRIORITY_MASK             0x7 /* Vlan priority */
9869efd0ba7SDavid C Somayajulu #define FCOE_CONN_OFFLOAD_RAMROD_DATA_PRIORITY_SHIFT            13
9879efd0ba7SDavid C Somayajulu 	__le16 physical_q0 /* Physical QM queue to be linked to logical queue 0 (fastPath queue) */;
9889efd0ba7SDavid C Somayajulu 	__le16 rec_rr_tov_timer_val /* REC_TOV timeout value in resolution of 1 msec  */;
9899efd0ba7SDavid C Somayajulu 	struct fc_addr_nw s_id /* Source ID in NW order, received during FLOGI */;
9909efd0ba7SDavid C Somayajulu 	u8 max_conc_seqs_c3 /* Maximum concurrent Sequences for Class 3 supported by target, received during PLOGI */;
9919efd0ba7SDavid C Somayajulu 	struct fc_addr_nw d_id /* Destination ID in NW order, received after inquiry of the fabric network */;
9929efd0ba7SDavid C Somayajulu 	u8 flags;
9939efd0ba7SDavid C Somayajulu #define FCOE_CONN_OFFLOAD_RAMROD_DATA_B_CONT_INCR_SEQ_CNT_MASK  0x1 /* Continuously increasing SEQ_CNT indication, received during PLOGI */
9949efd0ba7SDavid C Somayajulu #define FCOE_CONN_OFFLOAD_RAMROD_DATA_B_CONT_INCR_SEQ_CNT_SHIFT 0
9959efd0ba7SDavid C Somayajulu #define FCOE_CONN_OFFLOAD_RAMROD_DATA_B_CONF_REQ_MASK           0x1 /* Confirmation request supported */
9969efd0ba7SDavid C Somayajulu #define FCOE_CONN_OFFLOAD_RAMROD_DATA_B_CONF_REQ_SHIFT          1
9979efd0ba7SDavid C Somayajulu #define FCOE_CONN_OFFLOAD_RAMROD_DATA_B_REC_VALID_MASK          0x1 /* REC allowed */
9989efd0ba7SDavid C Somayajulu #define FCOE_CONN_OFFLOAD_RAMROD_DATA_B_REC_VALID_SHIFT         2
9999efd0ba7SDavid C Somayajulu #define FCOE_CONN_OFFLOAD_RAMROD_DATA_B_VLAN_FLAG_MASK          0x1 /* Does inner vlan exist */
10009efd0ba7SDavid C Somayajulu #define FCOE_CONN_OFFLOAD_RAMROD_DATA_B_VLAN_FLAG_SHIFT         3
1001*217ec208SDavid C Somayajulu #define FCOE_CONN_OFFLOAD_RAMROD_DATA_B_SINGLE_VLAN_MASK        0x1 /* Does a single vlan (inner/outer) should be used. - UFP mode */
1002*217ec208SDavid C Somayajulu #define FCOE_CONN_OFFLOAD_RAMROD_DATA_B_SINGLE_VLAN_SHIFT       4
10039efd0ba7SDavid C Somayajulu #define FCOE_CONN_OFFLOAD_RAMROD_DATA_MODE_MASK                 0x3 /* indication for conn mode: 0=Initiator, 1=Target, 2=Both Initiator and Traget */
1004*217ec208SDavid C Somayajulu #define FCOE_CONN_OFFLOAD_RAMROD_DATA_MODE_SHIFT                5
1005*217ec208SDavid C Somayajulu #define FCOE_CONN_OFFLOAD_RAMROD_DATA_RESERVED0_MASK            0x1
1006*217ec208SDavid C Somayajulu #define FCOE_CONN_OFFLOAD_RAMROD_DATA_RESERVED0_SHIFT           7
10079efd0ba7SDavid C Somayajulu 	__le16 conn_id /* Drivers connection ID. Should be sent in EQs to speed-up drivers access to connection data. */;
10089efd0ba7SDavid C Somayajulu 	u8 def_q_idx /* Default queue number to be used for unsolicited traffic */;
10099efd0ba7SDavid C Somayajulu 	u8 reserved[5];
10109efd0ba7SDavid C Somayajulu };
10119efd0ba7SDavid C Somayajulu 
10129efd0ba7SDavid C Somayajulu /*
10139efd0ba7SDavid C Somayajulu  * FCoE terminate connection request
10149efd0ba7SDavid C Somayajulu  */
10159efd0ba7SDavid C Somayajulu struct fcoe_conn_terminate_ramrod_data
10169efd0ba7SDavid C Somayajulu {
10179efd0ba7SDavid C Somayajulu 	struct regpair terminate_params_addr /* Terminate params ptr */;
10189efd0ba7SDavid C Somayajulu };
10199efd0ba7SDavid C Somayajulu 
1020*217ec208SDavid C Somayajulu /*
1021*217ec208SDavid C Somayajulu  * FCoE device type
1022*217ec208SDavid C Somayajulu  */
1023*217ec208SDavid C Somayajulu enum fcoe_device_type
1024*217ec208SDavid C Somayajulu {
1025*217ec208SDavid C Somayajulu 	FCOE_TASK_DEV_TYPE_DISK,
1026*217ec208SDavid C Somayajulu 	FCOE_TASK_DEV_TYPE_TAPE,
1027*217ec208SDavid C Somayajulu 	MAX_FCOE_DEVICE_TYPE
1028*217ec208SDavid C Somayajulu };
1029*217ec208SDavid C Somayajulu 
10309efd0ba7SDavid C Somayajulu /*
10319efd0ba7SDavid C Somayajulu  * Data sgl
10329efd0ba7SDavid C Somayajulu  */
10339efd0ba7SDavid C Somayajulu struct fcoe_fast_sgl_ctx
10349efd0ba7SDavid C Somayajulu {
10359efd0ba7SDavid C Somayajulu 	struct regpair sgl_start_addr /* Current sge address */;
10369efd0ba7SDavid C Somayajulu 	__le32 sgl_byte_offset /* Byte offset from the beginning of the first page in the SGL. In case SGL starts in the middle of page then driver should init this value with the start offset */;
10379efd0ba7SDavid C Somayajulu 	__le16 task_reuse_cnt /* The reuse count for that task. Wrap ion 4K value. */;
10389efd0ba7SDavid C Somayajulu 	__le16 init_offset_in_first_sge /* offset from the beginning of the first page in the SGL, never changed by FW */;
10399efd0ba7SDavid C Somayajulu };
10409efd0ba7SDavid C Somayajulu 
10419efd0ba7SDavid C Somayajulu /*
10429efd0ba7SDavid C Somayajulu  * FCoE firmware function init
10439efd0ba7SDavid C Somayajulu  */
10449efd0ba7SDavid C Somayajulu struct fcoe_init_func_ramrod_data
10459efd0ba7SDavid C Somayajulu {
10469efd0ba7SDavid C Somayajulu 	struct scsi_init_func_params func_params /* Common SCSI init params passed by driver to FW in function init ramrod */;
10479efd0ba7SDavid C Somayajulu 	struct scsi_init_func_queues q_params /* SCSI RQ/CQ/CMDQ firmware function init parameters */;
10489efd0ba7SDavid C Somayajulu 	__le16 mtu /* Max transmission unit */;
10499efd0ba7SDavid C Somayajulu 	__le16 sq_num_pages_in_pbl /* Number of pages at Send Queue */;
10509efd0ba7SDavid C Somayajulu 	__le32 reserved[3];
10519efd0ba7SDavid C Somayajulu };
10529efd0ba7SDavid C Somayajulu 
10539efd0ba7SDavid C Somayajulu /*
10549efd0ba7SDavid C Somayajulu  * FCoE: Mode of the connection: Target or Initiator or both
10559efd0ba7SDavid C Somayajulu  */
10569efd0ba7SDavid C Somayajulu enum fcoe_mode_type
10579efd0ba7SDavid C Somayajulu {
10589efd0ba7SDavid C Somayajulu 	FCOE_INITIATOR_MODE=0x0,
10599efd0ba7SDavid C Somayajulu 	FCOE_TARGET_MODE=0x1,
10609efd0ba7SDavid C Somayajulu 	FCOE_BOTH_OR_NOT_CHOSEN=0x3,
10619efd0ba7SDavid C Somayajulu 	MAX_FCOE_MODE_TYPE
10629efd0ba7SDavid C Somayajulu };
10639efd0ba7SDavid C Somayajulu 
10649efd0ba7SDavid C Somayajulu /*
10659efd0ba7SDavid C Somayajulu  * Per PF FCoE receive path statistics - tStorm RAM structure
10669efd0ba7SDavid C Somayajulu  */
10679efd0ba7SDavid C Somayajulu struct fcoe_rx_stat
10689efd0ba7SDavid C Somayajulu {
10699efd0ba7SDavid C Somayajulu 	struct regpair fcoe_rx_byte_cnt /* Number of FCoE bytes that were received */;
10709efd0ba7SDavid C Somayajulu 	struct regpair fcoe_rx_data_pkt_cnt /* Number of FCoE FCP DATA packets that were received */;
10719efd0ba7SDavid C Somayajulu 	struct regpair fcoe_rx_xfer_pkt_cnt /* Number of FCoE FCP XFER RDY packets that were received */;
10729efd0ba7SDavid C Somayajulu 	struct regpair fcoe_rx_other_pkt_cnt /* Number of FCoE packets which are not DATA/XFER_RDY that were received */;
10739efd0ba7SDavid C Somayajulu 	__le32 fcoe_silent_drop_pkt_cmdq_full_cnt /* Number of packets that were silently dropped since CMDQ was full */;
10749efd0ba7SDavid C Somayajulu 	__le32 fcoe_silent_drop_pkt_rq_full_cnt /* Number of packets that were silently dropped since RQ (BDQ) was full */;
10759efd0ba7SDavid C Somayajulu 	__le32 fcoe_silent_drop_pkt_crc_error_cnt /* Number of packets that were silently dropped due to FC CRC error */;
10769efd0ba7SDavid C Somayajulu 	__le32 fcoe_silent_drop_pkt_task_invalid_cnt /* Number of packets that were silently dropped since task was not valid */;
10779efd0ba7SDavid C Somayajulu 	__le32 fcoe_silent_drop_total_pkt_cnt /* Number of FCoE packets that were silently dropped */;
10789efd0ba7SDavid C Somayajulu 	__le32 rsrv;
10799efd0ba7SDavid C Somayajulu };
10809efd0ba7SDavid C Somayajulu 
10819efd0ba7SDavid C Somayajulu /*
1082*217ec208SDavid C Somayajulu  * FCoE SQE request type
1083*217ec208SDavid C Somayajulu  */
1084*217ec208SDavid C Somayajulu enum fcoe_sqe_request_type
1085*217ec208SDavid C Somayajulu {
1086*217ec208SDavid C Somayajulu 	SEND_FCOE_CMD,
1087*217ec208SDavid C Somayajulu 	SEND_FCOE_MIDPATH,
1088*217ec208SDavid C Somayajulu 	SEND_FCOE_ABTS_REQUEST,
1089*217ec208SDavid C Somayajulu 	FCOE_EXCHANGE_CLEANUP,
1090*217ec208SDavid C Somayajulu 	FCOE_SEQUENCE_RECOVERY,
1091*217ec208SDavid C Somayajulu 	SEND_FCOE_XFER_RDY,
1092*217ec208SDavid C Somayajulu 	SEND_FCOE_RSP,
1093*217ec208SDavid C Somayajulu 	SEND_FCOE_RSP_WITH_SENSE_DATA,
1094*217ec208SDavid C Somayajulu 	SEND_FCOE_TARGET_DATA,
1095*217ec208SDavid C Somayajulu 	SEND_FCOE_INITIATOR_DATA,
1096*217ec208SDavid C Somayajulu 	SEND_FCOE_XFER_CONTINUATION_RDY /* Xfer Continuation (==1) ready to be sent. Previous XFERs data received successfully. */,
1097*217ec208SDavid C Somayajulu 	SEND_FCOE_TARGET_ABTS_RSP,
1098*217ec208SDavid C Somayajulu 	MAX_FCOE_SQE_REQUEST_TYPE
1099*217ec208SDavid C Somayajulu };
1100*217ec208SDavid C Somayajulu 
1101*217ec208SDavid C Somayajulu /*
11029efd0ba7SDavid C Somayajulu  * FCoe statistics request
11039efd0ba7SDavid C Somayajulu  */
11049efd0ba7SDavid C Somayajulu struct fcoe_stat_ramrod_data
11059efd0ba7SDavid C Somayajulu {
11069efd0ba7SDavid C Somayajulu 	struct regpair stat_params_addr /* Statistics host address */;
11079efd0ba7SDavid C Somayajulu };
11089efd0ba7SDavid C Somayajulu 
1109*217ec208SDavid C Somayajulu /*
1110*217ec208SDavid C Somayajulu  * FCoE task type
1111*217ec208SDavid C Somayajulu  */
1112*217ec208SDavid C Somayajulu enum fcoe_task_type
1113*217ec208SDavid C Somayajulu {
1114*217ec208SDavid C Somayajulu 	FCOE_TASK_TYPE_WRITE_INITIATOR,
1115*217ec208SDavid C Somayajulu 	FCOE_TASK_TYPE_READ_INITIATOR,
1116*217ec208SDavid C Somayajulu 	FCOE_TASK_TYPE_MIDPATH,
1117*217ec208SDavid C Somayajulu 	FCOE_TASK_TYPE_UNSOLICITED,
1118*217ec208SDavid C Somayajulu 	FCOE_TASK_TYPE_ABTS,
1119*217ec208SDavid C Somayajulu 	FCOE_TASK_TYPE_EXCHANGE_CLEANUP,
1120*217ec208SDavid C Somayajulu 	FCOE_TASK_TYPE_SEQUENCE_CLEANUP,
1121*217ec208SDavid C Somayajulu 	FCOE_TASK_TYPE_WRITE_TARGET,
1122*217ec208SDavid C Somayajulu 	FCOE_TASK_TYPE_READ_TARGET,
1123*217ec208SDavid C Somayajulu 	FCOE_TASK_TYPE_RSP,
1124*217ec208SDavid C Somayajulu 	FCOE_TASK_TYPE_RSP_SENSE_DATA,
1125*217ec208SDavid C Somayajulu 	FCOE_TASK_TYPE_ABTS_TARGET,
1126*217ec208SDavid C Somayajulu 	FCOE_TASK_TYPE_ENUM_SIZE,
1127*217ec208SDavid C Somayajulu 	MAX_FCOE_TASK_TYPE
1128*217ec208SDavid C Somayajulu };
1129*217ec208SDavid C Somayajulu 
11309efd0ba7SDavid C Somayajulu /*
11319efd0ba7SDavid C Somayajulu  * Per PF FCoE transmit path statistics - pStorm RAM structure
11329efd0ba7SDavid C Somayajulu  */
11339efd0ba7SDavid C Somayajulu struct fcoe_tx_stat
11349efd0ba7SDavid C Somayajulu {
11359efd0ba7SDavid C Somayajulu 	struct regpair fcoe_tx_byte_cnt /* Transmitted FCoE bytes count */;
11369efd0ba7SDavid C Somayajulu 	struct regpair fcoe_tx_data_pkt_cnt /* Transmitted FCoE FCP DATA packets count */;
11379efd0ba7SDavid C Somayajulu 	struct regpair fcoe_tx_xfer_pkt_cnt /* Transmitted FCoE XFER_RDY packets count */;
11389efd0ba7SDavid C Somayajulu 	struct regpair fcoe_tx_other_pkt_cnt /* Transmitted FCoE packets which are not DATA/XFER_RDY count */;
11399efd0ba7SDavid C Somayajulu };
11409efd0ba7SDavid C Somayajulu 
11419efd0ba7SDavid C Somayajulu /*
11429efd0ba7SDavid C Somayajulu  * FCoE SQ/XferQ element
11439efd0ba7SDavid C Somayajulu  */
11449efd0ba7SDavid C Somayajulu struct fcoe_wqe
11459efd0ba7SDavid C Somayajulu {
11469efd0ba7SDavid C Somayajulu 	__le16 task_id /* Initiator - The task identifier (OX_ID). Target - Continuation tid or RX_ID in non-continuation mode */;
11479efd0ba7SDavid C Somayajulu 	__le16 flags;
11489efd0ba7SDavid C Somayajulu #define FCOE_WQE_REQ_TYPE_MASK       0xF /* Type of the wqe request. use enum fcoe_sqe_request_type  (use enum fcoe_sqe_request_type) */
11499efd0ba7SDavid C Somayajulu #define FCOE_WQE_REQ_TYPE_SHIFT      0
11509efd0ba7SDavid C Somayajulu #define FCOE_WQE_SGL_MODE_MASK       0x1 /* The driver will give a hint about sizes of SGEs for better credits evaluation at Xstorm. use enum scsi_sgl_mode (use enum scsi_sgl_mode) */
11519efd0ba7SDavid C Somayajulu #define FCOE_WQE_SGL_MODE_SHIFT      4
11529efd0ba7SDavid C Somayajulu #define FCOE_WQE_CONTINUATION_MASK   0x1 /* Indication if this wqe is a continuation to an existing task (Target only) */
11539efd0ba7SDavid C Somayajulu #define FCOE_WQE_CONTINUATION_SHIFT  5
11549efd0ba7SDavid C Somayajulu #define FCOE_WQE_SEND_AUTO_RSP_MASK  0x1 /* Indication to FW to send FCP_RSP after all data was sent - Target only */
11559efd0ba7SDavid C Somayajulu #define FCOE_WQE_SEND_AUTO_RSP_SHIFT 6
11569efd0ba7SDavid C Somayajulu #define FCOE_WQE_RESERVED_MASK       0x1
11579efd0ba7SDavid C Somayajulu #define FCOE_WQE_RESERVED_SHIFT      7
11589efd0ba7SDavid C Somayajulu #define FCOE_WQE_NUM_SGES_MASK       0xF /* Number of SGEs. 8 = at least 8 sges */
11599efd0ba7SDavid C Somayajulu #define FCOE_WQE_NUM_SGES_SHIFT      8
11609efd0ba7SDavid C Somayajulu #define FCOE_WQE_RESERVED1_MASK      0xF
11619efd0ba7SDavid C Somayajulu #define FCOE_WQE_RESERVED1_SHIFT     12
11629efd0ba7SDavid C Somayajulu 	union fcoe_additional_info_union additional_info_union /* Additional wqe information (if needed) */;
11639efd0ba7SDavid C Somayajulu };
11649efd0ba7SDavid C Somayajulu 
11659efd0ba7SDavid C Somayajulu /*
11669efd0ba7SDavid C Somayajulu  * FCoE XFRQ element
11679efd0ba7SDavid C Somayajulu  */
11689efd0ba7SDavid C Somayajulu struct xfrqe_prot_flags
11699efd0ba7SDavid C Somayajulu {
11709efd0ba7SDavid C Somayajulu 	u8 flags;
11719efd0ba7SDavid C Somayajulu #define XFRQE_PROT_FLAGS_PROT_INTERVAL_SIZE_LOG_MASK  0xF /* Protection log interval (9=512 10=1024  11=2048 12=4096 13=8192) */
11729efd0ba7SDavid C Somayajulu #define XFRQE_PROT_FLAGS_PROT_INTERVAL_SIZE_LOG_SHIFT 0
11739efd0ba7SDavid C Somayajulu #define XFRQE_PROT_FLAGS_DIF_TO_PEER_MASK             0x1 /* If DIF protection is configured against target (0=no, 1=yes) */
11749efd0ba7SDavid C Somayajulu #define XFRQE_PROT_FLAGS_DIF_TO_PEER_SHIFT            4
11759efd0ba7SDavid C Somayajulu #define XFRQE_PROT_FLAGS_HOST_INTERFACE_MASK          0x3 /* If DIF/DIX protection is configured against the host (0=none, 1=DIF, 2=DIX) */
11769efd0ba7SDavid C Somayajulu #define XFRQE_PROT_FLAGS_HOST_INTERFACE_SHIFT         5
11779efd0ba7SDavid C Somayajulu #define XFRQE_PROT_FLAGS_RESERVED_MASK                0x1 /* Must set to 0 */
11789efd0ba7SDavid C Somayajulu #define XFRQE_PROT_FLAGS_RESERVED_SHIFT               7
11799efd0ba7SDavid C Somayajulu };
11809efd0ba7SDavid C Somayajulu 
118111e25f0dSDavid C Somayajulu /*
118211e25f0dSDavid C Somayajulu  * FCoE doorbell data
118311e25f0dSDavid C Somayajulu  */
118411e25f0dSDavid C Somayajulu struct fcoe_db_data
118511e25f0dSDavid C Somayajulu {
118611e25f0dSDavid C Somayajulu 	u8 params;
118711e25f0dSDavid C Somayajulu #define FCOE_DB_DATA_DEST_MASK         0x3 /* destination of doorbell (use enum db_dest) */
118811e25f0dSDavid C Somayajulu #define FCOE_DB_DATA_DEST_SHIFT        0
118911e25f0dSDavid C Somayajulu #define FCOE_DB_DATA_AGG_CMD_MASK      0x3 /* aggregative command to CM (use enum db_agg_cmd_sel) */
119011e25f0dSDavid C Somayajulu #define FCOE_DB_DATA_AGG_CMD_SHIFT     2
119111e25f0dSDavid C Somayajulu #define FCOE_DB_DATA_BYPASS_EN_MASK    0x1 /* enable QM bypass */
119211e25f0dSDavid C Somayajulu #define FCOE_DB_DATA_BYPASS_EN_SHIFT   4
119311e25f0dSDavid C Somayajulu #define FCOE_DB_DATA_RESERVED_MASK     0x1
119411e25f0dSDavid C Somayajulu #define FCOE_DB_DATA_RESERVED_SHIFT    5
119511e25f0dSDavid C Somayajulu #define FCOE_DB_DATA_AGG_VAL_SEL_MASK  0x3 /* aggregative value selection */
119611e25f0dSDavid C Somayajulu #define FCOE_DB_DATA_AGG_VAL_SEL_SHIFT 6
119711e25f0dSDavid C Somayajulu 	u8 agg_flags /* bit for every DQ counter flags in CM context that DQ can increment */;
119811e25f0dSDavid C Somayajulu 	__le16 sq_prod;
119911e25f0dSDavid C Somayajulu };
120011e25f0dSDavid C Somayajulu 
120111e25f0dSDavid C Somayajulu #endif /* __FCOE_COMMON__ */
1202