18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *  QLogic FCoE Offload Driver
48c2ecf20Sopenharmony_ci *  Copyright (c) 2016-2018 Cavium Inc.
58c2ecf20Sopenharmony_ci */
68c2ecf20Sopenharmony_ci#ifndef __QEDF_HSI__
78c2ecf20Sopenharmony_ci#define __QEDF_HSI__
88c2ecf20Sopenharmony_ci/*
98c2ecf20Sopenharmony_ci * Add include to common target
108c2ecf20Sopenharmony_ci */
118c2ecf20Sopenharmony_ci#include <linux/qed/common_hsi.h>
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci/*
148c2ecf20Sopenharmony_ci * Add include to common storage target
158c2ecf20Sopenharmony_ci */
168c2ecf20Sopenharmony_ci#include <linux/qed/storage_common.h>
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci/*
198c2ecf20Sopenharmony_ci * Add include to common fcoe target for both eCore and protocol driver
208c2ecf20Sopenharmony_ci */
218c2ecf20Sopenharmony_ci#include <linux/qed/fcoe_common.h>
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci/*
258c2ecf20Sopenharmony_ci * FCoE CQ element ABTS information
268c2ecf20Sopenharmony_ci */
278c2ecf20Sopenharmony_cistruct fcoe_abts_info {
288c2ecf20Sopenharmony_ci	u8 r_ctl /* R_CTL in the ABTS response frame */;
298c2ecf20Sopenharmony_ci	u8 reserved0;
308c2ecf20Sopenharmony_ci	__le16 rx_id;
318c2ecf20Sopenharmony_ci	__le32 reserved2[2];
328c2ecf20Sopenharmony_ci	__le32 fc_payload[3] /* ABTS FC payload response frame */;
338c2ecf20Sopenharmony_ci};
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci/*
378c2ecf20Sopenharmony_ci * FCoE class type
388c2ecf20Sopenharmony_ci */
398c2ecf20Sopenharmony_cienum fcoe_class_type {
408c2ecf20Sopenharmony_ci	FCOE_TASK_CLASS_TYPE_3,
418c2ecf20Sopenharmony_ci	FCOE_TASK_CLASS_TYPE_2,
428c2ecf20Sopenharmony_ci	MAX_FCOE_CLASS_TYPE
438c2ecf20Sopenharmony_ci};
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci/*
478c2ecf20Sopenharmony_ci * FCoE CMDQ element control information
488c2ecf20Sopenharmony_ci */
498c2ecf20Sopenharmony_cistruct fcoe_cmdqe_control {
508c2ecf20Sopenharmony_ci	__le16 conn_id;
518c2ecf20Sopenharmony_ci	u8 num_additional_cmdqes;
528c2ecf20Sopenharmony_ci	u8 cmdType;
538c2ecf20Sopenharmony_ci	/* true for ABTS request cmdqe. used in Target mode */
548c2ecf20Sopenharmony_ci#define FCOE_CMDQE_CONTROL_ABTSREQCMD_MASK  0x1
558c2ecf20Sopenharmony_ci#define FCOE_CMDQE_CONTROL_ABTSREQCMD_SHIFT 0
568c2ecf20Sopenharmony_ci#define FCOE_CMDQE_CONTROL_RESERVED1_MASK   0x7F
578c2ecf20Sopenharmony_ci#define FCOE_CMDQE_CONTROL_RESERVED1_SHIFT  1
588c2ecf20Sopenharmony_ci	u8 reserved2[4];
598c2ecf20Sopenharmony_ci};
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci/*
628c2ecf20Sopenharmony_ci * FCoE control + payload CMDQ element
638c2ecf20Sopenharmony_ci */
648c2ecf20Sopenharmony_cistruct fcoe_cmdqe {
658c2ecf20Sopenharmony_ci	struct fcoe_cmdqe_control hdr;
668c2ecf20Sopenharmony_ci	u8 fc_header[24];
678c2ecf20Sopenharmony_ci	__le32 fcp_cmd_payload[8];
688c2ecf20Sopenharmony_ci};
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci
728c2ecf20Sopenharmony_ci/*
738c2ecf20Sopenharmony_ci * FCP RSP flags
748c2ecf20Sopenharmony_ci */
758c2ecf20Sopenharmony_cistruct fcoe_fcp_rsp_flags {
768c2ecf20Sopenharmony_ci	u8 flags;
778c2ecf20Sopenharmony_ci#define FCOE_FCP_RSP_FLAGS_FCP_RSP_LEN_VALID_MASK  0x1
788c2ecf20Sopenharmony_ci#define FCOE_FCP_RSP_FLAGS_FCP_RSP_LEN_VALID_SHIFT 0
798c2ecf20Sopenharmony_ci#define FCOE_FCP_RSP_FLAGS_FCP_SNS_LEN_VALID_MASK  0x1
808c2ecf20Sopenharmony_ci#define FCOE_FCP_RSP_FLAGS_FCP_SNS_LEN_VALID_SHIFT 1
818c2ecf20Sopenharmony_ci#define FCOE_FCP_RSP_FLAGS_FCP_RESID_OVER_MASK     0x1
828c2ecf20Sopenharmony_ci#define FCOE_FCP_RSP_FLAGS_FCP_RESID_OVER_SHIFT    2
838c2ecf20Sopenharmony_ci#define FCOE_FCP_RSP_FLAGS_FCP_RESID_UNDER_MASK    0x1
848c2ecf20Sopenharmony_ci#define FCOE_FCP_RSP_FLAGS_FCP_RESID_UNDER_SHIFT   3
858c2ecf20Sopenharmony_ci#define FCOE_FCP_RSP_FLAGS_FCP_CONF_REQ_MASK       0x1
868c2ecf20Sopenharmony_ci#define FCOE_FCP_RSP_FLAGS_FCP_CONF_REQ_SHIFT      4
878c2ecf20Sopenharmony_ci#define FCOE_FCP_RSP_FLAGS_FCP_BIDI_FLAGS_MASK     0x7
888c2ecf20Sopenharmony_ci#define FCOE_FCP_RSP_FLAGS_FCP_BIDI_FLAGS_SHIFT    5
898c2ecf20Sopenharmony_ci};
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ci/*
928c2ecf20Sopenharmony_ci * FCoE CQ element response information
938c2ecf20Sopenharmony_ci */
948c2ecf20Sopenharmony_cistruct fcoe_cqe_rsp_info {
958c2ecf20Sopenharmony_ci	struct fcoe_fcp_rsp_flags rsp_flags;
968c2ecf20Sopenharmony_ci	u8 scsi_status_code;
978c2ecf20Sopenharmony_ci	__le16 retry_delay_timer;
988c2ecf20Sopenharmony_ci	__le32 fcp_resid;
998c2ecf20Sopenharmony_ci	__le32 fcp_sns_len;
1008c2ecf20Sopenharmony_ci	__le32 fcp_rsp_len;
1018c2ecf20Sopenharmony_ci	__le16 rx_id;
1028c2ecf20Sopenharmony_ci	u8 fw_error_flags;
1038c2ecf20Sopenharmony_ci#define FCOE_CQE_RSP_INFO_FW_UNDERRUN_MASK  0x1 /* FW detected underrun */
1048c2ecf20Sopenharmony_ci#define FCOE_CQE_RSP_INFO_FW_UNDERRUN_SHIFT 0
1058c2ecf20Sopenharmony_ci#define FCOE_CQE_RSP_INFO_RESREVED_MASK     0x7F
1068c2ecf20Sopenharmony_ci#define FCOE_CQE_RSP_INFO_RESREVED_SHIFT    1
1078c2ecf20Sopenharmony_ci	u8 reserved;
1088c2ecf20Sopenharmony_ci	__le32 fw_residual /* Residual bytes calculated by FW */;
1098c2ecf20Sopenharmony_ci};
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ci/*
1128c2ecf20Sopenharmony_ci * FCoE CQ element Target completion information
1138c2ecf20Sopenharmony_ci */
1148c2ecf20Sopenharmony_cistruct fcoe_cqe_target_info {
1158c2ecf20Sopenharmony_ci	__le16 rx_id;
1168c2ecf20Sopenharmony_ci	__le16 reserved0;
1178c2ecf20Sopenharmony_ci	__le32 reserved1[5];
1188c2ecf20Sopenharmony_ci};
1198c2ecf20Sopenharmony_ci
1208c2ecf20Sopenharmony_ci/*
1218c2ecf20Sopenharmony_ci * FCoE error/warning reporting entry
1228c2ecf20Sopenharmony_ci */
1238c2ecf20Sopenharmony_cistruct fcoe_err_report_entry {
1248c2ecf20Sopenharmony_ci	__le32 err_warn_bitmap_lo /* Error bitmap lower 32 bits */;
1258c2ecf20Sopenharmony_ci	__le32 err_warn_bitmap_hi /* Error bitmap higher 32 bits */;
1268c2ecf20Sopenharmony_ci	/* Buffer offset the beginning of the Sequence last transmitted */
1278c2ecf20Sopenharmony_ci	__le32 tx_buf_off;
1288c2ecf20Sopenharmony_ci	/* Buffer offset from the beginning of the Sequence last received */
1298c2ecf20Sopenharmony_ci	__le32 rx_buf_off;
1308c2ecf20Sopenharmony_ci	__le16 rx_id /* RX_ID of the associated task */;
1318c2ecf20Sopenharmony_ci	__le16 reserved1;
1328c2ecf20Sopenharmony_ci	__le32 reserved2;
1338c2ecf20Sopenharmony_ci};
1348c2ecf20Sopenharmony_ci
1358c2ecf20Sopenharmony_ci/*
1368c2ecf20Sopenharmony_ci * FCoE CQ element middle path information
1378c2ecf20Sopenharmony_ci */
1388c2ecf20Sopenharmony_cistruct fcoe_cqe_midpath_info {
1398c2ecf20Sopenharmony_ci	__le32 data_placement_size;
1408c2ecf20Sopenharmony_ci	__le16 rx_id;
1418c2ecf20Sopenharmony_ci	__le16 reserved0;
1428c2ecf20Sopenharmony_ci	__le32 reserved1[4];
1438c2ecf20Sopenharmony_ci};
1448c2ecf20Sopenharmony_ci
1458c2ecf20Sopenharmony_ci/*
1468c2ecf20Sopenharmony_ci * FCoE CQ element unsolicited information
1478c2ecf20Sopenharmony_ci */
1488c2ecf20Sopenharmony_cistruct fcoe_unsolic_info {
1498c2ecf20Sopenharmony_ci	/* BD information: Physical address and opaque data */
1508c2ecf20Sopenharmony_ci	struct scsi_bd bd_info;
1518c2ecf20Sopenharmony_ci	__le16 conn_id /* Connection ID the frame is associated to */;
1528c2ecf20Sopenharmony_ci	__le16 pkt_len /* Packet length */;
1538c2ecf20Sopenharmony_ci	u8 reserved1[4];
1548c2ecf20Sopenharmony_ci};
1558c2ecf20Sopenharmony_ci
1568c2ecf20Sopenharmony_ci/*
1578c2ecf20Sopenharmony_ci * FCoE warning reporting entry
1588c2ecf20Sopenharmony_ci */
1598c2ecf20Sopenharmony_cistruct fcoe_warning_report_entry {
1608c2ecf20Sopenharmony_ci	/* BD information: Physical address and opaque data */
1618c2ecf20Sopenharmony_ci	struct scsi_bd bd_info;
1628c2ecf20Sopenharmony_ci	/* Buffer offset the beginning of the Sequence last transmitted */
1638c2ecf20Sopenharmony_ci	__le32 buf_off;
1648c2ecf20Sopenharmony_ci	__le16 rx_id /* RX_ID of the associated task */;
1658c2ecf20Sopenharmony_ci	__le16 reserved1;
1668c2ecf20Sopenharmony_ci};
1678c2ecf20Sopenharmony_ci
1688c2ecf20Sopenharmony_ci/*
1698c2ecf20Sopenharmony_ci * FCoE CQ element information
1708c2ecf20Sopenharmony_ci */
1718c2ecf20Sopenharmony_ciunion fcoe_cqe_info {
1728c2ecf20Sopenharmony_ci	struct fcoe_cqe_rsp_info rsp_info /* Response completion information */;
1738c2ecf20Sopenharmony_ci	/* Target completion information */
1748c2ecf20Sopenharmony_ci	struct fcoe_cqe_target_info target_info;
1758c2ecf20Sopenharmony_ci	/* Error completion information */
1768c2ecf20Sopenharmony_ci	struct fcoe_err_report_entry err_info;
1778c2ecf20Sopenharmony_ci	struct fcoe_abts_info abts_info /* ABTS completion information */;
1788c2ecf20Sopenharmony_ci	/* Middle path completion information */
1798c2ecf20Sopenharmony_ci	struct fcoe_cqe_midpath_info midpath_info;
1808c2ecf20Sopenharmony_ci	/* Unsolicited packet completion information */
1818c2ecf20Sopenharmony_ci	struct fcoe_unsolic_info unsolic_info;
1828c2ecf20Sopenharmony_ci	/* Warning completion information (Rec Tov expiration) */
1838c2ecf20Sopenharmony_ci	struct fcoe_warning_report_entry warn_info;
1848c2ecf20Sopenharmony_ci};
1858c2ecf20Sopenharmony_ci
1868c2ecf20Sopenharmony_ci/*
1878c2ecf20Sopenharmony_ci * FCoE CQ element
1888c2ecf20Sopenharmony_ci */
1898c2ecf20Sopenharmony_cistruct fcoe_cqe {
1908c2ecf20Sopenharmony_ci	__le32 cqe_data;
1918c2ecf20Sopenharmony_ci	/* The task identifier (OX_ID) to be completed */
1928c2ecf20Sopenharmony_ci#define FCOE_CQE_TASK_ID_MASK    0xFFFF
1938c2ecf20Sopenharmony_ci#define FCOE_CQE_TASK_ID_SHIFT   0
1948c2ecf20Sopenharmony_ci	/*
1958c2ecf20Sopenharmony_ci	 * The CQE type: 0x0 Indicating on a pending work request completion.
1968c2ecf20Sopenharmony_ci	 * 0x1 - Indicating on an unsolicited event notification. use enum
1978c2ecf20Sopenharmony_ci	 * fcoe_cqe_type  (use enum fcoe_cqe_type)
1988c2ecf20Sopenharmony_ci	 */
1998c2ecf20Sopenharmony_ci#define FCOE_CQE_CQE_TYPE_MASK   0xF
2008c2ecf20Sopenharmony_ci#define FCOE_CQE_CQE_TYPE_SHIFT  16
2018c2ecf20Sopenharmony_ci#define FCOE_CQE_RESERVED0_MASK  0xFFF
2028c2ecf20Sopenharmony_ci#define FCOE_CQE_RESERVED0_SHIFT 20
2038c2ecf20Sopenharmony_ci	__le16 reserved1;
2048c2ecf20Sopenharmony_ci	__le16 fw_cq_prod;
2058c2ecf20Sopenharmony_ci	union fcoe_cqe_info cqe_info;
2068c2ecf20Sopenharmony_ci};
2078c2ecf20Sopenharmony_ci
2088c2ecf20Sopenharmony_ci/*
2098c2ecf20Sopenharmony_ci * FCoE CQE type
2108c2ecf20Sopenharmony_ci */
2118c2ecf20Sopenharmony_cienum fcoe_cqe_type {
2128c2ecf20Sopenharmony_ci	/* solicited response on a R/W or middle-path SQE */
2138c2ecf20Sopenharmony_ci	FCOE_GOOD_COMPLETION_CQE_TYPE,
2148c2ecf20Sopenharmony_ci	FCOE_UNSOLIC_CQE_TYPE /* unsolicited packet, RQ consumed */,
2158c2ecf20Sopenharmony_ci	FCOE_ERROR_DETECTION_CQE_TYPE /* timer expiration, validation error */,
2168c2ecf20Sopenharmony_ci	FCOE_WARNING_CQE_TYPE /* rec_tov or rr_tov timer expiration */,
2178c2ecf20Sopenharmony_ci	FCOE_EXCH_CLEANUP_CQE_TYPE /* task cleanup completed */,
2188c2ecf20Sopenharmony_ci	FCOE_ABTS_CQE_TYPE /* ABTS received and task cleaned */,
2198c2ecf20Sopenharmony_ci	FCOE_DUMMY_CQE_TYPE /* just increment SQ CONS */,
2208c2ecf20Sopenharmony_ci	/* Task was completed wight after sending a pkt to the target */
2218c2ecf20Sopenharmony_ci	FCOE_LOCAL_COMP_CQE_TYPE,
2228c2ecf20Sopenharmony_ci	MAX_FCOE_CQE_TYPE
2238c2ecf20Sopenharmony_ci};
2248c2ecf20Sopenharmony_ci
2258c2ecf20Sopenharmony_ci/*
2268c2ecf20Sopenharmony_ci * FCoE fast path error codes
2278c2ecf20Sopenharmony_ci */
2288c2ecf20Sopenharmony_cienum fcoe_fp_error_warning_code {
2298c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_XFER_OOO_RO /* XFER error codes */,
2308c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_XFER_RO_NOT_ALIGNED,
2318c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_XFER_NULL_BURST_LEN,
2328c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_XFER_RO_GREATER_THAN_DATA2TRNS,
2338c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_XFER_INVALID_PAYLOAD_SIZE,
2348c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_XFER_TASK_TYPE_NOT_WRITE,
2358c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_XFER_PEND_XFER_SET,
2368c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_XFER_OPENED_SEQ,
2378c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_XFER_FCTL,
2388c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_FCP_RSP_BIDI_FLAGS_SET /* FCP RSP error codes */,
2398c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_FCP_RSP_INVALID_LENGTH_FIELD,
2408c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_FCP_RSP_INVALID_SNS_FIELD,
2418c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_FCP_RSP_INVALID_PAYLOAD_SIZE,
2428c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_FCP_RSP_PEND_XFER_SET,
2438c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_FCP_RSP_OPENED_SEQ,
2448c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_FCP_RSP_FCTL,
2458c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_FCP_RSP_LAST_SEQ_RESET,
2468c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_FCP_RSP_CONF_REQ_NOT_SUPPORTED_YET,
2478c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_DATA_OOO_RO /* FCP DATA error codes */,
2488c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_DATA_EXCEEDS_DEFINED_MAX_FRAME_SIZE,
2498c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_DATA_EXCEEDS_DATA2TRNS,
2508c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_DATA_SOFI3_SEQ_ACTIVE_SET,
2518c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_DATA_SOFN_SEQ_ACTIVE_RESET,
2528c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_DATA_EOFN_END_SEQ_SET,
2538c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_DATA_EOFT_END_SEQ_RESET,
2548c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_DATA_TASK_TYPE_NOT_READ,
2558c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_DATA_FCTL_INITIATIR,
2568c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_MIDPATH_INVALID_TYPE /* Middle path error codes */,
2578c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_MIDPATH_SOFI3_SEQ_ACTIVE_SET,
2588c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_MIDPATH_SOFN_SEQ_ACTIVE_RESET,
2598c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_MIDPATH_EOFN_END_SEQ_SET,
2608c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_MIDPATH_EOFT_END_SEQ_RESET,
2618c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_MIDPATH_REPLY_FCTL,
2628c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_MIDPATH_INVALID_REPLY,
2638c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_MIDPATH_ELS_REPLY_RCTL,
2648c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_COMMON_MIDDLE_FRAME_WITH_PAD /* Common error codes */,
2658c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_COMMON_SEQ_INIT_IN_TCE,
2668c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_COMMON_FC_HDR_RX_ID_MISMATCH,
2678c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_COMMON_INCORRECT_SEQ_CNT,
2688c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_COMMON_DATA_FC_HDR_FCP_TYPE_MISMATCH,
2698c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_COMMON_DATA_NO_MORE_SGES,
2708c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_COMMON_OPTIONAL_FC_HDR,
2718c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_COMMON_READ_TCE_OX_ID_TOO_BIG,
2728c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_COMMON_DATA_WAS_NOT_TRANSMITTED,
2738c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_COMMON_TASK_DDF_RCTL_INFO_FIELD,
2748c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_COMMON_TASK_INVALID_RCTL,
2758c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_COMMON_TASK_RCTL_GENERAL_MISMATCH,
2768c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_E_D_TOV_TIMER_EXPIRATION /* Timer error codes */,
2778c2ecf20Sopenharmony_ci	FCOE_WARNING_CODE_REC_TOV_TIMER_EXPIRATION /* Timer error codes */,
2788c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_RR_TOV_TIMER_EXPIRATION /* Timer error codes */,
2798c2ecf20Sopenharmony_ci	/* ABTSrsp pckt arrived unexpected */
2808c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_ABTS_REPLY_UNEXPECTED,
2818c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_TARGET_MODE_FCP_RSP,
2828c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_TARGET_MODE_FCP_XFER,
2838c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_TARGET_MODE_DATA_TASK_TYPE_NOT_WRITE,
2848c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_DATA_FCTL_TARGET,
2858c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_TARGET_DATA_SIZE_NO_MATCH_XFER,
2868c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_TARGET_DIF_CRC_CHECKSUM_ERROR,
2878c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_TARGET_DIF_REF_TAG_ERROR,
2888c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_TARGET_DIF_APP_TAG_ERROR,
2898c2ecf20Sopenharmony_ci	MAX_FCOE_FP_ERROR_WARNING_CODE
2908c2ecf20Sopenharmony_ci};
2918c2ecf20Sopenharmony_ci
2928c2ecf20Sopenharmony_ci
2938c2ecf20Sopenharmony_ci/*
2948c2ecf20Sopenharmony_ci * FCoE RESPQ element
2958c2ecf20Sopenharmony_ci */
2968c2ecf20Sopenharmony_cistruct fcoe_respqe {
2978c2ecf20Sopenharmony_ci	__le16 ox_id /* OX_ID that is located in the FCP_RSP FC header */;
2988c2ecf20Sopenharmony_ci	__le16 rx_id /* RX_ID that is located in the FCP_RSP FC header */;
2998c2ecf20Sopenharmony_ci	__le32 additional_info;
3008c2ecf20Sopenharmony_ci/* PARAM that is located in the FCP_RSP FC header */
3018c2ecf20Sopenharmony_ci#define FCOE_RESPQE_PARAM_MASK            0xFFFFFF
3028c2ecf20Sopenharmony_ci#define FCOE_RESPQE_PARAM_SHIFT           0
3038c2ecf20Sopenharmony_ci/* Indication whther its Target-auto-rsp mode or not */
3048c2ecf20Sopenharmony_ci#define FCOE_RESPQE_TARGET_AUTO_RSP_MASK  0xFF
3058c2ecf20Sopenharmony_ci#define FCOE_RESPQE_TARGET_AUTO_RSP_SHIFT 24
3068c2ecf20Sopenharmony_ci};
3078c2ecf20Sopenharmony_ci
3088c2ecf20Sopenharmony_ci
3098c2ecf20Sopenharmony_ci/*
3108c2ecf20Sopenharmony_ci * FCoE slow path error codes
3118c2ecf20Sopenharmony_ci */
3128c2ecf20Sopenharmony_cienum fcoe_sp_error_code {
3138c2ecf20Sopenharmony_ci	/* Error codes for Error Reporting in slow path flows */
3148c2ecf20Sopenharmony_ci	FCOE_ERROR_CODE_SLOW_PATH_TOO_MANY_FUNCS,
3158c2ecf20Sopenharmony_ci	FCOE_ERROR_SLOW_PATH_CODE_NO_LICENSE,
3168c2ecf20Sopenharmony_ci	MAX_FCOE_SP_ERROR_CODE
3178c2ecf20Sopenharmony_ci};
3188c2ecf20Sopenharmony_ci
3198c2ecf20Sopenharmony_ci/*
3208c2ecf20Sopenharmony_ci * FCoE task TX state
3218c2ecf20Sopenharmony_ci */
3228c2ecf20Sopenharmony_cienum fcoe_task_tx_state {
3238c2ecf20Sopenharmony_ci	/* Initiate state after driver has initialized the task */
3248c2ecf20Sopenharmony_ci	FCOE_TASK_TX_STATE_NORMAL,
3258c2ecf20Sopenharmony_ci	/* Updated by TX path after complete transmitting unsolicited packet */
3268c2ecf20Sopenharmony_ci	FCOE_TASK_TX_STATE_UNSOLICITED_COMPLETED,
3278c2ecf20Sopenharmony_ci	/*
3288c2ecf20Sopenharmony_ci	 * Updated by TX path after start processing the task requesting the
3298c2ecf20Sopenharmony_ci	 * cleanup/abort operation
3308c2ecf20Sopenharmony_ci	 */
3318c2ecf20Sopenharmony_ci	FCOE_TASK_TX_STATE_CLEAN_REQ,
3328c2ecf20Sopenharmony_ci	FCOE_TASK_TX_STATE_ABTS /* Updated by TX path during abort procedure */,
3338c2ecf20Sopenharmony_ci	/* Updated by TX path during exchange cleanup procedure */
3348c2ecf20Sopenharmony_ci	FCOE_TASK_TX_STATE_EXCLEANUP,
3358c2ecf20Sopenharmony_ci	/*
3368c2ecf20Sopenharmony_ci	 * Updated by TX path during exchange cleanup continuation task
3378c2ecf20Sopenharmony_ci	 * procedure
3388c2ecf20Sopenharmony_ci	 */
3398c2ecf20Sopenharmony_ci	FCOE_TASK_TX_STATE_EXCLEANUP_TARGET_WRITE_CONT,
3408c2ecf20Sopenharmony_ci	/* Updated by TX path during exchange cleanup first xfer procedure */
3418c2ecf20Sopenharmony_ci	FCOE_TASK_TX_STATE_EXCLEANUP_TARGET_WRITE,
3428c2ecf20Sopenharmony_ci	/* Updated by TX path during exchange cleanup read task in Target */
3438c2ecf20Sopenharmony_ci	FCOE_TASK_TX_STATE_EXCLEANUP_TARGET_READ_OR_RSP,
3448c2ecf20Sopenharmony_ci	/* Updated by TX path during target exchange cleanup procedure */
3458c2ecf20Sopenharmony_ci	FCOE_TASK_TX_STATE_EXCLEANUP_TARGET_WRITE_LAST_CYCLE,
3468c2ecf20Sopenharmony_ci	/* Updated by TX path during sequence recovery procedure */
3478c2ecf20Sopenharmony_ci	FCOE_TASK_TX_STATE_SEQRECOVERY,
3488c2ecf20Sopenharmony_ci	MAX_FCOE_TASK_TX_STATE
3498c2ecf20Sopenharmony_ci};
3508c2ecf20Sopenharmony_ci
3518c2ecf20Sopenharmony_ci#endif /* __QEDF_HSI__ */
352