1 /* $NetBSD: mpt_mpilib.h,v 1.7 2026/07/07 12:17:03 jdc Exp $ */ 2 3 /* 4 * Copyright (c) 2000, 2001 by LSI Logic Corporation 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice immediately at the beginning of the file, without modification, 11 * this list of conditions, and the following disclaimer. 12 * 2. The name of the author may not be used to endorse or promote products 13 * derived from this software without specific prior written permission. 14 * 15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 19 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * 27 * 28 * Name: MPI_TYPE.H 29 * Title: MPI Basic type definitions 30 * Creation Date: June 6, 2000 31 * 32 * MPI Version: 01.02.01 33 * 34 * Version History 35 * --------------- 36 * 37 * Date Version Description 38 * -------- -------- ------------------------------------------------------ 39 * 05-08-00 00.10.01 Original release for 0.10 spec dated 4/26/2000. 40 * 06-06-00 01.00.01 Update version number for 1.0 release. 41 * 11-02-00 01.01.01 Original release for post 1.0 work 42 * 02-20-01 01.01.02 Added define and ifdef for MPI_POINTER. 43 * 08-08-01 01.02.01 Original release for v1.2 work. 44 * -------------------------------------------------------------------------- 45 */ 46 47 #ifndef MPI_TYPE_H 48 #define MPI_TYPE_H 49 50 51 /******************************************************************************* 52 * Define MPI_POINTER if it hasn't already been defined. By default MPI_POINTER 53 * is defined to be a near pointer. MPI_POINTER can be defined as a far pointer 54 * by defining MPI_POINTER as "far *" before this header file is included. 55 */ 56 #ifndef MPI_POINTER 57 #define MPI_POINTER * 58 #endif 59 60 61 /***************************************************************************** 62 * 63 * B a s i c T y p e s 64 * 65 *****************************************************************************/ 66 67 #ifdef __NetBSD__ 68 typedef int8_t S8; 69 typedef uint8_t U8; 70 typedef int16_t S16; 71 typedef uint16_t U16; 72 typedef int32_t S32; 73 typedef uint32_t U32; 74 #else /* ! __NetBSD__ */ 75 typedef signed char S8; 76 typedef unsigned char U8; 77 typedef signed short S16; 78 typedef unsigned short U16; 79 80 #if defined(unix) || defined(__arm) || defined(ALPHA) || defined(__GNUC__) 81 82 typedef signed int S32; 83 typedef unsigned int U32; 84 85 #else 86 87 typedef signed long S32; 88 typedef unsigned long U32; 89 90 #endif 91 #endif /* __NetBSD__ */ 92 93 94 typedef struct _S64 95 { 96 U32 Low; 97 S32 High; 98 } S64; 99 100 typedef struct _U64 101 { 102 U32 Low; 103 U32 High; 104 } U64; 105 106 107 /****************************************************************************/ 108 /* Pointers */ 109 /****************************************************************************/ 110 111 typedef S8 *PS8; 112 typedef U8 *PU8; 113 typedef S16 *PS16; 114 typedef U16 *PU16; 115 typedef S32 *PS32; 116 typedef U32 *PU32; 117 typedef S64 *PS64; 118 typedef U64 *PU64; 119 120 121 #endif 122 123 124 /* 125 * Copyright (c) 2000, 2001 by LSI Logic Corporation 126 * 127 * Redistribution and use in source and binary forms, with or without 128 * modification, are permitted provided that the following conditions 129 * are met: 130 * 1. Redistributions of source code must retain the above copyright 131 * notice immediately at the beginning of the file, without modification, 132 * this list of conditions, and the following disclaimer. 133 * 2. The name of the author may not be used to endorse or promote products 134 * derived from this software without specific prior written permission. 135 * 136 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 137 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 138 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 139 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 140 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 141 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 142 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 143 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 144 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 145 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 146 * SUCH DAMAGE. 147 * 148 * 149 * Name: MPI.H 150 * Title: MPI Message independent structures and definitions 151 * Creation Date: July 27, 2000 152 * 153 * MPI Version: 01.02.03 154 * 155 * Version History 156 * --------------- 157 * 158 * Date Version Description 159 * -------- -------- ------------------------------------------------------ 160 * 05-08-00 00.10.01 Original release for 0.10 spec dated 4/26/2000. 161 * 05-24-00 00.10.02 Added MPI_IOCSTATUS_SCSI_RESIDUAL_MISMATCH definition. 162 * 06-06-00 01.00.01 Update MPI_VERSION_MAJOR and MPI_VERSION_MINOR. 163 * 06-22-00 01.00.02 Added MPI_IOCSTATUS_LAN_ definitions. 164 * Removed LAN_SUSPEND function definition. 165 * Added MPI_MSGFLAGS_CONTINUATION_REPLY definition. 166 * 06-30-00 01.00.03 Added MPI_CONTEXT_REPLY_TYPE_LAN definition. 167 * Added MPI_GET/SET_CONTEXT_REPLY_TYPE macros. 168 * 07-27-00 01.00.04 Added MPI_FAULT_ definitions. 169 * Removed MPI_IOCSTATUS_MSG/DATA_XFER_ERROR definitions. 170 * Added MPI_IOCSTATUS_INTERNAL_ERROR definition. 171 * Added MPI_IOCSTATUS_TARGET_XFER_COUNT_MISMATCH. 172 * 11-02-00 01.01.01 Original release for post 1.0 work. 173 * 12-04-00 01.01.02 Added new function codes. 174 * 01-09-01 01.01.03 Added more definitions to the system interface section 175 * Added MPI_IOCSTATUS_TARGET_STS_DATA_NOT_SENT. 176 * 01-25-01 01.01.04 Changed MPI_VERSION_MINOR from 0x00 to 0x01. 177 * 02-20-01 01.01.05 Started using MPI_POINTER. 178 * Fixed value for MPI_DIAG_RW_ENABLE. 179 * Added defines for MPI_DIAG_PREVENT_IOC_BOOT and 180 * MPI_DIAG_CLEAR_FLASH_BAD_SIG. 181 * Obsoleted MPI_IOCSTATUS_TARGET_FC_ defines. 182 * 02-27-01 01.01.06 Removed MPI_HOST_INDEX_REGISTER define. 183 * Added function codes for RAID. 184 * 04-09-01 01.01.07 Added alternate define for MPI_DOORBELL_ACTIVE, 185 * MPI_DOORBELL_USED, to better match the spec. 186 * 08-08-01 01.02.01 Original release for v1.2 work. 187 * Changed MPI_VERSION_MINOR from 0x01 to 0x02. 188 * Added define MPI_FUNCTION_TOOLBOX. 189 * 09-28-01 01.02.02 New function code MPI_SCSI_ENCLOSURE_PROCESSOR. 190 * 11-01-01 01.02.03 Changed name to MPI_FUNCTION_SCSI_ENCLOSURE_PROCESSOR. 191 * -------------------------------------------------------------------------- 192 */ 193 194 #ifndef MPI_H 195 #define MPI_H 196 197 198 /***************************************************************************** 199 * 200 * M P I V e r s i o n D e f i n i t i o n s 201 * 202 *****************************************************************************/ 203 204 #define MPI_VERSION_MAJOR (0x01) 205 #define MPI_VERSION_MINOR (0x02) 206 #define MPI_VERSION ((MPI_VERSION_MAJOR << 8) | MPI_VERSION_MINOR) 207 208 /* Note: The major versions of 0xe0 through 0xff are reserved */ 209 210 /***************************************************************************** 211 * 212 * I O C S t a t e D e f i n i t i o n s 213 * 214 *****************************************************************************/ 215 216 #define MPI_IOC_STATE_RESET (0x00000000) 217 #define MPI_IOC_STATE_READY (0x10000000) 218 #define MPI_IOC_STATE_OPERATIONAL (0x20000000) 219 #define MPI_IOC_STATE_FAULT (0x40000000) 220 221 #define MPI_IOC_STATE_MASK (0xF0000000) 222 #define MPI_IOC_STATE_SHIFT (28) 223 224 /* Fault state codes (product independent range 0x8000-0xFFFF) */ 225 226 #define MPI_FAULT_REQUEST_MESSAGE_PCI_PARITY_ERROR (0x8111) 227 #define MPI_FAULT_REQUEST_MESSAGE_PCI_BUS_FAULT (0x8112) 228 #define MPI_FAULT_REPLY_MESSAGE_PCI_PARITY_ERROR (0x8113) 229 #define MPI_FAULT_REPLY_MESSAGE_PCI_BUS_FAULT (0x8114) 230 #define MPI_FAULT_DATA_SEND_PCI_PARITY_ERROR (0x8115) 231 #define MPI_FAULT_DATA_SEND_PCI_BUS_FAULT (0x8116) 232 #define MPI_FAULT_DATA_RECEIVE_PCI_PARITY_ERROR (0x8117) 233 #define MPI_FAULT_DATA_RECEIVE_PCI_BUS_FAULT (0x8118) 234 235 236 /***************************************************************************** 237 * 238 * P C I S y s t e m I n t e r f a c e R e g i s t e r s 239 * 240 *****************************************************************************/ 241 242 /* S y s t e m D o o r b e l l */ 243 #define MPI_DOORBELL_OFFSET (0x00000000) 244 #define MPI_DOORBELL_ACTIVE (0x08000000) /* DoorbellUsed */ 245 #define MPI_DOORBELL_USED (MPI_DOORBELL_ACTIVE) 246 #define MPI_DOORBELL_ACTIVE_SHIFT (27) 247 #define MPI_DOORBELL_WHO_INIT_MASK (0x07000000) 248 #define MPI_DOORBELL_WHO_INIT_SHIFT (24) 249 #define MPI_DOORBELL_FUNCTION_MASK (0xFF000000) 250 #define MPI_DOORBELL_FUNCTION_SHIFT (24) 251 #define MPI_DOORBELL_ADD_DWORDS_MASK (0x00FF0000) 252 #define MPI_DOORBELL_ADD_DWORDS_SHIFT (16) 253 #define MPI_DOORBELL_DATA_MASK (0x0000FFFF) 254 255 256 #define MPI_WRITE_SEQUENCE_OFFSET (0x00000004) 257 #define MPI_WRSEQ_KEY_VALUE_MASK (0x0000000F) 258 #define MPI_WRSEQ_1ST_KEY_VALUE (0x04) 259 #define MPI_WRSEQ_2ND_KEY_VALUE (0x0B) 260 #define MPI_WRSEQ_3RD_KEY_VALUE (0x02) 261 #define MPI_WRSEQ_4TH_KEY_VALUE (0x07) 262 #define MPI_WRSEQ_5TH_KEY_VALUE (0x0D) 263 264 #define MPI_DIAGNOSTIC_OFFSET (0x00000008) 265 #define MPI_DIAG_CLEAR_FLASH_BAD_SIG (0x00000400) 266 #define MPI_DIAG_PREVENT_IOC_BOOT (0x00000200) 267 #define MPI_DIAG_DRWE (0x00000080) 268 #define MPI_DIAG_FLASH_BAD_SIG (0x00000040) 269 #define MPI_DIAG_RESET_HISTORY (0x00000020) 270 #define MPI_DIAG_RW_ENABLE (0x00000010) 271 #define MPI_DIAG_RESET_ADAPTER (0x00000004) 272 #define MPI_DIAG_DISABLE_ARM (0x00000002) 273 #define MPI_DIAG_MEM_ENABLE (0x00000001) 274 275 #define MPI_TEST_BASE_ADDRESS_OFFSET (0x0000000C) 276 277 #define MPI_DIAG_RW_DATA_OFFSET (0x00000010) 278 279 #define MPI_DIAG_RW_ADDRESS_OFFSET (0x00000014) 280 281 #define MPI_HOST_INTERRUPT_STATUS_OFFSET (0x00000030) 282 #define MPI_HIS_IOP_DOORBELL_STATUS (0x80000000) 283 #define MPI_HIS_REPLY_MESSAGE_INTERRUPT (0x00000008) 284 #define MPI_HIS_DOORBELL_INTERRUPT (0x00000001) 285 286 #define MPI_HOST_INTERRUPT_MASK_OFFSET (0x00000034) 287 #define MPI_HIM_RIM (0x00000008) 288 #define MPI_HIM_DIM (0x00000001) 289 290 #define MPI_REQUEST_QUEUE_OFFSET (0x00000040) 291 #define MPI_REQUEST_POST_FIFO_OFFSET (0x00000040) 292 293 #define MPI_REPLY_QUEUE_OFFSET (0x00000044) 294 #define MPI_REPLY_POST_FIFO_OFFSET (0x00000044) 295 #define MPI_REPLY_FREE_FIFO_OFFSET (0x00000044) 296 297 298 299 /***************************************************************************** 300 * 301 * M e s s a g e F r a m e D e s c r i p t o r s 302 * 303 *****************************************************************************/ 304 305 #define MPI_REQ_MF_DESCRIPTOR_NB_MASK (0x00000003) 306 #define MPI_REQ_MF_DESCRIPTOR_F_BIT (0x00000004) 307 #define MPI_REQ_MF_DESCRIPTOR_ADDRESS_MASK (0xFFFFFFF8) 308 309 #define MPI_ADDRESS_REPLY_A_BIT (0x80000000) 310 #define MPI_ADDRESS_REPLY_ADDRESS_MASK (0x7FFFFFFF) 311 312 #define MPI_CONTEXT_REPLY_A_BIT (0x80000000) 313 #define MPI_CONTEXT_REPLY_TYPE_MASK (0x60000000) 314 #define MPI_CONTEXT_REPLY_TYPE_SCSI_INIT (0x00) 315 #define MPI_CONTEXT_REPLY_TYPE_SCSI_TARGET (0x01) 316 #define MPI_CONTEXT_REPLY_TYPE_LAN (0x02) 317 #define MPI_CONTEXT_REPLY_TYPE_SHIFT (29) 318 #define MPI_CONTEXT_REPLY_CONTEXT_MASK (0x1FFFFFFF) 319 320 321 /****************************************************************************/ 322 /* Context Reply macros */ 323 /****************************************************************************/ 324 325 #define MPI_GET_CONTEXT_REPLY_TYPE(x) (((x) & MPI_CONTEXT_REPLY_TYPE_MASK) \ 326 >> MPI_CONTEXT_REPLY_TYPE_SHIFT) 327 328 #define MPI_SET_CONTEXT_REPLY_TYPE(x, typ) \ 329 ((x) = ((x) & ~MPI_CONTEXT_REPLY_TYPE_MASK) | \ 330 (((typ) << MPI_CONTEXT_REPLY_TYPE_SHIFT) & \ 331 MPI_CONTEXT_REPLY_TYPE_MASK)) 332 333 334 /***************************************************************************** 335 * 336 * M e s s a g e F u n c t i o n s 337 * 0x80 -> 0x8F reserved for private message use per product 338 * 339 * 340 *****************************************************************************/ 341 342 #define MPI_FUNCTION_SCSI_IO_REQUEST (0x00) 343 #define MPI_FUNCTION_SCSI_TASK_MGMT (0x01) 344 #define MPI_FUNCTION_IOC_INIT (0x02) 345 #define MPI_FUNCTION_IOC_FACTS (0x03) 346 #define MPI_FUNCTION_CONFIG (0x04) 347 #define MPI_FUNCTION_PORT_FACTS (0x05) 348 #define MPI_FUNCTION_PORT_ENABLE (0x06) 349 #define MPI_FUNCTION_EVENT_NOTIFICATION (0x07) 350 #define MPI_FUNCTION_EVENT_ACK (0x08) 351 #define MPI_FUNCTION_FW_DOWNLOAD (0x09) 352 #define MPI_FUNCTION_TARGET_CMD_BUFFER_POST (0x0A) 353 #define MPI_FUNCTION_TARGET_ASSIST (0x0B) 354 #define MPI_FUNCTION_TARGET_STATUS_SEND (0x0C) 355 #define MPI_FUNCTION_TARGET_MODE_ABORT (0x0D) 356 #define MPI_FUNCTION_TARGET_FC_BUF_POST_LINK_SRVC (0x0E) /* obsolete name */ 357 #define MPI_FUNCTION_TARGET_FC_RSP_LINK_SRVC (0x0F) /* obsolete name */ 358 #define MPI_FUNCTION_TARGET_FC_EX_SEND_LINK_SRVC (0x10) /* obsolete name */ 359 #define MPI_FUNCTION_TARGET_FC_ABORT (0x11) /* obsolete name */ 360 #define MPI_FUNCTION_FC_LINK_SRVC_BUF_POST (0x0E) 361 #define MPI_FUNCTION_FC_LINK_SRVC_RSP (0x0F) 362 #define MPI_FUNCTION_FC_EX_LINK_SRVC_SEND (0x10) 363 #define MPI_FUNCTION_FC_ABORT (0x11) 364 #define MPI_FUNCTION_FW_UPLOAD (0x12) 365 #define MPI_FUNCTION_FC_COMMON_TRANSPORT_SEND (0x13) 366 #define MPI_FUNCTION_FC_PRIMITIVE_SEND (0x14) 367 368 #define MPI_FUNCTION_RAID_ACTION (0x15) 369 #define MPI_FUNCTION_RAID_SCSI_IO_PASSTHROUGH (0x16) 370 371 #define MPI_FUNCTION_TOOLBOX (0x17) 372 373 #define MPI_FUNCTION_SCSI_ENCLOSURE_PROCESSOR (0x18) 374 375 #define MPI_FUNCTION_LAN_SEND (0x20) 376 #define MPI_FUNCTION_LAN_RECEIVE (0x21) 377 #define MPI_FUNCTION_LAN_RESET (0x22) 378 379 #define MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET (0x40) 380 #define MPI_FUNCTION_IO_UNIT_RESET (0x41) 381 #define MPI_FUNCTION_HANDSHAKE (0x42) 382 #define MPI_FUNCTION_REPLY_FRAME_REMOVAL (0x43) 383 384 385 386 /***************************************************************************** 387 * 388 * S c a t t e r G a t h e r E l e m e n t s 389 * 390 *****************************************************************************/ 391 392 /****************************************************************************/ 393 /* Simple element structures */ 394 /****************************************************************************/ 395 396 typedef struct _SGE_SIMPLE32 397 { 398 U32 FlagsLength; 399 U32 Address; 400 } SGE_SIMPLE32, MPI_POINTER PTR_SGE_SIMPLE32, 401 SGESimple32_t, MPI_POINTER pSGESimple32_t; 402 403 typedef struct _SGE_SIMPLE64 404 { 405 U32 FlagsLength; 406 U64 Address; 407 } SGE_SIMPLE64, MPI_POINTER PTR_SGE_SIMPLE64, 408 SGESimple64_t, MPI_POINTER pSGESimple64_t; 409 410 typedef struct _SGE_SIMPLE_UNION 411 { 412 U32 FlagsLength; 413 union 414 { 415 U32 Address32; 416 U64 Address64; 417 } _u; 418 } SGESimpleUnion_t, MPI_POINTER pSGESimpleUnion_t, 419 SGE_SIMPLE_UNION, MPI_POINTER PTR_SGE_SIMPLE_UNION; 420 421 /****************************************************************************/ 422 /* Chain element structures */ 423 /****************************************************************************/ 424 425 typedef struct _SGE_CHAIN32 426 { 427 U16 Length; 428 U8 NextChainOffset; 429 U8 Flags; 430 U32 Address; 431 } SGE_CHAIN32, MPI_POINTER PTR_SGE_CHAIN32, 432 SGEChain32_t, MPI_POINTER pSGEChain32_t; 433 434 typedef struct _SGE_CHAIN64 435 { 436 U16 Length; 437 U8 NextChainOffset; 438 U8 Flags; 439 U64 Address; 440 } SGE_CHAIN64, MPI_POINTER PTR_SGE_CHAIN64, 441 SGEChain64_t, MPI_POINTER pSGEChain64_t; 442 443 typedef struct _SGE_CHAIN_UNION 444 { 445 U16 Length; 446 U8 NextChainOffset; 447 U8 Flags; 448 union 449 { 450 U32 Address32; 451 U64 Address64; 452 } _u; 453 } SGE_CHAIN_UNION, MPI_POINTER PTR_SGE_CHAIN_UNION, 454 SGEChainUnion_t, MPI_POINTER pSGEChainUnion_t; 455 456 /****************************************************************************/ 457 /* Transaction Context element */ 458 /****************************************************************************/ 459 460 typedef struct _SGE_TRANSACTION32 461 { 462 U8 Reserved; 463 U8 ContextSize; 464 U8 DetailsLength; 465 U8 Flags; 466 U32 TransactionContext[1]; 467 U32 TransactionDetails[1]; 468 } SGE_TRANSACTION32, MPI_POINTER PTR_SGE_TRANSACTION32, 469 SGETransaction32_t, MPI_POINTER pSGETransaction32_t; 470 471 typedef struct _SGE_TRANSACTION64 472 { 473 U8 Reserved; 474 U8 ContextSize; 475 U8 DetailsLength; 476 U8 Flags; 477 U32 TransactionContext[2]; 478 U32 TransactionDetails[1]; 479 } SGE_TRANSACTION64, MPI_POINTER PTR_SGE_TRANSACTION64, 480 SGETransaction64_t, MPI_POINTER pSGETransaction64_t; 481 482 typedef struct _SGE_TRANSACTION96 483 { 484 U8 Reserved; 485 U8 ContextSize; 486 U8 DetailsLength; 487 U8 Flags; 488 U32 TransactionContext[3]; 489 U32 TransactionDetails[1]; 490 } SGE_TRANSACTION96, MPI_POINTER PTR_SGE_TRANSACTION96, 491 SGETransaction96_t, MPI_POINTER pSGETransaction96_t; 492 493 typedef struct _SGE_TRANSACTION128 494 { 495 U8 Reserved; 496 U8 ContextSize; 497 U8 DetailsLength; 498 U8 Flags; 499 U32 TransactionContext[4]; 500 U32 TransactionDetails[1]; 501 } SGE_TRANSACTION128, MPI_POINTER PTR_SGE_TRANSACTION128, 502 SGETransaction_t128, MPI_POINTER pSGETransaction_t128; 503 504 typedef struct _SGE_TRANSACTION_UNION 505 { 506 U8 Reserved; 507 U8 ContextSize; 508 U8 DetailsLength; 509 U8 Flags; 510 union 511 { 512 U32 TransactionContext32[1]; 513 U32 TransactionContext64[2]; 514 U32 TransactionContext96[3]; 515 U32 TransactionContext128[4]; 516 } _u; 517 U32 TransactionDetails[1]; 518 } SGE_TRANSACTION_UNION, MPI_POINTER PTR_SGE_TRANSACTION_UNION, 519 SGETransactionUnion_t, MPI_POINTER pSGETransactionUnion_t; 520 521 522 /****************************************************************************/ 523 /* SGE IO types union for IO SGL's */ 524 /****************************************************************************/ 525 526 typedef struct _SGE_IO_UNION 527 { 528 union 529 { 530 SGE_SIMPLE_UNION Simple; 531 SGE_CHAIN_UNION Chain; 532 } _u; 533 } SGE_IO_UNION, MPI_POINTER PTR_SGE_IO_UNION, 534 SGEIOUnion_t, MPI_POINTER pSGEIOUnion_t; 535 536 /****************************************************************************/ 537 /* SGE union for SGL's with Simple and Transaction elements */ 538 /****************************************************************************/ 539 540 typedef struct _SGE_TRANS_SIMPLE_UNION 541 { 542 union 543 { 544 SGE_SIMPLE_UNION Simple; 545 SGE_TRANSACTION_UNION Transaction; 546 } _u; 547 } SGE_TRANS_SIMPLE_UNION, MPI_POINTER PTR_SGE_TRANS_SIMPLE_UNION, 548 SGETransSimpleUnion_t, MPI_POINTER pSGETransSimpleUnion_t; 549 550 /****************************************************************************/ 551 /* All SGE types union */ 552 /****************************************************************************/ 553 554 typedef struct _SGE_MPI_UNION 555 { 556 union 557 { 558 SGE_SIMPLE_UNION Simple; 559 SGE_CHAIN_UNION Chain; 560 SGE_TRANSACTION_UNION Transaction; 561 } _u; 562 } SGE_MPI_UNION, MPI_POINTER PTR_SGE_MPI_UNION, 563 MPI_SGE_UNION_t, MPI_POINTER pMPI_SGE_UNION_t, 564 SGEAllUnion_t, MPI_POINTER pSGEAllUnion_t; 565 566 567 /****************************************************************************/ 568 /* SGE field definition and masks */ 569 /****************************************************************************/ 570 571 /* Flags field bit definitions */ 572 573 #define MPI_SGE_FLAGS_LAST_ELEMENT (0x80) 574 #define MPI_SGE_FLAGS_END_OF_BUFFER (0x40) 575 #define MPI_SGE_FLAGS_ELEMENT_TYPE_MASK (0x30) 576 #define MPI_SGE_FLAGS_LOCAL_ADDRESS (0x08) 577 #define MPI_SGE_FLAGS_DIRECTION (0x04) 578 #define MPI_SGE_FLAGS_ADDRESS_SIZE (0x02) 579 #define MPI_SGE_FLAGS_END_OF_LIST (0x01) 580 581 #define MPI_SGE_FLAGS_SHIFT (24) 582 583 #define MPI_SGE_LENGTH_MASK (0x00FFFFFF) 584 #define MPI_SGE_CHAIN_LENGTH_MASK (0x0000FFFF) 585 586 /* Element Type */ 587 588 #define MPI_SGE_FLAGS_TRANSACTION_ELEMENT (0x00) 589 #define MPI_SGE_FLAGS_SIMPLE_ELEMENT (0x10) 590 #define MPI_SGE_FLAGS_CHAIN_ELEMENT (0x30) 591 #define MPI_SGE_FLAGS_ELEMENT_MASK (0x30) 592 593 /* Address location */ 594 595 #define MPI_SGE_FLAGS_SYSTEM_ADDRESS (0x00) 596 597 /* Direction */ 598 599 #define MPI_SGE_FLAGS_IOC_TO_HOST (0x00) 600 #define MPI_SGE_FLAGS_HOST_TO_IOC (0x04) 601 602 /* Address Size */ 603 604 #define MPI_SGE_FLAGS_32_BIT_ADDRESSING (0x00) 605 #define MPI_SGE_FLAGS_64_BIT_ADDRESSING (0x02) 606 607 /* Context Size */ 608 609 #define MPI_SGE_FLAGS_32_BIT_CONTEXT (0x00) 610 #define MPI_SGE_FLAGS_64_BIT_CONTEXT (0x02) 611 #define MPI_SGE_FLAGS_96_BIT_CONTEXT (0x04) 612 #define MPI_SGE_FLAGS_128_BIT_CONTEXT (0x06) 613 614 #define MPI_SGE_CHAIN_OFFSET_MASK (0x00FF0000) 615 #define MPI_SGE_CHAIN_OFFSET_SHIFT (16) 616 617 618 /****************************************************************************/ 619 /* SGE operation Macros */ 620 /****************************************************************************/ 621 622 /* SIMPLE FlagsLength manipulations... */ 623 #define MPI_SGE_SET_FLAGS(f) ((U32)(f) << MPI_SGE_FLAGS_SHIFT) 624 #define MPI_SGE_GET_FLAGS(fl) (((fl) & ~MPI_SGE_LENGTH_MASK) >> MPI_SGE_FLAGS_SHIFT) 625 #define MPI_SGE_LENGTH(fl) ((fl) & MPI_SGE_LENGTH_MASK) 626 #define MPI_SGE_CHAIN_LENGTH(fl) ((fl) & MPI_SGE_CHAIN_LENGTH_MASK) 627 628 #define MPI_SGE_SET_FLAGS_LENGTH(f,l) (MPI_SGE_SET_FLAGS(f) | MPI_SGE_LENGTH(l)) 629 630 #define MPI_pSGE_GET_FLAGS(psg) MPI_SGE_GET_FLAGS((psg)->FlagsLength) 631 #define MPI_pSGE_GET_LENGTH(psg) MPI_SGE_LENGTH((psg)->FlagsLength) 632 #define MPI_pSGE_SET_FLAGS_LENGTH(psg,f,l) (psg)->FlagsLength = MPI_SGE_SET_FLAGS_LENGTH(f,l) 633 /* CAUTION - The following are READ-MODIFY-WRITE! */ 634 #define MPI_pSGE_SET_FLAGS(psg,f) (psg)->FlagsLength |= MPI_SGE_SET_FLAGS(f) 635 #define MPI_pSGE_SET_LENGTH(psg,l) (psg)->FlagsLength |= MPI_SGE_LENGTH(l) 636 637 #define MPI_GET_CHAIN_OFFSET(x) ((x&MPI_SGE_CHAIN_OFFSET_MASK)>>MPI_SGE_CHAIN_OFFSET_SHIFT) 638 639 640 641 /***************************************************************************** 642 * 643 * S t a n d a r d M e s s a g e S t r u c t u r e s 644 * 645 *****************************************************************************/ 646 647 /****************************************************************************/ 648 /* Standard message request header for all request messages */ 649 /****************************************************************************/ 650 651 typedef struct _MSG_REQUEST_HEADER 652 { 653 U8 Reserved[2]; /* function specific */ 654 U8 ChainOffset; 655 U8 Function; 656 U8 Reserved1[3]; /* function specific */ 657 U8 MsgFlags; 658 U32 MsgContext; 659 } MSG_REQUEST_HEADER, MPI_POINTER PTR_MSG_REQUEST_HEADER, 660 MPIHeader_t, MPI_POINTER pMPIHeader_t; 661 662 663 /****************************************************************************/ 664 /* Default Reply */ 665 /****************************************************************************/ 666 667 typedef struct _MSG_DEFAULT_REPLY 668 { 669 U8 Reserved[2]; /* function specific */ 670 U8 MsgLength; 671 U8 Function; 672 U8 Reserved1[3]; /* function specific */ 673 U8 MsgFlags; 674 U32 MsgContext; 675 U8 Reserved2[2]; /* function specific */ 676 U16 IOCStatus; 677 U32 IOCLogInfo; 678 } MSG_DEFAULT_REPLY, MPI_POINTER PTR_MSG_DEFAULT_REPLY, 679 MPIDefaultReply_t, MPI_POINTER pMPIDefaultReply_t; 680 681 682 /* MsgFlags definition for all replies */ 683 684 #define MPI_MSGFLAGS_CONTINUATION_REPLY (0x80) 685 686 687 /***************************************************************************** 688 * 689 * I O C S t a t u s V a l u e s 690 * 691 *****************************************************************************/ 692 693 /****************************************************************************/ 694 /* Common IOCStatus values for all replies */ 695 /****************************************************************************/ 696 697 #define MPI_IOCSTATUS_SUCCESS (0x0000) 698 #define MPI_IOCSTATUS_INVALID_FUNCTION (0x0001) 699 #define MPI_IOCSTATUS_BUSY (0x0002) 700 #define MPI_IOCSTATUS_INVALID_SGL (0x0003) 701 #define MPI_IOCSTATUS_INTERNAL_ERROR (0x0004) 702 #define MPI_IOCSTATUS_RESERVED (0x0005) 703 #define MPI_IOCSTATUS_INSUFFICIENT_RESOURCES (0x0006) 704 #define MPI_IOCSTATUS_INVALID_FIELD (0x0007) 705 #define MPI_IOCSTATUS_INVALID_STATE (0x0008) 706 707 /****************************************************************************/ 708 /* Config IOCStatus values */ 709 /****************************************************************************/ 710 711 #define MPI_IOCSTATUS_CONFIG_INVALID_ACTION (0x0020) 712 #define MPI_IOCSTATUS_CONFIG_INVALID_TYPE (0x0021) 713 #define MPI_IOCSTATUS_CONFIG_INVALID_PAGE (0x0022) 714 #define MPI_IOCSTATUS_CONFIG_INVALID_DATA (0x0023) 715 #define MPI_IOCSTATUS_CONFIG_NO_DEFAULTS (0x0024) 716 #define MPI_IOCSTATUS_CONFIG_CANT_COMMIT (0x0025) 717 718 /****************************************************************************/ 719 /* SCSIIO Reply (SPI & FCP) initiator values */ 720 /****************************************************************************/ 721 722 #define MPI_IOCSTATUS_SCSI_RECOVERED_ERROR (0x0040) 723 #define MPI_IOCSTATUS_SCSI_INVALID_BUS (0x0041) 724 #define MPI_IOCSTATUS_SCSI_INVALID_TARGETID (0x0042) 725 #define MPI_IOCSTATUS_SCSI_DEVICE_NOT_THERE (0x0043) 726 #define MPI_IOCSTATUS_SCSI_DATA_OVERRUN (0x0044) 727 #define MPI_IOCSTATUS_SCSI_DATA_UNDERRUN (0x0045) 728 #define MPI_IOCSTATUS_SCSI_IO_DATA_ERROR (0x0046) 729 #define MPI_IOCSTATUS_SCSI_PROTOCOL_ERROR (0x0047) 730 #define MPI_IOCSTATUS_SCSI_TASK_TERMINATED (0x0048) 731 #define MPI_IOCSTATUS_SCSI_RESIDUAL_MISMATCH (0x0049) 732 #define MPI_IOCSTATUS_SCSI_TASK_MGMT_FAILED (0x004A) 733 #define MPI_IOCSTATUS_SCSI_IOC_TERMINATED (0x004B) 734 #define MPI_IOCSTATUS_SCSI_EXT_TERMINATED (0x004C) 735 736 /****************************************************************************/ 737 /* SCSI (SPI & FCP) target values */ 738 /****************************************************************************/ 739 740 #define MPI_IOCSTATUS_TARGET_PRIORITY_IO (0x0060) 741 #define MPI_IOCSTATUS_TARGET_INVALID_PORT (0x0061) 742 #define MPI_IOCSTATUS_TARGET_INVALID_IOCINDEX (0x0062) 743 #define MPI_IOCSTATUS_TARGET_ABORTED (0x0063) 744 #define MPI_IOCSTATUS_TARGET_NO_CONN_RETRYABLE (0x0064) 745 #define MPI_IOCSTATUS_TARGET_NO_CONNECTION (0x0065) 746 #define MPI_IOCSTATUS_TARGET_XFER_COUNT_MISMATCH (0x006A) 747 #define MPI_IOCSTATUS_TARGET_STS_DATA_NOT_SENT (0x006B) 748 749 /****************************************************************************/ 750 /* Additional FCP target values */ 751 /****************************************************************************/ 752 753 #define MPI_IOCSTATUS_TARGET_FC_ABORTED (0x0066) /* obsolete */ 754 #define MPI_IOCSTATUS_TARGET_FC_RX_ID_INVALID (0x0067) /* obsolete */ 755 #define MPI_IOCSTATUS_TARGET_FC_DID_INVALID (0x0068) /* obsolete */ 756 #define MPI_IOCSTATUS_TARGET_FC_NODE_LOGGED_OUT (0x0069) /* obsolete */ 757 758 /****************************************************************************/ 759 /* Fibre Channel Direct Access values */ 760 /****************************************************************************/ 761 762 #define MPI_IOCSTATUS_FC_ABORTED (0x0066) 763 #define MPI_IOCSTATUS_FC_RX_ID_INVALID (0x0067) 764 #define MPI_IOCSTATUS_FC_DID_INVALID (0x0068) 765 #define MPI_IOCSTATUS_FC_NODE_LOGGED_OUT (0x0069) 766 767 /****************************************************************************/ 768 /* LAN values */ 769 /****************************************************************************/ 770 771 #define MPI_IOCSTATUS_LAN_DEVICE_NOT_FOUND (0x0080) 772 #define MPI_IOCSTATUS_LAN_DEVICE_FAILURE (0x0081) 773 #define MPI_IOCSTATUS_LAN_TRANSMIT_ERROR (0x0082) 774 #define MPI_IOCSTATUS_LAN_TRANSMIT_ABORTED (0x0083) 775 #define MPI_IOCSTATUS_LAN_RECEIVE_ERROR (0x0084) 776 #define MPI_IOCSTATUS_LAN_RECEIVE_ABORTED (0x0085) 777 #define MPI_IOCSTATUS_LAN_PARTIAL_PACKET (0x0086) 778 #define MPI_IOCSTATUS_LAN_CANCELED (0x0087) 779 780 781 /****************************************************************************/ 782 /* IOCStatus flag to indicate that log info is available */ 783 /****************************************************************************/ 784 785 #define MPI_IOCSTATUS_FLAG_LOG_INFO_AVAILABLE (0x8000) 786 #define MPI_IOCSTATUS_MASK (0x7FFF) 787 788 /****************************************************************************/ 789 /* LogInfo Types */ 790 /****************************************************************************/ 791 792 #define MPI_IOCLOGINFO_TYPE_MASK (0xF0000000) 793 #define MPI_IOCLOGINFO_TYPE_NONE (0x0) 794 #define MPI_IOCLOGINFO_TYPE_SCSI (0x1) 795 #define MPI_IOCLOGINFO_TYPE_FC (0x2) 796 #define MPI_IOCLOGINFO_LOG_DATA_MASK (0x0FFFFFFF) 797 798 799 #endif 800 801 /* 802 * Copyright (c) 2000, 2001 by LSI Logic Corporation 803 * 804 * Redistribution and use in source and binary forms, with or without 805 * modification, are permitted provided that the following conditions 806 * are met: 807 * 1. Redistributions of source code must retain the above copyright 808 * notice immediately at the beginning of the file, without modification, 809 * this list of conditions, and the following disclaimer. 810 * 2. The name of the author may not be used to endorse or promote products 811 * derived from this software without specific prior written permission. 812 * 813 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 814 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 815 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 816 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 817 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 818 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 819 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 820 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 821 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 822 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 823 * SUCH DAMAGE. 824 * 825 * 826 * Name: MPI_CNFG.H 827 * Title: MPI Config message, structures, and Pages 828 * Creation Date: July 27, 2000 829 * 830 * MPI Version: 01.02.05 831 * 832 * Version History 833 * --------------- 834 * 835 * Date Version Description 836 * -------- -------- ------------------------------------------------------ 837 * 05-08-00 00.10.01 Original release for 0.10 spec dated 4/26/2000. 838 * 06-06-00 01.00.01 Update version number for 1.0 release. 839 * 06-08-00 01.00.02 Added _PAGEVERSION definitions for all pages. 840 * Added FcPhLowestVersion, FcPhHighestVersion, Reserved2 841 * fields to FC_DEVICE_0 page, updated the page version. 842 * Changed _FREE_RUNNING_CLOCK to _PACING_TRANSFERS in 843 * SCSI_PORT_0, SCSI_DEVICE_0 and SCSI_DEVICE_1 pages 844 * and updated the page versions. 845 * Added _RESPONSE_ID_MASK definition to SCSI_PORT_1 846 * page and updated the page version. 847 * Added Information field and _INFO_PARAMS_NEGOTIATED 848 * definitionto SCSI_DEVICE_0 page. 849 * 06-22-00 01.00.03 Removed batch controls from LAN_0 page and updated the 850 * page version. 851 * Added BucketsRemaining to LAN_1 page, redefined the 852 * state values, and updated the page version. 853 * Revised bus width definitions in SCSI_PORT_0, 854 * SCSI_DEVICE_0 and SCSI_DEVICE_1 pages. 855 * 06-30-00 01.00.04 Added MaxReplySize to LAN_1 page and updated the page 856 * version. 857 * Moved FC_DEVICE_0 PageAddress description to spec. 858 * 07-27-00 01.00.05 Corrected the SubsystemVendorID and SubsystemID field 859 * widths in IOC_0 page and updated the page version. 860 * 11-02-00 01.01.01 Original release for post 1.0 work 861 * Added Manufacturing pages, IO Unit Page 2, SCSI SPI 862 * Port Page 2, FC Port Page 4, FC Port Page 5 863 * 11-15-00 01.01.02 Interim changes to match proposals 864 * 12-04-00 01.01.03 Config page changes to match MPI rev 1.00.01. 865 * 12-05-00 01.01.04 Modified config page actions. 866 * 01-09-01 01.01.05 Added defines for page address formats. 867 * Data size for Manufacturing pages 2 and 3 no longer 868 * defined here. 869 * Io Unit Page 2 size is fixed at 4 adapters and some 870 * flags were changed. 871 * SCSI Port Page 2 Device Settings modified. 872 * New fields added to FC Port Page 0 and some flags 873 * cleaned up. 874 * Removed impedance flash from FC Port Page 1. 875 * Added FC Port pages 6 and 7. 876 * 01-25-01 01.01.06 Added MaxInitiators field to FcPortPage0. 877 * 01-29-01 01.01.07 Changed some defines to make them 32 character unique. 878 * Added some LinkType defines for FcPortPage0. 879 * 02-20-01 01.01.08 Started using MPI_POINTER. 880 * 02-27-01 01.01.09 Replaced MPI_CONFIG_PAGETYPE_SCSI_LUN with 881 * MPI_CONFIG_PAGETYPE_RAID_VOLUME. 882 * Added definitions and structures for IOC Page 2 and 883 * RAID Volume Page 2. 884 * 03-27-01 01.01.10 Added CONFIG_PAGE_FC_PORT_8 and CONFIG_PAGE_FC_PORT_9. 885 * CONFIG_PAGE_FC_PORT_3 now supports persistent by DID. 886 * Added VendorId and ProductRevLevel fields to 887 * RAIDVOL2_IM_PHYS_ID struct. 888 * Modified values for MPI_FCPORTPAGE0_FLAGS_ATTACH_ 889 * defines to make them compatible to MPI version 1.0. 890 * Added structure offset comments. 891 * 04-09-01 01.01.11 Added some new defines for the PageAddress field and 892 * removed some obsolete ones. 893 * Added IO Unit Page 3. 894 * Modified defines for Scsi Port Page 2. 895 * Modified RAID Volume Pages. 896 * 08-08-01 01.02.01 Original release for v1.2 work. 897 * Added SepID and SepBus to RVP2 IMPhysicalDisk struct. 898 * Added defines for the SEP bits in RVP2 VolumeSettings. 899 * Modified the DeviceSettings field in RVP2 to use the 900 * proper structure. 901 * Added defines for SES, SAF-TE, and cross channel for 902 * IOCPage2 CapabilitiesFlags. 903 * Removed define for MPI_IOUNITPAGE2_FLAGS_RAID_DISABLE. 904 * Removed define for 905 * MPI_SCSIPORTPAGE2_PORT_FLAGS_PARITY_ENABLE. 906 * Added define for MPI_CONFIG_PAGEATTR_RO_PERSISTENT. 907 * 08-29-01 01.02.02 Fixed value for MPI_MANUFACTPAGE_DEVID_53C1035. 908 * Added defines for MPI_FCPORTPAGE1_FLAGS_HARD_ALPA_ONLY 909 * and MPI_FCPORTPAGE1_FLAGS_IMMEDIATE_ERROR_REPLY. 910 * Removed MPI_SCSIPORTPAGE0_CAP_PACING_TRANSFERS, 911 * MPI_SCSIDEVPAGE0_NP_PACING_TRANSFERS, and 912 * MPI_SCSIDEVPAGE1_RP_PACING_TRANSFERS, and 913 * MPI_SCSIDEVPAGE1_CONF_PPR_ALLOWED. 914 * Added defines for MPI_SCSIDEVPAGE1_CONF_WDTR_DISALLOWED 915 * and MPI_SCSIDEVPAGE1_CONF_SDTR_DISALLOWED. 916 * Added OnBusTimerValue to CONFIG_PAGE_SCSI_PORT_1. 917 * Added rejected bits to SCSI Device Page 0 Information. 918 * Increased size of ALPA array in FC Port Page 2 by one 919 * and removed a one byte reserved field. 920 * 09-28-01 01.02.03 Swapped NegWireSpeedLow and NegWireSpeedLow in 921 * CONFIG_PAGE_LAN_1 to match preferred 64-bit ordering. 922 * Added structures for Manufacturing Page 4, IO Unit 923 * Page 3, IOC Page 3, IOC Page 4, RAID Volume Page 0, and 924 * RAID PhysDisk Page 0. 925 * 10-04-01 01.02.04 Added define for MPI_CONFIG_PAGETYPE_RAID_PHYSDISK. 926 * Modified some of the new defines to make them 32 927 * character unique. 928 * Modified how variable length pages (arrays) are defined. 929 * Added generic defines for hot spare pools and RAID 930 * volume types. 931 * 11-01-01 01.02.05 Added define for MPI_IOUNITPAGE1_DISABLE_IR. 932 * -------------------------------------------------------------------------- 933 */ 934 935 #ifndef MPI_CNFG_H 936 #define MPI_CNFG_H 937 938 939 /***************************************************************************** 940 * 941 * C o n f i g M e s s a g e a n d S t r u c t u r e s 942 * 943 *****************************************************************************/ 944 945 typedef struct _CONFIG_PAGE_HEADER 946 { 947 U8 PageVersion; /* 00h */ 948 U8 PageLength; /* 01h */ 949 U8 PageNumber; /* 02h */ 950 U8 PageType; /* 03h */ 951 } fCONFIG_PAGE_HEADER, MPI_POINTER PTR_CONFIG_PAGE_HEADER, 952 ConfigPageHeader_t, MPI_POINTER pConfigPageHeader_t; 953 954 typedef union _CONFIG_PAGE_HEADER_UNION 955 { 956 ConfigPageHeader_t Struct; 957 U8 Bytes[4]; 958 U16 Word16[2]; 959 U32 Word32; 960 } ConfigPageHeaderUnion, MPI_POINTER pConfigPageHeaderUnion, 961 fCONFIG_PAGE_HEADER_UNION, MPI_POINTER PTR_CONFIG_PAGE_HEADER_UNION; 962 963 964 /**************************************************************************** 965 * PageType field values 966 ****************************************************************************/ 967 #define MPI_CONFIG_PAGEATTR_READ_ONLY (0x00) 968 #define MPI_CONFIG_PAGEATTR_CHANGEABLE (0x10) 969 #define MPI_CONFIG_PAGEATTR_PERSISTENT (0x20) 970 #define MPI_CONFIG_PAGEATTR_RO_PERSISTENT (0x30) 971 #define MPI_CONFIG_PAGEATTR_MASK (0xF0) 972 973 #define MPI_CONFIG_PAGETYPE_IO_UNIT (0x00) 974 #define MPI_CONFIG_PAGETYPE_IOC (0x01) 975 #define MPI_CONFIG_PAGETYPE_BIOS (0x02) 976 #define MPI_CONFIG_PAGETYPE_SCSI_PORT (0x03) 977 #define MPI_CONFIG_PAGETYPE_SCSI_DEVICE (0x04) 978 #define MPI_CONFIG_PAGETYPE_FC_PORT (0x05) 979 #define MPI_CONFIG_PAGETYPE_FC_DEVICE (0x06) 980 #define MPI_CONFIG_PAGETYPE_LAN (0x07) 981 #define MPI_CONFIG_PAGETYPE_RAID_VOLUME (0x08) 982 #define MPI_CONFIG_PAGETYPE_MANUFACTURING (0x09) 983 #define MPI_CONFIG_PAGETYPE_RAID_PHYSDISK (0x0A) 984 #define MPI_CONFIG_PAGETYPE_MASK (0x0F) 985 986 #define MPI_CONFIG_TYPENUM_MASK (0x0FFF) 987 988 989 /**************************************************************************** 990 * PageAddress field values 991 ****************************************************************************/ 992 #define MPI_SCSI_PORT_PGAD_PORT_MASK (0x000000FF) 993 994 #define MPI_SCSI_DEVICE_TARGET_ID_MASK (0x000000FF) 995 #define MPI_SCSI_DEVICE_TARGET_ID_SHIFT (0) 996 #define MPI_SCSI_DEVICE_BUS_MASK (0x0000FF00) 997 #define MPI_SCSI_DEVICE_BUS_SHIFT (8) 998 999 #define MPI_FC_PORT_PGAD_PORT_MASK (0xF0000000) 1000 #define MPI_FC_PORT_PGAD_PORT_SHIFT (28) 1001 #define MPI_FC_PORT_PGAD_FORM_MASK (0x0F000000) 1002 #define MPI_FC_PORT_PGAD_FORM_INDEX (0x01000000) 1003 #define MPI_FC_PORT_PGAD_INDEX_MASK (0x0000FFFF) 1004 #define MPI_FC_PORT_PGAD_INDEX_SHIFT (0) 1005 1006 #define MPI_FC_DEVICE_PGAD_PORT_MASK (0xF0000000) 1007 #define MPI_FC_DEVICE_PGAD_PORT_SHIFT (28) 1008 #define MPI_FC_DEVICE_PGAD_FORM_MASK (0x0F000000) 1009 #define MPI_FC_DEVICE_PGAD_FORM_NEXT_DID (0x00000000) 1010 #define MPI_FC_DEVICE_PGAD_ND_PORT_MASK (0xF0000000) 1011 #define MPI_FC_DEVICE_PGAD_ND_PORT_SHIFT (28) 1012 #define MPI_FC_DEVICE_PGAD_ND_DID_MASK (0x00FFFFFF) 1013 #define MPI_FC_DEVICE_PGAD_ND_DID_SHIFT (0) 1014 #define MPI_FC_DEVICE_PGAD_FORM_BUS_TID (0x01000000) 1015 #define MPI_FC_DEVICE_PGAD_BT_BUS_MASK (0x0000FF00) 1016 #define MPI_FC_DEVICE_PGAD_BT_BUS_SHIFT (8) 1017 #define MPI_FC_DEVICE_PGAD_BT_TID_MASK (0x000000FF) 1018 #define MPI_FC_DEVICE_PGAD_BT_TID_SHIFT (0) 1019 1020 #define MPI_PHYSDISK_PGAD_PHYSDISKNUM_MASK (0x000000FF) 1021 #define MPI_PHYSDISK_PGAD_PHYSDISKNUM_SHIFT (0) 1022 1023 1024 1025 /**************************************************************************** 1026 * Config Request Message 1027 ****************************************************************************/ 1028 typedef struct _MSG_CONFIG 1029 { 1030 U8 Action; /* 00h */ 1031 U8 Reserved; /* 01h */ 1032 U8 ChainOffset; /* 02h */ 1033 U8 Function; /* 03h */ 1034 U8 Reserved1[3]; /* 04h */ 1035 U8 MsgFlags; /* 07h */ 1036 U32 MsgContext; /* 08h */ 1037 U8 Reserved2[8]; /* 0Ch */ 1038 fCONFIG_PAGE_HEADER Header; /* 14h */ 1039 U32 PageAddress; /* 18h */ 1040 SGE_IO_UNION PageBufferSGE; /* 1Ch */ 1041 } MSG_CONFIG, MPI_POINTER PTR_MSG_CONFIG, 1042 Config_t, MPI_POINTER pConfig_t; 1043 1044 1045 /**************************************************************************** 1046 * Action field values 1047 ****************************************************************************/ 1048 #define MPI_CONFIG_ACTION_PAGE_HEADER (0x00) 1049 #define MPI_CONFIG_ACTION_PAGE_READ_CURRENT (0x01) 1050 #define MPI_CONFIG_ACTION_PAGE_WRITE_CURRENT (0x02) 1051 #define MPI_CONFIG_ACTION_PAGE_DEFAULT (0x03) 1052 #define MPI_CONFIG_ACTION_PAGE_WRITE_NVRAM (0x04) 1053 #define MPI_CONFIG_ACTION_PAGE_READ_DEFAULT (0x05) 1054 #define MPI_CONFIG_ACTION_PAGE_READ_NVRAM (0x06) 1055 1056 1057 /* Config Reply Message */ 1058 typedef struct _MSG_CONFIG_REPLY 1059 { 1060 U8 Action; /* 00h */ 1061 U8 Reserved; /* 01h */ 1062 U8 MsgLength; /* 02h */ 1063 U8 Function; /* 03h */ 1064 U8 Reserved1[3]; /* 04h */ 1065 U8 MsgFlags; /* 07h */ 1066 U32 MsgContext; /* 08h */ 1067 U8 Reserved2[2]; /* 0Ch */ 1068 U16 IOCStatus; /* 0Eh */ 1069 U32 IOCLogInfo; /* 10h */ 1070 fCONFIG_PAGE_HEADER Header; /* 14h */ 1071 } MSG_CONFIG_REPLY, MPI_POINTER PTR_MSG_CONFIG_REPLY, 1072 ConfigReply_t, MPI_POINTER pConfigReply_t; 1073 1074 1075 1076 /***************************************************************************** 1077 * 1078 * C o n f i g u r a t i o n P a g e s 1079 * 1080 *****************************************************************************/ 1081 1082 /**************************************************************************** 1083 * Manufacturing Config pages 1084 ****************************************************************************/ 1085 #define MPI_MANUFACTPAGE_DEVICEID_FC909 (0x0621) 1086 #define MPI_MANUFACTPAGE_DEVICEID_FC919 (0x0624) 1087 #define MPI_MANUFACTPAGE_DEVICEID_FC929 (0x0622) 1088 #define MPI_MANUFACTPAGE_DEVICEID_FC919X (0x0628) 1089 #define MPI_MANUFACTPAGE_DEVICEID_FC929X (0x0626) 1090 #define MPI_MANUFACTPAGE_DEVID_53C1030 (0x0030) 1091 #define MPI_MANUFACTPAGE_DEVID_53C1030ZC (0x0031) 1092 #define MPI_MANUFACTPAGE_DEVID_1030_53C1035 (0x0032) 1093 #define MPI_MANUFACTPAGE_DEVID_1030ZC_53C1035 (0x0033) 1094 #define MPI_MANUFACTPAGE_DEVID_53C1035 (0x0040) 1095 #define MPI_MANUFACTPAGE_DEVID_53C1035ZC (0x0041) 1096 1097 typedef struct _CONFIG_PAGE_MANUFACTURING_0 1098 { 1099 fCONFIG_PAGE_HEADER Header; /* 00h */ 1100 U8 ChipName[16]; /* 04h */ 1101 U8 ChipRevision[8]; /* 14h */ 1102 U8 BoardName[16]; /* 1Ch */ 1103 U8 BoardAssembly[16]; /* 2Ch */ 1104 U8 BoardTracerNumber[16]; /* 3Ch */ 1105 1106 } fCONFIG_PAGE_MANUFACTURING_0, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_0, 1107 ManufacturingPage0_t, MPI_POINTER pManufacturingPage0_t; 1108 1109 #define MPI_MANUFACTURING0_PAGEVERSION (0x00) 1110 1111 1112 typedef struct _CONFIG_PAGE_MANUFACTURING_1 1113 { 1114 fCONFIG_PAGE_HEADER Header; /* 00h */ 1115 U8 VPD[256]; /* 04h */ 1116 } fCONFIG_PAGE_MANUFACTURING_1, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_1, 1117 ManufacturingPage1_t, MPI_POINTER pManufacturingPage1_t; 1118 1119 #define MPI_MANUFACTURING1_PAGEVERSION (0x00) 1120 1121 1122 typedef struct _MPI_CHIP_REVISION_ID 1123 { 1124 U16 DeviceID; /* 00h */ 1125 U8 PCIRevisionID; /* 02h */ 1126 U8 Reserved; /* 03h */ 1127 } MPI_CHIP_REVISION_ID, MPI_POINTER PTR_MPI_CHIP_REVISION_ID, 1128 MpiChipRevisionId_t, MPI_POINTER pMpiChipRevisionId_t; 1129 1130 1131 /* 1132 * Host code (drivers, BIOS, utilities, etc.) should leave this define set to 1133 * one and check Header.PageLength at runtime. 1134 */ 1135 #ifndef MPI_MAN_PAGE_2_HW_SETTINGS_WORDS 1136 #define MPI_MAN_PAGE_2_HW_SETTINGS_WORDS (1) 1137 #endif 1138 1139 typedef struct _CONFIG_PAGE_MANUFACTURING_2 1140 { 1141 fCONFIG_PAGE_HEADER Header; /* 00h */ 1142 MPI_CHIP_REVISION_ID ChipId; /* 04h */ 1143 U32 HwSettings[MPI_MAN_PAGE_2_HW_SETTINGS_WORDS];/* 08h */ 1144 } fCONFIG_PAGE_MANUFACTURING_2, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_2, 1145 ManufacturingPage2_t, MPI_POINTER pManufacturingPage2_t; 1146 1147 #define MPI_MANUFACTURING2_PAGEVERSION (0x00) 1148 1149 1150 /* 1151 * Host code (drivers, BIOS, utilities, etc.) should leave this define set to 1152 * one and check Header.PageLength at runtime. 1153 */ 1154 #ifndef MPI_MAN_PAGE_3_INFO_WORDS 1155 #define MPI_MAN_PAGE_3_INFO_WORDS (1) 1156 #endif 1157 1158 typedef struct _CONFIG_PAGE_MANUFACTURING_3 1159 { 1160 fCONFIG_PAGE_HEADER Header; /* 00h */ 1161 MPI_CHIP_REVISION_ID ChipId; /* 04h */ 1162 U32 Info[MPI_MAN_PAGE_3_INFO_WORDS];/* 08h */ 1163 } fCONFIG_PAGE_MANUFACTURING_3, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_3, 1164 ManufacturingPage3_t, MPI_POINTER pManufacturingPage3_t; 1165 1166 #define MPI_MANUFACTURING3_PAGEVERSION (0x00) 1167 1168 1169 typedef struct _CONFIG_PAGE_MANUFACTURING_4 1170 { 1171 fCONFIG_PAGE_HEADER Header; /* 00h */ 1172 U32 Reserved1; /* 04h */ 1173 U8 InfoOffset0; /* 08h */ 1174 U8 InfoSize0; /* 09h */ 1175 U8 InfoOffset1; /* 0Ah */ 1176 U8 InfoSize1; /* 0Bh */ 1177 U8 InquirySize; /* 0Ch */ 1178 U8 Reserved2; /* 0Dh */ 1179 U16 Reserved3; /* 0Eh */ 1180 U8 InquiryData[56]; /* 10h */ 1181 U32 ISVolumeSettings; /* 48h */ 1182 U32 IMEVolumeSettings; /* 4Ch */ 1183 U32 IMVolumeSettings; /* 50h */ 1184 } fCONFIG_PAGE_MANUFACTURING_4, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_4, 1185 ManufacturingPage4_t, MPI_POINTER pManufacturingPage4_t; 1186 1187 #define MPI_MANUFACTURING4_PAGEVERSION (0x00) 1188 1189 1190 /**************************************************************************** 1191 * IO Unit Config Pages 1192 ****************************************************************************/ 1193 1194 typedef struct _CONFIG_PAGE_IO_UNIT_0 1195 { 1196 fCONFIG_PAGE_HEADER Header; /* 00h */ 1197 U64 UniqueValue; /* 04h */ 1198 } fCONFIG_PAGE_IO_UNIT_0, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_0, 1199 IOUnitPage0_t, MPI_POINTER pIOUnitPage0_t; 1200 1201 #define MPI_IOUNITPAGE0_PAGEVERSION (0x00) 1202 1203 1204 typedef struct _CONFIG_PAGE_IO_UNIT_1 1205 { 1206 fCONFIG_PAGE_HEADER Header; /* 00h */ 1207 U32 Flags; /* 04h */ 1208 } fCONFIG_PAGE_IO_UNIT_1, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_1, 1209 IOUnitPage1_t, MPI_POINTER pIOUnitPage1_t; 1210 1211 #define MPI_IOUNITPAGE1_PAGEVERSION (0x00) 1212 1213 /* IO Unit Page 1 Flags defines */ 1214 1215 #define MPI_IOUNITPAGE1_MULTI_FUNCTION (0x00000000) 1216 #define MPI_IOUNITPAGE1_SINGLE_FUNCTION (0x00000001) 1217 #define MPI_IOUNITPAGE1_MULTI_PATHING (0x00000002) 1218 #define MPI_IOUNITPAGE1_SINGLE_PATHING (0x00000000) 1219 #define MPI_IOUNITPAGE1_DISABLE_IR (0x00000040) 1220 #define MPI_IOUNITPAGE1_FORCE_32 (0x00000080) 1221 1222 1223 typedef struct _MPI_ADAPTER_INFO 1224 { 1225 U8 PciBusNumber; /* 00h */ 1226 U8 PciDeviceAndFunctionNumber; /* 01h */ 1227 U16 AdapterFlags; /* 02h */ 1228 } MPI_ADAPTER_INFO, MPI_POINTER PTR_MPI_ADAPTER_INFO, 1229 MpiAdapterInfo_t, MPI_POINTER pMpiAdapterInfo_t; 1230 1231 #define MPI_ADAPTER_INFO_FLAGS_EMBEDDED (0x0001) 1232 #define MPI_ADAPTER_INFO_FLAGS_INIT_STATUS (0x0002) 1233 1234 typedef struct _CONFIG_PAGE_IO_UNIT_2 1235 { 1236 fCONFIG_PAGE_HEADER Header; /* 00h */ 1237 U32 Flags; /* 04h */ 1238 U32 BiosVersion; /* 08h */ 1239 MPI_ADAPTER_INFO AdapterOrder[4]; /* 0Ch */ 1240 } fCONFIG_PAGE_IO_UNIT_2, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_2, 1241 IOUnitPage2_t, MPI_POINTER pIOUnitPage2_t; 1242 1243 #define MPI_IOUNITPAGE2_PAGEVERSION (0x00) 1244 1245 #define MPI_IOUNITPAGE2_FLAGS_PAUSE_ON_ERROR (0x00000002) 1246 #define MPI_IOUNITPAGE2_FLAGS_VERBOSE_ENABLE (0x00000004) 1247 #define MPI_IOUNITPAGE2_FLAGS_COLOR_VIDEO_DISABLE (0x00000008) 1248 #define MPI_IOUNITPAGE2_FLAGS_DONT_HOOK_INT_40 (0x00000010) 1249 1250 1251 /* 1252 * Host code (drivers, BIOS, utilities, etc.) should leave this define set to 1253 * one and check Header.PageLength at runtime. 1254 */ 1255 #ifndef MPI_IO_UNIT_PAGE_3_GPIO_VAL_MAX 1256 #define MPI_IO_UNIT_PAGE_3_GPIO_VAL_MAX (1) 1257 #endif 1258 1259 typedef struct _CONFIG_PAGE_IO_UNIT_3 1260 { 1261 fCONFIG_PAGE_HEADER Header; /* 00h */ 1262 U8 GPIOCount; /* 04h */ 1263 U8 Reserved1; /* 05h */ 1264 U16 Reserved2; /* 06h */ 1265 U16 GPIOVal[MPI_IO_UNIT_PAGE_3_GPIO_VAL_MAX]; /* 08h */ 1266 } fCONFIG_PAGE_IO_UNIT_3, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_3, 1267 IOUnitPage3_t, MPI_POINTER pIOUnitPage3_t; 1268 1269 #define MPI_IOUNITPAGE3_PAGEVERSION (0x01) 1270 1271 #define MPI_IOUNITPAGE3_GPIO_FUNCTION_MASK (0xFC) 1272 #define MPI_IOUNITPAGE3_GPIO_FUNCTION_SHIFT (2) 1273 #define MPI_IOUNITPAGE3_GPIO_SETTING_OFF (0x00) 1274 #define MPI_IOUNITPAGE3_GPIO_SETTING_ON (0x01) 1275 1276 1277 /**************************************************************************** 1278 * IOC Config Pages 1279 ****************************************************************************/ 1280 1281 typedef struct _CONFIG_PAGE_IOC_0 1282 { 1283 fCONFIG_PAGE_HEADER Header; /* 00h */ 1284 U32 TotalNVStore; /* 04h */ 1285 U32 FreeNVStore; /* 08h */ 1286 U16 VendorID; /* 0Ch */ 1287 U16 DeviceID; /* 0Eh */ 1288 U8 RevisionID; /* 10h */ 1289 U8 Reserved[3]; /* 11h */ 1290 U32 ClassCode; /* 14h */ 1291 U16 SubsystemVendorID; /* 18h */ 1292 U16 SubsystemID; /* 1Ah */ 1293 } fCONFIG_PAGE_IOC_0, MPI_POINTER PTR_CONFIG_PAGE_IOC_0, 1294 IOCPage0_t, MPI_POINTER pIOCPage0_t; 1295 1296 #define MPI_IOCPAGE0_PAGEVERSION (0x01) 1297 1298 1299 typedef struct _CONFIG_PAGE_IOC_1 1300 { 1301 fCONFIG_PAGE_HEADER Header; /* 00h */ 1302 U32 Flags; /* 04h */ 1303 U32 CoalescingTimeout; /* 08h */ 1304 U8 CoalescingDepth; /* 0Ch */ 1305 U8 Reserved[3]; /* 0Dh */ 1306 } fCONFIG_PAGE_IOC_1, MPI_POINTER PTR_CONFIG_PAGE_IOC_1, 1307 IOCPage1_t, MPI_POINTER pIOCPage1_t; 1308 1309 #define MPI_IOCPAGE1_PAGEVERSION (0x00) 1310 1311 #define MPI_IOCPAGE1_REPLY_COALESCING (0x00000001) 1312 1313 1314 typedef struct _CONFIG_PAGE_IOC_2_RAID_VOL 1315 { 1316 U8 VolumeID; /* 00h */ 1317 U8 VolumeBus; /* 01h */ 1318 U8 VolumeIOC; /* 02h */ 1319 U8 VolumePageNumber; /* 03h */ 1320 U8 VolumeType; /* 04h */ 1321 U8 Reserved2; /* 05h */ 1322 U16 Reserved3; /* 06h */ 1323 } fCONFIG_PAGE_IOC_2_RAID_VOL, MPI_POINTER PTR_CONFIG_PAGE_IOC_2_RAID_VOL, 1324 ConfigPageIoc2RaidVol_t, MPI_POINTER pConfigPageIoc2RaidVol_t; 1325 1326 /* 1327 * Host code (drivers, BIOS, utilities, etc.) should leave this define set to 1328 * one and check Header.PageLength at runtime. 1329 */ 1330 #ifndef MPI_IOC_PAGE_2_RAID_VOLUME_MAX 1331 #define MPI_IOC_PAGE_2_RAID_VOLUME_MAX (1) 1332 #endif 1333 1334 typedef struct _CONFIG_PAGE_IOC_2 1335 { 1336 fCONFIG_PAGE_HEADER Header; /* 00h */ 1337 U32 CapabilitiesFlags; /* 04h */ 1338 U8 NumActiveVolumes; /* 08h */ 1339 U8 MaxVolumes; /* 09h */ 1340 U8 NumActivePhysDisks; /* 0Ah */ 1341 U8 MaxPhysDisks; /* 0Bh */ 1342 fCONFIG_PAGE_IOC_2_RAID_VOL RaidVolume[MPI_IOC_PAGE_2_RAID_VOLUME_MAX];/* 0Ch */ 1343 } fCONFIG_PAGE_IOC_2, MPI_POINTER PTR_CONFIG_PAGE_IOC_2, 1344 IOCPage2_t, MPI_POINTER pIOCPage2_t; 1345 1346 #define MPI_IOCPAGE2_PAGEVERSION (0x01) 1347 1348 /* IOC Page 2 Capabilities flags */ 1349 1350 #define MPI_IOCPAGE2_CAP_FLAGS_IS_SUPPORT (0x00000001) 1351 #define MPI_IOCPAGE2_CAP_FLAGS_IME_SUPPORT (0x00000002) 1352 #define MPI_IOCPAGE2_CAP_FLAGS_IM_SUPPORT (0x00000004) 1353 #define MPI_IOCPAGE2_CAP_FLAGS_SES_SUPPORT (0x20000000) 1354 #define MPI_IOCPAGE2_CAP_FLAGS_SAFTE_SUPPORT (0x40000000) 1355 #define MPI_IOCPAGE2_CAP_FLAGS_CROSS_CHANNEL_SUPPORT (0x80000000) 1356 1357 /* IOC Page 2 Volume RAID Type values, also used in RAID Volume pages */ 1358 1359 #define MPI_RAID_VOL_TYPE_IS (0x00) 1360 #define MPI_RAID_VOL_TYPE_IME (0x01) 1361 #define MPI_RAID_VOL_TYPE_IM (0x02) 1362 1363 1364 typedef struct _IOC_3_PHYS_DISK 1365 { 1366 U8 PhysDiskID; /* 00h */ 1367 U8 PhysDiskBus; /* 01h */ 1368 U8 PhysDiskIOC; /* 02h */ 1369 U8 PhysDiskNum; /* 03h */ 1370 } IOC_3_PHYS_DISK, MPI_POINTER PTR_IOC_3_PHYS_DISK, 1371 Ioc3PhysDisk_t, MPI_POINTER pIoc3PhysDisk_t; 1372 1373 /* 1374 * Host code (drivers, BIOS, utilities, etc.) should leave this define set to 1375 * one and check Header.PageLength at runtime. 1376 */ 1377 #ifndef MPI_IOC_PAGE_3_PHYSDISK_MAX 1378 #define MPI_IOC_PAGE_3_PHYSDISK_MAX (1) 1379 #endif 1380 1381 typedef struct _CONFIG_PAGE_IOC_3 1382 { 1383 fCONFIG_PAGE_HEADER Header; /* 00h */ 1384 U8 NumPhysDisks; /* 04h */ 1385 U8 Reserved1; /* 05h */ 1386 U16 Reserved2; /* 06h */ 1387 IOC_3_PHYS_DISK PhysDisk[MPI_IOC_PAGE_3_PHYSDISK_MAX]; /* 08h */ 1388 } fCONFIG_PAGE_IOC_3, MPI_POINTER PTR_CONFIG_PAGE_IOC_3, 1389 IOCPage3_t, MPI_POINTER pIOCPage3_t; 1390 1391 #define MPI_IOCPAGE3_PAGEVERSION (0x00) 1392 1393 1394 typedef struct _IOC_4_SEP 1395 { 1396 U8 SEPTargetID; /* 00h */ 1397 U8 SEPBus; /* 01h */ 1398 U16 Reserved; /* 02h */ 1399 } IOC_4_SEP, MPI_POINTER PTR_IOC_4_SEP, 1400 Ioc4Sep_t, MPI_POINTER pIoc4Sep_t; 1401 1402 /* 1403 * Host code (drivers, BIOS, utilities, etc.) should leave this define set to 1404 * one and check Header.PageLength at runtime. 1405 */ 1406 #ifndef MPI_IOC_PAGE_4_SEP_MAX 1407 #define MPI_IOC_PAGE_4_SEP_MAX (1) 1408 #endif 1409 1410 typedef struct _CONFIG_PAGE_IOC_4 1411 { 1412 fCONFIG_PAGE_HEADER Header; /* 00h */ 1413 U8 ActiveSEP; /* 04h */ 1414 U8 MaxSEP; /* 05h */ 1415 U16 Reserved1; /* 06h */ 1416 IOC_4_SEP SEP[MPI_IOC_PAGE_4_SEP_MAX]; /* 08h */ 1417 } fCONFIG_PAGE_IOC_4, MPI_POINTER PTR_CONFIG_PAGE_IOC_4, 1418 IOCPage4_t, MPI_POINTER pIOCPage4_t; 1419 1420 #define MPI_IOCPAGE4_PAGEVERSION (0x00) 1421 1422 1423 /**************************************************************************** 1424 * SCSI Port Config Pages 1425 ****************************************************************************/ 1426 1427 typedef struct _CONFIG_PAGE_SCSI_PORT_0 1428 { 1429 fCONFIG_PAGE_HEADER Header; /* 00h */ 1430 U32 Capabilities; /* 04h */ 1431 U32 PhysicalInterface; /* 08h */ 1432 } fCONFIG_PAGE_SCSI_PORT_0, MPI_POINTER PTR_CONFIG_PAGE_SCSI_PORT_0, 1433 SCSIPortPage0_t, MPI_POINTER pSCSIPortPage0_t; 1434 1435 #define MPI_SCSIPORTPAGE0_PAGEVERSION (0x01) 1436 1437 #define MPI_SCSIPORTPAGE0_CAP_IU (0x00000001) 1438 #define MPI_SCSIPORTPAGE0_CAP_DT (0x00000002) 1439 #define MPI_SCSIPORTPAGE0_CAP_QAS (0x00000004) 1440 #define MPI_SCSIPORTPAGE0_CAP_MIN_SYNC_PERIOD_MASK (0x0000FF00) 1441 #define MPI_SCSIPORTPAGE0_CAP_MAX_SYNC_OFFSET_MASK (0x00FF0000) 1442 #define MPI_SCSIPORTPAGE0_CAP_WIDE (0x20000000) 1443 #define MPI_SCSIPORTPAGE0_CAP_AIP (0x80000000) 1444 1445 #define MPI_SCSIPORTPAGE0_PHY_SIGNAL_TYPE_MASK (0x00000003) 1446 #define MPI_SCSIPORTPAGE0_PHY_SIGNAL_HVD (0x01) 1447 #define MPI_SCSIPORTPAGE0_PHY_SIGNAL_SE (0x02) 1448 #define MPI_SCSIPORTPAGE0_PHY_SIGNAL_LVD (0x03) 1449 1450 1451 typedef struct _CONFIG_PAGE_SCSI_PORT_1 1452 { 1453 fCONFIG_PAGE_HEADER Header; /* 00h */ 1454 U32 Configuration; /* 04h */ 1455 U32 OnBusTimerValue; /* 08h */ 1456 } fCONFIG_PAGE_SCSI_PORT_1, MPI_POINTER PTR_CONFIG_PAGE_SCSI_PORT_1, 1457 SCSIPortPage1_t, MPI_POINTER pSCSIPortPage1_t; 1458 1459 #define MPI_SCSIPORTPAGE1_PAGEVERSION (0x02) 1460 1461 #define MPI_SCSIPORTPAGE1_CFG_PORT_SCSI_ID_MASK (0x000000FF) 1462 #define MPI_SCSIPORTPAGE1_CFG_PORT_RESPONSE_ID_MASK (0xFFFF0000) 1463 1464 1465 typedef struct _MPI_DEVICE_INFO 1466 { 1467 U8 Timeout; /* 00h */ 1468 U8 SyncFactor; /* 01h */ 1469 U16 DeviceFlags; /* 02h */ 1470 } MPI_DEVICE_INFO, MPI_POINTER PTR_MPI_DEVICE_INFO, 1471 MpiDeviceInfo_t, MPI_POINTER pMpiDeviceInfo_t; 1472 1473 typedef struct _CONFIG_PAGE_SCSI_PORT_2 1474 { 1475 fCONFIG_PAGE_HEADER Header; /* 00h */ 1476 U32 PortFlags; /* 04h */ 1477 U32 PortSettings; /* 08h */ 1478 MPI_DEVICE_INFO DeviceSettings[16]; /* 0Ch */ 1479 } fCONFIG_PAGE_SCSI_PORT_2, MPI_POINTER PTR_CONFIG_PAGE_SCSI_PORT_2, 1480 SCSIPortPage2_t, MPI_POINTER pSCSIPortPage2_t; 1481 1482 #define MPI_SCSIPORTPAGE2_PAGEVERSION (0x01) 1483 1484 #define MPI_SCSIPORTPAGE2_PORT_FLAGS_SCAN_HIGH_TO_LOW (0x00000001) 1485 #define MPI_SCSIPORTPAGE2_PORT_FLAGS_AVOID_SCSI_RESET (0x00000004) 1486 #define MPI_SCSIPORTPAGE2_PORT_FLAGS_ALTERNATE_CHS (0x00000008) 1487 #define MPI_SCSIPORTPAGE2_PORT_FLAGS_TERMINATION_DISABLE (0x00000010) 1488 1489 #define MPI_SCSIPORTPAGE2_PORT_HOST_ID_MASK (0x0000000F) 1490 #define MPI_SCSIPORTPAGE2_PORT_MASK_INIT_HBA (0x00000030) 1491 #define MPI_SCSIPORTPAGE2_PORT_DISABLE_INIT_HBA (0x00000000) 1492 #define MPI_SCSIPORTPAGE2_PORT_BIOS_INIT_HBA (0x00000010) 1493 #define MPI_SCSIPORTPAGE2_PORT_OS_INIT_HBA (0x00000020) 1494 #define MPI_SCSIPORTPAGE2_PORT_BIOS_OS_INIT_HBA (0x00000030) 1495 #define MPI_SCSIPORTPAGE2_PORT_REMOVABLE_MEDIA (0x000000C0) 1496 #define MPI_SCSIPORTPAGE2_PORT_SPINUP_DELAY_MASK (0x00000F00) 1497 #define MPI_SCSIPORTPAGE2_PORT_MASK_NEGO_MASTER_SETTINGS (0x00003000) 1498 #define MPI_SCSIPORTPAGE2_PORT_NEGO_MASTER_SETTINGS (0x00000000) 1499 #define MPI_SCSIPORTPAGE2_PORT_NONE_MASTER_SETTINGS (0x00001000) 1500 #define MPI_SCSIPORTPAGE2_PORT_ALL_MASTER_SETTINGS (0x00003000) 1501 1502 #define MPI_SCSIPORTPAGE2_DEVICE_DISCONNECT_ENABLE (0x0001) 1503 #define MPI_SCSIPORTPAGE2_DEVICE_ID_SCAN_ENABLE (0x0002) 1504 #define MPI_SCSIPORTPAGE2_DEVICE_LUN_SCAN_ENABLE (0x0004) 1505 #define MPI_SCSIPORTPAGE2_DEVICE_TAG_QUEUE_ENABLE (0x0008) 1506 #define MPI_SCSIPORTPAGE2_DEVICE_WIDE_DISABLE (0x0010) 1507 #define MPI_SCSIPORTPAGE2_DEVICE_BOOT_CHOICE (0x0020) 1508 1509 1510 /**************************************************************************** 1511 * SCSI Target Device Config Pages 1512 ****************************************************************************/ 1513 1514 typedef struct _CONFIG_PAGE_SCSI_DEVICE_0 1515 { 1516 fCONFIG_PAGE_HEADER Header; /* 00h */ 1517 U32 NegotiatedParameters; /* 04h */ 1518 U32 Information; /* 08h */ 1519 } fCONFIG_PAGE_SCSI_DEVICE_0, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_0, 1520 SCSIDevicePage0_t, MPI_POINTER pSCSIDevicePage0_t; 1521 1522 #define MPI_SCSIDEVPAGE0_PAGEVERSION (0x02) 1523 1524 #define MPI_SCSIDEVPAGE0_NP_IU (0x00000001) 1525 #define MPI_SCSIDEVPAGE0_NP_DT (0x00000002) 1526 #define MPI_SCSIDEVPAGE0_NP_QAS (0x00000004) 1527 #define MPI_SCSIDEVPAGE0_NP_NEG_SYNC_PERIOD_MASK (0x0000FF00) 1528 #define MPI_SCSIDEVPAGE0_NP_NEG_SYNC_OFFSET_MASK (0x00FF0000) 1529 #define MPI_SCSIDEVPAGE0_NP_WIDE (0x20000000) 1530 #define MPI_SCSIDEVPAGE0_NP_AIP (0x80000000) 1531 1532 #define MPI_SCSIDEVPAGE0_INFO_PARAMS_NEGOTIATED (0x00000001) 1533 #define MPI_SCSIDEVPAGE0_INFO_SDTR_REJECTED (0x00000002) 1534 #define MPI_SCSIDEVPAGE0_INFO_WDTR_REJECTED (0x00000004) 1535 #define MPI_SCSIDEVPAGE0_INFO_PPR_REJECTED (0x00000008) 1536 1537 1538 typedef struct _CONFIG_PAGE_SCSI_DEVICE_1 1539 { 1540 fCONFIG_PAGE_HEADER Header; /* 00h */ 1541 U32 RequestedParameters; /* 04h */ 1542 U32 Reserved; /* 08h */ 1543 U32 Configuration; /* 0Ch */ 1544 } fCONFIG_PAGE_SCSI_DEVICE_1, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_1, 1545 SCSIDevicePage1_t, MPI_POINTER pSCSIDevicePage1_t; 1546 1547 #define MPI_SCSIDEVPAGE1_PAGEVERSION (0x03) 1548 1549 #define MPI_SCSIDEVPAGE1_RP_IU (0x00000001) 1550 #define MPI_SCSIDEVPAGE1_RP_DT (0x00000002) 1551 #define MPI_SCSIDEVPAGE1_RP_QAS (0x00000004) 1552 #define MPI_SCSIDEVPAGE1_RP_MIN_SYNC_PERIOD_MASK (0x0000FF00) 1553 #define MPI_SCSIDEVPAGE1_RP_MAX_SYNC_OFFSET_MASK (0x00FF0000) 1554 #define MPI_SCSIDEVPAGE1_RP_WIDE (0x20000000) 1555 #define MPI_SCSIDEVPAGE1_RP_AIP (0x80000000) 1556 1557 #define MPI_SCSIDEVPAGE1_DV_LVD_DRIVE_STRENGTH_MASK (0x00000003) 1558 #define MPI_SCSIDEVPAGE1_DV_SE_SLEW_RATE_MASK (0x00000300) 1559 1560 #define MPI_SCSIDEVPAGE1_CONF_WDTR_DISALLOWED (0x00000002) 1561 #define MPI_SCSIDEVPAGE1_CONF_SDTR_DISALLOWED (0x00000004) 1562 1563 1564 typedef struct _CONFIG_PAGE_SCSI_DEVICE_2 1565 { 1566 fCONFIG_PAGE_HEADER Header; /* 00h */ 1567 U32 DomainValidation; /* 04h */ 1568 U32 ParityPipeSelect; /* 08h */ 1569 U32 DataPipeSelect; /* 0Ch */ 1570 } fCONFIG_PAGE_SCSI_DEVICE_2, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_2, 1571 SCSIDevicePage2_t, MPI_POINTER pSCSIDevicePage2_t; 1572 1573 #define MPI_SCSIDEVPAGE2_PAGEVERSION (0x00) 1574 1575 #define MPI_SCSIDEVPAGE2_DV_ISI_ENABLE (0x00000010) 1576 #define MPI_SCSIDEVPAGE2_DV_SECONDARY_DRIVER_ENABLE (0x00000020) 1577 #define MPI_SCSIDEVPAGE2_DV_SLEW_RATE_CTRL (0x00000380) 1578 #define MPI_SCSIDEVPAGE2_DV_PRIM_DRIVE_STR_CTRL (0x00001C00) 1579 #define MPI_SCSIDEVPAGE2_DV_SECOND_DRIVE_STR_CTRL (0x0000E000) 1580 #define MPI_SCSIDEVPAGE2_DV_XCLKH_ST (0x10000000) 1581 #define MPI_SCSIDEVPAGE2_DV_XCLKS_ST (0x20000000) 1582 #define MPI_SCSIDEVPAGE2_DV_XCLKH_DT (0x40000000) 1583 #define MPI_SCSIDEVPAGE2_DV_XCLKS_DT (0x80000000) 1584 1585 #define MPI_SCSIDEVPAGE2_PPS_PPS_MASK (0x00000003) 1586 1587 #define MPI_SCSIDEVPAGE2_DPS_BIT_0_PL_SELECT_MASK (0x00000003) 1588 #define MPI_SCSIDEVPAGE2_DPS_BIT_1_PL_SELECT_MASK (0x0000000C) 1589 #define MPI_SCSIDEVPAGE2_DPS_BIT_2_PL_SELECT_MASK (0x00000030) 1590 #define MPI_SCSIDEVPAGE2_DPS_BIT_3_PL_SELECT_MASK (0x000000C0) 1591 #define MPI_SCSIDEVPAGE2_DPS_BIT_4_PL_SELECT_MASK (0x00000300) 1592 #define MPI_SCSIDEVPAGE2_DPS_BIT_5_PL_SELECT_MASK (0x00000C00) 1593 #define MPI_SCSIDEVPAGE2_DPS_BIT_6_PL_SELECT_MASK (0x00003000) 1594 #define MPI_SCSIDEVPAGE2_DPS_BIT_7_PL_SELECT_MASK (0x0000C000) 1595 #define MPI_SCSIDEVPAGE2_DPS_BIT_8_PL_SELECT_MASK (0x00030000) 1596 #define MPI_SCSIDEVPAGE2_DPS_BIT_9_PL_SELECT_MASK (0x000C0000) 1597 #define MPI_SCSIDEVPAGE2_DPS_BIT_10_PL_SELECT_MASK (0x00300000) 1598 #define MPI_SCSIDEVPAGE2_DPS_BIT_11_PL_SELECT_MASK (0x00C00000) 1599 #define MPI_SCSIDEVPAGE2_DPS_BIT_12_PL_SELECT_MASK (0x03000000) 1600 #define MPI_SCSIDEVPAGE2_DPS_BIT_13_PL_SELECT_MASK (0x0C000000) 1601 #define MPI_SCSIDEVPAGE2_DPS_BIT_14_PL_SELECT_MASK (0x30000000) 1602 #define MPI_SCSIDEVPAGE2_DPS_BIT_15_PL_SELECT_MASK (0xC0000000) 1603 1604 1605 /**************************************************************************** 1606 * FC Port Config Pages 1607 ****************************************************************************/ 1608 1609 typedef struct _CONFIG_PAGE_FC_PORT_0 1610 { 1611 fCONFIG_PAGE_HEADER Header; /* 00h */ 1612 U32 Flags; /* 04h */ 1613 U8 MPIPortNumber; /* 08h */ 1614 U8 LinkType; /* 09h */ 1615 U8 PortState; /* 0Ah */ 1616 U8 Reserved; /* 0Bh */ 1617 U32 PortIdentifier; /* 0Ch */ 1618 U64 WWNN; /* 10h */ 1619 U64 WWPN; /* 18h */ 1620 U32 SupportedServiceClass; /* 20h */ 1621 U32 SupportedSpeeds; /* 24h */ 1622 U32 CurrentSpeed; /* 28h */ 1623 U32 MaxFrameSize; /* 2Ch */ 1624 U64 FabricWWNN; /* 30h */ 1625 U64 FabricWWPN; /* 38h */ 1626 U32 DiscoveredPortsCount; /* 40h */ 1627 U32 MaxInitiators; /* 44h */ 1628 } fCONFIG_PAGE_FC_PORT_0, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_0, 1629 FCPortPage0_t, MPI_POINTER pFCPortPage0_t; 1630 1631 #define MPI_FCPORTPAGE0_PAGEVERSION (0x01) 1632 1633 #define MPI_FCPORTPAGE0_FLAGS_PROT_MASK (0x0000000F) 1634 #define MPI_FCPORTPAGE0_FLAGS_PROT_FCP_INIT (MPI_PORTFACTS_PROTOCOL_INITIATOR) 1635 #define MPI_FCPORTPAGE0_FLAGS_PROT_FCP_TARG (MPI_PORTFACTS_PROTOCOL_TARGET) 1636 #define MPI_FCPORTPAGE0_FLAGS_PROT_LAN (MPI_PORTFACTS_PROTOCOL_LAN) 1637 #define MPI_FCPORTPAGE0_FLAGS_PROT_LOGBUSADDR (MPI_PORTFACTS_PROTOCOL_LOGBUSADDR) 1638 1639 #define MPI_FCPORTPAGE0_FLAGS_ALIAS_ALPA_SUPPORTED (0x00000010) 1640 #define MPI_FCPORTPAGE0_FLAGS_ALIAS_WWN_SUPPORTED (0x00000020) 1641 #define MPI_FCPORTPAGE0_FLAGS_FABRIC_WWN_VALID (0x00000030) 1642 1643 #define MPI_FCPORTPAGE0_FLAGS_ATTACH_TYPE_MASK (0x00000F00) 1644 #define MPI_FCPORTPAGE0_FLAGS_ATTACH_NO_INIT (0x00000000) 1645 #define MPI_FCPORTPAGE0_FLAGS_ATTACH_POINT_TO_POINT (0x00000100) 1646 #define MPI_FCPORTPAGE0_FLAGS_ATTACH_PRIVATE_LOOP (0x00000200) 1647 #define MPI_FCPORTPAGE0_FLAGS_ATTACH_FABRIC_DIRECT (0x00000400) 1648 #define MPI_FCPORTPAGE0_FLAGS_ATTACH_PUBLIC_LOOP (0x00000800) 1649 1650 #define MPI_FCPORTPAGE0_LTYPE_RESERVED (0x00) 1651 #define MPI_FCPORTPAGE0_LTYPE_OTHER (0x01) 1652 #define MPI_FCPORTPAGE0_LTYPE_UNKNOWN (0x02) 1653 #define MPI_FCPORTPAGE0_LTYPE_COPPER (0x03) 1654 #define MPI_FCPORTPAGE0_LTYPE_SINGLE_1300 (0x04) 1655 #define MPI_FCPORTPAGE0_LTYPE_SINGLE_1500 (0x05) 1656 #define MPI_FCPORTPAGE0_LTYPE_50_LASER_MULTI (0x06) 1657 #define MPI_FCPORTPAGE0_LTYPE_50_LED_MULTI (0x07) 1658 #define MPI_FCPORTPAGE0_LTYPE_62_LASER_MULTI (0x08) 1659 #define MPI_FCPORTPAGE0_LTYPE_62_LED_MULTI (0x09) 1660 #define MPI_FCPORTPAGE0_LTYPE_MULTI_LONG_WAVE (0x0A) 1661 #define MPI_FCPORTPAGE0_LTYPE_MULTI_SHORT_WAVE (0x0B) 1662 #define MPI_FCPORTPAGE0_LTYPE_LASER_SHORT_WAVE (0x0C) 1663 #define MPI_FCPORTPAGE0_LTYPE_LED_SHORT_WAVE (0x0D) 1664 #define MPI_FCPORTPAGE0_LTYPE_1300_LONG_WAVE (0x0E) 1665 #define MPI_FCPORTPAGE0_LTYPE_1500_LONG_WAVE (0x0F) 1666 1667 #define MPI_FCPORTPAGE0_PORTSTATE_UNKNOWN (0x01) /*(SNIA)HBA_PORTSTATE_UNKNOWN 1 Unknown */ 1668 #define MPI_FCPORTPAGE0_PORTSTATE_ONLINE (0x02) /*(SNIA)HBA_PORTSTATE_ONLINE 2 Operational */ 1669 #define MPI_FCPORTPAGE0_PORTSTATE_OFFLINE (0x03) /*(SNIA)HBA_PORTSTATE_OFFLINE 3 User Offline */ 1670 #define MPI_FCPORTPAGE0_PORTSTATE_BYPASSED (0x04) /*(SNIA)HBA_PORTSTATE_BYPASSED 4 Bypassed */ 1671 #define MPI_FCPORTPAGE0_PORTSTATE_DIAGNOST (0x05) /*(SNIA)HBA_PORTSTATE_DIAGNOSTICS 5 In diagnostics mode */ 1672 #define MPI_FCPORTPAGE0_PORTSTATE_LINKDOWN (0x06) /*(SNIA)HBA_PORTSTATE_LINKDOWN 6 Link Down */ 1673 #define MPI_FCPORTPAGE0_PORTSTATE_ERROR (0x07) /*(SNIA)HBA_PORTSTATE_ERROR 7 Port Error */ 1674 #define MPI_FCPORTPAGE0_PORTSTATE_LOOPBACK (0x08) /*(SNIA)HBA_PORTSTATE_LOOPBACK 8 Loopback */ 1675 1676 #define MPI_FCPORTPAGE0_SUPPORT_CLASS_1 (0x00000001) 1677 #define MPI_FCPORTPAGE0_SUPPORT_CLASS_2 (0x00000002) 1678 #define MPI_FCPORTPAGE0_SUPPORT_CLASS_3 (0x00000004) 1679 1680 #define MPI_FCPORTPAGE0_SUPPORT_1GBIT_SPEED (0x00000001) /* (SNIA)HBA_PORTSPEED_1GBIT 1 1 GBit/sec */ 1681 #define MPI_FCPORTPAGE0_SUPPORT_2GBIT_SPEED (0x00000002) /* (SNIA)HBA_PORTSPEED_2GBIT 2 2 GBit/sec */ 1682 #define MPI_FCPORTPAGE0_SUPPORT_10GBIT_SPEED (0x00000004) /* (SNIA)HBA_PORTSPEED_10GBIT 4 10 GBit/sec */ 1683 1684 #define MPI_FCPORTPAGE0_CURRENT_SPEED_1GBIT MPI_FCPORTPAGE0_SUPPORT_1GBIT_SPEED 1685 #define MPI_FCPORTPAGE0_CURRENT_SPEED_2GBIT MPI_FCPORTPAGE0_SUPPORT_2GBIT_SPEED 1686 #define MPI_FCPORTPAGE0_CURRENT_SPEED_10GBIT MPI_FCPORTPAGE0_SUPPORT_10GBIT_SPEED 1687 1688 1689 typedef struct _CONFIG_PAGE_FC_PORT_1 1690 { 1691 fCONFIG_PAGE_HEADER Header; /* 00h */ 1692 U32 Flags; /* 04h */ 1693 U64 NoSEEPROMWWNN; /* 08h */ 1694 U64 NoSEEPROMWWPN; /* 10h */ 1695 U8 HardALPA; /* 18h */ 1696 U8 LinkConfig; /* 19h */ 1697 U8 TopologyConfig; /* 1Ah */ 1698 U8 Reserved; /* 1Bh */ 1699 } fCONFIG_PAGE_FC_PORT_1, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_1, 1700 FCPortPage1_t, MPI_POINTER pFCPortPage1_t; 1701 1702 #define MPI_FCPORTPAGE1_PAGEVERSION (0x02) 1703 1704 #define MPI_FCPORTPAGE1_FLAGS_EXT_FCP_STATUS_EN (0x08000000) 1705 #define MPI_FCPORTPAGE1_FLAGS_IMMEDIATE_ERROR_REPLY (0x04000000) 1706 #define MPI_FCPORTPAGE1_FLAGS_SORT_BY_DID (0x00000001) 1707 #define MPI_FCPORTPAGE1_FLAGS_SORT_BY_WWN (0x00000000) 1708 1709 #define MPI_FCPORTPAGE1_FLAGS_PROT_MASK (0xF0000000) 1710 #define MPI_FCPORTPAGE1_FLAGS_PROT_SHIFT (28) 1711 #define MPI_FCPORTPAGE1_FLAGS_PROT_FCP_INIT ((U32)MPI_PORTFACTS_PROTOCOL_INITIATOR << MPI_FCPORTPAGE1_FLAGS_PROT_SHIFT) 1712 #define MPI_FCPORTPAGE1_FLAGS_PROT_FCP_TARG ((U32)MPI_PORTFACTS_PROTOCOL_TARGET << MPI_FCPORTPAGE1_FLAGS_PROT_SHIFT) 1713 #define MPI_FCPORTPAGE1_FLAGS_PROT_LAN ((U32)MPI_PORTFACTS_PROTOCOL_LAN << MPI_FCPORTPAGE1_FLAGS_PROT_SHIFT) 1714 #define MPI_FCPORTPAGE1_FLAGS_PROT_LOGBUSADDR ((U32)MPI_PORTFACTS_PROTOCOL_LOGBUSADDR << MPI_FCPORTPAGE1_FLAGS_PROT_SHIFT) 1715 1716 #define MPI_FCPORTPAGE1_HARD_ALPA_NOT_USED (0xFF) 1717 1718 #define MPI_FCPORTPAGE1_LCONFIG_SPEED_MASK (0x0F) 1719 #define MPI_FCPORTPAGE1_LCONFIG_SPEED_1GIG (0x00) 1720 #define MPI_FCPORTPAGE1_LCONFIG_SPEED_2GIG (0x01) 1721 #define MPI_FCPORTPAGE1_LCONFIG_SPEED_4GIG (0x02) 1722 #define MPI_FCPORTPAGE1_LCONFIG_SPEED_10GIG (0x03) 1723 #define MPI_FCPORTPAGE1_LCONFIG_SPEED_AUTO (0x0F) 1724 1725 #define MPI_FCPORTPAGE1_TOPOLOGY_MASK (0x0F) 1726 #define MPI_FCPORTPAGE1_TOPOLOGY_NLPORT (0x01) 1727 #define MPI_FCPORTPAGE1_TOPOLOGY_NPORT (0x02) 1728 #define MPI_FCPORTPAGE1_TOPOLOGY_AUTO (0x0F) 1729 1730 1731 typedef struct _CONFIG_PAGE_FC_PORT_2 1732 { 1733 fCONFIG_PAGE_HEADER Header; /* 00h */ 1734 U8 NumberActive; /* 04h */ 1735 U8 ALPA[127]; /* 05h */ 1736 } fCONFIG_PAGE_FC_PORT_2, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_2, 1737 FCPortPage2_t, MPI_POINTER pFCPortPage2_t; 1738 1739 #define MPI_FCPORTPAGE2_PAGEVERSION (0x01) 1740 1741 1742 typedef struct _WWN_FORMAT 1743 { 1744 U64 WWNN; /* 00h */ 1745 U64 WWPN; /* 08h */ 1746 } WWN_FORMAT, MPI_POINTER PTR_WWN_FORMAT, 1747 WWNFormat, MPI_POINTER pWWNFormat; 1748 1749 typedef union _FC_PORT_PERSISTENT_PHYSICAL_ID 1750 { 1751 WWN_FORMAT WWN; 1752 U32 Did; 1753 } FC_PORT_PERSISTENT_PHYSICAL_ID, MPI_POINTER PTR_FC_PORT_PERSISTENT_PHYSICAL_ID, 1754 PersistentPhysicalId_t, MPI_POINTER pPersistentPhysicalId_t; 1755 1756 typedef struct _FC_PORT_PERSISTENT 1757 { 1758 FC_PORT_PERSISTENT_PHYSICAL_ID PhysicalIdentifier; /* 00h */ 1759 U8 TargetID; /* 10h */ 1760 U8 Bus; /* 11h */ 1761 U16 Flags; /* 12h */ 1762 } FC_PORT_PERSISTENT, MPI_POINTER PTR_FC_PORT_PERSISTENT, 1763 PersistentData_t, MPI_POINTER pPersistentData_t; 1764 1765 #define MPI_PERSISTENT_FLAGS_SHIFT (16) 1766 #define MPI_PERSISTENT_FLAGS_ENTRY_VALID (0x0001) 1767 #define MPI_PERSISTENT_FLAGS_SCAN_ID (0x0002) 1768 #define MPI_PERSISTENT_FLAGS_SCAN_LUNS (0x0004) 1769 #define MPI_PERSISTENT_FLAGS_BOOT_DEVICE (0x0008) 1770 #define MPI_PERSISTENT_FLAGS_BY_DID (0x0080) 1771 1772 /* 1773 * Host code (drivers, BIOS, utilities, etc.) should leave this define set to 1774 * one and check Header.PageLength at runtime. 1775 */ 1776 #ifndef MPI_FC_PORT_PAGE_3_ENTRY_MAX 1777 #define MPI_FC_PORT_PAGE_3_ENTRY_MAX (1) 1778 #endif 1779 1780 typedef struct _CONFIG_PAGE_FC_PORT_3 1781 { 1782 fCONFIG_PAGE_HEADER Header; /* 00h */ 1783 FC_PORT_PERSISTENT Entry[MPI_FC_PORT_PAGE_3_ENTRY_MAX]; /* 04h */ 1784 } fCONFIG_PAGE_FC_PORT_3, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_3, 1785 FCPortPage3_t, MPI_POINTER pFCPortPage3_t; 1786 1787 #define MPI_FCPORTPAGE3_PAGEVERSION (0x01) 1788 1789 1790 typedef struct _CONFIG_PAGE_FC_PORT_4 1791 { 1792 fCONFIG_PAGE_HEADER Header; /* 00h */ 1793 U32 PortFlags; /* 04h */ 1794 U32 PortSettings; /* 08h */ 1795 } fCONFIG_PAGE_FC_PORT_4, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_4, 1796 FCPortPage4_t, MPI_POINTER pFCPortPage4_t; 1797 1798 #define MPI_FCPORTPAGE4_PAGEVERSION (0x00) 1799 1800 #define MPI_FCPORTPAGE4_PORT_FLAGS_ALTERNATE_CHS (0x00000008) 1801 1802 #define MPI_FCPORTPAGE4_PORT_MASK_INIT_HBA (0x00000030) 1803 #define MPI_FCPORTPAGE4_PORT_DISABLE_INIT_HBA (0x00000000) 1804 #define MPI_FCPORTPAGE4_PORT_BIOS_INIT_HBA (0x00000010) 1805 #define MPI_FCPORTPAGE4_PORT_OS_INIT_HBA (0x00000020) 1806 #define MPI_FCPORTPAGE4_PORT_BIOS_OS_INIT_HBA (0x00000030) 1807 #define MPI_FCPORTPAGE4_PORT_REMOVABLE_MEDIA (0x000000C0) 1808 #define MPI_FCPORTPAGE4_PORT_SPINUP_DELAY_MASK (0x00000F00) 1809 1810 1811 typedef struct _CONFIG_PAGE_FC_PORT_5_ALIAS_INFO 1812 { 1813 U8 Flags; /* 00h */ 1814 U8 AliasAlpa; /* 01h */ 1815 U16 Reserved; /* 02h */ 1816 U64 AliasWWNN; /* 04h */ 1817 U64 AliasWWPN; /* 0Ch */ 1818 } fCONFIG_PAGE_FC_PORT_5_ALIAS_INFO, 1819 MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_5_ALIAS_INFO, 1820 FcPortPage5AliasInfo_t, MPI_POINTER pFcPortPage5AliasInfo_t; 1821 1822 /* 1823 * Host code (drivers, BIOS, utilities, etc.) should leave this define set to 1824 * one and check Header.PageLength at runtime. 1825 */ 1826 #ifndef MPI_FC_PORT_PAGE_5_ALIAS_MAX 1827 #define MPI_FC_PORT_PAGE_5_ALIAS_MAX (1) 1828 #endif 1829 1830 typedef struct _CONFIG_PAGE_FC_PORT_5 1831 { 1832 fCONFIG_PAGE_HEADER Header; /* 00h */ 1833 fCONFIG_PAGE_FC_PORT_5_ALIAS_INFO AliasInfo[MPI_FC_PORT_PAGE_5_ALIAS_MAX];/* 04h */ 1834 } fCONFIG_PAGE_FC_PORT_5, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_5, 1835 FCPortPage5_t, MPI_POINTER pFCPortPage5_t; 1836 1837 #define MPI_FCPORTPAGE5_PAGEVERSION (0x00) 1838 1839 #define MPI_FCPORTPAGE5_FLAGS_ALIAS_ALPA_VALID (0x01) 1840 #define MPI_FCPORTPAGE5_FLAGS_ALIAS_WWN_VALID (0x02) 1841 1842 1843 typedef struct _CONFIG_PAGE_FC_PORT_6 1844 { 1845 fCONFIG_PAGE_HEADER Header; /* 00h */ 1846 U32 Reserved; /* 04h */ 1847 U64 TimeSinceReset; /* 08h */ 1848 U64 TxFrames; /* 10h */ 1849 U64 RxFrames; /* 18h */ 1850 U64 TxWords; /* 20h */ 1851 U64 RxWords; /* 28h */ 1852 U64 LipCount; /* 30h */ 1853 U64 NosCount; /* 38h */ 1854 U64 ErrorFrames; /* 40h */ 1855 U64 DumpedFrames; /* 48h */ 1856 U64 LinkFailureCount; /* 50h */ 1857 U64 LossOfSyncCount; /* 58h */ 1858 U64 LossOfSignalCount; /* 60h */ 1859 U64 PrimativeSeqErrCount; /* 68h */ 1860 U64 InvalidTxWordCount; /* 70h */ 1861 U64 InvalidCrcCount; /* 78h */ 1862 U64 FcpInitiatorIoCount; /* 80h */ 1863 } fCONFIG_PAGE_FC_PORT_6, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_6, 1864 FCPortPage6_t, MPI_POINTER pFCPortPage6_t; 1865 1866 #define MPI_FCPORTPAGE6_PAGEVERSION (0x00) 1867 1868 1869 typedef struct _CONFIG_PAGE_FC_PORT_7 1870 { 1871 fCONFIG_PAGE_HEADER Header; /* 00h */ 1872 U32 Reserved; /* 04h */ 1873 U8 PortSymbolicName[256]; /* 08h */ 1874 } fCONFIG_PAGE_FC_PORT_7, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_7, 1875 FCPortPage7_t, MPI_POINTER pFCPortPage7_t; 1876 1877 #define MPI_FCPORTPAGE7_PAGEVERSION (0x00) 1878 1879 1880 typedef struct _CONFIG_PAGE_FC_PORT_8 1881 { 1882 fCONFIG_PAGE_HEADER Header; /* 00h */ 1883 U32 BitVector[8]; /* 04h */ 1884 } fCONFIG_PAGE_FC_PORT_8, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_8, 1885 FCPortPage8_t, MPI_POINTER pFCPortPage8_t; 1886 1887 #define MPI_FCPORTPAGE8_PAGEVERSION (0x00) 1888 1889 1890 typedef struct _CONFIG_PAGE_FC_PORT_9 1891 { 1892 fCONFIG_PAGE_HEADER Header; /* 00h */ 1893 U32 Reserved; /* 04h */ 1894 U64 GlobalWWPN; /* 08h */ 1895 U64 GlobalWWNN; /* 10h */ 1896 U32 UnitType; /* 18h */ 1897 U32 PhysicalPortNumber; /* 1Ch */ 1898 U32 NumAttachedNodes; /* 20h */ 1899 U16 IPVersion; /* 24h */ 1900 U16 UDPPortNumber; /* 26h */ 1901 U8 IPAddress[16]; /* 28h */ 1902 U16 Reserved1; /* 38h */ 1903 U16 TopologyDiscoveryFlags; /* 3Ah */ 1904 } fCONFIG_PAGE_FC_PORT_9, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_9, 1905 FCPortPage9_t, MPI_POINTER pFCPortPage9_t; 1906 1907 #define MPI_FCPORTPAGE9_PAGEVERSION (0x00) 1908 1909 1910 /**************************************************************************** 1911 * FC Device Config Pages 1912 ****************************************************************************/ 1913 1914 typedef struct _CONFIG_PAGE_FC_DEVICE_0 1915 { 1916 fCONFIG_PAGE_HEADER Header; /* 00h */ 1917 U64 WWNN; /* 04h */ 1918 U64 WWPN; /* 0Ch */ 1919 U32 PortIdentifier; /* 14h */ 1920 U8 Protocol; /* 18h */ 1921 U8 Flags; /* 19h */ 1922 U16 BBCredit; /* 1Ah */ 1923 U16 MaxRxFrameSize; /* 1Ch */ 1924 U8 Reserved1; /* 1Eh */ 1925 U8 PortNumber; /* 1Fh */ 1926 U8 FcPhLowestVersion; /* 20h */ 1927 U8 FcPhHighestVersion; /* 21h */ 1928 U8 CurrentTargetID; /* 22h */ 1929 U8 CurrentBus; /* 23h */ 1930 } fCONFIG_PAGE_FC_DEVICE_0, MPI_POINTER PTR_CONFIG_PAGE_FC_DEVICE_0, 1931 FCDevicePage0_t, MPI_POINTER pFCDevicePage0_t; 1932 1933 #define MPI_FC_DEVICE_PAGE0_PAGEVERSION (0x02) 1934 1935 #define MPI_FC_DEVICE_PAGE0_FLAGS_TARGETID_BUS_VALID (0x01) 1936 1937 #define MPI_FC_DEVICE_PAGE0_PROT_IP (0x01) 1938 #define MPI_FC_DEVICE_PAGE0_PROT_FCP_TARGET (0x02) 1939 #define MPI_FC_DEVICE_PAGE0_PROT_FCP_INITIATOR (0x04) 1940 1941 #define MPI_FC_DEVICE_PAGE0_PGAD_PORT_MASK (MPI_FC_DEVICE_PGAD_PORT_MASK) 1942 #define MPI_FC_DEVICE_PAGE0_PGAD_FORM_MASK (MPI_FC_DEVICE_PGAD_FORM_MASK) 1943 #define MPI_FC_DEVICE_PAGE0_PGAD_FORM_NEXT_DID (MPI_FC_DEVICE_PGAD_FORM_NEXT_DID) 1944 #define MPI_FC_DEVICE_PAGE0_PGAD_FORM_BUS_TID (MPI_FC_DEVICE_PGAD_FORM_BUS_TID) 1945 #define MPI_FC_DEVICE_PAGE0_PGAD_DID_MASK (MPI_FC_DEVICE_PGAD_ND_DID_MASK) 1946 #define MPI_FC_DEVICE_PAGE0_PGAD_BUS_MASK (MPI_FC_DEVICE_PGAD_BT_BUS_MASK) 1947 #define MPI_FC_DEVICE_PAGE0_PGAD_BUS_SHIFT (MPI_FC_DEVICE_PGAD_BT_BUS_SHIFT) 1948 #define MPI_FC_DEVICE_PAGE0_PGAD_TID_MASK (MPI_FC_DEVICE_PGAD_BT_TID_MASK) 1949 1950 1951 /**************************************************************************** 1952 * RAID Volume Config Pages 1953 ****************************************************************************/ 1954 1955 typedef struct _RAID_VOL0_PHYS_DISK 1956 { 1957 U16 Reserved; /* 00h */ 1958 U8 PhysDiskMap; /* 02h */ 1959 U8 PhysDiskNum; /* 03h */ 1960 } RAID_VOL0_PHYS_DISK, MPI_POINTER PTR_RAID_VOL0_PHYS_DISK, 1961 RaidVol0PhysDisk_t, MPI_POINTER pRaidVol0PhysDisk_t; 1962 1963 #define MPI_RAIDVOL0_PHYSDISK_PRIMARY (0x01) 1964 #define MPI_RAIDVOL0_PHYSDISK_SECONDARY (0x02) 1965 1966 typedef struct _RAID_VOL0_STATUS 1967 { 1968 U8 Flags; /* 00h */ 1969 U8 State; /* 01h */ 1970 U16 Reserved; /* 02h */ 1971 } RAID_VOL0_STATUS, MPI_POINTER PTR_RAID_VOL0_STATUS, 1972 RaidVol0Status_t, MPI_POINTER pRaidVol0Status_t; 1973 1974 /* RAID Volume Page 0 VolumeStatus defines */ 1975 1976 #define MPI_RAIDVOL0_STATUS_FLAG_ENABLED (0x01) 1977 #define MPI_RAIDVOL0_STATUS_FLAG_QUIESCED (0x02) 1978 #define MPI_RAIDVOL0_STATUS_FLAG_RESYNC_IN_PROGRESS (0x04) 1979 #define MPI_RAIDVOL0_STATUS_FLAG_VOLUME_INACTIVE (0x08) 1980 #define MPI_RAIDVOL0_STATUS_FLAG_BAD_BLOCK_TABLE_FULL (0x10) 1981 1982 #define MPI_RAIDVOL0_STATUS_STATE_OPTIMAL (0x00) 1983 #define MPI_RAIDVOL0_STATUS_STATE_DEGRADED (0x01) 1984 #define MPI_RAIDVOL0_STATUS_STATE_FAILED (0x02) 1985 #define MPI_RAIDVOL0_STATUS_STATE_MISSING (0x03) 1986 1987 typedef struct _RAID_VOL0_SETTINGS 1988 { 1989 U16 Settings; /* 00h */ 1990 U8 HotSparePool; /* 01h */ /* MPI_RAID_HOT_SPARE_POOL_ */ 1991 U8 Reserved; /* 02h */ 1992 } RAID_VOL0_SETTINGS, MPI_POINTER PTR_RAID_VOL0_SETTINGS, 1993 RaidVol0Settings, MPI_POINTER pRaidVol0Settings; 1994 1995 /* RAID Volume Page 0 VolumeSettings defines */ 1996 1997 #define MPI_RAIDVOL0_SETTING_WRITE_CACHING_ENABLE (0x0001) 1998 #define MPI_RAIDVOL0_SETTING_OFFLINE_ON_SMART (0x0002) 1999 #define MPI_RAIDVOL0_SETTING_AUTO_CONFIGURE (0x0004) 2000 #define MPI_RAIDVOL0_SETTING_PRIORITY_RESYNC (0x0008) 2001 #define MPI_RAIDVOL0_SETTING_USE_PRODUCT_ID_SUFFIX (0x0010) 2002 #define MPI_RAIDVOL0_SETTING_USE_DEFAULTS (0x8000) 2003 2004 /* RAID Volume Page 0 HotSparePool defines, also used in RAID Physical Disk */ 2005 #define MPI_RAID_HOT_SPARE_POOL_0 (0x01) 2006 #define MPI_RAID_HOT_SPARE_POOL_1 (0x02) 2007 #define MPI_RAID_HOT_SPARE_POOL_2 (0x04) 2008 #define MPI_RAID_HOT_SPARE_POOL_3 (0x08) 2009 #define MPI_RAID_HOT_SPARE_POOL_4 (0x10) 2010 #define MPI_RAID_HOT_SPARE_POOL_5 (0x20) 2011 #define MPI_RAID_HOT_SPARE_POOL_6 (0x40) 2012 #define MPI_RAID_HOT_SPARE_POOL_7 (0x80) 2013 2014 /* 2015 * Host code (drivers, BIOS, utilities, etc.) should leave this define set to 2016 * one and check Header.PageLength at runtime. 2017 */ 2018 #ifndef MPI_RAID_VOL_PAGE_0_PHYSDISK_MAX 2019 #define MPI_RAID_VOL_PAGE_0_PHYSDISK_MAX (1) 2020 #endif 2021 2022 typedef struct _CONFIG_PAGE_RAID_VOL_0 2023 { 2024 fCONFIG_PAGE_HEADER Header; /* 00h */ 2025 U8 VolumeID; /* 04h */ 2026 U8 VolumeBus; /* 05h */ 2027 U8 VolumeIOC; /* 06h */ 2028 U8 VolumeType; /* 07h */ /* MPI_RAID_VOL_TYPE_ */ 2029 RAID_VOL0_STATUS VolumeStatus; /* 08h */ 2030 RAID_VOL0_SETTINGS VolumeSettings; /* 0Ch */ 2031 U32 MaxLBA; /* 10h */ 2032 U32 Reserved1; /* 14h */ 2033 U32 StripeSize; /* 18h */ 2034 U32 Reserved2; /* 1Ch */ 2035 U32 Reserved3; /* 20h */ 2036 U8 NumPhysDisks; /* 24h */ 2037 U8 Reserved4; /* 25h */ 2038 U16 Reserved5; /* 26h */ 2039 RAID_VOL0_PHYS_DISK PhysDisk[MPI_RAID_VOL_PAGE_0_PHYSDISK_MAX];/* 28h */ 2040 } fCONFIG_PAGE_RAID_VOL_0, MPI_POINTER PTR_CONFIG_PAGE_RAID_VOL_0, 2041 RaidVolumePage0_t, MPI_POINTER pRaidVolumePage0_t; 2042 2043 #define MPI_RAIDVOLPAGE0_PAGEVERSION (0x00) 2044 2045 2046 /**************************************************************************** 2047 * RAID Physical Disk Config Pages 2048 ****************************************************************************/ 2049 2050 typedef struct _RAID_PHYS_DISK0_ERROR_DATA 2051 { 2052 U8 ErrorCdbByte; /* 00h */ 2053 U8 ErrorSenseKey; /* 01h */ 2054 U16 Reserved; /* 02h */ 2055 U16 ErrorCount; /* 04h */ 2056 U8 ErrorASC; /* 06h */ 2057 U8 ErrorASCQ; /* 07h */ 2058 U16 SmartCount; /* 08h */ 2059 U8 SmartASC; /* 0Ah */ 2060 U8 SmartASCQ; /* 0Bh */ 2061 } RAID_PHYS_DISK0_ERROR_DATA, MPI_POINTER PTR_RAID_PHYS_DISK0_ERROR_DATA, 2062 RaidPhysDisk0ErrorData_t, MPI_POINTER pRaidPhysDisk0ErrorData_t; 2063 2064 typedef struct _RAID_PHYS_DISK_INQUIRY_DATA 2065 { 2066 U8 VendorID[8]; /* 00h */ 2067 U8 ProductID[16]; /* 08h */ 2068 U8 ProductRevLevel[4]; /* 18h */ 2069 U8 Info[32]; /* 1Ch */ 2070 } RAID_PHYS_DISK0_INQUIRY_DATA, MPI_POINTER PTR_RAID_PHYS_DISK0_INQUIRY_DATA, 2071 RaidPhysDisk0InquiryData, MPI_POINTER pRaidPhysDisk0InquiryData; 2072 2073 typedef struct _RAID_PHYS_DISK0_SETTINGS 2074 { 2075 U8 SepID; /* 00h */ 2076 U8 SepBus; /* 01h */ 2077 U8 HotSparePool; /* 02h */ /* MPI_RAID_HOT_SPARE_POOL_ */ 2078 U8 PhysDiskSettings; /* 03h */ 2079 } RAID_PHYS_DISK0_SETTINGS, MPI_POINTER PTR_RAID_PHYS_DISK0_SETTINGS, 2080 RaidPhysDiskSettings_t, MPI_POINTER pRaidPhysDiskSettings_t; 2081 2082 typedef struct _RAID_PHYS_DISK0_STATUS 2083 { 2084 U8 Flags; /* 00h */ 2085 U8 State; /* 01h */ 2086 U16 Reserved; /* 02h */ 2087 } RAID_PHYS_DISK0_STATUS, MPI_POINTER PTR_RAID_PHYS_DISK0_STATUS, 2088 RaidPhysDiskStatus_t, MPI_POINTER pRaidPhysDiskStatus_t; 2089 2090 /* RAID Volume 2 IM Physical Disk DiskStatus flags */ 2091 2092 #define MPI_PHYSDISK0_STATUS_FLAG_OUT_OF_SYNC (0x01) 2093 #define MPI_PHYSDISK0_STATUS_FLAG_QUIESCED (0x02) 2094 2095 #define MPI_PHYSDISK0_STATUS_ONLINE (0x00) 2096 #define MPI_PHYSDISK0_STATUS_MISSING (0x01) 2097 #define MPI_PHYSDISK0_STATUS_NOT_COMPATIBLE (0x02) 2098 #define MPI_PHYSDISK0_STATUS_FAILED (0x03) 2099 #define MPI_PHYSDISK0_STATUS_INITIALIZING (0x04) 2100 #define MPI_PHYSDISK0_STATUS_OFFLINE_REQUESTED (0x05) 2101 #define MPI_PHYSDISK0_STATUS_FAILED_REQUESTED (0x06) 2102 #define MPI_PHYSDISK0_STATUS_OTHER_OFFLINE (0xFF) 2103 2104 typedef struct _CONFIG_PAGE_RAID_PHYS_DISK_0 2105 { 2106 fCONFIG_PAGE_HEADER Header; /* 00h */ 2107 U8 PhysDiskID; /* 04h */ 2108 U8 PhysDiskBus; /* 05h */ 2109 U8 PhysDiskIOC; /* 06h */ 2110 U8 PhysDiskNum; /* 07h */ 2111 RAID_PHYS_DISK0_SETTINGS PhysDiskSettings; /* 08h */ 2112 U32 Reserved1; /* 0Ch */ 2113 U32 Reserved2; /* 10h */ 2114 U32 Reserved3; /* 14h */ 2115 U8 DiskIdentifier[16]; /* 18h */ 2116 RAID_PHYS_DISK0_INQUIRY_DATA InquiryData; /* 28h */ 2117 RAID_PHYS_DISK0_STATUS PhysDiskStatus; /* 64h */ 2118 U32 MaxLBA; /* 68h */ 2119 RAID_PHYS_DISK0_ERROR_DATA ErrorData; /* 6Ch */ 2120 } fCONFIG_PAGE_RAID_PHYS_DISK_0, MPI_POINTER PTR_CONFIG_PAGE_RAID_PHYS_DISK_0, 2121 RaidPhysDiskPage0_t, MPI_POINTER pRaidPhysDiskPage0_t; 2122 2123 #define MPI_RAIDPHYSDISKPAGE0_PAGEVERSION (0x00) 2124 2125 2126 /**************************************************************************** 2127 * LAN Config Pages 2128 ****************************************************************************/ 2129 2130 typedef struct _CONFIG_PAGE_LAN_0 2131 { 2132 ConfigPageHeader_t Header; /* 00h */ 2133 U16 TxRxModes; /* 04h */ 2134 U16 Reserved; /* 06h */ 2135 U32 PacketPrePad; /* 08h */ 2136 } fCONFIG_PAGE_LAN_0, MPI_POINTER PTR_CONFIG_PAGE_LAN_0, 2137 LANPage0_t, MPI_POINTER pLANPage0_t; 2138 2139 #define MPI_LAN_PAGE0_PAGEVERSION (0x01) 2140 2141 #define MPI_LAN_PAGE0_RETURN_LOOPBACK (0x0000) 2142 #define MPI_LAN_PAGE0_SUPPRESS_LOOPBACK (0x0001) 2143 #define MPI_LAN_PAGE0_LOOPBACK_MASK (0x0001) 2144 2145 typedef struct _CONFIG_PAGE_LAN_1 2146 { 2147 ConfigPageHeader_t Header; /* 00h */ 2148 U16 Reserved; /* 04h */ 2149 U8 CurrentDeviceState; /* 06h */ 2150 U8 Reserved1; /* 07h */ 2151 U32 MinPacketSize; /* 08h */ 2152 U32 MaxPacketSize; /* 0Ch */ 2153 U32 HardwareAddressLow; /* 10h */ 2154 U32 HardwareAddressHigh; /* 14h */ 2155 U32 MaxWireSpeedLow; /* 18h */ 2156 U32 MaxWireSpeedHigh; /* 1Ch */ 2157 U32 BucketsRemaining; /* 20h */ 2158 U32 MaxReplySize; /* 24h */ 2159 U32 NegWireSpeedLow; /* 28h */ 2160 U32 NegWireSpeedHigh; /* 2Ch */ 2161 } fCONFIG_PAGE_LAN_1, MPI_POINTER PTR_CONFIG_PAGE_LAN_1, 2162 LANPage1_t, MPI_POINTER pLANPage1_t; 2163 2164 #define MPI_LAN_PAGE1_PAGEVERSION (0x03) 2165 2166 #define MPI_LAN_PAGE1_DEV_STATE_RESET (0x00) 2167 #define MPI_LAN_PAGE1_DEV_STATE_OPERATIONAL (0x01) 2168 2169 #endif 2170 2171 2172 /* 2173 * Copyright (c) 2000, 2001 by LSI Logic Corporation 2174 * 2175 * Redistribution and use in source and binary forms, with or without 2176 * modification, are permitted provided that the following conditions 2177 * are met: 2178 * 1. Redistributions of source code must retain the above copyright 2179 * notice immediately at the beginning of the file, without modification, 2180 * this list of conditions, and the following disclaimer. 2181 * 2. The name of the author may not be used to endorse or promote products 2182 * derived from this software without specific prior written permission. 2183 * 2184 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 2185 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2186 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2187 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 2188 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2189 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2190 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2191 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2192 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2193 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2194 * SUCH DAMAGE. 2195 * 2196 * 2197 * Name: MPI_FC.H 2198 * Title: MPI Fibre Channel messages and structures 2199 * Creation Date: June 12, 2000 2200 * 2201 * MPI Version: 01.02.02 2202 * 2203 * Version History 2204 * --------------- 2205 * 2206 * Date Version Description 2207 * -------- -------- ------------------------------------------------------ 2208 * 05-08-00 00.10.01 Original release for 0.10 spec dated 4/26/2000. 2209 * 06-06-00 01.00.01 Update version number for 1.0 release. 2210 * 06-12-00 01.00.02 Added _MSG_FC_ABORT_REPLY structure. 2211 * 11-02-00 01.01.01 Original release for post 1.0 work 2212 * 12-04-00 01.01.02 Added messages for Common Transport Send and 2213 * Primitive Send. 2214 * 01-09-01 01.01.03 Modified some of the new flags to have an MPI prefix 2215 * and modified the FcPrimitiveSend flags. 2216 * 01-25-01 01.01.04 Move InitiatorIndex in LinkServiceRsp reply to a larger 2217 * field. 2218 * Added FC_ABORT_TYPE_CT_SEND_REQUEST and 2219 * FC_ABORT_TYPE_EXLINKSEND_REQUEST for FcAbort request. 2220 * Added MPI_FC_PRIM_SEND_FLAGS_STOP_SEND. 2221 * 02-20-01 01.01.05 Started using MPI_POINTER. 2222 * 03-27-01 01.01.06 Added Flags field to MSG_LINK_SERVICE_BUFFER_POST_REPLY 2223 * and defined MPI_LS_BUF_POST_REPLY_FLAG_NO_RSP_NEEDED. 2224 * Added MPI_FC_PRIM_SEND_FLAGS_RESET_LINK define. 2225 * Added structure offset comments. 2226 * 04-09-01 01.01.07 Added RspLength field to MSG_LINK_SERVICE_RSP_REQUEST. 2227 * 08-08-01 01.02.01 Original release for v1.2 work. 2228 * 09-28-01 01.02.02 Change name of reserved field in 2229 * MSG_LINK_SERVICE_RSP_REPLY. 2230 * -------------------------------------------------------------------------- 2231 */ 2232 2233 #ifndef MPI_FC_H 2234 #define MPI_FC_H 2235 2236 2237 /***************************************************************************** 2238 * 2239 * F C T a r g e t M o d e M e s s a g e s 2240 * 2241 *****************************************************************************/ 2242 2243 /****************************************************************************/ 2244 /* Link Service Buffer Post messages */ 2245 /****************************************************************************/ 2246 2247 typedef struct _MSG_LINK_SERVICE_BUFFER_POST_REQUEST 2248 { 2249 U8 BufferPostFlags; /* 00h */ 2250 U8 BufferCount; /* 01h */ 2251 U8 ChainOffset; /* 02h */ 2252 U8 Function; /* 03h */ 2253 U16 Reserved; /* 04h */ 2254 U8 Reserved1; /* 06h */ 2255 U8 MsgFlags; /* 07h */ 2256 U32 MsgContext; /* 08h */ 2257 SGE_TRANS_SIMPLE_UNION SGL; 2258 } MSG_LINK_SERVICE_BUFFER_POST_REQUEST, 2259 MPI_POINTER PTR_MSG_LINK_SERVICE_BUFFER_POST_REQUEST, 2260 LinkServiceBufferPostRequest_t, MPI_POINTER pLinkServiceBufferPostRequest_t; 2261 2262 #define LINK_SERVICE_BUFFER_POST_FLAGS_PORT_MASK (0x01) 2263 2264 typedef struct _WWNFORMAT 2265 { 2266 U32 PortNameHigh; /* 00h */ 2267 U32 PortNameLow; /* 04h */ 2268 U32 NodeNameHigh; /* 08h */ 2269 U32 NodeNameLow; /* 0Ch */ 2270 } WWNFORMAT, 2271 WwnFormat_t; 2272 2273 /* Link Service Buffer Post Reply */ 2274 typedef struct _MSG_LINK_SERVICE_BUFFER_POST_REPLY 2275 { 2276 U8 Flags; /* 00h */ 2277 U8 Reserved; /* 01h */ 2278 U8 MsgLength; /* 02h */ 2279 U8 Function; /* 03h */ 2280 U16 Reserved1; /* 04h */ 2281 U8 PortNumber; /* 06h */ 2282 U8 MsgFlags; /* 07h */ 2283 U32 MsgContext; /* 08h */ 2284 U16 Reserved2; /* 0Ch */ 2285 U16 IOCStatus; /* 0Eh */ 2286 U32 IOCLogInfo; /* 10h */ 2287 U32 TransferLength; /* 14h */ 2288 U32 TransactionContext; /* 18h */ 2289 U32 Rctl_Did; /* 1Ch */ 2290 U32 Csctl_Sid; /* 20h */ 2291 U32 Type_Fctl; /* 24h */ 2292 U16 SeqCnt; /* 28h */ 2293 U8 Dfctl; /* 2Ah */ 2294 U8 SeqId; /* 2Bh */ 2295 U16 Rxid; /* 2Ch */ 2296 U16 Oxid; /* 2Eh */ 2297 U32 Parameter; /* 30h */ 2298 WWNFORMAT Wwn; /* 34h */ 2299 } MSG_LINK_SERVICE_BUFFER_POST_REPLY, MPI_POINTER PTR_MSG_LINK_SERVICE_BUFFER_POST_REPLY, 2300 LinkServiceBufferPostReply_t, MPI_POINTER pLinkServiceBufferPostReply_t; 2301 2302 #define MPI_LS_BUF_POST_REPLY_FLAG_NO_RSP_NEEDED (0x80) 2303 2304 #define MPI_FC_DID_MASK (0x00FFFFFF) 2305 #define MPI_FC_DID_SHIFT (0) 2306 #define MPI_FC_RCTL_MASK (0xFF000000) 2307 #define MPI_FC_RCTL_SHIFT (24) 2308 #define MPI_FC_SID_MASK (0x00FFFFFF) 2309 #define MPI_FC_SID_SHIFT (0) 2310 #define MPI_FC_CSCTL_MASK (0xFF000000) 2311 #define MPI_FC_CSCTL_SHIFT (24) 2312 #define MPI_FC_FCTL_MASK (0x00FFFFFF) 2313 #define MPI_FC_FCTL_SHIFT (0) 2314 #define MPI_FC_TYPE_MASK (0xFF000000) 2315 #define MPI_FC_TYPE_SHIFT (24) 2316 2317 /* obsolete name for the above */ 2318 #define FCP_TARGET_DID_MASK (0x00FFFFFF) 2319 #define FCP_TARGET_DID_SHIFT (0) 2320 #define FCP_TARGET_RCTL_MASK (0xFF000000) 2321 #define FCP_TARGET_RCTL_SHIFT (24) 2322 #define FCP_TARGET_SID_MASK (0x00FFFFFF) 2323 #define FCP_TARGET_SID_SHIFT (0) 2324 #define FCP_TARGET_CSCTL_MASK (0xFF000000) 2325 #define FCP_TARGET_CSCTL_SHIFT (24) 2326 #define FCP_TARGET_FCTL_MASK (0x00FFFFFF) 2327 #define FCP_TARGET_FCTL_SHIFT (0) 2328 #define FCP_TARGET_TYPE_MASK (0xFF000000) 2329 #define FCP_TARGET_TYPE_SHIFT (24) 2330 2331 2332 /****************************************************************************/ 2333 /* Link Service Response messages */ 2334 /****************************************************************************/ 2335 2336 typedef struct _MSG_LINK_SERVICE_RSP_REQUEST 2337 { 2338 U8 RspFlags; /* 00h */ 2339 U8 RspLength; /* 01h */ 2340 U8 ChainOffset; /* 02h */ 2341 U8 Function; /* 03h */ 2342 U16 Reserved1; /* 04h */ 2343 U8 Reserved2; /* 06h */ 2344 U8 MsgFlags; /* 07h */ 2345 U32 MsgContext; /* 08h */ 2346 U32 Rctl_Did; /* 0Ch */ 2347 U32 Csctl_Sid; /* 10h */ 2348 U32 Type_Fctl; /* 14h */ 2349 U16 SeqCnt; /* 18h */ 2350 U8 Dfctl; /* 1Ah */ 2351 U8 SeqId; /* 1Bh */ 2352 U16 Rxid; /* 1Ch */ 2353 U16 Oxid; /* 1Eh */ 2354 U32 Parameter; /* 20h */ 2355 SGE_SIMPLE_UNION SGL; /* 24h */ 2356 } MSG_LINK_SERVICE_RSP_REQUEST, MPI_POINTER PTR_MSG_LINK_SERVICE_RSP_REQUEST, 2357 LinkServiceRspRequest_t, MPI_POINTER pLinkServiceRspRequest_t; 2358 2359 #define LINK_SERVICE_RSP_FLAGS_IMMEDIATE (0x80) 2360 #define LINK_SERVICE_RSP_FLAGS_PORT_MASK (0x01) 2361 2362 2363 /* Link Service Response Reply */ 2364 typedef struct _MSG_LINK_SERVICE_RSP_REPLY 2365 { 2366 U16 Reserved; /* 00h */ 2367 U8 MsgLength; /* 02h */ 2368 U8 Function; /* 03h */ 2369 U16 Reserved1; /* 04h */ 2370 U8 Reserved_0100_InitiatorIndex; /* 06h */ /* obsolete InitiatorIndex */ 2371 U8 MsgFlags; /* 07h */ 2372 U32 MsgContext; /* 08h */ 2373 U16 Reserved3; /* 0Ch */ 2374 U16 IOCStatus; /* 0Eh */ 2375 U32 IOCLogInfo; /* 10h */ 2376 U32 InitiatorIndex; /* 14h */ 2377 } MSG_LINK_SERVICE_RSP_REPLY, MPI_POINTER PTR_MSG_LINK_SERVICE_RSP_REPLY, 2378 LinkServiceRspReply_t, MPI_POINTER pLinkServiceRspReply_t; 2379 2380 2381 /****************************************************************************/ 2382 /* Extended Link Service Send messages */ 2383 /****************************************************************************/ 2384 2385 typedef struct _MSG_EXLINK_SERVICE_SEND_REQUEST 2386 { 2387 U8 SendFlags; /* 00h */ 2388 U8 Reserved; /* 01h */ 2389 U8 ChainOffset; /* 02h */ 2390 U8 Function; /* 03h */ 2391 U32 MsgFlags_Did; /* 04h */ 2392 U32 MsgContext; /* 08h */ 2393 U32 ElsCommandCode; /* 0Ch */ 2394 SGE_SIMPLE_UNION SGL; /* 10h */ 2395 } MSG_EXLINK_SERVICE_SEND_REQUEST, MPI_POINTER PTR_MSG_EXLINK_SERVICE_SEND_REQUEST, 2396 ExLinkServiceSendRequest_t, MPI_POINTER pExLinkServiceSendRequest_t; 2397 2398 #define EX_LINK_SERVICE_SEND_DID_MASK (0x00FFFFFF) 2399 #define EX_LINK_SERVICE_SEND_DID_SHIFT (0) 2400 #define EX_LINK_SERVICE_SEND_MSGFLAGS_MASK (0xFF000000) 2401 #define EX_LINK_SERVICE_SEND_MSGFLAGS_SHIFT (24) 2402 2403 2404 /* Extended Link Service Send Reply */ 2405 typedef struct _MSG_EXLINK_SERVICE_SEND_REPLY 2406 { 2407 U16 Reserved; /* 00h */ 2408 U8 MsgLength; /* 02h */ 2409 U8 Function; /* 03h */ 2410 U16 Reserved1; /* 04h */ 2411 U8 Reserved2; /* 06h */ 2412 U8 MsgFlags; /* 07h */ 2413 U32 MsgContext; /* 08h */ 2414 U16 Reserved3; /* 0Ch */ 2415 U16 IOCStatus; /* 0Eh */ 2416 U32 IOCLogInfo; /* 10h */ 2417 U32 ResponseLength; /* 14h */ 2418 } MSG_EXLINK_SERVICE_SEND_REPLY, MPI_POINTER PTR_MSG_EXLINK_SERVICE_SEND_REPLY, 2419 ExLinkServiceSendReply_t, MPI_POINTER pExLinkServiceSendReply_t; 2420 2421 /****************************************************************************/ 2422 /* FC Abort messages */ 2423 /****************************************************************************/ 2424 2425 typedef struct _MSG_FC_ABORT_REQUEST 2426 { 2427 U8 AbortFlags; /* 00h */ 2428 U8 AbortType; /* 01h */ 2429 U8 ChainOffset; /* 02h */ 2430 U8 Function; /* 03h */ 2431 U16 Reserved1; /* 04h */ 2432 U8 Reserved2; /* 06h */ 2433 U8 MsgFlags; /* 07h */ 2434 U32 MsgContext; /* 08h */ 2435 U32 TransactionContextToAbort; /* 0Ch */ 2436 } MSG_FC_ABORT_REQUEST, MPI_POINTER PTR_MSG_FC_ABORT_REQUEST, 2437 FcAbortRequest_t, MPI_POINTER pFcAbortRequest_t; 2438 2439 #define FC_ABORT_FLAG_PORT_MASK (0x01) 2440 2441 #define FC_ABORT_TYPE_ALL_FC_BUFFERS (0x00) 2442 #define FC_ABORT_TYPE_EXACT_FC_BUFFER (0x01) 2443 #define FC_ABORT_TYPE_CT_SEND_REQUEST (0x02) 2444 #define FC_ABORT_TYPE_EXLINKSEND_REQUEST (0x03) 2445 2446 /* FC Abort Reply */ 2447 typedef struct _MSG_FC_ABORT_REPLY 2448 { 2449 U16 Reserved; /* 00h */ 2450 U8 MsgLength; /* 02h */ 2451 U8 Function; /* 03h */ 2452 U16 Reserved1; /* 04h */ 2453 U8 Reserved2; /* 06h */ 2454 U8 MsgFlags; /* 07h */ 2455 U32 MsgContext; /* 08h */ 2456 U16 Reserved3; /* 0Ch */ 2457 U16 IOCStatus; /* 0Eh */ 2458 U32 IOCLogInfo; /* 10h */ 2459 } MSG_FC_ABORT_REPLY, MPI_POINTER PTR_MSG_FC_ABORT_REPLY, 2460 FcAbortReply_t, MPI_POINTER pFcAbortReply_t; 2461 2462 2463 /****************************************************************************/ 2464 /* FC Common Transport Send messages */ 2465 /****************************************************************************/ 2466 2467 typedef struct _MSG_FC_COMMON_TRANSPORT_SEND_REQUEST 2468 { 2469 U8 SendFlags; /* 00h */ 2470 U8 Reserved; /* 01h */ 2471 U8 ChainOffset; /* 02h */ 2472 U8 Function; /* 03h */ 2473 U32 MsgFlags_Did; /* 04h */ 2474 U32 MsgContext; /* 08h */ 2475 U16 CTCommandCode; /* 0Ch */ 2476 U8 FsType; /* 0Eh */ 2477 U8 Reserved1; /* 0Fh */ 2478 SGE_SIMPLE_UNION SGL; /* 10h */ 2479 } MSG_FC_COMMON_TRANSPORT_SEND_REQUEST, 2480 MPI_POINTER PTR_MSG_FC_COMMON_TRANSPORT_SEND_REQUEST, 2481 FcCommonTransportSendRequest_t, MPI_POINTER pFcCommonTransportSendRequest_t; 2482 2483 #define MPI_FC_CT_SEND_DID_MASK (0x00FFFFFF) 2484 #define MPI_FC_CT_SEND_DID_SHIFT (0) 2485 #define MPI_FC_CT_SEND_MSGFLAGS_MASK (0xFF000000) 2486 #define MPI_FC_CT_SEND_MSGFLAGS_SHIFT (24) 2487 2488 2489 /* FC Common Transport Send Reply */ 2490 typedef struct _MSG_FC_COMMON_TRANSPORT_SEND_REPLY 2491 { 2492 U16 Reserved; /* 00h */ 2493 U8 MsgLength; /* 02h */ 2494 U8 Function; /* 03h */ 2495 U16 Reserved1; /* 04h */ 2496 U8 Reserved2; /* 06h */ 2497 U8 MsgFlags; /* 07h */ 2498 U32 MsgContext; /* 08h */ 2499 U16 Reserved3; /* 0Ch */ 2500 U16 IOCStatus; /* 0Eh */ 2501 U32 IOCLogInfo; /* 10h */ 2502 U32 ResponseLength; /* 14h */ 2503 } MSG_FC_COMMON_TRANSPORT_SEND_REPLY, MPI_POINTER PTR_MSG_FC_COMMON_TRANSPORT_SEND_REPLY, 2504 FcCommonTransportSendReply_t, MPI_POINTER pFcCommonTransportSendReply_t; 2505 2506 2507 /****************************************************************************/ 2508 /* FC Primitive Send messages */ 2509 /****************************************************************************/ 2510 2511 typedef struct _MSG_FC_PRIMITIVE_SEND_REQUEST 2512 { 2513 U8 SendFlags; /* 00h */ 2514 U8 Reserved; /* 01h */ 2515 U8 ChainOffset; /* 02h */ 2516 U8 Function; /* 03h */ 2517 U16 Reserved1; /* 04h */ 2518 U8 Reserved2; /* 06h */ 2519 U8 MsgFlags; /* 07h */ 2520 U32 MsgContext; /* 08h */ 2521 U8 FcPrimitive[4]; /* 0Ch */ 2522 } MSG_FC_PRIMITIVE_SEND_REQUEST, MPI_POINTER PTR_MSG_FC_PRIMITIVE_SEND_REQUEST, 2523 FcPrimitiveSendRequest_t, MPI_POINTER pFcPrimitiveSendRequest_t; 2524 2525 #define MPI_FC_PRIM_SEND_FLAGS_PORT_MASK (0x01) 2526 #define MPI_FC_PRIM_SEND_FLAGS_RESET_LINK (0x04) 2527 #define MPI_FC_PRIM_SEND_FLAGS_STOP_SEND (0x08) 2528 #define MPI_FC_PRIM_SEND_FLAGS_SEND_ONCE (0x10) 2529 #define MPI_FC_PRIM_SEND_FLAGS_SEND_AROUND (0x20) 2530 #define MPI_FC_PRIM_SEND_FLAGS_UNTIL_FULL (0x40) 2531 #define MPI_FC_PRIM_SEND_FLAGS_FOREVER (0x80) 2532 2533 /* FC Primitive Send Reply */ 2534 typedef struct _MSG_FC_PRIMITIVE_SEND_REPLY 2535 { 2536 U8 SendFlags; /* 00h */ 2537 U8 Reserved; /* 01h */ 2538 U8 MsgLength; /* 02h */ 2539 U8 Function; /* 03h */ 2540 U16 Reserved1; /* 04h */ 2541 U8 Reserved2; /* 06h */ 2542 U8 MsgFlags; /* 07h */ 2543 U32 MsgContext; /* 08h */ 2544 U16 Reserved3; /* 0Ch */ 2545 U16 IOCStatus; /* 0Eh */ 2546 U32 IOCLogInfo; /* 10h */ 2547 } MSG_FC_PRIMITIVE_SEND_REPLY, MPI_POINTER PTR_MSG_FC_PRIMITIVE_SEND_REPLY, 2548 FcPrimitiveSendReply_t, MPI_POINTER pFcPrimitiveSendReply_t; 2549 2550 #endif 2551 2552 2553 /* 2554 * Copyright (c) 2000, 2001 by LSI Logic Corporation 2555 * 2556 * Redistribution and use in source and binary forms, with or without 2557 * modification, are permitted provided that the following conditions 2558 * are met: 2559 * 1. Redistributions of source code must retain the above copyright 2560 * notice immediately at the beginning of the file, without modification, 2561 * this list of conditions, and the following disclaimer. 2562 * 2. The name of the author may not be used to endorse or promote products 2563 * derived from this software without specific prior written permission. 2564 * 2565 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 2566 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2567 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2568 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 2569 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2570 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2571 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2572 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2573 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2574 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2575 * SUCH DAMAGE. 2576 * 2577 * 2578 * Name: MPI_INIT.H 2579 * Title: MPI initiator mode messages and structures 2580 * Creation Date: June 8, 2000 2581 * 2582 * MPI Version: 01.02.04 2583 * 2584 * Version History 2585 * --------------- 2586 * 2587 * Date Version Description 2588 * -------- -------- ------------------------------------------------------ 2589 * 05-08-00 00.10.01 Original release for 0.10 spec dated 4/26/2000. 2590 * 05-24-00 00.10.02 Added SenseBufferLength to _MSG_SCSI_IO_REPLY. 2591 * 06-06-00 01.00.01 Update version number for 1.0 release. 2592 * 06-08-00 01.00.02 Added MPI_SCSI_RSP_INFO_ definitions. 2593 * 11-02-00 01.01.01 Original release for post 1.0 work. 2594 * 12-04-00 01.01.02 Added MPI_SCSIIO_CONTROL_NO_DISCONNECT. 2595 * 02-20-01 01.01.03 Started using MPI_POINTER. 2596 * 03-27-01 01.01.04 Added structure offset comments. 2597 * 04-10-01 01.01.05 Added new MsgFlag for MSG_SCSI_TASK_MGMT. 2598 * 08-08-01 01.02.01 Original release for v1.2 work. 2599 * 08-29-01 01.02.02 Added MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET. 2600 * Added MPI_SCSI_STATE_QUEUE_TAG_REJECTED for 2601 * MSG_SCSI_IO_REPLY. 2602 * 09-28-01 01.02.03 Added structures and defines for SCSI Enclosure 2603 * Processor messages. 2604 * 10-04-01 01.02.04 Added defines for SEP request Action field. 2605 * -------------------------------------------------------------------------- 2606 */ 2607 2608 #ifndef MPI_INIT_H 2609 #define MPI_INIT_H 2610 2611 2612 /***************************************************************************** 2613 * 2614 * S C S I I n i t i a t o r M e s s a g e s 2615 * 2616 *****************************************************************************/ 2617 2618 /****************************************************************************/ 2619 /* SCSI IO messages and associated structures */ 2620 /****************************************************************************/ 2621 2622 typedef struct _MSG_SCSI_IO_REQUEST 2623 { 2624 U8 TargetID; /* 00h */ 2625 U8 Bus; /* 01h */ 2626 U8 ChainOffset; /* 02h */ 2627 U8 Function; /* 03h */ 2628 U8 CDBLength; /* 04h */ 2629 U8 SenseBufferLength; /* 05h */ 2630 U8 Reserved; /* 06h */ 2631 U8 MsgFlags; /* 07h */ 2632 U32 MsgContext; /* 08h */ 2633 U8 LUN[8]; /* 0Ch */ 2634 U32 Control; /* 14h */ 2635 U8 CDB[16]; /* 18h */ 2636 U32 DataLength; /* 28h */ 2637 U32 SenseBufferLowAddr; /* 2Ch */ 2638 SGE_IO_UNION SGL; /* 30h */ 2639 } MSG_SCSI_IO_REQUEST, MPI_POINTER PTR_MSG_SCSI_IO_REQUEST, 2640 SCSIIORequest_t, MPI_POINTER pSCSIIORequest_t; 2641 2642 2643 /* SCSIO MsgFlags bits */ 2644 2645 #define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH (0x01) 2646 #define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_32 (0x00) 2647 #define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_64 (0x01) 2648 #define MPI_SCSIIO_MSGFLGS_SENSE_LOCATION (0x02) 2649 #define MPI_SCSIIO_MSGFLGS_SENSE_LOC_HOST (0x00) 2650 #define MPI_SCSIIO_MSGFLGS_SENSE_LOC_IOC (0x02) 2651 2652 /* SCSIIO LUN fields */ 2653 2654 #define MPI_SCSIIO_LUN_FIRST_LEVEL_ADDRESSING (0x0000FFFF) 2655 #define MPI_SCSIIO_LUN_SECOND_LEVEL_ADDRESSING (0xFFFF0000) 2656 #define MPI_SCSIIO_LUN_THIRD_LEVEL_ADDRESSING (0x0000FFFF) 2657 #define MPI_SCSIIO_LUN_FOURTH_LEVEL_ADDRESSING (0xFFFF0000) 2658 #define MPI_SCSIIO_LUN_LEVEL_1_WORD (0xFF00) 2659 #define MPI_SCSIIO_LUN_LEVEL_1_DWORD (0x0000FF00) 2660 2661 /* SCSIO Control bits */ 2662 2663 #define MPI_SCSIIO_CONTROL_DATADIRECTION_MASK (0x03000000) 2664 #define MPI_SCSIIO_CONTROL_NODATATRANSFER (0x00000000) 2665 #define MPI_SCSIIO_CONTROL_WRITE (0x01000000) 2666 #define MPI_SCSIIO_CONTROL_READ (0x02000000) 2667 2668 #define MPI_SCSIIO_CONTROL_ADDCDBLEN_MASK (0x3C000000) 2669 #define MPI_SCSIIO_CONTROL_ADDCDBLEN_SHIFT (26) 2670 2671 #define MPI_SCSIIO_CONTROL_TASKATTRIBUTE_MASK (0x00000700) 2672 #define MPI_SCSIIO_CONTROL_SIMPLEQ (0x00000000) 2673 #define MPI_SCSIIO_CONTROL_HEADOFQ (0x00000100) 2674 #define MPI_SCSIIO_CONTROL_ORDEREDQ (0x00000200) 2675 #define MPI_SCSIIO_CONTROL_ACAQ (0x00000400) 2676 #define MPI_SCSIIO_CONTROL_UNTAGGED (0x00000500) 2677 #define MPI_SCSIIO_CONTROL_NO_DISCONNECT (0x00000700) 2678 2679 #define MPI_SCSIIO_CONTROL_TASKMANAGE_MASK (0x00FF0000) 2680 #define MPI_SCSIIO_CONTROL_OBSOLETE (0x00800000) 2681 #define MPI_SCSIIO_CONTROL_CLEAR_ACA_RSV (0x00400000) 2682 #define MPI_SCSIIO_CONTROL_TARGET_RESET (0x00200000) 2683 #define MPI_SCSIIO_CONTROL_LUN_RESET_RSV (0x00100000) 2684 #define MPI_SCSIIO_CONTROL_RESERVED (0x00080000) 2685 #define MPI_SCSIIO_CONTROL_CLR_TASK_SET_RSV (0x00040000) 2686 #define MPI_SCSIIO_CONTROL_ABORT_TASK_SET (0x00020000) 2687 #define MPI_SCSIIO_CONTROL_RESERVED2 (0x00010000) 2688 2689 2690 /* SCSIIO reply structure */ 2691 typedef struct _MSG_SCSI_IO_REPLY 2692 { 2693 U8 TargetID; /* 00h */ 2694 U8 Bus; /* 01h */ 2695 U8 MsgLength; /* 02h */ 2696 U8 Function; /* 03h */ 2697 U8 CDBLength; /* 04h */ 2698 U8 SenseBufferLength; /* 05h */ 2699 U8 Reserved; /* 06h */ 2700 U8 MsgFlags; /* 07h */ 2701 U32 MsgContext; /* 08h */ 2702 U8 SCSIStatus; /* 0Ch */ 2703 U8 SCSIState; /* 0Dh */ 2704 U16 IOCStatus; /* 0Eh */ 2705 U32 IOCLogInfo; /* 10h */ 2706 U32 TransferCount; /* 14h */ 2707 U32 SenseCount; /* 18h */ 2708 U32 ResponseInfo; /* 1Ch */ 2709 } MSG_SCSI_IO_REPLY, MPI_POINTER PTR_MSG_SCSI_IO_REPLY, 2710 SCSIIOReply_t, MPI_POINTER pSCSIIOReply_t; 2711 2712 2713 /* SCSIIO Reply SCSIStatus values (SAM-2 status codes) */ 2714 2715 #define MPI_SCSI_STATUS_SUCCESS (0x00) 2716 #define MPI_SCSI_STATUS_CHECK_CONDITION (0x02) 2717 #define MPI_SCSI_STATUS_CONDITION_MET (0x04) 2718 #define MPI_SCSI_STATUS_BUSY (0x08) 2719 #define MPI_SCSI_STATUS_INTERMEDIATE (0x10) 2720 #define MPI_SCSI_STATUS_INTERMEDIATE_CONDMET (0x14) 2721 #define MPI_SCSI_STATUS_RESERVATION_CONFLICT (0x18) 2722 #define MPI_SCSI_STATUS_COMMAND_TERMINATED (0x22) 2723 #define MPI_SCSI_STATUS_TASK_SET_FULL (0x28) 2724 #define MPI_SCSI_STATUS_ACA_ACTIVE (0x30) 2725 2726 2727 /* SCSIIO Reply SCSIState values */ 2728 2729 #define MPI_SCSI_STATE_AUTOSENSE_VALID (0x01) 2730 #define MPI_SCSI_STATE_AUTOSENSE_FAILED (0x02) 2731 #define MPI_SCSI_STATE_NO_SCSI_STATUS (0x04) 2732 #define MPI_SCSI_STATE_TERMINATED (0x08) 2733 #define MPI_SCSI_STATE_RESPONSE_INFO_VALID (0x10) 2734 #define MPI_SCSI_STATE_QUEUE_TAG_REJECTED (0x20) 2735 2736 /* SCSIIO Reply ResponseInfo values */ 2737 /* (FCP-1 RSP_CODE values and SPI-3 Packetized Failure codes) */ 2738 2739 #define MPI_SCSI_RSP_INFO_FUNCTION_COMPLETE (0x00000000) 2740 #define MPI_SCSI_RSP_INFO_FCP_BURST_LEN_ERROR (0x01000000) 2741 #define MPI_SCSI_RSP_INFO_CMND_FIELDS_INVALID (0x02000000) 2742 #define MPI_SCSI_RSP_INFO_FCP_DATA_RO_ERROR (0x03000000) 2743 #define MPI_SCSI_RSP_INFO_TASK_MGMT_UNSUPPORTED (0x04000000) 2744 #define MPI_SCSI_RSP_INFO_TASK_MGMT_FAILED (0x05000000) 2745 #define MPI_SCSI_RSP_INFO_SPI_LQ_INVALID_TYPE (0x06000000) 2746 2747 2748 /****************************************************************************/ 2749 /* SCSI Task Management messages */ 2750 /****************************************************************************/ 2751 2752 typedef struct _MSG_SCSI_TASK_MGMT 2753 { 2754 U8 TargetID; /* 00h */ 2755 U8 Bus; /* 01h */ 2756 U8 ChainOffset; /* 02h */ 2757 U8 Function; /* 03h */ 2758 U8 Reserved; /* 04h */ 2759 U8 TaskType; /* 05h */ 2760 U8 Reserved1; /* 06h */ 2761 U8 MsgFlags; /* 07h */ 2762 U32 MsgContext; /* 08h */ 2763 U8 LUN[8]; /* 0Ch */ 2764 U32 Reserved2[7]; /* 14h */ 2765 U32 TaskMsgContext; /* 30h */ 2766 } MSG_SCSI_TASK_MGMT, MPI_POINTER PTR_SCSI_TASK_MGMT, 2767 SCSITaskMgmt_t, MPI_POINTER pSCSITaskMgmt_t; 2768 2769 /* TaskType values */ 2770 2771 #define MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK (0x01) 2772 #define MPI_SCSITASKMGMT_TASKTYPE_ABRT_TASK_SET (0x02) 2773 #define MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET (0x03) 2774 #define MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS (0x04) 2775 #define MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET (0x05) 2776 2777 /* MsgFlags bits */ 2778 #define MPI_SCSITASKMGMT_MSGFLAGS_TARGET_RESET_OPTION (0x00) 2779 #define MPI_SCSITASKMGMT_MSGFLAGS_LIP_RESET_OPTION (0x02) 2780 #define MPI_SCSITASKMGMT_MSGFLAGS_LIPRESET_RESET_OPTION (0x04) 2781 2782 /* SCSI Task Management Reply */ 2783 typedef struct _MSG_SCSI_TASK_MGMT_REPLY 2784 { 2785 U8 TargetID; /* 00h */ 2786 U8 Bus; /* 01h */ 2787 U8 MsgLength; /* 02h */ 2788 U8 Function; /* 03h */ 2789 U8 Reserved; /* 04h */ 2790 U8 TaskType; /* 05h */ 2791 U8 Reserved1; /* 06h */ 2792 U8 MsgFlags; /* 07h */ 2793 U32 MsgContext; /* 08h */ 2794 U8 Reserved2[2]; /* 0Ch */ 2795 U16 IOCStatus; /* 0Eh */ 2796 U32 IOCLogInfo; /* 10h */ 2797 U32 TerminationCount; /* 14h */ 2798 } MSG_SCSI_TASK_MGMT_REPLY, MPI_POINTER PTR_MSG_SCSI_TASK_MGMT_REPLY, 2799 SCSITaskMgmtReply_t, MPI_POINTER pSCSITaskMgmtReply_t; 2800 2801 2802 /****************************************************************************/ 2803 /* SCSI Enclosure Processor messages */ 2804 /****************************************************************************/ 2805 2806 typedef struct _MSG_SEP_REQUEST 2807 { 2808 U8 TargetID; /* 00h */ 2809 U8 Bus; /* 01h */ 2810 U8 ChainOffset; /* 02h */ 2811 U8 Function; /* 03h */ 2812 U8 Action; /* 04h */ 2813 U8 Reserved1; /* 05h */ 2814 U8 Reserved2; /* 06h */ 2815 U8 MsgFlags; /* 07h */ 2816 U32 MsgContext; /* 08h */ 2817 U32 SlotStatus; /* 0Ch */ 2818 } MSG_SEP_REQUEST, MPI_POINTER PTR_MSG_SEP_REQUEST, 2819 SEPRequest_t, MPI_POINTER pSEPRequest_t; 2820 2821 /* Action defines */ 2822 #define MPI_SEP_REQ_ACTION_WRITE_STATUS (0x00) 2823 #define MPI_SEP_REQ_ACTION_READ_STATUS (0x01) 2824 2825 /* SlotStatus bits for MSG_SEP_REQUEST */ 2826 #define MPI_SEP_REQ_SLOTSTATUS_NO_ERROR (0x00000001) 2827 #define MPI_SEP_REQ_SLOTSTATUS_DEV_FAULTY (0x00000002) 2828 #define MPI_SEP_REQ_SLOTSTATUS_DEV_REBUILDING (0x00000004) 2829 #define MPI_SEP_REQ_SLOTSTATUS_IN_FAILED_ARRAY (0x00000008) 2830 #define MPI_SEP_REQ_SLOTSTATUS_IN_CRITICAL_ARRAY (0x00000010) 2831 #define MPI_SEP_REQ_SLOTSTATUS_PARITY_CHECK (0x00000020) 2832 #define MPI_SEP_REQ_SLOTSTATUS_PREDICTED_FAULT (0x00000040) 2833 #define MPI_SEP_REQ_SLOTSTATUS_UNCONFIGURED (0x00000080) 2834 #define MPI_SEP_REQ_SLOTSTATUS_HOT_SPARE (0x00000100) 2835 #define MPI_SEP_REQ_SLOTSTATUS_REBUILD_STOPPED (0x00000200) 2836 #define MPI_SEP_REQ_SLOTSTATUS_IDENTIFY_REQUEST (0x00020000) 2837 #define MPI_SEP_REQ_SLOTSTATUS_REQUEST_REMOVE (0x00040000) 2838 #define MPI_SEP_REQ_SLOTSTATUS_REQUEST_INSERT (0x00080000) 2839 #define MPI_SEP_REQ_SLOTSTATUS_DO_NOT_MOVE (0x00400000) 2840 #define MPI_SEP_REQ_SLOTSTATUS_B_ENABLE_BYPASS (0x04000000) 2841 #define MPI_SEP_REQ_SLOTSTATUS_A_ENABLE_BYPASS (0x08000000) 2842 #define MPI_SEP_REQ_SLOTSTATUS_DEV_OFF (0x10000000) 2843 #define MPI_SEP_REQ_SLOTSTATUS_SWAP_RESET (0x80000000) 2844 2845 2846 typedef struct _MSG_SEP_REPLY 2847 { 2848 U8 TargetID; /* 00h */ 2849 U8 Bus; /* 01h */ 2850 U8 MsgLength; /* 02h */ 2851 U8 Function; /* 03h */ 2852 U8 Action; /* 04h */ 2853 U8 Reserved1; /* 05h */ 2854 U8 Reserved2; /* 06h */ 2855 U8 MsgFlags; /* 07h */ 2856 U32 MsgContext; /* 08h */ 2857 U16 Reserved3; /* 0Ch */ 2858 U16 IOCStatus; /* 0Eh */ 2859 U32 IOCLogInfo; /* 10h */ 2860 U32 SlotStatus; /* 14h */ 2861 } MSG_SEP_REPLY, MPI_POINTER PTR_MSG_SEP_REPLY, 2862 SEPReply_t, MPI_POINTER pSEPReply_t; 2863 2864 /* SlotStatus bits for MSG_SEP_REPLY */ 2865 #define MPI_SEP_REPLY_SLOTSTATUS_NO_ERROR (0x00000001) 2866 #define MPI_SEP_REPLY_SLOTSTATUS_DEV_FAULTY (0x00000002) 2867 #define MPI_SEP_REPLY_SLOTSTATUS_DEV_REBUILDING (0x00000004) 2868 #define MPI_SEP_REPLY_SLOTSTATUS_IN_FAILED_ARRAY (0x00000008) 2869 #define MPI_SEP_REPLY_SLOTSTATUS_IN_CRITICAL_ARRAY (0x00000010) 2870 #define MPI_SEP_REPLY_SLOTSTATUS_PARITY_CHECK (0x00000020) 2871 #define MPI_SEP_REPLY_SLOTSTATUS_PREDICTED_FAULT (0x00000040) 2872 #define MPI_SEP_REPLY_SLOTSTATUS_UNCONFIGURED (0x00000080) 2873 #define MPI_SEP_REPLY_SLOTSTATUS_HOT_SPARE (0x00000100) 2874 #define MPI_SEP_REPLY_SLOTSTATUS_REBUILD_STOPPED (0x00000200) 2875 #define MPI_SEP_REPLY_SLOTSTATUS_REPORT (0x00010000) 2876 #define MPI_SEP_REPLY_SLOTSTATUS_IDENTIFY_REQUEST (0x00020000) 2877 #define MPI_SEP_REPLY_SLOTSTATUS_REMOVE_READY (0x00040000) 2878 #define MPI_SEP_REPLY_SLOTSTATUS_INSERT_READY (0x00080000) 2879 #define MPI_SEP_REPLY_SLOTSTATUS_DO_NOT_REMOVE (0x00400000) 2880 #define MPI_SEP_REPLY_SLOTSTATUS_B_BYPASS_ENABLED (0x01000000) 2881 #define MPI_SEP_REPLY_SLOTSTATUS_A_BYPASS_ENABLED (0x02000000) 2882 #define MPI_SEP_REPLY_SLOTSTATUS_B_ENABLE_BYPASS (0x04000000) 2883 #define MPI_SEP_REPLY_SLOTSTATUS_A_ENABLE_BYPASS (0x08000000) 2884 #define MPI_SEP_REPLY_SLOTSTATUS_DEV_OFF (0x10000000) 2885 #define MPI_SEP_REPLY_SLOTSTATUS_FAULT_SENSED (0x40000000) 2886 #define MPI_SEP_REPLY_SLOTSTATUS_SWAPPED (0x80000000) 2887 2888 #endif 2889 2890 /* 2891 * Copyright (c) 2000, 2001 by LSI Logic Corporation 2892 * 2893 * Redistribution and use in source and binary forms, with or without 2894 * modification, are permitted provided that the following conditions 2895 * are met: 2896 * 1. Redistributions of source code must retain the above copyright 2897 * notice immediately at the beginning of the file, without modification, 2898 * this list of conditions, and the following disclaimer. 2899 * 2. The name of the author may not be used to endorse or promote products 2900 * derived from this software without specific prior written permission. 2901 * 2902 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 2903 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2904 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2905 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 2906 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2907 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2908 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2909 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2910 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2911 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2912 * SUCH DAMAGE. 2913 * 2914 * 2915 * Name: MPI_IOC.H 2916 * Title: MPI IOC, Port, Event, FW Download, and FW Upload messages 2917 * Creation Date: August 11, 2000 2918 * 2919 * MPI Version: 01.02.04 2920 * 2921 * Version History 2922 * --------------- 2923 * 2924 * Date Version Description 2925 * -------- -------- ------------------------------------------------------ 2926 * 05-08-00 00.10.01 Original release for 0.10 spec dated 4/26/2000. 2927 * 05-24-00 00.10.02 Added _MSG_IOC_INIT_REPLY structure. 2928 * 06-06-00 01.00.01 Added CurReplyFrameSize field to _MSG_IOC_FACTS_REPLY. 2929 * 06-12-00 01.00.02 Added _MSG_PORT_ENABLE_REPLY structure. 2930 * Added _MSG_EVENT_ACK_REPLY structure. 2931 * Added _MSG_FW_DOWNLOAD_REPLY structure. 2932 * Added _MSG_TOOLBOX_REPLY structure. 2933 * 06-30-00 01.00.03 Added MaxLanBuckets to _PORT_FACT_REPLY structure. 2934 * 07-27-00 01.00.04 Added _EVENT_DATA structure definitions for _SCSI, 2935 * _LINK_STATUS, _LOOP_STATE and _LOGOUT. 2936 * 08-11-00 01.00.05 Switched positions of MsgLength and Function fields in 2937 * _MSG_EVENT_ACK_REPLY structure to match specification. 2938 * 11-02-00 01.01.01 Original release for post 1.0 work. 2939 * Added a value for Manufacturer to WhoInit. 2940 * 12-04-00 01.01.02 Modified IOCFacts reply, added FWUpload messages, and 2941 * removed toolbox message. 2942 * 01-09-01 01.01.03 Added event enabled and disabled defines. 2943 * Added structures for FwHeader and DataHeader. 2944 * Added ImageType to FwUpload reply. 2945 * 02-20-01 01.01.04 Started using MPI_POINTER. 2946 * 02-27-01 01.01.05 Added event for RAID status change and its event data. 2947 * Added IocNumber field to MSG_IOC_FACTS_REPLY. 2948 * 03-27-01 01.01.06 Added defines for ProductId field of MPI_FW_HEADER. 2949 * Added structure offset comments. 2950 * 04-09-01 01.01.07 Added structure EVENT_DATA_EVENT_CHANGE. 2951 * 08-08-01 01.02.01 Original release for v1.2 work. 2952 * New format for FWVersion and ProductId in 2953 * MSG_IOC_FACTS_REPLY and MPI_FW_HEADER. 2954 * 08-31-01 01.02.02 Added event MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE and 2955 * related structure and defines. 2956 * Added event MPI_EVENT_ON_BUS_TIMER_EXPIRED. 2957 * Added MPI_IOCINIT_FLAGS_DISCARD_FW_IMAGE. 2958 * Replaced a reserved field in MSG_IOC_FACTS_REPLY with 2959 * IOCExceptions and changed DataImageSize to reserved. 2960 * Added MPI_FW_DOWNLOAD_ITYPE_NVSTORE_DATA and 2961 * MPI_FW_UPLOAD_ITYPE_NVDATA. 2962 * 09-28-01 01.02.03 Modified Event Data for Integrated RAID. 2963 * 11-01-01 01.02.04 Added defines for MPI_EXT_IMAGE_HEADER ImageType field. 2964 * -------------------------------------------------------------------------- 2965 */ 2966 2967 #ifndef MPI_IOC_H 2968 #define MPI_IOC_H 2969 2970 2971 /***************************************************************************** 2972 * 2973 * I O C M e s s a g e s 2974 * 2975 *****************************************************************************/ 2976 2977 /****************************************************************************/ 2978 /* IOCInit message */ 2979 /****************************************************************************/ 2980 2981 typedef struct _MSG_IOC_INIT 2982 { 2983 U8 WhoInit; /* 00h */ 2984 U8 Reserved; /* 01h */ 2985 U8 ChainOffset; /* 02h */ 2986 U8 Function; /* 03h */ 2987 U8 Flags; /* 04h */ 2988 U8 MaxDevices; /* 05h */ 2989 U8 MaxBuses; /* 06h */ 2990 U8 MsgFlags; /* 07h */ 2991 U32 MsgContext; /* 08h */ 2992 U16 ReplyFrameSize; /* 0Ch */ 2993 U8 Reserved1[2]; /* 0Eh */ 2994 U32 HostMfaHighAddr; /* 10h */ 2995 U32 SenseBufferHighAddr; /* 14h */ 2996 } MSG_IOC_INIT, MPI_POINTER PTR_MSG_IOC_INIT, 2997 IOCInit_t, MPI_POINTER pIOCInit_t; 2998 2999 /* WhoInit values */ 3000 #define MPI_WHOINIT_NO_ONE (0x00) 3001 #define MPI_WHOINIT_SYSTEM_BIOS (0x01) 3002 #define MPI_WHOINIT_ROM_BIOS (0x02) 3003 #define MPI_WHOINIT_PCI_PEER (0x03) 3004 #define MPI_WHOINIT_HOST_DRIVER (0x04) 3005 #define MPI_WHOINIT_MANUFACTURER (0x05) 3006 3007 /* Flags values */ 3008 #define MPI_IOCINIT_FLAGS_DISCARD_FW_IMAGE (0x01) 3009 3010 typedef struct _MSG_IOC_INIT_REPLY 3011 { 3012 U8 WhoInit; /* 00h */ 3013 U8 Reserved; /* 01h */ 3014 U8 MsgLength; /* 02h */ 3015 U8 Function; /* 03h */ 3016 U8 Flags; /* 04h */ 3017 U8 MaxDevices; /* 05h */ 3018 U8 MaxBuses; /* 06h */ 3019 U8 MsgFlags; /* 07h */ 3020 U32 MsgContext; /* 08h */ 3021 U16 Reserved2; /* 0Ch */ 3022 U16 IOCStatus; /* 0Eh */ 3023 U32 IOCLogInfo; /* 10h */ 3024 } MSG_IOC_INIT_REPLY, MPI_POINTER PTR_MSG_IOC_INIT_REPLY, 3025 IOCInitReply_t, MPI_POINTER pIOCInitReply_t; 3026 3027 3028 3029 /****************************************************************************/ 3030 /* IOC Facts message */ 3031 /****************************************************************************/ 3032 3033 typedef struct _MSG_IOC_FACTS 3034 { 3035 U8 Reserved[2]; /* 00h */ 3036 U8 ChainOffset; /* 01h */ 3037 U8 Function; /* 02h */ 3038 U8 Reserved1[3]; /* 03h */ 3039 U8 MsgFlags; /* 04h */ 3040 U32 MsgContext; /* 08h */ 3041 } MSG_IOC_FACTS, MPI_POINTER PTR_IOC_FACTS, 3042 IOCFacts_t, MPI_POINTER pIOCFacts_t; 3043 3044 typedef struct _MPI_FW_VERSION_STRUCT 3045 { 3046 U8 Dev; /* 00h */ 3047 U8 Unit; /* 01h */ 3048 U8 Minor; /* 02h */ 3049 U8 Major; /* 03h */ 3050 } MPI_FW_VERSION_STRUCT; 3051 3052 typedef union _MPI_FW_VERSION 3053 { 3054 MPI_FW_VERSION_STRUCT Struct; 3055 U32 Word; 3056 } MPI_FW_VERSION; 3057 3058 /* IOC Facts Reply */ 3059 typedef struct _MSG_IOC_FACTS_REPLY 3060 { 3061 U16 MsgVersion; /* 00h */ 3062 U8 MsgLength; /* 02h */ 3063 U8 Function; /* 03h */ 3064 U16 Reserved; /* 04h */ 3065 U8 IOCNumber; /* 06h */ 3066 U8 MsgFlags; /* 07h */ 3067 U32 MsgContext; /* 08h */ 3068 U16 IOCExceptions; /* 0Ch */ 3069 U16 IOCStatus; /* 0Eh */ 3070 U32 IOCLogInfo; /* 10h */ 3071 U8 MaxChainDepth; /* 14h */ 3072 U8 WhoInit; /* 15h */ 3073 U8 BlockSize; /* 16h */ 3074 U8 Flags; /* 17h */ 3075 U16 ReplyQueueDepth; /* 18h */ 3076 U16 RequestFrameSize; /* 1Ah */ 3077 U16 Reserved_0101_FWVersion; /* 1Ch */ /* obsolete 16-bit FWVersion */ 3078 U16 ProductID; /* 1Eh */ 3079 U32 CurrentHostMfaHighAddr; /* 20h */ 3080 U16 GlobalCredits; /* 24h */ 3081 U8 NumberOfPorts; /* 26h */ 3082 U8 EventState; /* 27h */ 3083 U32 CurrentSenseBufferHighAddr; /* 28h */ 3084 U16 CurReplyFrameSize; /* 2Ch */ 3085 U8 MaxDevices; /* 2Eh */ 3086 U8 MaxBuses; /* 2Fh */ 3087 U32 FWImageSize; /* 30h */ 3088 U32 Reserved4; /* 34h */ 3089 MPI_FW_VERSION FWVersion; /* 38h */ 3090 } MSG_IOC_FACTS_REPLY, MPI_POINTER PTR_MSG_IOC_FACTS_REPLY, 3091 IOCFactsReply_t, MPI_POINTER pIOCFactsReply_t; 3092 3093 #define MPI_IOCFACTS_MSGVERSION_MAJOR_MASK (0xFF00) 3094 #define MPI_IOCFACTS_MSGVERSION_MINOR_MASK (0x00FF) 3095 3096 #define MPI_IOCFACTS_EXCEPT_CONFIG_CHECKSUM_FAIL (0x0001) 3097 3098 #define MPI_IOCFACTS_FLAGS_FW_DOWNLOAD_BOOT (0x01) 3099 3100 #define MPI_IOCFACTS_EVENTSTATE_DISABLED (0x00) 3101 #define MPI_IOCFACTS_EVENTSTATE_ENABLED (0x01) 3102 3103 3104 3105 /***************************************************************************** 3106 * 3107 * P o r t M e s s a g e s 3108 * 3109 *****************************************************************************/ 3110 3111 /****************************************************************************/ 3112 /* Port Facts message and Reply */ 3113 /****************************************************************************/ 3114 3115 typedef struct _MSG_PORT_FACTS 3116 { 3117 U8 Reserved[2]; /* 00h */ 3118 U8 ChainOffset; /* 02h */ 3119 U8 Function; /* 03h */ 3120 U8 Reserved1[2]; /* 04h */ 3121 U8 PortNumber; /* 06h */ 3122 U8 MsgFlags; /* 07h */ 3123 U32 MsgContext; /* 08h */ 3124 } MSG_PORT_FACTS, MPI_POINTER PTR_MSG_PORT_FACTS, 3125 PortFacts_t, MPI_POINTER pPortFacts_t; 3126 3127 typedef struct _MSG_PORT_FACTS_REPLY 3128 { 3129 U16 Reserved; /* 00h */ 3130 U8 MsgLength; /* 02h */ 3131 U8 Function; /* 03h */ 3132 U16 Reserved1; /* 04h */ 3133 U8 PortNumber; /* 06h */ 3134 U8 MsgFlags; /* 07h */ 3135 U32 MsgContext; /* 08h */ 3136 U16 Reserved2; /* 0Ch */ 3137 U16 IOCStatus; /* 0Eh */ 3138 U32 IOCLogInfo; /* 10h */ 3139 U8 Reserved3; /* 14h */ 3140 U8 PortType; /* 15h */ 3141 U16 MaxDevices; /* 16h */ 3142 U16 PortSCSIID; /* 18h */ 3143 U16 ProtocolFlags; /* 1Ah */ 3144 U16 MaxPostedCmdBuffers; /* 1Ch */ 3145 U16 MaxPersistentIDs; /* 1Eh */ 3146 U16 MaxLanBuckets; /* 20h */ 3147 U16 Reserved4; /* 22h */ 3148 U32 Reserved5; /* 24h */ 3149 } MSG_PORT_FACTS_REPLY, MPI_POINTER PTR_MSG_PORT_FACTS_REPLY, 3150 PortFactsReply_t, MPI_POINTER pPortFactsReply_t; 3151 3152 3153 /* PortTypes values */ 3154 3155 #define MPI_PORTFACTS_PORTTYPE_INACTIVE (0x00) 3156 #define MPI_PORTFACTS_PORTTYPE_SCSI (0x01) 3157 #define MPI_PORTFACTS_PORTTYPE_FC (0x10) 3158 #define MPI_PORTFACTS_PORTTYPE_ISCSI (0x20) 3159 #define MPI_PORTFACTS_PORTTYPE_SAS (0x30) 3160 3161 /* ProtocolFlags values */ 3162 3163 #define MPI_PORTFACTS_PROTOCOL_LOGBUSADDR (0x01) 3164 #define MPI_PORTFACTS_PROTOCOL_LAN (0x02) 3165 #define MPI_PORTFACTS_PROTOCOL_TARGET (0x04) 3166 #define MPI_PORTFACTS_PROTOCOL_INITIATOR (0x08) 3167 3168 3169 /****************************************************************************/ 3170 /* Port Enable Message */ 3171 /****************************************************************************/ 3172 3173 typedef struct _MSG_PORT_ENABLE 3174 { 3175 U8 Reserved[2]; /* 00h */ 3176 U8 ChainOffset; /* 02h */ 3177 U8 Function; /* 03h */ 3178 U8 Reserved1[2]; /* 04h */ 3179 U8 PortNumber; /* 06h */ 3180 U8 MsgFlags; /* 07h */ 3181 U32 MsgContext; /* 08h */ 3182 } MSG_PORT_ENABLE, MPI_POINTER PTR_MSG_PORT_ENABLE, 3183 PortEnable_t, MPI_POINTER pPortEnable_t; 3184 3185 typedef struct _MSG_PORT_ENABLE_REPLY 3186 { 3187 U8 Reserved[2]; /* 00h */ 3188 U8 MsgLength; /* 02h */ 3189 U8 Function; /* 03h */ 3190 U8 Reserved1[2]; /* 04h */ 3191 U8 PortNumber; /* 05h */ 3192 U8 MsgFlags; /* 07h */ 3193 U32 MsgContext; /* 08h */ 3194 U16 Reserved2; /* 0Ch */ 3195 U16 IOCStatus; /* 0Eh */ 3196 U32 IOCLogInfo; /* 10h */ 3197 } MSG_PORT_ENABLE_REPLY, MPI_POINTER PTR_MSG_PORT_ENABLE_REPLY, 3198 PortEnableReply_t, MPI_POINTER pPortEnableReply_t; 3199 3200 3201 /***************************************************************************** 3202 * 3203 * E v e n t M e s s a g e s 3204 * 3205 *****************************************************************************/ 3206 3207 /****************************************************************************/ 3208 /* Event Notification messages */ 3209 /****************************************************************************/ 3210 3211 typedef struct _MSG_EVENT_NOTIFY 3212 { 3213 U8 Switch; /* 00h */ 3214 U8 Reserved; /* 01h */ 3215 U8 ChainOffset; /* 02h */ 3216 U8 Function; /* 03h */ 3217 U8 Reserved1[3]; /* 04h */ 3218 U8 MsgFlags; /* 07h */ 3219 U32 MsgContext; /* 08h */ 3220 } MSG_EVENT_NOTIFY, MPI_POINTER PTR_MSG_EVENT_NOTIFY, 3221 EventNotification_t, MPI_POINTER pEventNotification_t; 3222 3223 /* Event Notification Reply */ 3224 3225 typedef struct _MSG_EVENT_NOTIFY_REPLY 3226 { 3227 U16 EventDataLength; /* 00h */ 3228 U8 MsgLength; /* 02h */ 3229 U8 Function; /* 03h */ 3230 U8 Reserved1[2]; /* 04h */ 3231 U8 AckRequired; /* 06h */ 3232 U8 MsgFlags; /* 07h */ 3233 U32 MsgContext; /* 08h */ 3234 U8 Reserved2[2]; /* 0Ch */ 3235 U16 IOCStatus; /* 0Eh */ 3236 U32 IOCLogInfo; /* 10h */ 3237 U32 Event; /* 14h */ 3238 U32 EventContext; /* 18h */ 3239 U32 Data[1]; /* 1Ch */ 3240 } MSG_EVENT_NOTIFY_REPLY, MPI_POINTER PTR_MSG_EVENT_NOTIFY_REPLY, 3241 EventNotificationReply_t, MPI_POINTER pEventNotificationReply_t; 3242 3243 /* Event Acknowledge */ 3244 3245 typedef struct _MSG_EVENT_ACK 3246 { 3247 U8 Reserved[2]; /* 00h */ 3248 U8 ChainOffset; /* 02h */ 3249 U8 Function; /* 03h */ 3250 U8 Reserved1[3]; /* 04h */ 3251 U8 MsgFlags; /* 07h */ 3252 U32 MsgContext; /* 08h */ 3253 U32 Event; /* 0Ch */ 3254 U32 EventContext; /* 10h */ 3255 } MSG_EVENT_ACK, MPI_POINTER PTR_MSG_EVENT_ACK, 3256 EventAck_t, MPI_POINTER pEventAck_t; 3257 3258 typedef struct _MSG_EVENT_ACK_REPLY 3259 { 3260 U8 Reserved[2]; /* 00h */ 3261 U8 MsgLength; /* 02h */ 3262 U8 Function; /* 03h */ 3263 U8 Reserved1[3]; /* 04h */ 3264 U8 MsgFlags; /* 07h */ 3265 U32 MsgContext; /* 08h */ 3266 U16 Reserved2; /* 0Ch */ 3267 U16 IOCStatus; /* 0Eh */ 3268 U32 IOCLogInfo; /* 10h */ 3269 } MSG_EVENT_ACK_REPLY, MPI_POINTER PTR_MSG_EVENT_ACK_REPLY, 3270 EventAckReply_t, MPI_POINTER pEventAckReply_t; 3271 3272 /* Switch */ 3273 3274 #define MPI_EVENT_NOTIFICATION_SWITCH_OFF (0x00) 3275 #define MPI_EVENT_NOTIFICATION_SWITCH_ON (0x01) 3276 3277 /* Event */ 3278 3279 #define MPI_EVENT_NONE (0x00000000) 3280 #define MPI_EVENT_LOG_DATA (0x00000001) 3281 #define MPI_EVENT_STATE_CHANGE (0x00000002) 3282 #define MPI_EVENT_UNIT_ATTENTION (0x00000003) 3283 #define MPI_EVENT_IOC_BUS_RESET (0x00000004) 3284 #define MPI_EVENT_EXT_BUS_RESET (0x00000005) 3285 #define MPI_EVENT_RESCAN (0x00000006) 3286 #define MPI_EVENT_LINK_STATUS_CHANGE (0x00000007) 3287 #define MPI_EVENT_LOOP_STATE_CHANGE (0x00000008) 3288 #define MPI_EVENT_LOGOUT (0x00000009) 3289 #define MPI_EVENT_EVENT_CHANGE (0x0000000A) 3290 #define MPI_EVENT_INTEGRATED_RAID (0x0000000B) 3291 #define MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE (0x0000000C) 3292 #define MPI_EVENT_ON_BUS_TIMER_EXPIRED (0x0000000D) 3293 #define MPI_EVENT_QUEUE_FULL (0x0000000E) 3294 #define MPI_EVENT_SAS_DEVICE_STATUS_CHANGE (0x0000000F) 3295 #define MPI_EVENT_SAS_SES (0x00000010) 3296 #define MPI_EVENT_PERSISTENT_TABLE_FULL (0x00000011) 3297 #define MPI_EVENT_SAS_PHY_LINK_STATUS (0x00000012) 3298 #define MPI_EVENT_SAS_DISCOVERY_ERROR (0x00000013) 3299 #define MPI_EVENT_IR_RESYNC_UPDATE (0x00000014) 3300 #define MPI_EVENT_IR2 (0x00000015) 3301 #define MPI_EVENT_SAS_DISCOVERY (0x00000016) 3302 3303 /* AckRequired field values */ 3304 3305 #define MPI_EVENT_NOTIFICATION_ACK_NOT_REQUIRED (0x00) 3306 #define MPI_EVENT_NOTIFICATION_ACK_REQUIRED (0x01) 3307 3308 /* EventChange Event data */ 3309 3310 typedef struct _EVENT_DATA_EVENT_CHANGE 3311 { 3312 U8 EventState; /* 00h */ 3313 U8 Reserved; /* 01h */ 3314 U16 Reserved1; /* 02h */ 3315 } EVENT_DATA_EVENT_CHANGE, MPI_POINTER PTR_EVENT_DATA_EVENT_CHANGE, 3316 EventDataEventChange_t, MPI_POINTER pEventDataEventChange_t; 3317 3318 /* SCSI Event data for Port, Bus and Device forms */ 3319 3320 typedef struct _EVENT_DATA_SCSI 3321 { 3322 U8 TargetID; /* 00h */ 3323 U8 BusPort; /* 01h */ 3324 U16 Reserved; /* 02h */ 3325 } EVENT_DATA_SCSI, MPI_POINTER PTR_EVENT_DATA_SCSI, 3326 EventDataScsi_t, MPI_POINTER pEventDataScsi_t; 3327 3328 /* SCSI Device Status Change Event data */ 3329 3330 typedef struct _EVENT_DATA_SCSI_DEVICE_STATUS_CHANGE 3331 { 3332 U8 TargetID; /* 00h */ 3333 U8 Bus; /* 01h */ 3334 U8 ReasonCode; /* 02h */ 3335 U8 LUN; /* 03h */ 3336 U8 ASC; /* 04h */ 3337 U8 ASCQ; /* 05h */ 3338 U16 Reserved; /* 06h */ 3339 } EVENT_DATA_SCSI_DEVICE_STATUS_CHANGE, 3340 MPI_POINTER PTR_EVENT_DATA_SCSI_DEVICE_STATUS_CHANGE, 3341 MpiEventDataScsiDeviceStatusChange_t, 3342 MPI_POINTER pMpiEventDataScsiDeviceStatusChange_t; 3343 3344 /* MPI SCSI Device Status Change Event data ReasonCode values */ 3345 #define MPI_EVENT_SCSI_DEV_STAT_RC_ADDED (0x03) 3346 #define MPI_EVENT_SCSI_DEV_STAT_RC_NOT_RESPONDING (0x04) 3347 #define MPI_EVENT_SCSI_DEV_STAT_RC_SMART_DATA (0x05) 3348 3349 /* MPI Link Status Change Event data */ 3350 3351 typedef struct _EVENT_DATA_LINK_STATUS 3352 { 3353 U8 State; /* 00h */ 3354 U8 Reserved; /* 01h */ 3355 U16 Reserved1; /* 02h */ 3356 U8 Reserved2; /* 04h */ 3357 U8 Port; /* 05h */ 3358 U16 Reserved3; /* 06h */ 3359 } EVENT_DATA_LINK_STATUS, MPI_POINTER PTR_EVENT_DATA_LINK_STATUS, 3360 EventDataLinkStatus_t, MPI_POINTER pEventDataLinkStatus_t; 3361 3362 #define MPI_EVENT_LINK_STATUS_FAILURE (0x00000000) 3363 #define MPI_EVENT_LINK_STATUS_ACTIVE (0x00000001) 3364 3365 /* MPI Loop State Change Event data */ 3366 3367 typedef struct _EVENT_DATA_LOOP_STATE 3368 { 3369 U8 Character4; /* 00h */ 3370 U8 Character3; /* 01h */ 3371 U8 Type; /* 02h */ 3372 U8 Reserved; /* 03h */ 3373 U8 Reserved1; /* 04h */ 3374 U8 Port; /* 05h */ 3375 U16 Reserved2; /* 06h */ 3376 } EVENT_DATA_LOOP_STATE, MPI_POINTER PTR_EVENT_DATA_LOOP_STATE, 3377 EventDataLoopState_t, MPI_POINTER pEventDataLoopState_t; 3378 3379 #define MPI_EVENT_LOOP_STATE_CHANGE_LIP (0x0001) 3380 #define MPI_EVENT_LOOP_STATE_CHANGE_LPE (0x0002) 3381 #define MPI_EVENT_LOOP_STATE_CHANGE_LPB (0x0003) 3382 3383 /* MPI LOGOUT Event data */ 3384 3385 typedef struct _EVENT_DATA_LOGOUT 3386 { 3387 U32 NPortID; /* 00h */ 3388 U8 Reserved; /* 04h */ 3389 U8 Port; /* 05h */ 3390 U16 Reserved1; /* 06h */ 3391 } EVENT_DATA_LOGOUT, MPI_POINTER PTR_EVENT_DATA_LOGOUT, 3392 EventDataLogout_t, MPI_POINTER pEventDataLogout_t; 3393 3394 /* MPI Integrated RAID Event data */ 3395 3396 typedef struct _EVENT_DATA_RAID 3397 { 3398 U8 VolumeID; /* 00h */ 3399 U8 VolumeBus; /* 01h */ 3400 U8 ReasonCode; /* 02h */ 3401 U8 PhysDiskNum; /* 03h */ 3402 U8 ASC; /* 04h */ 3403 U8 ASCQ; /* 05h */ 3404 U16 Reserved; /* 06h */ 3405 U32 SettingsStatus; /* 08h */ 3406 } EVENT_DATA_RAID, MPI_POINTER PTR_EVENT_DATA_RAID, 3407 MpiEventDataRaid_t, MPI_POINTER pMpiEventDataRaid_t; 3408 3409 /* MPI Integrated RAID Event data ReasonCode values */ 3410 #define MPI_EVENT_RAID_RC_VOLUME_CREATED (0x00) 3411 #define MPI_EVENT_RAID_RC_VOLUME_DELETED (0x01) 3412 #define MPI_EVENT_RAID_RC_VOLUME_SETTINGS_CHANGED (0x02) 3413 #define MPI_EVENT_RAID_RC_VOLUME_STATUS_CHANGED (0x03) 3414 #define MPI_EVENT_RAID_RC_VOLUME_PHYSDISK_CHANGED (0x04) 3415 #define MPI_EVENT_RAID_RC_PHYSDISK_CREATED (0x05) 3416 #define MPI_EVENT_RAID_RC_PHYSDISK_DELETED (0x06) 3417 #define MPI_EVENT_RAID_RC_PHYSDISK_SETTINGS_CHANGED (0x07) 3418 #define MPI_EVENT_RAID_RC_PHYSDISK_STATUS_CHANGED (0x08) 3419 #define MPI_EVENT_RAID_RC_DOMAIN_VAL_NEEDED (0x09) 3420 #define MPI_EVENT_RAID_RC_SMART_DATA (0x0A) 3421 #define MPI_EVENT_RAID_RC_REPLACE_ACTION_STARTED (0x0B) 3422 3423 /* MPI SAS Phy Link Event data */ 3424 3425 typedef struct _EVENT_DATA_SAS_PHY_LINK_STATUS 3426 { 3427 U8 PhyNum; /* 00h */ 3428 U8 LinkRates; /* 01h */ 3429 U16 DevHandle; /* 02h */ 3430 U64 SASAddress; /* 04h */ 3431 } EVENT_DATA_SAS_PHY_LINK_STATUS, 3432 MPI_POINTER PTR_EVENT_DATA_SAS_PHY_LINK_STATUS, 3433 EventDataSASPhyLinkStatus_t, MPI_POINTER pEventDataSASPhyLinkStatus_t; 3434 3435 #define MPI_EVENT_SAS_PLS_LR_CURRENT_MASK (0xF0) 3436 #define MPI_EVENT_SAS_PLS_LR_CURRENT_SHIFT (4) 3437 #define MPI_EVENT_SAS_PLS_LR_PREVIOUS_MASK (0x0F) 3438 #define MPI_EVENT_SAS_PLS_LR_PREVIOUS_SHIFT (0) 3439 #define MPI_EVENT_SAS_PLS_LR_RATE_UNKNOWN (0x00) 3440 #define MPI_EVENT_SAS_PLS_LR_RATE_PHY_DISABLED (0x01) 3441 #define MPI_EVENT_SAS_PLS_LR_RATE_FAILED_SPEED_NEG (0x02) 3442 #define MPI_EVENT_SAS_PLS_LR_RATE_SATA_OOB_COMPLETE (0x03) 3443 #define MPI_EVENT_SAS_PLS_LR_RATE_1_5 (0x08) 3444 #define MPI_EVENT_SAS_PLS_LR_RATE_3_0 (0x09) 3445 3446 /***************************************************************************** 3447 * 3448 * F i r m w a r e L o a d M e s s a g e s 3449 * 3450 *****************************************************************************/ 3451 3452 /****************************************************************************/ 3453 /* Firmware Download message and associated structures */ 3454 /****************************************************************************/ 3455 3456 typedef struct _MSG_FW_DOWNLOAD 3457 { 3458 U8 ImageType; /* 00h */ 3459 U8 Reserved; /* 01h */ 3460 U8 ChainOffset; /* 02h */ 3461 U8 Function; /* 03h */ 3462 U8 Reserved1[3]; /* 04h */ 3463 U8 MsgFlags; /* 07h */ 3464 U32 MsgContext; /* 08h */ 3465 SGE_MPI_UNION SGL; /* 0Ch */ 3466 } MSG_FW_DOWNLOAD, MPI_POINTER PTR_MSG_FW_DOWNLOAD, 3467 FWDownload_t, MPI_POINTER pFWDownload_t; 3468 3469 #define MPI_FW_DOWNLOAD_ITYPE_RESERVED (0x00) 3470 #define MPI_FW_DOWNLOAD_ITYPE_FW (0x01) 3471 #define MPI_FW_DOWNLOAD_ITYPE_BIOS (0x02) 3472 #define MPI_FW_DOWNLOAD_ITYPE_NVDATA (0x03) 3473 3474 3475 typedef struct _FWDownloadTCSGE 3476 { 3477 U8 Reserved; /* 00h */ 3478 U8 ContextSize; /* 01h */ 3479 U8 DetailsLength; /* 02h */ 3480 U8 Flags; /* 03h */ 3481 U32 Reserved_0100_Checksum; /* 04h */ /* obsolete Checksum */ 3482 U32 ImageOffset; /* 08h */ 3483 U32 ImageSize; /* 0Ch */ 3484 } FW_DOWNLOAD_TCSGE, MPI_POINTER PTR_FW_DOWNLOAD_TCSGE, 3485 FWDownloadTCSGE_t, MPI_POINTER pFWDownloadTCSGE_t; 3486 3487 /* Firmware Download reply */ 3488 typedef struct _MSG_FW_DOWNLOAD_REPLY 3489 { 3490 U8 ImageType; /* 00h */ 3491 U8 Reserved; /* 01h */ 3492 U8 MsgLength; /* 02h */ 3493 U8 Function; /* 03h */ 3494 U8 Reserved1[3]; /* 04h */ 3495 U8 MsgFlags; /* 07h */ 3496 U32 MsgContext; /* 08h */ 3497 U16 Reserved2; /* 0Ch */ 3498 U16 IOCStatus; /* 0Eh */ 3499 U32 IOCLogInfo; /* 10h */ 3500 } MSG_FW_DOWNLOAD_REPLY, MPI_POINTER PTR_MSG_FW_DOWNLOAD_REPLY, 3501 FWDownloadReply_t, MPI_POINTER pFWDownloadReply_t; 3502 3503 3504 /****************************************************************************/ 3505 /* Firmware Upload message and associated structures */ 3506 /****************************************************************************/ 3507 3508 typedef struct _MSG_FW_UPLOAD 3509 { 3510 U8 ImageType; /* 00h */ 3511 U8 Reserved; /* 01h */ 3512 U8 ChainOffset; /* 02h */ 3513 U8 Function; /* 03h */ 3514 U8 Reserved1[3]; /* 04h */ 3515 U8 MsgFlags; /* 07h */ 3516 U32 MsgContext; /* 08h */ 3517 SGE_MPI_UNION SGL; /* 0Ch */ 3518 } MSG_FW_UPLOAD, MPI_POINTER PTR_MSG_FW_UPLOAD, 3519 FWUpload_t, MPI_POINTER pFWUpload_t; 3520 3521 #define MPI_FW_UPLOAD_ITYPE_FW_IOC_MEM (0x00) 3522 #define MPI_FW_UPLOAD_ITYPE_FW_FLASH (0x01) 3523 #define MPI_FW_UPLOAD_ITYPE_BIOS_FLASH (0x02) 3524 #define MPI_FW_UPLOAD_ITYPE_NVDATA (0x03) 3525 3526 typedef struct _FWUploadTCSGE 3527 { 3528 U8 Reserved; /* 00h */ 3529 U8 ContextSize; /* 01h */ 3530 U8 DetailsLength; /* 02h */ 3531 U8 Flags; /* 03h */ 3532 U32 Reserved1; /* 04h */ 3533 U32 ImageOffset; /* 08h */ 3534 U32 ImageSize; /* 0Ch */ 3535 } FW_UPLOAD_TCSGE, MPI_POINTER PTR_FW_UPLOAD_TCSGE, 3536 FWUploadTCSGE_t, MPI_POINTER pFWUploadTCSGE_t; 3537 3538 /* Firmware Upload reply */ 3539 typedef struct _MSG_FW_UPLOAD_REPLY 3540 { 3541 U8 ImageType; /* 00h */ 3542 U8 Reserved; /* 01h */ 3543 U8 MsgLength; /* 02h */ 3544 U8 Function; /* 03h */ 3545 U8 Reserved1[3]; /* 04h */ 3546 U8 MsgFlags; /* 07h */ 3547 U32 MsgContext; /* 08h */ 3548 U16 Reserved2; /* 0Ch */ 3549 U16 IOCStatus; /* 0Eh */ 3550 U32 IOCLogInfo; /* 10h */ 3551 U32 ActualImageSize; /* 14h */ 3552 } MSG_FW_UPLOAD_REPLY, MPI_POINTER PTR_MSG_FW_UPLOAD_REPLY, 3553 FWUploadReply_t, MPI_POINTER pFWUploadReply_t; 3554 3555 3556 typedef struct _MPI_FW_HEADER 3557 { 3558 U32 ArmBranchInstruction0; /* 00h */ 3559 U32 Signature0; /* 04h */ 3560 U32 Signature1; /* 08h */ 3561 U32 Signature2; /* 0Ch */ 3562 U32 ArmBranchInstruction1; /* 10h */ 3563 U32 ArmBranchInstruction2; /* 14h */ 3564 U32 Reserved; /* 18h */ 3565 U32 Checksum; /* 1Ch */ 3566 U16 VendorId; /* 20h */ 3567 U16 ProductId; /* 22h */ 3568 MPI_FW_VERSION FWVersion; /* 24h */ 3569 U32 SeqCodeVersion; /* 28h */ 3570 U32 ImageSize; /* 2Ch */ 3571 U32 NextImageHeaderOffset; /* 30h */ 3572 U32 LoadStartAddress; /* 34h */ 3573 U32 IopResetVectorValue; /* 38h */ 3574 U32 IopResetRegAddr; /* 3Ch */ 3575 U32 VersionNameWhat; /* 40h */ 3576 U8 VersionName[32]; /* 44h */ 3577 U32 VendorNameWhat; /* 64h */ 3578 U8 VendorName[32]; /* 68h */ 3579 } MPI_FW_HEADER, MPI_POINTER PTR_MPI_FW_HEADER, 3580 MpiFwHeader_t, MPI_POINTER pMpiFwHeader_t; 3581 3582 #define MPI_FW_HEADER_WHAT_SIGNATURE (0x29232840) 3583 3584 /* defines for using the ProductId field */ 3585 #define MPI_FW_HEADER_PID_TYPE_MASK (0xF000) 3586 #define MPI_FW_HEADER_PID_TYPE_SCSI (0x0000) 3587 #define MPI_FW_HEADER_PID_TYPE_FC (0x1000) 3588 3589 #define MPI_FW_HEADER_PID_PROD_MASK (0x0F00) 3590 #define MPI_FW_HEADER_PID_PROD_INITIATOR_SCSI (0x0100) 3591 #define MPI_FW_HEADER_PID_PROD_TARGET_INITIATOR_SCSI (0x0200) 3592 #define MPI_FW_HEADER_PID_PROD_TARGET_SCSI (0x0300) 3593 #define MPI_FW_HEADER_PID_PROD_IM_SCSI (0x0400) 3594 #define MPI_FW_HEADER_PID_PROD_IS_SCSI (0x0500) 3595 #define MPI_FW_HEADER_PID_PROD_CTX_SCSI (0x0600) 3596 3597 #define MPI_FW_HEADER_PID_FAMILY_MASK (0x00FF) 3598 #define MPI_FW_HEADER_PID_FAMILY_1030A0_SCSI (0x0001) 3599 #define MPI_FW_HEADER_PID_FAMILY_1030B0_SCSI (0x0002) 3600 #define MPI_FW_HEADER_PID_FAMILY_1030B1_SCSI (0x0003) 3601 #define MPI_FW_HEADER_PID_FAMILY_1030C0_SCSI (0x0004) 3602 #define MPI_FW_HEADER_PID_FAMILY_1020A0_SCSI (0x0005) 3603 #define MPI_FW_HEADER_PID_FAMILY_1020B0_SCSI (0x0006) 3604 #define MPI_FW_HEADER_PID_FAMILY_1020B1_SCSI (0x0007) 3605 #define MPI_FW_HEADER_PID_FAMILY_1020C0_SCSI (0x0008) 3606 #define MPI_FW_HEADER_PID_FAMILY_1035A0_SCSI (0x0009) 3607 #define MPI_FW_HEADER_PID_FAMILY_1035B0_SCSI (0x000A) 3608 #define MPI_FW_HEADER_PID_FAMILY_909_FC (0x0000) 3609 #define MPI_FW_HEADER_PID_FAMILY_919_FC (0x0001) 3610 #define MPI_FW_HEADER_PID_FAMILY_919X_FC (0x0002) 3611 3612 typedef struct _MPI_EXT_IMAGE_HEADER 3613 { 3614 U8 ImageType; /* 00h */ 3615 U8 Reserved; /* 01h */ 3616 U16 Reserved1; /* 02h */ 3617 U32 Checksum; /* 04h */ 3618 U32 ImageSize; /* 08h */ 3619 U32 NextImageHeaderOffset; /* 0Ch */ 3620 U32 LoadStartAddress; /* 10h */ 3621 U32 Reserved2; /* 14h */ 3622 } MPI_EXT_IMAGE_HEADER, MPI_POINTER PTR_MPI_EXT_IMAGE_HEADER, 3623 MpiExtImageHeader_t, MPI_POINTER pMpiExtImageHeader_t; 3624 3625 /* defines for the ImageType field */ 3626 #define MPI_EXT_IMAGE_TYPE_UNSPECIFIED (0x00) 3627 #define MPI_EXT_IMAGE_TYPE_FW (0x01) 3628 #define MPI_EXT_IMAGE_TYPE_NVDATA (0x03) 3629 3630 #endif 3631 3632 /* 3633 * Copyright (c) 2000, 2001 by LSI Logic Corporation 3634 * 3635 * Redistribution and use in source and binary forms, with or without 3636 * modification, are permitted provided that the following conditions 3637 * are met: 3638 * 1. Redistributions of source code must retain the above copyright 3639 * notice immediately at the beginning of the file, without modification, 3640 * this list of conditions, and the following disclaimer. 3641 * 2. The name of the author may not be used to endorse or promote products 3642 * derived from this software without specific prior written permission. 3643 * 3644 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 3645 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 3646 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 3647 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 3648 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 3649 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 3650 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 3651 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 3652 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3653 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3654 * SUCH DAMAGE. 3655 * 3656 * 3657 * Name: MPI_LAN.H 3658 * Title: MPI LAN messages and structures 3659 * Creation Date: June 30, 2000 3660 * 3661 * MPI Version: 01.02.01 3662 * 3663 * Version History 3664 * --------------- 3665 * 3666 * Date Version Description 3667 * -------- -------- ------------------------------------------------------ 3668 * 05-08-00 00.10.01 Original release for 0.10 spec dated 4/26/2000. 3669 * 05-24-00 00.10.02 Added LANStatus field to _MSG_LAN_SEND_REPLY. 3670 * Added LANStatus field to _MSG_LAN_RECEIVE_POST_REPLY. 3671 * Moved ListCount field in _MSG_LAN_RECEIVE_POST_REPLY. 3672 * 06-06-00 01.00.01 Update version number for 1.0 release. 3673 * 06-12-00 01.00.02 Added MPI_ to BUCKETSTATUS_ definitions. 3674 * 06-22-00 01.00.03 Major changes to match new LAN definition in 1.0 spec. 3675 * 06-30-00 01.00.04 Added Context Reply definitions per revised proposal. 3676 * Changed transaction context usage to bucket/buffer. 3677 * 07-05-00 01.00.05 Removed LAN_RECEIVE_POST_BUCKET_CONTEXT_MASK definition 3678 * to lan private header file 3679 * 11-02-00 01.01.01 Original release for post 1.0 work 3680 * 02-20-01 01.01.02 Started using MPI_POINTER. 3681 * 03-27-01 01.01.03 Added structure offset comments. 3682 * 08-08-01 01.02.01 Original release for v1.2 work. 3683 * -------------------------------------------------------------------------- 3684 */ 3685 3686 #ifndef MPI_LAN_H 3687 #define MPI_LAN_H 3688 3689 3690 /****************************************************************************** 3691 * 3692 * L A N M e s s a g e s 3693 * 3694 *******************************************************************************/ 3695 3696 /* LANSend messages */ 3697 3698 typedef struct _MSG_LAN_SEND_REQUEST 3699 { 3700 U16 Reserved; /* 00h */ 3701 U8 ChainOffset; /* 02h */ 3702 U8 Function; /* 03h */ 3703 U16 Reserved2; /* 04h */ 3704 U8 PortNumber; /* 06h */ 3705 U8 MsgFlags; /* 07h */ 3706 U32 MsgContext; /* 08h */ 3707 SGE_MPI_UNION SG_List[1]; /* 0Ch */ 3708 } MSG_LAN_SEND_REQUEST, MPI_POINTER PTR_MSG_LAN_SEND_REQUEST, 3709 LANSendRequest_t, MPI_POINTER pLANSendRequest_t; 3710 3711 3712 typedef struct _MSG_LAN_SEND_REPLY 3713 { 3714 U16 Reserved; /* 00h */ 3715 U8 MsgLength; /* 02h */ 3716 U8 Function; /* 03h */ 3717 U8 Reserved2; /* 04h */ 3718 U8 NumberOfContexts; /* 05h */ 3719 U8 PortNumber; /* 06h */ 3720 U8 MsgFlags; /* 07h */ 3721 U32 MsgContext; /* 08h */ 3722 U16 Reserved3; /* 0Ch */ 3723 U16 IOCStatus; /* 0Eh */ 3724 U32 IOCLogInfo; /* 10h */ 3725 U32 BufferContext; /* 14h */ 3726 } MSG_LAN_SEND_REPLY, MPI_POINTER PTR_MSG_LAN_SEND_REPLY, 3727 LANSendReply_t, MPI_POINTER pLANSendReply_t; 3728 3729 3730 /* LANReceivePost */ 3731 3732 typedef struct _MSG_LAN_RECEIVE_POST_REQUEST 3733 { 3734 U16 Reserved; /* 00h */ 3735 U8 ChainOffset; /* 02h */ 3736 U8 Function; /* 03h */ 3737 U16 Reserved2; /* 04h */ 3738 U8 PortNumber; /* 06h */ 3739 U8 MsgFlags; /* 07h */ 3740 U32 MsgContext; /* 08h */ 3741 U32 BucketCount; /* 0Ch */ 3742 SGE_MPI_UNION SG_List[1]; /* 10h */ 3743 } MSG_LAN_RECEIVE_POST_REQUEST, MPI_POINTER PTR_MSG_LAN_RECEIVE_POST_REQUEST, 3744 LANReceivePostRequest_t, MPI_POINTER pLANReceivePostRequest_t; 3745 3746 3747 typedef struct _MSG_LAN_RECEIVE_POST_REPLY 3748 { 3749 U16 Reserved; /* 00h */ 3750 U8 MsgLength; /* 02h */ 3751 U8 Function; /* 03h */ 3752 U8 Reserved2; /* 04h */ 3753 U8 NumberOfContexts; /* 05h */ 3754 U8 PortNumber; /* 06h */ 3755 U8 MsgFlags; /* 07h */ 3756 U32 MsgContext; /* 08h */ 3757 U16 Reserved3; /* 0Ch */ 3758 U16 IOCStatus; /* 0Eh */ 3759 U32 IOCLogInfo; /* 10h */ 3760 U32 BucketsRemaining; /* 14h */ 3761 U32 PacketOffset; /* 18h */ 3762 U32 PacketLength; /* 1Ch */ 3763 U32 BucketContext[1]; /* 20h */ 3764 } MSG_LAN_RECEIVE_POST_REPLY, MPI_POINTER PTR_MSG_LAN_RECEIVE_POST_REPLY, 3765 LANReceivePostReply_t, MPI_POINTER pLANReceivePostReply_t; 3766 3767 3768 /* LANReset */ 3769 3770 typedef struct _MSG_LAN_RESET_REQUEST 3771 { 3772 U16 Reserved; /* 00h */ 3773 U8 ChainOffset; /* 02h */ 3774 U8 Function; /* 03h */ 3775 U16 Reserved2; /* 04h */ 3776 U8 PortNumber; /* 05h */ 3777 U8 MsgFlags; /* 07h */ 3778 U32 MsgContext; /* 08h */ 3779 } MSG_LAN_RESET_REQUEST, MPI_POINTER PTR_MSG_LAN_RESET_REQUEST, 3780 LANResetRequest_t, MPI_POINTER pLANResetRequest_t; 3781 3782 3783 typedef struct _MSG_LAN_RESET_REPLY 3784 { 3785 U16 Reserved; /* 00h */ 3786 U8 MsgLength; /* 02h */ 3787 U8 Function; /* 03h */ 3788 U16 Reserved2; /* 04h */ 3789 U8 PortNumber; /* 06h */ 3790 U8 MsgFlags; /* 07h */ 3791 U32 MsgContext; /* 08h */ 3792 U16 Reserved3; /* 0Ch */ 3793 U16 IOCStatus; /* 0Eh */ 3794 U32 IOCLogInfo; /* 10h */ 3795 } MSG_LAN_RESET_REPLY, MPI_POINTER PTR_MSG_LAN_RESET_REPLY, 3796 LANResetReply_t, MPI_POINTER pLANResetReply_t; 3797 3798 3799 /****************************************************************************/ 3800 /* LAN Context Reply defines and macros */ 3801 /****************************************************************************/ 3802 3803 #define LAN_REPLY_PACKET_LENGTH_MASK (0x0000FFFF) 3804 #define LAN_REPLY_PACKET_LENGTH_SHIFT (0) 3805 #define LAN_REPLY_BUCKET_CONTEXT_MASK (0x07FF0000) 3806 #define LAN_REPLY_BUCKET_CONTEXT_SHIFT (16) 3807 #define LAN_REPLY_BUFFER_CONTEXT_MASK (0x07FFFFFF) 3808 #define LAN_REPLY_BUFFER_CONTEXT_SHIFT (0) 3809 #define LAN_REPLY_FORM_MASK (0x18000000) 3810 #define LAN_REPLY_FORM_RECEIVE_SINGLE (0x00) 3811 #define LAN_REPLY_FORM_RECEIVE_MULTIPLE (0x01) 3812 #define LAN_REPLY_FORM_SEND_SINGLE (0x02) 3813 #define LAN_REPLY_FORM_MESSAGE_CONTEXT (0x03) 3814 #define LAN_REPLY_FORM_SHIFT (27) 3815 3816 #define GET_LAN_PACKET_LENGTH(x) (((x) & LAN_REPLY_PACKET_LENGTH_MASK) \ 3817 >> LAN_REPLY_PACKET_LENGTH_SHIFT) 3818 3819 #define SET_LAN_PACKET_LENGTH(x, lth) \ 3820 ((x) = ((x) & ~LAN_REPLY_PACKET_LENGTH_MASK) | \ 3821 (((lth) << LAN_REPLY_PACKET_LENGTH_SHIFT) & \ 3822 LAN_REPLY_PACKET_LENGTH_MASK)) 3823 3824 #define GET_LAN_BUCKET_CONTEXT(x) (((x) & LAN_REPLY_BUCKET_CONTEXT_MASK) \ 3825 >> LAN_REPLY_BUCKET_CONTEXT_SHIFT) 3826 3827 #define SET_LAN_BUCKET_CONTEXT(x, ctx) \ 3828 ((x) = ((x) & ~LAN_REPLY_BUCKET_CONTEXT_MASK) | \ 3829 (((ctx) << LAN_REPLY_BUCKET_CONTEXT_SHIFT) & \ 3830 LAN_REPLY_BUCKET_CONTEXT_MASK)) 3831 3832 #define GET_LAN_BUFFER_CONTEXT(x) (((x) & LAN_REPLY_BUFFER_CONTEXT_MASK) \ 3833 >> LAN_REPLY_BUFFER_CONTEXT_SHIFT) 3834 3835 #define SET_LAN_BUFFER_CONTEXT(x, ctx) \ 3836 ((x) = ((x) & ~LAN_REPLY_BUFFER_CONTEXT_MASK) | \ 3837 (((ctx) << LAN_REPLY_BUFFER_CONTEXT_SHIFT) & \ 3838 LAN_REPLY_BUFFER_CONTEXT_MASK)) 3839 3840 #define GET_LAN_FORM(x) (((x) & LAN_REPLY_FORM_MASK) \ 3841 >> LAN_REPLY_FORM_SHIFT) 3842 3843 #define SET_LAN_FORM(x, frm) \ 3844 ((x) = ((x) & ~LAN_REPLY_FORM_MASK) | \ 3845 (((frm) << LAN_REPLY_FORM_SHIFT) & \ 3846 LAN_REPLY_FORM_MASK)) 3847 3848 3849 /****************************************************************************/ 3850 /* LAN Current Device State defines */ 3851 /****************************************************************************/ 3852 3853 #define MPI_LAN_DEVICE_STATE_RESET (0x00) 3854 #define MPI_LAN_DEVICE_STATE_OPERATIONAL (0x01) 3855 3856 3857 /****************************************************************************/ 3858 /* LAN Loopback defines */ 3859 /****************************************************************************/ 3860 3861 #define MPI_LAN_TX_MODES_ENABLE_LOOPBACK_SUPPRESSION (0x01) 3862 3863 #endif 3864 3865 3866 /* 3867 * Copyright (c) 2000, 2001 by LSI Logic Corporation 3868 * 3869 * Redistribution and use in source and binary forms, with or without 3870 * modification, are permitted provided that the following conditions 3871 * are met: 3872 * 1. Redistributions of source code must retain the above copyright 3873 * notice immediately at the beginning of the file, without modification, 3874 * this list of conditions, and the following disclaimer. 3875 * 2. The name of the author may not be used to endorse or promote products 3876 * derived from this software without specific prior written permission. 3877 * 3878 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 3879 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 3880 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 3881 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 3882 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 3883 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 3884 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 3885 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 3886 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3887 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3888 * SUCH DAMAGE. 3889 * 3890 * 3891 * Name: MPI_TARG.H 3892 * Title: MPI Target mode messages and structures 3893 * Creation Date: June 22, 2000 3894 * 3895 * MPI Version: 01.02.04 3896 * 3897 * Version History 3898 * --------------- 3899 * 3900 * Date Version Description 3901 * -------- -------- ------------------------------------------------------ 3902 * 05-08-00 00.10.01 Original release for 0.10 spec dated 4/26/2000. 3903 * 06-06-00 01.00.01 Update version number for 1.0 release. 3904 * 06-22-00 01.00.02 Added _MSG_TARGET_CMD_BUFFER_POST_REPLY structure. 3905 * Corrected DECSRIPTOR typo to DESCRIPTOR. 3906 * 11-02-00 01.01.01 Original release for post 1.0 work 3907 * Modified target mode to use IoIndex instead of 3908 * HostIndex and IocIndex. Added Alias. 3909 * 01-09-01 01.01.02 Added defines for TARGET_ASSIST_FLAGS_REPOST_CMD_BUFFER 3910 * and TARGET_STATUS_SEND_FLAGS_REPOST_CMD_BUFFER. 3911 * 02-20-01 01.01.03 Started using MPI_POINTER. 3912 * Added structures for MPI_TARGET_SCSI_SPI_CMD_BUFFER and 3913 * MPI_TARGET_FCP_CMD_BUFFER. 3914 * 03-27-01 01.01.04 Added structure offset comments. 3915 * 08-08-01 01.02.01 Original release for v1.2 work. 3916 * 09-28-01 01.02.02 Added structure for MPI_TARGET_SCSI_SPI_STATUS_IU. 3917 * Added PriorityReason field to some replies and 3918 * defined more PriorityReason codes. 3919 * Added some defines for to support previous version 3920 * of MPI. 3921 * 10-04-01 01.02.03 Added PriorityReason to MSG_TARGET_ERROR_REPLY. 3922 * 11-01-01 01.02.04 Added define for TARGET_STATUS_SEND_FLAGS_HIGH_PRIORITY. 3923 * -------------------------------------------------------------------------- 3924 */ 3925 3926 #ifndef MPI_TARG_H 3927 #define MPI_TARG_H 3928 3929 3930 /****************************************************************************** 3931 * 3932 * S C S I T a r g e t M e s s a g e s 3933 * 3934 *******************************************************************************/ 3935 3936 typedef struct _CMD_BUFFER_DESCRIPTOR 3937 { 3938 U16 IoIndex; /* 00h */ 3939 U16 Reserved; /* 02h */ 3940 union /* 04h */ 3941 { 3942 U32 PhysicalAddress32; 3943 U64 PhysicalAddress64; 3944 } _u; 3945 } CMD_BUFFER_DESCRIPTOR, MPI_POINTER PTR_CMD_BUFFER_DESCRIPTOR, 3946 CmdBufferDescriptor_t, MPI_POINTER pCmdBufferDescriptor_t; 3947 3948 3949 /****************************************************************************/ 3950 /* Target Command Buffer Post Request */ 3951 /****************************************************************************/ 3952 3953 typedef struct _MSG_TARGET_CMD_BUFFER_POST_REQUEST 3954 { 3955 U8 BufferPostFlags; /* 00h */ 3956 U8 BufferCount; /* 01h */ 3957 U8 ChainOffset; /* 02h */ 3958 U8 Function; /* 03h */ 3959 U8 BufferLength; /* 04h */ 3960 U8 Reserved; /* 05h */ 3961 U8 Reserved1; /* 06h */ 3962 U8 MsgFlags; /* 07h */ 3963 U32 MsgContext; /* 08h */ 3964 CMD_BUFFER_DESCRIPTOR Buffer[1]; /* 0Ch */ 3965 } MSG_TARGET_CMD_BUFFER_POST_REQUEST, MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_REQUEST, 3966 TargetCmdBufferPostRequest_t, MPI_POINTER pTargetCmdBufferPostRequest_t; 3967 3968 #define CMD_BUFFER_POST_FLAGS_PORT_MASK (0x01) 3969 #define CMD_BUFFER_POST_FLAGS_ADDR_MODE_MASK (0x80) 3970 #define CMD_BUFFER_POST_FLAGS_ADDR_MODE_32 (0) 3971 #define CMD_BUFFER_POST_FLAGS_ADDR_MODE_64 (1) 3972 #define CMD_BUFFER_POST_FLAGS_64_BIT_ADDR (0x80) 3973 3974 #define CMD_BUFFER_POST_IO_INDEX_MASK (0x00003FFF) 3975 #define CMD_BUFFER_POST_IO_INDEX_MASK_0100 (0x000003FF) /* obsolete */ 3976 3977 3978 typedef struct _MSG_TARGET_CMD_BUFFER_POST_REPLY 3979 { 3980 U8 BufferPostFlags; /* 00h */ 3981 U8 BufferCount; /* 01h */ 3982 U8 MsgLength; /* 02h */ 3983 U8 Function; /* 03h */ 3984 U8 BufferLength; /* 04h */ 3985 U8 Reserved; /* 05h */ 3986 U8 Reserved1; /* 06h */ 3987 U8 MsgFlags; /* 07h */ 3988 U32 MsgContext; /* 08h */ 3989 U16 Reserved2; /* 0Ch */ 3990 U16 IOCStatus; /* 0Eh */ 3991 U32 IOCLogInfo; /* 10h */ 3992 } MSG_TARGET_CMD_BUFFER_POST_REPLY, MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_REPLY, 3993 TargetCmdBufferPostReply_t, MPI_POINTER pTargetCmdBufferPostReply_t; 3994 3995 /* the following structure is obsolete as of MPI v1.2 */ 3996 typedef struct _MSG_PRIORITY_CMD_RECEIVED_REPLY 3997 { 3998 U16 Reserved; /* 00h */ 3999 U8 MsgLength; /* 02h */ 4000 U8 Function; /* 03h */ 4001 U16 Reserved1; /* 04h */ 4002 U8 Reserved2; /* 06h */ 4003 U8 MsgFlags; /* 07h */ 4004 U32 MsgContext; /* 08h */ 4005 U8 PriorityReason; /* 0Ch */ 4006 U8 Reserved3; /* 0Dh */ 4007 U16 IOCStatus; /* 0Eh */ 4008 U32 IOCLogInfo; /* 10h */ 4009 U32 ReplyWord; /* 14h */ 4010 } MSG_PRIORITY_CMD_RECEIVED_REPLY, MPI_POINTER PTR_MSG_PRIORITY_CMD_RECEIVED_REPLY, 4011 PriorityCommandReceivedReply_t, MPI_POINTER pPriorityCommandReceivedReply_t; 4012 4013 #define PRIORITY_REASON_NO_DISCONNECT (0x00) 4014 #define PRIORITY_REASON_SCSI_TASK_MANAGEMENT (0x01) 4015 #define PRIORITY_REASON_CMD_PARITY_ERR (0x02) 4016 #define PRIORITY_REASON_MSG_OUT_PARITY_ERR (0x03) 4017 #define PRIORITY_REASON_LQ_CRC_ERR (0x04) 4018 #define PRIORITY_REASON_CMD_CRC_ERR (0x05) 4019 #define PRIORITY_REASON_PROTOCOL_ERR (0x06) 4020 #define PRIORITY_REASON_DATA_OUT_PARITY_ERR (0x07) 4021 #define PRIORITY_REASON_DATA_OUT_CRC_ERR (0x08) 4022 #define PRIORITY_REASON_UNKNOWN (0xFF) 4023 4024 4025 typedef struct _MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY 4026 { 4027 U16 Reserved; /* 00h */ 4028 U8 MsgLength; /* 02h */ 4029 U8 Function; /* 03h */ 4030 U16 Reserved1; /* 04h */ 4031 U8 Reserved2; /* 06h */ 4032 U8 MsgFlags; /* 07h */ 4033 U32 MsgContext; /* 08h */ 4034 U8 PriorityReason; /* 0Ch */ 4035 U8 Reserved3; /* 0Dh */ 4036 U16 IOCStatus; /* 0Eh */ 4037 U32 IOCLogInfo; /* 10h */ 4038 U32 ReplyWord; /* 14h */ 4039 } MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY, 4040 MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY, 4041 TargetCmdBufferPostErrorReply_t, MPI_POINTER pTargetCmdBufferPostErrorReply_t; 4042 4043 4044 typedef struct _MPI_TARGET_FCP_CMD_BUFFER 4045 { 4046 U8 FcpLun[8]; /* 00h */ 4047 U8 FcpCntl[4]; /* 08h */ 4048 U8 FcpCdb[16]; /* 0Ch */ 4049 U32 FcpDl; /* 1Ch */ 4050 } MPI_TARGET_FCP_CMD_BUFFER, MPI_POINTER PTR_MPI_TARGET_FCP_CMD_BUFFER, 4051 MpiTargetFcpCmdBuffer, MPI_POINTER pMpiTargetFcpCmdBuffer; 4052 4053 4054 typedef struct _MPI_TARGET_SCSI_SPI_CMD_BUFFER 4055 { 4056 /* SPI L_Q information unit */ 4057 U8 L_QType; /* 00h */ 4058 U8 Reserved; /* 01h */ 4059 U16 Tag; /* 02h */ 4060 U8 LogicalUnitNumber[8]; /* 04h */ 4061 U32 DataLength; /* 0Ch */ 4062 /* SPI command information unit */ 4063 U8 ReservedFirstByteOfCommandIU; /* 10h */ 4064 U8 TaskAttribute; /* 11h */ 4065 U8 TaskManagementFlags; /* 12h */ 4066 U8 AdditionalCDBLength; /* 13h */ 4067 U8 CDB[16]; /* 14h */ 4068 } MPI_TARGET_SCSI_SPI_CMD_BUFFER, 4069 MPI_POINTER PTR_MPI_TARGET_SCSI_SPI_CMD_BUFFER, 4070 MpiTargetScsiSpiCmdBuffer, MPI_POINTER pMpiTargetScsiSpiCmdBuffer; 4071 4072 4073 /****************************************************************************/ 4074 /* Target Assist Request */ 4075 /****************************************************************************/ 4076 4077 typedef struct _MSG_TARGET_ASSIST_REQUEST 4078 { 4079 U8 StatusCode; /* 00h */ 4080 U8 TargetAssistFlags; /* 01h */ 4081 U8 ChainOffset; /* 02h */ 4082 U8 Function; /* 03h */ 4083 U16 QueueTag; /* 04h */ 4084 U8 Reserved; /* 06h */ 4085 U8 MsgFlags; /* 07h */ 4086 U32 MsgContext; /* 08h */ 4087 U32 ReplyWord; /* 0Ch */ 4088 U8 LUN[8]; /* 10h */ 4089 U32 RelativeOffset; /* 18h */ 4090 U32 DataLength; /* 1Ch */ 4091 SGE_IO_UNION SGL[1]; /* 20h */ 4092 } MSG_TARGET_ASSIST_REQUEST, MPI_POINTER PTR_MSG_TARGET_ASSIST_REQUEST, 4093 TargetAssistRequest_t, MPI_POINTER pTargetAssistRequest_t; 4094 4095 #define TARGET_ASSIST_FLAGS_DATA_DIRECTION (0x01) 4096 #define TARGET_ASSIST_FLAGS_AUTO_STATUS (0x02) 4097 #define TARGET_ASSIST_FLAGS_HIGH_PRIORITY (0x04) 4098 #define TARGET_ASSIST_FLAGS_REPOST_CMD_BUFFER (0x80) 4099 4100 4101 typedef struct _MSG_TARGET_ERROR_REPLY 4102 { 4103 U16 Reserved; /* 00h */ 4104 U8 MsgLength; /* 02h */ 4105 U8 Function; /* 03h */ 4106 U16 Reserved1; /* 04h */ 4107 U8 Reserved2; /* 06h */ 4108 U8 MsgFlags; /* 07h */ 4109 U32 MsgContext; /* 08h */ 4110 U8 PriorityReason; /* 0Ch */ 4111 U8 Reserved3; /* 0Dh */ 4112 U16 IOCStatus; /* 0Eh */ 4113 U32 IOCLogInfo; /* 10h */ 4114 U32 ReplyWord; /* 14h */ 4115 U32 TransferCount; /* 18h */ 4116 } MSG_TARGET_ERROR_REPLY, MPI_POINTER PTR_MSG_TARGET_ERROR_REPLY, 4117 TargetErrorReply_t, MPI_POINTER pTargetErrorReply_t; 4118 4119 4120 /****************************************************************************/ 4121 /* Target Status Send Request */ 4122 /****************************************************************************/ 4123 4124 typedef struct _MSG_TARGET_STATUS_SEND_REQUEST 4125 { 4126 U8 StatusCode; /* 00h */ 4127 U8 StatusFlags; /* 01h */ 4128 U8 ChainOffset; /* 02h */ 4129 U8 Function; /* 03h */ 4130 U16 QueueTag; /* 04h */ 4131 U8 Reserved; /* 06h */ 4132 U8 MsgFlags; /* 07h */ 4133 U32 MsgContext; /* 08h */ 4134 U32 ReplyWord; /* 0Ch */ 4135 U8 LUN[8]; /* 10h */ 4136 SGE_SIMPLE_UNION StatusDataSGE; /* 18h */ 4137 } MSG_TARGET_STATUS_SEND_REQUEST, MPI_POINTER PTR_MSG_TARGET_STATUS_SEND_REQUEST, 4138 TargetStatusSendRequest_t, MPI_POINTER pTargetStatusSendRequest_t; 4139 4140 #define TARGET_STATUS_SEND_FLAGS_AUTO_GOOD_STATUS (0x01) 4141 #define TARGET_STATUS_SEND_FLAGS_HIGH_PRIORITY (0x04) 4142 #define TARGET_STATUS_SEND_FLAGS_REPOST_CMD_BUFFER (0x80) 4143 4144 typedef struct _MPI_TARGET_FCP_RSP_BUFFER 4145 { 4146 U8 Reserved0[8]; /* 00h */ 4147 U8 FcpStatus; /* 08h */ 4148 U8 FcpFlags; /* 09h */ 4149 U8 Reserved1[2]; /* 0Ah */ 4150 U32 FcpResid; /* 0Ch */ 4151 U32 FcpSenseLength; /* 10h */ 4152 U32 FcpResponseLength; /* 14h */ 4153 U8 FcpResponseData[8]; /* 18h */ 4154 U8 FcpSenseData[32]; /* Pad to 64 bytes */ /* 20h */ 4155 } MPI_TARGET_FCP_RSP_BUFFER, MPI_POINTER PTR_MPI_TARGET_FCP_RSP_BUFFER, 4156 MpiTargetFcpRspBuffer, MPI_POINTER pMpiTargetFcpRspBuffer; 4157 4158 typedef struct _MPI_TARGET_SCSI_SPI_STATUS_IU 4159 { 4160 U8 Reserved0; /* 00h */ 4161 U8 Reserved1; /* 01h */ 4162 U8 Valid; /* 02h */ 4163 U8 Status; /* 03h */ 4164 U32 SenseDataListLength; /* 04h */ 4165 U32 PktFailuresListLength; /* 08h */ 4166 U8 SenseData[52]; /* Pad the IU to 64 bytes */ /* 0Ch */ 4167 } MPI_TARGET_SCSI_SPI_STATUS_IU, MPI_POINTER PTR_MPI_TARGET_SCSI_SPI_STATUS_IU, 4168 TargetScsiSpiStatusIU_t, MPI_POINTER pTargetScsiSpiStatusIU_t; 4169 4170 /****************************************************************************/ 4171 /* Target Mode Abort Request */ 4172 /****************************************************************************/ 4173 4174 typedef struct _MSG_TARGET_MODE_ABORT_REQUEST 4175 { 4176 U8 AbortType; /* 00h */ 4177 U8 Reserved; /* 01h */ 4178 U8 ChainOffset; /* 02h */ 4179 U8 Function; /* 03h */ 4180 U16 Reserved1; /* 04h */ 4181 U8 Reserved2; /* 06h */ 4182 U8 MsgFlags; /* 07h */ 4183 U32 MsgContext; /* 08h */ 4184 U32 ReplyWord; /* 0Ch */ 4185 U32 MsgContextToAbort; /* 10h */ 4186 } MSG_TARGET_MODE_ABORT, MPI_POINTER PTR_MSG_TARGET_MODE_ABORT, 4187 TargetModeAbort_t, MPI_POINTER pTargetModeAbort_t; 4188 4189 #define TARGET_MODE_ABORT_TYPE_ALL_CMD_BUFFERS (0x00) 4190 #define TARGET_MODE_ABORT_TYPE_ALL_IO (0x01) 4191 #define TARGET_MODE_ABORT_TYPE_EXACT_IO (0x02) 4192 #define TARGET_MODE_ABORT_TYPE_EXACT_IO_REQUEST (0x03) 4193 4194 /* Target Mode Abort Reply */ 4195 4196 typedef struct _MSG_TARGET_MODE_ABORT_REPLY 4197 { 4198 U16 Reserved; /* 00h */ 4199 U8 MsgLength; /* 02h */ 4200 U8 Function; /* 03h */ 4201 U16 Reserved1; /* 04h */ 4202 U8 Reserved2; /* 06h */ 4203 U8 MsgFlags; /* 07h */ 4204 U32 MsgContext; /* 08h */ 4205 U16 Reserved3; /* 0Ch */ 4206 U16 IOCStatus; /* 0Eh */ 4207 U32 IOCLogInfo; /* 10h */ 4208 U32 AbortCount; /* 14h */ 4209 } MSG_TARGET_MODE_ABORT_REPLY, MPI_POINTER PTR_MSG_TARGET_MODE_ABORT_REPLY, 4210 TargetModeAbortReply_t, MPI_POINTER pTargetModeAbortReply_t; 4211 4212 4213 /****************************************************************************/ 4214 /* Target Mode Context Reply */ 4215 /****************************************************************************/ 4216 4217 #define TARGET_MODE_REPLY_IO_INDEX_MASK (0x00003FFF) 4218 #define TARGET_MODE_REPLY_IO_INDEX_SHIFT (0) 4219 #define TARGET_MODE_REPLY_INITIATOR_INDEX_MASK (0x03FFC000) 4220 #define TARGET_MODE_REPLY_INITIATOR_INDEX_SHIFT (14) 4221 #define TARGET_MODE_REPLY_ALIAS_MASK (0x0C000000) 4222 #define TARGET_MODE_REPLY_ALIAS_SHIFT (26) 4223 #define TARGET_MODE_REPLY_PORT_MASK (0x10000000) 4224 #define TARGET_MODE_REPLY_PORT_SHIFT (28) 4225 4226 4227 #define GET_IO_INDEX(x) (((x) & TARGET_MODE_REPLY_IO_INDEX_MASK) \ 4228 >> TARGET_MODE_REPLY_IO_INDEX_SHIFT) 4229 4230 #define SET_IO_INDEX(t, i) \ 4231 ((t) = ((t) & ~TARGET_MODE_REPLY_IO_INDEX_MASK) | \ 4232 (((i) << TARGET_MODE_REPLY_IO_INDEX_SHIFT) & \ 4233 TARGET_MODE_REPLY_IO_INDEX_MASK)) 4234 4235 #define GET_INITIATOR_INDEX(x) (((x) & TARGET_MODE_REPLY_INITIATOR_INDEX_MASK) \ 4236 >> TARGET_MODE_REPLY_INITIATOR_INDEX_SHIFT) 4237 4238 #define SET_INITIATOR_INDEX(t, ii) \ 4239 ((t) = ((t) & ~TARGET_MODE_REPLY_INITIATOR_INDEX_MASK) | \ 4240 (((ii) << TARGET_MODE_REPLY_INITIATOR_INDEX_SHIFT) & \ 4241 TARGET_MODE_REPLY_INITIATOR_INDEX_MASK)) 4242 4243 #define GET_ALIAS(x) (((x) & TARGET_MODE_REPLY_ALIAS_MASK) \ 4244 >> TARGET_MODE_REPLY_ALIAS_SHIFT) 4245 4246 #define SET_ALIAS(t, a) ((t) = ((t) & ~TARGET_MODE_REPLY_ALIAS_MASK) | \ 4247 (((a) << TARGET_MODE_REPLY_ALIAS_SHIFT) & \ 4248 TARGET_MODE_REPLY_ALIAS_MASK)) 4249 4250 #define GET_PORT(x) (((x) & TARGET_MODE_REPLY_PORT_MASK) \ 4251 >> TARGET_MODE_REPLY_PORT_SHIFT) 4252 4253 #define SET_PORT(t, p) ((t) = ((t) & ~TARGET_MODE_REPLY_PORT_MASK) | \ 4254 (((p) << TARGET_MODE_REPLY_PORT_SHIFT) & \ 4255 TARGET_MODE_REPLY_PORT_MASK)) 4256 4257 /* the following obsolete values are for MPI v1.0 support */ 4258 #define TARGET_MODE_REPLY_0100_MASK_HOST_INDEX (0x000003FF) 4259 #define TARGET_MODE_REPLY_0100_SHIFT_HOST_INDEX (0) 4260 #define TARGET_MODE_REPLY_0100_MASK_IOC_INDEX (0x001FF800) 4261 #define TARGET_MODE_REPLY_0100_SHIFT_IOC_INDEX (11) 4262 #define TARGET_MODE_REPLY_0100_PORT_MASK (0x00400000) 4263 #define TARGET_MODE_REPLY_0100_PORT_SHIFT (22) 4264 #define TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX (0x1F800000) 4265 #define TARGET_MODE_REPLY_0100_SHIFT_INITIATOR_INDEX (23) 4266 4267 #define GET_HOST_INDEX_0100(x) (((x) & TARGET_MODE_REPLY_0100_MASK_HOST_INDEX) \ 4268 >> TARGET_MODE_REPLY_0100_SHIFT_HOST_INDEX) 4269 4270 #define SET_HOST_INDEX_0100(t, hi) \ 4271 ((t) = ((t) & ~TARGET_MODE_REPLY_0100_MASK_HOST_INDEX) | \ 4272 (((hi) << TARGET_MODE_REPLY_0100_SHIFT_HOST_INDEX) & \ 4273 TARGET_MODE_REPLY_0100_MASK_HOST_INDEX)) 4274 4275 #define GET_IOC_INDEX_0100(x) (((x) & TARGET_MODE_REPLY_0100_MASK_IOC_INDEX) \ 4276 >> TARGET_MODE_REPLY_0100_SHIFT_IOC_INDEX) 4277 4278 #define SET_IOC_INDEX_0100(t, ii) \ 4279 ((t) = ((t) & ~TARGET_MODE_REPLY_0100_MASK_IOC_INDEX) | \ 4280 (((ii) << TARGET_MODE_REPLY_0100_SHIFT_IOC_INDEX) & \ 4281 TARGET_MODE_REPLY_0100_MASK_IOC_INDEX)) 4282 4283 #define GET_INITIATOR_INDEX_0100(x) \ 4284 (((x) & TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX) \ 4285 >> TARGET_MODE_REPLY_0100_SHIFT_INITIATOR_INDEX) 4286 4287 #define SET_INITIATOR_INDEX_0100(t, ii) \ 4288 ((t) = ((t) & ~TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX) | \ 4289 (((ii) << TARGET_MODE_REPLY_0100_SHIFT_INITIATOR_INDEX) & \ 4290 TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX)) 4291 4292 4293 #endif 4294 4295