Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  *  Copyright (c) 2000-2008 LSI Corporation.
0004  *
0005  *
0006  *           Name:  mpi_targ.h
0007  *          Title:  MPI Target mode messages and structures
0008  *  Creation Date:  June 22, 2000
0009  *
0010  *    mpi_targ.h Version:  01.05.06
0011  *
0012  *  Version History
0013  *  ---------------
0014  *
0015  *  Date      Version   Description
0016  *  --------  --------  ------------------------------------------------------
0017  *  05-08-00  00.10.01  Original release for 0.10 spec dated 4/26/2000.
0018  *  06-06-00  01.00.01  Update version number for 1.0 release.
0019  *  06-22-00  01.00.02  Added _MSG_TARGET_CMD_BUFFER_POST_REPLY structure.
0020  *                      Corrected DECSRIPTOR typo to DESCRIPTOR.
0021  *  11-02-00  01.01.01  Original release for post 1.0 work
0022  *                      Modified target mode to use IoIndex instead of
0023  *                      HostIndex and IocIndex. Added Alias.
0024  *  01-09-01  01.01.02  Added defines for TARGET_ASSIST_FLAGS_REPOST_CMD_BUFFER
0025  *                      and TARGET_STATUS_SEND_FLAGS_REPOST_CMD_BUFFER.
0026  *  02-20-01  01.01.03  Started using MPI_POINTER.
0027  *                      Added structures for MPI_TARGET_SCSI_SPI_CMD_BUFFER and
0028  *                      MPI_TARGET_FCP_CMD_BUFFER.
0029  *  03-27-01  01.01.04  Added structure offset comments.
0030  *  08-08-01  01.02.01  Original release for v1.2 work.
0031  *  09-28-01  01.02.02  Added structure for MPI_TARGET_SCSI_SPI_STATUS_IU.
0032  *                      Added PriorityReason field to some replies and
0033  *                      defined more PriorityReason codes.
0034  *                      Added some defines for to support previous version
0035  *                      of MPI.
0036  *  10-04-01  01.02.03  Added PriorityReason to MSG_TARGET_ERROR_REPLY.
0037  *  11-01-01  01.02.04  Added define for TARGET_STATUS_SEND_FLAGS_HIGH_PRIORITY.
0038  *  03-14-02  01.02.05  Modified MPI_TARGET_FCP_RSP_BUFFER to get the proper
0039  *                      byte ordering.
0040  *  05-31-02  01.02.06  Modified TARGET_MODE_REPLY_ALIAS_MASK to only include
0041  *                      one bit.
0042  *                      Added AliasIndex field to MPI_TARGET_FCP_CMD_BUFFER.
0043  *  09-16-02  01.02.07  Added flags for confirmed completion.
0044  *                      Added PRIORITY_REASON_TARGET_BUSY.
0045  *  11-15-02  01.02.08  Added AliasID field to MPI_TARGET_SCSI_SPI_CMD_BUFFER.
0046  *  04-01-03  01.02.09  Added OptionalOxid field to MPI_TARGET_FCP_CMD_BUFFER.
0047  *  05-11-04  01.03.01  Original release for MPI v1.3.
0048  *  08-19-04  01.05.01  Added new request message structures for
0049  *                      MSG_TARGET_CMD_BUF_POST_BASE_REQUEST,
0050  *                      MSG_TARGET_CMD_BUF_POST_LIST_REQUEST, and
0051  *                      MSG_TARGET_ASSIST_EXT_REQUEST.
0052  *                      Added new structures for SAS SSP Command buffer, SSP
0053  *                      Task buffer, and SSP Status IU.
0054  *  10-05-04  01.05.02  MSG_TARGET_CMD_BUFFER_POST_BASE_LIST_REPLY added.
0055  *  02-22-05  01.05.03  Changed a comment.
0056  *  03-11-05  01.05.04  Removed TargetAssistExtended Request.
0057  *  06-24-05  01.05.05  Added TargetAssistExtended structures and defines.
0058  *  03-27-06  01.05.06  Added a comment.
0059  *  --------------------------------------------------------------------------
0060  */
0061 
0062 #ifndef MPI_TARG_H
0063 #define MPI_TARG_H
0064 
0065 
0066 /******************************************************************************
0067 *
0068 *        S C S I    T a r g e t    M e s s a g e s
0069 *
0070 *******************************************************************************/
0071 
0072 typedef struct _CMD_BUFFER_DESCRIPTOR
0073 {
0074     U16                     IoIndex;                    /* 00h */
0075     U16                     Reserved;                   /* 02h */
0076     union                                               /* 04h */
0077     {
0078         U32                 PhysicalAddress32;
0079         U64                 PhysicalAddress64;
0080     } u;
0081 } CMD_BUFFER_DESCRIPTOR, MPI_POINTER PTR_CMD_BUFFER_DESCRIPTOR,
0082   CmdBufferDescriptor_t, MPI_POINTER pCmdBufferDescriptor_t;
0083 
0084 
0085 /****************************************************************************/
0086 /* Target Command Buffer Post Request                                       */
0087 /****************************************************************************/
0088 
0089 typedef struct _MSG_TARGET_CMD_BUFFER_POST_REQUEST
0090 {
0091     U8                      BufferPostFlags;            /* 00h */
0092     U8                      BufferCount;                /* 01h */
0093     U8                      ChainOffset;                /* 02h */
0094     U8                      Function;                   /* 03h */
0095     U8                      BufferLength;               /* 04h */
0096     U8                      Reserved;                   /* 05h */
0097     U8                      Reserved1;                  /* 06h */
0098     U8                      MsgFlags;                   /* 07h */
0099     U32                     MsgContext;                 /* 08h */
0100     CMD_BUFFER_DESCRIPTOR   Buffer[1];                  /* 0Ch */
0101 } MSG_TARGET_CMD_BUFFER_POST_REQUEST, MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_REQUEST,
0102   TargetCmdBufferPostRequest_t, MPI_POINTER pTargetCmdBufferPostRequest_t;
0103 
0104 #define CMD_BUFFER_POST_FLAGS_PORT_MASK         (0x01)
0105 #define CMD_BUFFER_POST_FLAGS_ADDR_MODE_MASK    (0x80)
0106 #define CMD_BUFFER_POST_FLAGS_ADDR_MODE_32      (0)
0107 #define CMD_BUFFER_POST_FLAGS_ADDR_MODE_64      (1)
0108 #define CMD_BUFFER_POST_FLAGS_64_BIT_ADDR       (0x80)
0109 
0110 #define CMD_BUFFER_POST_IO_INDEX_MASK           (0x00003FFF)
0111 #define CMD_BUFFER_POST_IO_INDEX_MASK_0100      (0x000003FF) /* obsolete */
0112 
0113 
0114 typedef struct _MSG_TARGET_CMD_BUFFER_POST_REPLY
0115 {
0116     U8                      BufferPostFlags;            /* 00h */
0117     U8                      BufferCount;                /* 01h */
0118     U8                      MsgLength;                  /* 02h */
0119     U8                      Function;                   /* 03h */
0120     U8                      BufferLength;               /* 04h */
0121     U8                      Reserved;                   /* 05h */
0122     U8                      Reserved1;                  /* 06h */
0123     U8                      MsgFlags;                   /* 07h */
0124     U32                     MsgContext;                 /* 08h */
0125     U16                     Reserved2;                  /* 0Ch */
0126     U16                     IOCStatus;                  /* 0Eh */
0127     U32                     IOCLogInfo;                 /* 10h */
0128 } MSG_TARGET_CMD_BUFFER_POST_REPLY, MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_REPLY,
0129   TargetCmdBufferPostReply_t, MPI_POINTER pTargetCmdBufferPostReply_t;
0130 
0131 /* the following structure is obsolete as of MPI v1.2 */
0132 typedef struct _MSG_PRIORITY_CMD_RECEIVED_REPLY
0133 {
0134     U16                     Reserved;                   /* 00h */
0135     U8                      MsgLength;                  /* 02h */
0136     U8                      Function;                   /* 03h */
0137     U16                     Reserved1;                  /* 04h */
0138     U8                      Reserved2;                  /* 06h */
0139     U8                      MsgFlags;                   /* 07h */
0140     U32                     MsgContext;                 /* 08h */
0141     U8                      PriorityReason;             /* 0Ch */
0142     U8                      Reserved3;                  /* 0Dh */
0143     U16                     IOCStatus;                  /* 0Eh */
0144     U32                     IOCLogInfo;                 /* 10h */
0145     U32                     ReplyWord;                  /* 14h */
0146 } MSG_PRIORITY_CMD_RECEIVED_REPLY, MPI_POINTER PTR_MSG_PRIORITY_CMD_RECEIVED_REPLY,
0147   PriorityCommandReceivedReply_t, MPI_POINTER pPriorityCommandReceivedReply_t;
0148 
0149 
0150 typedef struct _MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY
0151 {
0152     U16                     Reserved;                   /* 00h */
0153     U8                      MsgLength;                  /* 02h */
0154     U8                      Function;                   /* 03h */
0155     U16                     Reserved1;                  /* 04h */
0156     U8                      Reserved2;                  /* 06h */
0157     U8                      MsgFlags;                   /* 07h */
0158     U32                     MsgContext;                 /* 08h */
0159     U8                      PriorityReason;             /* 0Ch */
0160     U8                      Reserved3;                  /* 0Dh */
0161     U16                     IOCStatus;                  /* 0Eh */
0162     U32                     IOCLogInfo;                 /* 10h */
0163     U32                     ReplyWord;                  /* 14h */
0164 } MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY,
0165   MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY,
0166   TargetCmdBufferPostErrorReply_t, MPI_POINTER pTargetCmdBufferPostErrorReply_t;
0167 
0168 #define PRIORITY_REASON_NO_DISCONNECT           (0x00)
0169 #define PRIORITY_REASON_SCSI_TASK_MANAGEMENT    (0x01)
0170 #define PRIORITY_REASON_CMD_PARITY_ERR          (0x02)
0171 #define PRIORITY_REASON_MSG_OUT_PARITY_ERR      (0x03)
0172 #define PRIORITY_REASON_LQ_CRC_ERR              (0x04)
0173 #define PRIORITY_REASON_CMD_CRC_ERR             (0x05)
0174 #define PRIORITY_REASON_PROTOCOL_ERR            (0x06)
0175 #define PRIORITY_REASON_DATA_OUT_PARITY_ERR     (0x07)
0176 #define PRIORITY_REASON_DATA_OUT_CRC_ERR        (0x08)
0177 #define PRIORITY_REASON_TARGET_BUSY             (0x09)
0178 #define PRIORITY_REASON_UNKNOWN                 (0xFF)
0179 
0180 
0181 /****************************************************************************/
0182 /* Target Command Buffer Post Base Request                                  */
0183 /****************************************************************************/
0184 
0185 typedef struct _MSG_TARGET_CMD_BUF_POST_BASE_REQUEST
0186 {
0187     U8                      BufferPostFlags;            /* 00h */
0188     U8                      PortNumber;                 /* 01h */
0189     U8                      ChainOffset;                /* 02h */
0190     U8                      Function;                   /* 03h */
0191     U16                     TotalCmdBuffers;            /* 04h */
0192     U8                      Reserved;                   /* 06h */
0193     U8                      MsgFlags;                   /* 07h */
0194     U32                     MsgContext;                 /* 08h */
0195     U32                     Reserved1;                  /* 0Ch */
0196     U16                     CmdBufferLength;            /* 10h */
0197     U16                     NextCmdBufferOffset;        /* 12h */
0198     U32                     BaseAddressLow;             /* 14h */
0199     U32                     BaseAddressHigh;            /* 18h */
0200 } MSG_TARGET_CMD_BUF_POST_BASE_REQUEST,
0201   MPI_POINTER PTR__MSG_TARGET_CMD_BUF_POST_BASE_REQUEST,
0202   TargetCmdBufferPostBaseRequest_t,
0203   MPI_POINTER pTargetCmdBufferPostBaseRequest_t;
0204 
0205 #define CMD_BUFFER_POST_BASE_FLAGS_AUTO_POST_ALL    (0x01)
0206 
0207 
0208 typedef struct _MSG_TARGET_CMD_BUFFER_POST_BASE_LIST_REPLY
0209 {
0210     U16                     Reserved;                   /* 00h */
0211     U8                      MsgLength;                  /* 02h */
0212     U8                      Function;                   /* 03h */
0213     U16                     Reserved1;                  /* 04h */
0214     U8                      Reserved2;                  /* 06h */
0215     U8                      MsgFlags;                   /* 07h */
0216     U32                     MsgContext;                 /* 08h */
0217     U16                     Reserved3;                  /* 0Ch */
0218     U16                     IOCStatus;                  /* 0Eh */
0219     U32                     IOCLogInfo;                 /* 10h */
0220 } MSG_TARGET_CMD_BUFFER_POST_BASE_LIST_REPLY,
0221   MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_BASE_LIST_REPLY,
0222   TargetCmdBufferPostBaseListReply_t,
0223   MPI_POINTER pTargetCmdBufferPostBaseListReply_t;
0224 
0225 
0226 /****************************************************************************/
0227 /* Target Command Buffer Post List Request                                  */
0228 /****************************************************************************/
0229 
0230 typedef struct _MSG_TARGET_CMD_BUF_POST_LIST_REQUEST
0231 {
0232     U8                      Reserved;                   /* 00h */
0233     U8                      PortNumber;                 /* 01h */
0234     U8                      ChainOffset;                /* 02h */
0235     U8                      Function;                   /* 03h */
0236     U16                     CmdBufferCount;             /* 04h */
0237     U8                      Reserved1;                  /* 06h */
0238     U8                      MsgFlags;                   /* 07h */
0239     U32                     MsgContext;                 /* 08h */
0240     U32                     Reserved2;                  /* 0Ch */
0241     U16                     IoIndex[2];                 /* 10h */
0242 } MSG_TARGET_CMD_BUF_POST_LIST_REQUEST,
0243   MPI_POINTER PTR_MSG_TARGET_CMD_BUF_POST_LIST_REQUEST,
0244   TargetCmdBufferPostListRequest_t,
0245   MPI_POINTER pTargetCmdBufferPostListRequest_t;
0246 
0247 
0248 /****************************************************************************/
0249 /* Command Buffer Formats (with 16 byte CDB)                                */
0250 /****************************************************************************/
0251 
0252 typedef struct _MPI_TARGET_FCP_CMD_BUFFER
0253 {
0254     U8      FcpLun[8];                                  /* 00h */
0255     U8      FcpCntl[4];                                 /* 08h */
0256     U8      FcpCdb[16];                                 /* 0Ch */
0257     U32     FcpDl;                                      /* 1Ch */
0258     U8      AliasIndex;                                 /* 20h */
0259     U8      Reserved1;                                  /* 21h */
0260     U16     OptionalOxid;                               /* 22h */
0261 } MPI_TARGET_FCP_CMD_BUFFER, MPI_POINTER PTR_MPI_TARGET_FCP_CMD_BUFFER,
0262   MpiTargetFcpCmdBuffer, MPI_POINTER pMpiTargetFcpCmdBuffer;
0263 
0264 
0265 typedef struct _MPI_TARGET_SCSI_SPI_CMD_BUFFER
0266 {
0267     /* SPI L_Q information unit */
0268     U8      L_QType;                                    /* 00h */
0269     U8      Reserved;                                   /* 01h */
0270     U16     Tag;                                        /* 02h */
0271     U8      LogicalUnitNumber[8];                       /* 04h */
0272     U32     DataLength;                                 /* 0Ch */
0273     /* SPI command information unit */
0274     U8      ReservedFirstByteOfCommandIU;               /* 10h */
0275     U8      TaskAttribute;                              /* 11h */
0276     U8      TaskManagementFlags;                        /* 12h */
0277     U8      AdditionalCDBLength;                        /* 13h */
0278     U8      CDB[16];                                    /* 14h */
0279     /* Alias ID */
0280     U8      AliasID;                                    /* 24h */
0281     U8      Reserved1;                                  /* 25h */
0282     U16     Reserved2;                                  /* 26h */
0283 } MPI_TARGET_SCSI_SPI_CMD_BUFFER,
0284   MPI_POINTER PTR_MPI_TARGET_SCSI_SPI_CMD_BUFFER,
0285   MpiTargetScsiSpiCmdBuffer, MPI_POINTER pMpiTargetScsiSpiCmdBuffer;
0286 
0287 
0288 typedef struct _MPI_TARGET_SSP_CMD_BUFFER
0289 {
0290     U8      FrameType;                                  /* 00h */
0291     U8      Reserved1;                                  /* 01h */
0292     U16     Reserved2;                                  /* 02h */
0293     U16     InitiatorTag;                               /* 04h */
0294     U16     DevHandle;                                  /* 06h */
0295     /* COMMAND information unit starts here */
0296     U8      LogicalUnitNumber[8];                       /* 08h */
0297     U8      Reserved3;                                  /* 10h */
0298     U8      TaskAttribute; /* lower 3 bits */           /* 11h */
0299     U8      Reserved4;                                  /* 12h */
0300     U8      AdditionalCDBLength; /* upper 5 bits */     /* 13h */
0301     U8      CDB[16];                                    /* 14h */
0302     /* Additional CDB bytes extend past the CDB field */
0303 } MPI_TARGET_SSP_CMD_BUFFER, MPI_POINTER PTR_MPI_TARGET_SSP_CMD_BUFFER,
0304   MpiTargetSspCmdBuffer, MPI_POINTER pMpiTargetSspCmdBuffer;
0305 
0306 typedef struct _MPI_TARGET_SSP_TASK_BUFFER
0307 {
0308     U8      FrameType;                                  /* 00h */
0309     U8      Reserved1;                                  /* 01h */
0310     U16     Reserved2;                                  /* 02h */
0311     U16     InitiatorTag;                               /* 04h */
0312     U16     DevHandle;                                  /* 06h */
0313     /* TASK information unit starts here */
0314     U8      LogicalUnitNumber[8];                       /* 08h */
0315     U8      Reserved3;                                  /* 10h */
0316     U8      Reserved4;                                  /* 11h */
0317     U8      TaskManagementFunction;                     /* 12h */
0318     U8      Reserved5;                                  /* 13h */
0319     U16     ManagedTaskTag;                             /* 14h */
0320     U16     Reserved6;                                  /* 16h */
0321     U32     Reserved7;                                  /* 18h */
0322     U32     Reserved8;                                  /* 1Ch */
0323     U32     Reserved9;                                  /* 20h */
0324 } MPI_TARGET_SSP_TASK_BUFFER, MPI_POINTER PTR_MPI_TARGET_SSP_TASK_BUFFER,
0325   MpiTargetSspTaskBuffer, MPI_POINTER pMpiTargetSspTaskBuffer;
0326 
0327 
0328 /****************************************************************************/
0329 /* Target Assist Request                                                    */
0330 /****************************************************************************/
0331 
0332 typedef struct _MSG_TARGET_ASSIST_REQUEST
0333 {
0334     U8                      StatusCode;                 /* 00h */
0335     U8                      TargetAssistFlags;          /* 01h */
0336     U8                      ChainOffset;                /* 02h */
0337     U8                      Function;                   /* 03h */
0338     U16                     QueueTag;                   /* 04h */
0339     U8                      Reserved;                   /* 06h */
0340     U8                      MsgFlags;                   /* 07h */
0341     U32                     MsgContext;                 /* 08h */
0342     U32                     ReplyWord;                  /* 0Ch */
0343     U8                      LUN[8];                     /* 10h */
0344     U32                     RelativeOffset;             /* 18h */
0345     U32                     DataLength;                 /* 1Ch */
0346     SGE_IO_UNION            SGL[1];                     /* 20h */
0347 } MSG_TARGET_ASSIST_REQUEST, MPI_POINTER PTR_MSG_TARGET_ASSIST_REQUEST,
0348   TargetAssistRequest_t, MPI_POINTER pTargetAssistRequest_t;
0349 
0350 #define TARGET_ASSIST_FLAGS_DATA_DIRECTION          (0x01)
0351 #define TARGET_ASSIST_FLAGS_AUTO_STATUS             (0x02)
0352 #define TARGET_ASSIST_FLAGS_HIGH_PRIORITY           (0x04)
0353 #define TARGET_ASSIST_FLAGS_CONFIRMED               (0x08)
0354 #define TARGET_ASSIST_FLAGS_REPOST_CMD_BUFFER       (0x80)
0355 
0356 /* Standard Target Mode Reply message */
0357 typedef struct _MSG_TARGET_ERROR_REPLY
0358 {
0359     U16                     Reserved;                   /* 00h */
0360     U8                      MsgLength;                  /* 02h */
0361     U8                      Function;                   /* 03h */
0362     U16                     Reserved1;                  /* 04h */
0363     U8                      Reserved2;                  /* 06h */
0364     U8                      MsgFlags;                   /* 07h */
0365     U32                     MsgContext;                 /* 08h */
0366     U8                      PriorityReason;             /* 0Ch */
0367     U8                      Reserved3;                  /* 0Dh */
0368     U16                     IOCStatus;                  /* 0Eh */
0369     U32                     IOCLogInfo;                 /* 10h */
0370     U32                     ReplyWord;                  /* 14h */
0371     U32                     TransferCount;              /* 18h */
0372 } MSG_TARGET_ERROR_REPLY, MPI_POINTER PTR_MSG_TARGET_ERROR_REPLY,
0373   TargetErrorReply_t, MPI_POINTER pTargetErrorReply_t;
0374 
0375 
0376 /****************************************************************************/
0377 /* Target Assist Extended Request                                           */
0378 /****************************************************************************/
0379 
0380 typedef struct _MSG_TARGET_ASSIST_EXT_REQUEST
0381 {
0382     U8                      StatusCode;                     /* 00h */
0383     U8                      TargetAssistFlags;              /* 01h */
0384     U8                      ChainOffset;                    /* 02h */
0385     U8                      Function;                       /* 03h */
0386     U16                     QueueTag;                       /* 04h */
0387     U8                      Reserved1;                      /* 06h */
0388     U8                      MsgFlags;                       /* 07h */
0389     U32                     MsgContext;                     /* 08h */
0390     U32                     ReplyWord;                      /* 0Ch */
0391     U8                      LUN[8];                         /* 10h */
0392     U32                     RelativeOffset;                 /* 18h */
0393     U32                     Reserved2;                      /* 1Ch */
0394     U32                     Reserved3;                      /* 20h */
0395     U32                     PrimaryReferenceTag;            /* 24h */
0396     U16                     PrimaryApplicationTag;          /* 28h */
0397     U16                     PrimaryApplicationTagMask;      /* 2Ah */
0398     U32                     Reserved4;                      /* 2Ch */
0399     U32                     DataLength;                     /* 30h */
0400     U32                     BidirectionalDataLength;        /* 34h */
0401     U32                     SecondaryReferenceTag;          /* 38h */
0402     U16                     SecondaryApplicationTag;        /* 3Ch */
0403     U16                     Reserved5;                      /* 3Eh */
0404     U16                     EEDPFlags;                      /* 40h */
0405     U16                     ApplicationTagTranslationMask;  /* 42h */
0406     U32                     EEDPBlockSize;                  /* 44h */
0407     U8                      SGLOffset0;                     /* 48h */
0408     U8                      SGLOffset1;                     /* 49h */
0409     U8                      SGLOffset2;                     /* 4Ah */
0410     U8                      SGLOffset3;                     /* 4Bh */
0411     U32                     Reserved6;                      /* 4Ch */
0412     SGE_IO_UNION            SGL[1];                         /* 50h */
0413 } MSG_TARGET_ASSIST_EXT_REQUEST, MPI_POINTER PTR_MSG_TARGET_ASSIST_EXT_REQUEST,
0414   TargetAssistExtRequest_t, MPI_POINTER pTargetAssistExtRequest_t;
0415 
0416 /* see the defines after MSG_TARGET_ASSIST_REQUEST for TargetAssistFlags */
0417 
0418 /* defines for the MsgFlags field */
0419 #define TARGET_ASSIST_EXT_MSGFLAGS_BIDIRECTIONAL        (0x20)
0420 #define TARGET_ASSIST_EXT_MSGFLAGS_MULTICAST            (0x10)
0421 #define TARGET_ASSIST_EXT_MSGFLAGS_SGL_OFFSET_CHAINS    (0x08)
0422 
0423 /* defines for the EEDPFlags field */
0424 #define TARGET_ASSIST_EXT_EEDP_MASK_OP          (0x0007)
0425 #define TARGET_ASSIST_EXT_EEDP_NOOP_OP          (0x0000)
0426 #define TARGET_ASSIST_EXT_EEDP_CHK_OP           (0x0001)
0427 #define TARGET_ASSIST_EXT_EEDP_STRIP_OP         (0x0002)
0428 #define TARGET_ASSIST_EXT_EEDP_CHKRM_OP         (0x0003)
0429 #define TARGET_ASSIST_EXT_EEDP_INSERT_OP        (0x0004)
0430 #define TARGET_ASSIST_EXT_EEDP_REPLACE_OP       (0x0006)
0431 #define TARGET_ASSIST_EXT_EEDP_CHKREGEN_OP      (0x0007)
0432 
0433 #define TARGET_ASSIST_EXT_EEDP_PASS_REF_TAG     (0x0008)
0434 
0435 #define TARGET_ASSIST_EXT_EEDP_T10_CHK_MASK     (0x0700)
0436 #define TARGET_ASSIST_EXT_EEDP_T10_CHK_GUARD    (0x0100)
0437 #define TARGET_ASSIST_EXT_EEDP_T10_CHK_APPTAG   (0x0200)
0438 #define TARGET_ASSIST_EXT_EEDP_T10_CHK_REFTAG   (0x0400)
0439 #define TARGET_ASSIST_EXT_EEDP_T10_CHK_SHIFT    (8)
0440 
0441 #define TARGET_ASSIST_EXT_EEDP_INC_SEC_APPTAG   (0x1000)
0442 #define TARGET_ASSIST_EXT_EEDP_INC_PRI_APPTAG   (0x2000)
0443 #define TARGET_ASSIST_EXT_EEDP_INC_SEC_REFTAG   (0x4000)
0444 #define TARGET_ASSIST_EXT_EEDP_INC_PRI_REFTAG   (0x8000)
0445 
0446 
0447 /****************************************************************************/
0448 /* Target Status Send Request                                               */
0449 /****************************************************************************/
0450 
0451 typedef struct _MSG_TARGET_STATUS_SEND_REQUEST
0452 {
0453     U8                      StatusCode;                 /* 00h */
0454     U8                      StatusFlags;                /* 01h */
0455     U8                      ChainOffset;                /* 02h */
0456     U8                      Function;                   /* 03h */
0457     U16                     QueueTag;                   /* 04h */
0458     U8                      Reserved;                   /* 06h */
0459     U8                      MsgFlags;                   /* 07h */
0460     U32                     MsgContext;                 /* 08h */
0461     U32                     ReplyWord;                  /* 0Ch */
0462     U8                      LUN[8];                     /* 10h */
0463     SGE_SIMPLE_UNION        StatusDataSGE;              /* 18h */
0464 } MSG_TARGET_STATUS_SEND_REQUEST, MPI_POINTER PTR_MSG_TARGET_STATUS_SEND_REQUEST,
0465   TargetStatusSendRequest_t, MPI_POINTER pTargetStatusSendRequest_t;
0466 
0467 #define TARGET_STATUS_SEND_FLAGS_AUTO_GOOD_STATUS   (0x01)
0468 #define TARGET_STATUS_SEND_FLAGS_HIGH_PRIORITY      (0x04)
0469 #define TARGET_STATUS_SEND_FLAGS_CONFIRMED          (0x08)
0470 #define TARGET_STATUS_SEND_FLAGS_REPOST_CMD_BUFFER  (0x80)
0471 
0472 /*
0473  * NOTE: FCP_RSP data is big-endian. When used on a little-endian system, this
0474  * structure properly orders the bytes.
0475  */
0476 typedef struct _MPI_TARGET_FCP_RSP_BUFFER
0477 {
0478     U8      Reserved0[8];                               /* 00h */
0479     U8      Reserved1[2];                               /* 08h */
0480     U8      FcpFlags;                                   /* 0Ah */
0481     U8      FcpStatus;                                  /* 0Bh */
0482     U32     FcpResid;                                   /* 0Ch */
0483     U32     FcpSenseLength;                             /* 10h */
0484     U32     FcpResponseLength;                          /* 14h */
0485     U8      FcpResponseData[8];                         /* 18h */
0486     U8      FcpSenseData[32]; /* Pad to 64 bytes */     /* 20h */
0487 } MPI_TARGET_FCP_RSP_BUFFER, MPI_POINTER PTR_MPI_TARGET_FCP_RSP_BUFFER,
0488   MpiTargetFcpRspBuffer, MPI_POINTER pMpiTargetFcpRspBuffer;
0489 
0490 /*
0491  * NOTE: The SPI status IU is big-endian. When used on a little-endian system,
0492  * this structure properly orders the bytes.
0493  */
0494 typedef struct _MPI_TARGET_SCSI_SPI_STATUS_IU
0495 {
0496     U8      Reserved0;                                  /* 00h */
0497     U8      Reserved1;                                  /* 01h */
0498     U8      Valid;                                      /* 02h */
0499     U8      Status;                                     /* 03h */
0500     U32     SenseDataListLength;                        /* 04h */
0501     U32     PktFailuresListLength;                      /* 08h */
0502     U8      SenseData[52]; /* Pad the IU to 64 bytes */ /* 0Ch */
0503 } MPI_TARGET_SCSI_SPI_STATUS_IU, MPI_POINTER PTR_MPI_TARGET_SCSI_SPI_STATUS_IU,
0504   TargetScsiSpiStatusIU_t, MPI_POINTER pTargetScsiSpiStatusIU_t;
0505 
0506 /*
0507  * NOTE: The SSP status IU is big-endian. When used on a little-endian system,
0508  * this structure properly orders the bytes.
0509  */
0510 typedef struct _MPI_TARGET_SSP_RSP_IU
0511 {
0512     U32     Reserved0[6]; /* reserved for SSP header */ /* 00h */
0513     /* start of RESPONSE information unit */
0514     U32     Reserved1;                                  /* 18h */
0515     U32     Reserved2;                                  /* 1Ch */
0516     U16     Reserved3;                                  /* 20h */
0517     U8      DataPres; /* lower 2 bits */                /* 22h */
0518     U8      Status;                                     /* 23h */
0519     U32     Reserved4;                                  /* 24h */
0520     U32     SenseDataLength;                            /* 28h */
0521     U32     ResponseDataLength;                         /* 2Ch */
0522     U8      ResponseSenseData[4];                       /* 30h */
0523 } MPI_TARGET_SSP_RSP_IU, MPI_POINTER PTR_MPI_TARGET_SSP_RSP_IU,
0524   MpiTargetSspRspIu_t, MPI_POINTER pMpiTargetSspRspIu_t;
0525 
0526 
0527 /****************************************************************************/
0528 /* Target Mode Abort Request                                                */
0529 /****************************************************************************/
0530 
0531 typedef struct _MSG_TARGET_MODE_ABORT_REQUEST
0532 {
0533     U8                      AbortType;                  /* 00h */
0534     U8                      Reserved;                   /* 01h */
0535     U8                      ChainOffset;                /* 02h */
0536     U8                      Function;                   /* 03h */
0537     U16                     Reserved1;                  /* 04h */
0538     U8                      Reserved2;                  /* 06h */
0539     U8                      MsgFlags;                   /* 07h */
0540     U32                     MsgContext;                 /* 08h */
0541     U32                     ReplyWord;                  /* 0Ch */
0542     U32                     MsgContextToAbort;          /* 10h */
0543 } MSG_TARGET_MODE_ABORT, MPI_POINTER PTR_MSG_TARGET_MODE_ABORT,
0544   TargetModeAbort_t, MPI_POINTER pTargetModeAbort_t;
0545 
0546 #define TARGET_MODE_ABORT_TYPE_ALL_CMD_BUFFERS      (0x00)
0547 #define TARGET_MODE_ABORT_TYPE_ALL_IO               (0x01)
0548 #define TARGET_MODE_ABORT_TYPE_EXACT_IO             (0x02)
0549 #define TARGET_MODE_ABORT_TYPE_EXACT_IO_REQUEST     (0x03)
0550 
0551 /* Target Mode Abort Reply */
0552 
0553 typedef struct _MSG_TARGET_MODE_ABORT_REPLY
0554 {
0555     U16                     Reserved;                   /* 00h */
0556     U8                      MsgLength;                  /* 02h */
0557     U8                      Function;                   /* 03h */
0558     U16                     Reserved1;                  /* 04h */
0559     U8                      Reserved2;                  /* 06h */
0560     U8                      MsgFlags;                   /* 07h */
0561     U32                     MsgContext;                 /* 08h */
0562     U16                     Reserved3;                  /* 0Ch */
0563     U16                     IOCStatus;                  /* 0Eh */
0564     U32                     IOCLogInfo;                 /* 10h */
0565     U32                     AbortCount;                 /* 14h */
0566 } MSG_TARGET_MODE_ABORT_REPLY, MPI_POINTER PTR_MSG_TARGET_MODE_ABORT_REPLY,
0567   TargetModeAbortReply_t, MPI_POINTER pTargetModeAbortReply_t;
0568 
0569 
0570 /****************************************************************************/
0571 /* Target Mode Context Reply                                                */
0572 /****************************************************************************/
0573 
0574 #define TARGET_MODE_REPLY_IO_INDEX_MASK         (0x00003FFF)
0575 #define TARGET_MODE_REPLY_IO_INDEX_SHIFT        (0)
0576 #define TARGET_MODE_REPLY_INITIATOR_INDEX_MASK  (0x03FFC000)
0577 #define TARGET_MODE_REPLY_INITIATOR_INDEX_SHIFT (14)
0578 #define TARGET_MODE_REPLY_ALIAS_MASK            (0x04000000)
0579 #define TARGET_MODE_REPLY_ALIAS_SHIFT           (26)
0580 #define TARGET_MODE_REPLY_PORT_MASK             (0x10000000)
0581 #define TARGET_MODE_REPLY_PORT_SHIFT            (28)
0582 
0583 
0584 #define GET_IO_INDEX(x)     (((x) & TARGET_MODE_REPLY_IO_INDEX_MASK)           \
0585                                     >> TARGET_MODE_REPLY_IO_INDEX_SHIFT)
0586 
0587 #define SET_IO_INDEX(t, i)                                                     \
0588             ((t) = ((t) & ~TARGET_MODE_REPLY_IO_INDEX_MASK) |                  \
0589                               (((i) << TARGET_MODE_REPLY_IO_INDEX_SHIFT) &     \
0590                                              TARGET_MODE_REPLY_IO_INDEX_MASK))
0591 
0592 #define GET_INITIATOR_INDEX(x) (((x) & TARGET_MODE_REPLY_INITIATOR_INDEX_MASK) \
0593                                    >> TARGET_MODE_REPLY_INITIATOR_INDEX_SHIFT)
0594 
0595 #define SET_INITIATOR_INDEX(t, ii)                                             \
0596         ((t) = ((t) & ~TARGET_MODE_REPLY_INITIATOR_INDEX_MASK) |               \
0597                         (((ii) << TARGET_MODE_REPLY_INITIATOR_INDEX_SHIFT) &   \
0598                                       TARGET_MODE_REPLY_INITIATOR_INDEX_MASK))
0599 
0600 #define GET_ALIAS(x) (((x) & TARGET_MODE_REPLY_ALIAS_MASK)                     \
0601                                                >> TARGET_MODE_REPLY_ALIAS_SHIFT)
0602 
0603 #define SET_ALIAS(t, a)  ((t) = ((t) & ~TARGET_MODE_REPLY_ALIAS_MASK) |        \
0604                                     (((a) << TARGET_MODE_REPLY_ALIAS_SHIFT) &  \
0605                                                  TARGET_MODE_REPLY_ALIAS_MASK))
0606 
0607 #define GET_PORT(x) (((x) & TARGET_MODE_REPLY_PORT_MASK)                       \
0608                                                >> TARGET_MODE_REPLY_PORT_SHIFT)
0609 
0610 #define SET_PORT(t, p)  ((t) = ((t) & ~TARGET_MODE_REPLY_PORT_MASK) |          \
0611                                     (((p) << TARGET_MODE_REPLY_PORT_SHIFT) &   \
0612                                                   TARGET_MODE_REPLY_PORT_MASK))
0613 
0614 /* the following obsolete values are for MPI v1.0 support */
0615 #define TARGET_MODE_REPLY_0100_MASK_HOST_INDEX       (0x000003FF)
0616 #define TARGET_MODE_REPLY_0100_SHIFT_HOST_INDEX      (0)
0617 #define TARGET_MODE_REPLY_0100_MASK_IOC_INDEX        (0x001FF800)
0618 #define TARGET_MODE_REPLY_0100_SHIFT_IOC_INDEX       (11)
0619 #define TARGET_MODE_REPLY_0100_PORT_MASK             (0x00400000)
0620 #define TARGET_MODE_REPLY_0100_PORT_SHIFT            (22)
0621 #define TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX  (0x1F800000)
0622 #define TARGET_MODE_REPLY_0100_SHIFT_INITIATOR_INDEX (23)
0623 
0624 #define GET_HOST_INDEX_0100(x) (((x) & TARGET_MODE_REPLY_0100_MASK_HOST_INDEX) \
0625                                   >> TARGET_MODE_REPLY_0100_SHIFT_HOST_INDEX)
0626 
0627 #define SET_HOST_INDEX_0100(t, hi)                                             \
0628             ((t) = ((t) & ~TARGET_MODE_REPLY_0100_MASK_HOST_INDEX) |           \
0629                          (((hi) << TARGET_MODE_REPLY_0100_SHIFT_HOST_INDEX) &  \
0630                                       TARGET_MODE_REPLY_0100_MASK_HOST_INDEX))
0631 
0632 #define GET_IOC_INDEX_0100(x)   (((x) & TARGET_MODE_REPLY_0100_MASK_IOC_INDEX) \
0633                                   >> TARGET_MODE_REPLY_0100_SHIFT_IOC_INDEX)
0634 
0635 #define SET_IOC_INDEX_0100(t, ii)                                              \
0636             ((t) = ((t) & ~TARGET_MODE_REPLY_0100_MASK_IOC_INDEX) |            \
0637                         (((ii) << TARGET_MODE_REPLY_0100_SHIFT_IOC_INDEX) &    \
0638                                      TARGET_MODE_REPLY_0100_MASK_IOC_INDEX))
0639 
0640 #define GET_INITIATOR_INDEX_0100(x)                                            \
0641             (((x) & TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX)               \
0642                               >> TARGET_MODE_REPLY_0100_SHIFT_INITIATOR_INDEX)
0643 
0644 #define SET_INITIATOR_INDEX_0100(t, ii)                                        \
0645         ((t) = ((t) & ~TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX) |          \
0646                    (((ii) << TARGET_MODE_REPLY_0100_SHIFT_INITIATOR_INDEX) &   \
0647                                 TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX))
0648 
0649 
0650 #endif
0651