mpi_targ.h (139749) | mpi_targ.h (147883) |
---|---|
1/* $FreeBSD: head/sys/dev/mpt/mpilib/mpi_targ.h 139749 2005-01-06 01:43:34Z imp $ */ | 1/* $FreeBSD: head/sys/dev/mpt/mpilib/mpi_targ.h 147883 2005-07-10 15:05:39Z scottl $ */ |
2/*- | 2/*- |
3 * Copyright (c) 2000, 2001 by LSI Logic Corporation 4 * | 3 * Copyright (c) 2000-2005, LSI Logic Corporation and its contributors. 4 * All rights reserved. 5 * |
5 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions 7 * are met: | 7 * modification, are permitted provided that the following conditions are 8 * met: |
8 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
9 * notice immediately at the beginning of the file, without modification, 10 * this list of conditions, and the following disclaimer. 11 * 2. The name of the author may not be used to endorse or promote products 12 * derived from this software without specific prior written permission. 13 * 14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 10 * notice, this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce at minimum a disclaimer 12 * substantially similar to the "NO WARRANTY" disclaimer below 13 * ("Disclaimer") and any redistribution must be conditioned upon including 14 * a substantially similar Disclaimer requirement for further binary 15 * redistribution. 16 * 3. Neither the name of the LSI Logic Corporation nor the names of its 17 * contributors may be used to endorse or promote products derived from 18 * this software without specific prior written permission. 19 * 20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 18 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. | 23 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 24 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF THE COPYRIGHT 30 * OWNER OR CONTRIBUTOR IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
25 * 26 * 27 * Name: MPI_TARG.H 28 * Title: MPI Target mode messages and structures 29 * Creation Date: June 22, 2000 30 * | 31 * 32 * 33 * Name: MPI_TARG.H 34 * Title: MPI Target mode messages and structures 35 * Creation Date: June 22, 2000 36 * |
31 * MPI Version: 01.02.04 | 37 * MPI_TARG.H Version: 01.02.09 |
32 * 33 * Version History 34 * --------------- 35 * 36 * Date Version Description 37 * -------- -------- ------------------------------------------------------ 38 * 05-08-00 00.10.01 Original release for 0.10 spec dated 4/26/2000. 39 * 06-06-00 01.00.01 Update version number for 1.0 release. --- 11 unchanged lines hidden (view full) --- 51 * 08-08-01 01.02.01 Original release for v1.2 work. 52 * 09-28-01 01.02.02 Added structure for MPI_TARGET_SCSI_SPI_STATUS_IU. 53 * Added PriorityReason field to some replies and 54 * defined more PriorityReason codes. 55 * Added some defines for to support previous version 56 * of MPI. 57 * 10-04-01 01.02.03 Added PriorityReason to MSG_TARGET_ERROR_REPLY. 58 * 11-01-01 01.02.04 Added define for TARGET_STATUS_SEND_FLAGS_HIGH_PRIORITY. | 38 * 39 * Version History 40 * --------------- 41 * 42 * Date Version Description 43 * -------- -------- ------------------------------------------------------ 44 * 05-08-00 00.10.01 Original release for 0.10 spec dated 4/26/2000. 45 * 06-06-00 01.00.01 Update version number for 1.0 release. --- 11 unchanged lines hidden (view full) --- 57 * 08-08-01 01.02.01 Original release for v1.2 work. 58 * 09-28-01 01.02.02 Added structure for MPI_TARGET_SCSI_SPI_STATUS_IU. 59 * Added PriorityReason field to some replies and 60 * defined more PriorityReason codes. 61 * Added some defines for to support previous version 62 * of MPI. 63 * 10-04-01 01.02.03 Added PriorityReason to MSG_TARGET_ERROR_REPLY. 64 * 11-01-01 01.02.04 Added define for TARGET_STATUS_SEND_FLAGS_HIGH_PRIORITY. |
65 * 03-14-02 01.02.05 Modified MPI_TARGET_FCP_RSP_BUFFER to get the proper 66 * byte ordering. 67 * 05-31-02 01.02.06 Modified TARGET_MODE_REPLY_ALIAS_MASK to only include 68 * one bit. 69 * Added AliasIndex field to MPI_TARGET_FCP_CMD_BUFFER. 70 * 09-16-02 01.02.07 Added flags for confirmed completion. 71 * Added PRIORITY_REASON_TARGET_BUSY. 72 * 11-15-02 01.02.08 Added AliasID field to MPI_TARGET_SCSI_SPI_CMD_BUFFER. 73 * 04-01-03 01.02.09 Added OptionalOxid field to MPI_TARGET_FCP_CMD_BUFFER. |
|
59 * -------------------------------------------------------------------------- 60 */ 61 62#ifndef MPI_TARG_H 63#define MPI_TARG_H 64 65 66/****************************************************************************** --- 5 unchanged lines hidden (view full) --- 72typedef struct _CMD_BUFFER_DESCRIPTOR 73{ 74 U16 IoIndex; /* 00h */ 75 U16 Reserved; /* 02h */ 76 union /* 04h */ 77 { 78 U32 PhysicalAddress32; 79 U64 PhysicalAddress64; | 74 * -------------------------------------------------------------------------- 75 */ 76 77#ifndef MPI_TARG_H 78#define MPI_TARG_H 79 80 81/****************************************************************************** --- 5 unchanged lines hidden (view full) --- 87typedef struct _CMD_BUFFER_DESCRIPTOR 88{ 89 U16 IoIndex; /* 00h */ 90 U16 Reserved; /* 02h */ 91 union /* 04h */ 92 { 93 U32 PhysicalAddress32; 94 U64 PhysicalAddress64; |
80 } _u; | 95 } u; |
81} CMD_BUFFER_DESCRIPTOR, MPI_POINTER PTR_CMD_BUFFER_DESCRIPTOR, 82 CmdBufferDescriptor_t, MPI_POINTER pCmdBufferDescriptor_t; 83 84 85/****************************************************************************/ 86/* Target Command Buffer Post Request */ 87/****************************************************************************/ 88 --- 61 unchanged lines hidden (view full) --- 150#define PRIORITY_REASON_SCSI_TASK_MANAGEMENT (0x01) 151#define PRIORITY_REASON_CMD_PARITY_ERR (0x02) 152#define PRIORITY_REASON_MSG_OUT_PARITY_ERR (0x03) 153#define PRIORITY_REASON_LQ_CRC_ERR (0x04) 154#define PRIORITY_REASON_CMD_CRC_ERR (0x05) 155#define PRIORITY_REASON_PROTOCOL_ERR (0x06) 156#define PRIORITY_REASON_DATA_OUT_PARITY_ERR (0x07) 157#define PRIORITY_REASON_DATA_OUT_CRC_ERR (0x08) | 96} CMD_BUFFER_DESCRIPTOR, MPI_POINTER PTR_CMD_BUFFER_DESCRIPTOR, 97 CmdBufferDescriptor_t, MPI_POINTER pCmdBufferDescriptor_t; 98 99 100/****************************************************************************/ 101/* Target Command Buffer Post Request */ 102/****************************************************************************/ 103 --- 61 unchanged lines hidden (view full) --- 165#define PRIORITY_REASON_SCSI_TASK_MANAGEMENT (0x01) 166#define PRIORITY_REASON_CMD_PARITY_ERR (0x02) 167#define PRIORITY_REASON_MSG_OUT_PARITY_ERR (0x03) 168#define PRIORITY_REASON_LQ_CRC_ERR (0x04) 169#define PRIORITY_REASON_CMD_CRC_ERR (0x05) 170#define PRIORITY_REASON_PROTOCOL_ERR (0x06) 171#define PRIORITY_REASON_DATA_OUT_PARITY_ERR (0x07) 172#define PRIORITY_REASON_DATA_OUT_CRC_ERR (0x08) |
173#define PRIORITY_REASON_TARGET_BUSY (0x09) |
|
158#define PRIORITY_REASON_UNKNOWN (0xFF) 159 160 161typedef struct _MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY 162{ 163 U16 Reserved; /* 00h */ 164 U8 MsgLength; /* 02h */ 165 U8 Function; /* 03h */ --- 12 unchanged lines hidden (view full) --- 178 179 180typedef struct _MPI_TARGET_FCP_CMD_BUFFER 181{ 182 U8 FcpLun[8]; /* 00h */ 183 U8 FcpCntl[4]; /* 08h */ 184 U8 FcpCdb[16]; /* 0Ch */ 185 U32 FcpDl; /* 1Ch */ | 174#define PRIORITY_REASON_UNKNOWN (0xFF) 175 176 177typedef struct _MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY 178{ 179 U16 Reserved; /* 00h */ 180 U8 MsgLength; /* 02h */ 181 U8 Function; /* 03h */ --- 12 unchanged lines hidden (view full) --- 194 195 196typedef struct _MPI_TARGET_FCP_CMD_BUFFER 197{ 198 U8 FcpLun[8]; /* 00h */ 199 U8 FcpCntl[4]; /* 08h */ 200 U8 FcpCdb[16]; /* 0Ch */ 201 U32 FcpDl; /* 1Ch */ |
202 U8 AliasIndex; /* 20h */ 203 U8 Reserved1; /* 21h */ 204 U16 OptionalOxid; /* 22h */ |
|
186} MPI_TARGET_FCP_CMD_BUFFER, MPI_POINTER PTR_MPI_TARGET_FCP_CMD_BUFFER, 187 MpiTargetFcpCmdBuffer, MPI_POINTER pMpiTargetFcpCmdBuffer; 188 189 190typedef struct _MPI_TARGET_SCSI_SPI_CMD_BUFFER 191{ 192 /* SPI L_Q information unit */ 193 U8 L_QType; /* 00h */ 194 U8 Reserved; /* 01h */ 195 U16 Tag; /* 02h */ 196 U8 LogicalUnitNumber[8]; /* 04h */ 197 U32 DataLength; /* 0Ch */ 198 /* SPI command information unit */ 199 U8 ReservedFirstByteOfCommandIU; /* 10h */ 200 U8 TaskAttribute; /* 11h */ 201 U8 TaskManagementFlags; /* 12h */ 202 U8 AdditionalCDBLength; /* 13h */ 203 U8 CDB[16]; /* 14h */ | 205} MPI_TARGET_FCP_CMD_BUFFER, MPI_POINTER PTR_MPI_TARGET_FCP_CMD_BUFFER, 206 MpiTargetFcpCmdBuffer, MPI_POINTER pMpiTargetFcpCmdBuffer; 207 208 209typedef struct _MPI_TARGET_SCSI_SPI_CMD_BUFFER 210{ 211 /* SPI L_Q information unit */ 212 U8 L_QType; /* 00h */ 213 U8 Reserved; /* 01h */ 214 U16 Tag; /* 02h */ 215 U8 LogicalUnitNumber[8]; /* 04h */ 216 U32 DataLength; /* 0Ch */ 217 /* SPI command information unit */ 218 U8 ReservedFirstByteOfCommandIU; /* 10h */ 219 U8 TaskAttribute; /* 11h */ 220 U8 TaskManagementFlags; /* 12h */ 221 U8 AdditionalCDBLength; /* 13h */ 222 U8 CDB[16]; /* 14h */ |
223 /* Alias ID */ 224 U8 AliasID; /* 24h */ 225 U8 Reserved1; /* 25h */ 226 U16 Reserved2; /* 26h */ |
|
204} MPI_TARGET_SCSI_SPI_CMD_BUFFER, 205 MPI_POINTER PTR_MPI_TARGET_SCSI_SPI_CMD_BUFFER, 206 MpiTargetScsiSpiCmdBuffer, MPI_POINTER pMpiTargetScsiSpiCmdBuffer; 207 208 209/****************************************************************************/ 210/* Target Assist Request */ 211/****************************************************************************/ --- 14 unchanged lines hidden (view full) --- 226 U32 DataLength; /* 1Ch */ 227 SGE_IO_UNION SGL[1]; /* 20h */ 228} MSG_TARGET_ASSIST_REQUEST, MPI_POINTER PTR_MSG_TARGET_ASSIST_REQUEST, 229 TargetAssistRequest_t, MPI_POINTER pTargetAssistRequest_t; 230 231#define TARGET_ASSIST_FLAGS_DATA_DIRECTION (0x01) 232#define TARGET_ASSIST_FLAGS_AUTO_STATUS (0x02) 233#define TARGET_ASSIST_FLAGS_HIGH_PRIORITY (0x04) | 227} MPI_TARGET_SCSI_SPI_CMD_BUFFER, 228 MPI_POINTER PTR_MPI_TARGET_SCSI_SPI_CMD_BUFFER, 229 MpiTargetScsiSpiCmdBuffer, MPI_POINTER pMpiTargetScsiSpiCmdBuffer; 230 231 232/****************************************************************************/ 233/* Target Assist Request */ 234/****************************************************************************/ --- 14 unchanged lines hidden (view full) --- 249 U32 DataLength; /* 1Ch */ 250 SGE_IO_UNION SGL[1]; /* 20h */ 251} MSG_TARGET_ASSIST_REQUEST, MPI_POINTER PTR_MSG_TARGET_ASSIST_REQUEST, 252 TargetAssistRequest_t, MPI_POINTER pTargetAssistRequest_t; 253 254#define TARGET_ASSIST_FLAGS_DATA_DIRECTION (0x01) 255#define TARGET_ASSIST_FLAGS_AUTO_STATUS (0x02) 256#define TARGET_ASSIST_FLAGS_HIGH_PRIORITY (0x04) |
257#define TARGET_ASSIST_FLAGS_CONFIRMED (0x08) |
|
234#define TARGET_ASSIST_FLAGS_REPOST_CMD_BUFFER (0x80) 235 236 237typedef struct _MSG_TARGET_ERROR_REPLY 238{ 239 U16 Reserved; /* 00h */ 240 U8 MsgLength; /* 02h */ 241 U8 Function; /* 03h */ --- 28 unchanged lines hidden (view full) --- 270 U32 ReplyWord; /* 0Ch */ 271 U8 LUN[8]; /* 10h */ 272 SGE_SIMPLE_UNION StatusDataSGE; /* 18h */ 273} MSG_TARGET_STATUS_SEND_REQUEST, MPI_POINTER PTR_MSG_TARGET_STATUS_SEND_REQUEST, 274 TargetStatusSendRequest_t, MPI_POINTER pTargetStatusSendRequest_t; 275 276#define TARGET_STATUS_SEND_FLAGS_AUTO_GOOD_STATUS (0x01) 277#define TARGET_STATUS_SEND_FLAGS_HIGH_PRIORITY (0x04) | 258#define TARGET_ASSIST_FLAGS_REPOST_CMD_BUFFER (0x80) 259 260 261typedef struct _MSG_TARGET_ERROR_REPLY 262{ 263 U16 Reserved; /* 00h */ 264 U8 MsgLength; /* 02h */ 265 U8 Function; /* 03h */ --- 28 unchanged lines hidden (view full) --- 294 U32 ReplyWord; /* 0Ch */ 295 U8 LUN[8]; /* 10h */ 296 SGE_SIMPLE_UNION StatusDataSGE; /* 18h */ 297} MSG_TARGET_STATUS_SEND_REQUEST, MPI_POINTER PTR_MSG_TARGET_STATUS_SEND_REQUEST, 298 TargetStatusSendRequest_t, MPI_POINTER pTargetStatusSendRequest_t; 299 300#define TARGET_STATUS_SEND_FLAGS_AUTO_GOOD_STATUS (0x01) 301#define TARGET_STATUS_SEND_FLAGS_HIGH_PRIORITY (0x04) |
302#define TARGET_STATUS_SEND_FLAGS_CONFIRMED (0x08) |
|
278#define TARGET_STATUS_SEND_FLAGS_REPOST_CMD_BUFFER (0x80) 279 | 303#define TARGET_STATUS_SEND_FLAGS_REPOST_CMD_BUFFER (0x80) 304 |
305/* 306 * NOTE: FCP_RSP data is big-endian. When used on a little-endian system, this 307 * structure properly orders the bytes. 308 */ |
|
280typedef struct _MPI_TARGET_FCP_RSP_BUFFER 281{ 282 U8 Reserved0[8]; /* 00h */ | 309typedef struct _MPI_TARGET_FCP_RSP_BUFFER 310{ 311 U8 Reserved0[8]; /* 00h */ |
283 U8 FcpStatus; /* 08h */ 284 U8 FcpFlags; /* 09h */ 285 U8 Reserved1[2]; /* 0Ah */ | 312 U8 Reserved1[2]; /* 08h */ 313 U8 FcpFlags; /* 0Ah */ 314 U8 FcpStatus; /* 0Bh */ |
286 U32 FcpResid; /* 0Ch */ 287 U32 FcpSenseLength; /* 10h */ 288 U32 FcpResponseLength; /* 14h */ 289 U8 FcpResponseData[8]; /* 18h */ 290 U8 FcpSenseData[32]; /* Pad to 64 bytes */ /* 20h */ 291} MPI_TARGET_FCP_RSP_BUFFER, MPI_POINTER PTR_MPI_TARGET_FCP_RSP_BUFFER, 292 MpiTargetFcpRspBuffer, MPI_POINTER pMpiTargetFcpRspBuffer; 293 | 315 U32 FcpResid; /* 0Ch */ 316 U32 FcpSenseLength; /* 10h */ 317 U32 FcpResponseLength; /* 14h */ 318 U8 FcpResponseData[8]; /* 18h */ 319 U8 FcpSenseData[32]; /* Pad to 64 bytes */ /* 20h */ 320} MPI_TARGET_FCP_RSP_BUFFER, MPI_POINTER PTR_MPI_TARGET_FCP_RSP_BUFFER, 321 MpiTargetFcpRspBuffer, MPI_POINTER pMpiTargetFcpRspBuffer; 322 |
323/* 324 * NOTE: The SPI status IU is big-endian. When used on a little-endian system, 325 * this structure properly orders the bytes. 326 */ |
|
294typedef struct _MPI_TARGET_SCSI_SPI_STATUS_IU 295{ 296 U8 Reserved0; /* 00h */ 297 U8 Reserved1; /* 01h */ 298 U8 Valid; /* 02h */ 299 U8 Status; /* 03h */ 300 U32 SenseDataListLength; /* 04h */ 301 U32 PktFailuresListLength; /* 08h */ --- 47 unchanged lines hidden (view full) --- 349/****************************************************************************/ 350/* Target Mode Context Reply */ 351/****************************************************************************/ 352 353#define TARGET_MODE_REPLY_IO_INDEX_MASK (0x00003FFF) 354#define TARGET_MODE_REPLY_IO_INDEX_SHIFT (0) 355#define TARGET_MODE_REPLY_INITIATOR_INDEX_MASK (0x03FFC000) 356#define TARGET_MODE_REPLY_INITIATOR_INDEX_SHIFT (14) | 327typedef struct _MPI_TARGET_SCSI_SPI_STATUS_IU 328{ 329 U8 Reserved0; /* 00h */ 330 U8 Reserved1; /* 01h */ 331 U8 Valid; /* 02h */ 332 U8 Status; /* 03h */ 333 U32 SenseDataListLength; /* 04h */ 334 U32 PktFailuresListLength; /* 08h */ --- 47 unchanged lines hidden (view full) --- 382/****************************************************************************/ 383/* Target Mode Context Reply */ 384/****************************************************************************/ 385 386#define TARGET_MODE_REPLY_IO_INDEX_MASK (0x00003FFF) 387#define TARGET_MODE_REPLY_IO_INDEX_SHIFT (0) 388#define TARGET_MODE_REPLY_INITIATOR_INDEX_MASK (0x03FFC000) 389#define TARGET_MODE_REPLY_INITIATOR_INDEX_SHIFT (14) |
357#define TARGET_MODE_REPLY_ALIAS_MASK (0x0C000000) | 390#define TARGET_MODE_REPLY_ALIAS_MASK (0x04000000) |
358#define TARGET_MODE_REPLY_ALIAS_SHIFT (26) 359#define TARGET_MODE_REPLY_PORT_MASK (0x10000000) 360#define TARGET_MODE_REPLY_PORT_SHIFT (28) 361 362 363#define GET_IO_INDEX(x) (((x) & TARGET_MODE_REPLY_IO_INDEX_MASK) \ 364 >> TARGET_MODE_REPLY_IO_INDEX_SHIFT) 365 --- 65 unchanged lines hidden --- | 391#define TARGET_MODE_REPLY_ALIAS_SHIFT (26) 392#define TARGET_MODE_REPLY_PORT_MASK (0x10000000) 393#define TARGET_MODE_REPLY_PORT_SHIFT (28) 394 395 396#define GET_IO_INDEX(x) (((x) & TARGET_MODE_REPLY_IO_INDEX_MASK) \ 397 >> TARGET_MODE_REPLY_IO_INDEX_SHIFT) 398 --- 65 unchanged lines hidden --- |