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

/* SPDX-License-Identifier: GPL-2.0 */
/*
 *  Copyright (c) 2000-2008 LSI Corporation.
 *
 *
 *           Name:  mpi_targ.h
 *          Title:  MPI Target mode messages and structures
 *  Creation Date:  June 22, 2000
 *
 *    mpi_targ.h Version:  01.05.06
 *
 *  Version History
 *  ---------------
 *
 *  Date      Version   Description
 *  --------  --------  ------------------------------------------------------
 *  05-08-00  00.10.01  Original release for 0.10 spec dated 4/26/2000.
 *  06-06-00  01.00.01  Update version number for 1.0 release.
 *  06-22-00  01.00.02  Added _MSG_TARGET_CMD_BUFFER_POST_REPLY structure.
 *                      Corrected DECSRIPTOR typo to DESCRIPTOR.
 *  11-02-00  01.01.01  Original release for post 1.0 work
 *                      Modified target mode to use IoIndex instead of
 *                      HostIndex and IocIndex. Added Alias.
 *  01-09-01  01.01.02  Added defines for TARGET_ASSIST_FLAGS_REPOST_CMD_BUFFER
 *                      and TARGET_STATUS_SEND_FLAGS_REPOST_CMD_BUFFER.
 *  02-20-01  01.01.03  Started using MPI_POINTER.
 *                      Added structures for MPI_TARGET_SCSI_SPI_CMD_BUFFER and
 *                      MPI_TARGET_FCP_CMD_BUFFER.
 *  03-27-01  01.01.04  Added structure offset comments.
 *  08-08-01  01.02.01  Original release for v1.2 work.
 *  09-28-01  01.02.02  Added structure for MPI_TARGET_SCSI_SPI_STATUS_IU.
 *                      Added PriorityReason field to some replies and
 *                      defined more PriorityReason codes.
 *                      Added some defines for to support previous version
 *                      of MPI.
 *  10-04-01  01.02.03  Added PriorityReason to MSG_TARGET_ERROR_REPLY.
 *  11-01-01  01.02.04  Added define for TARGET_STATUS_SEND_FLAGS_HIGH_PRIORITY.
 *  03-14-02  01.02.05  Modified MPI_TARGET_FCP_RSP_BUFFER to get the proper
 *                      byte ordering.
 *  05-31-02  01.02.06  Modified TARGET_MODE_REPLY_ALIAS_MASK to only include
 *                      one bit.
 *                      Added AliasIndex field to MPI_TARGET_FCP_CMD_BUFFER.
 *  09-16-02  01.02.07  Added flags for confirmed completion.
 *                      Added PRIORITY_REASON_TARGET_BUSY.
 *  11-15-02  01.02.08  Added AliasID field to MPI_TARGET_SCSI_SPI_CMD_BUFFER.
 *  04-01-03  01.02.09  Added OptionalOxid field to MPI_TARGET_FCP_CMD_BUFFER.
 *  05-11-04  01.03.01  Original release for MPI v1.3.
 *  08-19-04  01.05.01  Added new request message structures for
 *                      MSG_TARGET_CMD_BUF_POST_BASE_REQUEST,
 *                      MSG_TARGET_CMD_BUF_POST_LIST_REQUEST, and
 *                      MSG_TARGET_ASSIST_EXT_REQUEST.
 *                      Added new structures for SAS SSP Command buffer, SSP
 *                      Task buffer, and SSP Status IU.
 *  10-05-04  01.05.02  MSG_TARGET_CMD_BUFFER_POST_BASE_LIST_REPLY added.
 *  02-22-05  01.05.03  Changed a comment.
 *  03-11-05  01.05.04  Removed TargetAssistExtended Request.
 *  06-24-05  01.05.05  Added TargetAssistExtended structures and defines.
 *  03-27-06  01.05.06  Added a comment.
 *  --------------------------------------------------------------------------
 */

#ifndef MPI_TARG_H
#define MPI_TARG_H


/******************************************************************************
*
*        S C S I    T a r g e t    M e s s a g e s
*
*******************************************************************************/

pCmdBufferDescriptor_t;


/****************************************************************************/
/* Target Command Buffer Post Request                                       */
/****************************************************************************/

pTargetCmdBufferPostRequest_t;

#define CMD_BUFFER_POST_FLAGS_PORT_MASK
#define CMD_BUFFER_POST_FLAGS_ADDR_MODE_MASK
#define CMD_BUFFER_POST_FLAGS_ADDR_MODE_32
#define CMD_BUFFER_POST_FLAGS_ADDR_MODE_64
#define CMD_BUFFER_POST_FLAGS_64_BIT_ADDR

#define CMD_BUFFER_POST_IO_INDEX_MASK
#define CMD_BUFFER_POST_IO_INDEX_MASK_0100


pTargetCmdBufferPostReply_t;

/* the following structure is obsolete as of MPI v1.2 */
pPriorityCommandReceivedReply_t;


pTargetCmdBufferPostErrorReply_t;

#define PRIORITY_REASON_NO_DISCONNECT
#define PRIORITY_REASON_SCSI_TASK_MANAGEMENT
#define PRIORITY_REASON_CMD_PARITY_ERR
#define PRIORITY_REASON_MSG_OUT_PARITY_ERR
#define PRIORITY_REASON_LQ_CRC_ERR
#define PRIORITY_REASON_CMD_CRC_ERR
#define PRIORITY_REASON_PROTOCOL_ERR
#define PRIORITY_REASON_DATA_OUT_PARITY_ERR
#define PRIORITY_REASON_DATA_OUT_CRC_ERR
#define PRIORITY_REASON_TARGET_BUSY
#define PRIORITY_REASON_UNKNOWN


/****************************************************************************/
/* Target Command Buffer Post Base Request                                  */
/****************************************************************************/

pTargetCmdBufferPostBaseRequest_t;

#define CMD_BUFFER_POST_BASE_FLAGS_AUTO_POST_ALL


pTargetCmdBufferPostBaseListReply_t;


/****************************************************************************/
/* Target Command Buffer Post List Request                                  */
/****************************************************************************/

pTargetCmdBufferPostListRequest_t;


/****************************************************************************/
/* Command Buffer Formats (with 16 byte CDB)                                */
/****************************************************************************/

pMpiTargetFcpCmdBuffer;


pMpiTargetScsiSpiCmdBuffer;


pMpiTargetSspCmdBuffer;

pMpiTargetSspTaskBuffer;


/****************************************************************************/
/* Target Assist Request                                                    */
/****************************************************************************/

pTargetAssistRequest_t;

#define TARGET_ASSIST_FLAGS_DATA_DIRECTION
#define TARGET_ASSIST_FLAGS_AUTO_STATUS
#define TARGET_ASSIST_FLAGS_HIGH_PRIORITY
#define TARGET_ASSIST_FLAGS_CONFIRMED
#define TARGET_ASSIST_FLAGS_REPOST_CMD_BUFFER

/* Standard Target Mode Reply message */
pTargetErrorReply_t;


/****************************************************************************/
/* Target Assist Extended Request                                           */
/****************************************************************************/

pTargetAssistExtRequest_t;

/* see the defines after MSG_TARGET_ASSIST_REQUEST for TargetAssistFlags */

/* defines for the MsgFlags field */
#define TARGET_ASSIST_EXT_MSGFLAGS_BIDIRECTIONAL
#define TARGET_ASSIST_EXT_MSGFLAGS_MULTICAST
#define TARGET_ASSIST_EXT_MSGFLAGS_SGL_OFFSET_CHAINS

/* defines for the EEDPFlags field */
#define TARGET_ASSIST_EXT_EEDP_MASK_OP
#define TARGET_ASSIST_EXT_EEDP_NOOP_OP
#define TARGET_ASSIST_EXT_EEDP_CHK_OP
#define TARGET_ASSIST_EXT_EEDP_STRIP_OP
#define TARGET_ASSIST_EXT_EEDP_CHKRM_OP
#define TARGET_ASSIST_EXT_EEDP_INSERT_OP
#define TARGET_ASSIST_EXT_EEDP_REPLACE_OP
#define TARGET_ASSIST_EXT_EEDP_CHKREGEN_OP

#define TARGET_ASSIST_EXT_EEDP_PASS_REF_TAG

#define TARGET_ASSIST_EXT_EEDP_T10_CHK_MASK
#define TARGET_ASSIST_EXT_EEDP_T10_CHK_GUARD
#define TARGET_ASSIST_EXT_EEDP_T10_CHK_APPTAG
#define TARGET_ASSIST_EXT_EEDP_T10_CHK_REFTAG
#define TARGET_ASSIST_EXT_EEDP_T10_CHK_SHIFT

#define TARGET_ASSIST_EXT_EEDP_INC_SEC_APPTAG
#define TARGET_ASSIST_EXT_EEDP_INC_PRI_APPTAG
#define TARGET_ASSIST_EXT_EEDP_INC_SEC_REFTAG
#define TARGET_ASSIST_EXT_EEDP_INC_PRI_REFTAG


/****************************************************************************/
/* Target Status Send Request                                               */
/****************************************************************************/

pTargetStatusSendRequest_t;

#define TARGET_STATUS_SEND_FLAGS_AUTO_GOOD_STATUS
#define TARGET_STATUS_SEND_FLAGS_HIGH_PRIORITY
#define TARGET_STATUS_SEND_FLAGS_CONFIRMED
#define TARGET_STATUS_SEND_FLAGS_REPOST_CMD_BUFFER

/*
 * NOTE: FCP_RSP data is big-endian. When used on a little-endian system, this
 * structure properly orders the bytes.
 */
pMpiTargetFcpRspBuffer;

/*
 * NOTE: The SPI status IU is big-endian. When used on a little-endian system,
 * this structure properly orders the bytes.
 */
pTargetScsiSpiStatusIU_t;

/*
 * NOTE: The SSP status IU is big-endian. When used on a little-endian system,
 * this structure properly orders the bytes.
 */
pMpiTargetSspRspIu_t;


/****************************************************************************/
/* Target Mode Abort Request                                                */
/****************************************************************************/

pTargetModeAbort_t;

#define TARGET_MODE_ABORT_TYPE_ALL_CMD_BUFFERS
#define TARGET_MODE_ABORT_TYPE_ALL_IO
#define TARGET_MODE_ABORT_TYPE_EXACT_IO
#define TARGET_MODE_ABORT_TYPE_EXACT_IO_REQUEST

/* Target Mode Abort Reply */

pTargetModeAbortReply_t;


/****************************************************************************/
/* Target Mode Context Reply                                                */
/****************************************************************************/

#define TARGET_MODE_REPLY_IO_INDEX_MASK
#define TARGET_MODE_REPLY_IO_INDEX_SHIFT
#define TARGET_MODE_REPLY_INITIATOR_INDEX_MASK
#define TARGET_MODE_REPLY_INITIATOR_INDEX_SHIFT
#define TARGET_MODE_REPLY_ALIAS_MASK
#define TARGET_MODE_REPLY_ALIAS_SHIFT
#define TARGET_MODE_REPLY_PORT_MASK
#define TARGET_MODE_REPLY_PORT_SHIFT


#define GET_IO_INDEX(x)

#define SET_IO_INDEX(t, i)

#define GET_INITIATOR_INDEX(x)

#define SET_INITIATOR_INDEX(t, ii)

#define GET_ALIAS(x)

#define SET_ALIAS(t, a)

#define GET_PORT(x)

#define SET_PORT(t, p)

/* the following obsolete values are for MPI v1.0 support */
#define TARGET_MODE_REPLY_0100_MASK_HOST_INDEX
#define TARGET_MODE_REPLY_0100_SHIFT_HOST_INDEX
#define TARGET_MODE_REPLY_0100_MASK_IOC_INDEX
#define TARGET_MODE_REPLY_0100_SHIFT_IOC_INDEX
#define TARGET_MODE_REPLY_0100_PORT_MASK
#define TARGET_MODE_REPLY_0100_PORT_SHIFT
#define TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX
#define TARGET_MODE_REPLY_0100_SHIFT_INITIATOR_INDEX

#define GET_HOST_INDEX_0100(x)

#define SET_HOST_INDEX_0100(t, hi)

#define GET_IOC_INDEX_0100(x)

#define SET_IOC_INDEX_0100(t, ii)

#define GET_INITIATOR_INDEX_0100(x)

#define SET_INITIATOR_INDEX_0100(t, ii)


#endif