Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / drivers / message / fusion / lsi / mpi_init.h
1 /*
2  *  Copyright (c) 2000-2005 LSI Logic Corporation.
3  *
4  *
5  *           Name:  mpi_init.h
6  *          Title:  MPI initiator mode messages and structures
7  *  Creation Date:  June 8, 2000
8  *
9  *    mpi_init.h Version:  01.05.06
10  *
11  *  Version History
12  *  ---------------
13  *
14  *  Date      Version   Description
15  *  --------  --------  ------------------------------------------------------
16  *  05-08-00  00.10.01  Original release for 0.10 spec dated 4/26/2000.
17  *  05-24-00  00.10.02  Added SenseBufferLength to _MSG_SCSI_IO_REPLY.
18  *  06-06-00  01.00.01  Update version number for 1.0 release.
19  *  06-08-00  01.00.02  Added MPI_SCSI_RSP_INFO_ definitions.
20  *  11-02-00  01.01.01  Original release for post 1.0 work.
21  *  12-04-00  01.01.02  Added MPI_SCSIIO_CONTROL_NO_DISCONNECT.
22  *  02-20-01  01.01.03  Started using MPI_POINTER.
23  *  03-27-01  01.01.04  Added structure offset comments.
24  *  04-10-01  01.01.05  Added new MsgFlag for MSG_SCSI_TASK_MGMT.
25  *  08-08-01  01.02.01  Original release for v1.2 work.
26  *  08-29-01  01.02.02  Added MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET.
27  *                      Added MPI_SCSI_STATE_QUEUE_TAG_REJECTED for
28  *                      MSG_SCSI_IO_REPLY.
29  *  09-28-01  01.02.03  Added structures and defines for SCSI Enclosure
30  *                      Processor messages.
31  *  10-04-01  01.02.04  Added defines for SEP request Action field.
32  *  05-31-02  01.02.05  Added MPI_SCSIIO_MSGFLGS_CMD_DETERMINES_DATA_DIR define
33  *                      for SCSI IO requests.
34  *  11-15-02  01.02.06  Added special extended SCSI Status defines for FCP.
35  *  06-26-03  01.02.07  Added MPI_SCSI_STATUS_FCPEXT_UNASSIGNED define.
36  *  05-11-04  01.03.01  Original release for MPI v1.3.
37  *  08-19-04  01.05.01  Added MsgFlags defines for EEDP to SCSI IO request.
38  *                      Added new word to MSG_SCSI_IO_REPLY to add TaskTag field
39  *                      and a reserved U16.
40  *                      Added new MSG_SCSI_IO32_REQUEST structure.
41  *                      Added a TaskType of Clear Task Set to SCSI
42  *                      Task Management request.
43  *  12-07-04  01.05.02  Added support for Task Management Query Task.
44  *  01-15-05  01.05.03  Modified SCSI Enclosure Processor Request to support
45  *                      WWID addressing.
46  *  03-11-05  01.05.04  Removed EEDP flags from SCSI IO Request.
47  *                      Removed SCSI IO 32 Request.
48  *                      Modified SCSI Enclosure Processor Request and Reply to
49  *                      support Enclosure/Slot addressing rather than WWID
50  *                      addressing.
51  *  06-24-05  01.05.05  Added SCSI IO 32 structures and defines.
52  *                      Added four new defines for SEP SlotStatus.
53  *  08-03-05  01.05.06  Fixed some MPI_SCSIIO32_MSGFLGS_ defines to make them
54  *                      unique in the first 32 characters.
55  *  --------------------------------------------------------------------------
56  */
57
58 #ifndef MPI_INIT_H
59 #define MPI_INIT_H
60
61
62 /*****************************************************************************
63 *
64 *               S C S I    I n i t i a t o r    M e s s a g e s
65 *
66 *****************************************************************************/
67
68 /****************************************************************************/
69 /*  SCSI IO messages and associated structures                              */
70 /****************************************************************************/
71
72 typedef struct _MSG_SCSI_IO_REQUEST
73 {
74     U8                      TargetID;           /* 00h */
75     U8                      Bus;                /* 01h */
76     U8                      ChainOffset;        /* 02h */
77     U8                      Function;           /* 03h */
78     U8                      CDBLength;          /* 04h */
79     U8                      SenseBufferLength;  /* 05h */
80     U8                      Reserved;           /* 06h */
81     U8                      MsgFlags;           /* 07h */
82     U32                     MsgContext;         /* 08h */
83     U8                      LUN[8];             /* 0Ch */
84     U32                     Control;            /* 14h */
85     U8                      CDB[16];            /* 18h */
86     U32                     DataLength;         /* 28h */
87     U32                     SenseBufferLowAddr; /* 2Ch */
88     SGE_IO_UNION            SGL;                /* 30h */
89 } MSG_SCSI_IO_REQUEST, MPI_POINTER PTR_MSG_SCSI_IO_REQUEST,
90   SCSIIORequest_t, MPI_POINTER pSCSIIORequest_t;
91
92
93 /* SCSI IO MsgFlags bits */
94
95 #define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH              (0x01)
96 #define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_32           (0x00)
97 #define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_64           (0x01)
98
99 #define MPI_SCSIIO_MSGFLGS_SENSE_LOCATION           (0x02)
100 #define MPI_SCSIIO_MSGFLGS_SENSE_LOC_HOST           (0x00)
101 #define MPI_SCSIIO_MSGFLGS_SENSE_LOC_IOC            (0x02)
102
103 #define MPI_SCSIIO_MSGFLGS_CMD_DETERMINES_DATA_DIR  (0x04)
104
105 /* SCSI IO LUN fields */
106
107 #define MPI_SCSIIO_LUN_FIRST_LEVEL_ADDRESSING   (0x0000FFFF)
108 #define MPI_SCSIIO_LUN_SECOND_LEVEL_ADDRESSING  (0xFFFF0000)
109 #define MPI_SCSIIO_LUN_THIRD_LEVEL_ADDRESSING   (0x0000FFFF)
110 #define MPI_SCSIIO_LUN_FOURTH_LEVEL_ADDRESSING  (0xFFFF0000)
111 #define MPI_SCSIIO_LUN_LEVEL_1_WORD             (0xFF00)
112 #define MPI_SCSIIO_LUN_LEVEL_1_DWORD            (0x0000FF00)
113
114 /* SCSI IO Control bits */
115
116 #define MPI_SCSIIO_CONTROL_DATADIRECTION_MASK   (0x03000000)
117 #define MPI_SCSIIO_CONTROL_NODATATRANSFER       (0x00000000)
118 #define MPI_SCSIIO_CONTROL_WRITE                (0x01000000)
119 #define MPI_SCSIIO_CONTROL_READ                 (0x02000000)
120
121 #define MPI_SCSIIO_CONTROL_ADDCDBLEN_MASK       (0x3C000000)
122 #define MPI_SCSIIO_CONTROL_ADDCDBLEN_SHIFT      (26)
123
124 #define MPI_SCSIIO_CONTROL_TASKATTRIBUTE_MASK   (0x00000700)
125 #define MPI_SCSIIO_CONTROL_SIMPLEQ              (0x00000000)
126 #define MPI_SCSIIO_CONTROL_HEADOFQ              (0x00000100)
127 #define MPI_SCSIIO_CONTROL_ORDEREDQ             (0x00000200)
128 #define MPI_SCSIIO_CONTROL_ACAQ                 (0x00000400)
129 #define MPI_SCSIIO_CONTROL_UNTAGGED             (0x00000500)
130 #define MPI_SCSIIO_CONTROL_NO_DISCONNECT        (0x00000700)
131
132 #define MPI_SCSIIO_CONTROL_TASKMANAGE_MASK      (0x00FF0000)
133 #define MPI_SCSIIO_CONTROL_OBSOLETE             (0x00800000)
134 #define MPI_SCSIIO_CONTROL_CLEAR_ACA_RSV        (0x00400000)
135 #define MPI_SCSIIO_CONTROL_TARGET_RESET         (0x00200000)
136 #define MPI_SCSIIO_CONTROL_LUN_RESET_RSV        (0x00100000)
137 #define MPI_SCSIIO_CONTROL_RESERVED             (0x00080000)
138 #define MPI_SCSIIO_CONTROL_CLR_TASK_SET_RSV     (0x00040000)
139 #define MPI_SCSIIO_CONTROL_ABORT_TASK_SET       (0x00020000)
140 #define MPI_SCSIIO_CONTROL_RESERVED2            (0x00010000)
141
142
143 /* SCSI IO reply structure */
144 typedef struct _MSG_SCSI_IO_REPLY
145 {
146     U8                      TargetID;           /* 00h */
147     U8                      Bus;                /* 01h */
148     U8                      MsgLength;          /* 02h */
149     U8                      Function;           /* 03h */
150     U8                      CDBLength;          /* 04h */
151     U8                      SenseBufferLength;  /* 05h */
152     U8                      Reserved;           /* 06h */
153     U8                      MsgFlags;           /* 07h */
154     U32                     MsgContext;         /* 08h */
155     U8                      SCSIStatus;         /* 0Ch */
156     U8                      SCSIState;          /* 0Dh */
157     U16                     IOCStatus;          /* 0Eh */
158     U32                     IOCLogInfo;         /* 10h */
159     U32                     TransferCount;      /* 14h */
160     U32                     SenseCount;         /* 18h */
161     U32                     ResponseInfo;       /* 1Ch */
162     U16                     TaskTag;            /* 20h */
163     U16                     Reserved1;          /* 22h */
164 } MSG_SCSI_IO_REPLY, MPI_POINTER PTR_MSG_SCSI_IO_REPLY,
165   SCSIIOReply_t, MPI_POINTER pSCSIIOReply_t;
166
167
168 /* SCSI IO Reply SCSIStatus values (SAM-2 status codes) */
169
170 #define MPI_SCSI_STATUS_SUCCESS                 (0x00)
171 #define MPI_SCSI_STATUS_CHECK_CONDITION         (0x02)
172 #define MPI_SCSI_STATUS_CONDITION_MET           (0x04)
173 #define MPI_SCSI_STATUS_BUSY                    (0x08)
174 #define MPI_SCSI_STATUS_INTERMEDIATE            (0x10)
175 #define MPI_SCSI_STATUS_INTERMEDIATE_CONDMET    (0x14)
176 #define MPI_SCSI_STATUS_RESERVATION_CONFLICT    (0x18)
177 #define MPI_SCSI_STATUS_COMMAND_TERMINATED      (0x22)
178 #define MPI_SCSI_STATUS_TASK_SET_FULL           (0x28)
179 #define MPI_SCSI_STATUS_ACA_ACTIVE              (0x30)
180
181 #define MPI_SCSI_STATUS_FCPEXT_DEVICE_LOGGED_OUT    (0x80)
182 #define MPI_SCSI_STATUS_FCPEXT_NO_LINK              (0x81)
183 #define MPI_SCSI_STATUS_FCPEXT_UNASSIGNED           (0x82)
184
185
186 /* SCSI IO Reply SCSIState values */
187
188 #define MPI_SCSI_STATE_AUTOSENSE_VALID          (0x01)
189 #define MPI_SCSI_STATE_AUTOSENSE_FAILED         (0x02)
190 #define MPI_SCSI_STATE_NO_SCSI_STATUS           (0x04)
191 #define MPI_SCSI_STATE_TERMINATED               (0x08)
192 #define MPI_SCSI_STATE_RESPONSE_INFO_VALID      (0x10)
193 #define MPI_SCSI_STATE_QUEUE_TAG_REJECTED       (0x20)
194
195 /* SCSI IO Reply ResponseInfo values */
196 /* (FCP-1 RSP_CODE values and SPI-3 Packetized Failure codes) */
197
198 #define MPI_SCSI_RSP_INFO_FUNCTION_COMPLETE     (0x00000000)
199 #define MPI_SCSI_RSP_INFO_FCP_BURST_LEN_ERROR   (0x01000000)
200 #define MPI_SCSI_RSP_INFO_CMND_FIELDS_INVALID   (0x02000000)
201 #define MPI_SCSI_RSP_INFO_FCP_DATA_RO_ERROR     (0x03000000)
202 #define MPI_SCSI_RSP_INFO_TASK_MGMT_UNSUPPORTED (0x04000000)
203 #define MPI_SCSI_RSP_INFO_TASK_MGMT_FAILED      (0x05000000)
204 #define MPI_SCSI_RSP_INFO_SPI_LQ_INVALID_TYPE   (0x06000000)
205
206 #define MPI_SCSI_TASKTAG_UNKNOWN                (0xFFFF)
207
208
209 /****************************************************************************/
210 /*  SCSI IO 32 messages and associated structures                           */
211 /****************************************************************************/
212
213 typedef struct
214 {
215     U8                      CDB[20];                    /* 00h */
216     U32                     PrimaryReferenceTag;        /* 14h */
217     U16                     PrimaryApplicationTag;      /* 18h */
218     U16                     PrimaryApplicationTagMask;  /* 1Ah */
219     U32                     TransferLength;             /* 1Ch */
220 } MPI_SCSI_IO32_CDB_EEDP32, MPI_POINTER PTR_MPI_SCSI_IO32_CDB_EEDP32,
221   MpiScsiIo32CdbEedp32_t, MPI_POINTER pMpiScsiIo32CdbEedp32_t;
222
223 typedef struct
224 {
225     U8                      CDB[16];                    /* 00h */
226     U32                     DataLength;                 /* 10h */
227     U32                     PrimaryReferenceTag;        /* 14h */
228     U16                     PrimaryApplicationTag;      /* 18h */
229     U16                     PrimaryApplicationTagMask;  /* 1Ah */
230     U32                     TransferLength;             /* 1Ch */
231 } MPI_SCSI_IO32_CDB_EEDP16, MPI_POINTER PTR_MPI_SCSI_IO32_CDB_EEDP16,
232   MpiScsiIo32CdbEedp16_t, MPI_POINTER pMpiScsiIo32CdbEedp16_t;
233
234 typedef union
235 {
236     U8                       CDB32[32];
237     MPI_SCSI_IO32_CDB_EEDP32 EEDP32;
238     MPI_SCSI_IO32_CDB_EEDP16 EEDP16;
239     SGE_SIMPLE_UNION         SGE;
240 } MPI_SCSI_IO32_CDB_UNION, MPI_POINTER PTR_MPI_SCSI_IO32_CDB_UNION,
241   MpiScsiIo32Cdb_t, MPI_POINTER pMpiScsiIo32Cdb_t;
242
243 typedef struct
244 {
245     U8                      TargetID;           /* 00h */
246     U8                      Bus;                /* 01h */
247     U16                     Reserved1;          /* 02h */
248     U32                     Reserved2;          /* 04h */
249 } MPI_SCSI_IO32_BUS_TARGET_ID_FORM, MPI_POINTER PTR_MPI_SCSI_IO32_BUS_TARGET_ID_FORM,
250   MpiScsiIo32BusTargetIdForm_t, MPI_POINTER pMpiScsiIo32BusTargetIdForm_t;
251
252 typedef union
253 {
254     MPI_SCSI_IO32_BUS_TARGET_ID_FORM    SCSIID;
255     U64                                 WWID;
256 } MPI_SCSI_IO32_ADDRESS, MPI_POINTER PTR_MPI_SCSI_IO32_ADDRESS,
257   MpiScsiIo32Address_t, MPI_POINTER pMpiScsiIo32Address_t;
258
259 typedef struct _MSG_SCSI_IO32_REQUEST
260 {
261     U8                          Port;                           /* 00h */
262     U8                          Reserved1;                      /* 01h */
263     U8                          ChainOffset;                    /* 02h */
264     U8                          Function;                       /* 03h */
265     U8                          CDBLength;                      /* 04h */
266     U8                          SenseBufferLength;              /* 05h */
267     U8                          Flags;                          /* 06h */
268     U8                          MsgFlags;                       /* 07h */
269     U32                         MsgContext;                     /* 08h */
270     U8                          LUN[8];                         /* 0Ch */
271     U32                         Control;                        /* 14h */
272     MPI_SCSI_IO32_CDB_UNION     CDB;                            /* 18h */
273     U32                         DataLength;                     /* 38h */
274     U32                         BidirectionalDataLength;        /* 3Ch */
275     U32                         SecondaryReferenceTag;          /* 40h */
276     U16                         SecondaryApplicationTag;        /* 44h */
277     U16                         Reserved2;                      /* 46h */
278     U16                         EEDPFlags;                      /* 48h */
279     U16                         ApplicationTagTranslationMask;  /* 4Ah */
280     U32                         EEDPBlockSize;                  /* 4Ch */
281     MPI_SCSI_IO32_ADDRESS       DeviceAddress;                  /* 50h */
282     U8                          SGLOffset0;                     /* 58h */
283     U8                          SGLOffset1;                     /* 59h */
284     U8                          SGLOffset2;                     /* 5Ah */
285     U8                          SGLOffset3;                     /* 5Bh */
286     U32                         Reserved3;                      /* 5Ch */
287     U32                         Reserved4;                      /* 60h */
288     U32                         SenseBufferLowAddr;             /* 64h */
289     SGE_IO_UNION                SGL;                            /* 68h */
290 } MSG_SCSI_IO32_REQUEST, MPI_POINTER PTR_MSG_SCSI_IO32_REQUEST,
291   SCSIIO32Request_t, MPI_POINTER pSCSIIO32Request_t;
292
293 /* SCSI IO 32 MsgFlags bits */
294 #define MPI_SCSIIO32_MSGFLGS_SENSE_WIDTH                (0x01)
295 #define MPI_SCSIIO32_MSGFLGS_32_SENSE_WIDTH             (0x00)
296 #define MPI_SCSIIO32_MSGFLGS_64_SENSE_WIDTH             (0x01)
297
298 #define MPI_SCSIIO32_MSGFLGS_SENSE_LOCATION             (0x02)
299 #define MPI_SCSIIO32_MSGFLGS_SENSE_LOC_HOST             (0x00)
300 #define MPI_SCSIIO32_MSGFLGS_SENSE_LOC_IOC              (0x02)
301
302 #define MPI_SCSIIO32_MSGFLGS_CMD_DETERMINES_DATA_DIR    (0x04)
303 #define MPI_SCSIIO32_MSGFLGS_SGL_OFFSETS_CHAINS         (0x08)
304 #define MPI_SCSIIO32_MSGFLGS_MULTICAST                  (0x10)
305 #define MPI_SCSIIO32_MSGFLGS_BIDIRECTIONAL              (0x20)
306 #define MPI_SCSIIO32_MSGFLGS_LARGE_CDB                  (0x40)
307
308 /* SCSI IO 32 Flags bits */
309 #define MPI_SCSIIO32_FLAGS_FORM_MASK                    (0x03)
310 #define MPI_SCSIIO32_FLAGS_FORM_SCSIID                  (0x00)
311 #define MPI_SCSIIO32_FLAGS_FORM_WWID                    (0x01)
312
313 /* SCSI IO 32 LUN fields */
314 #define MPI_SCSIIO32_LUN_FIRST_LEVEL_ADDRESSING     (0x0000FFFF)
315 #define MPI_SCSIIO32_LUN_SECOND_LEVEL_ADDRESSING    (0xFFFF0000)
316 #define MPI_SCSIIO32_LUN_THIRD_LEVEL_ADDRESSING     (0x0000FFFF)
317 #define MPI_SCSIIO32_LUN_FOURTH_LEVEL_ADDRESSING    (0xFFFF0000)
318 #define MPI_SCSIIO32_LUN_LEVEL_1_WORD               (0xFF00)
319 #define MPI_SCSIIO32_LUN_LEVEL_1_DWORD              (0x0000FF00)
320
321 /* SCSI IO 32 Control bits */
322 #define MPI_SCSIIO32_CONTROL_DATADIRECTION_MASK     (0x03000000)
323 #define MPI_SCSIIO32_CONTROL_NODATATRANSFER         (0x00000000)
324 #define MPI_SCSIIO32_CONTROL_WRITE                  (0x01000000)
325 #define MPI_SCSIIO32_CONTROL_READ                   (0x02000000)
326 #define MPI_SCSIIO32_CONTROL_BIDIRECTIONAL          (0x03000000)
327
328 #define MPI_SCSIIO32_CONTROL_ADDCDBLEN_MASK         (0xFC000000)
329 #define MPI_SCSIIO32_CONTROL_ADDCDBLEN_SHIFT        (26)
330
331 #define MPI_SCSIIO32_CONTROL_TASKATTRIBUTE_MASK     (0x00000700)
332 #define MPI_SCSIIO32_CONTROL_SIMPLEQ                (0x00000000)
333 #define MPI_SCSIIO32_CONTROL_HEADOFQ                (0x00000100)
334 #define MPI_SCSIIO32_CONTROL_ORDEREDQ               (0x00000200)
335 #define MPI_SCSIIO32_CONTROL_ACAQ                   (0x00000400)
336 #define MPI_SCSIIO32_CONTROL_UNTAGGED               (0x00000500)
337 #define MPI_SCSIIO32_CONTROL_NO_DISCONNECT          (0x00000700)
338
339 #define MPI_SCSIIO32_CONTROL_TASKMANAGE_MASK        (0x00FF0000)
340 #define MPI_SCSIIO32_CONTROL_OBSOLETE               (0x00800000)
341 #define MPI_SCSIIO32_CONTROL_CLEAR_ACA_RSV          (0x00400000)
342 #define MPI_SCSIIO32_CONTROL_TARGET_RESET           (0x00200000)
343 #define MPI_SCSIIO32_CONTROL_LUN_RESET_RSV          (0x00100000)
344 #define MPI_SCSIIO32_CONTROL_RESERVED               (0x00080000)
345 #define MPI_SCSIIO32_CONTROL_CLR_TASK_SET_RSV       (0x00040000)
346 #define MPI_SCSIIO32_CONTROL_ABORT_TASK_SET         (0x00020000)
347 #define MPI_SCSIIO32_CONTROL_RESERVED2              (0x00010000)
348
349 /* SCSI IO 32 EEDPFlags */
350 #define MPI_SCSIIO32_EEDPFLAGS_MASK_OP              (0x0007)
351 #define MPI_SCSIIO32_EEDPFLAGS_NOOP_OP              (0x0000)
352 #define MPI_SCSIIO32_EEDPFLAGS_CHK_OP               (0x0001)
353 #define MPI_SCSIIO32_EEDPFLAGS_STRIP_OP             (0x0002)
354 #define MPI_SCSIIO32_EEDPFLAGS_CHKRM_OP             (0x0003)
355 #define MPI_SCSIIO32_EEDPFLAGS_INSERT_OP            (0x0004)
356 #define MPI_SCSIIO32_EEDPFLAGS_REPLACE_OP           (0x0006)
357 #define MPI_SCSIIO32_EEDPFLAGS_CHKREGEN_OP          (0x0007)
358
359 #define MPI_SCSIIO32_EEDPFLAGS_PASS_REF_TAG         (0x0008)
360 #define MPI_SCSIIO32_EEDPFLAGS_8_9THS_MODE          (0x0010)
361
362 #define MPI_SCSIIO32_EEDPFLAGS_T10_CHK_MASK         (0x0700)
363 #define MPI_SCSIIO32_EEDPFLAGS_T10_CHK_GUARD        (0x0100)
364 #define MPI_SCSIIO32_EEDPFLAGS_T10_CHK_REFTAG       (0x0200)
365 #define MPI_SCSIIO32_EEDPFLAGS_T10_CHK_LBATAG       (0x0400)
366 #define MPI_SCSIIO32_EEDPFLAGS_T10_CHK_SHIFT        (8)
367
368 #define MPI_SCSIIO32_EEDPFLAGS_INC_SEC_APPTAG       (0x1000)
369 #define MPI_SCSIIO32_EEDPFLAGS_INC_PRI_APPTAG       (0x2000)
370 #define MPI_SCSIIO32_EEDPFLAGS_INC_SEC_REFTAG       (0x4000)
371 #define MPI_SCSIIO32_EEDPFLAGS_INC_PRI_REFTAG       (0x8000)
372
373
374 /* SCSIIO32 IO reply structure */
375 typedef struct _MSG_SCSIIO32_IO_REPLY
376 {
377     U8                      Port;                       /* 00h */
378     U8                      Reserved1;                  /* 01h */
379     U8                      MsgLength;                  /* 02h */
380     U8                      Function;                   /* 03h */
381     U8                      CDBLength;                  /* 04h */
382     U8                      SenseBufferLength;          /* 05h */
383     U8                      Flags;                      /* 06h */
384     U8                      MsgFlags;                   /* 07h */
385     U32                     MsgContext;                 /* 08h */
386     U8                      SCSIStatus;                 /* 0Ch */
387     U8                      SCSIState;                  /* 0Dh */
388     U16                     IOCStatus;                  /* 0Eh */
389     U32                     IOCLogInfo;                 /* 10h */
390     U32                     TransferCount;              /* 14h */
391     U32                     SenseCount;                 /* 18h */
392     U32                     ResponseInfo;               /* 1Ch */
393     U16                     TaskTag;                    /* 20h */
394     U16                     Reserved2;                  /* 22h */
395     U32                     BidirectionalTransferCount; /* 24h */
396 } MSG_SCSIIO32_IO_REPLY, MPI_POINTER PTR_MSG_SCSIIO32_IO_REPLY,
397   SCSIIO32Reply_t, MPI_POINTER pSCSIIO32Reply_t;
398
399
400 /****************************************************************************/
401 /*  SCSI Task Management messages                                           */
402 /****************************************************************************/
403
404 typedef struct _MSG_SCSI_TASK_MGMT
405 {
406     U8                      TargetID;           /* 00h */
407     U8                      Bus;                /* 01h */
408     U8                      ChainOffset;        /* 02h */
409     U8                      Function;           /* 03h */
410     U8                      Reserved;           /* 04h */
411     U8                      TaskType;           /* 05h */
412     U8                      Reserved1;          /* 06h */
413     U8                      MsgFlags;           /* 07h */
414     U32                     MsgContext;         /* 08h */
415     U8                      LUN[8];             /* 0Ch */
416     U32                     Reserved2[7];       /* 14h */
417     U32                     TaskMsgContext;     /* 30h */
418 } MSG_SCSI_TASK_MGMT, MPI_POINTER PTR_SCSI_TASK_MGMT,
419   SCSITaskMgmt_t, MPI_POINTER pSCSITaskMgmt_t;
420
421 /* TaskType values */
422
423 #define MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK            (0x01)
424 #define MPI_SCSITASKMGMT_TASKTYPE_ABRT_TASK_SET         (0x02)
425 #define MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET          (0x03)
426 #define MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS             (0x04)
427 #define MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET    (0x05)
428 #define MPI_SCSITASKMGMT_TASKTYPE_CLEAR_TASK_SET        (0x06)
429 #define MPI_SCSITASKMGMT_TASKTYPE_QUERY_TASK            (0x07)
430
431 /* MsgFlags bits */
432 #define MPI_SCSITASKMGMT_MSGFLAGS_TARGET_RESET_OPTION   (0x00)
433 #define MPI_SCSITASKMGMT_MSGFLAGS_LIP_RESET_OPTION      (0x02)
434 #define MPI_SCSITASKMGMT_MSGFLAGS_LIPRESET_RESET_OPTION (0x04)
435
436 /* SCSI Task Management Reply */
437 typedef struct _MSG_SCSI_TASK_MGMT_REPLY
438 {
439     U8                      TargetID;           /* 00h */
440     U8                      Bus;                /* 01h */
441     U8                      MsgLength;          /* 02h */
442     U8                      Function;           /* 03h */
443     U8                      ResponseCode;       /* 04h */
444     U8                      TaskType;           /* 05h */
445     U8                      Reserved1;          /* 06h */
446     U8                      MsgFlags;           /* 07h */
447     U32                     MsgContext;         /* 08h */
448     U8                      Reserved2[2];       /* 0Ch */
449     U16                     IOCStatus;          /* 0Eh */
450     U32                     IOCLogInfo;         /* 10h */
451     U32                     TerminationCount;   /* 14h */
452 } MSG_SCSI_TASK_MGMT_REPLY, MPI_POINTER PTR_MSG_SCSI_TASK_MGMT_REPLY,
453   SCSITaskMgmtReply_t, MPI_POINTER pSCSITaskMgmtReply_t;
454
455 /* ResponseCode values */
456 #define MPI_SCSITASKMGMT_RSP_TM_COMPLETE                (0x00)
457 #define MPI_SCSITASKMGMT_RSP_INVALID_FRAME              (0x02)
458 #define MPI_SCSITASKMGMT_RSP_TM_NOT_SUPPORTED           (0x04)
459 #define MPI_SCSITASKMGMT_RSP_TM_FAILED                  (0x05)
460 #define MPI_SCSITASKMGMT_RSP_TM_SUCCEEDED               (0x08)
461 #define MPI_SCSITASKMGMT_RSP_TM_INVALID_LUN             (0x09)
462 #define MPI_SCSITASKMGMT_RSP_IO_QUEUED_ON_IOC           (0x80)
463
464
465 /****************************************************************************/
466 /*  SCSI Enclosure Processor messages                                       */
467 /****************************************************************************/
468
469 typedef struct _MSG_SEP_REQUEST
470 {
471     U8                      TargetID;           /* 00h */
472     U8                      Bus;                /* 01h */
473     U8                      ChainOffset;        /* 02h */
474     U8                      Function;           /* 03h */
475     U8                      Action;             /* 04h */
476     U8                      Flags;              /* 05h */
477     U8                      Reserved1;          /* 06h */
478     U8                      MsgFlags;           /* 07h */
479     U32                     MsgContext;         /* 08h */
480     U32                     SlotStatus;         /* 0Ch */
481     U32                     Reserved2;          /* 10h */
482     U32                     Reserved3;          /* 14h */
483     U32                     Reserved4;          /* 18h */
484     U16                     Slot;               /* 1Ch */
485     U16                     EnclosureHandle;    /* 1Eh */
486 } MSG_SEP_REQUEST, MPI_POINTER PTR_MSG_SEP_REQUEST,
487   SEPRequest_t, MPI_POINTER pSEPRequest_t;
488
489 /* Action defines */
490 #define MPI_SEP_REQ_ACTION_WRITE_STATUS                 (0x00)
491 #define MPI_SEP_REQ_ACTION_READ_STATUS                  (0x01)
492
493 /* Flags defines */
494 #define MPI_SEP_REQ_FLAGS_ENCLOSURE_SLOT_ADDRESS        (0x01)
495 #define MPI_SEP_REQ_FLAGS_BUS_TARGETID_ADDRESS          (0x00)
496
497 /* SlotStatus bits for MSG_SEP_REQUEST */
498 #define MPI_SEP_REQ_SLOTSTATUS_NO_ERROR                 (0x00000001)
499 #define MPI_SEP_REQ_SLOTSTATUS_DEV_FAULTY               (0x00000002)
500 #define MPI_SEP_REQ_SLOTSTATUS_DEV_REBUILDING           (0x00000004)
501 #define MPI_SEP_REQ_SLOTSTATUS_IN_FAILED_ARRAY          (0x00000008)
502 #define MPI_SEP_REQ_SLOTSTATUS_IN_CRITICAL_ARRAY        (0x00000010)
503 #define MPI_SEP_REQ_SLOTSTATUS_PARITY_CHECK             (0x00000020)
504 #define MPI_SEP_REQ_SLOTSTATUS_PREDICTED_FAULT          (0x00000040)
505 #define MPI_SEP_REQ_SLOTSTATUS_UNCONFIGURED             (0x00000080)
506 #define MPI_SEP_REQ_SLOTSTATUS_HOT_SPARE                (0x00000100)
507 #define MPI_SEP_REQ_SLOTSTATUS_REBUILD_STOPPED          (0x00000200)
508 #define MPI_SEP_REQ_SLOTSTATUS_REQ_CONSISTENCY_CHECK    (0x00001000)
509 #define MPI_SEP_REQ_SLOTSTATUS_DISABLE                  (0x00002000)
510 #define MPI_SEP_REQ_SLOTSTATUS_REQ_RESERVED_DEVICE      (0x00004000)
511 #define MPI_SEP_REQ_SLOTSTATUS_IDENTIFY_REQUEST         (0x00020000)
512 #define MPI_SEP_REQ_SLOTSTATUS_REQUEST_REMOVE           (0x00040000)
513 #define MPI_SEP_REQ_SLOTSTATUS_REQUEST_INSERT           (0x00080000)
514 #define MPI_SEP_REQ_SLOTSTATUS_DO_NOT_MOVE              (0x00400000)
515 #define MPI_SEP_REQ_SLOTSTATUS_ACTIVE                   (0x00800000)
516 #define MPI_SEP_REQ_SLOTSTATUS_B_ENABLE_BYPASS          (0x04000000)
517 #define MPI_SEP_REQ_SLOTSTATUS_A_ENABLE_BYPASS          (0x08000000)
518 #define MPI_SEP_REQ_SLOTSTATUS_DEV_OFF                  (0x10000000)
519 #define MPI_SEP_REQ_SLOTSTATUS_SWAP_RESET               (0x80000000)
520
521
522 typedef struct _MSG_SEP_REPLY
523 {
524     U8                      TargetID;           /* 00h */
525     U8                      Bus;                /* 01h */
526     U8                      MsgLength;          /* 02h */
527     U8                      Function;           /* 03h */
528     U8                      Action;             /* 04h */
529     U8                      Reserved1;          /* 05h */
530     U8                      Reserved2;          /* 06h */
531     U8                      MsgFlags;           /* 07h */
532     U32                     MsgContext;         /* 08h */
533     U16                     Reserved3;          /* 0Ch */
534     U16                     IOCStatus;          /* 0Eh */
535     U32                     IOCLogInfo;         /* 10h */
536     U32                     SlotStatus;         /* 14h */
537     U32                     Reserved4;          /* 18h */
538     U16                     Slot;               /* 1Ch */
539     U16                     EnclosureHandle;    /* 1Eh */
540 } MSG_SEP_REPLY, MPI_POINTER PTR_MSG_SEP_REPLY,
541   SEPReply_t, MPI_POINTER pSEPReply_t;
542
543 /* SlotStatus bits for MSG_SEP_REPLY */
544 #define MPI_SEP_REPLY_SLOTSTATUS_NO_ERROR               (0x00000001)
545 #define MPI_SEP_REPLY_SLOTSTATUS_DEV_FAULTY             (0x00000002)
546 #define MPI_SEP_REPLY_SLOTSTATUS_DEV_REBUILDING         (0x00000004)
547 #define MPI_SEP_REPLY_SLOTSTATUS_IN_FAILED_ARRAY        (0x00000008)
548 #define MPI_SEP_REPLY_SLOTSTATUS_IN_CRITICAL_ARRAY      (0x00000010)
549 #define MPI_SEP_REPLY_SLOTSTATUS_PARITY_CHECK           (0x00000020)
550 #define MPI_SEP_REPLY_SLOTSTATUS_PREDICTED_FAULT        (0x00000040)
551 #define MPI_SEP_REPLY_SLOTSTATUS_UNCONFIGURED           (0x00000080)
552 #define MPI_SEP_REPLY_SLOTSTATUS_HOT_SPARE              (0x00000100)
553 #define MPI_SEP_REPLY_SLOTSTATUS_REBUILD_STOPPED        (0x00000200)
554 #define MPI_SEP_REPLY_SLOTSTATUS_CONSISTENCY_CHECK      (0x00001000)
555 #define MPI_SEP_REPLY_SLOTSTATUS_DISABLE                (0x00002000)
556 #define MPI_SEP_REPLY_SLOTSTATUS_RESERVED_DEVICE        (0x00004000)
557 #define MPI_SEP_REPLY_SLOTSTATUS_REPORT                 (0x00010000)
558 #define MPI_SEP_REPLY_SLOTSTATUS_IDENTIFY_REQUEST       (0x00020000)
559 #define MPI_SEP_REPLY_SLOTSTATUS_REMOVE_READY           (0x00040000)
560 #define MPI_SEP_REPLY_SLOTSTATUS_INSERT_READY           (0x00080000)
561 #define MPI_SEP_REPLY_SLOTSTATUS_DO_NOT_REMOVE          (0x00400000)
562 #define MPI_SEP_REPLY_SLOTSTATUS_ACTIVE                 (0x00800000)
563 #define MPI_SEP_REPLY_SLOTSTATUS_B_BYPASS_ENABLED       (0x01000000)
564 #define MPI_SEP_REPLY_SLOTSTATUS_A_BYPASS_ENABLED       (0x02000000)
565 #define MPI_SEP_REPLY_SLOTSTATUS_B_ENABLE_BYPASS        (0x04000000)
566 #define MPI_SEP_REPLY_SLOTSTATUS_A_ENABLE_BYPASS        (0x08000000)
567 #define MPI_SEP_REPLY_SLOTSTATUS_DEV_OFF                (0x10000000)
568 #define MPI_SEP_REPLY_SLOTSTATUS_FAULT_SENSED           (0x40000000)
569 #define MPI_SEP_REPLY_SLOTSTATUS_SWAPPED                (0x80000000)
570
571 #endif