linux/drivers/message/fusion/lsi/mpi_init.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 *  Copyright (c) 2000-2008 LSI Corporation.
 *
 *
 *           Name:  mpi_init.h
 *          Title:  MPI initiator mode messages and structures
 *  Creation Date:  June 8, 2000
 *
 *    mpi_init.h Version:  01.05.09
 *
 *  Version History
 *  ---------------
 *
 *  Date      Version   Description
 *  --------  --------  ------------------------------------------------------
 *  05-08-00  00.10.01  Original release for 0.10 spec dated 4/26/2000.
 *  05-24-00  00.10.02  Added SenseBufferLength to _MSG_SCSI_IO_REPLY.
 *  06-06-00  01.00.01  Update version number for 1.0 release.
 *  06-08-00  01.00.02  Added MPI_SCSI_RSP_INFO_ definitions.
 *  11-02-00  01.01.01  Original release for post 1.0 work.
 *  12-04-00  01.01.02  Added MPI_SCSIIO_CONTROL_NO_DISCONNECT.
 *  02-20-01  01.01.03  Started using MPI_POINTER.
 *  03-27-01  01.01.04  Added structure offset comments.
 *  04-10-01  01.01.05  Added new MsgFlag for MSG_SCSI_TASK_MGMT.
 *  08-08-01  01.02.01  Original release for v1.2 work.
 *  08-29-01  01.02.02  Added MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET.
 *                      Added MPI_SCSI_STATE_QUEUE_TAG_REJECTED for
 *                      MSG_SCSI_IO_REPLY.
 *  09-28-01  01.02.03  Added structures and defines for SCSI Enclosure
 *                      Processor messages.
 *  10-04-01  01.02.04  Added defines for SEP request Action field.
 *  05-31-02  01.02.05  Added MPI_SCSIIO_MSGFLGS_CMD_DETERMINES_DATA_DIR define
 *                      for SCSI IO requests.
 *  11-15-02  01.02.06  Added special extended SCSI Status defines for FCP.
 *  06-26-03  01.02.07  Added MPI_SCSI_STATUS_FCPEXT_UNASSIGNED define.
 *  05-11-04  01.03.01  Original release for MPI v1.3.
 *  08-19-04  01.05.01  Added MsgFlags defines for EEDP to SCSI IO request.
 *                      Added new word to MSG_SCSI_IO_REPLY to add TaskTag field
 *                      and a reserved U16.
 *                      Added new MSG_SCSI_IO32_REQUEST structure.
 *                      Added a TaskType of Clear Task Set to SCSI
 *                      Task Management request.
 *  12-07-04  01.05.02  Added support for Task Management Query Task.
 *  01-15-05  01.05.03  Modified SCSI Enclosure Processor Request to support
 *                      WWID addressing.
 *  03-11-05  01.05.04  Removed EEDP flags from SCSI IO Request.
 *                      Removed SCSI IO 32 Request.
 *                      Modified SCSI Enclosure Processor Request and Reply to
 *                      support Enclosure/Slot addressing rather than WWID
 *                      addressing.
 *  06-24-05  01.05.05  Added SCSI IO 32 structures and defines.
 *                      Added four new defines for SEP SlotStatus.
 *  08-03-05  01.05.06  Fixed some MPI_SCSIIO32_MSGFLGS_ defines to make them
 *                      unique in the first 32 characters.
 *  03-27-06  01.05.07  Added Task Management type of Clear ACA.
 *  10-11-06  01.05.08  Shortened define for Task Management type of Clear ACA.
 *  02-28-07  01.05.09  Defined two new MsgFlags bits for SCSI Task Management
 *                      Request: Do Not Send Task IU and Soft Reset Option.
 *  --------------------------------------------------------------------------
 */

#ifndef MPI_INIT_H
#define MPI_INIT_H


/*****************************************************************************
*
*               S C S I    I n i t i a t o r    M e s s a g e s
*
*****************************************************************************/

/****************************************************************************/
/*  SCSI IO messages and associated structures                              */
/****************************************************************************/

pSCSIIORequest_t;


/* SCSI IO MsgFlags bits */

#define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH
#define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_32
#define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_64

#define MPI_SCSIIO_MSGFLGS_SENSE_LOCATION
#define MPI_SCSIIO_MSGFLGS_SENSE_LOC_HOST
#define MPI_SCSIIO_MSGFLGS_SENSE_LOC_IOC

#define MPI_SCSIIO_MSGFLGS_CMD_DETERMINES_DATA_DIR

/* SCSI IO LUN fields */

#define MPI_SCSIIO_LUN_FIRST_LEVEL_ADDRESSING
#define MPI_SCSIIO_LUN_SECOND_LEVEL_ADDRESSING
#define MPI_SCSIIO_LUN_THIRD_LEVEL_ADDRESSING
#define MPI_SCSIIO_LUN_FOURTH_LEVEL_ADDRESSING
#define MPI_SCSIIO_LUN_LEVEL_1_WORD
#define MPI_SCSIIO_LUN_LEVEL_1_DWORD

/* SCSI IO Control bits */

#define MPI_SCSIIO_CONTROL_DATADIRECTION_MASK
#define MPI_SCSIIO_CONTROL_NODATATRANSFER
#define MPI_SCSIIO_CONTROL_WRITE
#define MPI_SCSIIO_CONTROL_READ

#define MPI_SCSIIO_CONTROL_ADDCDBLEN_MASK
#define MPI_SCSIIO_CONTROL_ADDCDBLEN_SHIFT

#define MPI_SCSIIO_CONTROL_TASKATTRIBUTE_MASK
#define MPI_SCSIIO_CONTROL_SIMPLEQ
#define MPI_SCSIIO_CONTROL_HEADOFQ
#define MPI_SCSIIO_CONTROL_ORDEREDQ
#define MPI_SCSIIO_CONTROL_ACAQ
#define MPI_SCSIIO_CONTROL_UNTAGGED
#define MPI_SCSIIO_CONTROL_NO_DISCONNECT

#define MPI_SCSIIO_CONTROL_TASKMANAGE_MASK
#define MPI_SCSIIO_CONTROL_OBSOLETE
#define MPI_SCSIIO_CONTROL_CLEAR_ACA_RSV
#define MPI_SCSIIO_CONTROL_TARGET_RESET
#define MPI_SCSIIO_CONTROL_LUN_RESET_RSV
#define MPI_SCSIIO_CONTROL_RESERVED
#define MPI_SCSIIO_CONTROL_CLR_TASK_SET_RSV
#define MPI_SCSIIO_CONTROL_ABORT_TASK_SET
#define MPI_SCSIIO_CONTROL_RESERVED2


/* SCSI IO reply structure */
pSCSIIOReply_t;


/* SCSI IO Reply SCSIStatus values (SAM-2 status codes) */

#define MPI_SCSI_STATUS_SUCCESS
#define MPI_SCSI_STATUS_CHECK_CONDITION
#define MPI_SCSI_STATUS_CONDITION_MET
#define MPI_SCSI_STATUS_BUSY
#define MPI_SCSI_STATUS_INTERMEDIATE
#define MPI_SCSI_STATUS_INTERMEDIATE_CONDMET
#define MPI_SCSI_STATUS_RESERVATION_CONFLICT
#define MPI_SCSI_STATUS_COMMAND_TERMINATED
#define MPI_SCSI_STATUS_TASK_SET_FULL
#define MPI_SCSI_STATUS_ACA_ACTIVE

#define MPI_SCSI_STATUS_FCPEXT_DEVICE_LOGGED_OUT
#define MPI_SCSI_STATUS_FCPEXT_NO_LINK
#define MPI_SCSI_STATUS_FCPEXT_UNASSIGNED


/* SCSI IO Reply SCSIState values */

#define MPI_SCSI_STATE_AUTOSENSE_VALID
#define MPI_SCSI_STATE_AUTOSENSE_FAILED
#define MPI_SCSI_STATE_NO_SCSI_STATUS
#define MPI_SCSI_STATE_TERMINATED
#define MPI_SCSI_STATE_RESPONSE_INFO_VALID
#define MPI_SCSI_STATE_QUEUE_TAG_REJECTED

/* SCSI IO Reply ResponseInfo values */
/* (FCP-1 RSP_CODE values and SPI-3 Packetized Failure codes) */

#define MPI_SCSI_RSP_INFO_FUNCTION_COMPLETE
#define MPI_SCSI_RSP_INFO_FCP_BURST_LEN_ERROR
#define MPI_SCSI_RSP_INFO_CMND_FIELDS_INVALID
#define MPI_SCSI_RSP_INFO_FCP_DATA_RO_ERROR
#define MPI_SCSI_RSP_INFO_TASK_MGMT_UNSUPPORTED
#define MPI_SCSI_RSP_INFO_TASK_MGMT_FAILED
#define MPI_SCSI_RSP_INFO_SPI_LQ_INVALID_TYPE

#define MPI_SCSI_TASKTAG_UNKNOWN


/****************************************************************************/
/*  SCSI IO 32 messages and associated structures                           */
/****************************************************************************/

pMpiScsiIo32CdbEedp32_t;

pMpiScsiIo32CdbEedp16_t;

pMpiScsiIo32Cdb_t;

pMpiScsiIo32BusTargetIdForm_t;

pMpiScsiIo32Address_t;

pSCSIIO32Request_t;

/* SCSI IO 32 MsgFlags bits */
#define MPI_SCSIIO32_MSGFLGS_SENSE_WIDTH
#define MPI_SCSIIO32_MSGFLGS_32_SENSE_WIDTH
#define MPI_SCSIIO32_MSGFLGS_64_SENSE_WIDTH

#define MPI_SCSIIO32_MSGFLGS_SENSE_LOCATION
#define MPI_SCSIIO32_MSGFLGS_SENSE_LOC_HOST
#define MPI_SCSIIO32_MSGFLGS_SENSE_LOC_IOC

#define MPI_SCSIIO32_MSGFLGS_CMD_DETERMINES_DATA_DIR
#define MPI_SCSIIO32_MSGFLGS_SGL_OFFSETS_CHAINS
#define MPI_SCSIIO32_MSGFLGS_MULTICAST
#define MPI_SCSIIO32_MSGFLGS_BIDIRECTIONAL
#define MPI_SCSIIO32_MSGFLGS_LARGE_CDB

/* SCSI IO 32 Flags bits */
#define MPI_SCSIIO32_FLAGS_FORM_MASK
#define MPI_SCSIIO32_FLAGS_FORM_SCSIID
#define MPI_SCSIIO32_FLAGS_FORM_WWID

/* SCSI IO 32 LUN fields */
#define MPI_SCSIIO32_LUN_FIRST_LEVEL_ADDRESSING
#define MPI_SCSIIO32_LUN_SECOND_LEVEL_ADDRESSING
#define MPI_SCSIIO32_LUN_THIRD_LEVEL_ADDRESSING
#define MPI_SCSIIO32_LUN_FOURTH_LEVEL_ADDRESSING
#define MPI_SCSIIO32_LUN_LEVEL_1_WORD
#define MPI_SCSIIO32_LUN_LEVEL_1_DWORD

/* SCSI IO 32 Control bits */
#define MPI_SCSIIO32_CONTROL_DATADIRECTION_MASK
#define MPI_SCSIIO32_CONTROL_NODATATRANSFER
#define MPI_SCSIIO32_CONTROL_WRITE
#define MPI_SCSIIO32_CONTROL_READ
#define MPI_SCSIIO32_CONTROL_BIDIRECTIONAL

#define MPI_SCSIIO32_CONTROL_ADDCDBLEN_MASK
#define MPI_SCSIIO32_CONTROL_ADDCDBLEN_SHIFT

#define MPI_SCSIIO32_CONTROL_TASKATTRIBUTE_MASK
#define MPI_SCSIIO32_CONTROL_SIMPLEQ
#define MPI_SCSIIO32_CONTROL_HEADOFQ
#define MPI_SCSIIO32_CONTROL_ORDEREDQ
#define MPI_SCSIIO32_CONTROL_ACAQ
#define MPI_SCSIIO32_CONTROL_UNTAGGED
#define MPI_SCSIIO32_CONTROL_NO_DISCONNECT

#define MPI_SCSIIO32_CONTROL_TASKMANAGE_MASK
#define MPI_SCSIIO32_CONTROL_OBSOLETE
#define MPI_SCSIIO32_CONTROL_CLEAR_ACA_RSV
#define MPI_SCSIIO32_CONTROL_TARGET_RESET
#define MPI_SCSIIO32_CONTROL_LUN_RESET_RSV
#define MPI_SCSIIO32_CONTROL_RESERVED
#define MPI_SCSIIO32_CONTROL_CLR_TASK_SET_RSV
#define MPI_SCSIIO32_CONTROL_ABORT_TASK_SET
#define MPI_SCSIIO32_CONTROL_RESERVED2

/* SCSI IO 32 EEDPFlags */
#define MPI_SCSIIO32_EEDPFLAGS_MASK_OP
#define MPI_SCSIIO32_EEDPFLAGS_NOOP_OP
#define MPI_SCSIIO32_EEDPFLAGS_CHK_OP
#define MPI_SCSIIO32_EEDPFLAGS_STRIP_OP
#define MPI_SCSIIO32_EEDPFLAGS_CHKRM_OP
#define MPI_SCSIIO32_EEDPFLAGS_INSERT_OP
#define MPI_SCSIIO32_EEDPFLAGS_REPLACE_OP
#define MPI_SCSIIO32_EEDPFLAGS_CHKREGEN_OP

#define MPI_SCSIIO32_EEDPFLAGS_PASS_REF_TAG
#define MPI_SCSIIO32_EEDPFLAGS_8_9THS_MODE

#define MPI_SCSIIO32_EEDPFLAGS_T10_CHK_MASK
#define MPI_SCSIIO32_EEDPFLAGS_T10_CHK_GUARD
#define MPI_SCSIIO32_EEDPFLAGS_T10_CHK_REFTAG
#define MPI_SCSIIO32_EEDPFLAGS_T10_CHK_LBATAG
#define MPI_SCSIIO32_EEDPFLAGS_T10_CHK_SHIFT

#define MPI_SCSIIO32_EEDPFLAGS_INC_SEC_APPTAG
#define MPI_SCSIIO32_EEDPFLAGS_INC_PRI_APPTAG
#define MPI_SCSIIO32_EEDPFLAGS_INC_SEC_REFTAG
#define MPI_SCSIIO32_EEDPFLAGS_INC_PRI_REFTAG


/* SCSIIO32 IO reply structure */
pSCSIIO32Reply_t;


/****************************************************************************/
/*  SCSI Task Management messages                                           */
/****************************************************************************/

pSCSITaskMgmt_t;

/* TaskType values */

#define MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK
#define MPI_SCSITASKMGMT_TASKTYPE_ABRT_TASK_SET
#define MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET
#define MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS
#define MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET
#define MPI_SCSITASKMGMT_TASKTYPE_CLEAR_TASK_SET
#define MPI_SCSITASKMGMT_TASKTYPE_QUERY_TASK
#define MPI_SCSITASKMGMT_TASKTYPE_CLR_ACA

/* MsgFlags bits */
#define MPI_SCSITASKMGMT_MSGFLAGS_DO_NOT_SEND_TASK_IU

#define MPI_SCSITASKMGMT_MSGFLAGS_TARGET_RESET_OPTION
#define MPI_SCSITASKMGMT_MSGFLAGS_LIP_RESET_OPTION
#define MPI_SCSITASKMGMT_MSGFLAGS_LIPRESET_RESET_OPTION

#define MPI_SCSITASKMGMT_MSGFLAGS_SOFT_RESET_OPTION

/* SCSI Task Management Reply */
pSCSITaskMgmtReply_t;

/* ResponseCode values */
#define MPI_SCSITASKMGMT_RSP_TM_COMPLETE
#define MPI_SCSITASKMGMT_RSP_INVALID_FRAME
#define MPI_SCSITASKMGMT_RSP_TM_NOT_SUPPORTED
#define MPI_SCSITASKMGMT_RSP_TM_FAILED
#define MPI_SCSITASKMGMT_RSP_TM_SUCCEEDED
#define MPI_SCSITASKMGMT_RSP_TM_INVALID_LUN
#define MPI_SCSITASKMGMT_RSP_IO_QUEUED_ON_IOC


/****************************************************************************/
/*  SCSI Enclosure Processor messages                                       */
/****************************************************************************/

pSEPRequest_t;

/* Action defines */
#define MPI_SEP_REQ_ACTION_WRITE_STATUS
#define MPI_SEP_REQ_ACTION_READ_STATUS

/* Flags defines */
#define MPI_SEP_REQ_FLAGS_ENCLOSURE_SLOT_ADDRESS
#define MPI_SEP_REQ_FLAGS_BUS_TARGETID_ADDRESS

/* SlotStatus bits for MSG_SEP_REQUEST */
#define MPI_SEP_REQ_SLOTSTATUS_NO_ERROR
#define MPI_SEP_REQ_SLOTSTATUS_DEV_FAULTY
#define MPI_SEP_REQ_SLOTSTATUS_DEV_REBUILDING
#define MPI_SEP_REQ_SLOTSTATUS_IN_FAILED_ARRAY
#define MPI_SEP_REQ_SLOTSTATUS_IN_CRITICAL_ARRAY
#define MPI_SEP_REQ_SLOTSTATUS_PARITY_CHECK
#define MPI_SEP_REQ_SLOTSTATUS_PREDICTED_FAULT
#define MPI_SEP_REQ_SLOTSTATUS_UNCONFIGURED
#define MPI_SEP_REQ_SLOTSTATUS_HOT_SPARE
#define MPI_SEP_REQ_SLOTSTATUS_REBUILD_STOPPED
#define MPI_SEP_REQ_SLOTSTATUS_REQ_CONSISTENCY_CHECK
#define MPI_SEP_REQ_SLOTSTATUS_DISABLE
#define MPI_SEP_REQ_SLOTSTATUS_REQ_RESERVED_DEVICE
#define MPI_SEP_REQ_SLOTSTATUS_IDENTIFY_REQUEST
#define MPI_SEP_REQ_SLOTSTATUS_REQUEST_REMOVE
#define MPI_SEP_REQ_SLOTSTATUS_REQUEST_INSERT
#define MPI_SEP_REQ_SLOTSTATUS_DO_NOT_MOVE
#define MPI_SEP_REQ_SLOTSTATUS_ACTIVE
#define MPI_SEP_REQ_SLOTSTATUS_B_ENABLE_BYPASS
#define MPI_SEP_REQ_SLOTSTATUS_A_ENABLE_BYPASS
#define MPI_SEP_REQ_SLOTSTATUS_DEV_OFF
#define MPI_SEP_REQ_SLOTSTATUS_SWAP_RESET


pSEPReply_t;

/* SlotStatus bits for MSG_SEP_REPLY */
#define MPI_SEP_REPLY_SLOTSTATUS_NO_ERROR
#define MPI_SEP_REPLY_SLOTSTATUS_DEV_FAULTY
#define MPI_SEP_REPLY_SLOTSTATUS_DEV_REBUILDING
#define MPI_SEP_REPLY_SLOTSTATUS_IN_FAILED_ARRAY
#define MPI_SEP_REPLY_SLOTSTATUS_IN_CRITICAL_ARRAY
#define MPI_SEP_REPLY_SLOTSTATUS_PARITY_CHECK
#define MPI_SEP_REPLY_SLOTSTATUS_PREDICTED_FAULT
#define MPI_SEP_REPLY_SLOTSTATUS_UNCONFIGURED
#define MPI_SEP_REPLY_SLOTSTATUS_HOT_SPARE
#define MPI_SEP_REPLY_SLOTSTATUS_REBUILD_STOPPED
#define MPI_SEP_REPLY_SLOTSTATUS_CONSISTENCY_CHECK
#define MPI_SEP_REPLY_SLOTSTATUS_DISABLE
#define MPI_SEP_REPLY_SLOTSTATUS_RESERVED_DEVICE
#define MPI_SEP_REPLY_SLOTSTATUS_REPORT
#define MPI_SEP_REPLY_SLOTSTATUS_IDENTIFY_REQUEST
#define MPI_SEP_REPLY_SLOTSTATUS_REMOVE_READY
#define MPI_SEP_REPLY_SLOTSTATUS_INSERT_READY
#define MPI_SEP_REPLY_SLOTSTATUS_DO_NOT_REMOVE
#define MPI_SEP_REPLY_SLOTSTATUS_ACTIVE
#define MPI_SEP_REPLY_SLOTSTATUS_B_BYPASS_ENABLED
#define MPI_SEP_REPLY_SLOTSTATUS_A_BYPASS_ENABLED
#define MPI_SEP_REPLY_SLOTSTATUS_B_ENABLE_BYPASS
#define MPI_SEP_REPLY_SLOTSTATUS_A_ENABLE_BYPASS
#define MPI_SEP_REPLY_SLOTSTATUS_DEV_OFF
#define MPI_SEP_REPLY_SLOTSTATUS_FAULT_SENSED
#define MPI_SEP_REPLY_SLOTSTATUS_SWAPPED

#endif