162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci *  Copyright (c) 2000-2008 LSI Corporation.
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci *
662306a36Sopenharmony_ci *           Name:  mpi_targ.h
762306a36Sopenharmony_ci *          Title:  MPI Target mode messages and structures
862306a36Sopenharmony_ci *  Creation Date:  June 22, 2000
962306a36Sopenharmony_ci *
1062306a36Sopenharmony_ci *    mpi_targ.h Version:  01.05.06
1162306a36Sopenharmony_ci *
1262306a36Sopenharmony_ci *  Version History
1362306a36Sopenharmony_ci *  ---------------
1462306a36Sopenharmony_ci *
1562306a36Sopenharmony_ci *  Date      Version   Description
1662306a36Sopenharmony_ci *  --------  --------  ------------------------------------------------------
1762306a36Sopenharmony_ci *  05-08-00  00.10.01  Original release for 0.10 spec dated 4/26/2000.
1862306a36Sopenharmony_ci *  06-06-00  01.00.01  Update version number for 1.0 release.
1962306a36Sopenharmony_ci *  06-22-00  01.00.02  Added _MSG_TARGET_CMD_BUFFER_POST_REPLY structure.
2062306a36Sopenharmony_ci *                      Corrected DECSRIPTOR typo to DESCRIPTOR.
2162306a36Sopenharmony_ci *  11-02-00  01.01.01  Original release for post 1.0 work
2262306a36Sopenharmony_ci *                      Modified target mode to use IoIndex instead of
2362306a36Sopenharmony_ci *                      HostIndex and IocIndex. Added Alias.
2462306a36Sopenharmony_ci *  01-09-01  01.01.02  Added defines for TARGET_ASSIST_FLAGS_REPOST_CMD_BUFFER
2562306a36Sopenharmony_ci *                      and TARGET_STATUS_SEND_FLAGS_REPOST_CMD_BUFFER.
2662306a36Sopenharmony_ci *  02-20-01  01.01.03  Started using MPI_POINTER.
2762306a36Sopenharmony_ci *                      Added structures for MPI_TARGET_SCSI_SPI_CMD_BUFFER and
2862306a36Sopenharmony_ci *                      MPI_TARGET_FCP_CMD_BUFFER.
2962306a36Sopenharmony_ci *  03-27-01  01.01.04  Added structure offset comments.
3062306a36Sopenharmony_ci *  08-08-01  01.02.01  Original release for v1.2 work.
3162306a36Sopenharmony_ci *  09-28-01  01.02.02  Added structure for MPI_TARGET_SCSI_SPI_STATUS_IU.
3262306a36Sopenharmony_ci *                      Added PriorityReason field to some replies and
3362306a36Sopenharmony_ci *                      defined more PriorityReason codes.
3462306a36Sopenharmony_ci *                      Added some defines for to support previous version
3562306a36Sopenharmony_ci *                      of MPI.
3662306a36Sopenharmony_ci *  10-04-01  01.02.03  Added PriorityReason to MSG_TARGET_ERROR_REPLY.
3762306a36Sopenharmony_ci *  11-01-01  01.02.04  Added define for TARGET_STATUS_SEND_FLAGS_HIGH_PRIORITY.
3862306a36Sopenharmony_ci *  03-14-02  01.02.05  Modified MPI_TARGET_FCP_RSP_BUFFER to get the proper
3962306a36Sopenharmony_ci *                      byte ordering.
4062306a36Sopenharmony_ci *  05-31-02  01.02.06  Modified TARGET_MODE_REPLY_ALIAS_MASK to only include
4162306a36Sopenharmony_ci *                      one bit.
4262306a36Sopenharmony_ci *                      Added AliasIndex field to MPI_TARGET_FCP_CMD_BUFFER.
4362306a36Sopenharmony_ci *  09-16-02  01.02.07  Added flags for confirmed completion.
4462306a36Sopenharmony_ci *                      Added PRIORITY_REASON_TARGET_BUSY.
4562306a36Sopenharmony_ci *  11-15-02  01.02.08  Added AliasID field to MPI_TARGET_SCSI_SPI_CMD_BUFFER.
4662306a36Sopenharmony_ci *  04-01-03  01.02.09  Added OptionalOxid field to MPI_TARGET_FCP_CMD_BUFFER.
4762306a36Sopenharmony_ci *  05-11-04  01.03.01  Original release for MPI v1.3.
4862306a36Sopenharmony_ci *  08-19-04  01.05.01  Added new request message structures for
4962306a36Sopenharmony_ci *                      MSG_TARGET_CMD_BUF_POST_BASE_REQUEST,
5062306a36Sopenharmony_ci *                      MSG_TARGET_CMD_BUF_POST_LIST_REQUEST, and
5162306a36Sopenharmony_ci *                      MSG_TARGET_ASSIST_EXT_REQUEST.
5262306a36Sopenharmony_ci *                      Added new structures for SAS SSP Command buffer, SSP
5362306a36Sopenharmony_ci *                      Task buffer, and SSP Status IU.
5462306a36Sopenharmony_ci *  10-05-04  01.05.02  MSG_TARGET_CMD_BUFFER_POST_BASE_LIST_REPLY added.
5562306a36Sopenharmony_ci *  02-22-05  01.05.03  Changed a comment.
5662306a36Sopenharmony_ci *  03-11-05  01.05.04  Removed TargetAssistExtended Request.
5762306a36Sopenharmony_ci *  06-24-05  01.05.05  Added TargetAssistExtended structures and defines.
5862306a36Sopenharmony_ci *  03-27-06  01.05.06  Added a comment.
5962306a36Sopenharmony_ci *  --------------------------------------------------------------------------
6062306a36Sopenharmony_ci */
6162306a36Sopenharmony_ci
6262306a36Sopenharmony_ci#ifndef MPI_TARG_H
6362306a36Sopenharmony_ci#define MPI_TARG_H
6462306a36Sopenharmony_ci
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_ci/******************************************************************************
6762306a36Sopenharmony_ci*
6862306a36Sopenharmony_ci*        S C S I    T a r g e t    M e s s a g e s
6962306a36Sopenharmony_ci*
7062306a36Sopenharmony_ci*******************************************************************************/
7162306a36Sopenharmony_ci
7262306a36Sopenharmony_citypedef struct _CMD_BUFFER_DESCRIPTOR
7362306a36Sopenharmony_ci{
7462306a36Sopenharmony_ci    U16                     IoIndex;                    /* 00h */
7562306a36Sopenharmony_ci    U16                     Reserved;                   /* 02h */
7662306a36Sopenharmony_ci    union                                               /* 04h */
7762306a36Sopenharmony_ci    {
7862306a36Sopenharmony_ci        U32                 PhysicalAddress32;
7962306a36Sopenharmony_ci        U64                 PhysicalAddress64;
8062306a36Sopenharmony_ci    } u;
8162306a36Sopenharmony_ci} CMD_BUFFER_DESCRIPTOR, MPI_POINTER PTR_CMD_BUFFER_DESCRIPTOR,
8262306a36Sopenharmony_ci  CmdBufferDescriptor_t, MPI_POINTER pCmdBufferDescriptor_t;
8362306a36Sopenharmony_ci
8462306a36Sopenharmony_ci
8562306a36Sopenharmony_ci/****************************************************************************/
8662306a36Sopenharmony_ci/* Target Command Buffer Post Request                                       */
8762306a36Sopenharmony_ci/****************************************************************************/
8862306a36Sopenharmony_ci
8962306a36Sopenharmony_citypedef struct _MSG_TARGET_CMD_BUFFER_POST_REQUEST
9062306a36Sopenharmony_ci{
9162306a36Sopenharmony_ci    U8                      BufferPostFlags;            /* 00h */
9262306a36Sopenharmony_ci    U8                      BufferCount;                /* 01h */
9362306a36Sopenharmony_ci    U8                      ChainOffset;                /* 02h */
9462306a36Sopenharmony_ci    U8                      Function;                   /* 03h */
9562306a36Sopenharmony_ci    U8                      BufferLength;               /* 04h */
9662306a36Sopenharmony_ci    U8                      Reserved;                   /* 05h */
9762306a36Sopenharmony_ci    U8                      Reserved1;                  /* 06h */
9862306a36Sopenharmony_ci    U8                      MsgFlags;                   /* 07h */
9962306a36Sopenharmony_ci    U32                     MsgContext;                 /* 08h */
10062306a36Sopenharmony_ci    CMD_BUFFER_DESCRIPTOR   Buffer[1];                  /* 0Ch */
10162306a36Sopenharmony_ci} MSG_TARGET_CMD_BUFFER_POST_REQUEST, MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_REQUEST,
10262306a36Sopenharmony_ci  TargetCmdBufferPostRequest_t, MPI_POINTER pTargetCmdBufferPostRequest_t;
10362306a36Sopenharmony_ci
10462306a36Sopenharmony_ci#define CMD_BUFFER_POST_FLAGS_PORT_MASK         (0x01)
10562306a36Sopenharmony_ci#define CMD_BUFFER_POST_FLAGS_ADDR_MODE_MASK    (0x80)
10662306a36Sopenharmony_ci#define CMD_BUFFER_POST_FLAGS_ADDR_MODE_32      (0)
10762306a36Sopenharmony_ci#define CMD_BUFFER_POST_FLAGS_ADDR_MODE_64      (1)
10862306a36Sopenharmony_ci#define CMD_BUFFER_POST_FLAGS_64_BIT_ADDR       (0x80)
10962306a36Sopenharmony_ci
11062306a36Sopenharmony_ci#define CMD_BUFFER_POST_IO_INDEX_MASK           (0x00003FFF)
11162306a36Sopenharmony_ci#define CMD_BUFFER_POST_IO_INDEX_MASK_0100      (0x000003FF) /* obsolete */
11262306a36Sopenharmony_ci
11362306a36Sopenharmony_ci
11462306a36Sopenharmony_citypedef struct _MSG_TARGET_CMD_BUFFER_POST_REPLY
11562306a36Sopenharmony_ci{
11662306a36Sopenharmony_ci    U8                      BufferPostFlags;            /* 00h */
11762306a36Sopenharmony_ci    U8                      BufferCount;                /* 01h */
11862306a36Sopenharmony_ci    U8                      MsgLength;                  /* 02h */
11962306a36Sopenharmony_ci    U8                      Function;                   /* 03h */
12062306a36Sopenharmony_ci    U8                      BufferLength;               /* 04h */
12162306a36Sopenharmony_ci    U8                      Reserved;                   /* 05h */
12262306a36Sopenharmony_ci    U8                      Reserved1;                  /* 06h */
12362306a36Sopenharmony_ci    U8                      MsgFlags;                   /* 07h */
12462306a36Sopenharmony_ci    U32                     MsgContext;                 /* 08h */
12562306a36Sopenharmony_ci    U16                     Reserved2;                  /* 0Ch */
12662306a36Sopenharmony_ci    U16                     IOCStatus;                  /* 0Eh */
12762306a36Sopenharmony_ci    U32                     IOCLogInfo;                 /* 10h */
12862306a36Sopenharmony_ci} MSG_TARGET_CMD_BUFFER_POST_REPLY, MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_REPLY,
12962306a36Sopenharmony_ci  TargetCmdBufferPostReply_t, MPI_POINTER pTargetCmdBufferPostReply_t;
13062306a36Sopenharmony_ci
13162306a36Sopenharmony_ci/* the following structure is obsolete as of MPI v1.2 */
13262306a36Sopenharmony_citypedef struct _MSG_PRIORITY_CMD_RECEIVED_REPLY
13362306a36Sopenharmony_ci{
13462306a36Sopenharmony_ci    U16                     Reserved;                   /* 00h */
13562306a36Sopenharmony_ci    U8                      MsgLength;                  /* 02h */
13662306a36Sopenharmony_ci    U8                      Function;                   /* 03h */
13762306a36Sopenharmony_ci    U16                     Reserved1;                  /* 04h */
13862306a36Sopenharmony_ci    U8                      Reserved2;                  /* 06h */
13962306a36Sopenharmony_ci    U8                      MsgFlags;                   /* 07h */
14062306a36Sopenharmony_ci    U32                     MsgContext;                 /* 08h */
14162306a36Sopenharmony_ci    U8                      PriorityReason;             /* 0Ch */
14262306a36Sopenharmony_ci    U8                      Reserved3;                  /* 0Dh */
14362306a36Sopenharmony_ci    U16                     IOCStatus;                  /* 0Eh */
14462306a36Sopenharmony_ci    U32                     IOCLogInfo;                 /* 10h */
14562306a36Sopenharmony_ci    U32                     ReplyWord;                  /* 14h */
14662306a36Sopenharmony_ci} MSG_PRIORITY_CMD_RECEIVED_REPLY, MPI_POINTER PTR_MSG_PRIORITY_CMD_RECEIVED_REPLY,
14762306a36Sopenharmony_ci  PriorityCommandReceivedReply_t, MPI_POINTER pPriorityCommandReceivedReply_t;
14862306a36Sopenharmony_ci
14962306a36Sopenharmony_ci
15062306a36Sopenharmony_citypedef struct _MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY
15162306a36Sopenharmony_ci{
15262306a36Sopenharmony_ci    U16                     Reserved;                   /* 00h */
15362306a36Sopenharmony_ci    U8                      MsgLength;                  /* 02h */
15462306a36Sopenharmony_ci    U8                      Function;                   /* 03h */
15562306a36Sopenharmony_ci    U16                     Reserved1;                  /* 04h */
15662306a36Sopenharmony_ci    U8                      Reserved2;                  /* 06h */
15762306a36Sopenharmony_ci    U8                      MsgFlags;                   /* 07h */
15862306a36Sopenharmony_ci    U32                     MsgContext;                 /* 08h */
15962306a36Sopenharmony_ci    U8                      PriorityReason;             /* 0Ch */
16062306a36Sopenharmony_ci    U8                      Reserved3;                  /* 0Dh */
16162306a36Sopenharmony_ci    U16                     IOCStatus;                  /* 0Eh */
16262306a36Sopenharmony_ci    U32                     IOCLogInfo;                 /* 10h */
16362306a36Sopenharmony_ci    U32                     ReplyWord;                  /* 14h */
16462306a36Sopenharmony_ci} MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY,
16562306a36Sopenharmony_ci  MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY,
16662306a36Sopenharmony_ci  TargetCmdBufferPostErrorReply_t, MPI_POINTER pTargetCmdBufferPostErrorReply_t;
16762306a36Sopenharmony_ci
16862306a36Sopenharmony_ci#define PRIORITY_REASON_NO_DISCONNECT           (0x00)
16962306a36Sopenharmony_ci#define PRIORITY_REASON_SCSI_TASK_MANAGEMENT    (0x01)
17062306a36Sopenharmony_ci#define PRIORITY_REASON_CMD_PARITY_ERR          (0x02)
17162306a36Sopenharmony_ci#define PRIORITY_REASON_MSG_OUT_PARITY_ERR      (0x03)
17262306a36Sopenharmony_ci#define PRIORITY_REASON_LQ_CRC_ERR              (0x04)
17362306a36Sopenharmony_ci#define PRIORITY_REASON_CMD_CRC_ERR             (0x05)
17462306a36Sopenharmony_ci#define PRIORITY_REASON_PROTOCOL_ERR            (0x06)
17562306a36Sopenharmony_ci#define PRIORITY_REASON_DATA_OUT_PARITY_ERR     (0x07)
17662306a36Sopenharmony_ci#define PRIORITY_REASON_DATA_OUT_CRC_ERR        (0x08)
17762306a36Sopenharmony_ci#define PRIORITY_REASON_TARGET_BUSY             (0x09)
17862306a36Sopenharmony_ci#define PRIORITY_REASON_UNKNOWN                 (0xFF)
17962306a36Sopenharmony_ci
18062306a36Sopenharmony_ci
18162306a36Sopenharmony_ci/****************************************************************************/
18262306a36Sopenharmony_ci/* Target Command Buffer Post Base Request                                  */
18362306a36Sopenharmony_ci/****************************************************************************/
18462306a36Sopenharmony_ci
18562306a36Sopenharmony_citypedef struct _MSG_TARGET_CMD_BUF_POST_BASE_REQUEST
18662306a36Sopenharmony_ci{
18762306a36Sopenharmony_ci    U8                      BufferPostFlags;            /* 00h */
18862306a36Sopenharmony_ci    U8                      PortNumber;                 /* 01h */
18962306a36Sopenharmony_ci    U8                      ChainOffset;                /* 02h */
19062306a36Sopenharmony_ci    U8                      Function;                   /* 03h */
19162306a36Sopenharmony_ci    U16                     TotalCmdBuffers;            /* 04h */
19262306a36Sopenharmony_ci    U8                      Reserved;                   /* 06h */
19362306a36Sopenharmony_ci    U8                      MsgFlags;                   /* 07h */
19462306a36Sopenharmony_ci    U32                     MsgContext;                 /* 08h */
19562306a36Sopenharmony_ci    U32                     Reserved1;                  /* 0Ch */
19662306a36Sopenharmony_ci    U16                     CmdBufferLength;            /* 10h */
19762306a36Sopenharmony_ci    U16                     NextCmdBufferOffset;        /* 12h */
19862306a36Sopenharmony_ci    U32                     BaseAddressLow;             /* 14h */
19962306a36Sopenharmony_ci    U32                     BaseAddressHigh;            /* 18h */
20062306a36Sopenharmony_ci} MSG_TARGET_CMD_BUF_POST_BASE_REQUEST,
20162306a36Sopenharmony_ci  MPI_POINTER PTR__MSG_TARGET_CMD_BUF_POST_BASE_REQUEST,
20262306a36Sopenharmony_ci  TargetCmdBufferPostBaseRequest_t,
20362306a36Sopenharmony_ci  MPI_POINTER pTargetCmdBufferPostBaseRequest_t;
20462306a36Sopenharmony_ci
20562306a36Sopenharmony_ci#define CMD_BUFFER_POST_BASE_FLAGS_AUTO_POST_ALL    (0x01)
20662306a36Sopenharmony_ci
20762306a36Sopenharmony_ci
20862306a36Sopenharmony_citypedef struct _MSG_TARGET_CMD_BUFFER_POST_BASE_LIST_REPLY
20962306a36Sopenharmony_ci{
21062306a36Sopenharmony_ci    U16                     Reserved;                   /* 00h */
21162306a36Sopenharmony_ci    U8                      MsgLength;                  /* 02h */
21262306a36Sopenharmony_ci    U8                      Function;                   /* 03h */
21362306a36Sopenharmony_ci    U16                     Reserved1;                  /* 04h */
21462306a36Sopenharmony_ci    U8                      Reserved2;                  /* 06h */
21562306a36Sopenharmony_ci    U8                      MsgFlags;                   /* 07h */
21662306a36Sopenharmony_ci    U32                     MsgContext;                 /* 08h */
21762306a36Sopenharmony_ci    U16                     Reserved3;                  /* 0Ch */
21862306a36Sopenharmony_ci    U16                     IOCStatus;                  /* 0Eh */
21962306a36Sopenharmony_ci    U32                     IOCLogInfo;                 /* 10h */
22062306a36Sopenharmony_ci} MSG_TARGET_CMD_BUFFER_POST_BASE_LIST_REPLY,
22162306a36Sopenharmony_ci  MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_BASE_LIST_REPLY,
22262306a36Sopenharmony_ci  TargetCmdBufferPostBaseListReply_t,
22362306a36Sopenharmony_ci  MPI_POINTER pTargetCmdBufferPostBaseListReply_t;
22462306a36Sopenharmony_ci
22562306a36Sopenharmony_ci
22662306a36Sopenharmony_ci/****************************************************************************/
22762306a36Sopenharmony_ci/* Target Command Buffer Post List Request                                  */
22862306a36Sopenharmony_ci/****************************************************************************/
22962306a36Sopenharmony_ci
23062306a36Sopenharmony_citypedef struct _MSG_TARGET_CMD_BUF_POST_LIST_REQUEST
23162306a36Sopenharmony_ci{
23262306a36Sopenharmony_ci    U8                      Reserved;                   /* 00h */
23362306a36Sopenharmony_ci    U8                      PortNumber;                 /* 01h */
23462306a36Sopenharmony_ci    U8                      ChainOffset;                /* 02h */
23562306a36Sopenharmony_ci    U8                      Function;                   /* 03h */
23662306a36Sopenharmony_ci    U16                     CmdBufferCount;             /* 04h */
23762306a36Sopenharmony_ci    U8                      Reserved1;                  /* 06h */
23862306a36Sopenharmony_ci    U8                      MsgFlags;                   /* 07h */
23962306a36Sopenharmony_ci    U32                     MsgContext;                 /* 08h */
24062306a36Sopenharmony_ci    U32                     Reserved2;                  /* 0Ch */
24162306a36Sopenharmony_ci    U16                     IoIndex[2];                 /* 10h */
24262306a36Sopenharmony_ci} MSG_TARGET_CMD_BUF_POST_LIST_REQUEST,
24362306a36Sopenharmony_ci  MPI_POINTER PTR_MSG_TARGET_CMD_BUF_POST_LIST_REQUEST,
24462306a36Sopenharmony_ci  TargetCmdBufferPostListRequest_t,
24562306a36Sopenharmony_ci  MPI_POINTER pTargetCmdBufferPostListRequest_t;
24662306a36Sopenharmony_ci
24762306a36Sopenharmony_ci
24862306a36Sopenharmony_ci/****************************************************************************/
24962306a36Sopenharmony_ci/* Command Buffer Formats (with 16 byte CDB)                                */
25062306a36Sopenharmony_ci/****************************************************************************/
25162306a36Sopenharmony_ci
25262306a36Sopenharmony_citypedef struct _MPI_TARGET_FCP_CMD_BUFFER
25362306a36Sopenharmony_ci{
25462306a36Sopenharmony_ci    U8      FcpLun[8];                                  /* 00h */
25562306a36Sopenharmony_ci    U8      FcpCntl[4];                                 /* 08h */
25662306a36Sopenharmony_ci    U8      FcpCdb[16];                                 /* 0Ch */
25762306a36Sopenharmony_ci    U32     FcpDl;                                      /* 1Ch */
25862306a36Sopenharmony_ci    U8      AliasIndex;                                 /* 20h */
25962306a36Sopenharmony_ci    U8      Reserved1;                                  /* 21h */
26062306a36Sopenharmony_ci    U16     OptionalOxid;                               /* 22h */
26162306a36Sopenharmony_ci} MPI_TARGET_FCP_CMD_BUFFER, MPI_POINTER PTR_MPI_TARGET_FCP_CMD_BUFFER,
26262306a36Sopenharmony_ci  MpiTargetFcpCmdBuffer, MPI_POINTER pMpiTargetFcpCmdBuffer;
26362306a36Sopenharmony_ci
26462306a36Sopenharmony_ci
26562306a36Sopenharmony_citypedef struct _MPI_TARGET_SCSI_SPI_CMD_BUFFER
26662306a36Sopenharmony_ci{
26762306a36Sopenharmony_ci    /* SPI L_Q information unit */
26862306a36Sopenharmony_ci    U8      L_QType;                                    /* 00h */
26962306a36Sopenharmony_ci    U8      Reserved;                                   /* 01h */
27062306a36Sopenharmony_ci    U16     Tag;                                        /* 02h */
27162306a36Sopenharmony_ci    U8      LogicalUnitNumber[8];                       /* 04h */
27262306a36Sopenharmony_ci    U32     DataLength;                                 /* 0Ch */
27362306a36Sopenharmony_ci    /* SPI command information unit */
27462306a36Sopenharmony_ci    U8      ReservedFirstByteOfCommandIU;               /* 10h */
27562306a36Sopenharmony_ci    U8      TaskAttribute;                              /* 11h */
27662306a36Sopenharmony_ci    U8      TaskManagementFlags;                        /* 12h */
27762306a36Sopenharmony_ci    U8      AdditionalCDBLength;                        /* 13h */
27862306a36Sopenharmony_ci    U8      CDB[16];                                    /* 14h */
27962306a36Sopenharmony_ci    /* Alias ID */
28062306a36Sopenharmony_ci    U8      AliasID;                                    /* 24h */
28162306a36Sopenharmony_ci    U8      Reserved1;                                  /* 25h */
28262306a36Sopenharmony_ci    U16     Reserved2;                                  /* 26h */
28362306a36Sopenharmony_ci} MPI_TARGET_SCSI_SPI_CMD_BUFFER,
28462306a36Sopenharmony_ci  MPI_POINTER PTR_MPI_TARGET_SCSI_SPI_CMD_BUFFER,
28562306a36Sopenharmony_ci  MpiTargetScsiSpiCmdBuffer, MPI_POINTER pMpiTargetScsiSpiCmdBuffer;
28662306a36Sopenharmony_ci
28762306a36Sopenharmony_ci
28862306a36Sopenharmony_citypedef struct _MPI_TARGET_SSP_CMD_BUFFER
28962306a36Sopenharmony_ci{
29062306a36Sopenharmony_ci    U8      FrameType;                                  /* 00h */
29162306a36Sopenharmony_ci    U8      Reserved1;                                  /* 01h */
29262306a36Sopenharmony_ci    U16     Reserved2;                                  /* 02h */
29362306a36Sopenharmony_ci    U16     InitiatorTag;                               /* 04h */
29462306a36Sopenharmony_ci    U16     DevHandle;                                  /* 06h */
29562306a36Sopenharmony_ci    /* COMMAND information unit starts here */
29662306a36Sopenharmony_ci    U8      LogicalUnitNumber[8];                       /* 08h */
29762306a36Sopenharmony_ci    U8      Reserved3;                                  /* 10h */
29862306a36Sopenharmony_ci    U8      TaskAttribute; /* lower 3 bits */           /* 11h */
29962306a36Sopenharmony_ci    U8      Reserved4;                                  /* 12h */
30062306a36Sopenharmony_ci    U8      AdditionalCDBLength; /* upper 5 bits */     /* 13h */
30162306a36Sopenharmony_ci    U8      CDB[16];                                    /* 14h */
30262306a36Sopenharmony_ci    /* Additional CDB bytes extend past the CDB field */
30362306a36Sopenharmony_ci} MPI_TARGET_SSP_CMD_BUFFER, MPI_POINTER PTR_MPI_TARGET_SSP_CMD_BUFFER,
30462306a36Sopenharmony_ci  MpiTargetSspCmdBuffer, MPI_POINTER pMpiTargetSspCmdBuffer;
30562306a36Sopenharmony_ci
30662306a36Sopenharmony_citypedef struct _MPI_TARGET_SSP_TASK_BUFFER
30762306a36Sopenharmony_ci{
30862306a36Sopenharmony_ci    U8      FrameType;                                  /* 00h */
30962306a36Sopenharmony_ci    U8      Reserved1;                                  /* 01h */
31062306a36Sopenharmony_ci    U16     Reserved2;                                  /* 02h */
31162306a36Sopenharmony_ci    U16     InitiatorTag;                               /* 04h */
31262306a36Sopenharmony_ci    U16     DevHandle;                                  /* 06h */
31362306a36Sopenharmony_ci    /* TASK information unit starts here */
31462306a36Sopenharmony_ci    U8      LogicalUnitNumber[8];                       /* 08h */
31562306a36Sopenharmony_ci    U8      Reserved3;                                  /* 10h */
31662306a36Sopenharmony_ci    U8      Reserved4;                                  /* 11h */
31762306a36Sopenharmony_ci    U8      TaskManagementFunction;                     /* 12h */
31862306a36Sopenharmony_ci    U8      Reserved5;                                  /* 13h */
31962306a36Sopenharmony_ci    U16     ManagedTaskTag;                             /* 14h */
32062306a36Sopenharmony_ci    U16     Reserved6;                                  /* 16h */
32162306a36Sopenharmony_ci    U32     Reserved7;                                  /* 18h */
32262306a36Sopenharmony_ci    U32     Reserved8;                                  /* 1Ch */
32362306a36Sopenharmony_ci    U32     Reserved9;                                  /* 20h */
32462306a36Sopenharmony_ci} MPI_TARGET_SSP_TASK_BUFFER, MPI_POINTER PTR_MPI_TARGET_SSP_TASK_BUFFER,
32562306a36Sopenharmony_ci  MpiTargetSspTaskBuffer, MPI_POINTER pMpiTargetSspTaskBuffer;
32662306a36Sopenharmony_ci
32762306a36Sopenharmony_ci
32862306a36Sopenharmony_ci/****************************************************************************/
32962306a36Sopenharmony_ci/* Target Assist Request                                                    */
33062306a36Sopenharmony_ci/****************************************************************************/
33162306a36Sopenharmony_ci
33262306a36Sopenharmony_citypedef struct _MSG_TARGET_ASSIST_REQUEST
33362306a36Sopenharmony_ci{
33462306a36Sopenharmony_ci    U8                      StatusCode;                 /* 00h */
33562306a36Sopenharmony_ci    U8                      TargetAssistFlags;          /* 01h */
33662306a36Sopenharmony_ci    U8                      ChainOffset;                /* 02h */
33762306a36Sopenharmony_ci    U8                      Function;                   /* 03h */
33862306a36Sopenharmony_ci    U16                     QueueTag;                   /* 04h */
33962306a36Sopenharmony_ci    U8                      Reserved;                   /* 06h */
34062306a36Sopenharmony_ci    U8                      MsgFlags;                   /* 07h */
34162306a36Sopenharmony_ci    U32                     MsgContext;                 /* 08h */
34262306a36Sopenharmony_ci    U32                     ReplyWord;                  /* 0Ch */
34362306a36Sopenharmony_ci    U8                      LUN[8];                     /* 10h */
34462306a36Sopenharmony_ci    U32                     RelativeOffset;             /* 18h */
34562306a36Sopenharmony_ci    U32                     DataLength;                 /* 1Ch */
34662306a36Sopenharmony_ci    SGE_IO_UNION            SGL[1];                     /* 20h */
34762306a36Sopenharmony_ci} MSG_TARGET_ASSIST_REQUEST, MPI_POINTER PTR_MSG_TARGET_ASSIST_REQUEST,
34862306a36Sopenharmony_ci  TargetAssistRequest_t, MPI_POINTER pTargetAssistRequest_t;
34962306a36Sopenharmony_ci
35062306a36Sopenharmony_ci#define TARGET_ASSIST_FLAGS_DATA_DIRECTION          (0x01)
35162306a36Sopenharmony_ci#define TARGET_ASSIST_FLAGS_AUTO_STATUS             (0x02)
35262306a36Sopenharmony_ci#define TARGET_ASSIST_FLAGS_HIGH_PRIORITY           (0x04)
35362306a36Sopenharmony_ci#define TARGET_ASSIST_FLAGS_CONFIRMED               (0x08)
35462306a36Sopenharmony_ci#define TARGET_ASSIST_FLAGS_REPOST_CMD_BUFFER       (0x80)
35562306a36Sopenharmony_ci
35662306a36Sopenharmony_ci/* Standard Target Mode Reply message */
35762306a36Sopenharmony_citypedef struct _MSG_TARGET_ERROR_REPLY
35862306a36Sopenharmony_ci{
35962306a36Sopenharmony_ci    U16                     Reserved;                   /* 00h */
36062306a36Sopenharmony_ci    U8                      MsgLength;                  /* 02h */
36162306a36Sopenharmony_ci    U8                      Function;                   /* 03h */
36262306a36Sopenharmony_ci    U16                     Reserved1;                  /* 04h */
36362306a36Sopenharmony_ci    U8                      Reserved2;                  /* 06h */
36462306a36Sopenharmony_ci    U8                      MsgFlags;                   /* 07h */
36562306a36Sopenharmony_ci    U32                     MsgContext;                 /* 08h */
36662306a36Sopenharmony_ci    U8                      PriorityReason;             /* 0Ch */
36762306a36Sopenharmony_ci    U8                      Reserved3;                  /* 0Dh */
36862306a36Sopenharmony_ci    U16                     IOCStatus;                  /* 0Eh */
36962306a36Sopenharmony_ci    U32                     IOCLogInfo;                 /* 10h */
37062306a36Sopenharmony_ci    U32                     ReplyWord;                  /* 14h */
37162306a36Sopenharmony_ci    U32                     TransferCount;              /* 18h */
37262306a36Sopenharmony_ci} MSG_TARGET_ERROR_REPLY, MPI_POINTER PTR_MSG_TARGET_ERROR_REPLY,
37362306a36Sopenharmony_ci  TargetErrorReply_t, MPI_POINTER pTargetErrorReply_t;
37462306a36Sopenharmony_ci
37562306a36Sopenharmony_ci
37662306a36Sopenharmony_ci/****************************************************************************/
37762306a36Sopenharmony_ci/* Target Assist Extended Request                                           */
37862306a36Sopenharmony_ci/****************************************************************************/
37962306a36Sopenharmony_ci
38062306a36Sopenharmony_citypedef struct _MSG_TARGET_ASSIST_EXT_REQUEST
38162306a36Sopenharmony_ci{
38262306a36Sopenharmony_ci    U8                      StatusCode;                     /* 00h */
38362306a36Sopenharmony_ci    U8                      TargetAssistFlags;              /* 01h */
38462306a36Sopenharmony_ci    U8                      ChainOffset;                    /* 02h */
38562306a36Sopenharmony_ci    U8                      Function;                       /* 03h */
38662306a36Sopenharmony_ci    U16                     QueueTag;                       /* 04h */
38762306a36Sopenharmony_ci    U8                      Reserved1;                      /* 06h */
38862306a36Sopenharmony_ci    U8                      MsgFlags;                       /* 07h */
38962306a36Sopenharmony_ci    U32                     MsgContext;                     /* 08h */
39062306a36Sopenharmony_ci    U32                     ReplyWord;                      /* 0Ch */
39162306a36Sopenharmony_ci    U8                      LUN[8];                         /* 10h */
39262306a36Sopenharmony_ci    U32                     RelativeOffset;                 /* 18h */
39362306a36Sopenharmony_ci    U32                     Reserved2;                      /* 1Ch */
39462306a36Sopenharmony_ci    U32                     Reserved3;                      /* 20h */
39562306a36Sopenharmony_ci    U32                     PrimaryReferenceTag;            /* 24h */
39662306a36Sopenharmony_ci    U16                     PrimaryApplicationTag;          /* 28h */
39762306a36Sopenharmony_ci    U16                     PrimaryApplicationTagMask;      /* 2Ah */
39862306a36Sopenharmony_ci    U32                     Reserved4;                      /* 2Ch */
39962306a36Sopenharmony_ci    U32                     DataLength;                     /* 30h */
40062306a36Sopenharmony_ci    U32                     BidirectionalDataLength;        /* 34h */
40162306a36Sopenharmony_ci    U32                     SecondaryReferenceTag;          /* 38h */
40262306a36Sopenharmony_ci    U16                     SecondaryApplicationTag;        /* 3Ch */
40362306a36Sopenharmony_ci    U16                     Reserved5;                      /* 3Eh */
40462306a36Sopenharmony_ci    U16                     EEDPFlags;                      /* 40h */
40562306a36Sopenharmony_ci    U16                     ApplicationTagTranslationMask;  /* 42h */
40662306a36Sopenharmony_ci    U32                     EEDPBlockSize;                  /* 44h */
40762306a36Sopenharmony_ci    U8                      SGLOffset0;                     /* 48h */
40862306a36Sopenharmony_ci    U8                      SGLOffset1;                     /* 49h */
40962306a36Sopenharmony_ci    U8                      SGLOffset2;                     /* 4Ah */
41062306a36Sopenharmony_ci    U8                      SGLOffset3;                     /* 4Bh */
41162306a36Sopenharmony_ci    U32                     Reserved6;                      /* 4Ch */
41262306a36Sopenharmony_ci    SGE_IO_UNION            SGL[1];                         /* 50h */
41362306a36Sopenharmony_ci} MSG_TARGET_ASSIST_EXT_REQUEST, MPI_POINTER PTR_MSG_TARGET_ASSIST_EXT_REQUEST,
41462306a36Sopenharmony_ci  TargetAssistExtRequest_t, MPI_POINTER pTargetAssistExtRequest_t;
41562306a36Sopenharmony_ci
41662306a36Sopenharmony_ci/* see the defines after MSG_TARGET_ASSIST_REQUEST for TargetAssistFlags */
41762306a36Sopenharmony_ci
41862306a36Sopenharmony_ci/* defines for the MsgFlags field */
41962306a36Sopenharmony_ci#define TARGET_ASSIST_EXT_MSGFLAGS_BIDIRECTIONAL        (0x20)
42062306a36Sopenharmony_ci#define TARGET_ASSIST_EXT_MSGFLAGS_MULTICAST            (0x10)
42162306a36Sopenharmony_ci#define TARGET_ASSIST_EXT_MSGFLAGS_SGL_OFFSET_CHAINS    (0x08)
42262306a36Sopenharmony_ci
42362306a36Sopenharmony_ci/* defines for the EEDPFlags field */
42462306a36Sopenharmony_ci#define TARGET_ASSIST_EXT_EEDP_MASK_OP          (0x0007)
42562306a36Sopenharmony_ci#define TARGET_ASSIST_EXT_EEDP_NOOP_OP          (0x0000)
42662306a36Sopenharmony_ci#define TARGET_ASSIST_EXT_EEDP_CHK_OP           (0x0001)
42762306a36Sopenharmony_ci#define TARGET_ASSIST_EXT_EEDP_STRIP_OP         (0x0002)
42862306a36Sopenharmony_ci#define TARGET_ASSIST_EXT_EEDP_CHKRM_OP         (0x0003)
42962306a36Sopenharmony_ci#define TARGET_ASSIST_EXT_EEDP_INSERT_OP        (0x0004)
43062306a36Sopenharmony_ci#define TARGET_ASSIST_EXT_EEDP_REPLACE_OP       (0x0006)
43162306a36Sopenharmony_ci#define TARGET_ASSIST_EXT_EEDP_CHKREGEN_OP      (0x0007)
43262306a36Sopenharmony_ci
43362306a36Sopenharmony_ci#define TARGET_ASSIST_EXT_EEDP_PASS_REF_TAG     (0x0008)
43462306a36Sopenharmony_ci
43562306a36Sopenharmony_ci#define TARGET_ASSIST_EXT_EEDP_T10_CHK_MASK     (0x0700)
43662306a36Sopenharmony_ci#define TARGET_ASSIST_EXT_EEDP_T10_CHK_GUARD    (0x0100)
43762306a36Sopenharmony_ci#define TARGET_ASSIST_EXT_EEDP_T10_CHK_APPTAG   (0x0200)
43862306a36Sopenharmony_ci#define TARGET_ASSIST_EXT_EEDP_T10_CHK_REFTAG   (0x0400)
43962306a36Sopenharmony_ci#define TARGET_ASSIST_EXT_EEDP_T10_CHK_SHIFT    (8)
44062306a36Sopenharmony_ci
44162306a36Sopenharmony_ci#define TARGET_ASSIST_EXT_EEDP_INC_SEC_APPTAG   (0x1000)
44262306a36Sopenharmony_ci#define TARGET_ASSIST_EXT_EEDP_INC_PRI_APPTAG   (0x2000)
44362306a36Sopenharmony_ci#define TARGET_ASSIST_EXT_EEDP_INC_SEC_REFTAG   (0x4000)
44462306a36Sopenharmony_ci#define TARGET_ASSIST_EXT_EEDP_INC_PRI_REFTAG   (0x8000)
44562306a36Sopenharmony_ci
44662306a36Sopenharmony_ci
44762306a36Sopenharmony_ci/****************************************************************************/
44862306a36Sopenharmony_ci/* Target Status Send Request                                               */
44962306a36Sopenharmony_ci/****************************************************************************/
45062306a36Sopenharmony_ci
45162306a36Sopenharmony_citypedef struct _MSG_TARGET_STATUS_SEND_REQUEST
45262306a36Sopenharmony_ci{
45362306a36Sopenharmony_ci    U8                      StatusCode;                 /* 00h */
45462306a36Sopenharmony_ci    U8                      StatusFlags;                /* 01h */
45562306a36Sopenharmony_ci    U8                      ChainOffset;                /* 02h */
45662306a36Sopenharmony_ci    U8                      Function;                   /* 03h */
45762306a36Sopenharmony_ci    U16                     QueueTag;                   /* 04h */
45862306a36Sopenharmony_ci    U8                      Reserved;                   /* 06h */
45962306a36Sopenharmony_ci    U8                      MsgFlags;                   /* 07h */
46062306a36Sopenharmony_ci    U32                     MsgContext;                 /* 08h */
46162306a36Sopenharmony_ci    U32                     ReplyWord;                  /* 0Ch */
46262306a36Sopenharmony_ci    U8                      LUN[8];                     /* 10h */
46362306a36Sopenharmony_ci    SGE_SIMPLE_UNION        StatusDataSGE;              /* 18h */
46462306a36Sopenharmony_ci} MSG_TARGET_STATUS_SEND_REQUEST, MPI_POINTER PTR_MSG_TARGET_STATUS_SEND_REQUEST,
46562306a36Sopenharmony_ci  TargetStatusSendRequest_t, MPI_POINTER pTargetStatusSendRequest_t;
46662306a36Sopenharmony_ci
46762306a36Sopenharmony_ci#define TARGET_STATUS_SEND_FLAGS_AUTO_GOOD_STATUS   (0x01)
46862306a36Sopenharmony_ci#define TARGET_STATUS_SEND_FLAGS_HIGH_PRIORITY      (0x04)
46962306a36Sopenharmony_ci#define TARGET_STATUS_SEND_FLAGS_CONFIRMED          (0x08)
47062306a36Sopenharmony_ci#define TARGET_STATUS_SEND_FLAGS_REPOST_CMD_BUFFER  (0x80)
47162306a36Sopenharmony_ci
47262306a36Sopenharmony_ci/*
47362306a36Sopenharmony_ci * NOTE: FCP_RSP data is big-endian. When used on a little-endian system, this
47462306a36Sopenharmony_ci * structure properly orders the bytes.
47562306a36Sopenharmony_ci */
47662306a36Sopenharmony_citypedef struct _MPI_TARGET_FCP_RSP_BUFFER
47762306a36Sopenharmony_ci{
47862306a36Sopenharmony_ci    U8      Reserved0[8];                               /* 00h */
47962306a36Sopenharmony_ci    U8      Reserved1[2];                               /* 08h */
48062306a36Sopenharmony_ci    U8      FcpFlags;                                   /* 0Ah */
48162306a36Sopenharmony_ci    U8      FcpStatus;                                  /* 0Bh */
48262306a36Sopenharmony_ci    U32     FcpResid;                                   /* 0Ch */
48362306a36Sopenharmony_ci    U32     FcpSenseLength;                             /* 10h */
48462306a36Sopenharmony_ci    U32     FcpResponseLength;                          /* 14h */
48562306a36Sopenharmony_ci    U8      FcpResponseData[8];                         /* 18h */
48662306a36Sopenharmony_ci    U8      FcpSenseData[32]; /* Pad to 64 bytes */     /* 20h */
48762306a36Sopenharmony_ci} MPI_TARGET_FCP_RSP_BUFFER, MPI_POINTER PTR_MPI_TARGET_FCP_RSP_BUFFER,
48862306a36Sopenharmony_ci  MpiTargetFcpRspBuffer, MPI_POINTER pMpiTargetFcpRspBuffer;
48962306a36Sopenharmony_ci
49062306a36Sopenharmony_ci/*
49162306a36Sopenharmony_ci * NOTE: The SPI status IU is big-endian. When used on a little-endian system,
49262306a36Sopenharmony_ci * this structure properly orders the bytes.
49362306a36Sopenharmony_ci */
49462306a36Sopenharmony_citypedef struct _MPI_TARGET_SCSI_SPI_STATUS_IU
49562306a36Sopenharmony_ci{
49662306a36Sopenharmony_ci    U8      Reserved0;                                  /* 00h */
49762306a36Sopenharmony_ci    U8      Reserved1;                                  /* 01h */
49862306a36Sopenharmony_ci    U8      Valid;                                      /* 02h */
49962306a36Sopenharmony_ci    U8      Status;                                     /* 03h */
50062306a36Sopenharmony_ci    U32     SenseDataListLength;                        /* 04h */
50162306a36Sopenharmony_ci    U32     PktFailuresListLength;                      /* 08h */
50262306a36Sopenharmony_ci    U8      SenseData[52]; /* Pad the IU to 64 bytes */ /* 0Ch */
50362306a36Sopenharmony_ci} MPI_TARGET_SCSI_SPI_STATUS_IU, MPI_POINTER PTR_MPI_TARGET_SCSI_SPI_STATUS_IU,
50462306a36Sopenharmony_ci  TargetScsiSpiStatusIU_t, MPI_POINTER pTargetScsiSpiStatusIU_t;
50562306a36Sopenharmony_ci
50662306a36Sopenharmony_ci/*
50762306a36Sopenharmony_ci * NOTE: The SSP status IU is big-endian. When used on a little-endian system,
50862306a36Sopenharmony_ci * this structure properly orders the bytes.
50962306a36Sopenharmony_ci */
51062306a36Sopenharmony_citypedef struct _MPI_TARGET_SSP_RSP_IU
51162306a36Sopenharmony_ci{
51262306a36Sopenharmony_ci    U32     Reserved0[6]; /* reserved for SSP header */ /* 00h */
51362306a36Sopenharmony_ci    /* start of RESPONSE information unit */
51462306a36Sopenharmony_ci    U32     Reserved1;                                  /* 18h */
51562306a36Sopenharmony_ci    U32     Reserved2;                                  /* 1Ch */
51662306a36Sopenharmony_ci    U16     Reserved3;                                  /* 20h */
51762306a36Sopenharmony_ci    U8      DataPres; /* lower 2 bits */                /* 22h */
51862306a36Sopenharmony_ci    U8      Status;                                     /* 23h */
51962306a36Sopenharmony_ci    U32     Reserved4;                                  /* 24h */
52062306a36Sopenharmony_ci    U32     SenseDataLength;                            /* 28h */
52162306a36Sopenharmony_ci    U32     ResponseDataLength;                         /* 2Ch */
52262306a36Sopenharmony_ci    U8      ResponseSenseData[4];                       /* 30h */
52362306a36Sopenharmony_ci} MPI_TARGET_SSP_RSP_IU, MPI_POINTER PTR_MPI_TARGET_SSP_RSP_IU,
52462306a36Sopenharmony_ci  MpiTargetSspRspIu_t, MPI_POINTER pMpiTargetSspRspIu_t;
52562306a36Sopenharmony_ci
52662306a36Sopenharmony_ci
52762306a36Sopenharmony_ci/****************************************************************************/
52862306a36Sopenharmony_ci/* Target Mode Abort Request                                                */
52962306a36Sopenharmony_ci/****************************************************************************/
53062306a36Sopenharmony_ci
53162306a36Sopenharmony_citypedef struct _MSG_TARGET_MODE_ABORT_REQUEST
53262306a36Sopenharmony_ci{
53362306a36Sopenharmony_ci    U8                      AbortType;                  /* 00h */
53462306a36Sopenharmony_ci    U8                      Reserved;                   /* 01h */
53562306a36Sopenharmony_ci    U8                      ChainOffset;                /* 02h */
53662306a36Sopenharmony_ci    U8                      Function;                   /* 03h */
53762306a36Sopenharmony_ci    U16                     Reserved1;                  /* 04h */
53862306a36Sopenharmony_ci    U8                      Reserved2;                  /* 06h */
53962306a36Sopenharmony_ci    U8                      MsgFlags;                   /* 07h */
54062306a36Sopenharmony_ci    U32                     MsgContext;                 /* 08h */
54162306a36Sopenharmony_ci    U32                     ReplyWord;                  /* 0Ch */
54262306a36Sopenharmony_ci    U32                     MsgContextToAbort;          /* 10h */
54362306a36Sopenharmony_ci} MSG_TARGET_MODE_ABORT, MPI_POINTER PTR_MSG_TARGET_MODE_ABORT,
54462306a36Sopenharmony_ci  TargetModeAbort_t, MPI_POINTER pTargetModeAbort_t;
54562306a36Sopenharmony_ci
54662306a36Sopenharmony_ci#define TARGET_MODE_ABORT_TYPE_ALL_CMD_BUFFERS      (0x00)
54762306a36Sopenharmony_ci#define TARGET_MODE_ABORT_TYPE_ALL_IO               (0x01)
54862306a36Sopenharmony_ci#define TARGET_MODE_ABORT_TYPE_EXACT_IO             (0x02)
54962306a36Sopenharmony_ci#define TARGET_MODE_ABORT_TYPE_EXACT_IO_REQUEST     (0x03)
55062306a36Sopenharmony_ci
55162306a36Sopenharmony_ci/* Target Mode Abort Reply */
55262306a36Sopenharmony_ci
55362306a36Sopenharmony_citypedef struct _MSG_TARGET_MODE_ABORT_REPLY
55462306a36Sopenharmony_ci{
55562306a36Sopenharmony_ci    U16                     Reserved;                   /* 00h */
55662306a36Sopenharmony_ci    U8                      MsgLength;                  /* 02h */
55762306a36Sopenharmony_ci    U8                      Function;                   /* 03h */
55862306a36Sopenharmony_ci    U16                     Reserved1;                  /* 04h */
55962306a36Sopenharmony_ci    U8                      Reserved2;                  /* 06h */
56062306a36Sopenharmony_ci    U8                      MsgFlags;                   /* 07h */
56162306a36Sopenharmony_ci    U32                     MsgContext;                 /* 08h */
56262306a36Sopenharmony_ci    U16                     Reserved3;                  /* 0Ch */
56362306a36Sopenharmony_ci    U16                     IOCStatus;                  /* 0Eh */
56462306a36Sopenharmony_ci    U32                     IOCLogInfo;                 /* 10h */
56562306a36Sopenharmony_ci    U32                     AbortCount;                 /* 14h */
56662306a36Sopenharmony_ci} MSG_TARGET_MODE_ABORT_REPLY, MPI_POINTER PTR_MSG_TARGET_MODE_ABORT_REPLY,
56762306a36Sopenharmony_ci  TargetModeAbortReply_t, MPI_POINTER pTargetModeAbortReply_t;
56862306a36Sopenharmony_ci
56962306a36Sopenharmony_ci
57062306a36Sopenharmony_ci/****************************************************************************/
57162306a36Sopenharmony_ci/* Target Mode Context Reply                                                */
57262306a36Sopenharmony_ci/****************************************************************************/
57362306a36Sopenharmony_ci
57462306a36Sopenharmony_ci#define TARGET_MODE_REPLY_IO_INDEX_MASK         (0x00003FFF)
57562306a36Sopenharmony_ci#define TARGET_MODE_REPLY_IO_INDEX_SHIFT        (0)
57662306a36Sopenharmony_ci#define TARGET_MODE_REPLY_INITIATOR_INDEX_MASK  (0x03FFC000)
57762306a36Sopenharmony_ci#define TARGET_MODE_REPLY_INITIATOR_INDEX_SHIFT (14)
57862306a36Sopenharmony_ci#define TARGET_MODE_REPLY_ALIAS_MASK            (0x04000000)
57962306a36Sopenharmony_ci#define TARGET_MODE_REPLY_ALIAS_SHIFT           (26)
58062306a36Sopenharmony_ci#define TARGET_MODE_REPLY_PORT_MASK             (0x10000000)
58162306a36Sopenharmony_ci#define TARGET_MODE_REPLY_PORT_SHIFT            (28)
58262306a36Sopenharmony_ci
58362306a36Sopenharmony_ci
58462306a36Sopenharmony_ci#define GET_IO_INDEX(x)     (((x) & TARGET_MODE_REPLY_IO_INDEX_MASK)           \
58562306a36Sopenharmony_ci                                    >> TARGET_MODE_REPLY_IO_INDEX_SHIFT)
58662306a36Sopenharmony_ci
58762306a36Sopenharmony_ci#define SET_IO_INDEX(t, i)                                                     \
58862306a36Sopenharmony_ci            ((t) = ((t) & ~TARGET_MODE_REPLY_IO_INDEX_MASK) |                  \
58962306a36Sopenharmony_ci                              (((i) << TARGET_MODE_REPLY_IO_INDEX_SHIFT) &     \
59062306a36Sopenharmony_ci                                             TARGET_MODE_REPLY_IO_INDEX_MASK))
59162306a36Sopenharmony_ci
59262306a36Sopenharmony_ci#define GET_INITIATOR_INDEX(x) (((x) & TARGET_MODE_REPLY_INITIATOR_INDEX_MASK) \
59362306a36Sopenharmony_ci                                   >> TARGET_MODE_REPLY_INITIATOR_INDEX_SHIFT)
59462306a36Sopenharmony_ci
59562306a36Sopenharmony_ci#define SET_INITIATOR_INDEX(t, ii)                                             \
59662306a36Sopenharmony_ci        ((t) = ((t) & ~TARGET_MODE_REPLY_INITIATOR_INDEX_MASK) |               \
59762306a36Sopenharmony_ci                        (((ii) << TARGET_MODE_REPLY_INITIATOR_INDEX_SHIFT) &   \
59862306a36Sopenharmony_ci                                      TARGET_MODE_REPLY_INITIATOR_INDEX_MASK))
59962306a36Sopenharmony_ci
60062306a36Sopenharmony_ci#define GET_ALIAS(x) (((x) & TARGET_MODE_REPLY_ALIAS_MASK)                     \
60162306a36Sopenharmony_ci                                               >> TARGET_MODE_REPLY_ALIAS_SHIFT)
60262306a36Sopenharmony_ci
60362306a36Sopenharmony_ci#define SET_ALIAS(t, a)  ((t) = ((t) & ~TARGET_MODE_REPLY_ALIAS_MASK) |        \
60462306a36Sopenharmony_ci                                    (((a) << TARGET_MODE_REPLY_ALIAS_SHIFT) &  \
60562306a36Sopenharmony_ci                                                 TARGET_MODE_REPLY_ALIAS_MASK))
60662306a36Sopenharmony_ci
60762306a36Sopenharmony_ci#define GET_PORT(x) (((x) & TARGET_MODE_REPLY_PORT_MASK)                       \
60862306a36Sopenharmony_ci                                               >> TARGET_MODE_REPLY_PORT_SHIFT)
60962306a36Sopenharmony_ci
61062306a36Sopenharmony_ci#define SET_PORT(t, p)  ((t) = ((t) & ~TARGET_MODE_REPLY_PORT_MASK) |          \
61162306a36Sopenharmony_ci                                    (((p) << TARGET_MODE_REPLY_PORT_SHIFT) &   \
61262306a36Sopenharmony_ci                                                  TARGET_MODE_REPLY_PORT_MASK))
61362306a36Sopenharmony_ci
61462306a36Sopenharmony_ci/* the following obsolete values are for MPI v1.0 support */
61562306a36Sopenharmony_ci#define TARGET_MODE_REPLY_0100_MASK_HOST_INDEX       (0x000003FF)
61662306a36Sopenharmony_ci#define TARGET_MODE_REPLY_0100_SHIFT_HOST_INDEX      (0)
61762306a36Sopenharmony_ci#define TARGET_MODE_REPLY_0100_MASK_IOC_INDEX        (0x001FF800)
61862306a36Sopenharmony_ci#define TARGET_MODE_REPLY_0100_SHIFT_IOC_INDEX       (11)
61962306a36Sopenharmony_ci#define TARGET_MODE_REPLY_0100_PORT_MASK             (0x00400000)
62062306a36Sopenharmony_ci#define TARGET_MODE_REPLY_0100_PORT_SHIFT            (22)
62162306a36Sopenharmony_ci#define TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX  (0x1F800000)
62262306a36Sopenharmony_ci#define TARGET_MODE_REPLY_0100_SHIFT_INITIATOR_INDEX (23)
62362306a36Sopenharmony_ci
62462306a36Sopenharmony_ci#define GET_HOST_INDEX_0100(x) (((x) & TARGET_MODE_REPLY_0100_MASK_HOST_INDEX) \
62562306a36Sopenharmony_ci                                  >> TARGET_MODE_REPLY_0100_SHIFT_HOST_INDEX)
62662306a36Sopenharmony_ci
62762306a36Sopenharmony_ci#define SET_HOST_INDEX_0100(t, hi)                                             \
62862306a36Sopenharmony_ci            ((t) = ((t) & ~TARGET_MODE_REPLY_0100_MASK_HOST_INDEX) |           \
62962306a36Sopenharmony_ci                         (((hi) << TARGET_MODE_REPLY_0100_SHIFT_HOST_INDEX) &  \
63062306a36Sopenharmony_ci                                      TARGET_MODE_REPLY_0100_MASK_HOST_INDEX))
63162306a36Sopenharmony_ci
63262306a36Sopenharmony_ci#define GET_IOC_INDEX_0100(x)   (((x) & TARGET_MODE_REPLY_0100_MASK_IOC_INDEX) \
63362306a36Sopenharmony_ci                                  >> TARGET_MODE_REPLY_0100_SHIFT_IOC_INDEX)
63462306a36Sopenharmony_ci
63562306a36Sopenharmony_ci#define SET_IOC_INDEX_0100(t, ii)                                              \
63662306a36Sopenharmony_ci            ((t) = ((t) & ~TARGET_MODE_REPLY_0100_MASK_IOC_INDEX) |            \
63762306a36Sopenharmony_ci                        (((ii) << TARGET_MODE_REPLY_0100_SHIFT_IOC_INDEX) &    \
63862306a36Sopenharmony_ci                                     TARGET_MODE_REPLY_0100_MASK_IOC_INDEX))
63962306a36Sopenharmony_ci
64062306a36Sopenharmony_ci#define GET_INITIATOR_INDEX_0100(x)                                            \
64162306a36Sopenharmony_ci            (((x) & TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX)               \
64262306a36Sopenharmony_ci                              >> TARGET_MODE_REPLY_0100_SHIFT_INITIATOR_INDEX)
64362306a36Sopenharmony_ci
64462306a36Sopenharmony_ci#define SET_INITIATOR_INDEX_0100(t, ii)                                        \
64562306a36Sopenharmony_ci        ((t) = ((t) & ~TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX) |          \
64662306a36Sopenharmony_ci                   (((ii) << TARGET_MODE_REPLY_0100_SHIFT_INITIATOR_INDEX) &   \
64762306a36Sopenharmony_ci                                TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX))
64862306a36Sopenharmony_ci
64962306a36Sopenharmony_ci
65062306a36Sopenharmony_ci#endif
65162306a36Sopenharmony_ci
652