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