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_ioc.h
762306a36Sopenharmony_ci *          Title:  MPI IOC, Port, Event, FW Download, and FW Upload messages
862306a36Sopenharmony_ci *  Creation Date:  August 11, 2000
962306a36Sopenharmony_ci *
1062306a36Sopenharmony_ci *    mpi_ioc.h Version:  01.05.16
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 *  05-24-00  00.10.02  Added _MSG_IOC_INIT_REPLY structure.
1962306a36Sopenharmony_ci *  06-06-00  01.00.01  Added CurReplyFrameSize field to _MSG_IOC_FACTS_REPLY.
2062306a36Sopenharmony_ci *  06-12-00  01.00.02  Added _MSG_PORT_ENABLE_REPLY structure.
2162306a36Sopenharmony_ci *                      Added _MSG_EVENT_ACK_REPLY structure.
2262306a36Sopenharmony_ci *                      Added _MSG_FW_DOWNLOAD_REPLY structure.
2362306a36Sopenharmony_ci *                      Added _MSG_TOOLBOX_REPLY structure.
2462306a36Sopenharmony_ci *  06-30-00  01.00.03  Added MaxLanBuckets to _PORT_FACT_REPLY structure.
2562306a36Sopenharmony_ci *  07-27-00  01.00.04  Added _EVENT_DATA structure definitions for _SCSI,
2662306a36Sopenharmony_ci *                      _LINK_STATUS, _LOOP_STATE and _LOGOUT.
2762306a36Sopenharmony_ci *  08-11-00  01.00.05  Switched positions of MsgLength and Function fields in
2862306a36Sopenharmony_ci *                      _MSG_EVENT_ACK_REPLY structure to match specification.
2962306a36Sopenharmony_ci *  11-02-00  01.01.01  Original release for post 1.0 work.
3062306a36Sopenharmony_ci *                      Added a value for Manufacturer to WhoInit.
3162306a36Sopenharmony_ci *  12-04-00  01.01.02  Modified IOCFacts reply, added FWUpload messages, and
3262306a36Sopenharmony_ci *                      removed toolbox message.
3362306a36Sopenharmony_ci *  01-09-01  01.01.03  Added event enabled and disabled defines.
3462306a36Sopenharmony_ci *                      Added structures for FwHeader and DataHeader.
3562306a36Sopenharmony_ci *                      Added ImageType to FwUpload reply.
3662306a36Sopenharmony_ci *  02-20-01  01.01.04  Started using MPI_POINTER.
3762306a36Sopenharmony_ci *  02-27-01  01.01.05  Added event for RAID status change and its event data.
3862306a36Sopenharmony_ci *                      Added IocNumber field to MSG_IOC_FACTS_REPLY.
3962306a36Sopenharmony_ci *  03-27-01  01.01.06  Added defines for ProductId field of MPI_FW_HEADER.
4062306a36Sopenharmony_ci *                      Added structure offset comments.
4162306a36Sopenharmony_ci *  04-09-01  01.01.07  Added structure EVENT_DATA_EVENT_CHANGE.
4262306a36Sopenharmony_ci *  08-08-01  01.02.01  Original release for v1.2 work.
4362306a36Sopenharmony_ci *                      New format for FWVersion and ProductId in
4462306a36Sopenharmony_ci *                      MSG_IOC_FACTS_REPLY and MPI_FW_HEADER.
4562306a36Sopenharmony_ci *  08-31-01  01.02.02  Addded event MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE and
4662306a36Sopenharmony_ci *                      related structure and defines.
4762306a36Sopenharmony_ci *                      Added event MPI_EVENT_ON_BUS_TIMER_EXPIRED.
4862306a36Sopenharmony_ci *                      Added MPI_IOCINIT_FLAGS_DISCARD_FW_IMAGE.
4962306a36Sopenharmony_ci *                      Replaced a reserved field in MSG_IOC_FACTS_REPLY with
5062306a36Sopenharmony_ci *                      IOCExceptions and changed DataImageSize to reserved.
5162306a36Sopenharmony_ci *                      Added MPI_FW_DOWNLOAD_ITYPE_NVSTORE_DATA and
5262306a36Sopenharmony_ci *                      MPI_FW_UPLOAD_ITYPE_NVDATA.
5362306a36Sopenharmony_ci *  09-28-01  01.02.03  Modified Event Data for Integrated RAID.
5462306a36Sopenharmony_ci *  11-01-01  01.02.04  Added defines for MPI_EXT_IMAGE_HEADER ImageType field.
5562306a36Sopenharmony_ci *  03-14-02  01.02.05  Added HeaderVersion field to MSG_IOC_FACTS_REPLY.
5662306a36Sopenharmony_ci *  05-31-02  01.02.06  Added define for
5762306a36Sopenharmony_ci *                      MPI_IOCFACTS_EXCEPT_RAID_CONFIG_INVALID.
5862306a36Sopenharmony_ci *                      Added AliasIndex to EVENT_DATA_LOGOUT structure.
5962306a36Sopenharmony_ci *  04-01-03  01.02.07  Added defines for MPI_FW_HEADER_SIGNATURE_.
6062306a36Sopenharmony_ci *  06-26-03  01.02.08  Added new values to the product family defines.
6162306a36Sopenharmony_ci *  04-29-04  01.02.09  Added IOCCapabilities field to MSG_IOC_FACTS_REPLY and
6262306a36Sopenharmony_ci *                      added related defines.
6362306a36Sopenharmony_ci *  05-11-04  01.03.01  Original release for MPI v1.3.
6462306a36Sopenharmony_ci *  08-19-04  01.05.01  Added four new fields to MSG_IOC_INIT.
6562306a36Sopenharmony_ci *                      Added three new fields to MSG_IOC_FACTS_REPLY.
6662306a36Sopenharmony_ci *                      Defined four new bits for the IOCCapabilities field of
6762306a36Sopenharmony_ci *                      the IOCFacts reply.
6862306a36Sopenharmony_ci *                      Added two new PortTypes for the PortFacts reply.
6962306a36Sopenharmony_ci *                      Added six new events along with their EventData
7062306a36Sopenharmony_ci *                      structures.
7162306a36Sopenharmony_ci *                      Added a new MsgFlag to the FwDownload request to
7262306a36Sopenharmony_ci *                      indicate last segment.
7362306a36Sopenharmony_ci *                      Defined a new image type of boot loader.
7462306a36Sopenharmony_ci *                      Added FW family codes for SAS product families.
7562306a36Sopenharmony_ci *  10-05-04  01.05.02  Added ReplyFifoHostSignalingAddr field to
7662306a36Sopenharmony_ci *                      MSG_IOC_FACTS_REPLY.
7762306a36Sopenharmony_ci *  12-07-04  01.05.03  Added more defines for SAS Discovery Error event.
7862306a36Sopenharmony_ci *  12-09-04  01.05.04  Added Unsupported device to SAS Device event.
7962306a36Sopenharmony_ci *  01-15-05  01.05.05  Added event data for SAS SES Event.
8062306a36Sopenharmony_ci *  02-09-05  01.05.06  Added MPI_FW_UPLOAD_ITYPE_FW_BACKUP define.
8162306a36Sopenharmony_ci *  02-22-05  01.05.07  Added Host Page Buffer Persistent flag to IOC Facts
8262306a36Sopenharmony_ci *                      Reply and IOC Init Request.
8362306a36Sopenharmony_ci *  03-11-05  01.05.08  Added family code for 1068E family.
8462306a36Sopenharmony_ci *                      Removed IOCFacts Reply EEDP Capability bit.
8562306a36Sopenharmony_ci *  06-24-05  01.05.09  Added 5 new IOCFacts Reply IOCCapabilities bits.
8662306a36Sopenharmony_ci *                      Added Max SATA Targets to SAS Discovery Error event.
8762306a36Sopenharmony_ci *  08-30-05  01.05.10  Added 4 new events and their event data structures.
8862306a36Sopenharmony_ci *                      Added new ReasonCode value for SAS Device Status Change
8962306a36Sopenharmony_ci *                      event.
9062306a36Sopenharmony_ci *                      Added new family code for FC949E.
9162306a36Sopenharmony_ci *  03-27-06  01.05.11  Added MPI_IOCFACTS_CAPABILITY_TLR.
9262306a36Sopenharmony_ci *                      Added additional Reason Codes and more event data fields
9362306a36Sopenharmony_ci *                      to EVENT_DATA_SAS_DEVICE_STATUS_CHANGE.
9462306a36Sopenharmony_ci *                      Added EVENT_DATA_SAS_BROADCAST_PRIMITIVE structure and
9562306a36Sopenharmony_ci *                      new event.
9662306a36Sopenharmony_ci *                      Added MPI_EVENT_SAS_SMP_ERROR and event data structure.
9762306a36Sopenharmony_ci *                      Added MPI_EVENT_SAS_INIT_DEVICE_STATUS_CHANGE and event
9862306a36Sopenharmony_ci *                      data structure.
9962306a36Sopenharmony_ci *                      Added MPI_EVENT_SAS_INIT_TABLE_OVERFLOW and event
10062306a36Sopenharmony_ci *                      data structure.
10162306a36Sopenharmony_ci *                      Added MPI_EXT_IMAGE_TYPE_INITIALIZATION.
10262306a36Sopenharmony_ci *  10-11-06  01.05.12  Added MPI_IOCFACTS_EXCEPT_METADATA_UNSUPPORTED.
10362306a36Sopenharmony_ci *                      Added MaxInitiators field to PortFacts reply.
10462306a36Sopenharmony_ci *                      Added SAS Device Status Change ReasonCode for
10562306a36Sopenharmony_ci *                      asynchronous notificaiton.
10662306a36Sopenharmony_ci *                      Added MPI_EVENT_SAS_EXPANDER_STATUS_CHANGE and event
10762306a36Sopenharmony_ci *                      data structure.
10862306a36Sopenharmony_ci *                      Added new ImageType values for FWDownload and FWUpload
10962306a36Sopenharmony_ci *                      requests.
11062306a36Sopenharmony_ci *  02-28-07  01.05.13  Added MPI_EVENT_PRIMITIVE_ASYNCHRONOUS_EVENT for SAS
11162306a36Sopenharmony_ci *                      Broadcast Event Data (replacing _RESERVED2).
11262306a36Sopenharmony_ci *                      For Discovery Error Event Data DiscoveryStatus field,
11362306a36Sopenharmony_ci *                      replaced _MULTPL_PATHS with _UNSUPPORTED_DEVICE and
11462306a36Sopenharmony_ci *                      added _MULTI_PORT_DOMAIN.
11562306a36Sopenharmony_ci *  05-24-07  01.05.14  Added Common Boot Block type to FWDownload Request.
11662306a36Sopenharmony_ci *                      Added Common Boot Block type to FWUpload Request.
11762306a36Sopenharmony_ci *  08-07-07  01.05.15  Added MPI_EVENT_SAS_INIT_RC_REMOVED define.
11862306a36Sopenharmony_ci *                      Added MPI_EVENT_IR2_RC_DUAL_PORT_ADDED and
11962306a36Sopenharmony_ci *                      MPI_EVENT_IR2_RC_DUAL_PORT_REMOVED for IR2 event data.
12062306a36Sopenharmony_ci *                      Added SASAddress field to SAS Initiator Device Table
12162306a36Sopenharmony_ci *                      Overflow event data structure.
12262306a36Sopenharmony_ci *  03-28-08  01.05.16  Added two new ReasonCode values to SAS Device Status
12362306a36Sopenharmony_ci *                      Change Event data to indicate completion of internally
12462306a36Sopenharmony_ci *                      generated task management.
12562306a36Sopenharmony_ci *                      Added MPI_EVENT_DSCVRY_ERR_DS_SATA_INIT_FAILURE define.
12662306a36Sopenharmony_ci *                      Added MPI_EVENT_SAS_INIT_RC_INACCESSIBLE define.
12762306a36Sopenharmony_ci *  --------------------------------------------------------------------------
12862306a36Sopenharmony_ci */
12962306a36Sopenharmony_ci
13062306a36Sopenharmony_ci#ifndef MPI_IOC_H
13162306a36Sopenharmony_ci#define MPI_IOC_H
13262306a36Sopenharmony_ci
13362306a36Sopenharmony_ci
13462306a36Sopenharmony_ci/*****************************************************************************
13562306a36Sopenharmony_ci*
13662306a36Sopenharmony_ci*               I O C    M e s s a g e s
13762306a36Sopenharmony_ci*
13862306a36Sopenharmony_ci*****************************************************************************/
13962306a36Sopenharmony_ci
14062306a36Sopenharmony_ci/****************************************************************************/
14162306a36Sopenharmony_ci/*  IOCInit message                                                         */
14262306a36Sopenharmony_ci/****************************************************************************/
14362306a36Sopenharmony_ci
14462306a36Sopenharmony_citypedef struct _MSG_IOC_INIT
14562306a36Sopenharmony_ci{
14662306a36Sopenharmony_ci    U8                      WhoInit;                    /* 00h */
14762306a36Sopenharmony_ci    U8                      Reserved;                   /* 01h */
14862306a36Sopenharmony_ci    U8                      ChainOffset;                /* 02h */
14962306a36Sopenharmony_ci    U8                      Function;                   /* 03h */
15062306a36Sopenharmony_ci    U8                      Flags;                      /* 04h */
15162306a36Sopenharmony_ci    U8                      MaxDevices;                 /* 05h */
15262306a36Sopenharmony_ci    U8                      MaxBuses;                   /* 06h */
15362306a36Sopenharmony_ci    U8                      MsgFlags;                   /* 07h */
15462306a36Sopenharmony_ci    U32                     MsgContext;                 /* 08h */
15562306a36Sopenharmony_ci    U16                     ReplyFrameSize;             /* 0Ch */
15662306a36Sopenharmony_ci    U8                      Reserved1[2];               /* 0Eh */
15762306a36Sopenharmony_ci    U32                     HostMfaHighAddr;            /* 10h */
15862306a36Sopenharmony_ci    U32                     SenseBufferHighAddr;        /* 14h */
15962306a36Sopenharmony_ci    U32                     ReplyFifoHostSignalingAddr; /* 18h */
16062306a36Sopenharmony_ci    SGE_SIMPLE_UNION        HostPageBufferSGE;          /* 1Ch */
16162306a36Sopenharmony_ci    U16                     MsgVersion;                 /* 28h */
16262306a36Sopenharmony_ci    U16                     HeaderVersion;              /* 2Ah */
16362306a36Sopenharmony_ci} MSG_IOC_INIT, MPI_POINTER PTR_MSG_IOC_INIT,
16462306a36Sopenharmony_ci  IOCInit_t, MPI_POINTER pIOCInit_t;
16562306a36Sopenharmony_ci
16662306a36Sopenharmony_ci/* WhoInit values */
16762306a36Sopenharmony_ci#define MPI_WHOINIT_NO_ONE                              (0x00)
16862306a36Sopenharmony_ci#define MPI_WHOINIT_SYSTEM_BIOS                         (0x01)
16962306a36Sopenharmony_ci#define MPI_WHOINIT_ROM_BIOS                            (0x02)
17062306a36Sopenharmony_ci#define MPI_WHOINIT_PCI_PEER                            (0x03)
17162306a36Sopenharmony_ci#define MPI_WHOINIT_HOST_DRIVER                         (0x04)
17262306a36Sopenharmony_ci#define MPI_WHOINIT_MANUFACTURER                        (0x05)
17362306a36Sopenharmony_ci
17462306a36Sopenharmony_ci/* Flags values */
17562306a36Sopenharmony_ci#define MPI_IOCINIT_FLAGS_HOST_PAGE_BUFFER_PERSISTENT   (0x04)
17662306a36Sopenharmony_ci#define MPI_IOCINIT_FLAGS_REPLY_FIFO_HOST_SIGNAL        (0x02)
17762306a36Sopenharmony_ci#define MPI_IOCINIT_FLAGS_DISCARD_FW_IMAGE              (0x01)
17862306a36Sopenharmony_ci
17962306a36Sopenharmony_ci/* MsgVersion */
18062306a36Sopenharmony_ci#define MPI_IOCINIT_MSGVERSION_MAJOR_MASK               (0xFF00)
18162306a36Sopenharmony_ci#define MPI_IOCINIT_MSGVERSION_MAJOR_SHIFT              (8)
18262306a36Sopenharmony_ci#define MPI_IOCINIT_MSGVERSION_MINOR_MASK               (0x00FF)
18362306a36Sopenharmony_ci#define MPI_IOCINIT_MSGVERSION_MINOR_SHIFT              (0)
18462306a36Sopenharmony_ci
18562306a36Sopenharmony_ci/* HeaderVersion */
18662306a36Sopenharmony_ci#define MPI_IOCINIT_HEADERVERSION_UNIT_MASK             (0xFF00)
18762306a36Sopenharmony_ci#define MPI_IOCINIT_HEADERVERSION_UNIT_SHIFT            (8)
18862306a36Sopenharmony_ci#define MPI_IOCINIT_HEADERVERSION_DEV_MASK              (0x00FF)
18962306a36Sopenharmony_ci#define MPI_IOCINIT_HEADERVERSION_DEV_SHIFT             (0)
19062306a36Sopenharmony_ci
19162306a36Sopenharmony_ci
19262306a36Sopenharmony_citypedef struct _MSG_IOC_INIT_REPLY
19362306a36Sopenharmony_ci{
19462306a36Sopenharmony_ci    U8                      WhoInit;                    /* 00h */
19562306a36Sopenharmony_ci    U8                      Reserved;                   /* 01h */
19662306a36Sopenharmony_ci    U8                      MsgLength;                  /* 02h */
19762306a36Sopenharmony_ci    U8                      Function;                   /* 03h */
19862306a36Sopenharmony_ci    U8                      Flags;                      /* 04h */
19962306a36Sopenharmony_ci    U8                      MaxDevices;                 /* 05h */
20062306a36Sopenharmony_ci    U8                      MaxBuses;                   /* 06h */
20162306a36Sopenharmony_ci    U8                      MsgFlags;                   /* 07h */
20262306a36Sopenharmony_ci    U32                     MsgContext;                 /* 08h */
20362306a36Sopenharmony_ci    U16                     Reserved2;                  /* 0Ch */
20462306a36Sopenharmony_ci    U16                     IOCStatus;                  /* 0Eh */
20562306a36Sopenharmony_ci    U32                     IOCLogInfo;                 /* 10h */
20662306a36Sopenharmony_ci} MSG_IOC_INIT_REPLY, MPI_POINTER PTR_MSG_IOC_INIT_REPLY,
20762306a36Sopenharmony_ci  IOCInitReply_t, MPI_POINTER pIOCInitReply_t;
20862306a36Sopenharmony_ci
20962306a36Sopenharmony_ci
21062306a36Sopenharmony_ci
21162306a36Sopenharmony_ci/****************************************************************************/
21262306a36Sopenharmony_ci/*  IOC Facts message                                                       */
21362306a36Sopenharmony_ci/****************************************************************************/
21462306a36Sopenharmony_ci
21562306a36Sopenharmony_citypedef struct _MSG_IOC_FACTS
21662306a36Sopenharmony_ci{
21762306a36Sopenharmony_ci    U8                      Reserved[2];                /* 00h */
21862306a36Sopenharmony_ci    U8                      ChainOffset;                /* 01h */
21962306a36Sopenharmony_ci    U8                      Function;                   /* 02h */
22062306a36Sopenharmony_ci    U8                      Reserved1[3];               /* 03h */
22162306a36Sopenharmony_ci    U8                      MsgFlags;                   /* 04h */
22262306a36Sopenharmony_ci    U32                     MsgContext;                 /* 08h */
22362306a36Sopenharmony_ci} MSG_IOC_FACTS, MPI_POINTER PTR_IOC_FACTS,
22462306a36Sopenharmony_ci  IOCFacts_t, MPI_POINTER pIOCFacts_t;
22562306a36Sopenharmony_ci
22662306a36Sopenharmony_citypedef struct _MPI_FW_VERSION_STRUCT
22762306a36Sopenharmony_ci{
22862306a36Sopenharmony_ci    U8                      Dev;                        /* 00h */
22962306a36Sopenharmony_ci    U8                      Unit;                       /* 01h */
23062306a36Sopenharmony_ci    U8                      Minor;                      /* 02h */
23162306a36Sopenharmony_ci    U8                      Major;                      /* 03h */
23262306a36Sopenharmony_ci} MPI_FW_VERSION_STRUCT;
23362306a36Sopenharmony_ci
23462306a36Sopenharmony_citypedef union _MPI_FW_VERSION
23562306a36Sopenharmony_ci{
23662306a36Sopenharmony_ci    MPI_FW_VERSION_STRUCT   Struct;
23762306a36Sopenharmony_ci    U32                     Word;
23862306a36Sopenharmony_ci} MPI_FW_VERSION;
23962306a36Sopenharmony_ci
24062306a36Sopenharmony_ci/* IOC Facts Reply */
24162306a36Sopenharmony_citypedef struct _MSG_IOC_FACTS_REPLY
24262306a36Sopenharmony_ci{
24362306a36Sopenharmony_ci    U16                     MsgVersion;                 /* 00h */
24462306a36Sopenharmony_ci    U8                      MsgLength;                  /* 02h */
24562306a36Sopenharmony_ci    U8                      Function;                   /* 03h */
24662306a36Sopenharmony_ci    U16                     HeaderVersion;              /* 04h */
24762306a36Sopenharmony_ci    U8                      IOCNumber;                  /* 06h */
24862306a36Sopenharmony_ci    U8                      MsgFlags;                   /* 07h */
24962306a36Sopenharmony_ci    U32                     MsgContext;                 /* 08h */
25062306a36Sopenharmony_ci    U16                     IOCExceptions;              /* 0Ch */
25162306a36Sopenharmony_ci    U16                     IOCStatus;                  /* 0Eh */
25262306a36Sopenharmony_ci    U32                     IOCLogInfo;                 /* 10h */
25362306a36Sopenharmony_ci    U8                      MaxChainDepth;              /* 14h */
25462306a36Sopenharmony_ci    U8                      WhoInit;                    /* 15h */
25562306a36Sopenharmony_ci    U8                      BlockSize;                  /* 16h */
25662306a36Sopenharmony_ci    U8                      Flags;                      /* 17h */
25762306a36Sopenharmony_ci    U16                     ReplyQueueDepth;            /* 18h */
25862306a36Sopenharmony_ci    U16                     RequestFrameSize;           /* 1Ah */
25962306a36Sopenharmony_ci    U16                     Reserved_0101_FWVersion;    /* 1Ch */ /* obsolete 16-bit FWVersion */
26062306a36Sopenharmony_ci    U16                     ProductID;                  /* 1Eh */
26162306a36Sopenharmony_ci    U32                     CurrentHostMfaHighAddr;     /* 20h */
26262306a36Sopenharmony_ci    U16                     GlobalCredits;              /* 24h */
26362306a36Sopenharmony_ci    U8                      NumberOfPorts;              /* 26h */
26462306a36Sopenharmony_ci    U8                      EventState;                 /* 27h */
26562306a36Sopenharmony_ci    U32                     CurrentSenseBufferHighAddr; /* 28h */
26662306a36Sopenharmony_ci    U16                     CurReplyFrameSize;          /* 2Ch */
26762306a36Sopenharmony_ci    U8                      MaxDevices;                 /* 2Eh */
26862306a36Sopenharmony_ci    U8                      MaxBuses;                   /* 2Fh */
26962306a36Sopenharmony_ci    U32                     FWImageSize;                /* 30h */
27062306a36Sopenharmony_ci    U32                     IOCCapabilities;            /* 34h */
27162306a36Sopenharmony_ci    MPI_FW_VERSION          FWVersion;                  /* 38h */
27262306a36Sopenharmony_ci    U16                     HighPriorityQueueDepth;     /* 3Ch */
27362306a36Sopenharmony_ci    U16                     Reserved2;                  /* 3Eh */
27462306a36Sopenharmony_ci    SGE_SIMPLE_UNION        HostPageBufferSGE;          /* 40h */
27562306a36Sopenharmony_ci    U32                     ReplyFifoHostSignalingAddr; /* 4Ch */
27662306a36Sopenharmony_ci} MSG_IOC_FACTS_REPLY, MPI_POINTER PTR_MSG_IOC_FACTS_REPLY,
27762306a36Sopenharmony_ci  IOCFactsReply_t, MPI_POINTER pIOCFactsReply_t;
27862306a36Sopenharmony_ci
27962306a36Sopenharmony_ci#define MPI_IOCFACTS_MSGVERSION_MAJOR_MASK              (0xFF00)
28062306a36Sopenharmony_ci#define MPI_IOCFACTS_MSGVERSION_MAJOR_SHIFT             (8)
28162306a36Sopenharmony_ci#define MPI_IOCFACTS_MSGVERSION_MINOR_MASK              (0x00FF)
28262306a36Sopenharmony_ci#define MPI_IOCFACTS_MSGVERSION_MINOR_SHIFT             (0)
28362306a36Sopenharmony_ci
28462306a36Sopenharmony_ci#define MPI_IOCFACTS_HDRVERSION_UNIT_MASK               (0xFF00)
28562306a36Sopenharmony_ci#define MPI_IOCFACTS_HDRVERSION_UNIT_SHIFT              (8)
28662306a36Sopenharmony_ci#define MPI_IOCFACTS_HDRVERSION_DEV_MASK                (0x00FF)
28762306a36Sopenharmony_ci#define MPI_IOCFACTS_HDRVERSION_DEV_SHIFT               (0)
28862306a36Sopenharmony_ci
28962306a36Sopenharmony_ci#define MPI_IOCFACTS_EXCEPT_CONFIG_CHECKSUM_FAIL        (0x0001)
29062306a36Sopenharmony_ci#define MPI_IOCFACTS_EXCEPT_RAID_CONFIG_INVALID         (0x0002)
29162306a36Sopenharmony_ci#define MPI_IOCFACTS_EXCEPT_FW_CHECKSUM_FAIL            (0x0004)
29262306a36Sopenharmony_ci#define MPI_IOCFACTS_EXCEPT_PERSISTENT_TABLE_FULL       (0x0008)
29362306a36Sopenharmony_ci#define MPI_IOCFACTS_EXCEPT_METADATA_UNSUPPORTED        (0x0010)
29462306a36Sopenharmony_ci
29562306a36Sopenharmony_ci#define MPI_IOCFACTS_FLAGS_FW_DOWNLOAD_BOOT             (0x01)
29662306a36Sopenharmony_ci#define MPI_IOCFACTS_FLAGS_REPLY_FIFO_HOST_SIGNAL       (0x02)
29762306a36Sopenharmony_ci#define MPI_IOCFACTS_FLAGS_HOST_PAGE_BUFFER_PERSISTENT  (0x04)
29862306a36Sopenharmony_ci
29962306a36Sopenharmony_ci#define MPI_IOCFACTS_EVENTSTATE_DISABLED                (0x00)
30062306a36Sopenharmony_ci#define MPI_IOCFACTS_EVENTSTATE_ENABLED                 (0x01)
30162306a36Sopenharmony_ci
30262306a36Sopenharmony_ci#define MPI_IOCFACTS_CAPABILITY_HIGH_PRI_Q              (0x00000001)
30362306a36Sopenharmony_ci#define MPI_IOCFACTS_CAPABILITY_REPLY_HOST_SIGNAL       (0x00000002)
30462306a36Sopenharmony_ci#define MPI_IOCFACTS_CAPABILITY_QUEUE_FULL_HANDLING     (0x00000004)
30562306a36Sopenharmony_ci#define MPI_IOCFACTS_CAPABILITY_DIAG_TRACE_BUFFER       (0x00000008)
30662306a36Sopenharmony_ci#define MPI_IOCFACTS_CAPABILITY_SNAPSHOT_BUFFER         (0x00000010)
30762306a36Sopenharmony_ci#define MPI_IOCFACTS_CAPABILITY_EXTENDED_BUFFER         (0x00000020)
30862306a36Sopenharmony_ci#define MPI_IOCFACTS_CAPABILITY_EEDP                    (0x00000040)
30962306a36Sopenharmony_ci#define MPI_IOCFACTS_CAPABILITY_BIDIRECTIONAL           (0x00000080)
31062306a36Sopenharmony_ci#define MPI_IOCFACTS_CAPABILITY_MULTICAST               (0x00000100)
31162306a36Sopenharmony_ci#define MPI_IOCFACTS_CAPABILITY_SCSIIO32                (0x00000200)
31262306a36Sopenharmony_ci#define MPI_IOCFACTS_CAPABILITY_NO_SCSIIO16             (0x00000400)
31362306a36Sopenharmony_ci#define MPI_IOCFACTS_CAPABILITY_TLR                     (0x00000800)
31462306a36Sopenharmony_ci
31562306a36Sopenharmony_ci
31662306a36Sopenharmony_ci/*****************************************************************************
31762306a36Sopenharmony_ci*
31862306a36Sopenharmony_ci*               P o r t    M e s s a g e s
31962306a36Sopenharmony_ci*
32062306a36Sopenharmony_ci*****************************************************************************/
32162306a36Sopenharmony_ci
32262306a36Sopenharmony_ci/****************************************************************************/
32362306a36Sopenharmony_ci/*  Port Facts message and Reply                                            */
32462306a36Sopenharmony_ci/****************************************************************************/
32562306a36Sopenharmony_ci
32662306a36Sopenharmony_citypedef struct _MSG_PORT_FACTS
32762306a36Sopenharmony_ci{
32862306a36Sopenharmony_ci     U8                     Reserved[2];                /* 00h */
32962306a36Sopenharmony_ci     U8                     ChainOffset;                /* 02h */
33062306a36Sopenharmony_ci     U8                     Function;                   /* 03h */
33162306a36Sopenharmony_ci     U8                     Reserved1[2];               /* 04h */
33262306a36Sopenharmony_ci     U8                     PortNumber;                 /* 06h */
33362306a36Sopenharmony_ci     U8                     MsgFlags;                   /* 07h */
33462306a36Sopenharmony_ci     U32                    MsgContext;                 /* 08h */
33562306a36Sopenharmony_ci} MSG_PORT_FACTS, MPI_POINTER PTR_MSG_PORT_FACTS,
33662306a36Sopenharmony_ci  PortFacts_t, MPI_POINTER pPortFacts_t;
33762306a36Sopenharmony_ci
33862306a36Sopenharmony_citypedef struct _MSG_PORT_FACTS_REPLY
33962306a36Sopenharmony_ci{
34062306a36Sopenharmony_ci     U16                    Reserved;                   /* 00h */
34162306a36Sopenharmony_ci     U8                     MsgLength;                  /* 02h */
34262306a36Sopenharmony_ci     U8                     Function;                   /* 03h */
34362306a36Sopenharmony_ci     U16                    Reserved1;                  /* 04h */
34462306a36Sopenharmony_ci     U8                     PortNumber;                 /* 06h */
34562306a36Sopenharmony_ci     U8                     MsgFlags;                   /* 07h */
34662306a36Sopenharmony_ci     U32                    MsgContext;                 /* 08h */
34762306a36Sopenharmony_ci     U16                    Reserved2;                  /* 0Ch */
34862306a36Sopenharmony_ci     U16                    IOCStatus;                  /* 0Eh */
34962306a36Sopenharmony_ci     U32                    IOCLogInfo;                 /* 10h */
35062306a36Sopenharmony_ci     U8                     Reserved3;                  /* 14h */
35162306a36Sopenharmony_ci     U8                     PortType;                   /* 15h */
35262306a36Sopenharmony_ci     U16                    MaxDevices;                 /* 16h */
35362306a36Sopenharmony_ci     U16                    PortSCSIID;                 /* 18h */
35462306a36Sopenharmony_ci     U16                    ProtocolFlags;              /* 1Ah */
35562306a36Sopenharmony_ci     U16                    MaxPostedCmdBuffers;        /* 1Ch */
35662306a36Sopenharmony_ci     U16                    MaxPersistentIDs;           /* 1Eh */
35762306a36Sopenharmony_ci     U16                    MaxLanBuckets;              /* 20h */
35862306a36Sopenharmony_ci     U8                     MaxInitiators;              /* 22h */
35962306a36Sopenharmony_ci     U8                     Reserved4;                  /* 23h */
36062306a36Sopenharmony_ci     U32                    Reserved5;                  /* 24h */
36162306a36Sopenharmony_ci} MSG_PORT_FACTS_REPLY, MPI_POINTER PTR_MSG_PORT_FACTS_REPLY,
36262306a36Sopenharmony_ci  PortFactsReply_t, MPI_POINTER pPortFactsReply_t;
36362306a36Sopenharmony_ci
36462306a36Sopenharmony_ci
36562306a36Sopenharmony_ci/* PortTypes values */
36662306a36Sopenharmony_ci
36762306a36Sopenharmony_ci#define MPI_PORTFACTS_PORTTYPE_INACTIVE         (0x00)
36862306a36Sopenharmony_ci#define MPI_PORTFACTS_PORTTYPE_SCSI             (0x01)
36962306a36Sopenharmony_ci#define MPI_PORTFACTS_PORTTYPE_FC               (0x10)
37062306a36Sopenharmony_ci#define MPI_PORTFACTS_PORTTYPE_ISCSI            (0x20)
37162306a36Sopenharmony_ci#define MPI_PORTFACTS_PORTTYPE_SAS              (0x30)
37262306a36Sopenharmony_ci
37362306a36Sopenharmony_ci/* ProtocolFlags values */
37462306a36Sopenharmony_ci
37562306a36Sopenharmony_ci#define MPI_PORTFACTS_PROTOCOL_LOGBUSADDR       (0x01)
37662306a36Sopenharmony_ci#define MPI_PORTFACTS_PROTOCOL_LAN              (0x02)
37762306a36Sopenharmony_ci#define MPI_PORTFACTS_PROTOCOL_TARGET           (0x04)
37862306a36Sopenharmony_ci#define MPI_PORTFACTS_PROTOCOL_INITIATOR        (0x08)
37962306a36Sopenharmony_ci
38062306a36Sopenharmony_ci
38162306a36Sopenharmony_ci/****************************************************************************/
38262306a36Sopenharmony_ci/*  Port Enable Message                                                     */
38362306a36Sopenharmony_ci/****************************************************************************/
38462306a36Sopenharmony_ci
38562306a36Sopenharmony_citypedef struct _MSG_PORT_ENABLE
38662306a36Sopenharmony_ci{
38762306a36Sopenharmony_ci    U8                      Reserved[2];                /* 00h */
38862306a36Sopenharmony_ci    U8                      ChainOffset;                /* 02h */
38962306a36Sopenharmony_ci    U8                      Function;                   /* 03h */
39062306a36Sopenharmony_ci    U8                      Reserved1[2];               /* 04h */
39162306a36Sopenharmony_ci    U8                      PortNumber;                 /* 06h */
39262306a36Sopenharmony_ci    U8                      MsgFlags;                   /* 07h */
39362306a36Sopenharmony_ci    U32                     MsgContext;                 /* 08h */
39462306a36Sopenharmony_ci} MSG_PORT_ENABLE, MPI_POINTER PTR_MSG_PORT_ENABLE,
39562306a36Sopenharmony_ci  PortEnable_t, MPI_POINTER pPortEnable_t;
39662306a36Sopenharmony_ci
39762306a36Sopenharmony_citypedef struct _MSG_PORT_ENABLE_REPLY
39862306a36Sopenharmony_ci{
39962306a36Sopenharmony_ci    U8                      Reserved[2];                /* 00h */
40062306a36Sopenharmony_ci    U8                      MsgLength;                  /* 02h */
40162306a36Sopenharmony_ci    U8                      Function;                   /* 03h */
40262306a36Sopenharmony_ci    U8                      Reserved1[2];               /* 04h */
40362306a36Sopenharmony_ci    U8                      PortNumber;                 /* 05h */
40462306a36Sopenharmony_ci    U8                      MsgFlags;                   /* 07h */
40562306a36Sopenharmony_ci    U32                     MsgContext;                 /* 08h */
40662306a36Sopenharmony_ci    U16                     Reserved2;                  /* 0Ch */
40762306a36Sopenharmony_ci    U16                     IOCStatus;                  /* 0Eh */
40862306a36Sopenharmony_ci    U32                     IOCLogInfo;                 /* 10h */
40962306a36Sopenharmony_ci} MSG_PORT_ENABLE_REPLY, MPI_POINTER PTR_MSG_PORT_ENABLE_REPLY,
41062306a36Sopenharmony_ci  PortEnableReply_t, MPI_POINTER pPortEnableReply_t;
41162306a36Sopenharmony_ci
41262306a36Sopenharmony_ci
41362306a36Sopenharmony_ci/*****************************************************************************
41462306a36Sopenharmony_ci*
41562306a36Sopenharmony_ci*               E v e n t    M e s s a g e s
41662306a36Sopenharmony_ci*
41762306a36Sopenharmony_ci*****************************************************************************/
41862306a36Sopenharmony_ci
41962306a36Sopenharmony_ci/****************************************************************************/
42062306a36Sopenharmony_ci/*  Event Notification messages                                             */
42162306a36Sopenharmony_ci/****************************************************************************/
42262306a36Sopenharmony_ci
42362306a36Sopenharmony_citypedef struct _MSG_EVENT_NOTIFY
42462306a36Sopenharmony_ci{
42562306a36Sopenharmony_ci    U8                      Switch;                     /* 00h */
42662306a36Sopenharmony_ci    U8                      Reserved;                   /* 01h */
42762306a36Sopenharmony_ci    U8                      ChainOffset;                /* 02h */
42862306a36Sopenharmony_ci    U8                      Function;                   /* 03h */
42962306a36Sopenharmony_ci    U8                      Reserved1[3];               /* 04h */
43062306a36Sopenharmony_ci    U8                      MsgFlags;                   /* 07h */
43162306a36Sopenharmony_ci    U32                     MsgContext;                 /* 08h */
43262306a36Sopenharmony_ci} MSG_EVENT_NOTIFY, MPI_POINTER PTR_MSG_EVENT_NOTIFY,
43362306a36Sopenharmony_ci  EventNotification_t, MPI_POINTER pEventNotification_t;
43462306a36Sopenharmony_ci
43562306a36Sopenharmony_ci/* Event Notification Reply */
43662306a36Sopenharmony_ci
43762306a36Sopenharmony_citypedef struct _MSG_EVENT_NOTIFY_REPLY
43862306a36Sopenharmony_ci{
43962306a36Sopenharmony_ci     U16                    EventDataLength;            /* 00h */
44062306a36Sopenharmony_ci     U8                     MsgLength;                  /* 02h */
44162306a36Sopenharmony_ci     U8                     Function;                   /* 03h */
44262306a36Sopenharmony_ci     U8                     Reserved1[2];               /* 04h */
44362306a36Sopenharmony_ci     U8                     AckRequired;                /* 06h */
44462306a36Sopenharmony_ci     U8                     MsgFlags;                   /* 07h */
44562306a36Sopenharmony_ci     U32                    MsgContext;                 /* 08h */
44662306a36Sopenharmony_ci     U8                     Reserved2[2];               /* 0Ch */
44762306a36Sopenharmony_ci     U16                    IOCStatus;                  /* 0Eh */
44862306a36Sopenharmony_ci     U32                    IOCLogInfo;                 /* 10h */
44962306a36Sopenharmony_ci     U32                    Event;                      /* 14h */
45062306a36Sopenharmony_ci     U32                    EventContext;               /* 18h */
45162306a36Sopenharmony_ci     U32                    Data[];			/* 1Ch */
45262306a36Sopenharmony_ci} MSG_EVENT_NOTIFY_REPLY, MPI_POINTER PTR_MSG_EVENT_NOTIFY_REPLY,
45362306a36Sopenharmony_ci  EventNotificationReply_t, MPI_POINTER pEventNotificationReply_t;
45462306a36Sopenharmony_ci
45562306a36Sopenharmony_ci/* Event Acknowledge */
45662306a36Sopenharmony_ci
45762306a36Sopenharmony_citypedef struct _MSG_EVENT_ACK
45862306a36Sopenharmony_ci{
45962306a36Sopenharmony_ci    U8                      Reserved[2];                /* 00h */
46062306a36Sopenharmony_ci    U8                      ChainOffset;                /* 02h */
46162306a36Sopenharmony_ci    U8                      Function;                   /* 03h */
46262306a36Sopenharmony_ci    U8                      Reserved1[3];               /* 04h */
46362306a36Sopenharmony_ci    U8                      MsgFlags;                   /* 07h */
46462306a36Sopenharmony_ci    U32                     MsgContext;                 /* 08h */
46562306a36Sopenharmony_ci    U32                     Event;                      /* 0Ch */
46662306a36Sopenharmony_ci    U32                     EventContext;               /* 10h */
46762306a36Sopenharmony_ci} MSG_EVENT_ACK, MPI_POINTER PTR_MSG_EVENT_ACK,
46862306a36Sopenharmony_ci  EventAck_t, MPI_POINTER pEventAck_t;
46962306a36Sopenharmony_ci
47062306a36Sopenharmony_citypedef struct _MSG_EVENT_ACK_REPLY
47162306a36Sopenharmony_ci{
47262306a36Sopenharmony_ci    U8                      Reserved[2];                /* 00h */
47362306a36Sopenharmony_ci    U8                      MsgLength;                  /* 02h */
47462306a36Sopenharmony_ci    U8                      Function;                   /* 03h */
47562306a36Sopenharmony_ci    U8                      Reserved1[3];               /* 04h */
47662306a36Sopenharmony_ci    U8                      MsgFlags;                   /* 07h */
47762306a36Sopenharmony_ci    U32                     MsgContext;                 /* 08h */
47862306a36Sopenharmony_ci    U16                     Reserved2;                  /* 0Ch */
47962306a36Sopenharmony_ci    U16                     IOCStatus;                  /* 0Eh */
48062306a36Sopenharmony_ci    U32                     IOCLogInfo;                 /* 10h */
48162306a36Sopenharmony_ci} MSG_EVENT_ACK_REPLY, MPI_POINTER PTR_MSG_EVENT_ACK_REPLY,
48262306a36Sopenharmony_ci  EventAckReply_t, MPI_POINTER pEventAckReply_t;
48362306a36Sopenharmony_ci
48462306a36Sopenharmony_ci/* Switch */
48562306a36Sopenharmony_ci
48662306a36Sopenharmony_ci#define MPI_EVENT_NOTIFICATION_SWITCH_OFF   (0x00)
48762306a36Sopenharmony_ci#define MPI_EVENT_NOTIFICATION_SWITCH_ON    (0x01)
48862306a36Sopenharmony_ci
48962306a36Sopenharmony_ci/* Event */
49062306a36Sopenharmony_ci
49162306a36Sopenharmony_ci#define MPI_EVENT_NONE                          (0x00000000)
49262306a36Sopenharmony_ci#define MPI_EVENT_LOG_DATA                      (0x00000001)
49362306a36Sopenharmony_ci#define MPI_EVENT_STATE_CHANGE                  (0x00000002)
49462306a36Sopenharmony_ci#define MPI_EVENT_UNIT_ATTENTION                (0x00000003)
49562306a36Sopenharmony_ci#define MPI_EVENT_IOC_BUS_RESET                 (0x00000004)
49662306a36Sopenharmony_ci#define MPI_EVENT_EXT_BUS_RESET                 (0x00000005)
49762306a36Sopenharmony_ci#define MPI_EVENT_RESCAN                        (0x00000006)
49862306a36Sopenharmony_ci#define MPI_EVENT_LINK_STATUS_CHANGE            (0x00000007)
49962306a36Sopenharmony_ci#define MPI_EVENT_LOOP_STATE_CHANGE             (0x00000008)
50062306a36Sopenharmony_ci#define MPI_EVENT_LOGOUT                        (0x00000009)
50162306a36Sopenharmony_ci#define MPI_EVENT_EVENT_CHANGE                  (0x0000000A)
50262306a36Sopenharmony_ci#define MPI_EVENT_INTEGRATED_RAID               (0x0000000B)
50362306a36Sopenharmony_ci#define MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE     (0x0000000C)
50462306a36Sopenharmony_ci#define MPI_EVENT_ON_BUS_TIMER_EXPIRED          (0x0000000D)
50562306a36Sopenharmony_ci#define MPI_EVENT_QUEUE_FULL                    (0x0000000E)
50662306a36Sopenharmony_ci#define MPI_EVENT_SAS_DEVICE_STATUS_CHANGE      (0x0000000F)
50762306a36Sopenharmony_ci#define MPI_EVENT_SAS_SES                       (0x00000010)
50862306a36Sopenharmony_ci#define MPI_EVENT_PERSISTENT_TABLE_FULL         (0x00000011)
50962306a36Sopenharmony_ci#define MPI_EVENT_SAS_PHY_LINK_STATUS           (0x00000012)
51062306a36Sopenharmony_ci#define MPI_EVENT_SAS_DISCOVERY_ERROR           (0x00000013)
51162306a36Sopenharmony_ci#define MPI_EVENT_IR_RESYNC_UPDATE              (0x00000014)
51262306a36Sopenharmony_ci#define MPI_EVENT_IR2                           (0x00000015)
51362306a36Sopenharmony_ci#define MPI_EVENT_SAS_DISCOVERY                 (0x00000016)
51462306a36Sopenharmony_ci#define MPI_EVENT_SAS_BROADCAST_PRIMITIVE       (0x00000017)
51562306a36Sopenharmony_ci#define MPI_EVENT_SAS_INIT_DEVICE_STATUS_CHANGE (0x00000018)
51662306a36Sopenharmony_ci#define MPI_EVENT_SAS_INIT_TABLE_OVERFLOW       (0x00000019)
51762306a36Sopenharmony_ci#define MPI_EVENT_SAS_SMP_ERROR                 (0x0000001A)
51862306a36Sopenharmony_ci#define MPI_EVENT_SAS_EXPANDER_STATUS_CHANGE    (0x0000001B)
51962306a36Sopenharmony_ci#define MPI_EVENT_LOG_ENTRY_ADDED               (0x00000021)
52062306a36Sopenharmony_ci
52162306a36Sopenharmony_ci/* AckRequired field values */
52262306a36Sopenharmony_ci
52362306a36Sopenharmony_ci#define MPI_EVENT_NOTIFICATION_ACK_NOT_REQUIRED (0x00)
52462306a36Sopenharmony_ci#define MPI_EVENT_NOTIFICATION_ACK_REQUIRED     (0x01)
52562306a36Sopenharmony_ci
52662306a36Sopenharmony_ci/* EventChange Event data */
52762306a36Sopenharmony_ci
52862306a36Sopenharmony_citypedef struct _EVENT_DATA_EVENT_CHANGE
52962306a36Sopenharmony_ci{
53062306a36Sopenharmony_ci    U8                      EventState;                 /* 00h */
53162306a36Sopenharmony_ci    U8                      Reserved;                   /* 01h */
53262306a36Sopenharmony_ci    U16                     Reserved1;                  /* 02h */
53362306a36Sopenharmony_ci} EVENT_DATA_EVENT_CHANGE, MPI_POINTER PTR_EVENT_DATA_EVENT_CHANGE,
53462306a36Sopenharmony_ci  EventDataEventChange_t, MPI_POINTER pEventDataEventChange_t;
53562306a36Sopenharmony_ci
53662306a36Sopenharmony_ci/* LogEntryAdded Event data */
53762306a36Sopenharmony_ci
53862306a36Sopenharmony_ci/* this structure matches MPI_LOG_0_ENTRY in mpi_cnfg.h */
53962306a36Sopenharmony_ci#define MPI_EVENT_DATA_LOG_ENTRY_DATA_LENGTH    (0x1C)
54062306a36Sopenharmony_citypedef struct _EVENT_DATA_LOG_ENTRY
54162306a36Sopenharmony_ci{
54262306a36Sopenharmony_ci    U32         TimeStamp;                          /* 00h */
54362306a36Sopenharmony_ci    U32         Reserved1;                          /* 04h */
54462306a36Sopenharmony_ci    U16         LogSequence;                        /* 08h */
54562306a36Sopenharmony_ci    U16         LogEntryQualifier;                  /* 0Ah */
54662306a36Sopenharmony_ci    U8          LogData[MPI_EVENT_DATA_LOG_ENTRY_DATA_LENGTH]; /* 0Ch */
54762306a36Sopenharmony_ci} EVENT_DATA_LOG_ENTRY, MPI_POINTER PTR_EVENT_DATA_LOG_ENTRY,
54862306a36Sopenharmony_ci  MpiEventDataLogEntry_t, MPI_POINTER pMpiEventDataLogEntry_t;
54962306a36Sopenharmony_ci
55062306a36Sopenharmony_citypedef struct _EVENT_DATA_LOG_ENTRY_ADDED
55162306a36Sopenharmony_ci{
55262306a36Sopenharmony_ci    U16                     LogSequence;            /* 00h */
55362306a36Sopenharmony_ci    U16                     Reserved1;              /* 02h */
55462306a36Sopenharmony_ci    U32                     Reserved2;              /* 04h */
55562306a36Sopenharmony_ci    EVENT_DATA_LOG_ENTRY    LogEntry;               /* 08h */
55662306a36Sopenharmony_ci} EVENT_DATA_LOG_ENTRY_ADDED, MPI_POINTER PTR_EVENT_DATA_LOG_ENTRY_ADDED,
55762306a36Sopenharmony_ci  MpiEventDataLogEntryAdded_t, MPI_POINTER pMpiEventDataLogEntryAdded_t;
55862306a36Sopenharmony_ci
55962306a36Sopenharmony_ci/* SCSI Event data for Port, Bus and Device forms */
56062306a36Sopenharmony_ci
56162306a36Sopenharmony_citypedef struct _EVENT_DATA_SCSI
56262306a36Sopenharmony_ci{
56362306a36Sopenharmony_ci    U8                      TargetID;                   /* 00h */
56462306a36Sopenharmony_ci    U8                      BusPort;                    /* 01h */
56562306a36Sopenharmony_ci    U16                     Reserved;                   /* 02h */
56662306a36Sopenharmony_ci} EVENT_DATA_SCSI, MPI_POINTER PTR_EVENT_DATA_SCSI,
56762306a36Sopenharmony_ci  EventDataScsi_t, MPI_POINTER pEventDataScsi_t;
56862306a36Sopenharmony_ci
56962306a36Sopenharmony_ci/* SCSI Device Status Change Event data */
57062306a36Sopenharmony_ci
57162306a36Sopenharmony_citypedef struct _EVENT_DATA_SCSI_DEVICE_STATUS_CHANGE
57262306a36Sopenharmony_ci{
57362306a36Sopenharmony_ci    U8                      TargetID;                   /* 00h */
57462306a36Sopenharmony_ci    U8                      Bus;                        /* 01h */
57562306a36Sopenharmony_ci    U8                      ReasonCode;                 /* 02h */
57662306a36Sopenharmony_ci    U8                      LUN;                        /* 03h */
57762306a36Sopenharmony_ci    U8                      ASC;                        /* 04h */
57862306a36Sopenharmony_ci    U8                      ASCQ;                       /* 05h */
57962306a36Sopenharmony_ci    U16                     Reserved;                   /* 06h */
58062306a36Sopenharmony_ci} EVENT_DATA_SCSI_DEVICE_STATUS_CHANGE,
58162306a36Sopenharmony_ci  MPI_POINTER PTR_EVENT_DATA_SCSI_DEVICE_STATUS_CHANGE,
58262306a36Sopenharmony_ci  MpiEventDataScsiDeviceStatusChange_t,
58362306a36Sopenharmony_ci  MPI_POINTER pMpiEventDataScsiDeviceStatusChange_t;
58462306a36Sopenharmony_ci
58562306a36Sopenharmony_ci/* MPI SCSI Device Status Change Event data ReasonCode values */
58662306a36Sopenharmony_ci#define MPI_EVENT_SCSI_DEV_STAT_RC_ADDED                (0x03)
58762306a36Sopenharmony_ci#define MPI_EVENT_SCSI_DEV_STAT_RC_NOT_RESPONDING       (0x04)
58862306a36Sopenharmony_ci#define MPI_EVENT_SCSI_DEV_STAT_RC_SMART_DATA           (0x05)
58962306a36Sopenharmony_ci
59062306a36Sopenharmony_ci/* SAS Device Status Change Event data */
59162306a36Sopenharmony_ci
59262306a36Sopenharmony_citypedef struct _EVENT_DATA_SAS_DEVICE_STATUS_CHANGE
59362306a36Sopenharmony_ci{
59462306a36Sopenharmony_ci    U8                      TargetID;                   /* 00h */
59562306a36Sopenharmony_ci    U8                      Bus;                        /* 01h */
59662306a36Sopenharmony_ci    U8                      ReasonCode;                 /* 02h */
59762306a36Sopenharmony_ci    U8                      Reserved;                   /* 03h */
59862306a36Sopenharmony_ci    U8                      ASC;                        /* 04h */
59962306a36Sopenharmony_ci    U8                      ASCQ;                       /* 05h */
60062306a36Sopenharmony_ci    U16                     DevHandle;                  /* 06h */
60162306a36Sopenharmony_ci    U32                     DeviceInfo;                 /* 08h */
60262306a36Sopenharmony_ci    U16                     ParentDevHandle;            /* 0Ch */
60362306a36Sopenharmony_ci    U8                      PhyNum;                     /* 0Eh */
60462306a36Sopenharmony_ci    U8                      Reserved1;                  /* 0Fh */
60562306a36Sopenharmony_ci    U64                     SASAddress;                 /* 10h */
60662306a36Sopenharmony_ci    U8                      LUN[8];                     /* 18h */
60762306a36Sopenharmony_ci    U16                     TaskTag;                    /* 20h */
60862306a36Sopenharmony_ci    U16                     Reserved2;                  /* 22h */
60962306a36Sopenharmony_ci} EVENT_DATA_SAS_DEVICE_STATUS_CHANGE,
61062306a36Sopenharmony_ci  MPI_POINTER PTR_EVENT_DATA_SAS_DEVICE_STATUS_CHANGE,
61162306a36Sopenharmony_ci  MpiEventDataSasDeviceStatusChange_t,
61262306a36Sopenharmony_ci  MPI_POINTER pMpiEventDataSasDeviceStatusChange_t;
61362306a36Sopenharmony_ci
61462306a36Sopenharmony_ci/* MPI SAS Device Status Change Event data ReasonCode values */
61562306a36Sopenharmony_ci#define MPI_EVENT_SAS_DEV_STAT_RC_ADDED                     (0x03)
61662306a36Sopenharmony_ci#define MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING            (0x04)
61762306a36Sopenharmony_ci#define MPI_EVENT_SAS_DEV_STAT_RC_SMART_DATA                (0x05)
61862306a36Sopenharmony_ci#define MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED          (0x06)
61962306a36Sopenharmony_ci#define MPI_EVENT_SAS_DEV_STAT_RC_UNSUPPORTED               (0x07)
62062306a36Sopenharmony_ci#define MPI_EVENT_SAS_DEV_STAT_RC_INTERNAL_DEVICE_RESET     (0x08)
62162306a36Sopenharmony_ci#define MPI_EVENT_SAS_DEV_STAT_RC_TASK_ABORT_INTERNAL       (0x09)
62262306a36Sopenharmony_ci#define MPI_EVENT_SAS_DEV_STAT_RC_ABORT_TASK_SET_INTERNAL   (0x0A)
62362306a36Sopenharmony_ci#define MPI_EVENT_SAS_DEV_STAT_RC_CLEAR_TASK_SET_INTERNAL   (0x0B)
62462306a36Sopenharmony_ci#define MPI_EVENT_SAS_DEV_STAT_RC_QUERY_TASK_INTERNAL       (0x0C)
62562306a36Sopenharmony_ci#define MPI_EVENT_SAS_DEV_STAT_RC_ASYNC_NOTIFICATION        (0x0D)
62662306a36Sopenharmony_ci#define MPI_EVENT_SAS_DEV_STAT_RC_CMPL_INTERNAL_DEV_RESET   (0x0E)
62762306a36Sopenharmony_ci#define MPI_EVENT_SAS_DEV_STAT_RC_CMPL_TASK_ABORT_INTERNAL  (0x0F)
62862306a36Sopenharmony_ci
62962306a36Sopenharmony_ci
63062306a36Sopenharmony_ci/* SCSI Event data for Queue Full event */
63162306a36Sopenharmony_ci
63262306a36Sopenharmony_citypedef struct _EVENT_DATA_QUEUE_FULL
63362306a36Sopenharmony_ci{
63462306a36Sopenharmony_ci    U8                      TargetID;                   /* 00h */
63562306a36Sopenharmony_ci    U8                      Bus;                        /* 01h */
63662306a36Sopenharmony_ci    U16                     CurrentDepth;               /* 02h */
63762306a36Sopenharmony_ci} EVENT_DATA_QUEUE_FULL, MPI_POINTER PTR_EVENT_DATA_QUEUE_FULL,
63862306a36Sopenharmony_ci  EventDataQueueFull_t, MPI_POINTER pEventDataQueueFull_t;
63962306a36Sopenharmony_ci
64062306a36Sopenharmony_ci/* MPI Integrated RAID Event data */
64162306a36Sopenharmony_ci
64262306a36Sopenharmony_citypedef struct _EVENT_DATA_RAID
64362306a36Sopenharmony_ci{
64462306a36Sopenharmony_ci    U8                      VolumeID;                   /* 00h */
64562306a36Sopenharmony_ci    U8                      VolumeBus;                  /* 01h */
64662306a36Sopenharmony_ci    U8                      ReasonCode;                 /* 02h */
64762306a36Sopenharmony_ci    U8                      PhysDiskNum;                /* 03h */
64862306a36Sopenharmony_ci    U8                      ASC;                        /* 04h */
64962306a36Sopenharmony_ci    U8                      ASCQ;                       /* 05h */
65062306a36Sopenharmony_ci    U16                     Reserved;                   /* 06h */
65162306a36Sopenharmony_ci    U32                     SettingsStatus;             /* 08h */
65262306a36Sopenharmony_ci} EVENT_DATA_RAID, MPI_POINTER PTR_EVENT_DATA_RAID,
65362306a36Sopenharmony_ci  MpiEventDataRaid_t, MPI_POINTER pMpiEventDataRaid_t;
65462306a36Sopenharmony_ci
65562306a36Sopenharmony_ci/* MPI Integrated RAID Event data ReasonCode values */
65662306a36Sopenharmony_ci#define MPI_EVENT_RAID_RC_VOLUME_CREATED                (0x00)
65762306a36Sopenharmony_ci#define MPI_EVENT_RAID_RC_VOLUME_DELETED                (0x01)
65862306a36Sopenharmony_ci#define MPI_EVENT_RAID_RC_VOLUME_SETTINGS_CHANGED       (0x02)
65962306a36Sopenharmony_ci#define MPI_EVENT_RAID_RC_VOLUME_STATUS_CHANGED         (0x03)
66062306a36Sopenharmony_ci#define MPI_EVENT_RAID_RC_VOLUME_PHYSDISK_CHANGED       (0x04)
66162306a36Sopenharmony_ci#define MPI_EVENT_RAID_RC_PHYSDISK_CREATED              (0x05)
66262306a36Sopenharmony_ci#define MPI_EVENT_RAID_RC_PHYSDISK_DELETED              (0x06)
66362306a36Sopenharmony_ci#define MPI_EVENT_RAID_RC_PHYSDISK_SETTINGS_CHANGED     (0x07)
66462306a36Sopenharmony_ci#define MPI_EVENT_RAID_RC_PHYSDISK_STATUS_CHANGED       (0x08)
66562306a36Sopenharmony_ci#define MPI_EVENT_RAID_RC_DOMAIN_VAL_NEEDED             (0x09)
66662306a36Sopenharmony_ci#define MPI_EVENT_RAID_RC_SMART_DATA                    (0x0A)
66762306a36Sopenharmony_ci#define MPI_EVENT_RAID_RC_REPLACE_ACTION_STARTED        (0x0B)
66862306a36Sopenharmony_ci
66962306a36Sopenharmony_ci
67062306a36Sopenharmony_ci/* MPI Integrated RAID Resync Update Event data */
67162306a36Sopenharmony_ci
67262306a36Sopenharmony_citypedef struct _MPI_EVENT_DATA_IR_RESYNC_UPDATE
67362306a36Sopenharmony_ci{
67462306a36Sopenharmony_ci    U8                      VolumeID;                   /* 00h */
67562306a36Sopenharmony_ci    U8                      VolumeBus;                  /* 01h */
67662306a36Sopenharmony_ci    U8                      ResyncComplete;             /* 02h */
67762306a36Sopenharmony_ci    U8                      Reserved1;                  /* 03h */
67862306a36Sopenharmony_ci    U32                     Reserved2;                  /* 04h */
67962306a36Sopenharmony_ci} MPI_EVENT_DATA_IR_RESYNC_UPDATE,
68062306a36Sopenharmony_ci  MPI_POINTER PTR_MPI_EVENT_DATA_IR_RESYNC_UPDATE,
68162306a36Sopenharmony_ci  MpiEventDataIrResyncUpdate_t, MPI_POINTER pMpiEventDataIrResyncUpdate_t;
68262306a36Sopenharmony_ci
68362306a36Sopenharmony_ci/* MPI IR2 Event data */
68462306a36Sopenharmony_ci
68562306a36Sopenharmony_ci/* MPI_LD_STATE or MPI_PD_STATE */
68662306a36Sopenharmony_citypedef struct _IR2_STATE_CHANGED
68762306a36Sopenharmony_ci{
68862306a36Sopenharmony_ci    U16                 PreviousState;  /* 00h */
68962306a36Sopenharmony_ci    U16                 NewState;       /* 02h */
69062306a36Sopenharmony_ci} IR2_STATE_CHANGED, MPI_POINTER PTR_IR2_STATE_CHANGED;
69162306a36Sopenharmony_ci
69262306a36Sopenharmony_citypedef struct _IR2_PD_INFO
69362306a36Sopenharmony_ci{
69462306a36Sopenharmony_ci    U16                 DeviceHandle;           /* 00h */
69562306a36Sopenharmony_ci    U8                  TruncEnclosureHandle;   /* 02h */
69662306a36Sopenharmony_ci    U8                  TruncatedSlot;          /* 03h */
69762306a36Sopenharmony_ci} IR2_PD_INFO, MPI_POINTER PTR_IR2_PD_INFO;
69862306a36Sopenharmony_ci
69962306a36Sopenharmony_citypedef union _MPI_IR2_RC_EVENT_DATA
70062306a36Sopenharmony_ci{
70162306a36Sopenharmony_ci    IR2_STATE_CHANGED   StateChanged;
70262306a36Sopenharmony_ci    U32                 Lba;
70362306a36Sopenharmony_ci    IR2_PD_INFO         PdInfo;
70462306a36Sopenharmony_ci} MPI_IR2_RC_EVENT_DATA, MPI_POINTER PTR_MPI_IR2_RC_EVENT_DATA;
70562306a36Sopenharmony_ci
70662306a36Sopenharmony_citypedef struct _MPI_EVENT_DATA_IR2
70762306a36Sopenharmony_ci{
70862306a36Sopenharmony_ci    U8                      TargetID;             /* 00h */
70962306a36Sopenharmony_ci    U8                      Bus;                  /* 01h */
71062306a36Sopenharmony_ci    U8                      ReasonCode;           /* 02h */
71162306a36Sopenharmony_ci    U8                      PhysDiskNum;          /* 03h */
71262306a36Sopenharmony_ci    MPI_IR2_RC_EVENT_DATA   IR2EventData;         /* 04h */
71362306a36Sopenharmony_ci} MPI_EVENT_DATA_IR2, MPI_POINTER PTR_MPI_EVENT_DATA_IR2,
71462306a36Sopenharmony_ci  MpiEventDataIR2_t, MPI_POINTER pMpiEventDataIR2_t;
71562306a36Sopenharmony_ci
71662306a36Sopenharmony_ci/* MPI IR2 Event data ReasonCode values */
71762306a36Sopenharmony_ci#define MPI_EVENT_IR2_RC_LD_STATE_CHANGED           (0x01)
71862306a36Sopenharmony_ci#define MPI_EVENT_IR2_RC_PD_STATE_CHANGED           (0x02)
71962306a36Sopenharmony_ci#define MPI_EVENT_IR2_RC_BAD_BLOCK_TABLE_FULL       (0x03)
72062306a36Sopenharmony_ci#define MPI_EVENT_IR2_RC_PD_INSERTED                (0x04)
72162306a36Sopenharmony_ci#define MPI_EVENT_IR2_RC_PD_REMOVED                 (0x05)
72262306a36Sopenharmony_ci#define MPI_EVENT_IR2_RC_FOREIGN_CFG_DETECTED       (0x06)
72362306a36Sopenharmony_ci#define MPI_EVENT_IR2_RC_REBUILD_MEDIUM_ERROR       (0x07)
72462306a36Sopenharmony_ci#define MPI_EVENT_IR2_RC_DUAL_PORT_ADDED            (0x08)
72562306a36Sopenharmony_ci#define MPI_EVENT_IR2_RC_DUAL_PORT_REMOVED          (0x09)
72662306a36Sopenharmony_ci
72762306a36Sopenharmony_ci/* defines for logical disk states */
72862306a36Sopenharmony_ci#define MPI_LD_STATE_OPTIMAL                        (0x00)
72962306a36Sopenharmony_ci#define MPI_LD_STATE_DEGRADED                       (0x01)
73062306a36Sopenharmony_ci#define MPI_LD_STATE_FAILED                         (0x02)
73162306a36Sopenharmony_ci#define MPI_LD_STATE_MISSING                        (0x03)
73262306a36Sopenharmony_ci#define MPI_LD_STATE_OFFLINE                        (0x04)
73362306a36Sopenharmony_ci
73462306a36Sopenharmony_ci/* defines for physical disk states */
73562306a36Sopenharmony_ci#define MPI_PD_STATE_ONLINE                         (0x00)
73662306a36Sopenharmony_ci#define MPI_PD_STATE_MISSING                        (0x01)
73762306a36Sopenharmony_ci#define MPI_PD_STATE_NOT_COMPATIBLE                 (0x02)
73862306a36Sopenharmony_ci#define MPI_PD_STATE_FAILED                         (0x03)
73962306a36Sopenharmony_ci#define MPI_PD_STATE_INITIALIZING                   (0x04)
74062306a36Sopenharmony_ci#define MPI_PD_STATE_OFFLINE_AT_HOST_REQUEST        (0x05)
74162306a36Sopenharmony_ci#define MPI_PD_STATE_FAILED_AT_HOST_REQUEST         (0x06)
74262306a36Sopenharmony_ci#define MPI_PD_STATE_OFFLINE_FOR_ANOTHER_REASON     (0xFF)
74362306a36Sopenharmony_ci
74462306a36Sopenharmony_ci/* MPI Link Status Change Event data */
74562306a36Sopenharmony_ci
74662306a36Sopenharmony_citypedef struct _EVENT_DATA_LINK_STATUS
74762306a36Sopenharmony_ci{
74862306a36Sopenharmony_ci    U8                      State;                      /* 00h */
74962306a36Sopenharmony_ci    U8                      Reserved;                   /* 01h */
75062306a36Sopenharmony_ci    U16                     Reserved1;                  /* 02h */
75162306a36Sopenharmony_ci    U8                      Reserved2;                  /* 04h */
75262306a36Sopenharmony_ci    U8                      Port;                       /* 05h */
75362306a36Sopenharmony_ci    U16                     Reserved3;                  /* 06h */
75462306a36Sopenharmony_ci} EVENT_DATA_LINK_STATUS, MPI_POINTER PTR_EVENT_DATA_LINK_STATUS,
75562306a36Sopenharmony_ci  EventDataLinkStatus_t, MPI_POINTER pEventDataLinkStatus_t;
75662306a36Sopenharmony_ci
75762306a36Sopenharmony_ci#define MPI_EVENT_LINK_STATUS_FAILURE       (0x00000000)
75862306a36Sopenharmony_ci#define MPI_EVENT_LINK_STATUS_ACTIVE        (0x00000001)
75962306a36Sopenharmony_ci
76062306a36Sopenharmony_ci/* MPI Loop State Change Event data */
76162306a36Sopenharmony_ci
76262306a36Sopenharmony_citypedef struct _EVENT_DATA_LOOP_STATE
76362306a36Sopenharmony_ci{
76462306a36Sopenharmony_ci    U8                      Character4;                 /* 00h */
76562306a36Sopenharmony_ci    U8                      Character3;                 /* 01h */
76662306a36Sopenharmony_ci    U8                      Type;                       /* 02h */
76762306a36Sopenharmony_ci    U8                      Reserved;                   /* 03h */
76862306a36Sopenharmony_ci    U8                      Reserved1;                  /* 04h */
76962306a36Sopenharmony_ci    U8                      Port;                       /* 05h */
77062306a36Sopenharmony_ci    U16                     Reserved2;                  /* 06h */
77162306a36Sopenharmony_ci} EVENT_DATA_LOOP_STATE, MPI_POINTER PTR_EVENT_DATA_LOOP_STATE,
77262306a36Sopenharmony_ci  EventDataLoopState_t, MPI_POINTER pEventDataLoopState_t;
77362306a36Sopenharmony_ci
77462306a36Sopenharmony_ci#define MPI_EVENT_LOOP_STATE_CHANGE_LIP     (0x0001)
77562306a36Sopenharmony_ci#define MPI_EVENT_LOOP_STATE_CHANGE_LPE     (0x0002)
77662306a36Sopenharmony_ci#define MPI_EVENT_LOOP_STATE_CHANGE_LPB     (0x0003)
77762306a36Sopenharmony_ci
77862306a36Sopenharmony_ci/* MPI LOGOUT Event data */
77962306a36Sopenharmony_ci
78062306a36Sopenharmony_citypedef struct _EVENT_DATA_LOGOUT
78162306a36Sopenharmony_ci{
78262306a36Sopenharmony_ci    U32                     NPortID;                    /* 00h */
78362306a36Sopenharmony_ci    U8                      AliasIndex;                 /* 04h */
78462306a36Sopenharmony_ci    U8                      Port;                       /* 05h */
78562306a36Sopenharmony_ci    U16                     Reserved1;                  /* 06h */
78662306a36Sopenharmony_ci} EVENT_DATA_LOGOUT, MPI_POINTER PTR_EVENT_DATA_LOGOUT,
78762306a36Sopenharmony_ci  EventDataLogout_t, MPI_POINTER pEventDataLogout_t;
78862306a36Sopenharmony_ci
78962306a36Sopenharmony_ci#define MPI_EVENT_LOGOUT_ALL_ALIASES        (0xFF)
79062306a36Sopenharmony_ci
79162306a36Sopenharmony_ci/* SAS SES Event data */
79262306a36Sopenharmony_ci
79362306a36Sopenharmony_citypedef struct _EVENT_DATA_SAS_SES
79462306a36Sopenharmony_ci{
79562306a36Sopenharmony_ci    U8                      PhyNum;                     /* 00h */
79662306a36Sopenharmony_ci    U8                      Port;                       /* 01h */
79762306a36Sopenharmony_ci    U8                      PortWidth;                  /* 02h */
79862306a36Sopenharmony_ci    U8                      Reserved1;                  /* 04h */
79962306a36Sopenharmony_ci} EVENT_DATA_SAS_SES, MPI_POINTER PTR_EVENT_DATA_SAS_SES,
80062306a36Sopenharmony_ci  MpiEventDataSasSes_t, MPI_POINTER pMpiEventDataSasSes_t;
80162306a36Sopenharmony_ci
80262306a36Sopenharmony_ci/* SAS Broadcast Primitive Event data */
80362306a36Sopenharmony_ci
80462306a36Sopenharmony_citypedef struct _EVENT_DATA_SAS_BROADCAST_PRIMITIVE
80562306a36Sopenharmony_ci{
80662306a36Sopenharmony_ci    U8                      PhyNum;                     /* 00h */
80762306a36Sopenharmony_ci    U8                      Port;                       /* 01h */
80862306a36Sopenharmony_ci    U8                      PortWidth;                  /* 02h */
80962306a36Sopenharmony_ci    U8                      Primitive;                  /* 04h */
81062306a36Sopenharmony_ci} EVENT_DATA_SAS_BROADCAST_PRIMITIVE,
81162306a36Sopenharmony_ci  MPI_POINTER PTR_EVENT_DATA_SAS_BROADCAST_PRIMITIVE,
81262306a36Sopenharmony_ci  MpiEventDataSasBroadcastPrimitive_t,
81362306a36Sopenharmony_ci  MPI_POINTER pMpiEventDataSasBroadcastPrimitive_t;
81462306a36Sopenharmony_ci
81562306a36Sopenharmony_ci#define MPI_EVENT_PRIMITIVE_CHANGE              (0x01)
81662306a36Sopenharmony_ci#define MPI_EVENT_PRIMITIVE_EXPANDER            (0x03)
81762306a36Sopenharmony_ci#define MPI_EVENT_PRIMITIVE_ASYNCHRONOUS_EVENT  (0x04)
81862306a36Sopenharmony_ci#define MPI_EVENT_PRIMITIVE_RESERVED3           (0x05)
81962306a36Sopenharmony_ci#define MPI_EVENT_PRIMITIVE_RESERVED4           (0x06)
82062306a36Sopenharmony_ci#define MPI_EVENT_PRIMITIVE_CHANGE0_RESERVED    (0x07)
82162306a36Sopenharmony_ci#define MPI_EVENT_PRIMITIVE_CHANGE1_RESERVED    (0x08)
82262306a36Sopenharmony_ci
82362306a36Sopenharmony_ci/* SAS Phy Link Status Event data */
82462306a36Sopenharmony_ci
82562306a36Sopenharmony_citypedef struct _EVENT_DATA_SAS_PHY_LINK_STATUS
82662306a36Sopenharmony_ci{
82762306a36Sopenharmony_ci    U8                      PhyNum;                     /* 00h */
82862306a36Sopenharmony_ci    U8                      LinkRates;                  /* 01h */
82962306a36Sopenharmony_ci    U16                     DevHandle;                  /* 02h */
83062306a36Sopenharmony_ci    U64                     SASAddress;                 /* 04h */
83162306a36Sopenharmony_ci} EVENT_DATA_SAS_PHY_LINK_STATUS, MPI_POINTER PTR_EVENT_DATA_SAS_PHY_LINK_STATUS,
83262306a36Sopenharmony_ci  MpiEventDataSasPhyLinkStatus_t, MPI_POINTER pMpiEventDataSasPhyLinkStatus_t;
83362306a36Sopenharmony_ci
83462306a36Sopenharmony_ci/* defines for the LinkRates field of the SAS PHY Link Status event */
83562306a36Sopenharmony_ci#define MPI_EVENT_SAS_PLS_LR_CURRENT_MASK                   (0xF0)
83662306a36Sopenharmony_ci#define MPI_EVENT_SAS_PLS_LR_CURRENT_SHIFT                  (4)
83762306a36Sopenharmony_ci#define MPI_EVENT_SAS_PLS_LR_PREVIOUS_MASK                  (0x0F)
83862306a36Sopenharmony_ci#define MPI_EVENT_SAS_PLS_LR_PREVIOUS_SHIFT                 (0)
83962306a36Sopenharmony_ci#define MPI_EVENT_SAS_PLS_LR_RATE_UNKNOWN                   (0x00)
84062306a36Sopenharmony_ci#define MPI_EVENT_SAS_PLS_LR_RATE_PHY_DISABLED              (0x01)
84162306a36Sopenharmony_ci#define MPI_EVENT_SAS_PLS_LR_RATE_FAILED_SPEED_NEGOTIATION  (0x02)
84262306a36Sopenharmony_ci#define MPI_EVENT_SAS_PLS_LR_RATE_SATA_OOB_COMPLETE         (0x03)
84362306a36Sopenharmony_ci#define MPI_EVENT_SAS_PLS_LR_RATE_1_5                       (0x08)
84462306a36Sopenharmony_ci#define MPI_EVENT_SAS_PLS_LR_RATE_3_0                       (0x09)
84562306a36Sopenharmony_ci#define MPI_EVENT_SAS_PLS_LR_RATE_6_0                       (0x0A)
84662306a36Sopenharmony_ci
84762306a36Sopenharmony_ci/* SAS Discovery Event data */
84862306a36Sopenharmony_ci
84962306a36Sopenharmony_citypedef struct _EVENT_DATA_SAS_DISCOVERY
85062306a36Sopenharmony_ci{
85162306a36Sopenharmony_ci    U32                     DiscoveryStatus;            /* 00h */
85262306a36Sopenharmony_ci    U32                     Reserved1;                  /* 04h */
85362306a36Sopenharmony_ci} EVENT_DATA_SAS_DISCOVERY, MPI_POINTER PTR_EVENT_DATA_SAS_DISCOVERY,
85462306a36Sopenharmony_ci  EventDataSasDiscovery_t, MPI_POINTER pEventDataSasDiscovery_t;
85562306a36Sopenharmony_ci
85662306a36Sopenharmony_ci#define MPI_EVENT_SAS_DSCVRY_COMPLETE                       (0x00000000)
85762306a36Sopenharmony_ci#define MPI_EVENT_SAS_DSCVRY_IN_PROGRESS                    (0x00000001)
85862306a36Sopenharmony_ci#define MPI_EVENT_SAS_DSCVRY_PHY_BITS_MASK                  (0xFFFF0000)
85962306a36Sopenharmony_ci#define MPI_EVENT_SAS_DSCVRY_PHY_BITS_SHIFT                 (16)
86062306a36Sopenharmony_ci
86162306a36Sopenharmony_ci/* SAS Discovery Error Event data */
86262306a36Sopenharmony_ci
86362306a36Sopenharmony_citypedef struct _EVENT_DATA_DISCOVERY_ERROR
86462306a36Sopenharmony_ci{
86562306a36Sopenharmony_ci    U32                     DiscoveryStatus;            /* 00h */
86662306a36Sopenharmony_ci    U8                      Port;                       /* 04h */
86762306a36Sopenharmony_ci    U8                      Reserved1;                  /* 05h */
86862306a36Sopenharmony_ci    U16                     Reserved2;                  /* 06h */
86962306a36Sopenharmony_ci} EVENT_DATA_DISCOVERY_ERROR, MPI_POINTER PTR_EVENT_DATA_DISCOVERY_ERROR,
87062306a36Sopenharmony_ci  EventDataDiscoveryError_t, MPI_POINTER pEventDataDiscoveryError_t;
87162306a36Sopenharmony_ci
87262306a36Sopenharmony_ci#define MPI_EVENT_DSCVRY_ERR_DS_LOOP_DETECTED               (0x00000001)
87362306a36Sopenharmony_ci#define MPI_EVENT_DSCVRY_ERR_DS_UNADDRESSABLE_DEVICE        (0x00000002)
87462306a36Sopenharmony_ci#define MPI_EVENT_DSCVRY_ERR_DS_MULTIPLE_PORTS              (0x00000004)
87562306a36Sopenharmony_ci#define MPI_EVENT_DSCVRY_ERR_DS_EXPANDER_ERR                (0x00000008)
87662306a36Sopenharmony_ci#define MPI_EVENT_DSCVRY_ERR_DS_SMP_TIMEOUT                 (0x00000010)
87762306a36Sopenharmony_ci#define MPI_EVENT_DSCVRY_ERR_DS_OUT_ROUTE_ENTRIES           (0x00000020)
87862306a36Sopenharmony_ci#define MPI_EVENT_DSCVRY_ERR_DS_INDEX_NOT_EXIST             (0x00000040)
87962306a36Sopenharmony_ci#define MPI_EVENT_DSCVRY_ERR_DS_SMP_FUNCTION_FAILED         (0x00000080)
88062306a36Sopenharmony_ci#define MPI_EVENT_DSCVRY_ERR_DS_SMP_CRC_ERROR               (0x00000100)
88162306a36Sopenharmony_ci#define MPI_EVENT_DSCVRY_ERR_DS_MULTPL_SUBTRACTIVE          (0x00000200)
88262306a36Sopenharmony_ci#define MPI_EVENT_DSCVRY_ERR_DS_TABLE_TO_TABLE              (0x00000400)
88362306a36Sopenharmony_ci#define MPI_EVENT_DSCVRY_ERR_DS_UNSUPPORTED_DEVICE          (0x00000800)
88462306a36Sopenharmony_ci#define MPI_EVENT_DSCVRY_ERR_DS_MAX_SATA_TARGETS            (0x00001000)
88562306a36Sopenharmony_ci#define MPI_EVENT_DSCVRY_ERR_DS_MULTI_PORT_DOMAIN           (0x00002000)
88662306a36Sopenharmony_ci#define MPI_EVENT_DSCVRY_ERR_DS_SATA_INIT_FAILURE           (0x00004000)
88762306a36Sopenharmony_ci
88862306a36Sopenharmony_ci/* SAS SMP Error Event data */
88962306a36Sopenharmony_ci
89062306a36Sopenharmony_citypedef struct _EVENT_DATA_SAS_SMP_ERROR
89162306a36Sopenharmony_ci{
89262306a36Sopenharmony_ci    U8                      Status;                     /* 00h */
89362306a36Sopenharmony_ci    U8                      Port;                       /* 01h */
89462306a36Sopenharmony_ci    U8                      SMPFunctionResult;          /* 02h */
89562306a36Sopenharmony_ci    U8                      Reserved1;                  /* 03h */
89662306a36Sopenharmony_ci    U64                     SASAddress;                 /* 04h */
89762306a36Sopenharmony_ci} EVENT_DATA_SAS_SMP_ERROR, MPI_POINTER PTR_EVENT_DATA_SAS_SMP_ERROR,
89862306a36Sopenharmony_ci  MpiEventDataSasSmpError_t, MPI_POINTER pMpiEventDataSasSmpError_t;
89962306a36Sopenharmony_ci
90062306a36Sopenharmony_ci/* defines for the Status field of the SAS SMP Error event */
90162306a36Sopenharmony_ci#define MPI_EVENT_SAS_SMP_FUNCTION_RESULT_VALID         (0x00)
90262306a36Sopenharmony_ci#define MPI_EVENT_SAS_SMP_CRC_ERROR                     (0x01)
90362306a36Sopenharmony_ci#define MPI_EVENT_SAS_SMP_TIMEOUT                       (0x02)
90462306a36Sopenharmony_ci#define MPI_EVENT_SAS_SMP_NO_DESTINATION                (0x03)
90562306a36Sopenharmony_ci#define MPI_EVENT_SAS_SMP_BAD_DESTINATION               (0x04)
90662306a36Sopenharmony_ci
90762306a36Sopenharmony_ci/* SAS Initiator Device Status Change Event data */
90862306a36Sopenharmony_ci
90962306a36Sopenharmony_citypedef struct _EVENT_DATA_SAS_INIT_DEV_STATUS_CHANGE
91062306a36Sopenharmony_ci{
91162306a36Sopenharmony_ci    U8                      ReasonCode;                 /* 00h */
91262306a36Sopenharmony_ci    U8                      Port;                       /* 01h */
91362306a36Sopenharmony_ci    U16                     DevHandle;                  /* 02h */
91462306a36Sopenharmony_ci    U64                     SASAddress;                 /* 04h */
91562306a36Sopenharmony_ci} EVENT_DATA_SAS_INIT_DEV_STATUS_CHANGE,
91662306a36Sopenharmony_ci  MPI_POINTER PTR_EVENT_DATA_SAS_INIT_DEV_STATUS_CHANGE,
91762306a36Sopenharmony_ci  MpiEventDataSasInitDevStatusChange_t,
91862306a36Sopenharmony_ci  MPI_POINTER pMpiEventDataSasInitDevStatusChange_t;
91962306a36Sopenharmony_ci
92062306a36Sopenharmony_ci/* defines for the ReasonCode field of the SAS Initiator Device Status Change event */
92162306a36Sopenharmony_ci#define MPI_EVENT_SAS_INIT_RC_ADDED                 (0x01)
92262306a36Sopenharmony_ci#define MPI_EVENT_SAS_INIT_RC_REMOVED               (0x02)
92362306a36Sopenharmony_ci#define MPI_EVENT_SAS_INIT_RC_INACCESSIBLE          (0x03)
92462306a36Sopenharmony_ci
92562306a36Sopenharmony_ci/* SAS Initiator Device Table Overflow Event data */
92662306a36Sopenharmony_ci
92762306a36Sopenharmony_citypedef struct _EVENT_DATA_SAS_INIT_TABLE_OVERFLOW
92862306a36Sopenharmony_ci{
92962306a36Sopenharmony_ci    U8                      MaxInit;                    /* 00h */
93062306a36Sopenharmony_ci    U8                      CurrentInit;                /* 01h */
93162306a36Sopenharmony_ci    U16                     Reserved1;                  /* 02h */
93262306a36Sopenharmony_ci    U64                     SASAddress;                 /* 04h */
93362306a36Sopenharmony_ci} EVENT_DATA_SAS_INIT_TABLE_OVERFLOW,
93462306a36Sopenharmony_ci  MPI_POINTER PTR_EVENT_DATA_SAS_INIT_TABLE_OVERFLOW,
93562306a36Sopenharmony_ci  MpiEventDataSasInitTableOverflow_t,
93662306a36Sopenharmony_ci  MPI_POINTER pMpiEventDataSasInitTableOverflow_t;
93762306a36Sopenharmony_ci
93862306a36Sopenharmony_ci/* SAS Expander Status Change Event data */
93962306a36Sopenharmony_ci
94062306a36Sopenharmony_citypedef struct _EVENT_DATA_SAS_EXPANDER_STATUS_CHANGE
94162306a36Sopenharmony_ci{
94262306a36Sopenharmony_ci    U8                      ReasonCode;             /* 00h */
94362306a36Sopenharmony_ci    U8                      Reserved1;              /* 01h */
94462306a36Sopenharmony_ci    U16                     Reserved2;              /* 02h */
94562306a36Sopenharmony_ci    U8                      PhysicalPort;           /* 04h */
94662306a36Sopenharmony_ci    U8                      Reserved3;              /* 05h */
94762306a36Sopenharmony_ci    U16                     EnclosureHandle;        /* 06h */
94862306a36Sopenharmony_ci    U64                     SASAddress;             /* 08h */
94962306a36Sopenharmony_ci    U32                     DiscoveryStatus;        /* 10h */
95062306a36Sopenharmony_ci    U16                     DevHandle;              /* 14h */
95162306a36Sopenharmony_ci    U16                     ParentDevHandle;        /* 16h */
95262306a36Sopenharmony_ci    U16                     ExpanderChangeCount;    /* 18h */
95362306a36Sopenharmony_ci    U16                     ExpanderRouteIndexes;   /* 1Ah */
95462306a36Sopenharmony_ci    U8                      NumPhys;                /* 1Ch */
95562306a36Sopenharmony_ci    U8                      SASLevel;               /* 1Dh */
95662306a36Sopenharmony_ci    U8                      Flags;                  /* 1Eh */
95762306a36Sopenharmony_ci    U8                      Reserved4;              /* 1Fh */
95862306a36Sopenharmony_ci} EVENT_DATA_SAS_EXPANDER_STATUS_CHANGE,
95962306a36Sopenharmony_ci  MPI_POINTER PTR_EVENT_DATA_SAS_EXPANDER_STATUS_CHANGE,
96062306a36Sopenharmony_ci  MpiEventDataSasExpanderStatusChange_t,
96162306a36Sopenharmony_ci  MPI_POINTER pMpiEventDataSasExpanderStatusChange_t;
96262306a36Sopenharmony_ci
96362306a36Sopenharmony_ci/* values for ReasonCode field of SAS Expander Status Change Event data */
96462306a36Sopenharmony_ci#define MPI_EVENT_SAS_EXP_RC_ADDED                      (0x00)
96562306a36Sopenharmony_ci#define MPI_EVENT_SAS_EXP_RC_NOT_RESPONDING             (0x01)
96662306a36Sopenharmony_ci
96762306a36Sopenharmony_ci/* values for DiscoveryStatus field of SAS Expander Status Change Event data */
96862306a36Sopenharmony_ci#define MPI_EVENT_SAS_EXP_DS_LOOP_DETECTED              (0x00000001)
96962306a36Sopenharmony_ci#define MPI_EVENT_SAS_EXP_DS_UNADDRESSABLE_DEVICE       (0x00000002)
97062306a36Sopenharmony_ci#define MPI_EVENT_SAS_EXP_DS_MULTIPLE_PORTS             (0x00000004)
97162306a36Sopenharmony_ci#define MPI_EVENT_SAS_EXP_DS_EXPANDER_ERR               (0x00000008)
97262306a36Sopenharmony_ci#define MPI_EVENT_SAS_EXP_DS_SMP_TIMEOUT                (0x00000010)
97362306a36Sopenharmony_ci#define MPI_EVENT_SAS_EXP_DS_OUT_ROUTE_ENTRIES          (0x00000020)
97462306a36Sopenharmony_ci#define MPI_EVENT_SAS_EXP_DS_INDEX_NOT_EXIST            (0x00000040)
97562306a36Sopenharmony_ci#define MPI_EVENT_SAS_EXP_DS_SMP_FUNCTION_FAILED        (0x00000080)
97662306a36Sopenharmony_ci#define MPI_EVENT_SAS_EXP_DS_SMP_CRC_ERROR              (0x00000100)
97762306a36Sopenharmony_ci#define MPI_EVENT_SAS_EXP_DS_SUBTRACTIVE_LINK           (0x00000200)
97862306a36Sopenharmony_ci#define MPI_EVENT_SAS_EXP_DS_TABLE_LINK                 (0x00000400)
97962306a36Sopenharmony_ci#define MPI_EVENT_SAS_EXP_DS_UNSUPPORTED_DEVICE         (0x00000800)
98062306a36Sopenharmony_ci
98162306a36Sopenharmony_ci/* values for Flags field of SAS Expander Status Change Event data */
98262306a36Sopenharmony_ci#define MPI_EVENT_SAS_EXP_FLAGS_ROUTE_TABLE_CONFIG      (0x02)
98362306a36Sopenharmony_ci#define MPI_EVENT_SAS_EXP_FLAGS_CONFIG_IN_PROGRESS      (0x01)
98462306a36Sopenharmony_ci
98562306a36Sopenharmony_ci
98662306a36Sopenharmony_ci
98762306a36Sopenharmony_ci/*****************************************************************************
98862306a36Sopenharmony_ci*
98962306a36Sopenharmony_ci*               F i r m w a r e    L o a d    M e s s a g e s
99062306a36Sopenharmony_ci*
99162306a36Sopenharmony_ci*****************************************************************************/
99262306a36Sopenharmony_ci
99362306a36Sopenharmony_ci/****************************************************************************/
99462306a36Sopenharmony_ci/*  Firmware Download message and associated structures                     */
99562306a36Sopenharmony_ci/****************************************************************************/
99662306a36Sopenharmony_ci
99762306a36Sopenharmony_citypedef struct _MSG_FW_DOWNLOAD
99862306a36Sopenharmony_ci{
99962306a36Sopenharmony_ci    U8                      ImageType;                  /* 00h */
100062306a36Sopenharmony_ci    U8                      Reserved;                   /* 01h */
100162306a36Sopenharmony_ci    U8                      ChainOffset;                /* 02h */
100262306a36Sopenharmony_ci    U8                      Function;                   /* 03h */
100362306a36Sopenharmony_ci    U8                      Reserved1[3];               /* 04h */
100462306a36Sopenharmony_ci    U8                      MsgFlags;                   /* 07h */
100562306a36Sopenharmony_ci    U32                     MsgContext;                 /* 08h */
100662306a36Sopenharmony_ci    SGE_MPI_UNION           SGL;                        /* 0Ch */
100762306a36Sopenharmony_ci} MSG_FW_DOWNLOAD, MPI_POINTER PTR_MSG_FW_DOWNLOAD,
100862306a36Sopenharmony_ci  FWDownload_t, MPI_POINTER pFWDownload_t;
100962306a36Sopenharmony_ci
101062306a36Sopenharmony_ci#define MPI_FW_DOWNLOAD_MSGFLGS_LAST_SEGMENT    (0x01)
101162306a36Sopenharmony_ci
101262306a36Sopenharmony_ci#define MPI_FW_DOWNLOAD_ITYPE_RESERVED          (0x00)
101362306a36Sopenharmony_ci#define MPI_FW_DOWNLOAD_ITYPE_FW                (0x01)
101462306a36Sopenharmony_ci#define MPI_FW_DOWNLOAD_ITYPE_BIOS              (0x02)
101562306a36Sopenharmony_ci#define MPI_FW_DOWNLOAD_ITYPE_NVDATA            (0x03)
101662306a36Sopenharmony_ci#define MPI_FW_DOWNLOAD_ITYPE_BOOTLOADER        (0x04)
101762306a36Sopenharmony_ci#define MPI_FW_DOWNLOAD_ITYPE_MANUFACTURING     (0x06)
101862306a36Sopenharmony_ci#define MPI_FW_DOWNLOAD_ITYPE_CONFIG_1          (0x07)
101962306a36Sopenharmony_ci#define MPI_FW_DOWNLOAD_ITYPE_CONFIG_2          (0x08)
102062306a36Sopenharmony_ci#define MPI_FW_DOWNLOAD_ITYPE_MEGARAID          (0x09)
102162306a36Sopenharmony_ci#define MPI_FW_DOWNLOAD_ITYPE_COMMON_BOOT_BLOCK (0x0B)
102262306a36Sopenharmony_ci
102362306a36Sopenharmony_ci
102462306a36Sopenharmony_citypedef struct _FWDownloadTCSGE
102562306a36Sopenharmony_ci{
102662306a36Sopenharmony_ci    U8                      Reserved;                   /* 00h */
102762306a36Sopenharmony_ci    U8                      ContextSize;                /* 01h */
102862306a36Sopenharmony_ci    U8                      DetailsLength;              /* 02h */
102962306a36Sopenharmony_ci    U8                      Flags;                      /* 03h */
103062306a36Sopenharmony_ci    U32                     Reserved_0100_Checksum;     /* 04h */ /* obsolete Checksum */
103162306a36Sopenharmony_ci    U32                     ImageOffset;                /* 08h */
103262306a36Sopenharmony_ci    U32                     ImageSize;                  /* 0Ch */
103362306a36Sopenharmony_ci} FW_DOWNLOAD_TCSGE, MPI_POINTER PTR_FW_DOWNLOAD_TCSGE,
103462306a36Sopenharmony_ci  FWDownloadTCSGE_t, MPI_POINTER pFWDownloadTCSGE_t;
103562306a36Sopenharmony_ci
103662306a36Sopenharmony_ci/* Firmware Download reply */
103762306a36Sopenharmony_citypedef struct _MSG_FW_DOWNLOAD_REPLY
103862306a36Sopenharmony_ci{
103962306a36Sopenharmony_ci    U8                      ImageType;                  /* 00h */
104062306a36Sopenharmony_ci    U8                      Reserved;                   /* 01h */
104162306a36Sopenharmony_ci    U8                      MsgLength;                  /* 02h */
104262306a36Sopenharmony_ci    U8                      Function;                   /* 03h */
104362306a36Sopenharmony_ci    U8                      Reserved1[3];               /* 04h */
104462306a36Sopenharmony_ci    U8                      MsgFlags;                   /* 07h */
104562306a36Sopenharmony_ci    U32                     MsgContext;                 /* 08h */
104662306a36Sopenharmony_ci    U16                     Reserved2;                  /* 0Ch */
104762306a36Sopenharmony_ci    U16                     IOCStatus;                  /* 0Eh */
104862306a36Sopenharmony_ci    U32                     IOCLogInfo;                 /* 10h */
104962306a36Sopenharmony_ci} MSG_FW_DOWNLOAD_REPLY, MPI_POINTER PTR_MSG_FW_DOWNLOAD_REPLY,
105062306a36Sopenharmony_ci  FWDownloadReply_t, MPI_POINTER pFWDownloadReply_t;
105162306a36Sopenharmony_ci
105262306a36Sopenharmony_ci
105362306a36Sopenharmony_ci/****************************************************************************/
105462306a36Sopenharmony_ci/*  Firmware Upload message and associated structures                       */
105562306a36Sopenharmony_ci/****************************************************************************/
105662306a36Sopenharmony_ci
105762306a36Sopenharmony_citypedef struct _MSG_FW_UPLOAD
105862306a36Sopenharmony_ci{
105962306a36Sopenharmony_ci    U8                      ImageType;                  /* 00h */
106062306a36Sopenharmony_ci    U8                      Reserved;                   /* 01h */
106162306a36Sopenharmony_ci    U8                      ChainOffset;                /* 02h */
106262306a36Sopenharmony_ci    U8                      Function;                   /* 03h */
106362306a36Sopenharmony_ci    U8                      Reserved1[3];               /* 04h */
106462306a36Sopenharmony_ci    U8                      MsgFlags;                   /* 07h */
106562306a36Sopenharmony_ci    U32                     MsgContext;                 /* 08h */
106662306a36Sopenharmony_ci    SGE_MPI_UNION           SGL;                        /* 0Ch */
106762306a36Sopenharmony_ci} MSG_FW_UPLOAD, MPI_POINTER PTR_MSG_FW_UPLOAD,
106862306a36Sopenharmony_ci  FWUpload_t, MPI_POINTER pFWUpload_t;
106962306a36Sopenharmony_ci
107062306a36Sopenharmony_ci#define MPI_FW_UPLOAD_ITYPE_FW_IOC_MEM          (0x00)
107162306a36Sopenharmony_ci#define MPI_FW_UPLOAD_ITYPE_FW_FLASH            (0x01)
107262306a36Sopenharmony_ci#define MPI_FW_UPLOAD_ITYPE_BIOS_FLASH          (0x02)
107362306a36Sopenharmony_ci#define MPI_FW_UPLOAD_ITYPE_NVDATA              (0x03)
107462306a36Sopenharmony_ci#define MPI_FW_UPLOAD_ITYPE_BOOTLOADER          (0x04)
107562306a36Sopenharmony_ci#define MPI_FW_UPLOAD_ITYPE_FW_BACKUP           (0x05)
107662306a36Sopenharmony_ci#define MPI_FW_UPLOAD_ITYPE_MANUFACTURING       (0x06)
107762306a36Sopenharmony_ci#define MPI_FW_UPLOAD_ITYPE_CONFIG_1            (0x07)
107862306a36Sopenharmony_ci#define MPI_FW_UPLOAD_ITYPE_CONFIG_2            (0x08)
107962306a36Sopenharmony_ci#define MPI_FW_UPLOAD_ITYPE_MEGARAID            (0x09)
108062306a36Sopenharmony_ci#define MPI_FW_UPLOAD_ITYPE_COMPLETE            (0x0A)
108162306a36Sopenharmony_ci#define MPI_FW_UPLOAD_ITYPE_COMMON_BOOT_BLOCK   (0x0B)
108262306a36Sopenharmony_ci
108362306a36Sopenharmony_citypedef struct _FWUploadTCSGE
108462306a36Sopenharmony_ci{
108562306a36Sopenharmony_ci    U8                      Reserved;                   /* 00h */
108662306a36Sopenharmony_ci    U8                      ContextSize;                /* 01h */
108762306a36Sopenharmony_ci    U8                      DetailsLength;              /* 02h */
108862306a36Sopenharmony_ci    U8                      Flags;                      /* 03h */
108962306a36Sopenharmony_ci    U32                     Reserved1;                  /* 04h */
109062306a36Sopenharmony_ci    U32                     ImageOffset;                /* 08h */
109162306a36Sopenharmony_ci    U32                     ImageSize;                  /* 0Ch */
109262306a36Sopenharmony_ci} FW_UPLOAD_TCSGE, MPI_POINTER PTR_FW_UPLOAD_TCSGE,
109362306a36Sopenharmony_ci  FWUploadTCSGE_t, MPI_POINTER pFWUploadTCSGE_t;
109462306a36Sopenharmony_ci
109562306a36Sopenharmony_ci/* Firmware Upload reply */
109662306a36Sopenharmony_citypedef struct _MSG_FW_UPLOAD_REPLY
109762306a36Sopenharmony_ci{
109862306a36Sopenharmony_ci    U8                      ImageType;                  /* 00h */
109962306a36Sopenharmony_ci    U8                      Reserved;                   /* 01h */
110062306a36Sopenharmony_ci    U8                      MsgLength;                  /* 02h */
110162306a36Sopenharmony_ci    U8                      Function;                   /* 03h */
110262306a36Sopenharmony_ci    U8                      Reserved1[3];               /* 04h */
110362306a36Sopenharmony_ci    U8                      MsgFlags;                   /* 07h */
110462306a36Sopenharmony_ci    U32                     MsgContext;                 /* 08h */
110562306a36Sopenharmony_ci    U16                     Reserved2;                  /* 0Ch */
110662306a36Sopenharmony_ci    U16                     IOCStatus;                  /* 0Eh */
110762306a36Sopenharmony_ci    U32                     IOCLogInfo;                 /* 10h */
110862306a36Sopenharmony_ci    U32                     ActualImageSize;            /* 14h */
110962306a36Sopenharmony_ci} MSG_FW_UPLOAD_REPLY, MPI_POINTER PTR_MSG_FW_UPLOAD_REPLY,
111062306a36Sopenharmony_ci  FWUploadReply_t, MPI_POINTER pFWUploadReply_t;
111162306a36Sopenharmony_ci
111262306a36Sopenharmony_ci
111362306a36Sopenharmony_citypedef struct _MPI_FW_HEADER
111462306a36Sopenharmony_ci{
111562306a36Sopenharmony_ci    U32                     ArmBranchInstruction0;      /* 00h */
111662306a36Sopenharmony_ci    U32                     Signature0;                 /* 04h */
111762306a36Sopenharmony_ci    U32                     Signature1;                 /* 08h */
111862306a36Sopenharmony_ci    U32                     Signature2;                 /* 0Ch */
111962306a36Sopenharmony_ci    U32                     ArmBranchInstruction1;      /* 10h */
112062306a36Sopenharmony_ci    U32                     ArmBranchInstruction2;      /* 14h */
112162306a36Sopenharmony_ci    U32                     Reserved;                   /* 18h */
112262306a36Sopenharmony_ci    U32                     Checksum;                   /* 1Ch */
112362306a36Sopenharmony_ci    U16                     VendorId;                   /* 20h */
112462306a36Sopenharmony_ci    U16                     ProductId;                  /* 22h */
112562306a36Sopenharmony_ci    MPI_FW_VERSION          FWVersion;                  /* 24h */
112662306a36Sopenharmony_ci    U32                     SeqCodeVersion;             /* 28h */
112762306a36Sopenharmony_ci    U32                     ImageSize;                  /* 2Ch */
112862306a36Sopenharmony_ci    U32                     NextImageHeaderOffset;      /* 30h */
112962306a36Sopenharmony_ci    U32                     LoadStartAddress;           /* 34h */
113062306a36Sopenharmony_ci    U32                     IopResetVectorValue;        /* 38h */
113162306a36Sopenharmony_ci    U32                     IopResetRegAddr;            /* 3Ch */
113262306a36Sopenharmony_ci    U32                     VersionNameWhat;            /* 40h */
113362306a36Sopenharmony_ci    U8                      VersionName[32];            /* 44h */
113462306a36Sopenharmony_ci    U32                     VendorNameWhat;             /* 64h */
113562306a36Sopenharmony_ci    U8                      VendorName[32];             /* 68h */
113662306a36Sopenharmony_ci} MPI_FW_HEADER, MPI_POINTER PTR_MPI_FW_HEADER,
113762306a36Sopenharmony_ci  MpiFwHeader_t, MPI_POINTER pMpiFwHeader_t;
113862306a36Sopenharmony_ci
113962306a36Sopenharmony_ci#define MPI_FW_HEADER_WHAT_SIGNATURE        (0x29232840)
114062306a36Sopenharmony_ci
114162306a36Sopenharmony_ci/* defines for using the ProductId field */
114262306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_TYPE_MASK             (0xF000)
114362306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_TYPE_SCSI             (0x0000)
114462306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_TYPE_FC               (0x1000)
114562306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_TYPE_SAS              (0x2000)
114662306a36Sopenharmony_ci
114762306a36Sopenharmony_ci#define MPI_FW_HEADER_SIGNATURE_0               (0x5AEAA55A)
114862306a36Sopenharmony_ci#define MPI_FW_HEADER_SIGNATURE_1               (0xA55AEAA5)
114962306a36Sopenharmony_ci#define MPI_FW_HEADER_SIGNATURE_2               (0x5AA55AEA)
115062306a36Sopenharmony_ci
115162306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_PROD_MASK                     (0x0F00)
115262306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_PROD_INITIATOR_SCSI           (0x0100)
115362306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_PROD_TARGET_INITIATOR_SCSI    (0x0200)
115462306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_PROD_TARGET_SCSI              (0x0300)
115562306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_PROD_IM_SCSI                  (0x0400)
115662306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_PROD_IS_SCSI                  (0x0500)
115762306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_PROD_CTX_SCSI                 (0x0600)
115862306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_PROD_IR_SCSI                  (0x0700)
115962306a36Sopenharmony_ci
116062306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_FAMILY_MASK           (0x00FF)
116162306a36Sopenharmony_ci/* SCSI */
116262306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_FAMILY_1030A0_SCSI    (0x0001)
116362306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_FAMILY_1030B0_SCSI    (0x0002)
116462306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_FAMILY_1030B1_SCSI    (0x0003)
116562306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_FAMILY_1030C0_SCSI    (0x0004)
116662306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_FAMILY_1020A0_SCSI    (0x0005)
116762306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_FAMILY_1020B0_SCSI    (0x0006)
116862306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_FAMILY_1020B1_SCSI    (0x0007)
116962306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_FAMILY_1020C0_SCSI    (0x0008)
117062306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_FAMILY_1035A0_SCSI    (0x0009)
117162306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_FAMILY_1035B0_SCSI    (0x000A)
117262306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_FAMILY_1030TA0_SCSI   (0x000B)
117362306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_FAMILY_1020TA0_SCSI   (0x000C)
117462306a36Sopenharmony_ci/* Fibre Channel */
117562306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_FAMILY_909_FC         (0x0000)
117662306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_FAMILY_919_FC         (0x0001) /* 919 and 929     */
117762306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_FAMILY_919X_FC        (0x0002) /* 919X and 929X   */
117862306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_FAMILY_919XL_FC       (0x0003) /* 919XL and 929XL */
117962306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_FAMILY_939X_FC        (0x0004) /* 939X and 949X   */
118062306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_FAMILY_959_FC         (0x0005)
118162306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_FAMILY_949E_FC        (0x0006)
118262306a36Sopenharmony_ci/* SAS */
118362306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_FAMILY_1064_SAS       (0x0001)
118462306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_FAMILY_1068_SAS       (0x0002)
118562306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_FAMILY_1078_SAS       (0x0003)
118662306a36Sopenharmony_ci#define MPI_FW_HEADER_PID_FAMILY_106xE_SAS      (0x0004) /* 1068E, 1066E, and 1064E */
118762306a36Sopenharmony_ci
118862306a36Sopenharmony_citypedef struct _MPI_EXT_IMAGE_HEADER
118962306a36Sopenharmony_ci{
119062306a36Sopenharmony_ci    U8                      ImageType;                  /* 00h */
119162306a36Sopenharmony_ci    U8                      Reserved;                   /* 01h */
119262306a36Sopenharmony_ci    U16                     Reserved1;                  /* 02h */
119362306a36Sopenharmony_ci    U32                     Checksum;                   /* 04h */
119462306a36Sopenharmony_ci    U32                     ImageSize;                  /* 08h */
119562306a36Sopenharmony_ci    U32                     NextImageHeaderOffset;      /* 0Ch */
119662306a36Sopenharmony_ci    U32                     LoadStartAddress;           /* 10h */
119762306a36Sopenharmony_ci    U32                     Reserved2;                  /* 14h */
119862306a36Sopenharmony_ci} MPI_EXT_IMAGE_HEADER, MPI_POINTER PTR_MPI_EXT_IMAGE_HEADER,
119962306a36Sopenharmony_ci  MpiExtImageHeader_t, MPI_POINTER pMpiExtImageHeader_t;
120062306a36Sopenharmony_ci
120162306a36Sopenharmony_ci/* defines for the ImageType field */
120262306a36Sopenharmony_ci#define MPI_EXT_IMAGE_TYPE_UNSPECIFIED          (0x00)
120362306a36Sopenharmony_ci#define MPI_EXT_IMAGE_TYPE_FW                   (0x01)
120462306a36Sopenharmony_ci#define MPI_EXT_IMAGE_TYPE_NVDATA               (0x03)
120562306a36Sopenharmony_ci#define MPI_EXT_IMAGE_TYPE_BOOTLOADER           (0x04)
120662306a36Sopenharmony_ci#define MPI_EXT_IMAGE_TYPE_INITIALIZATION       (0x05)
120762306a36Sopenharmony_ci
120862306a36Sopenharmony_ci#endif
1209