2 * Copyright (c) 2000-2005 LSI Logic Corporation.
6 * Title: MPI initiator mode messages and structures
7 * Creation Date: June 8, 2000
9 * mpi_init.h Version: 01.05.04
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
29 * 09-28-01 01.02.03 Added structures and defines for SCSI Enclosure
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
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
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
51 * --------------------------------------------------------------------------
58 /*****************************************************************************
60 * S C S I I n i t i a t o r M e s s a g e s
62 *****************************************************************************/
64 /****************************************************************************/
65 /* SCSI IO messages and associated structures */
66 /****************************************************************************/
68 typedef struct _MSG_SCSI_IO_REQUEST
70 U8 TargetID; /* 00h */
72 U8 ChainOffset; /* 02h */
73 U8 Function; /* 03h */
74 U8 CDBLength; /* 04h */
75 U8 SenseBufferLength; /* 05h */
76 U8 Reserved; /* 06h */
77 U8 MsgFlags; /* 07h */
78 U32 MsgContext; /* 08h */
80 U32 Control; /* 14h */
82 U32 DataLength; /* 28h */
83 U32 SenseBufferLowAddr; /* 2Ch */
84 SGE_IO_UNION SGL; /* 30h */
85 } MSG_SCSI_IO_REQUEST, MPI_POINTER PTR_MSG_SCSI_IO_REQUEST,
86 SCSIIORequest_t, MPI_POINTER pSCSIIORequest_t;
89 /* SCSI IO MsgFlags bits */
91 #define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH (0x01)
92 #define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_32 (0x00)
93 #define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_64 (0x01)
95 #define MPI_SCSIIO_MSGFLGS_SENSE_LOCATION (0x02)
96 #define MPI_SCSIIO_MSGFLGS_SENSE_LOC_HOST (0x00)
97 #define MPI_SCSIIO_MSGFLGS_SENSE_LOC_IOC (0x02)
99 #define MPI_SCSIIO_MSGFLGS_CMD_DETERMINES_DATA_DIR (0x04)
101 /* SCSI IO LUN fields */
103 #define MPI_SCSIIO_LUN_FIRST_LEVEL_ADDRESSING (0x0000FFFF)
104 #define MPI_SCSIIO_LUN_SECOND_LEVEL_ADDRESSING (0xFFFF0000)
105 #define MPI_SCSIIO_LUN_THIRD_LEVEL_ADDRESSING (0x0000FFFF)
106 #define MPI_SCSIIO_LUN_FOURTH_LEVEL_ADDRESSING (0xFFFF0000)
107 #define MPI_SCSIIO_LUN_LEVEL_1_WORD (0xFF00)
108 #define MPI_SCSIIO_LUN_LEVEL_1_DWORD (0x0000FF00)
110 /* SCSI IO Control bits */
112 #define MPI_SCSIIO_CONTROL_DATADIRECTION_MASK (0x03000000)
113 #define MPI_SCSIIO_CONTROL_NODATATRANSFER (0x00000000)
114 #define MPI_SCSIIO_CONTROL_WRITE (0x01000000)
115 #define MPI_SCSIIO_CONTROL_READ (0x02000000)
117 #define MPI_SCSIIO_CONTROL_ADDCDBLEN_MASK (0x3C000000)
118 #define MPI_SCSIIO_CONTROL_ADDCDBLEN_SHIFT (26)
120 #define MPI_SCSIIO_CONTROL_TASKATTRIBUTE_MASK (0x00000700)
121 #define MPI_SCSIIO_CONTROL_SIMPLEQ (0x00000000)
122 #define MPI_SCSIIO_CONTROL_HEADOFQ (0x00000100)
123 #define MPI_SCSIIO_CONTROL_ORDEREDQ (0x00000200)
124 #define MPI_SCSIIO_CONTROL_ACAQ (0x00000400)
125 #define MPI_SCSIIO_CONTROL_UNTAGGED (0x00000500)
126 #define MPI_SCSIIO_CONTROL_NO_DISCONNECT (0x00000700)
128 #define MPI_SCSIIO_CONTROL_TASKMANAGE_MASK (0x00FF0000)
129 #define MPI_SCSIIO_CONTROL_OBSOLETE (0x00800000)
130 #define MPI_SCSIIO_CONTROL_CLEAR_ACA_RSV (0x00400000)
131 #define MPI_SCSIIO_CONTROL_TARGET_RESET (0x00200000)
132 #define MPI_SCSIIO_CONTROL_LUN_RESET_RSV (0x00100000)
133 #define MPI_SCSIIO_CONTROL_RESERVED (0x00080000)
134 #define MPI_SCSIIO_CONTROL_CLR_TASK_SET_RSV (0x00040000)
135 #define MPI_SCSIIO_CONTROL_ABORT_TASK_SET (0x00020000)
136 #define MPI_SCSIIO_CONTROL_RESERVED2 (0x00010000)
139 /* SCSI IO reply structure */
140 typedef struct _MSG_SCSI_IO_REPLY
142 U8 TargetID; /* 00h */
144 U8 MsgLength; /* 02h */
145 U8 Function; /* 03h */
146 U8 CDBLength; /* 04h */
147 U8 SenseBufferLength; /* 05h */
148 U8 Reserved; /* 06h */
149 U8 MsgFlags; /* 07h */
150 U32 MsgContext; /* 08h */
151 U8 SCSIStatus; /* 0Ch */
152 U8 SCSIState; /* 0Dh */
153 U16 IOCStatus; /* 0Eh */
154 U32 IOCLogInfo; /* 10h */
155 U32 TransferCount; /* 14h */
156 U32 SenseCount; /* 18h */
157 U32 ResponseInfo; /* 1Ch */
158 U16 TaskTag; /* 20h */
159 U16 Reserved1; /* 22h */
160 } MSG_SCSI_IO_REPLY, MPI_POINTER PTR_MSG_SCSI_IO_REPLY,
161 SCSIIOReply_t, MPI_POINTER pSCSIIOReply_t;
164 /* SCSI IO Reply SCSIStatus values (SAM-2 status codes) */
166 #define MPI_SCSI_STATUS_SUCCESS (0x00)
167 #define MPI_SCSI_STATUS_CHECK_CONDITION (0x02)
168 #define MPI_SCSI_STATUS_CONDITION_MET (0x04)
169 #define MPI_SCSI_STATUS_BUSY (0x08)
170 #define MPI_SCSI_STATUS_INTERMEDIATE (0x10)
171 #define MPI_SCSI_STATUS_INTERMEDIATE_CONDMET (0x14)
172 #define MPI_SCSI_STATUS_RESERVATION_CONFLICT (0x18)
173 #define MPI_SCSI_STATUS_COMMAND_TERMINATED (0x22)
174 #define MPI_SCSI_STATUS_TASK_SET_FULL (0x28)
175 #define MPI_SCSI_STATUS_ACA_ACTIVE (0x30)
177 #define MPI_SCSI_STATUS_FCPEXT_DEVICE_LOGGED_OUT (0x80)
178 #define MPI_SCSI_STATUS_FCPEXT_NO_LINK (0x81)
179 #define MPI_SCSI_STATUS_FCPEXT_UNASSIGNED (0x82)
182 /* SCSI IO Reply SCSIState values */
184 #define MPI_SCSI_STATE_AUTOSENSE_VALID (0x01)
185 #define MPI_SCSI_STATE_AUTOSENSE_FAILED (0x02)
186 #define MPI_SCSI_STATE_NO_SCSI_STATUS (0x04)
187 #define MPI_SCSI_STATE_TERMINATED (0x08)
188 #define MPI_SCSI_STATE_RESPONSE_INFO_VALID (0x10)
189 #define MPI_SCSI_STATE_QUEUE_TAG_REJECTED (0x20)
191 /* SCSI IO Reply ResponseInfo values */
192 /* (FCP-1 RSP_CODE values and SPI-3 Packetized Failure codes) */
194 #define MPI_SCSI_RSP_INFO_FUNCTION_COMPLETE (0x00000000)
195 #define MPI_SCSI_RSP_INFO_FCP_BURST_LEN_ERROR (0x01000000)
196 #define MPI_SCSI_RSP_INFO_CMND_FIELDS_INVALID (0x02000000)
197 #define MPI_SCSI_RSP_INFO_FCP_DATA_RO_ERROR (0x03000000)
198 #define MPI_SCSI_RSP_INFO_TASK_MGMT_UNSUPPORTED (0x04000000)
199 #define MPI_SCSI_RSP_INFO_TASK_MGMT_FAILED (0x05000000)
200 #define MPI_SCSI_RSP_INFO_SPI_LQ_INVALID_TYPE (0x06000000)
202 #define MPI_SCSI_TASKTAG_UNKNOWN (0xFFFF)
205 /****************************************************************************/
206 /* SCSI Task Management messages */
207 /****************************************************************************/
209 typedef struct _MSG_SCSI_TASK_MGMT
211 U8 TargetID; /* 00h */
213 U8 ChainOffset; /* 02h */
214 U8 Function; /* 03h */
215 U8 Reserved; /* 04h */
216 U8 TaskType; /* 05h */
217 U8 Reserved1; /* 06h */
218 U8 MsgFlags; /* 07h */
219 U32 MsgContext; /* 08h */
221 U32 Reserved2[7]; /* 14h */
222 U32 TaskMsgContext; /* 30h */
223 } MSG_SCSI_TASK_MGMT, MPI_POINTER PTR_SCSI_TASK_MGMT,
224 SCSITaskMgmt_t, MPI_POINTER pSCSITaskMgmt_t;
226 /* TaskType values */
228 #define MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK (0x01)
229 #define MPI_SCSITASKMGMT_TASKTYPE_ABRT_TASK_SET (0x02)
230 #define MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET (0x03)
231 #define MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS (0x04)
232 #define MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET (0x05)
233 #define MPI_SCSITASKMGMT_TASKTYPE_CLEAR_TASK_SET (0x06)
234 #define MPI_SCSITASKMGMT_TASKTYPE_QUERY_TASK (0x07)
237 #define MPI_SCSITASKMGMT_MSGFLAGS_TARGET_RESET_OPTION (0x00)
238 #define MPI_SCSITASKMGMT_MSGFLAGS_LIP_RESET_OPTION (0x02)
239 #define MPI_SCSITASKMGMT_MSGFLAGS_LIPRESET_RESET_OPTION (0x04)
241 /* SCSI Task Management Reply */
242 typedef struct _MSG_SCSI_TASK_MGMT_REPLY
244 U8 TargetID; /* 00h */
246 U8 MsgLength; /* 02h */
247 U8 Function; /* 03h */
248 U8 ResponseCode; /* 04h */
249 U8 TaskType; /* 05h */
250 U8 Reserved1; /* 06h */
251 U8 MsgFlags; /* 07h */
252 U32 MsgContext; /* 08h */
253 U8 Reserved2[2]; /* 0Ch */
254 U16 IOCStatus; /* 0Eh */
255 U32 IOCLogInfo; /* 10h */
256 U32 TerminationCount; /* 14h */
257 } MSG_SCSI_TASK_MGMT_REPLY, MPI_POINTER PTR_MSG_SCSI_TASK_MGMT_REPLY,
258 SCSITaskMgmtReply_t, MPI_POINTER pSCSITaskMgmtReply_t;
260 /* ResponseCode values */
261 #define MPI_SCSITASKMGMT_RSP_TM_COMPLETE (0x00)
262 #define MPI_SCSITASKMGMT_RSP_INVALID_FRAME (0x02)
263 #define MPI_SCSITASKMGMT_RSP_TM_NOT_SUPPORTED (0x04)
264 #define MPI_SCSITASKMGMT_RSP_TM_FAILED (0x05)
265 #define MPI_SCSITASKMGMT_RSP_TM_SUCCEEDED (0x08)
266 #define MPI_SCSITASKMGMT_RSP_TM_INVALID_LUN (0x09)
267 #define MPI_SCSITASKMGMT_RSP_IO_QUEUED_ON_IOC (0x80)
270 /****************************************************************************/
271 /* SCSI Enclosure Processor messages */
272 /****************************************************************************/
274 typedef struct _MSG_SEP_REQUEST
276 U8 TargetID; /* 00h */
278 U8 ChainOffset; /* 02h */
279 U8 Function; /* 03h */
282 U8 Reserved1; /* 06h */
283 U8 MsgFlags; /* 07h */
284 U32 MsgContext; /* 08h */
285 U32 SlotStatus; /* 0Ch */
286 U32 Reserved2; /* 10h */
287 U32 Reserved3; /* 14h */
288 U32 Reserved4; /* 18h */
290 U16 EnclosureHandle; /* 1Eh */
291 } MSG_SEP_REQUEST, MPI_POINTER PTR_MSG_SEP_REQUEST,
292 SEPRequest_t, MPI_POINTER pSEPRequest_t;
295 #define MPI_SEP_REQ_ACTION_WRITE_STATUS (0x00)
296 #define MPI_SEP_REQ_ACTION_READ_STATUS (0x01)
299 #define MPI_SEP_REQ_FLAGS_ENCLOSURE_SLOT_ADDRESS (0x01)
300 #define MPI_SEP_REQ_FLAGS_BUS_TARGETID_ADDRESS (0x00)
302 /* SlotStatus bits for MSG_SEP_REQUEST */
303 #define MPI_SEP_REQ_SLOTSTATUS_NO_ERROR (0x00000001)
304 #define MPI_SEP_REQ_SLOTSTATUS_DEV_FAULTY (0x00000002)
305 #define MPI_SEP_REQ_SLOTSTATUS_DEV_REBUILDING (0x00000004)
306 #define MPI_SEP_REQ_SLOTSTATUS_IN_FAILED_ARRAY (0x00000008)
307 #define MPI_SEP_REQ_SLOTSTATUS_IN_CRITICAL_ARRAY (0x00000010)
308 #define MPI_SEP_REQ_SLOTSTATUS_PARITY_CHECK (0x00000020)
309 #define MPI_SEP_REQ_SLOTSTATUS_PREDICTED_FAULT (0x00000040)
310 #define MPI_SEP_REQ_SLOTSTATUS_UNCONFIGURED (0x00000080)
311 #define MPI_SEP_REQ_SLOTSTATUS_HOT_SPARE (0x00000100)
312 #define MPI_SEP_REQ_SLOTSTATUS_REBUILD_STOPPED (0x00000200)
313 #define MPI_SEP_REQ_SLOTSTATUS_IDENTIFY_REQUEST (0x00020000)
314 #define MPI_SEP_REQ_SLOTSTATUS_REQUEST_REMOVE (0x00040000)
315 #define MPI_SEP_REQ_SLOTSTATUS_REQUEST_INSERT (0x00080000)
316 #define MPI_SEP_REQ_SLOTSTATUS_DO_NOT_MOVE (0x00400000)
317 #define MPI_SEP_REQ_SLOTSTATUS_B_ENABLE_BYPASS (0x04000000)
318 #define MPI_SEP_REQ_SLOTSTATUS_A_ENABLE_BYPASS (0x08000000)
319 #define MPI_SEP_REQ_SLOTSTATUS_DEV_OFF (0x10000000)
320 #define MPI_SEP_REQ_SLOTSTATUS_SWAP_RESET (0x80000000)
323 typedef struct _MSG_SEP_REPLY
325 U8 TargetID; /* 00h */
327 U8 MsgLength; /* 02h */
328 U8 Function; /* 03h */
330 U8 Reserved1; /* 05h */
331 U8 Reserved2; /* 06h */
332 U8 MsgFlags; /* 07h */
333 U32 MsgContext; /* 08h */
334 U16 Reserved3; /* 0Ch */
335 U16 IOCStatus; /* 0Eh */
336 U32 IOCLogInfo; /* 10h */
337 U32 SlotStatus; /* 14h */
338 U32 Reserved4; /* 18h */
340 U16 EnclosureHandle; /* 1Eh */
341 } MSG_SEP_REPLY, MPI_POINTER PTR_MSG_SEP_REPLY,
342 SEPReply_t, MPI_POINTER pSEPReply_t;
344 /* SlotStatus bits for MSG_SEP_REPLY */
345 #define MPI_SEP_REPLY_SLOTSTATUS_NO_ERROR (0x00000001)
346 #define MPI_SEP_REPLY_SLOTSTATUS_DEV_FAULTY (0x00000002)
347 #define MPI_SEP_REPLY_SLOTSTATUS_DEV_REBUILDING (0x00000004)
348 #define MPI_SEP_REPLY_SLOTSTATUS_IN_FAILED_ARRAY (0x00000008)
349 #define MPI_SEP_REPLY_SLOTSTATUS_IN_CRITICAL_ARRAY (0x00000010)
350 #define MPI_SEP_REPLY_SLOTSTATUS_PARITY_CHECK (0x00000020)
351 #define MPI_SEP_REPLY_SLOTSTATUS_PREDICTED_FAULT (0x00000040)
352 #define MPI_SEP_REPLY_SLOTSTATUS_UNCONFIGURED (0x00000080)
353 #define MPI_SEP_REPLY_SLOTSTATUS_HOT_SPARE (0x00000100)
354 #define MPI_SEP_REPLY_SLOTSTATUS_REBUILD_STOPPED (0x00000200)
355 #define MPI_SEP_REPLY_SLOTSTATUS_REPORT (0x00010000)
356 #define MPI_SEP_REPLY_SLOTSTATUS_IDENTIFY_REQUEST (0x00020000)
357 #define MPI_SEP_REPLY_SLOTSTATUS_REMOVE_READY (0x00040000)
358 #define MPI_SEP_REPLY_SLOTSTATUS_INSERT_READY (0x00080000)
359 #define MPI_SEP_REPLY_SLOTSTATUS_DO_NOT_REMOVE (0x00400000)
360 #define MPI_SEP_REPLY_SLOTSTATUS_B_BYPASS_ENABLED (0x01000000)
361 #define MPI_SEP_REPLY_SLOTSTATUS_A_BYPASS_ENABLED (0x02000000)
362 #define MPI_SEP_REPLY_SLOTSTATUS_B_ENABLE_BYPASS (0x04000000)
363 #define MPI_SEP_REPLY_SLOTSTATUS_A_ENABLE_BYPASS (0x08000000)
364 #define MPI_SEP_REPLY_SLOTSTATUS_DEV_OFF (0x10000000)
365 #define MPI_SEP_REPLY_SLOTSTATUS_FAULT_SENSED (0x40000000)
366 #define MPI_SEP_REPLY_SLOTSTATUS_SWAPPED (0x80000000)