18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *  Copyright (c) 2000-2008 LSI Corporation.
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci *           Name:  mpi_init.h
78c2ecf20Sopenharmony_ci *          Title:  MPI initiator mode messages and structures
88c2ecf20Sopenharmony_ci *  Creation Date:  June 8, 2000
98c2ecf20Sopenharmony_ci *
108c2ecf20Sopenharmony_ci *    mpi_init.h Version:  01.05.09
118c2ecf20Sopenharmony_ci *
128c2ecf20Sopenharmony_ci *  Version History
138c2ecf20Sopenharmony_ci *  ---------------
148c2ecf20Sopenharmony_ci *
158c2ecf20Sopenharmony_ci *  Date      Version   Description
168c2ecf20Sopenharmony_ci *  --------  --------  ------------------------------------------------------
178c2ecf20Sopenharmony_ci *  05-08-00  00.10.01  Original release for 0.10 spec dated 4/26/2000.
188c2ecf20Sopenharmony_ci *  05-24-00  00.10.02  Added SenseBufferLength to _MSG_SCSI_IO_REPLY.
198c2ecf20Sopenharmony_ci *  06-06-00  01.00.01  Update version number for 1.0 release.
208c2ecf20Sopenharmony_ci *  06-08-00  01.00.02  Added MPI_SCSI_RSP_INFO_ definitions.
218c2ecf20Sopenharmony_ci *  11-02-00  01.01.01  Original release for post 1.0 work.
228c2ecf20Sopenharmony_ci *  12-04-00  01.01.02  Added MPI_SCSIIO_CONTROL_NO_DISCONNECT.
238c2ecf20Sopenharmony_ci *  02-20-01  01.01.03  Started using MPI_POINTER.
248c2ecf20Sopenharmony_ci *  03-27-01  01.01.04  Added structure offset comments.
258c2ecf20Sopenharmony_ci *  04-10-01  01.01.05  Added new MsgFlag for MSG_SCSI_TASK_MGMT.
268c2ecf20Sopenharmony_ci *  08-08-01  01.02.01  Original release for v1.2 work.
278c2ecf20Sopenharmony_ci *  08-29-01  01.02.02  Added MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET.
288c2ecf20Sopenharmony_ci *                      Added MPI_SCSI_STATE_QUEUE_TAG_REJECTED for
298c2ecf20Sopenharmony_ci *                      MSG_SCSI_IO_REPLY.
308c2ecf20Sopenharmony_ci *  09-28-01  01.02.03  Added structures and defines for SCSI Enclosure
318c2ecf20Sopenharmony_ci *                      Processor messages.
328c2ecf20Sopenharmony_ci *  10-04-01  01.02.04  Added defines for SEP request Action field.
338c2ecf20Sopenharmony_ci *  05-31-02  01.02.05  Added MPI_SCSIIO_MSGFLGS_CMD_DETERMINES_DATA_DIR define
348c2ecf20Sopenharmony_ci *                      for SCSI IO requests.
358c2ecf20Sopenharmony_ci *  11-15-02  01.02.06  Added special extended SCSI Status defines for FCP.
368c2ecf20Sopenharmony_ci *  06-26-03  01.02.07  Added MPI_SCSI_STATUS_FCPEXT_UNASSIGNED define.
378c2ecf20Sopenharmony_ci *  05-11-04  01.03.01  Original release for MPI v1.3.
388c2ecf20Sopenharmony_ci *  08-19-04  01.05.01  Added MsgFlags defines for EEDP to SCSI IO request.
398c2ecf20Sopenharmony_ci *                      Added new word to MSG_SCSI_IO_REPLY to add TaskTag field
408c2ecf20Sopenharmony_ci *                      and a reserved U16.
418c2ecf20Sopenharmony_ci *                      Added new MSG_SCSI_IO32_REQUEST structure.
428c2ecf20Sopenharmony_ci *                      Added a TaskType of Clear Task Set to SCSI
438c2ecf20Sopenharmony_ci *                      Task Management request.
448c2ecf20Sopenharmony_ci *  12-07-04  01.05.02  Added support for Task Management Query Task.
458c2ecf20Sopenharmony_ci *  01-15-05  01.05.03  Modified SCSI Enclosure Processor Request to support
468c2ecf20Sopenharmony_ci *                      WWID addressing.
478c2ecf20Sopenharmony_ci *  03-11-05  01.05.04  Removed EEDP flags from SCSI IO Request.
488c2ecf20Sopenharmony_ci *                      Removed SCSI IO 32 Request.
498c2ecf20Sopenharmony_ci *                      Modified SCSI Enclosure Processor Request and Reply to
508c2ecf20Sopenharmony_ci *                      support Enclosure/Slot addressing rather than WWID
518c2ecf20Sopenharmony_ci *                      addressing.
528c2ecf20Sopenharmony_ci *  06-24-05  01.05.05  Added SCSI IO 32 structures and defines.
538c2ecf20Sopenharmony_ci *                      Added four new defines for SEP SlotStatus.
548c2ecf20Sopenharmony_ci *  08-03-05  01.05.06  Fixed some MPI_SCSIIO32_MSGFLGS_ defines to make them
558c2ecf20Sopenharmony_ci *                      unique in the first 32 characters.
568c2ecf20Sopenharmony_ci *  03-27-06  01.05.07  Added Task Management type of Clear ACA.
578c2ecf20Sopenharmony_ci *  10-11-06  01.05.08  Shortened define for Task Management type of Clear ACA.
588c2ecf20Sopenharmony_ci *  02-28-07  01.05.09  Defined two new MsgFlags bits for SCSI Task Management
598c2ecf20Sopenharmony_ci *                      Request: Do Not Send Task IU and Soft Reset Option.
608c2ecf20Sopenharmony_ci *  --------------------------------------------------------------------------
618c2ecf20Sopenharmony_ci */
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ci#ifndef MPI_INIT_H
648c2ecf20Sopenharmony_ci#define MPI_INIT_H
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ci/*****************************************************************************
688c2ecf20Sopenharmony_ci*
698c2ecf20Sopenharmony_ci*               S C S I    I n i t i a t o r    M e s s a g e s
708c2ecf20Sopenharmony_ci*
718c2ecf20Sopenharmony_ci*****************************************************************************/
728c2ecf20Sopenharmony_ci
738c2ecf20Sopenharmony_ci/****************************************************************************/
748c2ecf20Sopenharmony_ci/*  SCSI IO messages and associated structures                              */
758c2ecf20Sopenharmony_ci/****************************************************************************/
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_citypedef struct _MSG_SCSI_IO_REQUEST
788c2ecf20Sopenharmony_ci{
798c2ecf20Sopenharmony_ci    U8                      TargetID;           /* 00h */
808c2ecf20Sopenharmony_ci    U8                      Bus;                /* 01h */
818c2ecf20Sopenharmony_ci    U8                      ChainOffset;        /* 02h */
828c2ecf20Sopenharmony_ci    U8                      Function;           /* 03h */
838c2ecf20Sopenharmony_ci    U8                      CDBLength;          /* 04h */
848c2ecf20Sopenharmony_ci    U8                      SenseBufferLength;  /* 05h */
858c2ecf20Sopenharmony_ci    U8                      Reserved;           /* 06h */
868c2ecf20Sopenharmony_ci    U8                      MsgFlags;           /* 07h */
878c2ecf20Sopenharmony_ci    U32                     MsgContext;         /* 08h */
888c2ecf20Sopenharmony_ci    U8                      LUN[8];             /* 0Ch */
898c2ecf20Sopenharmony_ci    U32                     Control;            /* 14h */
908c2ecf20Sopenharmony_ci    U8                      CDB[16];            /* 18h */
918c2ecf20Sopenharmony_ci    U32                     DataLength;         /* 28h */
928c2ecf20Sopenharmony_ci    U32                     SenseBufferLowAddr; /* 2Ch */
938c2ecf20Sopenharmony_ci    SGE_IO_UNION            SGL;                /* 30h */
948c2ecf20Sopenharmony_ci} MSG_SCSI_IO_REQUEST, MPI_POINTER PTR_MSG_SCSI_IO_REQUEST,
958c2ecf20Sopenharmony_ci  SCSIIORequest_t, MPI_POINTER pSCSIIORequest_t;
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci/* SCSI IO MsgFlags bits */
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ci#define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH              (0x01)
1018c2ecf20Sopenharmony_ci#define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_32           (0x00)
1028c2ecf20Sopenharmony_ci#define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_64           (0x01)
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci#define MPI_SCSIIO_MSGFLGS_SENSE_LOCATION           (0x02)
1058c2ecf20Sopenharmony_ci#define MPI_SCSIIO_MSGFLGS_SENSE_LOC_HOST           (0x00)
1068c2ecf20Sopenharmony_ci#define MPI_SCSIIO_MSGFLGS_SENSE_LOC_IOC            (0x02)
1078c2ecf20Sopenharmony_ci
1088c2ecf20Sopenharmony_ci#define MPI_SCSIIO_MSGFLGS_CMD_DETERMINES_DATA_DIR  (0x04)
1098c2ecf20Sopenharmony_ci
1108c2ecf20Sopenharmony_ci/* SCSI IO LUN fields */
1118c2ecf20Sopenharmony_ci
1128c2ecf20Sopenharmony_ci#define MPI_SCSIIO_LUN_FIRST_LEVEL_ADDRESSING   (0x0000FFFF)
1138c2ecf20Sopenharmony_ci#define MPI_SCSIIO_LUN_SECOND_LEVEL_ADDRESSING  (0xFFFF0000)
1148c2ecf20Sopenharmony_ci#define MPI_SCSIIO_LUN_THIRD_LEVEL_ADDRESSING   (0x0000FFFF)
1158c2ecf20Sopenharmony_ci#define MPI_SCSIIO_LUN_FOURTH_LEVEL_ADDRESSING  (0xFFFF0000)
1168c2ecf20Sopenharmony_ci#define MPI_SCSIIO_LUN_LEVEL_1_WORD             (0xFF00)
1178c2ecf20Sopenharmony_ci#define MPI_SCSIIO_LUN_LEVEL_1_DWORD            (0x0000FF00)
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_ci/* SCSI IO Control bits */
1208c2ecf20Sopenharmony_ci
1218c2ecf20Sopenharmony_ci#define MPI_SCSIIO_CONTROL_DATADIRECTION_MASK   (0x03000000)
1228c2ecf20Sopenharmony_ci#define MPI_SCSIIO_CONTROL_NODATATRANSFER       (0x00000000)
1238c2ecf20Sopenharmony_ci#define MPI_SCSIIO_CONTROL_WRITE                (0x01000000)
1248c2ecf20Sopenharmony_ci#define MPI_SCSIIO_CONTROL_READ                 (0x02000000)
1258c2ecf20Sopenharmony_ci
1268c2ecf20Sopenharmony_ci#define MPI_SCSIIO_CONTROL_ADDCDBLEN_MASK       (0x3C000000)
1278c2ecf20Sopenharmony_ci#define MPI_SCSIIO_CONTROL_ADDCDBLEN_SHIFT      (26)
1288c2ecf20Sopenharmony_ci
1298c2ecf20Sopenharmony_ci#define MPI_SCSIIO_CONTROL_TASKATTRIBUTE_MASK   (0x00000700)
1308c2ecf20Sopenharmony_ci#define MPI_SCSIIO_CONTROL_SIMPLEQ              (0x00000000)
1318c2ecf20Sopenharmony_ci#define MPI_SCSIIO_CONTROL_HEADOFQ              (0x00000100)
1328c2ecf20Sopenharmony_ci#define MPI_SCSIIO_CONTROL_ORDEREDQ             (0x00000200)
1338c2ecf20Sopenharmony_ci#define MPI_SCSIIO_CONTROL_ACAQ                 (0x00000400)
1348c2ecf20Sopenharmony_ci#define MPI_SCSIIO_CONTROL_UNTAGGED             (0x00000500)
1358c2ecf20Sopenharmony_ci#define MPI_SCSIIO_CONTROL_NO_DISCONNECT        (0x00000700)
1368c2ecf20Sopenharmony_ci
1378c2ecf20Sopenharmony_ci#define MPI_SCSIIO_CONTROL_TASKMANAGE_MASK      (0x00FF0000)
1388c2ecf20Sopenharmony_ci#define MPI_SCSIIO_CONTROL_OBSOLETE             (0x00800000)
1398c2ecf20Sopenharmony_ci#define MPI_SCSIIO_CONTROL_CLEAR_ACA_RSV        (0x00400000)
1408c2ecf20Sopenharmony_ci#define MPI_SCSIIO_CONTROL_TARGET_RESET         (0x00200000)
1418c2ecf20Sopenharmony_ci#define MPI_SCSIIO_CONTROL_LUN_RESET_RSV        (0x00100000)
1428c2ecf20Sopenharmony_ci#define MPI_SCSIIO_CONTROL_RESERVED             (0x00080000)
1438c2ecf20Sopenharmony_ci#define MPI_SCSIIO_CONTROL_CLR_TASK_SET_RSV     (0x00040000)
1448c2ecf20Sopenharmony_ci#define MPI_SCSIIO_CONTROL_ABORT_TASK_SET       (0x00020000)
1458c2ecf20Sopenharmony_ci#define MPI_SCSIIO_CONTROL_RESERVED2            (0x00010000)
1468c2ecf20Sopenharmony_ci
1478c2ecf20Sopenharmony_ci
1488c2ecf20Sopenharmony_ci/* SCSI IO reply structure */
1498c2ecf20Sopenharmony_citypedef struct _MSG_SCSI_IO_REPLY
1508c2ecf20Sopenharmony_ci{
1518c2ecf20Sopenharmony_ci    U8                      TargetID;           /* 00h */
1528c2ecf20Sopenharmony_ci    U8                      Bus;                /* 01h */
1538c2ecf20Sopenharmony_ci    U8                      MsgLength;          /* 02h */
1548c2ecf20Sopenharmony_ci    U8                      Function;           /* 03h */
1558c2ecf20Sopenharmony_ci    U8                      CDBLength;          /* 04h */
1568c2ecf20Sopenharmony_ci    U8                      SenseBufferLength;  /* 05h */
1578c2ecf20Sopenharmony_ci    U8                      Reserved;           /* 06h */
1588c2ecf20Sopenharmony_ci    U8                      MsgFlags;           /* 07h */
1598c2ecf20Sopenharmony_ci    U32                     MsgContext;         /* 08h */
1608c2ecf20Sopenharmony_ci    U8                      SCSIStatus;         /* 0Ch */
1618c2ecf20Sopenharmony_ci    U8                      SCSIState;          /* 0Dh */
1628c2ecf20Sopenharmony_ci    U16                     IOCStatus;          /* 0Eh */
1638c2ecf20Sopenharmony_ci    U32                     IOCLogInfo;         /* 10h */
1648c2ecf20Sopenharmony_ci    U32                     TransferCount;      /* 14h */
1658c2ecf20Sopenharmony_ci    U32                     SenseCount;         /* 18h */
1668c2ecf20Sopenharmony_ci    U32                     ResponseInfo;       /* 1Ch */
1678c2ecf20Sopenharmony_ci    U16                     TaskTag;            /* 20h */
1688c2ecf20Sopenharmony_ci    U16                     Reserved1;          /* 22h */
1698c2ecf20Sopenharmony_ci} MSG_SCSI_IO_REPLY, MPI_POINTER PTR_MSG_SCSI_IO_REPLY,
1708c2ecf20Sopenharmony_ci  SCSIIOReply_t, MPI_POINTER pSCSIIOReply_t;
1718c2ecf20Sopenharmony_ci
1728c2ecf20Sopenharmony_ci
1738c2ecf20Sopenharmony_ci/* SCSI IO Reply SCSIStatus values (SAM-2 status codes) */
1748c2ecf20Sopenharmony_ci
1758c2ecf20Sopenharmony_ci#define MPI_SCSI_STATUS_SUCCESS                 (0x00)
1768c2ecf20Sopenharmony_ci#define MPI_SCSI_STATUS_CHECK_CONDITION         (0x02)
1778c2ecf20Sopenharmony_ci#define MPI_SCSI_STATUS_CONDITION_MET           (0x04)
1788c2ecf20Sopenharmony_ci#define MPI_SCSI_STATUS_BUSY                    (0x08)
1798c2ecf20Sopenharmony_ci#define MPI_SCSI_STATUS_INTERMEDIATE            (0x10)
1808c2ecf20Sopenharmony_ci#define MPI_SCSI_STATUS_INTERMEDIATE_CONDMET    (0x14)
1818c2ecf20Sopenharmony_ci#define MPI_SCSI_STATUS_RESERVATION_CONFLICT    (0x18)
1828c2ecf20Sopenharmony_ci#define MPI_SCSI_STATUS_COMMAND_TERMINATED      (0x22)
1838c2ecf20Sopenharmony_ci#define MPI_SCSI_STATUS_TASK_SET_FULL           (0x28)
1848c2ecf20Sopenharmony_ci#define MPI_SCSI_STATUS_ACA_ACTIVE              (0x30)
1858c2ecf20Sopenharmony_ci
1868c2ecf20Sopenharmony_ci#define MPI_SCSI_STATUS_FCPEXT_DEVICE_LOGGED_OUT    (0x80)
1878c2ecf20Sopenharmony_ci#define MPI_SCSI_STATUS_FCPEXT_NO_LINK              (0x81)
1888c2ecf20Sopenharmony_ci#define MPI_SCSI_STATUS_FCPEXT_UNASSIGNED           (0x82)
1898c2ecf20Sopenharmony_ci
1908c2ecf20Sopenharmony_ci
1918c2ecf20Sopenharmony_ci/* SCSI IO Reply SCSIState values */
1928c2ecf20Sopenharmony_ci
1938c2ecf20Sopenharmony_ci#define MPI_SCSI_STATE_AUTOSENSE_VALID          (0x01)
1948c2ecf20Sopenharmony_ci#define MPI_SCSI_STATE_AUTOSENSE_FAILED         (0x02)
1958c2ecf20Sopenharmony_ci#define MPI_SCSI_STATE_NO_SCSI_STATUS           (0x04)
1968c2ecf20Sopenharmony_ci#define MPI_SCSI_STATE_TERMINATED               (0x08)
1978c2ecf20Sopenharmony_ci#define MPI_SCSI_STATE_RESPONSE_INFO_VALID      (0x10)
1988c2ecf20Sopenharmony_ci#define MPI_SCSI_STATE_QUEUE_TAG_REJECTED       (0x20)
1998c2ecf20Sopenharmony_ci
2008c2ecf20Sopenharmony_ci/* SCSI IO Reply ResponseInfo values */
2018c2ecf20Sopenharmony_ci/* (FCP-1 RSP_CODE values and SPI-3 Packetized Failure codes) */
2028c2ecf20Sopenharmony_ci
2038c2ecf20Sopenharmony_ci#define MPI_SCSI_RSP_INFO_FUNCTION_COMPLETE     (0x00000000)
2048c2ecf20Sopenharmony_ci#define MPI_SCSI_RSP_INFO_FCP_BURST_LEN_ERROR   (0x01000000)
2058c2ecf20Sopenharmony_ci#define MPI_SCSI_RSP_INFO_CMND_FIELDS_INVALID   (0x02000000)
2068c2ecf20Sopenharmony_ci#define MPI_SCSI_RSP_INFO_FCP_DATA_RO_ERROR     (0x03000000)
2078c2ecf20Sopenharmony_ci#define MPI_SCSI_RSP_INFO_TASK_MGMT_UNSUPPORTED (0x04000000)
2088c2ecf20Sopenharmony_ci#define MPI_SCSI_RSP_INFO_TASK_MGMT_FAILED      (0x05000000)
2098c2ecf20Sopenharmony_ci#define MPI_SCSI_RSP_INFO_SPI_LQ_INVALID_TYPE   (0x06000000)
2108c2ecf20Sopenharmony_ci
2118c2ecf20Sopenharmony_ci#define MPI_SCSI_TASKTAG_UNKNOWN                (0xFFFF)
2128c2ecf20Sopenharmony_ci
2138c2ecf20Sopenharmony_ci
2148c2ecf20Sopenharmony_ci/****************************************************************************/
2158c2ecf20Sopenharmony_ci/*  SCSI IO 32 messages and associated structures                           */
2168c2ecf20Sopenharmony_ci/****************************************************************************/
2178c2ecf20Sopenharmony_ci
2188c2ecf20Sopenharmony_citypedef struct
2198c2ecf20Sopenharmony_ci{
2208c2ecf20Sopenharmony_ci    U8                      CDB[20];                    /* 00h */
2218c2ecf20Sopenharmony_ci    U32                     PrimaryReferenceTag;        /* 14h */
2228c2ecf20Sopenharmony_ci    U16                     PrimaryApplicationTag;      /* 18h */
2238c2ecf20Sopenharmony_ci    U16                     PrimaryApplicationTagMask;  /* 1Ah */
2248c2ecf20Sopenharmony_ci    U32                     TransferLength;             /* 1Ch */
2258c2ecf20Sopenharmony_ci} MPI_SCSI_IO32_CDB_EEDP32, MPI_POINTER PTR_MPI_SCSI_IO32_CDB_EEDP32,
2268c2ecf20Sopenharmony_ci  MpiScsiIo32CdbEedp32_t, MPI_POINTER pMpiScsiIo32CdbEedp32_t;
2278c2ecf20Sopenharmony_ci
2288c2ecf20Sopenharmony_citypedef struct
2298c2ecf20Sopenharmony_ci{
2308c2ecf20Sopenharmony_ci    U8                      CDB[16];                    /* 00h */
2318c2ecf20Sopenharmony_ci    U32                     DataLength;                 /* 10h */
2328c2ecf20Sopenharmony_ci    U32                     PrimaryReferenceTag;        /* 14h */
2338c2ecf20Sopenharmony_ci    U16                     PrimaryApplicationTag;      /* 18h */
2348c2ecf20Sopenharmony_ci    U16                     PrimaryApplicationTagMask;  /* 1Ah */
2358c2ecf20Sopenharmony_ci    U32                     TransferLength;             /* 1Ch */
2368c2ecf20Sopenharmony_ci} MPI_SCSI_IO32_CDB_EEDP16, MPI_POINTER PTR_MPI_SCSI_IO32_CDB_EEDP16,
2378c2ecf20Sopenharmony_ci  MpiScsiIo32CdbEedp16_t, MPI_POINTER pMpiScsiIo32CdbEedp16_t;
2388c2ecf20Sopenharmony_ci
2398c2ecf20Sopenharmony_citypedef union
2408c2ecf20Sopenharmony_ci{
2418c2ecf20Sopenharmony_ci    U8                       CDB32[32];
2428c2ecf20Sopenharmony_ci    MPI_SCSI_IO32_CDB_EEDP32 EEDP32;
2438c2ecf20Sopenharmony_ci    MPI_SCSI_IO32_CDB_EEDP16 EEDP16;
2448c2ecf20Sopenharmony_ci    SGE_SIMPLE_UNION         SGE;
2458c2ecf20Sopenharmony_ci} MPI_SCSI_IO32_CDB_UNION, MPI_POINTER PTR_MPI_SCSI_IO32_CDB_UNION,
2468c2ecf20Sopenharmony_ci  MpiScsiIo32Cdb_t, MPI_POINTER pMpiScsiIo32Cdb_t;
2478c2ecf20Sopenharmony_ci
2488c2ecf20Sopenharmony_citypedef struct
2498c2ecf20Sopenharmony_ci{
2508c2ecf20Sopenharmony_ci    U8                      TargetID;           /* 00h */
2518c2ecf20Sopenharmony_ci    U8                      Bus;                /* 01h */
2528c2ecf20Sopenharmony_ci    U16                     Reserved1;          /* 02h */
2538c2ecf20Sopenharmony_ci    U32                     Reserved2;          /* 04h */
2548c2ecf20Sopenharmony_ci} MPI_SCSI_IO32_BUS_TARGET_ID_FORM, MPI_POINTER PTR_MPI_SCSI_IO32_BUS_TARGET_ID_FORM,
2558c2ecf20Sopenharmony_ci  MpiScsiIo32BusTargetIdForm_t, MPI_POINTER pMpiScsiIo32BusTargetIdForm_t;
2568c2ecf20Sopenharmony_ci
2578c2ecf20Sopenharmony_citypedef union
2588c2ecf20Sopenharmony_ci{
2598c2ecf20Sopenharmony_ci    MPI_SCSI_IO32_BUS_TARGET_ID_FORM    SCSIID;
2608c2ecf20Sopenharmony_ci    U64                                 WWID;
2618c2ecf20Sopenharmony_ci} MPI_SCSI_IO32_ADDRESS, MPI_POINTER PTR_MPI_SCSI_IO32_ADDRESS,
2628c2ecf20Sopenharmony_ci  MpiScsiIo32Address_t, MPI_POINTER pMpiScsiIo32Address_t;
2638c2ecf20Sopenharmony_ci
2648c2ecf20Sopenharmony_citypedef struct _MSG_SCSI_IO32_REQUEST
2658c2ecf20Sopenharmony_ci{
2668c2ecf20Sopenharmony_ci    U8                          Port;                           /* 00h */
2678c2ecf20Sopenharmony_ci    U8                          Reserved1;                      /* 01h */
2688c2ecf20Sopenharmony_ci    U8                          ChainOffset;                    /* 02h */
2698c2ecf20Sopenharmony_ci    U8                          Function;                       /* 03h */
2708c2ecf20Sopenharmony_ci    U8                          CDBLength;                      /* 04h */
2718c2ecf20Sopenharmony_ci    U8                          SenseBufferLength;              /* 05h */
2728c2ecf20Sopenharmony_ci    U8                          Flags;                          /* 06h */
2738c2ecf20Sopenharmony_ci    U8                          MsgFlags;                       /* 07h */
2748c2ecf20Sopenharmony_ci    U32                         MsgContext;                     /* 08h */
2758c2ecf20Sopenharmony_ci    U8                          LUN[8];                         /* 0Ch */
2768c2ecf20Sopenharmony_ci    U32                         Control;                        /* 14h */
2778c2ecf20Sopenharmony_ci    MPI_SCSI_IO32_CDB_UNION     CDB;                            /* 18h */
2788c2ecf20Sopenharmony_ci    U32                         DataLength;                     /* 38h */
2798c2ecf20Sopenharmony_ci    U32                         BidirectionalDataLength;        /* 3Ch */
2808c2ecf20Sopenharmony_ci    U32                         SecondaryReferenceTag;          /* 40h */
2818c2ecf20Sopenharmony_ci    U16                         SecondaryApplicationTag;        /* 44h */
2828c2ecf20Sopenharmony_ci    U16                         Reserved2;                      /* 46h */
2838c2ecf20Sopenharmony_ci    U16                         EEDPFlags;                      /* 48h */
2848c2ecf20Sopenharmony_ci    U16                         ApplicationTagTranslationMask;  /* 4Ah */
2858c2ecf20Sopenharmony_ci    U32                         EEDPBlockSize;                  /* 4Ch */
2868c2ecf20Sopenharmony_ci    MPI_SCSI_IO32_ADDRESS       DeviceAddress;                  /* 50h */
2878c2ecf20Sopenharmony_ci    U8                          SGLOffset0;                     /* 58h */
2888c2ecf20Sopenharmony_ci    U8                          SGLOffset1;                     /* 59h */
2898c2ecf20Sopenharmony_ci    U8                          SGLOffset2;                     /* 5Ah */
2908c2ecf20Sopenharmony_ci    U8                          SGLOffset3;                     /* 5Bh */
2918c2ecf20Sopenharmony_ci    U32                         Reserved3;                      /* 5Ch */
2928c2ecf20Sopenharmony_ci    U32                         Reserved4;                      /* 60h */
2938c2ecf20Sopenharmony_ci    U32                         SenseBufferLowAddr;             /* 64h */
2948c2ecf20Sopenharmony_ci    SGE_IO_UNION                SGL;                            /* 68h */
2958c2ecf20Sopenharmony_ci} MSG_SCSI_IO32_REQUEST, MPI_POINTER PTR_MSG_SCSI_IO32_REQUEST,
2968c2ecf20Sopenharmony_ci  SCSIIO32Request_t, MPI_POINTER pSCSIIO32Request_t;
2978c2ecf20Sopenharmony_ci
2988c2ecf20Sopenharmony_ci/* SCSI IO 32 MsgFlags bits */
2998c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_MSGFLGS_SENSE_WIDTH                (0x01)
3008c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_MSGFLGS_32_SENSE_WIDTH             (0x00)
3018c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_MSGFLGS_64_SENSE_WIDTH             (0x01)
3028c2ecf20Sopenharmony_ci
3038c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_MSGFLGS_SENSE_LOCATION             (0x02)
3048c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_MSGFLGS_SENSE_LOC_HOST             (0x00)
3058c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_MSGFLGS_SENSE_LOC_IOC              (0x02)
3068c2ecf20Sopenharmony_ci
3078c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_MSGFLGS_CMD_DETERMINES_DATA_DIR    (0x04)
3088c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_MSGFLGS_SGL_OFFSETS_CHAINS         (0x08)
3098c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_MSGFLGS_MULTICAST                  (0x10)
3108c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_MSGFLGS_BIDIRECTIONAL              (0x20)
3118c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_MSGFLGS_LARGE_CDB                  (0x40)
3128c2ecf20Sopenharmony_ci
3138c2ecf20Sopenharmony_ci/* SCSI IO 32 Flags bits */
3148c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_FLAGS_FORM_MASK                    (0x03)
3158c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_FLAGS_FORM_SCSIID                  (0x00)
3168c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_FLAGS_FORM_WWID                    (0x01)
3178c2ecf20Sopenharmony_ci
3188c2ecf20Sopenharmony_ci/* SCSI IO 32 LUN fields */
3198c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_LUN_FIRST_LEVEL_ADDRESSING     (0x0000FFFF)
3208c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_LUN_SECOND_LEVEL_ADDRESSING    (0xFFFF0000)
3218c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_LUN_THIRD_LEVEL_ADDRESSING     (0x0000FFFF)
3228c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_LUN_FOURTH_LEVEL_ADDRESSING    (0xFFFF0000)
3238c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_LUN_LEVEL_1_WORD               (0xFF00)
3248c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_LUN_LEVEL_1_DWORD              (0x0000FF00)
3258c2ecf20Sopenharmony_ci
3268c2ecf20Sopenharmony_ci/* SCSI IO 32 Control bits */
3278c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_CONTROL_DATADIRECTION_MASK     (0x03000000)
3288c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_CONTROL_NODATATRANSFER         (0x00000000)
3298c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_CONTROL_WRITE                  (0x01000000)
3308c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_CONTROL_READ                   (0x02000000)
3318c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_CONTROL_BIDIRECTIONAL          (0x03000000)
3328c2ecf20Sopenharmony_ci
3338c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_CONTROL_ADDCDBLEN_MASK         (0xFC000000)
3348c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_CONTROL_ADDCDBLEN_SHIFT        (26)
3358c2ecf20Sopenharmony_ci
3368c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_CONTROL_TASKATTRIBUTE_MASK     (0x00000700)
3378c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_CONTROL_SIMPLEQ                (0x00000000)
3388c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_CONTROL_HEADOFQ                (0x00000100)
3398c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_CONTROL_ORDEREDQ               (0x00000200)
3408c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_CONTROL_ACAQ                   (0x00000400)
3418c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_CONTROL_UNTAGGED               (0x00000500)
3428c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_CONTROL_NO_DISCONNECT          (0x00000700)
3438c2ecf20Sopenharmony_ci
3448c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_CONTROL_TASKMANAGE_MASK        (0x00FF0000)
3458c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_CONTROL_OBSOLETE               (0x00800000)
3468c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_CONTROL_CLEAR_ACA_RSV          (0x00400000)
3478c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_CONTROL_TARGET_RESET           (0x00200000)
3488c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_CONTROL_LUN_RESET_RSV          (0x00100000)
3498c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_CONTROL_RESERVED               (0x00080000)
3508c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_CONTROL_CLR_TASK_SET_RSV       (0x00040000)
3518c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_CONTROL_ABORT_TASK_SET         (0x00020000)
3528c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_CONTROL_RESERVED2              (0x00010000)
3538c2ecf20Sopenharmony_ci
3548c2ecf20Sopenharmony_ci/* SCSI IO 32 EEDPFlags */
3558c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_EEDPFLAGS_MASK_OP              (0x0007)
3568c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_EEDPFLAGS_NOOP_OP              (0x0000)
3578c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_EEDPFLAGS_CHK_OP               (0x0001)
3588c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_EEDPFLAGS_STRIP_OP             (0x0002)
3598c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_EEDPFLAGS_CHKRM_OP             (0x0003)
3608c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_EEDPFLAGS_INSERT_OP            (0x0004)
3618c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_EEDPFLAGS_REPLACE_OP           (0x0006)
3628c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_EEDPFLAGS_CHKREGEN_OP          (0x0007)
3638c2ecf20Sopenharmony_ci
3648c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_EEDPFLAGS_PASS_REF_TAG         (0x0008)
3658c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_EEDPFLAGS_8_9THS_MODE          (0x0010)
3668c2ecf20Sopenharmony_ci
3678c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_EEDPFLAGS_T10_CHK_MASK         (0x0700)
3688c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_EEDPFLAGS_T10_CHK_GUARD        (0x0100)
3698c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_EEDPFLAGS_T10_CHK_REFTAG       (0x0200)
3708c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_EEDPFLAGS_T10_CHK_LBATAG       (0x0400)
3718c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_EEDPFLAGS_T10_CHK_SHIFT        (8)
3728c2ecf20Sopenharmony_ci
3738c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_EEDPFLAGS_INC_SEC_APPTAG       (0x1000)
3748c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_EEDPFLAGS_INC_PRI_APPTAG       (0x2000)
3758c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_EEDPFLAGS_INC_SEC_REFTAG       (0x4000)
3768c2ecf20Sopenharmony_ci#define MPI_SCSIIO32_EEDPFLAGS_INC_PRI_REFTAG       (0x8000)
3778c2ecf20Sopenharmony_ci
3788c2ecf20Sopenharmony_ci
3798c2ecf20Sopenharmony_ci/* SCSIIO32 IO reply structure */
3808c2ecf20Sopenharmony_citypedef struct _MSG_SCSIIO32_IO_REPLY
3818c2ecf20Sopenharmony_ci{
3828c2ecf20Sopenharmony_ci    U8                      Port;                       /* 00h */
3838c2ecf20Sopenharmony_ci    U8                      Reserved1;                  /* 01h */
3848c2ecf20Sopenharmony_ci    U8                      MsgLength;                  /* 02h */
3858c2ecf20Sopenharmony_ci    U8                      Function;                   /* 03h */
3868c2ecf20Sopenharmony_ci    U8                      CDBLength;                  /* 04h */
3878c2ecf20Sopenharmony_ci    U8                      SenseBufferLength;          /* 05h */
3888c2ecf20Sopenharmony_ci    U8                      Flags;                      /* 06h */
3898c2ecf20Sopenharmony_ci    U8                      MsgFlags;                   /* 07h */
3908c2ecf20Sopenharmony_ci    U32                     MsgContext;                 /* 08h */
3918c2ecf20Sopenharmony_ci    U8                      SCSIStatus;                 /* 0Ch */
3928c2ecf20Sopenharmony_ci    U8                      SCSIState;                  /* 0Dh */
3938c2ecf20Sopenharmony_ci    U16                     IOCStatus;                  /* 0Eh */
3948c2ecf20Sopenharmony_ci    U32                     IOCLogInfo;                 /* 10h */
3958c2ecf20Sopenharmony_ci    U32                     TransferCount;              /* 14h */
3968c2ecf20Sopenharmony_ci    U32                     SenseCount;                 /* 18h */
3978c2ecf20Sopenharmony_ci    U32                     ResponseInfo;               /* 1Ch */
3988c2ecf20Sopenharmony_ci    U16                     TaskTag;                    /* 20h */
3998c2ecf20Sopenharmony_ci    U16                     Reserved2;                  /* 22h */
4008c2ecf20Sopenharmony_ci    U32                     BidirectionalTransferCount; /* 24h */
4018c2ecf20Sopenharmony_ci} MSG_SCSIIO32_IO_REPLY, MPI_POINTER PTR_MSG_SCSIIO32_IO_REPLY,
4028c2ecf20Sopenharmony_ci  SCSIIO32Reply_t, MPI_POINTER pSCSIIO32Reply_t;
4038c2ecf20Sopenharmony_ci
4048c2ecf20Sopenharmony_ci
4058c2ecf20Sopenharmony_ci/****************************************************************************/
4068c2ecf20Sopenharmony_ci/*  SCSI Task Management messages                                           */
4078c2ecf20Sopenharmony_ci/****************************************************************************/
4088c2ecf20Sopenharmony_ci
4098c2ecf20Sopenharmony_citypedef struct _MSG_SCSI_TASK_MGMT
4108c2ecf20Sopenharmony_ci{
4118c2ecf20Sopenharmony_ci    U8                      TargetID;           /* 00h */
4128c2ecf20Sopenharmony_ci    U8                      Bus;                /* 01h */
4138c2ecf20Sopenharmony_ci    U8                      ChainOffset;        /* 02h */
4148c2ecf20Sopenharmony_ci    U8                      Function;           /* 03h */
4158c2ecf20Sopenharmony_ci    U8                      Reserved;           /* 04h */
4168c2ecf20Sopenharmony_ci    U8                      TaskType;           /* 05h */
4178c2ecf20Sopenharmony_ci    U8                      Reserved1;          /* 06h */
4188c2ecf20Sopenharmony_ci    U8                      MsgFlags;           /* 07h */
4198c2ecf20Sopenharmony_ci    U32                     MsgContext;         /* 08h */
4208c2ecf20Sopenharmony_ci    U8                      LUN[8];             /* 0Ch */
4218c2ecf20Sopenharmony_ci    U32                     Reserved2[7];       /* 14h */
4228c2ecf20Sopenharmony_ci    U32                     TaskMsgContext;     /* 30h */
4238c2ecf20Sopenharmony_ci} MSG_SCSI_TASK_MGMT, MPI_POINTER PTR_SCSI_TASK_MGMT,
4248c2ecf20Sopenharmony_ci  SCSITaskMgmt_t, MPI_POINTER pSCSITaskMgmt_t;
4258c2ecf20Sopenharmony_ci
4268c2ecf20Sopenharmony_ci/* TaskType values */
4278c2ecf20Sopenharmony_ci
4288c2ecf20Sopenharmony_ci#define MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK            (0x01)
4298c2ecf20Sopenharmony_ci#define MPI_SCSITASKMGMT_TASKTYPE_ABRT_TASK_SET         (0x02)
4308c2ecf20Sopenharmony_ci#define MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET          (0x03)
4318c2ecf20Sopenharmony_ci#define MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS             (0x04)
4328c2ecf20Sopenharmony_ci#define MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET    (0x05)
4338c2ecf20Sopenharmony_ci#define MPI_SCSITASKMGMT_TASKTYPE_CLEAR_TASK_SET        (0x06)
4348c2ecf20Sopenharmony_ci#define MPI_SCSITASKMGMT_TASKTYPE_QUERY_TASK            (0x07)
4358c2ecf20Sopenharmony_ci#define MPI_SCSITASKMGMT_TASKTYPE_CLR_ACA               (0x08)
4368c2ecf20Sopenharmony_ci
4378c2ecf20Sopenharmony_ci/* MsgFlags bits */
4388c2ecf20Sopenharmony_ci#define MPI_SCSITASKMGMT_MSGFLAGS_DO_NOT_SEND_TASK_IU   (0x01)
4398c2ecf20Sopenharmony_ci
4408c2ecf20Sopenharmony_ci#define MPI_SCSITASKMGMT_MSGFLAGS_TARGET_RESET_OPTION   (0x00)
4418c2ecf20Sopenharmony_ci#define MPI_SCSITASKMGMT_MSGFLAGS_LIP_RESET_OPTION      (0x02)
4428c2ecf20Sopenharmony_ci#define MPI_SCSITASKMGMT_MSGFLAGS_LIPRESET_RESET_OPTION (0x04)
4438c2ecf20Sopenharmony_ci
4448c2ecf20Sopenharmony_ci#define MPI_SCSITASKMGMT_MSGFLAGS_SOFT_RESET_OPTION     (0x08)
4458c2ecf20Sopenharmony_ci
4468c2ecf20Sopenharmony_ci/* SCSI Task Management Reply */
4478c2ecf20Sopenharmony_citypedef struct _MSG_SCSI_TASK_MGMT_REPLY
4488c2ecf20Sopenharmony_ci{
4498c2ecf20Sopenharmony_ci    U8                      TargetID;           /* 00h */
4508c2ecf20Sopenharmony_ci    U8                      Bus;                /* 01h */
4518c2ecf20Sopenharmony_ci    U8                      MsgLength;          /* 02h */
4528c2ecf20Sopenharmony_ci    U8                      Function;           /* 03h */
4538c2ecf20Sopenharmony_ci    U8                      ResponseCode;       /* 04h */
4548c2ecf20Sopenharmony_ci    U8                      TaskType;           /* 05h */
4558c2ecf20Sopenharmony_ci    U8                      Reserved1;          /* 06h */
4568c2ecf20Sopenharmony_ci    U8                      MsgFlags;           /* 07h */
4578c2ecf20Sopenharmony_ci    U32                     MsgContext;         /* 08h */
4588c2ecf20Sopenharmony_ci    U8                      Reserved2[2];       /* 0Ch */
4598c2ecf20Sopenharmony_ci    U16                     IOCStatus;          /* 0Eh */
4608c2ecf20Sopenharmony_ci    U32                     IOCLogInfo;         /* 10h */
4618c2ecf20Sopenharmony_ci    U32                     TerminationCount;   /* 14h */
4628c2ecf20Sopenharmony_ci} MSG_SCSI_TASK_MGMT_REPLY, MPI_POINTER PTR_MSG_SCSI_TASK_MGMT_REPLY,
4638c2ecf20Sopenharmony_ci  SCSITaskMgmtReply_t, MPI_POINTER pSCSITaskMgmtReply_t;
4648c2ecf20Sopenharmony_ci
4658c2ecf20Sopenharmony_ci/* ResponseCode values */
4668c2ecf20Sopenharmony_ci#define MPI_SCSITASKMGMT_RSP_TM_COMPLETE                (0x00)
4678c2ecf20Sopenharmony_ci#define MPI_SCSITASKMGMT_RSP_INVALID_FRAME              (0x02)
4688c2ecf20Sopenharmony_ci#define MPI_SCSITASKMGMT_RSP_TM_NOT_SUPPORTED           (0x04)
4698c2ecf20Sopenharmony_ci#define MPI_SCSITASKMGMT_RSP_TM_FAILED                  (0x05)
4708c2ecf20Sopenharmony_ci#define MPI_SCSITASKMGMT_RSP_TM_SUCCEEDED               (0x08)
4718c2ecf20Sopenharmony_ci#define MPI_SCSITASKMGMT_RSP_TM_INVALID_LUN             (0x09)
4728c2ecf20Sopenharmony_ci#define MPI_SCSITASKMGMT_RSP_IO_QUEUED_ON_IOC           (0x80)
4738c2ecf20Sopenharmony_ci
4748c2ecf20Sopenharmony_ci
4758c2ecf20Sopenharmony_ci/****************************************************************************/
4768c2ecf20Sopenharmony_ci/*  SCSI Enclosure Processor messages                                       */
4778c2ecf20Sopenharmony_ci/****************************************************************************/
4788c2ecf20Sopenharmony_ci
4798c2ecf20Sopenharmony_citypedef struct _MSG_SEP_REQUEST
4808c2ecf20Sopenharmony_ci{
4818c2ecf20Sopenharmony_ci    U8                      TargetID;           /* 00h */
4828c2ecf20Sopenharmony_ci    U8                      Bus;                /* 01h */
4838c2ecf20Sopenharmony_ci    U8                      ChainOffset;        /* 02h */
4848c2ecf20Sopenharmony_ci    U8                      Function;           /* 03h */
4858c2ecf20Sopenharmony_ci    U8                      Action;             /* 04h */
4868c2ecf20Sopenharmony_ci    U8                      Flags;              /* 05h */
4878c2ecf20Sopenharmony_ci    U8                      Reserved1;          /* 06h */
4888c2ecf20Sopenharmony_ci    U8                      MsgFlags;           /* 07h */
4898c2ecf20Sopenharmony_ci    U32                     MsgContext;         /* 08h */
4908c2ecf20Sopenharmony_ci    U32                     SlotStatus;         /* 0Ch */
4918c2ecf20Sopenharmony_ci    U32                     Reserved2;          /* 10h */
4928c2ecf20Sopenharmony_ci    U32                     Reserved3;          /* 14h */
4938c2ecf20Sopenharmony_ci    U32                     Reserved4;          /* 18h */
4948c2ecf20Sopenharmony_ci    U16                     Slot;               /* 1Ch */
4958c2ecf20Sopenharmony_ci    U16                     EnclosureHandle;    /* 1Eh */
4968c2ecf20Sopenharmony_ci} MSG_SEP_REQUEST, MPI_POINTER PTR_MSG_SEP_REQUEST,
4978c2ecf20Sopenharmony_ci  SEPRequest_t, MPI_POINTER pSEPRequest_t;
4988c2ecf20Sopenharmony_ci
4998c2ecf20Sopenharmony_ci/* Action defines */
5008c2ecf20Sopenharmony_ci#define MPI_SEP_REQ_ACTION_WRITE_STATUS                 (0x00)
5018c2ecf20Sopenharmony_ci#define MPI_SEP_REQ_ACTION_READ_STATUS                  (0x01)
5028c2ecf20Sopenharmony_ci
5038c2ecf20Sopenharmony_ci/* Flags defines */
5048c2ecf20Sopenharmony_ci#define MPI_SEP_REQ_FLAGS_ENCLOSURE_SLOT_ADDRESS        (0x01)
5058c2ecf20Sopenharmony_ci#define MPI_SEP_REQ_FLAGS_BUS_TARGETID_ADDRESS          (0x00)
5068c2ecf20Sopenharmony_ci
5078c2ecf20Sopenharmony_ci/* SlotStatus bits for MSG_SEP_REQUEST */
5088c2ecf20Sopenharmony_ci#define MPI_SEP_REQ_SLOTSTATUS_NO_ERROR                 (0x00000001)
5098c2ecf20Sopenharmony_ci#define MPI_SEP_REQ_SLOTSTATUS_DEV_FAULTY               (0x00000002)
5108c2ecf20Sopenharmony_ci#define MPI_SEP_REQ_SLOTSTATUS_DEV_REBUILDING           (0x00000004)
5118c2ecf20Sopenharmony_ci#define MPI_SEP_REQ_SLOTSTATUS_IN_FAILED_ARRAY          (0x00000008)
5128c2ecf20Sopenharmony_ci#define MPI_SEP_REQ_SLOTSTATUS_IN_CRITICAL_ARRAY        (0x00000010)
5138c2ecf20Sopenharmony_ci#define MPI_SEP_REQ_SLOTSTATUS_PARITY_CHECK             (0x00000020)
5148c2ecf20Sopenharmony_ci#define MPI_SEP_REQ_SLOTSTATUS_PREDICTED_FAULT          (0x00000040)
5158c2ecf20Sopenharmony_ci#define MPI_SEP_REQ_SLOTSTATUS_UNCONFIGURED             (0x00000080)
5168c2ecf20Sopenharmony_ci#define MPI_SEP_REQ_SLOTSTATUS_HOT_SPARE                (0x00000100)
5178c2ecf20Sopenharmony_ci#define MPI_SEP_REQ_SLOTSTATUS_REBUILD_STOPPED          (0x00000200)
5188c2ecf20Sopenharmony_ci#define MPI_SEP_REQ_SLOTSTATUS_REQ_CONSISTENCY_CHECK    (0x00001000)
5198c2ecf20Sopenharmony_ci#define MPI_SEP_REQ_SLOTSTATUS_DISABLE                  (0x00002000)
5208c2ecf20Sopenharmony_ci#define MPI_SEP_REQ_SLOTSTATUS_REQ_RESERVED_DEVICE      (0x00004000)
5218c2ecf20Sopenharmony_ci#define MPI_SEP_REQ_SLOTSTATUS_IDENTIFY_REQUEST         (0x00020000)
5228c2ecf20Sopenharmony_ci#define MPI_SEP_REQ_SLOTSTATUS_REQUEST_REMOVE           (0x00040000)
5238c2ecf20Sopenharmony_ci#define MPI_SEP_REQ_SLOTSTATUS_REQUEST_INSERT           (0x00080000)
5248c2ecf20Sopenharmony_ci#define MPI_SEP_REQ_SLOTSTATUS_DO_NOT_MOVE              (0x00400000)
5258c2ecf20Sopenharmony_ci#define MPI_SEP_REQ_SLOTSTATUS_ACTIVE                   (0x00800000)
5268c2ecf20Sopenharmony_ci#define MPI_SEP_REQ_SLOTSTATUS_B_ENABLE_BYPASS          (0x04000000)
5278c2ecf20Sopenharmony_ci#define MPI_SEP_REQ_SLOTSTATUS_A_ENABLE_BYPASS          (0x08000000)
5288c2ecf20Sopenharmony_ci#define MPI_SEP_REQ_SLOTSTATUS_DEV_OFF                  (0x10000000)
5298c2ecf20Sopenharmony_ci#define MPI_SEP_REQ_SLOTSTATUS_SWAP_RESET               (0x80000000)
5308c2ecf20Sopenharmony_ci
5318c2ecf20Sopenharmony_ci
5328c2ecf20Sopenharmony_citypedef struct _MSG_SEP_REPLY
5338c2ecf20Sopenharmony_ci{
5348c2ecf20Sopenharmony_ci    U8                      TargetID;           /* 00h */
5358c2ecf20Sopenharmony_ci    U8                      Bus;                /* 01h */
5368c2ecf20Sopenharmony_ci    U8                      MsgLength;          /* 02h */
5378c2ecf20Sopenharmony_ci    U8                      Function;           /* 03h */
5388c2ecf20Sopenharmony_ci    U8                      Action;             /* 04h */
5398c2ecf20Sopenharmony_ci    U8                      Reserved1;          /* 05h */
5408c2ecf20Sopenharmony_ci    U8                      Reserved2;          /* 06h */
5418c2ecf20Sopenharmony_ci    U8                      MsgFlags;           /* 07h */
5428c2ecf20Sopenharmony_ci    U32                     MsgContext;         /* 08h */
5438c2ecf20Sopenharmony_ci    U16                     Reserved3;          /* 0Ch */
5448c2ecf20Sopenharmony_ci    U16                     IOCStatus;          /* 0Eh */
5458c2ecf20Sopenharmony_ci    U32                     IOCLogInfo;         /* 10h */
5468c2ecf20Sopenharmony_ci    U32                     SlotStatus;         /* 14h */
5478c2ecf20Sopenharmony_ci    U32                     Reserved4;          /* 18h */
5488c2ecf20Sopenharmony_ci    U16                     Slot;               /* 1Ch */
5498c2ecf20Sopenharmony_ci    U16                     EnclosureHandle;    /* 1Eh */
5508c2ecf20Sopenharmony_ci} MSG_SEP_REPLY, MPI_POINTER PTR_MSG_SEP_REPLY,
5518c2ecf20Sopenharmony_ci  SEPReply_t, MPI_POINTER pSEPReply_t;
5528c2ecf20Sopenharmony_ci
5538c2ecf20Sopenharmony_ci/* SlotStatus bits for MSG_SEP_REPLY */
5548c2ecf20Sopenharmony_ci#define MPI_SEP_REPLY_SLOTSTATUS_NO_ERROR               (0x00000001)
5558c2ecf20Sopenharmony_ci#define MPI_SEP_REPLY_SLOTSTATUS_DEV_FAULTY             (0x00000002)
5568c2ecf20Sopenharmony_ci#define MPI_SEP_REPLY_SLOTSTATUS_DEV_REBUILDING         (0x00000004)
5578c2ecf20Sopenharmony_ci#define MPI_SEP_REPLY_SLOTSTATUS_IN_FAILED_ARRAY        (0x00000008)
5588c2ecf20Sopenharmony_ci#define MPI_SEP_REPLY_SLOTSTATUS_IN_CRITICAL_ARRAY      (0x00000010)
5598c2ecf20Sopenharmony_ci#define MPI_SEP_REPLY_SLOTSTATUS_PARITY_CHECK           (0x00000020)
5608c2ecf20Sopenharmony_ci#define MPI_SEP_REPLY_SLOTSTATUS_PREDICTED_FAULT        (0x00000040)
5618c2ecf20Sopenharmony_ci#define MPI_SEP_REPLY_SLOTSTATUS_UNCONFIGURED           (0x00000080)
5628c2ecf20Sopenharmony_ci#define MPI_SEP_REPLY_SLOTSTATUS_HOT_SPARE              (0x00000100)
5638c2ecf20Sopenharmony_ci#define MPI_SEP_REPLY_SLOTSTATUS_REBUILD_STOPPED        (0x00000200)
5648c2ecf20Sopenharmony_ci#define MPI_SEP_REPLY_SLOTSTATUS_CONSISTENCY_CHECK      (0x00001000)
5658c2ecf20Sopenharmony_ci#define MPI_SEP_REPLY_SLOTSTATUS_DISABLE                (0x00002000)
5668c2ecf20Sopenharmony_ci#define MPI_SEP_REPLY_SLOTSTATUS_RESERVED_DEVICE        (0x00004000)
5678c2ecf20Sopenharmony_ci#define MPI_SEP_REPLY_SLOTSTATUS_REPORT                 (0x00010000)
5688c2ecf20Sopenharmony_ci#define MPI_SEP_REPLY_SLOTSTATUS_IDENTIFY_REQUEST       (0x00020000)
5698c2ecf20Sopenharmony_ci#define MPI_SEP_REPLY_SLOTSTATUS_REMOVE_READY           (0x00040000)
5708c2ecf20Sopenharmony_ci#define MPI_SEP_REPLY_SLOTSTATUS_INSERT_READY           (0x00080000)
5718c2ecf20Sopenharmony_ci#define MPI_SEP_REPLY_SLOTSTATUS_DO_NOT_REMOVE          (0x00400000)
5728c2ecf20Sopenharmony_ci#define MPI_SEP_REPLY_SLOTSTATUS_ACTIVE                 (0x00800000)
5738c2ecf20Sopenharmony_ci#define MPI_SEP_REPLY_SLOTSTATUS_B_BYPASS_ENABLED       (0x01000000)
5748c2ecf20Sopenharmony_ci#define MPI_SEP_REPLY_SLOTSTATUS_A_BYPASS_ENABLED       (0x02000000)
5758c2ecf20Sopenharmony_ci#define MPI_SEP_REPLY_SLOTSTATUS_B_ENABLE_BYPASS        (0x04000000)
5768c2ecf20Sopenharmony_ci#define MPI_SEP_REPLY_SLOTSTATUS_A_ENABLE_BYPASS        (0x08000000)
5778c2ecf20Sopenharmony_ci#define MPI_SEP_REPLY_SLOTSTATUS_DEV_OFF                (0x10000000)
5788c2ecf20Sopenharmony_ci#define MPI_SEP_REPLY_SLOTSTATUS_FAULT_SENSED           (0x40000000)
5798c2ecf20Sopenharmony_ci#define MPI_SEP_REPLY_SLOTSTATUS_SWAPPED                (0x80000000)
5808c2ecf20Sopenharmony_ci
5818c2ecf20Sopenharmony_ci#endif
582