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