mpi_init.h revision 102595
1/* $FreeBSD: head/sys/dev/mpt/mpilib/mpi_init.h 102595 2002-08-30 02:34:19Z mjacob $ */ 2/* 3 * Copyright (c) 2000-2001 LSI Logic Corporation. 4 * 5 * 6 * Name: MPI_INIT.H 7 * Title: MPI initiator mode messages and structures 8 * Creation Date: June 8, 2000 9 * 10 * MPI Version: 01.02.04 11 * 12 * Version History 13 * --------------- 14 * 15 * Date Version Description 16 * -------- -------- ------------------------------------------------------ 17 * 05-08-00 00.10.01 Original release for 0.10 spec dated 4/26/2000. 18 * 05-24-00 00.10.02 Added SenseBufferLength to _MSG_SCSI_IO_REPLY. 19 * 06-06-00 01.00.01 Update version number for 1.0 release. 20 * 06-08-00 01.00.02 Added MPI_SCSI_RSP_INFO_ definitions. 21 * 11-02-00 01.01.01 Original release for post 1.0 work. 22 * 12-04-00 01.01.02 Added MPI_SCSIIO_CONTROL_NO_DISCONNECT. 23 * 02-20-01 01.01.03 Started using MPI_POINTER. 24 * 03-27-01 01.01.04 Added structure offset comments. 25 * 04-10-01 01.01.05 Added new MsgFlag for MSG_SCSI_TASK_MGMT. 26 * 08-08-01 01.02.01 Original release for v1.2 work. 27 * 08-29-01 01.02.02 Added MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET. 28 * Added MPI_SCSI_STATE_QUEUE_TAG_REJECTED for 29 * MSG_SCSI_IO_REPLY. 30 * 09-28-01 01.02.03 Added structures and defines for SCSI Enclosure 31 * Processor messages. 32 * 10-04-01 01.02.04 Added defines for SEP request Action field. 33 * -------------------------------------------------------------------------- 34 */ 35/* 36 * Copyright (c) 2002 by Matthew Jacob 37 * 38 * Redistribution and use in source and binary forms, with or without 39 * modification, are permitted provided that the following conditions 40 * are met: 41 * 1. Redistributions of source code must retain the original LSI Logic 42 * copyright notice at the beginning of the file and the above copyright 43 * notice immediately after it, both without modification, this list of 44 * conditions, and the following disclaimer and note. 45 * 2. The name of the author or LSI Logic may not be used to endorse or 46 * promote products derived from this software without specific prior 47 * written permission. 48 * 49 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND LSI LOGIC AND CONTRIBUTORS 50 *``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 51 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 52 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE 53 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 54 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 55 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 56 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 57 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 58 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 59 * POSSIBILITY OF SUCH DAMAGE. 60 * 61 * Note: this copyright information has been added with the express written 62 * consent of LSI Logic (available upon request) in order to clarify the 63 * original LSI Logic copyright in order to allow for unencumbered binary 64 * and source redistribution of the MPI API definitions. 65 */ 66 67#ifndef MPI_INIT_H 68#define MPI_INIT_H 69 70 71/***************************************************************************** 72* 73* S C S I I n i t i a t o r M e s s a g e s 74* 75*****************************************************************************/ 76 77/****************************************************************************/ 78/* SCSI IO messages and assocaited structures */ 79/****************************************************************************/ 80 81typedef struct _MSG_SCSI_IO_REQUEST 82{ 83 U8 TargetID; /* 00h */ 84 U8 Bus; /* 01h */ 85 U8 ChainOffset; /* 02h */ 86 U8 Function; /* 03h */ 87 U8 CDBLength; /* 04h */ 88 U8 SenseBufferLength; /* 05h */ 89 U8 Reserved; /* 06h */ 90 U8 MsgFlags; /* 07h */ 91 U32 MsgContext; /* 08h */ 92 U8 LUN[8]; /* 0Ch */ 93 U32 Control; /* 14h */ 94 U8 CDB[16]; /* 18h */ 95 U32 DataLength; /* 28h */ 96 U32 SenseBufferLowAddr; /* 2Ch */ 97 SGE_IO_UNION SGL; /* 30h */ 98} MSG_SCSI_IO_REQUEST, MPI_POINTER PTR_MSG_SCSI_IO_REQUEST, 99 SCSIIORequest_t, MPI_POINTER pSCSIIORequest_t; 100 101 102/* SCSIO MsgFlags bits */ 103 104#define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH (0x01) 105#define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_32 (0x00) 106#define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_64 (0x01) 107#define MPI_SCSIIO_MSGFLGS_SENSE_LOCATION (0x02) 108#define MPI_SCSIIO_MSGFLGS_SENSE_LOC_HOST (0x00) 109#define MPI_SCSIIO_MSGFLGS_SENSE_LOC_IOC (0x02) 110 111/* SCSIIO LUN fields */ 112 113#define MPI_SCSIIO_LUN_FIRST_LEVEL_ADDRESSING (0x0000FFFF) 114#define MPI_SCSIIO_LUN_SECOND_LEVEL_ADDRESSING (0xFFFF0000) 115#define MPI_SCSIIO_LUN_THIRD_LEVEL_ADDRESSING (0x0000FFFF) 116#define MPI_SCSIIO_LUN_FOURTH_LEVEL_ADDRESSING (0xFFFF0000) 117#define MPI_SCSIIO_LUN_LEVEL_1_WORD (0xFF00) 118#define MPI_SCSIIO_LUN_LEVEL_1_DWORD (0x0000FF00) 119 120/* SCSIO Control bits */ 121 122#define MPI_SCSIIO_CONTROL_DATADIRECTION_MASK (0x03000000) 123#define MPI_SCSIIO_CONTROL_NODATATRANSFER (0x00000000) 124#define MPI_SCSIIO_CONTROL_WRITE (0x01000000) 125#define MPI_SCSIIO_CONTROL_READ (0x02000000) 126 127#define MPI_SCSIIO_CONTROL_ADDCDBLEN_MASK (0x3C000000) 128#define MPI_SCSIIO_CONTROL_ADDCDBLEN_SHIFT (26) 129 130#define MPI_SCSIIO_CONTROL_TASKATTRIBUTE_MASK (0x00000700) 131#define MPI_SCSIIO_CONTROL_SIMPLEQ (0x00000000) 132#define MPI_SCSIIO_CONTROL_HEADOFQ (0x00000100) 133#define MPI_SCSIIO_CONTROL_ORDEREDQ (0x00000200) 134#define MPI_SCSIIO_CONTROL_ACAQ (0x00000400) 135#define MPI_SCSIIO_CONTROL_UNTAGGED (0x00000500) 136#define MPI_SCSIIO_CONTROL_NO_DISCONNECT (0x00000700) 137 138#define MPI_SCSIIO_CONTROL_TASKMANAGE_MASK (0x00FF0000) 139#define MPI_SCSIIO_CONTROL_OBSOLETE (0x00800000) 140#define MPI_SCSIIO_CONTROL_CLEAR_ACA_RSV (0x00400000) 141#define MPI_SCSIIO_CONTROL_TARGET_RESET (0x00200000) 142#define MPI_SCSIIO_CONTROL_LUN_RESET_RSV (0x00100000) 143#define MPI_SCSIIO_CONTROL_RESERVED (0x00080000) 144#define MPI_SCSIIO_CONTROL_CLR_TASK_SET_RSV (0x00040000) 145#define MPI_SCSIIO_CONTROL_ABORT_TASK_SET (0x00020000) 146#define MPI_SCSIIO_CONTROL_RESERVED2 (0x00010000) 147 148 149/* SCSIIO reply structure */ 150typedef struct _MSG_SCSI_IO_REPLY 151{ 152 U8 TargetID; /* 00h */ 153 U8 Bus; /* 01h */ 154 U8 MsgLength; /* 02h */ 155 U8 Function; /* 03h */ 156 U8 CDBLength; /* 04h */ 157 U8 SenseBufferLength; /* 05h */ 158 U8 Reserved; /* 06h */ 159 U8 MsgFlags; /* 07h */ 160 U32 MsgContext; /* 08h */ 161 U8 SCSIStatus; /* 0Ch */ 162 U8 SCSIState; /* 0Dh */ 163 U16 IOCStatus; /* 0Eh */ 164 U32 IOCLogInfo; /* 10h */ 165 U32 TransferCount; /* 14h */ 166 U32 SenseCount; /* 18h */ 167 U32 ResponseInfo; /* 1Ch */ 168} MSG_SCSI_IO_REPLY, MPI_POINTER PTR_MSG_SCSI_IO_REPLY, 169 SCSIIOReply_t, MPI_POINTER pSCSIIOReply_t; 170 171 172/* SCSIIO Reply SCSIStatus values (SAM-2 status codes) */ 173 174#define MPI_SCSI_STATUS_SUCCESS (0x00) 175#define MPI_SCSI_STATUS_CHECK_CONDITION (0x02) 176#define MPI_SCSI_STATUS_CONDITION_MET (0x04) 177#define MPI_SCSI_STATUS_BUSY (0x08) 178#define MPI_SCSI_STATUS_INTERMEDIATE (0x10) 179#define MPI_SCSI_STATUS_INTERMEDIATE_CONDMET (0x14) 180#define MPI_SCSI_STATUS_RESERVATION_CONFLICT (0x18) 181#define MPI_SCSI_STATUS_COMMAND_TERMINATED (0x22) 182#define MPI_SCSI_STATUS_TASK_SET_FULL (0x28) 183#define MPI_SCSI_STATUS_ACA_ACTIVE (0x30) 184 185 186/* SCSIIO 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/* SCSIIO 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 207/****************************************************************************/ 208/* SCSI Task Management messages */ 209/****************************************************************************/ 210 211typedef struct _MSG_SCSI_TASK_MGMT 212{ 213 U8 TargetID; /* 00h */ 214 U8 Bus; /* 01h */ 215 U8 ChainOffset; /* 02h */ 216 U8 Function; /* 03h */ 217 U8 Reserved; /* 04h */ 218 U8 TaskType; /* 05h */ 219 U8 Reserved1; /* 06h */ 220 U8 MsgFlags; /* 07h */ 221 U32 MsgContext; /* 08h */ 222 U8 LUN[8]; /* 0Ch */ 223 U32 Reserved2[7]; /* 14h */ 224 U32 TaskMsgContext; /* 30h */ 225} MSG_SCSI_TASK_MGMT, MPI_POINTER PTR_SCSI_TASK_MGMT, 226 SCSITaskMgmt_t, MPI_POINTER pSCSITaskMgmt_t; 227 228/* TaskType values */ 229 230#define MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK (0x01) 231#define MPI_SCSITASKMGMT_TASKTYPE_ABRT_TASK_SET (0x02) 232#define MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET (0x03) 233#define MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS (0x04) 234#define MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET (0x05) 235 236/* MsgFlags bits */ 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) 240 241/* SCSI Task Management Reply */ 242typedef struct _MSG_SCSI_TASK_MGMT_REPLY 243{ 244 U8 TargetID; /* 00h */ 245 U8 Bus; /* 01h */ 246 U8 MsgLength; /* 02h */ 247 U8 Function; /* 03h */ 248 U8 Reserved; /* 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; 259 260 261/****************************************************************************/ 262/* SCSI Enclosure Processor messages */ 263/****************************************************************************/ 264 265typedef struct _MSG_SEP_REQUEST 266{ 267 U8 TargetID; /* 00h */ 268 U8 Bus; /* 01h */ 269 U8 ChainOffset; /* 02h */ 270 U8 Function; /* 03h */ 271 U8 Action; /* 04h */ 272 U8 Reserved1; /* 05h */ 273 U8 Reserved2; /* 06h */ 274 U8 MsgFlags; /* 07h */ 275 U32 MsgContext; /* 08h */ 276 U32 SlotStatus; /* 0Ch */ 277} MSG_SEP_REQUEST, MPI_POINTER PTR_MSG_SEP_REQUEST, 278 SEPRequest_t, MPI_POINTER pSEPRequest_t; 279 280/* Action defines */ 281#define MPI_SEP_REQ_ACTION_WRITE_STATUS (0x00) 282#define MPI_SEP_REQ_ACTION_READ_STATUS (0x01) 283 284/* SlotStatus bits for MSG_SEP_REQUEST */ 285#define MPI_SEP_REQ_SLOTSTATUS_NO_ERROR (0x00000001) 286#define MPI_SEP_REQ_SLOTSTATUS_DEV_FAULTY (0x00000002) 287#define MPI_SEP_REQ_SLOTSTATUS_DEV_REBUILDING (0x00000004) 288#define MPI_SEP_REQ_SLOTSTATUS_IN_FAILED_ARRAY (0x00000008) 289#define MPI_SEP_REQ_SLOTSTATUS_IN_CRITICAL_ARRAY (0x00000010) 290#define MPI_SEP_REQ_SLOTSTATUS_PARITY_CHECK (0x00000020) 291#define MPI_SEP_REQ_SLOTSTATUS_PREDICTED_FAULT (0x00000040) 292#define MPI_SEP_REQ_SLOTSTATUS_UNCONFIGURED (0x00000080) 293#define MPI_SEP_REQ_SLOTSTATUS_HOT_SPARE (0x00000100) 294#define MPI_SEP_REQ_SLOTSTATUS_REBUILD_STOPPED (0x00000200) 295#define MPI_SEP_REQ_SLOTSTATUS_IDENTIFY_REQUEST (0x00020000) 296#define MPI_SEP_REQ_SLOTSTATUS_REQUEST_REMOVE (0x00040000) 297#define MPI_SEP_REQ_SLOTSTATUS_REQUEST_INSERT (0x00080000) 298#define MPI_SEP_REQ_SLOTSTATUS_DO_NOT_MOVE (0x00400000) 299#define MPI_SEP_REQ_SLOTSTATUS_B_ENABLE_BYPASS (0x04000000) 300#define MPI_SEP_REQ_SLOTSTATUS_A_ENABLE_BYPASS (0x08000000) 301#define MPI_SEP_REQ_SLOTSTATUS_DEV_OFF (0x10000000) 302#define MPI_SEP_REQ_SLOTSTATUS_SWAP_RESET (0x80000000) 303 304 305typedef struct _MSG_SEP_REPLY 306{ 307 U8 TargetID; /* 00h */ 308 U8 Bus; /* 01h */ 309 U8 MsgLength; /* 02h */ 310 U8 Function; /* 03h */ 311 U8 Action; /* 04h */ 312 U8 Reserved1; /* 05h */ 313 U8 Reserved2; /* 06h */ 314 U8 MsgFlags; /* 07h */ 315 U32 MsgContext; /* 08h */ 316 U16 Reserved3; /* 0Ch */ 317 U16 IOCStatus; /* 0Eh */ 318 U32 IOCLogInfo; /* 10h */ 319 U32 SlotStatus; /* 14h */ 320} MSG_SEP_REPLY, MPI_POINTER PTR_MSG_SEP_REPLY, 321 SEPReply_t, MPI_POINTER pSEPReply_t; 322 323/* SlotStatus bits for MSG_SEP_REPLY */ 324#define MPI_SEP_REPLY_SLOTSTATUS_NO_ERROR (0x00000001) 325#define MPI_SEP_REPLY_SLOTSTATUS_DEV_FAULTY (0x00000002) 326#define MPI_SEP_REPLY_SLOTSTATUS_DEV_REBUILDING (0x00000004) 327#define MPI_SEP_REPLY_SLOTSTATUS_IN_FAILED_ARRAY (0x00000008) 328#define MPI_SEP_REPLY_SLOTSTATUS_IN_CRITICAL_ARRAY (0x00000010) 329#define MPI_SEP_REPLY_SLOTSTATUS_PARITY_CHECK (0x00000020) 330#define MPI_SEP_REPLY_SLOTSTATUS_PREDICTED_FAULT (0x00000040) 331#define MPI_SEP_REPLY_SLOTSTATUS_UNCONFIGURED (0x00000080) 332#define MPI_SEP_REPLY_SLOTSTATUS_HOT_SPARE (0x00000100) 333#define MPI_SEP_REPLY_SLOTSTATUS_REBUILD_STOPPED (0x00000200) 334#define MPI_SEP_REPLY_SLOTSTATUS_REPORT (0x00010000) 335#define MPI_SEP_REPLY_SLOTSTATUS_IDENTIFY_REQUEST (0x00020000) 336#define MPI_SEP_REPLY_SLOTSTATUS_REMOVE_READY (0x00040000) 337#define MPI_SEP_REPLY_SLOTSTATUS_INSERT_READY (0x00080000) 338#define MPI_SEP_REPLY_SLOTSTATUS_DO_NOT_REMOVE (0x00400000) 339#define MPI_SEP_REPLY_SLOTSTATUS_B_BYPASS_ENABLED (0x01000000) 340#define MPI_SEP_REPLY_SLOTSTATUS_A_BYPASS_ENABLED (0x02000000) 341#define MPI_SEP_REPLY_SLOTSTATUS_B_ENABLE_BYPASS (0x04000000) 342#define MPI_SEP_REPLY_SLOTSTATUS_A_ENABLE_BYPASS (0x08000000) 343#define MPI_SEP_REPLY_SLOTSTATUS_DEV_OFF (0x10000000) 344#define MPI_SEP_REPLY_SLOTSTATUS_FAULT_SENSED (0x40000000) 345#define MPI_SEP_REPLY_SLOTSTATUS_SWAPPED (0x80000000) 346 347#endif 348