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