19de3c85cSMatt Jacob /* $FreeBSD$ */ 29de3c85cSMatt Jacob /*- 39de3c85cSMatt Jacob * Copyright (c) 2000-2005, LSI Logic Corporation and its contributors. 49de3c85cSMatt Jacob * All rights reserved. 59de3c85cSMatt Jacob * 69de3c85cSMatt Jacob * Redistribution and use in source and binary forms, with or without 79de3c85cSMatt Jacob * modification, are permitted provided that the following conditions are 89de3c85cSMatt Jacob * met: 99de3c85cSMatt Jacob * 1. Redistributions of source code must retain the above copyright 109de3c85cSMatt Jacob * notice, this list of conditions and the following disclaimer. 119de3c85cSMatt Jacob * 2. Redistributions in binary form must reproduce at minimum a disclaimer 129de3c85cSMatt Jacob * substantially similar to the "NO WARRANTY" disclaimer below 139de3c85cSMatt Jacob * ("Disclaimer") and any redistribution must be conditioned upon including 149de3c85cSMatt Jacob * a substantially similar Disclaimer requirement for further binary 159de3c85cSMatt Jacob * redistribution. 169de3c85cSMatt Jacob * 3. Neither the name of the LSI Logic Corporation nor the names of its 179de3c85cSMatt Jacob * contributors may be used to endorse or promote products derived from 189de3c85cSMatt Jacob * this software without specific prior written permission. 199de3c85cSMatt Jacob * 209de3c85cSMatt Jacob * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 219de3c85cSMatt Jacob * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 229de3c85cSMatt Jacob * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 239de3c85cSMatt Jacob * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 249de3c85cSMatt Jacob * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 259de3c85cSMatt Jacob * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 269de3c85cSMatt Jacob * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 279de3c85cSMatt Jacob * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 289de3c85cSMatt Jacob * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 299de3c85cSMatt Jacob * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF THE COPYRIGHT 309de3c85cSMatt Jacob * OWNER OR CONTRIBUTOR IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 319de3c85cSMatt Jacob * 329de3c85cSMatt Jacob * 339de3c85cSMatt Jacob * Name: mpi_sas.h 349de3c85cSMatt Jacob * Title: MPI Serial Attached SCSI structures and definitions 359de3c85cSMatt Jacob * Creation Date: August 19, 2004 369de3c85cSMatt Jacob * 379de3c85cSMatt Jacob * mpi_sas.h Version: 01.05.01 389de3c85cSMatt Jacob * 399de3c85cSMatt Jacob * Version History 409de3c85cSMatt Jacob * --------------- 419de3c85cSMatt Jacob * 429de3c85cSMatt Jacob * Date Version Description 439de3c85cSMatt Jacob * -------- -------- ------------------------------------------------------ 449de3c85cSMatt Jacob * 08-19-04 01.05.01 Original release. 459de3c85cSMatt Jacob * -------------------------------------------------------------------------- 469de3c85cSMatt Jacob */ 479de3c85cSMatt Jacob 489de3c85cSMatt Jacob #ifndef MPI_SAS_H 499de3c85cSMatt Jacob #define MPI_SAS_H 509de3c85cSMatt Jacob 519de3c85cSMatt Jacob 529de3c85cSMatt Jacob /* 539de3c85cSMatt Jacob * Values for SASStatus. 549de3c85cSMatt Jacob */ 559de3c85cSMatt Jacob #define MPI_SASSTATUS_SUCCESS (0x00) 569de3c85cSMatt Jacob #define MPI_SASSTATUS_UNKNOWN_ERROR (0x01) 579de3c85cSMatt Jacob #define MPI_SASSTATUS_INVALID_FRAME (0x02) 589de3c85cSMatt Jacob #define MPI_SASSTATUS_UTC_BAD_DEST (0x03) 599de3c85cSMatt Jacob #define MPI_SASSTATUS_UTC_BREAK_RECEIVED (0x04) 609de3c85cSMatt Jacob #define MPI_SASSTATUS_UTC_CONNECT_RATE_NOT_SUPPORTED (0x05) 619de3c85cSMatt Jacob #define MPI_SASSTATUS_UTC_PORT_LAYER_REQUEST (0x06) 629de3c85cSMatt Jacob #define MPI_SASSTATUS_UTC_PROTOCOL_NOT_SUPPORTED (0x07) 639de3c85cSMatt Jacob #define MPI_SASSTATUS_UTC_STP_RESOURCES_BUSY (0x08) 649de3c85cSMatt Jacob #define MPI_SASSTATUS_UTC_WRONG_DESTINATION (0x09) 659de3c85cSMatt Jacob #define MPI_SASSTATUS_SHORT_INFORMATION_UNIT (0x0A) 669de3c85cSMatt Jacob #define MPI_SASSTATUS_LONG_INFORMATION_UNIT (0x0B) 679de3c85cSMatt Jacob #define MPI_SASSTATUS_XFER_RDY_INCORRECT_WRITE_DATA (0x0C) 689de3c85cSMatt Jacob #define MPI_SASSTATUS_XFER_RDY_REQUEST_OFFSET_ERROR (0x0D) 699de3c85cSMatt Jacob #define MPI_SASSTATUS_XFER_RDY_NOT_EXPECTED (0x0E) 709de3c85cSMatt Jacob #define MPI_SASSTATUS_DATA_INCORRECT_DATA_LENGTH (0x0F) 719de3c85cSMatt Jacob #define MPI_SASSTATUS_DATA_TOO_MUCH_READ_DATA (0x10) 729de3c85cSMatt Jacob #define MPI_SASSTATUS_DATA_OFFSET_ERROR (0x11) 739de3c85cSMatt Jacob #define MPI_SASSTATUS_SDSF_NAK_RECEIVED (0x12) 749de3c85cSMatt Jacob #define MPI_SASSTATUS_SDSF_CONNECTION_FAILED (0x13) 759de3c85cSMatt Jacob #define MPI_SASSTATUS_INITIATOR_RESPONSE_TIMEOUT (0x14) 769de3c85cSMatt Jacob 779de3c85cSMatt Jacob 789de3c85cSMatt Jacob /* 799de3c85cSMatt Jacob * Values for the SAS DeviceInfo field used in SAS Device Status Change Event 809de3c85cSMatt Jacob * data and SAS IO Unit Configuration pages. 819de3c85cSMatt Jacob */ 829de3c85cSMatt Jacob #define MPI_SAS_DEVICE_INFO_ATAPI_DEVICE (0x00002000) 839de3c85cSMatt Jacob #define MPI_SAS_DEVICE_INFO_LSI_DEVICE (0x00001000) 849de3c85cSMatt Jacob #define MPI_SAS_DEVICE_INFO_DIRECT_ATTACH (0x00000800) 859de3c85cSMatt Jacob #define MPI_SAS_DEVICE_INFO_SSP_TARGET (0x00000400) 869de3c85cSMatt Jacob #define MPI_SAS_DEVICE_INFO_STP_TARGET (0x00000200) 879de3c85cSMatt Jacob #define MPI_SAS_DEVICE_INFO_SMP_TARGET (0x00000100) 889de3c85cSMatt Jacob #define MPI_SAS_DEVICE_INFO_SATA_DEVICE (0x00000080) 899de3c85cSMatt Jacob #define MPI_SAS_DEVICE_INFO_SSP_INITIATOR (0x00000040) 909de3c85cSMatt Jacob #define MPI_SAS_DEVICE_INFO_STP_INITIATOR (0x00000020) 919de3c85cSMatt Jacob #define MPI_SAS_DEVICE_INFO_SMP_INITIATOR (0x00000010) 929de3c85cSMatt Jacob #define MPI_SAS_DEVICE_INFO_SATA_HOST (0x00000008) 939de3c85cSMatt Jacob 949de3c85cSMatt Jacob #define MPI_SAS_DEVICE_INFO_MASK_DEVICE_TYPE (0x00000007) 959de3c85cSMatt Jacob #define MPI_SAS_DEVICE_INFO_NO_DEVICE (0x00000000) 969de3c85cSMatt Jacob #define MPI_SAS_DEVICE_INFO_END_DEVICE (0x00000001) 979de3c85cSMatt Jacob #define MPI_SAS_DEVICE_INFO_EDGE_EXPANDER (0x00000002) 989de3c85cSMatt Jacob #define MPI_SAS_DEVICE_INFO_FANOUT_EXPANDER (0x00000003) 999de3c85cSMatt Jacob 1009de3c85cSMatt Jacob 1019de3c85cSMatt Jacob 1029de3c85cSMatt Jacob /***************************************************************************** 1039de3c85cSMatt Jacob * 1049de3c85cSMatt Jacob * S e r i a l A t t a c h e d S C S I M e s s a g e s 1059de3c85cSMatt Jacob * 1069de3c85cSMatt Jacob *****************************************************************************/ 1079de3c85cSMatt Jacob 1089de3c85cSMatt Jacob /****************************************************************************/ 1099de3c85cSMatt Jacob /* Serial Management Protocol Passthrough Request */ 1109de3c85cSMatt Jacob /****************************************************************************/ 1119de3c85cSMatt Jacob 1129de3c85cSMatt Jacob typedef struct _MSG_SMP_PASSTHROUGH_REQUEST 1139de3c85cSMatt Jacob { 1149de3c85cSMatt Jacob U8 PassthroughFlags; /* 00h */ 1159de3c85cSMatt Jacob U8 PhysicalPort; /* 01h */ 1169de3c85cSMatt Jacob U8 ChainOffset; /* 02h */ 1179de3c85cSMatt Jacob U8 Function; /* 03h */ 1189de3c85cSMatt Jacob U16 RequestDataLength; /* 04h */ 1199de3c85cSMatt Jacob U8 ConnectionRate; /* 06h */ 1209de3c85cSMatt Jacob U8 MsgFlags; /* 07h */ 1219de3c85cSMatt Jacob U32 MsgContext; /* 08h */ 1229de3c85cSMatt Jacob U32 Reserved1; /* 0Ch */ 1239de3c85cSMatt Jacob U64 SASAddress; /* 10h */ 1249de3c85cSMatt Jacob U32 Reserved2; /* 18h */ 1259de3c85cSMatt Jacob U32 Reserved3; /* 1Ch */ 1269de3c85cSMatt Jacob SGE_SIMPLE_UNION SGL; /* 20h */ 1279de3c85cSMatt Jacob } MSG_SMP_PASSTHROUGH_REQUEST, MPI_POINTER PTR_MSG_SMP_PASSTHROUGH_REQUEST, 1289de3c85cSMatt Jacob SmpPassthroughRequest_t, MPI_POINTER pSmpPassthroughRequest_t; 1299de3c85cSMatt Jacob 1309de3c85cSMatt Jacob /* values for PassthroughFlags field */ 1319de3c85cSMatt Jacob #define MPI_SMP_PT_REQ_PT_FLAGS_IMMEDIATE (0x80) 1329de3c85cSMatt Jacob 1339de3c85cSMatt Jacob /* values for ConnectionRate field */ 1349de3c85cSMatt Jacob #define MPI_SMP_PT_REQ_CONNECT_RATE_NEGOTIATED (0x00) 1359de3c85cSMatt Jacob #define MPI_SMP_PT_REQ_CONNECT_RATE_1_5 (0x08) 1369de3c85cSMatt Jacob #define MPI_SMP_PT_REQ_CONNECT_RATE_3_0 (0x09) 1379de3c85cSMatt Jacob 1389de3c85cSMatt Jacob 1399de3c85cSMatt Jacob /* Serial Management Protocol Passthrough Reply */ 1409de3c85cSMatt Jacob typedef struct _MSG_SMP_PASSTHROUGH_REPLY 1419de3c85cSMatt Jacob { 1429de3c85cSMatt Jacob U8 PassthroughFlags; /* 00h */ 1439de3c85cSMatt Jacob U8 PhysicalPort; /* 01h */ 1449de3c85cSMatt Jacob U8 MsgLength; /* 02h */ 1459de3c85cSMatt Jacob U8 Function; /* 03h */ 1469de3c85cSMatt Jacob U16 ResponseDataLength; /* 04h */ 1479de3c85cSMatt Jacob U8 Reserved1; /* 06h */ 1489de3c85cSMatt Jacob U8 MsgFlags; /* 07h */ 1499de3c85cSMatt Jacob U32 MsgContext; /* 08h */ 1509de3c85cSMatt Jacob U8 Reserved2; /* 0Ch */ 1519de3c85cSMatt Jacob U8 SASStatus; /* 0Dh */ 1529de3c85cSMatt Jacob U16 IOCStatus; /* 0Eh */ 1539de3c85cSMatt Jacob U32 IOCLogInfo; /* 10h */ 1549de3c85cSMatt Jacob U32 Reserved3; /* 14h */ 1559de3c85cSMatt Jacob U8 ResponseData[4]; /* 18h */ 1569de3c85cSMatt Jacob } MSG_SMP_PASSTHROUGH_REPLY, MPI_POINTER PTR_MSG_SMP_PASSTHROUGH_REPLY, 1579de3c85cSMatt Jacob SmpPassthroughReply_t, MPI_POINTER pSmpPassthroughReply_t; 1589de3c85cSMatt Jacob 1599de3c85cSMatt Jacob #define MPI_SMP_PT_REPLY_PT_FLAGS_IMMEDIATE (0x80) 1609de3c85cSMatt Jacob 1619de3c85cSMatt Jacob 1629de3c85cSMatt Jacob /****************************************************************************/ 1639de3c85cSMatt Jacob /* SATA Passthrough Request */ 1649de3c85cSMatt Jacob /****************************************************************************/ 1659de3c85cSMatt Jacob 1669de3c85cSMatt Jacob typedef struct _MSG_SATA_PASSTHROUGH_REQUEST 1679de3c85cSMatt Jacob { 1689de3c85cSMatt Jacob U8 TargetID; /* 00h */ 1699de3c85cSMatt Jacob U8 Bus; /* 01h */ 1709de3c85cSMatt Jacob U8 ChainOffset; /* 02h */ 1719de3c85cSMatt Jacob U8 Function; /* 03h */ 1729de3c85cSMatt Jacob U16 PassthroughFlags; /* 04h */ 1739de3c85cSMatt Jacob U8 ConnectionRate; /* 06h */ 1749de3c85cSMatt Jacob U8 MsgFlags; /* 07h */ 1759de3c85cSMatt Jacob U32 MsgContext; /* 08h */ 1769de3c85cSMatt Jacob U32 Reserved1; /* 0Ch */ 1779de3c85cSMatt Jacob U32 Reserved2; /* 10h */ 1789de3c85cSMatt Jacob U32 Reserved3; /* 14h */ 1799de3c85cSMatt Jacob U32 DataLength; /* 18h */ 1809de3c85cSMatt Jacob U8 CommandFIS[20]; /* 1Ch */ 1819de3c85cSMatt Jacob SGE_SIMPLE_UNION SGL; /* 30h */ 1829de3c85cSMatt Jacob } MSG_SATA_PASSTHROUGH_REQUEST, MPI_POINTER PTR_MSG_SATA_PASSTHROUGH_REQUEST, 1839de3c85cSMatt Jacob SataPassthroughRequest_t, MPI_POINTER pSataPassthroughRequest_t; 1849de3c85cSMatt Jacob 1859de3c85cSMatt Jacob /* values for PassthroughFlags field */ 1869de3c85cSMatt Jacob #define MPI_SATA_PT_REQ_PT_FLAGS_RESET_DEVICE (0x0200) 1879de3c85cSMatt Jacob #define MPI_SATA_PT_REQ_PT_FLAGS_EXECUTE_DIAG (0x0100) 1889de3c85cSMatt Jacob #define MPI_SATA_PT_REQ_PT_FLAGS_DMA_QUEUED (0x0080) 1899de3c85cSMatt Jacob #define MPI_SATA_PT_REQ_PT_FLAGS_PACKET_COMMAND (0x0040) 1909de3c85cSMatt Jacob #define MPI_SATA_PT_REQ_PT_FLAGS_DMA (0x0020) 1919de3c85cSMatt Jacob #define MPI_SATA_PT_REQ_PT_FLAGS_PIO (0x0010) 1929de3c85cSMatt Jacob #define MPI_SATA_PT_REQ_PT_FLAGS_UNSPECIFIED_VU (0x0004) 1939de3c85cSMatt Jacob #define MPI_SATA_PT_REQ_PT_FLAGS_WRITE (0x0002) 1949de3c85cSMatt Jacob #define MPI_SATA_PT_REQ_PT_FLAGS_READ (0x0001) 1959de3c85cSMatt Jacob 1969de3c85cSMatt Jacob /* values for ConnectionRate field */ 1979de3c85cSMatt Jacob #define MPI_SATA_PT_REQ_CONNECT_RATE_NEGOTIATED (0x00) 1989de3c85cSMatt Jacob #define MPI_SATA_PT_REQ_CONNECT_RATE_1_5 (0x08) 1999de3c85cSMatt Jacob #define MPI_SATA_PT_REQ_CONNECT_RATE_3_0 (0x09) 2009de3c85cSMatt Jacob 2019de3c85cSMatt Jacob 2029de3c85cSMatt Jacob /* SATA Passthrough Reply */ 2039de3c85cSMatt Jacob typedef struct _MSG_SATA_PASSTHROUGH_REPLY 2049de3c85cSMatt Jacob { 2059de3c85cSMatt Jacob U8 TargetID; /* 00h */ 2069de3c85cSMatt Jacob U8 Bus; /* 01h */ 2079de3c85cSMatt Jacob U8 MsgLength; /* 02h */ 2089de3c85cSMatt Jacob U8 Function; /* 03h */ 2099de3c85cSMatt Jacob U16 PassthroughFlags; /* 04h */ 2109de3c85cSMatt Jacob U8 Reserved1; /* 06h */ 2119de3c85cSMatt Jacob U8 MsgFlags; /* 07h */ 2129de3c85cSMatt Jacob U32 MsgContext; /* 08h */ 2139de3c85cSMatt Jacob U8 Reserved2; /* 0Ch */ 2149de3c85cSMatt Jacob U8 SASStatus; /* 0Dh */ 2159de3c85cSMatt Jacob U16 IOCStatus; /* 0Eh */ 2169de3c85cSMatt Jacob U32 IOCLogInfo; /* 10h */ 2179de3c85cSMatt Jacob U8 StatusFIS[20]; /* 14h */ 2189de3c85cSMatt Jacob U32 StatusControlRegisters; /* 28h */ 2199de3c85cSMatt Jacob U32 TransferCount; /* 2Ch */ 2209de3c85cSMatt Jacob } MSG_SATA_PASSTHROUGH_REPLY, MPI_POINTER PTR_MSG_SATA_PASSTHROUGH_REPLY, 2219de3c85cSMatt Jacob SataPassthroughReply_t, MPI_POINTER pSataPassthroughReply_t; 2229de3c85cSMatt Jacob 2239de3c85cSMatt Jacob 2249de3c85cSMatt Jacob 2259de3c85cSMatt Jacob 2269de3c85cSMatt Jacob /****************************************************************************/ 2279de3c85cSMatt Jacob /* SAS IO Unit Control Request */ 2289de3c85cSMatt Jacob /****************************************************************************/ 2299de3c85cSMatt Jacob 2309de3c85cSMatt Jacob typedef struct _MSG_SAS_IOUNIT_CONTROL_REQUEST 2319de3c85cSMatt Jacob { 2329de3c85cSMatt Jacob U8 Operation; /* 00h */ 2339de3c85cSMatt Jacob U8 Reserved1; /* 01h */ 2349de3c85cSMatt Jacob U8 ChainOffset; /* 02h */ 2359de3c85cSMatt Jacob U8 Function; /* 03h */ 2369de3c85cSMatt Jacob U16 Reserved2; /* 04h */ 2379de3c85cSMatt Jacob U8 Reserved3; /* 06h */ 2389de3c85cSMatt Jacob U8 MsgFlags; /* 07h */ 2399de3c85cSMatt Jacob U32 MsgContext; /* 08h */ 2409de3c85cSMatt Jacob U8 TargetID; /* 0Ch */ 2419de3c85cSMatt Jacob U8 Bus; /* 0Dh */ 2429de3c85cSMatt Jacob U8 PhyNum; /* 0Eh */ 2439de3c85cSMatt Jacob U8 Reserved4; /* 0Fh */ 2449de3c85cSMatt Jacob U32 Reserved5; /* 10h */ 2459de3c85cSMatt Jacob U64 SASAddress; /* 14h */ 2469de3c85cSMatt Jacob U32 Reserved6; /* 1Ch */ 2479de3c85cSMatt Jacob } MSG_SAS_IOUNIT_CONTROL_REQUEST, MPI_POINTER PTR_MSG_SAS_IOUNIT_CONTROL_REQUEST, 2489de3c85cSMatt Jacob SasIoUnitControlRequest_t, MPI_POINTER pSasIoUnitControlRequest_t; 2499de3c85cSMatt Jacob 2509de3c85cSMatt Jacob /* values for the Operation field */ 2519de3c85cSMatt Jacob #define MPI_SAS_OP_CLEAR_NOT_PRESENT (0x01) 2529de3c85cSMatt Jacob #define MPI_SAS_OP_CLEAR_ALL_PERSISTENT (0x02) 2539de3c85cSMatt Jacob #define MPI_SAS_OP_PHY_LINK_RESET (0x06) 2549de3c85cSMatt Jacob #define MPI_SAS_OP_PHY_HARD_RESET (0x07) 2559de3c85cSMatt Jacob #define MPI_SAS_OP_PHY_CLEAR_ERROR_LOG (0x08) 2569de3c85cSMatt Jacob #define MPI_SAS_OP_MAP_CURRENT (0x09) 2579de3c85cSMatt Jacob 2589de3c85cSMatt Jacob 2599de3c85cSMatt Jacob /* SAS IO Unit Control Reply */ 2609de3c85cSMatt Jacob typedef struct _MSG_SAS_IOUNIT_CONTROL_REPLY 2619de3c85cSMatt Jacob { 2629de3c85cSMatt Jacob U8 Operation; /* 00h */ 2639de3c85cSMatt Jacob U8 Reserved1; /* 01h */ 2649de3c85cSMatt Jacob U8 MsgLength; /* 02h */ 2659de3c85cSMatt Jacob U8 Function; /* 03h */ 2669de3c85cSMatt Jacob U16 Reserved2; /* 04h */ 2679de3c85cSMatt Jacob U8 Reserved3; /* 06h */ 2689de3c85cSMatt Jacob U8 MsgFlags; /* 07h */ 2699de3c85cSMatt Jacob U32 MsgContext; /* 08h */ 2709de3c85cSMatt Jacob U16 Reserved4; /* 0Ch */ 2719de3c85cSMatt Jacob U16 IOCStatus; /* 0Eh */ 2729de3c85cSMatt Jacob U32 IOCLogInfo; /* 10h */ 2739de3c85cSMatt Jacob } MSG_SAS_IOUNIT_CONTROL_REPLY, MPI_POINTER PTR_MSG_SAS_IOUNIT_CONTROL_REPLY, 2749de3c85cSMatt Jacob SasIoUnitControlReply_t, MPI_POINTER pSasIoUnitControlReply_t; 2759de3c85cSMatt Jacob 2769de3c85cSMatt Jacob #endif 277