mpi_ioc.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:33k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  *  Copyright (c) 2000-2001 LSI Logic Corporation.
  3.  *
  4.  *
  5.  *           Name:  MPI_IOC.H
  6.  *          Title:  MPI IOC, Port, Event, FW Download, and FW Upload messages
  7.  *  Creation Date:  August 11, 2000
  8.  *
  9.  *    MPI Version:  01.02.04
  10.  *
  11.  *  Version History
  12.  *  ---------------
  13.  *
  14.  *  Date      Version   Description
  15.  *  --------  --------  ------------------------------------------------------
  16.  *  05-08-00  00.10.01  Original release for 0.10 spec dated 4/26/2000.
  17.  *  05-24-00  00.10.02  Added _MSG_IOC_INIT_REPLY structure.
  18.  *  06-06-00  01.00.01  Added CurReplyFrameSize field to _MSG_IOC_FACTS_REPLY.
  19.  *  06-12-00  01.00.02  Added _MSG_PORT_ENABLE_REPLY structure.
  20.  *                      Added _MSG_EVENT_ACK_REPLY structure.
  21.  *                      Added _MSG_FW_DOWNLOAD_REPLY structure.
  22.  *                      Added _MSG_TOOLBOX_REPLY structure.
  23.  *  06-30-00  01.00.03  Added MaxLanBuckets to _PORT_FACT_REPLY structure.
  24.  *  07-27-00  01.00.04  Added _EVENT_DATA structure definitions for _SCSI,
  25.  *                      _LINK_STATUS, _LOOP_STATE and _LOGOUT.
  26.  *  08-11-00  01.00.05  Switched positions of MsgLength and Function fields in
  27.  *                      _MSG_EVENT_ACK_REPLY structure to match specification.
  28.  *  11-02-00  01.01.01  Original release for post 1.0 work.
  29.  *                      Added a value for Manufacturer to WhoInit.
  30.  *  12-04-00  01.01.02  Modified IOCFacts reply, added FWUpload messages, and
  31.  *                      removed toolbox message.
  32.  *  01-09-01  01.01.03  Added event enabled and disabled defines.
  33.  *                      Added structures for FwHeader and DataHeader.
  34.  *                      Added ImageType to FwUpload reply.
  35.  *  02-20-01  01.01.04  Started using MPI_POINTER.
  36.  *  02-27-01  01.01.05  Added event for RAID status change and its event data.
  37.  *                      Added IocNumber field to MSG_IOC_FACTS_REPLY.
  38.  *  03-27-01  01.01.06  Added defines for ProductId field of MPI_FW_HEADER.
  39.  *                      Added structure offset comments.
  40.  *  04-09-01  01.01.07  Added structure EVENT_DATA_EVENT_CHANGE.
  41.  *  08-08-01  01.02.01  Original release for v1.2 work.
  42.  *                      New format for FWVersion and ProductId in
  43.  *                      MSG_IOC_FACTS_REPLY and MPI_FW_HEADER.
  44.  *  08-31-01  01.02.02  Addded event MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE and
  45.  *                      related structure and defines.
  46.  *                      Added event MPI_EVENT_ON_BUS_TIMER_EXPIRED.
  47.  *                      Added MPI_IOCINIT_FLAGS_DISCARD_FW_IMAGE.
  48.  *                      Replaced a reserved field in MSG_IOC_FACTS_REPLY with
  49.  *                      IOCExceptions and changed DataImageSize to reserved.
  50.  *                      Added MPI_FW_DOWNLOAD_ITYPE_NVSTORE_DATA and
  51.  *                      MPI_FW_UPLOAD_ITYPE_NVDATA.
  52.  *  09-28-01  01.02.03  Modified Event Data for Integrated RAID.
  53.  *  11-01-01  01.02.04  Added defines for MPI_EXT_IMAGE_HEADER ImageType field.
  54.  *  --------------------------------------------------------------------------
  55.  */
  56. #ifndef MPI_IOC_H
  57. #define MPI_IOC_H
  58. /*****************************************************************************
  59. *
  60. *               I O C    M e s s a g e s
  61. *
  62. *****************************************************************************/
  63. /****************************************************************************/
  64. /*  IOCInit message                                                         */
  65. /****************************************************************************/
  66. typedef struct _MSG_IOC_INIT
  67. {
  68.     U8                      WhoInit;                    /* 00h */
  69.     U8                      Reserved;                   /* 01h */
  70.     U8                      ChainOffset;                /* 02h */
  71.     U8                      Function;                   /* 03h */
  72.     U8                      Flags;                      /* 04h */
  73.     U8                      MaxDevices;                 /* 05h */
  74.     U8                      MaxBuses;                   /* 06h */
  75.     U8                      MsgFlags;                   /* 07h */
  76.     U32                     MsgContext;                 /* 08h */
  77.     U16                     ReplyFrameSize;             /* 0Ch */
  78.     U8                      Reserved1[2];               /* 0Eh */
  79.     U32                     HostMfaHighAddr;            /* 10h */
  80.     U32                     SenseBufferHighAddr;        /* 14h */
  81. } MSG_IOC_INIT, MPI_POINTER PTR_MSG_IOC_INIT,
  82.   IOCInit_t, MPI_POINTER pIOCInit_t;
  83. /* WhoInit values */
  84. #define MPI_WHOINIT_NO_ONE                      (0x00)
  85. #define MPI_WHOINIT_SYSTEM_BIOS                 (0x01)
  86. #define MPI_WHOINIT_ROM_BIOS                    (0x02)
  87. #define MPI_WHOINIT_PCI_PEER                    (0x03)
  88. #define MPI_WHOINIT_HOST_DRIVER                 (0x04)
  89. #define MPI_WHOINIT_MANUFACTURER                (0x05)
  90. /* Flags values */
  91. #define MPI_IOCINIT_FLAGS_DISCARD_FW_IMAGE      (0x01)
  92. typedef struct _MSG_IOC_INIT_REPLY
  93. {
  94.     U8                      WhoInit;                    /* 00h */
  95.     U8                      Reserved;                   /* 01h */
  96.     U8                      MsgLength;                  /* 02h */
  97.     U8                      Function;                   /* 03h */
  98.     U8                      Flags;                      /* 04h */
  99.     U8                      MaxDevices;                 /* 05h */
  100.     U8                      MaxBuses;                   /* 06h */
  101.     U8                      MsgFlags;                   /* 07h */
  102.     U32                     MsgContext;                 /* 08h */
  103.     U16                     Reserved2;                  /* 0Ch */
  104.     U16                     IOCStatus;                  /* 0Eh */
  105.     U32                     IOCLogInfo;                 /* 10h */
  106. } MSG_IOC_INIT_REPLY, MPI_POINTER PTR_MSG_IOC_INIT_REPLY,
  107.   IOCInitReply_t, MPI_POINTER pIOCInitReply_t;
  108. /****************************************************************************/
  109. /*  IOC Facts message                                                       */
  110. /****************************************************************************/
  111. typedef struct _MSG_IOC_FACTS
  112. {
  113.     U8                      Reserved[2];                /* 00h */
  114.     U8                      ChainOffset;                /* 01h */
  115.     U8                      Function;                   /* 02h */
  116.     U8                      Reserved1[3];               /* 03h */
  117.     U8                      MsgFlags;                   /* 04h */
  118.     U32                     MsgContext;                 /* 08h */
  119. } MSG_IOC_FACTS, MPI_POINTER PTR_IOC_FACTS,
  120.   IOCFacts_t, MPI_POINTER pIOCFacts_t;
  121. typedef struct _MPI_FW_VERSION_STRUCT
  122. {
  123.     U8                      Dev;                        /* 00h */
  124.     U8                      Unit;                       /* 01h */
  125.     U8                      Minor;                      /* 02h */
  126.     U8                      Major;                      /* 03h */
  127. } MPI_FW_VERSION_STRUCT;
  128. typedef union _MPI_FW_VERSION
  129. {
  130.     MPI_FW_VERSION_STRUCT   Struct;
  131.     U32                     Word;
  132. } MPI_FW_VERSION;
  133. /* IOC Facts Reply */
  134. typedef struct _MSG_IOC_FACTS_REPLY
  135. {
  136.     U16                     MsgVersion;                 /* 00h */
  137.     U8                      MsgLength;                  /* 02h */
  138.     U8                      Function;                   /* 03h */
  139.     U16                     Reserved;                   /* 04h */
  140.     U8                      IOCNumber;                  /* 06h */
  141.     U8                      MsgFlags;                   /* 07h */
  142.     U32                     MsgContext;                 /* 08h */
  143.     U16                     IOCExceptions;              /* 0Ch */
  144.     U16                     IOCStatus;                  /* 0Eh */
  145.     U32                     IOCLogInfo;                 /* 10h */
  146.     U8                      MaxChainDepth;              /* 14h */
  147.     U8                      WhoInit;                    /* 15h */
  148.     U8                      BlockSize;                  /* 16h */
  149.     U8                      Flags;                      /* 17h */
  150.     U16                     ReplyQueueDepth;            /* 18h */
  151.     U16                     RequestFrameSize;           /* 1Ah */
  152.     U16                     Reserved_0101_FWVersion;    /* 1Ch */ /* obsolete 16-bit FWVersion */
  153.     U16                     ProductID;                  /* 1Eh */
  154.     U32                     CurrentHostMfaHighAddr;     /* 20h */
  155.     U16                     GlobalCredits;              /* 24h */
  156.     U8                      NumberOfPorts;              /* 26h */
  157.     U8                      EventState;                 /* 27h */
  158.     U32                     CurrentSenseBufferHighAddr; /* 28h */
  159.     U16                     CurReplyFrameSize;          /* 2Ch */
  160.     U8                      MaxDevices;                 /* 2Eh */
  161.     U8                      MaxBuses;                   /* 2Fh */
  162.     U32                     FWImageSize;                /* 30h */
  163.     U32                     Reserved4;                  /* 34h */
  164.     MPI_FW_VERSION          FWVersion;                  /* 38h */
  165. } MSG_IOC_FACTS_REPLY, MPI_POINTER PTR_MSG_IOC_FACTS_REPLY,
  166.   IOCFactsReply_t, MPI_POINTER pIOCFactsReply_t;
  167. #define MPI_IOCFACTS_MSGVERSION_MAJOR_MASK          (0xFF00)
  168. #define MPI_IOCFACTS_MSGVERSION_MINOR_MASK          (0x00FF)
  169. #define MPI_IOCFACTS_EXCEPT_CONFIG_CHECKSUM_FAIL    (0x0001)
  170. #define MPI_IOCFACTS_FLAGS_FW_DOWNLOAD_BOOT         (0x01)
  171. #define MPI_IOCFACTS_EVENTSTATE_DISABLED            (0x00)
  172. #define MPI_IOCFACTS_EVENTSTATE_ENABLED             (0x01)
  173. /*****************************************************************************
  174. *
  175. *               P o r t    M e s s a g e s
  176. *
  177. *****************************************************************************/
  178. /****************************************************************************/
  179. /*  Port Facts message and Reply                                            */
  180. /****************************************************************************/
  181. typedef struct _MSG_PORT_FACTS
  182. {
  183.      U8                     Reserved[2];                /* 00h */
  184.      U8                     ChainOffset;                /* 02h */
  185.      U8                     Function;                   /* 03h */
  186.      U8                     Reserved1[2];               /* 04h */
  187.      U8                     PortNumber;                 /* 06h */
  188.      U8                     MsgFlags;                   /* 07h */
  189.      U32                    MsgContext;                 /* 08h */
  190. } MSG_PORT_FACTS, MPI_POINTER PTR_MSG_PORT_FACTS,
  191.   PortFacts_t, MPI_POINTER pPortFacts_t;
  192. typedef struct _MSG_PORT_FACTS_REPLY
  193. {
  194.      U16                    Reserved;                   /* 00h */
  195.      U8                     MsgLength;                  /* 02h */
  196.      U8                     Function;                   /* 03h */
  197.      U16                    Reserved1;                  /* 04h */
  198.      U8                     PortNumber;                 /* 06h */
  199.      U8                     MsgFlags;                   /* 07h */
  200.      U32                    MsgContext;                 /* 08h */
  201.      U16                    Reserved2;                  /* 0Ch */
  202.      U16                    IOCStatus;                  /* 0Eh */
  203.      U32                    IOCLogInfo;                 /* 10h */
  204.      U8                     Reserved3;                  /* 14h */
  205.      U8                     PortType;                   /* 15h */
  206.      U16                    MaxDevices;                 /* 16h */
  207.      U16                    PortSCSIID;                 /* 18h */
  208.      U16                    ProtocolFlags;              /* 1Ah */
  209.      U16                    MaxPostedCmdBuffers;        /* 1Ch */
  210.      U16                    MaxPersistentIDs;           /* 1Eh */
  211.      U16                    MaxLanBuckets;              /* 20h */
  212.      U16                    Reserved4;                  /* 22h */
  213.      U32                    Reserved5;                  /* 24h */
  214. } MSG_PORT_FACTS_REPLY, MPI_POINTER PTR_MSG_PORT_FACTS_REPLY,
  215.   PortFactsReply_t, MPI_POINTER pPortFactsReply_t;
  216. /* PortTypes values */
  217. #define MPI_PORTFACTS_PORTTYPE_INACTIVE         (0x00)
  218. #define MPI_PORTFACTS_PORTTYPE_SCSI             (0x01)
  219. #define MPI_PORTFACTS_PORTTYPE_FC               (0x10)
  220. /* ProtocolFlags values */
  221. #define MPI_PORTFACTS_PROTOCOL_LOGBUSADDR       (0x01)
  222. #define MPI_PORTFACTS_PROTOCOL_LAN              (0x02)
  223. #define MPI_PORTFACTS_PROTOCOL_TARGET           (0x04)
  224. #define MPI_PORTFACTS_PROTOCOL_INITIATOR        (0x08)
  225. /****************************************************************************/
  226. /*  Port Enable Message                                                     */
  227. /****************************************************************************/
  228. typedef struct _MSG_PORT_ENABLE
  229. {
  230.     U8                      Reserved[2];                /* 00h */
  231.     U8                      ChainOffset;                /* 02h */
  232.     U8                      Function;                   /* 03h */
  233.     U8                      Reserved1[2];               /* 04h */
  234.     U8                      PortNumber;                 /* 06h */
  235.     U8                      MsgFlags;                   /* 07h */
  236.     U32                     MsgContext;                 /* 08h */
  237. } MSG_PORT_ENABLE, MPI_POINTER PTR_MSG_PORT_ENABLE,
  238.   PortEnable_t, MPI_POINTER pPortEnable_t;
  239. typedef struct _MSG_PORT_ENABLE_REPLY
  240. {
  241.     U8                      Reserved[2];                /* 00h */
  242.     U8                      MsgLength;                  /* 02h */
  243.     U8                      Function;                   /* 03h */
  244.     U8                      Reserved1[2];               /* 04h */
  245.     U8                      PortNumber;                 /* 05h */
  246.     U8                      MsgFlags;                   /* 07h */
  247.     U32                     MsgContext;                 /* 08h */
  248.     U16                     Reserved2;                  /* 0Ch */
  249.     U16                     IOCStatus;                  /* 0Eh */
  250.     U32                     IOCLogInfo;                 /* 10h */
  251. } MSG_PORT_ENABLE_REPLY, MPI_POINTER PTR_MSG_PORT_ENABLE_REPLY,
  252.   PortEnableReply_t, MPI_POINTER pPortEnableReply_t;
  253. /*****************************************************************************
  254. *
  255. *               E v e n t    M e s s a g e s
  256. *
  257. *****************************************************************************/
  258. /****************************************************************************/
  259. /*  Event Notification messages                                             */
  260. /****************************************************************************/
  261. typedef struct _MSG_EVENT_NOTIFY
  262. {
  263.     U8                      Switch;                     /* 00h */
  264.     U8                      Reserved;                   /* 01h */
  265.     U8                      ChainOffset;                /* 02h */
  266.     U8                      Function;                   /* 03h */
  267.     U8                      Reserved1[3];               /* 04h */
  268.     U8                      MsgFlags;                   /* 07h */
  269.     U32                     MsgContext;                 /* 08h */
  270. } MSG_EVENT_NOTIFY, MPI_POINTER PTR_MSG_EVENT_NOTIFY,
  271.   EventNotification_t, MPI_POINTER pEventNotification_t;
  272. /* Event Notification Reply */
  273. typedef struct _MSG_EVENT_NOTIFY_REPLY
  274. {
  275.      U16                    EventDataLength;            /* 00h */
  276.      U8                     MsgLength;                  /* 02h */
  277.      U8                     Function;                   /* 03h */
  278.      U8                     Reserved1[2];               /* 04h */
  279.      U8                     AckRequired;                /* 06h */
  280.      U8                     MsgFlags;                   /* 07h */
  281.      U32                    MsgContext;                 /* 08h */
  282.      U8                     Reserved2[2];               /* 0Ch */
  283.      U16                    IOCStatus;                  /* 0Eh */
  284.      U32                    IOCLogInfo;                 /* 10h */
  285.      U32                    Event;                      /* 14h */
  286.      U32                    EventContext;               /* 18h */
  287.      U32                    Data[1];                    /* 1Ch */
  288. } MSG_EVENT_NOTIFY_REPLY, MPI_POINTER PTR_MSG_EVENT_NOTIFY_REPLY,
  289.   EventNotificationReply_t, MPI_POINTER pEventNotificationReply_t;
  290. /* Event Acknowledge */
  291. typedef struct _MSG_EVENT_ACK
  292. {
  293.     U8                      Reserved[2];                /* 00h */
  294.     U8                      ChainOffset;                /* 02h */
  295.     U8                      Function;                   /* 03h */
  296.     U8                      Reserved1[3];               /* 04h */
  297.     U8                      MsgFlags;                   /* 07h */
  298.     U32                     MsgContext;                 /* 08h */
  299.     U32                     Event;                      /* 0Ch */
  300.     U32                     EventContext;               /* 10h */
  301. } MSG_EVENT_ACK, MPI_POINTER PTR_MSG_EVENT_ACK,
  302.   EventAck_t, MPI_POINTER pEventAck_t;
  303. typedef struct _MSG_EVENT_ACK_REPLY
  304. {
  305.     U8                      Reserved[2];                /* 00h */
  306.     U8                      MsgLength;                  /* 02h */
  307.     U8                      Function;                   /* 03h */
  308.     U8                      Reserved1[3];               /* 04h */
  309.     U8                      MsgFlags;                   /* 07h */
  310.     U32                     MsgContext;                 /* 08h */
  311.     U16                     Reserved2;                  /* 0Ch */
  312.     U16                     IOCStatus;                  /* 0Eh */
  313.     U32                     IOCLogInfo;                 /* 10h */
  314. } MSG_EVENT_ACK_REPLY, MPI_POINTER PTR_MSG_EVENT_ACK_REPLY,
  315.   EventAckReply_t, MPI_POINTER pEventAckReply_t;
  316. /* Switch */
  317. #define MPI_EVENT_NOTIFICATION_SWITCH_OFF   (0x00)
  318. #define MPI_EVENT_NOTIFICATION_SWITCH_ON    (0x01)
  319. /* Event */
  320. #define MPI_EVENT_NONE                      (0x00000000)
  321. #define MPI_EVENT_LOG_DATA                  (0x00000001)
  322. #define MPI_EVENT_STATE_CHANGE              (0x00000002)
  323. #define MPI_EVENT_UNIT_ATTENTION            (0x00000003)
  324. #define MPI_EVENT_IOC_BUS_RESET             (0x00000004)
  325. #define MPI_EVENT_EXT_BUS_RESET             (0x00000005)
  326. #define MPI_EVENT_RESCAN                    (0x00000006)
  327. #define MPI_EVENT_LINK_STATUS_CHANGE        (0x00000007)
  328. #define MPI_EVENT_LOOP_STATE_CHANGE         (0x00000008)
  329. #define MPI_EVENT_LOGOUT                    (0x00000009)
  330. #define MPI_EVENT_EVENT_CHANGE              (0x0000000A)
  331. #define MPI_EVENT_INTEGRATED_RAID           (0x0000000B)
  332. #define MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE (0x0000000C)
  333. #define MPI_EVENT_ON_BUS_TIMER_EXPIRED      (0x0000000D)
  334. /* AckRequired field values */
  335. #define MPI_EVENT_NOTIFICATION_ACK_NOT_REQUIRED (0x00)
  336. #define MPI_EVENT_NOTIFICATION_ACK_REQUIRED     (0x01)
  337. /* EventChange Event data */
  338. typedef struct _EVENT_DATA_EVENT_CHANGE
  339. {
  340.     U8                      EventState;                 /* 00h */
  341.     U8                      Reserved;                   /* 01h */
  342.     U16                     Reserved1;                  /* 02h */
  343. } EVENT_DATA_EVENT_CHANGE, MPI_POINTER PTR_EVENT_DATA_EVENT_CHANGE,
  344.   EventDataEventChange_t, MPI_POINTER pEventDataEventChange_t;
  345. /* SCSI Event data for Port, Bus and Device forms */
  346. typedef struct _EVENT_DATA_SCSI
  347. {
  348.     U8                      TargetID;                   /* 00h */
  349.     U8                      BusPort;                    /* 01h */
  350.     U16                     Reserved;                   /* 02h */
  351. } EVENT_DATA_SCSI, MPI_POINTER PTR_EVENT_DATA_SCSI,
  352.   EventDataScsi_t, MPI_POINTER pEventDataScsi_t;
  353. /* SCSI Device Status Change Event data */
  354. typedef struct _EVENT_DATA_SCSI_DEVICE_STATUS_CHANGE
  355. {
  356.     U8                      TargetID;                   /* 00h */
  357.     U8                      Bus;                        /* 01h */
  358.     U8                      ReasonCode;                 /* 02h */
  359.     U8                      LUN;                        /* 03h */
  360.     U8                      ASC;                        /* 04h */
  361.     U8                      ASCQ;                       /* 05h */
  362.     U16                     Reserved;                   /* 06h */
  363. } EVENT_DATA_SCSI_DEVICE_STATUS_CHANGE,
  364.   MPI_POINTER PTR_EVENT_DATA_SCSI_DEVICE_STATUS_CHANGE,
  365.   MpiEventDataScsiDeviceStatusChange_t,
  366.   MPI_POINTER pMpiEventDataScsiDeviceStatusChange_t;
  367. /* MPI SCSI Device Status Change Event data ReasonCode values */
  368. #define MPI_EVENT_SCSI_DEV_STAT_RC_ADDED                (0x03)
  369. #define MPI_EVENT_SCSI_DEV_STAT_RC_NOT_RESPONDING       (0x04)
  370. #define MPI_EVENT_SCSI_DEV_STAT_RC_SMART_DATA           (0x05)
  371. /* MPI Link Status Change Event data */
  372. typedef struct _EVENT_DATA_LINK_STATUS
  373. {
  374.     U8                      State;                      /* 00h */
  375.     U8                      Reserved;                   /* 01h */
  376.     U16                     Reserved1;                  /* 02h */
  377.     U8                      Reserved2;                  /* 04h */
  378.     U8                      Port;                       /* 05h */
  379.     U16                     Reserved3;                  /* 06h */
  380. } EVENT_DATA_LINK_STATUS, MPI_POINTER PTR_EVENT_DATA_LINK_STATUS,
  381.   EventDataLinkStatus_t, MPI_POINTER pEventDataLinkStatus_t;
  382. #define MPI_EVENT_LINK_STATUS_FAILURE       (0x00000000)
  383. #define MPI_EVENT_LINK_STATUS_ACTIVE        (0x00000001)
  384. /* MPI Loop State Change Event data */
  385. typedef struct _EVENT_DATA_LOOP_STATE
  386. {
  387.     U8                      Character4;                 /* 00h */
  388.     U8                      Character3;                 /* 01h */
  389.     U8                      Type;                       /* 02h */
  390.     U8                      Reserved;                   /* 03h */
  391.     U8                      Reserved1;                  /* 04h */
  392.     U8                      Port;                       /* 05h */
  393.     U16                     Reserved2;                  /* 06h */
  394. } EVENT_DATA_LOOP_STATE, MPI_POINTER PTR_EVENT_DATA_LOOP_STATE,
  395.   EventDataLoopState_t, MPI_POINTER pEventDataLoopState_t;
  396. #define MPI_EVENT_LOOP_STATE_CHANGE_LIP     (0x0001)
  397. #define MPI_EVENT_LOOP_STATE_CHANGE_LPE     (0x0002)
  398. #define MPI_EVENT_LOOP_STATE_CHANGE_LPB     (0x0003)
  399. /* MPI LOGOUT Event data */
  400. typedef struct _EVENT_DATA_LOGOUT
  401. {
  402.     U32                     NPortID;                    /* 00h */
  403.     U8                      Reserved;                   /* 04h */
  404.     U8                      Port;                       /* 05h */
  405.     U16                     Reserved1;                  /* 06h */
  406. } EVENT_DATA_LOGOUT, MPI_POINTER PTR_EVENT_DATA_LOGOUT,
  407.   EventDataLogout_t, MPI_POINTER pEventDataLogout_t;
  408. /* MPI Integrated RAID Event data */
  409. typedef struct _EVENT_DATA_RAID
  410. {
  411.     U8                      VolumeID;                   /* 00h */
  412.     U8                      VolumeBus;                  /* 01h */
  413.     U8                      ReasonCode;                 /* 02h */
  414.     U8                      PhysDiskNum;                /* 03h */
  415.     U8                      ASC;                        /* 04h */
  416.     U8                      ASCQ;                       /* 05h */
  417.     U16                     Reserved;                   /* 06h */
  418.     U32                     SettingsStatus;             /* 08h */
  419. } EVENT_DATA_RAID, MPI_POINTER PTR_EVENT_DATA_RAID,
  420.   MpiEventDataRaid_t, MPI_POINTER pMpiEventDataRaid_t;
  421. /* MPI Integrated RAID Event data ReasonCode values */
  422. #define MPI_EVENT_RAID_RC_VOLUME_CREATED                (0x00)
  423. #define MPI_EVENT_RAID_RC_VOLUME_DELETED                (0x01)
  424. #define MPI_EVENT_RAID_RC_VOLUME_SETTINGS_CHANGED       (0x02)
  425. #define MPI_EVENT_RAID_RC_VOLUME_STATUS_CHANGED         (0x03)
  426. #define MPI_EVENT_RAID_RC_VOLUME_PHYSDISK_CHANGED       (0x04)
  427. #define MPI_EVENT_RAID_RC_PHYSDISK_CREATED              (0x05)
  428. #define MPI_EVENT_RAID_RC_PHYSDISK_DELETED              (0x06)
  429. #define MPI_EVENT_RAID_RC_PHYSDISK_SETTINGS_CHANGED     (0x07)
  430. #define MPI_EVENT_RAID_RC_PHYSDISK_STATUS_CHANGED       (0x08)
  431. #define MPI_EVENT_RAID_RC_DOMAIN_VAL_NEEDED             (0x09)
  432. #define MPI_EVENT_RAID_RC_SMART_DATA                    (0x0A)
  433. #define MPI_EVENT_RAID_RC_REPLACE_ACTION_STARTED        (0x0B)
  434. /*****************************************************************************
  435. *
  436. *               F i r m w a r e    L o a d    M e s s a g e s
  437. *
  438. *****************************************************************************/
  439. /****************************************************************************/
  440. /*  Firmware Download message and associated structures                     */
  441. /****************************************************************************/
  442. typedef struct _MSG_FW_DOWNLOAD
  443. {
  444.     U8                      ImageType;                  /* 00h */
  445.     U8                      Reserved;                   /* 01h */
  446.     U8                      ChainOffset;                /* 02h */
  447.     U8                      Function;                   /* 03h */
  448.     U8                      Reserved1[3];               /* 04h */
  449.     U8                      MsgFlags;                   /* 07h */
  450.     U32                     MsgContext;                 /* 08h */
  451.     SGE_MPI_UNION           SGL;                        /* 0Ch */
  452. } MSG_FW_DOWNLOAD, MPI_POINTER PTR_MSG_FW_DOWNLOAD,
  453.   FWDownload_t, MPI_POINTER pFWDownload_t;
  454. #define MPI_FW_DOWNLOAD_ITYPE_RESERVED      (0x00)
  455. #define MPI_FW_DOWNLOAD_ITYPE_FW            (0x01)
  456. #define MPI_FW_DOWNLOAD_ITYPE_BIOS          (0x02)
  457. #define MPI_FW_DOWNLOAD_ITYPE_NVDATA        (0x03)
  458. typedef struct _FWDownloadTCSGE
  459. {
  460.     U8                      Reserved;                   /* 00h */
  461.     U8                      ContextSize;                /* 01h */
  462.     U8                      DetailsLength;              /* 02h */
  463.     U8                      Flags;                      /* 03h */
  464.     U32                     Reserved_0100_Checksum;     /* 04h */ /* obsolete Checksum */
  465.     U32                     ImageOffset;                /* 08h */
  466.     U32                     ImageSize;                  /* 0Ch */
  467. } FW_DOWNLOAD_TCSGE, MPI_POINTER PTR_FW_DOWNLOAD_TCSGE,
  468.   FWDownloadTCSGE_t, MPI_POINTER pFWDownloadTCSGE_t;
  469. /* Firmware Download reply */
  470. typedef struct _MSG_FW_DOWNLOAD_REPLY
  471. {
  472.     U8                      ImageType;                  /* 00h */
  473.     U8                      Reserved;                   /* 01h */
  474.     U8                      MsgLength;                  /* 02h */
  475.     U8                      Function;                   /* 03h */
  476.     U8                      Reserved1[3];               /* 04h */
  477.     U8                      MsgFlags;                   /* 07h */
  478.     U32                     MsgContext;                 /* 08h */
  479.     U16                     Reserved2;                  /* 0Ch */
  480.     U16                     IOCStatus;                  /* 0Eh */
  481.     U32                     IOCLogInfo;                 /* 10h */
  482. } MSG_FW_DOWNLOAD_REPLY, MPI_POINTER PTR_MSG_FW_DOWNLOAD_REPLY,
  483.   FWDownloadReply_t, MPI_POINTER pFWDownloadReply_t;
  484. /****************************************************************************/
  485. /*  Firmware Upload message and associated structures                       */
  486. /****************************************************************************/
  487. typedef struct _MSG_FW_UPLOAD
  488. {
  489.     U8                      ImageType;                  /* 00h */
  490.     U8                      Reserved;                   /* 01h */
  491.     U8                      ChainOffset;                /* 02h */
  492.     U8                      Function;                   /* 03h */
  493.     U8                      Reserved1[3];               /* 04h */
  494.     U8                      MsgFlags;                   /* 07h */
  495.     U32                     MsgContext;                 /* 08h */
  496.     SGE_MPI_UNION           SGL;                        /* 0Ch */
  497. } MSG_FW_UPLOAD, MPI_POINTER PTR_MSG_FW_UPLOAD,
  498.   FWUpload_t, MPI_POINTER pFWUpload_t;
  499. #define MPI_FW_UPLOAD_ITYPE_FW_IOC_MEM      (0x00)
  500. #define MPI_FW_UPLOAD_ITYPE_FW_FLASH        (0x01)
  501. #define MPI_FW_UPLOAD_ITYPE_BIOS_FLASH      (0x02)
  502. #define MPI_FW_UPLOAD_ITYPE_NVDATA          (0x03)
  503. typedef struct _FWUploadTCSGE
  504. {
  505.     U8                      Reserved;                   /* 00h */
  506.     U8                      ContextSize;                /* 01h */
  507.     U8                      DetailsLength;              /* 02h */
  508.     U8                      Flags;                      /* 03h */
  509.     U32                     Reserved1;                  /* 04h */
  510.     U32                     ImageOffset;                /* 08h */
  511.     U32                     ImageSize;                  /* 0Ch */
  512. } FW_UPLOAD_TCSGE, MPI_POINTER PTR_FW_UPLOAD_TCSGE,
  513.   FWUploadTCSGE_t, MPI_POINTER pFWUploadTCSGE_t;
  514. /* Firmware Upload reply */
  515. typedef struct _MSG_FW_UPLOAD_REPLY
  516. {
  517.     U8                      ImageType;                  /* 00h */
  518.     U8                      Reserved;                   /* 01h */
  519.     U8                      MsgLength;                  /* 02h */
  520.     U8                      Function;                   /* 03h */
  521.     U8                      Reserved1[3];               /* 04h */
  522.     U8                      MsgFlags;                   /* 07h */
  523.     U32                     MsgContext;                 /* 08h */
  524.     U16                     Reserved2;                  /* 0Ch */
  525.     U16                     IOCStatus;                  /* 0Eh */
  526.     U32                     IOCLogInfo;                 /* 10h */
  527.     U32                     ActualImageSize;            /* 14h */
  528. } MSG_FW_UPLOAD_REPLY, MPI_POINTER PTR_MSG_FW_UPLOAD_REPLY,
  529.   FWUploadReply_t, MPI_POINTER pFWUploadReply_t;
  530. typedef struct _MPI_FW_HEADER
  531. {
  532.     U32                     ArmBranchInstruction0;      /* 00h */
  533.     U32                     Signature0;                 /* 04h */
  534.     U32                     Signature1;                 /* 08h */
  535.     U32                     Signature2;                 /* 0Ch */
  536.     U32                     ArmBranchInstruction1;      /* 10h */
  537.     U32                     ArmBranchInstruction2;      /* 14h */
  538.     U32                     Reserved;                   /* 18h */
  539.     U32                     Checksum;                   /* 1Ch */
  540.     U16                     VendorId;                   /* 20h */
  541.     U16                     ProductId;                  /* 22h */
  542.     MPI_FW_VERSION          FWVersion;                  /* 24h */
  543.     U32                     SeqCodeVersion;             /* 28h */
  544.     U32                     ImageSize;                  /* 2Ch */
  545.     U32                     NextImageHeaderOffset;      /* 30h */
  546.     U32                     LoadStartAddress;           /* 34h */
  547.     U32                     IopResetVectorValue;        /* 38h */
  548.     U32                     IopResetRegAddr;            /* 3Ch */
  549.     U32                     VersionNameWhat;            /* 40h */
  550.     U8                      VersionName[32];            /* 44h */
  551.     U32                     VendorNameWhat;             /* 64h */
  552.     U8                      VendorName[32];             /* 68h */
  553. } MPI_FW_HEADER, MPI_POINTER PTR_MPI_FW_HEADER,
  554.   MpiFwHeader_t, MPI_POINTER pMpiFwHeader_t;
  555. #define MPI_FW_HEADER_WHAT_SIGNATURE        (0x29232840)
  556. /* defines for using the ProductId field */
  557. #define MPI_FW_HEADER_PID_TYPE_MASK             (0xF000)
  558. #define MPI_FW_HEADER_PID_TYPE_SCSI             (0x0000)
  559. #define MPI_FW_HEADER_PID_TYPE_FC               (0x1000)
  560. #define MPI_FW_HEADER_PID_PROD_MASK                     (0x0F00)
  561. #define MPI_FW_HEADER_PID_PROD_INITIATOR_SCSI           (0x0100)
  562. #define MPI_FW_HEADER_PID_PROD_TARGET_INITIATOR_SCSI    (0x0200)
  563. #define MPI_FW_HEADER_PID_PROD_TARGET_SCSI              (0x0300)
  564. #define MPI_FW_HEADER_PID_PROD_IM_SCSI                  (0x0400)
  565. #define MPI_FW_HEADER_PID_PROD_IS_SCSI                  (0x0500)
  566. #define MPI_FW_HEADER_PID_PROD_CTX_SCSI                 (0x0600)
  567. #define MPI_FW_HEADER_PID_FAMILY_MASK           (0x00FF)
  568. #define MPI_FW_HEADER_PID_FAMILY_1030A0_SCSI    (0x0001)
  569. #define MPI_FW_HEADER_PID_FAMILY_1030B0_SCSI    (0x0002)
  570. #define MPI_FW_HEADER_PID_FAMILY_1030B1_SCSI    (0x0003)
  571. #define MPI_FW_HEADER_PID_FAMILY_1030C0_SCSI    (0x0004)
  572. #define MPI_FW_HEADER_PID_FAMILY_1020A0_SCSI    (0x0005)
  573. #define MPI_FW_HEADER_PID_FAMILY_1020B0_SCSI    (0x0006)
  574. #define MPI_FW_HEADER_PID_FAMILY_1020B1_SCSI    (0x0007)
  575. #define MPI_FW_HEADER_PID_FAMILY_1020C0_SCSI    (0x0008)
  576. #define MPI_FW_HEADER_PID_FAMILY_1035A0_SCSI    (0x0009)
  577. #define MPI_FW_HEADER_PID_FAMILY_1035B0_SCSI    (0x000A)
  578. #define MPI_FW_HEADER_PID_FAMILY_909_FC         (0x0000)
  579. #define MPI_FW_HEADER_PID_FAMILY_919_FC         (0x0001)
  580. #define MPI_FW_HEADER_PID_FAMILY_919X_FC        (0x0002)
  581. typedef struct _MPI_EXT_IMAGE_HEADER
  582. {
  583.     U8                      ImageType;                  /* 00h */
  584.     U8                      Reserved;                   /* 01h */
  585.     U16                     Reserved1;                  /* 02h */
  586.     U32                     Checksum;                   /* 04h */
  587.     U32                     ImageSize;                  /* 08h */
  588.     U32                     NextImageHeaderOffset;      /* 0Ch */
  589.     U32                     LoadStartAddress;           /* 10h */
  590.     U32                     Reserved2;                  /* 14h */
  591. } MPI_EXT_IMAGE_HEADER, MPI_POINTER PTR_MPI_EXT_IMAGE_HEADER,
  592.   MpiExtImageHeader_t, MPI_POINTER pMpiExtImageHeader_t;
  593. /* defines for the ImageType field */
  594. #define MPI_EXT_IMAGE_TYPE_UNSPECIFIED          (0x00)
  595. #define MPI_EXT_IMAGE_TYPE_FW                   (0x01)
  596. #define MPI_EXT_IMAGE_TYPE_NVDATA               (0x03)
  597. #endif