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