/* * Header status codes from firmware
*/ enum snic_io_status {
SNIC_STAT_IO_SUCCESS = 0, /* request was successful */
/* * If a request to the fw is rejected, the original request header * will be returned with the status set to one of the following:
*/
SNIC_STAT_INVALID_HDR, /* header contains invalid data */
SNIC_STAT_OUT_OF_RES, /* out of resources to complete request */
SNIC_STAT_INVALID_PARM, /* some parameter in request is not valid */
SNIC_STAT_REQ_NOT_SUP, /* req type is not supported */
SNIC_STAT_IO_NOT_FOUND, /* requested IO was not found */
/* * Once a request is processed, the fw will usually return * a cmpl message type. In cases where errors occurred, * the header status would be filled in with one of the following:
*/
SNIC_STAT_ABORTED, /* req was aborted */
SNIC_STAT_TIMEOUT, /* req was timed out */
SNIC_STAT_SGL_INVALID, /* req was aborted due to sgl error */
SNIC_STAT_DATA_CNT_MISMATCH, /*recv/sent more/less data than expec */
SNIC_STAT_FW_ERR, /* req was terminated due to fw error */
SNIC_STAT_ITMF_REJECT, /* itmf req was rejected by target */
SNIC_STAT_ITMF_FAIL, /* itmf req was failed */
SNIC_STAT_ITMF_INCORRECT_LUN, /* itmf req has incorrect LUN id*/
SNIC_STAT_CMND_REJECT, /* req was invalid and rejected */
SNIC_STAT_DEV_OFFLINE, /* req sent to offline device */
SNIC_STAT_NO_BOOTLUN,
SNIC_STAT_SCSI_ERR, /* SCSI error returned by Target. */
SNIC_STAT_NOT_READY, /* sNIC Subsystem is not ready */
SNIC_STAT_FATAL_ERROR, /* sNIC is in unrecoverable state */
}; /* end of enum snic_io_status */
/* * snic_io_hdr : host <--> firmware * * for any other message that will be queued to firmware should * have the following request header
*/ struct snic_io_hdr {
__le32 hid;
__le32 cmnd_id; /* tag here */
ulong init_ctx; /* initiator context */
u8 type; /* request/response type */
u8 status; /* header status entry */
u8 protocol; /* Protocol specific, may needed for RoCE*/
u8 flags;
__le16 sg_cnt;
u16 resvd;
};
/* * snic_host_info: host -> firmware * * Used for sending host information to firmware, and request fw version
*/ struct snic_exch_ver_req {
__le32 drvr_ver; /* for debugging, when fw dump captured */
__le32 os_type; /* for OS specific features */
};
/* * os_type flags * Bit 0-7 : OS information * Bit 8-31: Feature/Capability Information
*/ #define SNIC_OS_LINUX 0x1 #define SNIC_OS_WIN 0x2 #define SNIC_OS_ESX 0x3
/* * HBA Capabilities * Bit 1: Reserved. * Bit 2: Dynamic Discovery of LUNs. * Bit 3: Async event notifications on tgt online/offline events. * Bit 4: IO timeout support in FW. * Bit 5-31: Reserved.
*/ #define SNIC_HBA_CAP_DDL 0x02 /* Supports Dynamic Discovery of LUNs */ #define SNIC_HBA_CAP_AEN 0x04 /* Supports Async Event Noitifcation */ #define SNIC_HBA_CAP_TMO 0x08 /* Supports IO timeout in FW */
/* * snic_exch_ver_rsp : firmware -> host * * Used by firmware to send response to version request
*/ struct snic_exch_ver_rsp {
__le32 version;
__le32 hid;
__le32 max_concur_ios; /* max concurrent ios */
__le32 max_sgs_per_cmd; /* max sgls per IO */
__le32 max_io_sz; /* max io size supported */
__le32 hba_cap; /* hba capabilities */
__le32 max_tgts; /* max tgts supported */
__le16 io_timeout; /* FW extended timeout */
u16 rsvd;
};
/* * snic_report_tgts : host -> firmware request * * Used by the host to request list of targets
*/ struct snic_report_tgts {
__le16 sg_cnt;
__le16 flags; /* specific flags from fw */
u8 _resvd[4];
__le64 sg_addr; /* Points to SGL */
__le64 sense_addr;
};
#define SNIC_ICMND_PRI_SHIFT 5 /* prio val starts at bit 5 */
/* * snic_icmnd : host-> firmware request * * used for sending out an initiator SCSI 16/32-byte command
*/ struct snic_icmnd {
__le16 sg_cnt; /* Number of SG Elements */
__le16 flags; /* flags */
__le32 sense_len; /* Sense buffer length */
__le64 tgt_id; /* Destination Target ID */
__le64 lun_id; /* Destination LUN ID */
u8 cdb_len;
u8 _resvd;
__le16 time_out; /* ms time for Res allocations fw to handle io*/
__le32 data_len; /* Total number of bytes to be transferred */
u8 cdb[SNIC_CDB_LEN];
__le64 sg_addr; /* Points to SG List */
__le64 sense_addr; /* Sense buffer address */
};
/* Response flags */ /* Bit 0: Under run * Bit 1: Over Run * Bit 2-7: Reserved
*/ #define SNIC_ICMND_CMPL_UNDR_RUN 0x01 /* resid under and valid */ #define SNIC_ICMND_CMPL_OVER_RUN 0x02 /* resid over and valid */
/* * snic_icmnd_cmpl: firmware -> host response * * Used for sending the host a response to an icmnd (initiator command)
*/ struct snic_icmnd_cmpl {
u8 scsi_status; /* value as per SAM */
u8 flags;
__le16 sense_len; /* Sense Length */
__le32 resid; /* Residue : # bytes under or over run */
};
/* * snic_itmf: host->firmware request * * used for requesting the firmware to abort a request and/or send out * a task management function * * the req_id field is valid in case of abort task and clear task
*/ struct snic_itmf {
u8 tm_type; /* SCSI Task Management request */
u8 resvd;
__le16 flags; /* flags */
__le32 req_id; /* Command id of snic req to be aborted */
__le64 tgt_id; /* Target ID */
__le64 lun_id; /* Destination LUN ID */
__le16 timeout; /* in sec */
};
/* * snic_itmf_cmpl: firmware -> host resposne * * used for sending the host a response for a itmf request
*/ struct snic_itmf_cmpl {
__le32 nterminated; /* # IOs terminated as a result of tmf */
u8 flags; /* flags */
u8 _resvd[3];
};
/* * itmfl_cmpl flags * Bit 0 : 1 - Num terminated field valid * Bit 1 - 7 : Reserved
*/ #define SNIC_NUM_TERM_VALID 0x01 /* Number of IOs terminated */
/* * snic_hba_reset: host -> firmware request * * used for requesting firmware to reset snic
*/ struct snic_hba_reset {
__le16 flags; /* flags */
u8 _resvd[6];
};
/* * snic_hba_reset_cmpl: firmware -> host response * * Used by firmware to respond to the host's hba reset request
*/ struct snic_hba_reset_cmpl {
u8 flags; /* flags : more info needs to be added*/
u8 _resvd[7];
};
/* * snic_notify_msg: firmware -> host response * * Used by firmware to notify host of the last work queue entry received
*/ struct snic_notify_msg {
__le32 wqe_num; /* wq entry number */
u8 flags; /* flags, macros */
u8 _resvd[4];
};
#define SNIC_EVDATA_LEN 24 /* in bytes */ /* snic_async_evnotify: firmware -> host notification * * Used by firmware to notify the host about configuration/state changes
*/ struct snic_async_evnotify {
u8 FLS_EVENT_DESC;
u8 vnic; /* vnic id */
u8 _resvd[2];
__le32 ev_id; /* Event ID */
u8 ev_data[SNIC_EVDATA_LEN]; /* Event Data */
u8 _resvd2[4];
};
/* * snic_host_req: host -> firmware request * * Basic structure for all snic requests that are sent from the host to * firmware. They are 128 bytes in size.
*/ struct snic_host_req {
u64 ctrl_data[2]; /*16 bytes - Control Data */ struct snic_io_hdr hdr; union { /* * Entry specific space, last byte contains color
*/
u8 buf[SNIC_HOST_REQ_PAYLOAD];
/* * Exchange firmware version
*/ struct snic_exch_ver_req exch_ver;
/* * Auxillary macro to verify specific snic req/cmpl structures * to ensure that it will be aligned to 64 bit, and not using * color bit field
*/ #define VERIFY_REQ_SZ(x) #define VERIFY_CMPL_SZ(x)
/* * Access routines to encode and decode the color bit, which is the most * significant bit of the structure.
*/ staticinlinevoid
snic_color_enc(struct snic_fw_req *req, u8 color)
{
u8 *c = ((u8 *) req) + sizeof(struct snic_fw_req) - 1;
/* Make sure color bit is read from desc *before* other fields * are read from desc. Hardware guarantees color bit is last * bit (byte) written. Adding the rmb() prevents the compiler * and/or CPU from reordering the reads which would potentially * result in reading stale values.
*/
rmb();
} #endif/* end of __SNIC_FWINT_H */
Messung V0.5
¤ Dauer der Verarbeitung: 0.24 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.