Path: blob/master/drivers/message/fusion/lsi/mpi_targ.h
15111 views
/*1* Copyright (c) 2000-2008 LSI Corporation.2*3*4* Name: mpi_targ.h5* Title: MPI Target mode messages and structures6* Creation Date: June 22, 20007*8* mpi_targ.h Version: 01.05.069*10* Version History11* ---------------12*13* Date Version Description14* -------- -------- ------------------------------------------------------15* 05-08-00 00.10.01 Original release for 0.10 spec dated 4/26/2000.16* 06-06-00 01.00.01 Update version number for 1.0 release.17* 06-22-00 01.00.02 Added _MSG_TARGET_CMD_BUFFER_POST_REPLY structure.18* Corrected DECSRIPTOR typo to DESCRIPTOR.19* 11-02-00 01.01.01 Original release for post 1.0 work20* Modified target mode to use IoIndex instead of21* HostIndex and IocIndex. Added Alias.22* 01-09-01 01.01.02 Added defines for TARGET_ASSIST_FLAGS_REPOST_CMD_BUFFER23* and TARGET_STATUS_SEND_FLAGS_REPOST_CMD_BUFFER.24* 02-20-01 01.01.03 Started using MPI_POINTER.25* Added structures for MPI_TARGET_SCSI_SPI_CMD_BUFFER and26* MPI_TARGET_FCP_CMD_BUFFER.27* 03-27-01 01.01.04 Added structure offset comments.28* 08-08-01 01.02.01 Original release for v1.2 work.29* 09-28-01 01.02.02 Added structure for MPI_TARGET_SCSI_SPI_STATUS_IU.30* Added PriorityReason field to some replies and31* defined more PriorityReason codes.32* Added some defines for to support previous version33* of MPI.34* 10-04-01 01.02.03 Added PriorityReason to MSG_TARGET_ERROR_REPLY.35* 11-01-01 01.02.04 Added define for TARGET_STATUS_SEND_FLAGS_HIGH_PRIORITY.36* 03-14-02 01.02.05 Modified MPI_TARGET_FCP_RSP_BUFFER to get the proper37* byte ordering.38* 05-31-02 01.02.06 Modified TARGET_MODE_REPLY_ALIAS_MASK to only include39* one bit.40* Added AliasIndex field to MPI_TARGET_FCP_CMD_BUFFER.41* 09-16-02 01.02.07 Added flags for confirmed completion.42* Added PRIORITY_REASON_TARGET_BUSY.43* 11-15-02 01.02.08 Added AliasID field to MPI_TARGET_SCSI_SPI_CMD_BUFFER.44* 04-01-03 01.02.09 Added OptionalOxid field to MPI_TARGET_FCP_CMD_BUFFER.45* 05-11-04 01.03.01 Original release for MPI v1.3.46* 08-19-04 01.05.01 Added new request message structures for47* MSG_TARGET_CMD_BUF_POST_BASE_REQUEST,48* MSG_TARGET_CMD_BUF_POST_LIST_REQUEST, and49* MSG_TARGET_ASSIST_EXT_REQUEST.50* Added new structures for SAS SSP Command buffer, SSP51* Task buffer, and SSP Status IU.52* 10-05-04 01.05.02 MSG_TARGET_CMD_BUFFER_POST_BASE_LIST_REPLY added.53* 02-22-05 01.05.03 Changed a comment.54* 03-11-05 01.05.04 Removed TargetAssistExtended Request.55* 06-24-05 01.05.05 Added TargetAssistExtended structures and defines.56* 03-27-06 01.05.06 Added a comment.57* --------------------------------------------------------------------------58*/5960#ifndef MPI_TARG_H61#define MPI_TARG_H626364/******************************************************************************65*66* S C S I T a r g e t M e s s a g e s67*68*******************************************************************************/6970typedef struct _CMD_BUFFER_DESCRIPTOR71{72U16 IoIndex; /* 00h */73U16 Reserved; /* 02h */74union /* 04h */75{76U32 PhysicalAddress32;77U64 PhysicalAddress64;78} u;79} CMD_BUFFER_DESCRIPTOR, MPI_POINTER PTR_CMD_BUFFER_DESCRIPTOR,80CmdBufferDescriptor_t, MPI_POINTER pCmdBufferDescriptor_t;818283/****************************************************************************/84/* Target Command Buffer Post Request */85/****************************************************************************/8687typedef struct _MSG_TARGET_CMD_BUFFER_POST_REQUEST88{89U8 BufferPostFlags; /* 00h */90U8 BufferCount; /* 01h */91U8 ChainOffset; /* 02h */92U8 Function; /* 03h */93U8 BufferLength; /* 04h */94U8 Reserved; /* 05h */95U8 Reserved1; /* 06h */96U8 MsgFlags; /* 07h */97U32 MsgContext; /* 08h */98CMD_BUFFER_DESCRIPTOR Buffer[1]; /* 0Ch */99} MSG_TARGET_CMD_BUFFER_POST_REQUEST, MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_REQUEST,100TargetCmdBufferPostRequest_t, MPI_POINTER pTargetCmdBufferPostRequest_t;101102#define CMD_BUFFER_POST_FLAGS_PORT_MASK (0x01)103#define CMD_BUFFER_POST_FLAGS_ADDR_MODE_MASK (0x80)104#define CMD_BUFFER_POST_FLAGS_ADDR_MODE_32 (0)105#define CMD_BUFFER_POST_FLAGS_ADDR_MODE_64 (1)106#define CMD_BUFFER_POST_FLAGS_64_BIT_ADDR (0x80)107108#define CMD_BUFFER_POST_IO_INDEX_MASK (0x00003FFF)109#define CMD_BUFFER_POST_IO_INDEX_MASK_0100 (0x000003FF) /* obsolete */110111112typedef struct _MSG_TARGET_CMD_BUFFER_POST_REPLY113{114U8 BufferPostFlags; /* 00h */115U8 BufferCount; /* 01h */116U8 MsgLength; /* 02h */117U8 Function; /* 03h */118U8 BufferLength; /* 04h */119U8 Reserved; /* 05h */120U8 Reserved1; /* 06h */121U8 MsgFlags; /* 07h */122U32 MsgContext; /* 08h */123U16 Reserved2; /* 0Ch */124U16 IOCStatus; /* 0Eh */125U32 IOCLogInfo; /* 10h */126} MSG_TARGET_CMD_BUFFER_POST_REPLY, MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_REPLY,127TargetCmdBufferPostReply_t, MPI_POINTER pTargetCmdBufferPostReply_t;128129/* the following structure is obsolete as of MPI v1.2 */130typedef struct _MSG_PRIORITY_CMD_RECEIVED_REPLY131{132U16 Reserved; /* 00h */133U8 MsgLength; /* 02h */134U8 Function; /* 03h */135U16 Reserved1; /* 04h */136U8 Reserved2; /* 06h */137U8 MsgFlags; /* 07h */138U32 MsgContext; /* 08h */139U8 PriorityReason; /* 0Ch */140U8 Reserved3; /* 0Dh */141U16 IOCStatus; /* 0Eh */142U32 IOCLogInfo; /* 10h */143U32 ReplyWord; /* 14h */144} MSG_PRIORITY_CMD_RECEIVED_REPLY, MPI_POINTER PTR_MSG_PRIORITY_CMD_RECEIVED_REPLY,145PriorityCommandReceivedReply_t, MPI_POINTER pPriorityCommandReceivedReply_t;146147148typedef struct _MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY149{150U16 Reserved; /* 00h */151U8 MsgLength; /* 02h */152U8 Function; /* 03h */153U16 Reserved1; /* 04h */154U8 Reserved2; /* 06h */155U8 MsgFlags; /* 07h */156U32 MsgContext; /* 08h */157U8 PriorityReason; /* 0Ch */158U8 Reserved3; /* 0Dh */159U16 IOCStatus; /* 0Eh */160U32 IOCLogInfo; /* 10h */161U32 ReplyWord; /* 14h */162} MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY,163MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY,164TargetCmdBufferPostErrorReply_t, MPI_POINTER pTargetCmdBufferPostErrorReply_t;165166#define PRIORITY_REASON_NO_DISCONNECT (0x00)167#define PRIORITY_REASON_SCSI_TASK_MANAGEMENT (0x01)168#define PRIORITY_REASON_CMD_PARITY_ERR (0x02)169#define PRIORITY_REASON_MSG_OUT_PARITY_ERR (0x03)170#define PRIORITY_REASON_LQ_CRC_ERR (0x04)171#define PRIORITY_REASON_CMD_CRC_ERR (0x05)172#define PRIORITY_REASON_PROTOCOL_ERR (0x06)173#define PRIORITY_REASON_DATA_OUT_PARITY_ERR (0x07)174#define PRIORITY_REASON_DATA_OUT_CRC_ERR (0x08)175#define PRIORITY_REASON_TARGET_BUSY (0x09)176#define PRIORITY_REASON_UNKNOWN (0xFF)177178179/****************************************************************************/180/* Target Command Buffer Post Base Request */181/****************************************************************************/182183typedef struct _MSG_TARGET_CMD_BUF_POST_BASE_REQUEST184{185U8 BufferPostFlags; /* 00h */186U8 PortNumber; /* 01h */187U8 ChainOffset; /* 02h */188U8 Function; /* 03h */189U16 TotalCmdBuffers; /* 04h */190U8 Reserved; /* 06h */191U8 MsgFlags; /* 07h */192U32 MsgContext; /* 08h */193U32 Reserved1; /* 0Ch */194U16 CmdBufferLength; /* 10h */195U16 NextCmdBufferOffset; /* 12h */196U32 BaseAddressLow; /* 14h */197U32 BaseAddressHigh; /* 18h */198} MSG_TARGET_CMD_BUF_POST_BASE_REQUEST,199MPI_POINTER PTR__MSG_TARGET_CMD_BUF_POST_BASE_REQUEST,200TargetCmdBufferPostBaseRequest_t,201MPI_POINTER pTargetCmdBufferPostBaseRequest_t;202203#define CMD_BUFFER_POST_BASE_FLAGS_AUTO_POST_ALL (0x01)204205206typedef struct _MSG_TARGET_CMD_BUFFER_POST_BASE_LIST_REPLY207{208U16 Reserved; /* 00h */209U8 MsgLength; /* 02h */210U8 Function; /* 03h */211U16 Reserved1; /* 04h */212U8 Reserved2; /* 06h */213U8 MsgFlags; /* 07h */214U32 MsgContext; /* 08h */215U16 Reserved3; /* 0Ch */216U16 IOCStatus; /* 0Eh */217U32 IOCLogInfo; /* 10h */218} MSG_TARGET_CMD_BUFFER_POST_BASE_LIST_REPLY,219MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_BASE_LIST_REPLY,220TargetCmdBufferPostBaseListReply_t,221MPI_POINTER pTargetCmdBufferPostBaseListReply_t;222223224/****************************************************************************/225/* Target Command Buffer Post List Request */226/****************************************************************************/227228typedef struct _MSG_TARGET_CMD_BUF_POST_LIST_REQUEST229{230U8 Reserved; /* 00h */231U8 PortNumber; /* 01h */232U8 ChainOffset; /* 02h */233U8 Function; /* 03h */234U16 CmdBufferCount; /* 04h */235U8 Reserved1; /* 06h */236U8 MsgFlags; /* 07h */237U32 MsgContext; /* 08h */238U32 Reserved2; /* 0Ch */239U16 IoIndex[2]; /* 10h */240} MSG_TARGET_CMD_BUF_POST_LIST_REQUEST,241MPI_POINTER PTR_MSG_TARGET_CMD_BUF_POST_LIST_REQUEST,242TargetCmdBufferPostListRequest_t,243MPI_POINTER pTargetCmdBufferPostListRequest_t;244245246/****************************************************************************/247/* Command Buffer Formats (with 16 byte CDB) */248/****************************************************************************/249250typedef struct _MPI_TARGET_FCP_CMD_BUFFER251{252U8 FcpLun[8]; /* 00h */253U8 FcpCntl[4]; /* 08h */254U8 FcpCdb[16]; /* 0Ch */255U32 FcpDl; /* 1Ch */256U8 AliasIndex; /* 20h */257U8 Reserved1; /* 21h */258U16 OptionalOxid; /* 22h */259} MPI_TARGET_FCP_CMD_BUFFER, MPI_POINTER PTR_MPI_TARGET_FCP_CMD_BUFFER,260MpiTargetFcpCmdBuffer, MPI_POINTER pMpiTargetFcpCmdBuffer;261262263typedef struct _MPI_TARGET_SCSI_SPI_CMD_BUFFER264{265/* SPI L_Q information unit */266U8 L_QType; /* 00h */267U8 Reserved; /* 01h */268U16 Tag; /* 02h */269U8 LogicalUnitNumber[8]; /* 04h */270U32 DataLength; /* 0Ch */271/* SPI command information unit */272U8 ReservedFirstByteOfCommandIU; /* 10h */273U8 TaskAttribute; /* 11h */274U8 TaskManagementFlags; /* 12h */275U8 AdditionalCDBLength; /* 13h */276U8 CDB[16]; /* 14h */277/* Alias ID */278U8 AliasID; /* 24h */279U8 Reserved1; /* 25h */280U16 Reserved2; /* 26h */281} MPI_TARGET_SCSI_SPI_CMD_BUFFER,282MPI_POINTER PTR_MPI_TARGET_SCSI_SPI_CMD_BUFFER,283MpiTargetScsiSpiCmdBuffer, MPI_POINTER pMpiTargetScsiSpiCmdBuffer;284285286typedef struct _MPI_TARGET_SSP_CMD_BUFFER287{288U8 FrameType; /* 00h */289U8 Reserved1; /* 01h */290U16 Reserved2; /* 02h */291U16 InitiatorTag; /* 04h */292U16 DevHandle; /* 06h */293/* COMMAND information unit starts here */294U8 LogicalUnitNumber[8]; /* 08h */295U8 Reserved3; /* 10h */296U8 TaskAttribute; /* lower 3 bits */ /* 11h */297U8 Reserved4; /* 12h */298U8 AdditionalCDBLength; /* upper 5 bits */ /* 13h */299U8 CDB[16]; /* 14h */300/* Additional CDB bytes extend past the CDB field */301} MPI_TARGET_SSP_CMD_BUFFER, MPI_POINTER PTR_MPI_TARGET_SSP_CMD_BUFFER,302MpiTargetSspCmdBuffer, MPI_POINTER pMpiTargetSspCmdBuffer;303304typedef struct _MPI_TARGET_SSP_TASK_BUFFER305{306U8 FrameType; /* 00h */307U8 Reserved1; /* 01h */308U16 Reserved2; /* 02h */309U16 InitiatorTag; /* 04h */310U16 DevHandle; /* 06h */311/* TASK information unit starts here */312U8 LogicalUnitNumber[8]; /* 08h */313U8 Reserved3; /* 10h */314U8 Reserved4; /* 11h */315U8 TaskManagementFunction; /* 12h */316U8 Reserved5; /* 13h */317U16 ManagedTaskTag; /* 14h */318U16 Reserved6; /* 16h */319U32 Reserved7; /* 18h */320U32 Reserved8; /* 1Ch */321U32 Reserved9; /* 20h */322} MPI_TARGET_SSP_TASK_BUFFER, MPI_POINTER PTR_MPI_TARGET_SSP_TASK_BUFFER,323MpiTargetSspTaskBuffer, MPI_POINTER pMpiTargetSspTaskBuffer;324325326/****************************************************************************/327/* Target Assist Request */328/****************************************************************************/329330typedef struct _MSG_TARGET_ASSIST_REQUEST331{332U8 StatusCode; /* 00h */333U8 TargetAssistFlags; /* 01h */334U8 ChainOffset; /* 02h */335U8 Function; /* 03h */336U16 QueueTag; /* 04h */337U8 Reserved; /* 06h */338U8 MsgFlags; /* 07h */339U32 MsgContext; /* 08h */340U32 ReplyWord; /* 0Ch */341U8 LUN[8]; /* 10h */342U32 RelativeOffset; /* 18h */343U32 DataLength; /* 1Ch */344SGE_IO_UNION SGL[1]; /* 20h */345} MSG_TARGET_ASSIST_REQUEST, MPI_POINTER PTR_MSG_TARGET_ASSIST_REQUEST,346TargetAssistRequest_t, MPI_POINTER pTargetAssistRequest_t;347348#define TARGET_ASSIST_FLAGS_DATA_DIRECTION (0x01)349#define TARGET_ASSIST_FLAGS_AUTO_STATUS (0x02)350#define TARGET_ASSIST_FLAGS_HIGH_PRIORITY (0x04)351#define TARGET_ASSIST_FLAGS_CONFIRMED (0x08)352#define TARGET_ASSIST_FLAGS_REPOST_CMD_BUFFER (0x80)353354/* Standard Target Mode Reply message */355typedef struct _MSG_TARGET_ERROR_REPLY356{357U16 Reserved; /* 00h */358U8 MsgLength; /* 02h */359U8 Function; /* 03h */360U16 Reserved1; /* 04h */361U8 Reserved2; /* 06h */362U8 MsgFlags; /* 07h */363U32 MsgContext; /* 08h */364U8 PriorityReason; /* 0Ch */365U8 Reserved3; /* 0Dh */366U16 IOCStatus; /* 0Eh */367U32 IOCLogInfo; /* 10h */368U32 ReplyWord; /* 14h */369U32 TransferCount; /* 18h */370} MSG_TARGET_ERROR_REPLY, MPI_POINTER PTR_MSG_TARGET_ERROR_REPLY,371TargetErrorReply_t, MPI_POINTER pTargetErrorReply_t;372373374/****************************************************************************/375/* Target Assist Extended Request */376/****************************************************************************/377378typedef struct _MSG_TARGET_ASSIST_EXT_REQUEST379{380U8 StatusCode; /* 00h */381U8 TargetAssistFlags; /* 01h */382U8 ChainOffset; /* 02h */383U8 Function; /* 03h */384U16 QueueTag; /* 04h */385U8 Reserved1; /* 06h */386U8 MsgFlags; /* 07h */387U32 MsgContext; /* 08h */388U32 ReplyWord; /* 0Ch */389U8 LUN[8]; /* 10h */390U32 RelativeOffset; /* 18h */391U32 Reserved2; /* 1Ch */392U32 Reserved3; /* 20h */393U32 PrimaryReferenceTag; /* 24h */394U16 PrimaryApplicationTag; /* 28h */395U16 PrimaryApplicationTagMask; /* 2Ah */396U32 Reserved4; /* 2Ch */397U32 DataLength; /* 30h */398U32 BidirectionalDataLength; /* 34h */399U32 SecondaryReferenceTag; /* 38h */400U16 SecondaryApplicationTag; /* 3Ch */401U16 Reserved5; /* 3Eh */402U16 EEDPFlags; /* 40h */403U16 ApplicationTagTranslationMask; /* 42h */404U32 EEDPBlockSize; /* 44h */405U8 SGLOffset0; /* 48h */406U8 SGLOffset1; /* 49h */407U8 SGLOffset2; /* 4Ah */408U8 SGLOffset3; /* 4Bh */409U32 Reserved6; /* 4Ch */410SGE_IO_UNION SGL[1]; /* 50h */411} MSG_TARGET_ASSIST_EXT_REQUEST, MPI_POINTER PTR_MSG_TARGET_ASSIST_EXT_REQUEST,412TargetAssistExtRequest_t, MPI_POINTER pTargetAssistExtRequest_t;413414/* see the defines after MSG_TARGET_ASSIST_REQUEST for TargetAssistFlags */415416/* defines for the MsgFlags field */417#define TARGET_ASSIST_EXT_MSGFLAGS_BIDIRECTIONAL (0x20)418#define TARGET_ASSIST_EXT_MSGFLAGS_MULTICAST (0x10)419#define TARGET_ASSIST_EXT_MSGFLAGS_SGL_OFFSET_CHAINS (0x08)420421/* defines for the EEDPFlags field */422#define TARGET_ASSIST_EXT_EEDP_MASK_OP (0x0007)423#define TARGET_ASSIST_EXT_EEDP_NOOP_OP (0x0000)424#define TARGET_ASSIST_EXT_EEDP_CHK_OP (0x0001)425#define TARGET_ASSIST_EXT_EEDP_STRIP_OP (0x0002)426#define TARGET_ASSIST_EXT_EEDP_CHKRM_OP (0x0003)427#define TARGET_ASSIST_EXT_EEDP_INSERT_OP (0x0004)428#define TARGET_ASSIST_EXT_EEDP_REPLACE_OP (0x0006)429#define TARGET_ASSIST_EXT_EEDP_CHKREGEN_OP (0x0007)430431#define TARGET_ASSIST_EXT_EEDP_PASS_REF_TAG (0x0008)432433#define TARGET_ASSIST_EXT_EEDP_T10_CHK_MASK (0x0700)434#define TARGET_ASSIST_EXT_EEDP_T10_CHK_GUARD (0x0100)435#define TARGET_ASSIST_EXT_EEDP_T10_CHK_APPTAG (0x0200)436#define TARGET_ASSIST_EXT_EEDP_T10_CHK_REFTAG (0x0400)437#define TARGET_ASSIST_EXT_EEDP_T10_CHK_SHIFT (8)438439#define TARGET_ASSIST_EXT_EEDP_INC_SEC_APPTAG (0x1000)440#define TARGET_ASSIST_EXT_EEDP_INC_PRI_APPTAG (0x2000)441#define TARGET_ASSIST_EXT_EEDP_INC_SEC_REFTAG (0x4000)442#define TARGET_ASSIST_EXT_EEDP_INC_PRI_REFTAG (0x8000)443444445/****************************************************************************/446/* Target Status Send Request */447/****************************************************************************/448449typedef struct _MSG_TARGET_STATUS_SEND_REQUEST450{451U8 StatusCode; /* 00h */452U8 StatusFlags; /* 01h */453U8 ChainOffset; /* 02h */454U8 Function; /* 03h */455U16 QueueTag; /* 04h */456U8 Reserved; /* 06h */457U8 MsgFlags; /* 07h */458U32 MsgContext; /* 08h */459U32 ReplyWord; /* 0Ch */460U8 LUN[8]; /* 10h */461SGE_SIMPLE_UNION StatusDataSGE; /* 18h */462} MSG_TARGET_STATUS_SEND_REQUEST, MPI_POINTER PTR_MSG_TARGET_STATUS_SEND_REQUEST,463TargetStatusSendRequest_t, MPI_POINTER pTargetStatusSendRequest_t;464465#define TARGET_STATUS_SEND_FLAGS_AUTO_GOOD_STATUS (0x01)466#define TARGET_STATUS_SEND_FLAGS_HIGH_PRIORITY (0x04)467#define TARGET_STATUS_SEND_FLAGS_CONFIRMED (0x08)468#define TARGET_STATUS_SEND_FLAGS_REPOST_CMD_BUFFER (0x80)469470/*471* NOTE: FCP_RSP data is big-endian. When used on a little-endian system, this472* structure properly orders the bytes.473*/474typedef struct _MPI_TARGET_FCP_RSP_BUFFER475{476U8 Reserved0[8]; /* 00h */477U8 Reserved1[2]; /* 08h */478U8 FcpFlags; /* 0Ah */479U8 FcpStatus; /* 0Bh */480U32 FcpResid; /* 0Ch */481U32 FcpSenseLength; /* 10h */482U32 FcpResponseLength; /* 14h */483U8 FcpResponseData[8]; /* 18h */484U8 FcpSenseData[32]; /* Pad to 64 bytes */ /* 20h */485} MPI_TARGET_FCP_RSP_BUFFER, MPI_POINTER PTR_MPI_TARGET_FCP_RSP_BUFFER,486MpiTargetFcpRspBuffer, MPI_POINTER pMpiTargetFcpRspBuffer;487488/*489* NOTE: The SPI status IU is big-endian. When used on a little-endian system,490* this structure properly orders the bytes.491*/492typedef struct _MPI_TARGET_SCSI_SPI_STATUS_IU493{494U8 Reserved0; /* 00h */495U8 Reserved1; /* 01h */496U8 Valid; /* 02h */497U8 Status; /* 03h */498U32 SenseDataListLength; /* 04h */499U32 PktFailuresListLength; /* 08h */500U8 SenseData[52]; /* Pad the IU to 64 bytes */ /* 0Ch */501} MPI_TARGET_SCSI_SPI_STATUS_IU, MPI_POINTER PTR_MPI_TARGET_SCSI_SPI_STATUS_IU,502TargetScsiSpiStatusIU_t, MPI_POINTER pTargetScsiSpiStatusIU_t;503504/*505* NOTE: The SSP status IU is big-endian. When used on a little-endian system,506* this structure properly orders the bytes.507*/508typedef struct _MPI_TARGET_SSP_RSP_IU509{510U32 Reserved0[6]; /* reserved for SSP header */ /* 00h */511/* start of RESPONSE information unit */512U32 Reserved1; /* 18h */513U32 Reserved2; /* 1Ch */514U16 Reserved3; /* 20h */515U8 DataPres; /* lower 2 bits */ /* 22h */516U8 Status; /* 23h */517U32 Reserved4; /* 24h */518U32 SenseDataLength; /* 28h */519U32 ResponseDataLength; /* 2Ch */520U8 ResponseSenseData[4]; /* 30h */521} MPI_TARGET_SSP_RSP_IU, MPI_POINTER PTR_MPI_TARGET_SSP_RSP_IU,522MpiTargetSspRspIu_t, MPI_POINTER pMpiTargetSspRspIu_t;523524525/****************************************************************************/526/* Target Mode Abort Request */527/****************************************************************************/528529typedef struct _MSG_TARGET_MODE_ABORT_REQUEST530{531U8 AbortType; /* 00h */532U8 Reserved; /* 01h */533U8 ChainOffset; /* 02h */534U8 Function; /* 03h */535U16 Reserved1; /* 04h */536U8 Reserved2; /* 06h */537U8 MsgFlags; /* 07h */538U32 MsgContext; /* 08h */539U32 ReplyWord; /* 0Ch */540U32 MsgContextToAbort; /* 10h */541} MSG_TARGET_MODE_ABORT, MPI_POINTER PTR_MSG_TARGET_MODE_ABORT,542TargetModeAbort_t, MPI_POINTER pTargetModeAbort_t;543544#define TARGET_MODE_ABORT_TYPE_ALL_CMD_BUFFERS (0x00)545#define TARGET_MODE_ABORT_TYPE_ALL_IO (0x01)546#define TARGET_MODE_ABORT_TYPE_EXACT_IO (0x02)547#define TARGET_MODE_ABORT_TYPE_EXACT_IO_REQUEST (0x03)548549/* Target Mode Abort Reply */550551typedef struct _MSG_TARGET_MODE_ABORT_REPLY552{553U16 Reserved; /* 00h */554U8 MsgLength; /* 02h */555U8 Function; /* 03h */556U16 Reserved1; /* 04h */557U8 Reserved2; /* 06h */558U8 MsgFlags; /* 07h */559U32 MsgContext; /* 08h */560U16 Reserved3; /* 0Ch */561U16 IOCStatus; /* 0Eh */562U32 IOCLogInfo; /* 10h */563U32 AbortCount; /* 14h */564} MSG_TARGET_MODE_ABORT_REPLY, MPI_POINTER PTR_MSG_TARGET_MODE_ABORT_REPLY,565TargetModeAbortReply_t, MPI_POINTER pTargetModeAbortReply_t;566567568/****************************************************************************/569/* Target Mode Context Reply */570/****************************************************************************/571572#define TARGET_MODE_REPLY_IO_INDEX_MASK (0x00003FFF)573#define TARGET_MODE_REPLY_IO_INDEX_SHIFT (0)574#define TARGET_MODE_REPLY_INITIATOR_INDEX_MASK (0x03FFC000)575#define TARGET_MODE_REPLY_INITIATOR_INDEX_SHIFT (14)576#define TARGET_MODE_REPLY_ALIAS_MASK (0x04000000)577#define TARGET_MODE_REPLY_ALIAS_SHIFT (26)578#define TARGET_MODE_REPLY_PORT_MASK (0x10000000)579#define TARGET_MODE_REPLY_PORT_SHIFT (28)580581582#define GET_IO_INDEX(x) (((x) & TARGET_MODE_REPLY_IO_INDEX_MASK) \583>> TARGET_MODE_REPLY_IO_INDEX_SHIFT)584585#define SET_IO_INDEX(t, i) \586((t) = ((t) & ~TARGET_MODE_REPLY_IO_INDEX_MASK) | \587(((i) << TARGET_MODE_REPLY_IO_INDEX_SHIFT) & \588TARGET_MODE_REPLY_IO_INDEX_MASK))589590#define GET_INITIATOR_INDEX(x) (((x) & TARGET_MODE_REPLY_INITIATOR_INDEX_MASK) \591>> TARGET_MODE_REPLY_INITIATOR_INDEX_SHIFT)592593#define SET_INITIATOR_INDEX(t, ii) \594((t) = ((t) & ~TARGET_MODE_REPLY_INITIATOR_INDEX_MASK) | \595(((ii) << TARGET_MODE_REPLY_INITIATOR_INDEX_SHIFT) & \596TARGET_MODE_REPLY_INITIATOR_INDEX_MASK))597598#define GET_ALIAS(x) (((x) & TARGET_MODE_REPLY_ALIAS_MASK) \599>> TARGET_MODE_REPLY_ALIAS_SHIFT)600601#define SET_ALIAS(t, a) ((t) = ((t) & ~TARGET_MODE_REPLY_ALIAS_MASK) | \602(((a) << TARGET_MODE_REPLY_ALIAS_SHIFT) & \603TARGET_MODE_REPLY_ALIAS_MASK))604605#define GET_PORT(x) (((x) & TARGET_MODE_REPLY_PORT_MASK) \606>> TARGET_MODE_REPLY_PORT_SHIFT)607608#define SET_PORT(t, p) ((t) = ((t) & ~TARGET_MODE_REPLY_PORT_MASK) | \609(((p) << TARGET_MODE_REPLY_PORT_SHIFT) & \610TARGET_MODE_REPLY_PORT_MASK))611612/* the following obsolete values are for MPI v1.0 support */613#define TARGET_MODE_REPLY_0100_MASK_HOST_INDEX (0x000003FF)614#define TARGET_MODE_REPLY_0100_SHIFT_HOST_INDEX (0)615#define TARGET_MODE_REPLY_0100_MASK_IOC_INDEX (0x001FF800)616#define TARGET_MODE_REPLY_0100_SHIFT_IOC_INDEX (11)617#define TARGET_MODE_REPLY_0100_PORT_MASK (0x00400000)618#define TARGET_MODE_REPLY_0100_PORT_SHIFT (22)619#define TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX (0x1F800000)620#define TARGET_MODE_REPLY_0100_SHIFT_INITIATOR_INDEX (23)621622#define GET_HOST_INDEX_0100(x) (((x) & TARGET_MODE_REPLY_0100_MASK_HOST_INDEX) \623>> TARGET_MODE_REPLY_0100_SHIFT_HOST_INDEX)624625#define SET_HOST_INDEX_0100(t, hi) \626((t) = ((t) & ~TARGET_MODE_REPLY_0100_MASK_HOST_INDEX) | \627(((hi) << TARGET_MODE_REPLY_0100_SHIFT_HOST_INDEX) & \628TARGET_MODE_REPLY_0100_MASK_HOST_INDEX))629630#define GET_IOC_INDEX_0100(x) (((x) & TARGET_MODE_REPLY_0100_MASK_IOC_INDEX) \631>> TARGET_MODE_REPLY_0100_SHIFT_IOC_INDEX)632633#define SET_IOC_INDEX_0100(t, ii) \634((t) = ((t) & ~TARGET_MODE_REPLY_0100_MASK_IOC_INDEX) | \635(((ii) << TARGET_MODE_REPLY_0100_SHIFT_IOC_INDEX) & \636TARGET_MODE_REPLY_0100_MASK_IOC_INDEX))637638#define GET_INITIATOR_INDEX_0100(x) \639(((x) & TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX) \640>> TARGET_MODE_REPLY_0100_SHIFT_INITIATOR_INDEX)641642#define SET_INITIATOR_INDEX_0100(t, ii) \643((t) = ((t) & ~TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX) | \644(((ii) << TARGET_MODE_REPLY_0100_SHIFT_INITIATOR_INDEX) & \645TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX))646647648#endif649650651652