^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * QLogic FCoE Offload Driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Copyright (c) 2016-2018 Cavium Inc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #ifndef __QEDF_HSI__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #define __QEDF_HSI__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * Add include to common target
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <linux/qed/common_hsi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * Add include to common storage target
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <linux/qed/storage_common.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) * Add include to common fcoe target for both eCore and protocol driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #include <linux/qed/fcoe_common.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) * FCoE CQ element ABTS information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) struct fcoe_abts_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) u8 r_ctl /* R_CTL in the ABTS response frame */;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) u8 reserved0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) __le16 rx_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) __le32 reserved2[2];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) __le32 fc_payload[3] /* ABTS FC payload response frame */;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) * FCoE class type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) enum fcoe_class_type {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) FCOE_TASK_CLASS_TYPE_3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) FCOE_TASK_CLASS_TYPE_2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) MAX_FCOE_CLASS_TYPE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) * FCoE CMDQ element control information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) struct fcoe_cmdqe_control {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) __le16 conn_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) u8 num_additional_cmdqes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) u8 cmdType;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) /* true for ABTS request cmdqe. used in Target mode */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) #define FCOE_CMDQE_CONTROL_ABTSREQCMD_MASK 0x1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) #define FCOE_CMDQE_CONTROL_ABTSREQCMD_SHIFT 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) #define FCOE_CMDQE_CONTROL_RESERVED1_MASK 0x7F
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) #define FCOE_CMDQE_CONTROL_RESERVED1_SHIFT 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) u8 reserved2[4];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) * FCoE control + payload CMDQ element
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) struct fcoe_cmdqe {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) struct fcoe_cmdqe_control hdr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) u8 fc_header[24];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) __le32 fcp_cmd_payload[8];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) * FCP RSP flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) struct fcoe_fcp_rsp_flags {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) u8 flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) #define FCOE_FCP_RSP_FLAGS_FCP_RSP_LEN_VALID_MASK 0x1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) #define FCOE_FCP_RSP_FLAGS_FCP_RSP_LEN_VALID_SHIFT 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) #define FCOE_FCP_RSP_FLAGS_FCP_SNS_LEN_VALID_MASK 0x1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) #define FCOE_FCP_RSP_FLAGS_FCP_SNS_LEN_VALID_SHIFT 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) #define FCOE_FCP_RSP_FLAGS_FCP_RESID_OVER_MASK 0x1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) #define FCOE_FCP_RSP_FLAGS_FCP_RESID_OVER_SHIFT 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) #define FCOE_FCP_RSP_FLAGS_FCP_RESID_UNDER_MASK 0x1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) #define FCOE_FCP_RSP_FLAGS_FCP_RESID_UNDER_SHIFT 3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) #define FCOE_FCP_RSP_FLAGS_FCP_CONF_REQ_MASK 0x1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) #define FCOE_FCP_RSP_FLAGS_FCP_CONF_REQ_SHIFT 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) #define FCOE_FCP_RSP_FLAGS_FCP_BIDI_FLAGS_MASK 0x7
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) #define FCOE_FCP_RSP_FLAGS_FCP_BIDI_FLAGS_SHIFT 5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) * FCoE CQ element response information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) struct fcoe_cqe_rsp_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) struct fcoe_fcp_rsp_flags rsp_flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) u8 scsi_status_code;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) __le16 retry_delay_timer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) __le32 fcp_resid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) __le32 fcp_sns_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) __le32 fcp_rsp_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) __le16 rx_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) u8 fw_error_flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) #define FCOE_CQE_RSP_INFO_FW_UNDERRUN_MASK 0x1 /* FW detected underrun */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) #define FCOE_CQE_RSP_INFO_FW_UNDERRUN_SHIFT 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) #define FCOE_CQE_RSP_INFO_RESREVED_MASK 0x7F
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) #define FCOE_CQE_RSP_INFO_RESREVED_SHIFT 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) u8 reserved;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) __le32 fw_residual /* Residual bytes calculated by FW */;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) * FCoE CQ element Target completion information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) struct fcoe_cqe_target_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) __le16 rx_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) __le16 reserved0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) __le32 reserved1[5];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) * FCoE error/warning reporting entry
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) struct fcoe_err_report_entry {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) __le32 err_warn_bitmap_lo /* Error bitmap lower 32 bits */;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) __le32 err_warn_bitmap_hi /* Error bitmap higher 32 bits */;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) /* Buffer offset the beginning of the Sequence last transmitted */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) __le32 tx_buf_off;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) /* Buffer offset from the beginning of the Sequence last received */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) __le32 rx_buf_off;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) __le16 rx_id /* RX_ID of the associated task */;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) __le16 reserved1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) __le32 reserved2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) * FCoE CQ element middle path information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) struct fcoe_cqe_midpath_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) __le32 data_placement_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) __le16 rx_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) __le16 reserved0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) __le32 reserved1[4];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) * FCoE CQ element unsolicited information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) struct fcoe_unsolic_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) /* BD information: Physical address and opaque data */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) struct scsi_bd bd_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) __le16 conn_id /* Connection ID the frame is associated to */;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) __le16 pkt_len /* Packet length */;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) u8 reserved1[4];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) * FCoE warning reporting entry
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) struct fcoe_warning_report_entry {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) /* BD information: Physical address and opaque data */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) struct scsi_bd bd_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) /* Buffer offset the beginning of the Sequence last transmitted */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) __le32 buf_off;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) __le16 rx_id /* RX_ID of the associated task */;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) __le16 reserved1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) * FCoE CQ element information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) union fcoe_cqe_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) struct fcoe_cqe_rsp_info rsp_info /* Response completion information */;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) /* Target completion information */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) struct fcoe_cqe_target_info target_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) /* Error completion information */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) struct fcoe_err_report_entry err_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) struct fcoe_abts_info abts_info /* ABTS completion information */;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) /* Middle path completion information */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) struct fcoe_cqe_midpath_info midpath_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) /* Unsolicited packet completion information */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) struct fcoe_unsolic_info unsolic_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) /* Warning completion information (Rec Tov expiration) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) struct fcoe_warning_report_entry warn_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) * FCoE CQ element
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) struct fcoe_cqe {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) __le32 cqe_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) /* The task identifier (OX_ID) to be completed */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) #define FCOE_CQE_TASK_ID_MASK 0xFFFF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) #define FCOE_CQE_TASK_ID_SHIFT 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) * The CQE type: 0x0 Indicating on a pending work request completion.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) * 0x1 - Indicating on an unsolicited event notification. use enum
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) * fcoe_cqe_type (use enum fcoe_cqe_type)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) #define FCOE_CQE_CQE_TYPE_MASK 0xF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) #define FCOE_CQE_CQE_TYPE_SHIFT 16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) #define FCOE_CQE_RESERVED0_MASK 0xFFF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) #define FCOE_CQE_RESERVED0_SHIFT 20
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) __le16 reserved1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) __le16 fw_cq_prod;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) union fcoe_cqe_info cqe_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) * FCoE CQE type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) enum fcoe_cqe_type {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) /* solicited response on a R/W or middle-path SQE */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) FCOE_GOOD_COMPLETION_CQE_TYPE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) FCOE_UNSOLIC_CQE_TYPE /* unsolicited packet, RQ consumed */,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) FCOE_ERROR_DETECTION_CQE_TYPE /* timer expiration, validation error */,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) FCOE_WARNING_CQE_TYPE /* rec_tov or rr_tov timer expiration */,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) FCOE_EXCH_CLEANUP_CQE_TYPE /* task cleanup completed */,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) FCOE_ABTS_CQE_TYPE /* ABTS received and task cleaned */,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) FCOE_DUMMY_CQE_TYPE /* just increment SQ CONS */,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) /* Task was completed wight after sending a pkt to the target */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) FCOE_LOCAL_COMP_CQE_TYPE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) MAX_FCOE_CQE_TYPE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) * FCoE fast path error codes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) enum fcoe_fp_error_warning_code {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) FCOE_ERROR_CODE_XFER_OOO_RO /* XFER error codes */,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) FCOE_ERROR_CODE_XFER_RO_NOT_ALIGNED,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) FCOE_ERROR_CODE_XFER_NULL_BURST_LEN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) FCOE_ERROR_CODE_XFER_RO_GREATER_THAN_DATA2TRNS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) FCOE_ERROR_CODE_XFER_INVALID_PAYLOAD_SIZE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) FCOE_ERROR_CODE_XFER_TASK_TYPE_NOT_WRITE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) FCOE_ERROR_CODE_XFER_PEND_XFER_SET,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) FCOE_ERROR_CODE_XFER_OPENED_SEQ,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) FCOE_ERROR_CODE_XFER_FCTL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) FCOE_ERROR_CODE_FCP_RSP_BIDI_FLAGS_SET /* FCP RSP error codes */,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) FCOE_ERROR_CODE_FCP_RSP_INVALID_LENGTH_FIELD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) FCOE_ERROR_CODE_FCP_RSP_INVALID_SNS_FIELD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) FCOE_ERROR_CODE_FCP_RSP_INVALID_PAYLOAD_SIZE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) FCOE_ERROR_CODE_FCP_RSP_PEND_XFER_SET,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) FCOE_ERROR_CODE_FCP_RSP_OPENED_SEQ,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) FCOE_ERROR_CODE_FCP_RSP_FCTL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) FCOE_ERROR_CODE_FCP_RSP_LAST_SEQ_RESET,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) FCOE_ERROR_CODE_FCP_RSP_CONF_REQ_NOT_SUPPORTED_YET,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) FCOE_ERROR_CODE_DATA_OOO_RO /* FCP DATA error codes */,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) FCOE_ERROR_CODE_DATA_EXCEEDS_DEFINED_MAX_FRAME_SIZE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) FCOE_ERROR_CODE_DATA_EXCEEDS_DATA2TRNS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) FCOE_ERROR_CODE_DATA_SOFI3_SEQ_ACTIVE_SET,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) FCOE_ERROR_CODE_DATA_SOFN_SEQ_ACTIVE_RESET,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) FCOE_ERROR_CODE_DATA_EOFN_END_SEQ_SET,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) FCOE_ERROR_CODE_DATA_EOFT_END_SEQ_RESET,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) FCOE_ERROR_CODE_DATA_TASK_TYPE_NOT_READ,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) FCOE_ERROR_CODE_DATA_FCTL_INITIATIR,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) FCOE_ERROR_CODE_MIDPATH_INVALID_TYPE /* Middle path error codes */,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) FCOE_ERROR_CODE_MIDPATH_SOFI3_SEQ_ACTIVE_SET,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) FCOE_ERROR_CODE_MIDPATH_SOFN_SEQ_ACTIVE_RESET,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) FCOE_ERROR_CODE_MIDPATH_EOFN_END_SEQ_SET,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) FCOE_ERROR_CODE_MIDPATH_EOFT_END_SEQ_RESET,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) FCOE_ERROR_CODE_MIDPATH_REPLY_FCTL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) FCOE_ERROR_CODE_MIDPATH_INVALID_REPLY,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) FCOE_ERROR_CODE_MIDPATH_ELS_REPLY_RCTL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) FCOE_ERROR_CODE_COMMON_MIDDLE_FRAME_WITH_PAD /* Common error codes */,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) FCOE_ERROR_CODE_COMMON_SEQ_INIT_IN_TCE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) FCOE_ERROR_CODE_COMMON_FC_HDR_RX_ID_MISMATCH,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) FCOE_ERROR_CODE_COMMON_INCORRECT_SEQ_CNT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) FCOE_ERROR_CODE_COMMON_DATA_FC_HDR_FCP_TYPE_MISMATCH,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) FCOE_ERROR_CODE_COMMON_DATA_NO_MORE_SGES,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) FCOE_ERROR_CODE_COMMON_OPTIONAL_FC_HDR,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) FCOE_ERROR_CODE_COMMON_READ_TCE_OX_ID_TOO_BIG,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) FCOE_ERROR_CODE_COMMON_DATA_WAS_NOT_TRANSMITTED,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) FCOE_ERROR_CODE_COMMON_TASK_DDF_RCTL_INFO_FIELD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) FCOE_ERROR_CODE_COMMON_TASK_INVALID_RCTL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) FCOE_ERROR_CODE_COMMON_TASK_RCTL_GENERAL_MISMATCH,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) FCOE_ERROR_CODE_E_D_TOV_TIMER_EXPIRATION /* Timer error codes */,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) FCOE_WARNING_CODE_REC_TOV_TIMER_EXPIRATION /* Timer error codes */,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) FCOE_ERROR_CODE_RR_TOV_TIMER_EXPIRATION /* Timer error codes */,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) /* ABTSrsp pckt arrived unexpected */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) FCOE_ERROR_CODE_ABTS_REPLY_UNEXPECTED,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) FCOE_ERROR_CODE_TARGET_MODE_FCP_RSP,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) FCOE_ERROR_CODE_TARGET_MODE_FCP_XFER,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) FCOE_ERROR_CODE_TARGET_MODE_DATA_TASK_TYPE_NOT_WRITE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) FCOE_ERROR_CODE_DATA_FCTL_TARGET,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) FCOE_ERROR_CODE_TARGET_DATA_SIZE_NO_MATCH_XFER,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) FCOE_ERROR_CODE_TARGET_DIF_CRC_CHECKSUM_ERROR,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) FCOE_ERROR_CODE_TARGET_DIF_REF_TAG_ERROR,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) FCOE_ERROR_CODE_TARGET_DIF_APP_TAG_ERROR,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) MAX_FCOE_FP_ERROR_WARNING_CODE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) * FCoE RESPQ element
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) struct fcoe_respqe {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) __le16 ox_id /* OX_ID that is located in the FCP_RSP FC header */;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) __le16 rx_id /* RX_ID that is located in the FCP_RSP FC header */;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) __le32 additional_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) /* PARAM that is located in the FCP_RSP FC header */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) #define FCOE_RESPQE_PARAM_MASK 0xFFFFFF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) #define FCOE_RESPQE_PARAM_SHIFT 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) /* Indication whther its Target-auto-rsp mode or not */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) #define FCOE_RESPQE_TARGET_AUTO_RSP_MASK 0xFF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) #define FCOE_RESPQE_TARGET_AUTO_RSP_SHIFT 24
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) * FCoE slow path error codes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) enum fcoe_sp_error_code {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) /* Error codes for Error Reporting in slow path flows */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) FCOE_ERROR_CODE_SLOW_PATH_TOO_MANY_FUNCS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) FCOE_ERROR_SLOW_PATH_CODE_NO_LICENSE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) MAX_FCOE_SP_ERROR_CODE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) * FCoE task TX state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) enum fcoe_task_tx_state {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) /* Initiate state after driver has initialized the task */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) FCOE_TASK_TX_STATE_NORMAL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) /* Updated by TX path after complete transmitting unsolicited packet */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) FCOE_TASK_TX_STATE_UNSOLICITED_COMPLETED,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) * Updated by TX path after start processing the task requesting the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) * cleanup/abort operation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) FCOE_TASK_TX_STATE_CLEAN_REQ,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) FCOE_TASK_TX_STATE_ABTS /* Updated by TX path during abort procedure */,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) /* Updated by TX path during exchange cleanup procedure */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) FCOE_TASK_TX_STATE_EXCLEANUP,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) * Updated by TX path during exchange cleanup continuation task
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) * procedure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) FCOE_TASK_TX_STATE_EXCLEANUP_TARGET_WRITE_CONT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) /* Updated by TX path during exchange cleanup first xfer procedure */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) FCOE_TASK_TX_STATE_EXCLEANUP_TARGET_WRITE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) /* Updated by TX path during exchange cleanup read task in Target */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) FCOE_TASK_TX_STATE_EXCLEANUP_TARGET_READ_OR_RSP,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) /* Updated by TX path during target exchange cleanup procedure */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) FCOE_TASK_TX_STATE_EXCLEANUP_TARGET_WRITE_LAST_CYCLE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) /* Updated by TX path during sequence recovery procedure */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) FCOE_TASK_TX_STATE_SEQRECOVERY,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) MAX_FCOE_TASK_TX_STATE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) #endif /* __QEDF_HSI__ */