162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * Copyright (c) 2004-2008 LSI Corporation. 462306a36Sopenharmony_ci * 562306a36Sopenharmony_ci * 662306a36Sopenharmony_ci * Name: mpi_sas.h 762306a36Sopenharmony_ci * Title: MPI Serial Attached SCSI structures and definitions 862306a36Sopenharmony_ci * Creation Date: August 19, 2004 962306a36Sopenharmony_ci * 1062306a36Sopenharmony_ci * mpi_sas.h Version: 01.05.05 1162306a36Sopenharmony_ci * 1262306a36Sopenharmony_ci * Version History 1362306a36Sopenharmony_ci * --------------- 1462306a36Sopenharmony_ci * 1562306a36Sopenharmony_ci * Date Version Description 1662306a36Sopenharmony_ci * -------- -------- ------------------------------------------------------ 1762306a36Sopenharmony_ci * 08-19-04 01.05.01 Original release. 1862306a36Sopenharmony_ci * 08-30-05 01.05.02 Added DeviceInfo bit for SEP. 1962306a36Sopenharmony_ci * Added PrimFlags and Primitive field to SAS IO Unit 2062306a36Sopenharmony_ci * Control request, and added a new operation code. 2162306a36Sopenharmony_ci * 03-27-06 01.05.03 Added Force Full Discovery, Transmit Port Select Signal, 2262306a36Sopenharmony_ci * and Remove Device operations to SAS IO Unit Control. 2362306a36Sopenharmony_ci * Added DevHandle field to SAS IO Unit Control request and 2462306a36Sopenharmony_ci * reply. 2562306a36Sopenharmony_ci * 10-11-06 01.05.04 Fixed the name of a define for Operation field of SAS IO 2662306a36Sopenharmony_ci * Unit Control request. 2762306a36Sopenharmony_ci * 01-15-08 01.05.05 Added support for MPI_SAS_OP_SET_IOC_PARAMETER, 2862306a36Sopenharmony_ci * including adding IOCParameter and IOCParameter value 2962306a36Sopenharmony_ci * fields to SAS IO Unit Control Request. 3062306a36Sopenharmony_ci * Added MPI_SAS_DEVICE_INFO_PRODUCT_SPECIFIC define. 3162306a36Sopenharmony_ci * -------------------------------------------------------------------------- 3262306a36Sopenharmony_ci */ 3362306a36Sopenharmony_ci 3462306a36Sopenharmony_ci#ifndef MPI_SAS_H 3562306a36Sopenharmony_ci#define MPI_SAS_H 3662306a36Sopenharmony_ci 3762306a36Sopenharmony_ci 3862306a36Sopenharmony_ci/* 3962306a36Sopenharmony_ci * Values for SASStatus. 4062306a36Sopenharmony_ci */ 4162306a36Sopenharmony_ci#define MPI_SASSTATUS_SUCCESS (0x00) 4262306a36Sopenharmony_ci#define MPI_SASSTATUS_UNKNOWN_ERROR (0x01) 4362306a36Sopenharmony_ci#define MPI_SASSTATUS_INVALID_FRAME (0x02) 4462306a36Sopenharmony_ci#define MPI_SASSTATUS_UTC_BAD_DEST (0x03) 4562306a36Sopenharmony_ci#define MPI_SASSTATUS_UTC_BREAK_RECEIVED (0x04) 4662306a36Sopenharmony_ci#define MPI_SASSTATUS_UTC_CONNECT_RATE_NOT_SUPPORTED (0x05) 4762306a36Sopenharmony_ci#define MPI_SASSTATUS_UTC_PORT_LAYER_REQUEST (0x06) 4862306a36Sopenharmony_ci#define MPI_SASSTATUS_UTC_PROTOCOL_NOT_SUPPORTED (0x07) 4962306a36Sopenharmony_ci#define MPI_SASSTATUS_UTC_STP_RESOURCES_BUSY (0x08) 5062306a36Sopenharmony_ci#define MPI_SASSTATUS_UTC_WRONG_DESTINATION (0x09) 5162306a36Sopenharmony_ci#define MPI_SASSTATUS_SHORT_INFORMATION_UNIT (0x0A) 5262306a36Sopenharmony_ci#define MPI_SASSTATUS_LONG_INFORMATION_UNIT (0x0B) 5362306a36Sopenharmony_ci#define MPI_SASSTATUS_XFER_RDY_INCORRECT_WRITE_DATA (0x0C) 5462306a36Sopenharmony_ci#define MPI_SASSTATUS_XFER_RDY_REQUEST_OFFSET_ERROR (0x0D) 5562306a36Sopenharmony_ci#define MPI_SASSTATUS_XFER_RDY_NOT_EXPECTED (0x0E) 5662306a36Sopenharmony_ci#define MPI_SASSTATUS_DATA_INCORRECT_DATA_LENGTH (0x0F) 5762306a36Sopenharmony_ci#define MPI_SASSTATUS_DATA_TOO_MUCH_READ_DATA (0x10) 5862306a36Sopenharmony_ci#define MPI_SASSTATUS_DATA_OFFSET_ERROR (0x11) 5962306a36Sopenharmony_ci#define MPI_SASSTATUS_SDSF_NAK_RECEIVED (0x12) 6062306a36Sopenharmony_ci#define MPI_SASSTATUS_SDSF_CONNECTION_FAILED (0x13) 6162306a36Sopenharmony_ci#define MPI_SASSTATUS_INITIATOR_RESPONSE_TIMEOUT (0x14) 6262306a36Sopenharmony_ci 6362306a36Sopenharmony_ci 6462306a36Sopenharmony_ci/* 6562306a36Sopenharmony_ci * Values for the SAS DeviceInfo field used in SAS Device Status Change Event 6662306a36Sopenharmony_ci * data and SAS IO Unit Configuration pages. 6762306a36Sopenharmony_ci */ 6862306a36Sopenharmony_ci#define MPI_SAS_DEVICE_INFO_PRODUCT_SPECIFIC (0xF0000000) 6962306a36Sopenharmony_ci 7062306a36Sopenharmony_ci#define MPI_SAS_DEVICE_INFO_SEP (0x00004000) 7162306a36Sopenharmony_ci#define MPI_SAS_DEVICE_INFO_ATAPI_DEVICE (0x00002000) 7262306a36Sopenharmony_ci#define MPI_SAS_DEVICE_INFO_LSI_DEVICE (0x00001000) 7362306a36Sopenharmony_ci#define MPI_SAS_DEVICE_INFO_DIRECT_ATTACH (0x00000800) 7462306a36Sopenharmony_ci#define MPI_SAS_DEVICE_INFO_SSP_TARGET (0x00000400) 7562306a36Sopenharmony_ci#define MPI_SAS_DEVICE_INFO_STP_TARGET (0x00000200) 7662306a36Sopenharmony_ci#define MPI_SAS_DEVICE_INFO_SMP_TARGET (0x00000100) 7762306a36Sopenharmony_ci#define MPI_SAS_DEVICE_INFO_SATA_DEVICE (0x00000080) 7862306a36Sopenharmony_ci#define MPI_SAS_DEVICE_INFO_SSP_INITIATOR (0x00000040) 7962306a36Sopenharmony_ci#define MPI_SAS_DEVICE_INFO_STP_INITIATOR (0x00000020) 8062306a36Sopenharmony_ci#define MPI_SAS_DEVICE_INFO_SMP_INITIATOR (0x00000010) 8162306a36Sopenharmony_ci#define MPI_SAS_DEVICE_INFO_SATA_HOST (0x00000008) 8262306a36Sopenharmony_ci 8362306a36Sopenharmony_ci#define MPI_SAS_DEVICE_INFO_MASK_DEVICE_TYPE (0x00000007) 8462306a36Sopenharmony_ci#define MPI_SAS_DEVICE_INFO_NO_DEVICE (0x00000000) 8562306a36Sopenharmony_ci#define MPI_SAS_DEVICE_INFO_END_DEVICE (0x00000001) 8662306a36Sopenharmony_ci#define MPI_SAS_DEVICE_INFO_EDGE_EXPANDER (0x00000002) 8762306a36Sopenharmony_ci#define MPI_SAS_DEVICE_INFO_FANOUT_EXPANDER (0x00000003) 8862306a36Sopenharmony_ci 8962306a36Sopenharmony_ci 9062306a36Sopenharmony_ci 9162306a36Sopenharmony_ci/***************************************************************************** 9262306a36Sopenharmony_ci* 9362306a36Sopenharmony_ci* 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 9462306a36Sopenharmony_ci* 9562306a36Sopenharmony_ci*****************************************************************************/ 9662306a36Sopenharmony_ci 9762306a36Sopenharmony_ci/****************************************************************************/ 9862306a36Sopenharmony_ci/* Serial Management Protocol Passthrough Request */ 9962306a36Sopenharmony_ci/****************************************************************************/ 10062306a36Sopenharmony_ci 10162306a36Sopenharmony_citypedef struct _MSG_SMP_PASSTHROUGH_REQUEST 10262306a36Sopenharmony_ci{ 10362306a36Sopenharmony_ci U8 PassthroughFlags; /* 00h */ 10462306a36Sopenharmony_ci U8 PhysicalPort; /* 01h */ 10562306a36Sopenharmony_ci U8 ChainOffset; /* 02h */ 10662306a36Sopenharmony_ci U8 Function; /* 03h */ 10762306a36Sopenharmony_ci U16 RequestDataLength; /* 04h */ 10862306a36Sopenharmony_ci U8 ConnectionRate; /* 06h */ 10962306a36Sopenharmony_ci U8 MsgFlags; /* 07h */ 11062306a36Sopenharmony_ci U32 MsgContext; /* 08h */ 11162306a36Sopenharmony_ci U32 Reserved1; /* 0Ch */ 11262306a36Sopenharmony_ci U64 SASAddress; /* 10h */ 11362306a36Sopenharmony_ci U32 Reserved2; /* 18h */ 11462306a36Sopenharmony_ci U32 Reserved3; /* 1Ch */ 11562306a36Sopenharmony_ci SGE_SIMPLE_UNION SGL; /* 20h */ 11662306a36Sopenharmony_ci} MSG_SMP_PASSTHROUGH_REQUEST, MPI_POINTER PTR_MSG_SMP_PASSTHROUGH_REQUEST, 11762306a36Sopenharmony_ci SmpPassthroughRequest_t, MPI_POINTER pSmpPassthroughRequest_t; 11862306a36Sopenharmony_ci 11962306a36Sopenharmony_ci/* values for PassthroughFlags field */ 12062306a36Sopenharmony_ci#define MPI_SMP_PT_REQ_PT_FLAGS_IMMEDIATE (0x80) 12162306a36Sopenharmony_ci 12262306a36Sopenharmony_ci/* values for ConnectionRate field */ 12362306a36Sopenharmony_ci#define MPI_SMP_PT_REQ_CONNECT_RATE_NEGOTIATED (0x00) 12462306a36Sopenharmony_ci#define MPI_SMP_PT_REQ_CONNECT_RATE_1_5 (0x08) 12562306a36Sopenharmony_ci#define MPI_SMP_PT_REQ_CONNECT_RATE_3_0 (0x09) 12662306a36Sopenharmony_ci 12762306a36Sopenharmony_ci 12862306a36Sopenharmony_ci/* Serial Management Protocol Passthrough Reply */ 12962306a36Sopenharmony_citypedef struct _MSG_SMP_PASSTHROUGH_REPLY 13062306a36Sopenharmony_ci{ 13162306a36Sopenharmony_ci U8 PassthroughFlags; /* 00h */ 13262306a36Sopenharmony_ci U8 PhysicalPort; /* 01h */ 13362306a36Sopenharmony_ci U8 MsgLength; /* 02h */ 13462306a36Sopenharmony_ci U8 Function; /* 03h */ 13562306a36Sopenharmony_ci U16 ResponseDataLength; /* 04h */ 13662306a36Sopenharmony_ci U8 Reserved1; /* 06h */ 13762306a36Sopenharmony_ci U8 MsgFlags; /* 07h */ 13862306a36Sopenharmony_ci U32 MsgContext; /* 08h */ 13962306a36Sopenharmony_ci U8 Reserved2; /* 0Ch */ 14062306a36Sopenharmony_ci U8 SASStatus; /* 0Dh */ 14162306a36Sopenharmony_ci U16 IOCStatus; /* 0Eh */ 14262306a36Sopenharmony_ci U32 IOCLogInfo; /* 10h */ 14362306a36Sopenharmony_ci U32 Reserved3; /* 14h */ 14462306a36Sopenharmony_ci U8 ResponseData[4]; /* 18h */ 14562306a36Sopenharmony_ci} MSG_SMP_PASSTHROUGH_REPLY, MPI_POINTER PTR_MSG_SMP_PASSTHROUGH_REPLY, 14662306a36Sopenharmony_ci SmpPassthroughReply_t, MPI_POINTER pSmpPassthroughReply_t; 14762306a36Sopenharmony_ci 14862306a36Sopenharmony_ci#define MPI_SMP_PT_REPLY_PT_FLAGS_IMMEDIATE (0x80) 14962306a36Sopenharmony_ci 15062306a36Sopenharmony_ci 15162306a36Sopenharmony_ci/****************************************************************************/ 15262306a36Sopenharmony_ci/* SATA Passthrough Request */ 15362306a36Sopenharmony_ci/****************************************************************************/ 15462306a36Sopenharmony_ci 15562306a36Sopenharmony_citypedef struct _MSG_SATA_PASSTHROUGH_REQUEST 15662306a36Sopenharmony_ci{ 15762306a36Sopenharmony_ci U8 TargetID; /* 00h */ 15862306a36Sopenharmony_ci U8 Bus; /* 01h */ 15962306a36Sopenharmony_ci U8 ChainOffset; /* 02h */ 16062306a36Sopenharmony_ci U8 Function; /* 03h */ 16162306a36Sopenharmony_ci U16 PassthroughFlags; /* 04h */ 16262306a36Sopenharmony_ci U8 ConnectionRate; /* 06h */ 16362306a36Sopenharmony_ci U8 MsgFlags; /* 07h */ 16462306a36Sopenharmony_ci U32 MsgContext; /* 08h */ 16562306a36Sopenharmony_ci U32 Reserved1; /* 0Ch */ 16662306a36Sopenharmony_ci U32 Reserved2; /* 10h */ 16762306a36Sopenharmony_ci U32 Reserved3; /* 14h */ 16862306a36Sopenharmony_ci U32 DataLength; /* 18h */ 16962306a36Sopenharmony_ci U8 CommandFIS[20]; /* 1Ch */ 17062306a36Sopenharmony_ci SGE_SIMPLE_UNION SGL; /* 30h */ 17162306a36Sopenharmony_ci} MSG_SATA_PASSTHROUGH_REQUEST, MPI_POINTER PTR_MSG_SATA_PASSTHROUGH_REQUEST, 17262306a36Sopenharmony_ci SataPassthroughRequest_t, MPI_POINTER pSataPassthroughRequest_t; 17362306a36Sopenharmony_ci 17462306a36Sopenharmony_ci/* values for PassthroughFlags field */ 17562306a36Sopenharmony_ci#define MPI_SATA_PT_REQ_PT_FLAGS_RESET_DEVICE (0x0200) 17662306a36Sopenharmony_ci#define MPI_SATA_PT_REQ_PT_FLAGS_EXECUTE_DIAG (0x0100) 17762306a36Sopenharmony_ci#define MPI_SATA_PT_REQ_PT_FLAGS_DMA_QUEUED (0x0080) 17862306a36Sopenharmony_ci#define MPI_SATA_PT_REQ_PT_FLAGS_PACKET_COMMAND (0x0040) 17962306a36Sopenharmony_ci#define MPI_SATA_PT_REQ_PT_FLAGS_DMA (0x0020) 18062306a36Sopenharmony_ci#define MPI_SATA_PT_REQ_PT_FLAGS_PIO (0x0010) 18162306a36Sopenharmony_ci#define MPI_SATA_PT_REQ_PT_FLAGS_UNSPECIFIED_VU (0x0004) 18262306a36Sopenharmony_ci#define MPI_SATA_PT_REQ_PT_FLAGS_WRITE (0x0002) 18362306a36Sopenharmony_ci#define MPI_SATA_PT_REQ_PT_FLAGS_READ (0x0001) 18462306a36Sopenharmony_ci 18562306a36Sopenharmony_ci/* values for ConnectionRate field */ 18662306a36Sopenharmony_ci#define MPI_SATA_PT_REQ_CONNECT_RATE_NEGOTIATED (0x00) 18762306a36Sopenharmony_ci#define MPI_SATA_PT_REQ_CONNECT_RATE_1_5 (0x08) 18862306a36Sopenharmony_ci#define MPI_SATA_PT_REQ_CONNECT_RATE_3_0 (0x09) 18962306a36Sopenharmony_ci 19062306a36Sopenharmony_ci 19162306a36Sopenharmony_ci/* SATA Passthrough Reply */ 19262306a36Sopenharmony_citypedef struct _MSG_SATA_PASSTHROUGH_REPLY 19362306a36Sopenharmony_ci{ 19462306a36Sopenharmony_ci U8 TargetID; /* 00h */ 19562306a36Sopenharmony_ci U8 Bus; /* 01h */ 19662306a36Sopenharmony_ci U8 MsgLength; /* 02h */ 19762306a36Sopenharmony_ci U8 Function; /* 03h */ 19862306a36Sopenharmony_ci U16 PassthroughFlags; /* 04h */ 19962306a36Sopenharmony_ci U8 Reserved1; /* 06h */ 20062306a36Sopenharmony_ci U8 MsgFlags; /* 07h */ 20162306a36Sopenharmony_ci U32 MsgContext; /* 08h */ 20262306a36Sopenharmony_ci U8 Reserved2; /* 0Ch */ 20362306a36Sopenharmony_ci U8 SASStatus; /* 0Dh */ 20462306a36Sopenharmony_ci U16 IOCStatus; /* 0Eh */ 20562306a36Sopenharmony_ci U32 IOCLogInfo; /* 10h */ 20662306a36Sopenharmony_ci U8 StatusFIS[20]; /* 14h */ 20762306a36Sopenharmony_ci U32 StatusControlRegisters; /* 28h */ 20862306a36Sopenharmony_ci U32 TransferCount; /* 2Ch */ 20962306a36Sopenharmony_ci} MSG_SATA_PASSTHROUGH_REPLY, MPI_POINTER PTR_MSG_SATA_PASSTHROUGH_REPLY, 21062306a36Sopenharmony_ci SataPassthroughReply_t, MPI_POINTER pSataPassthroughReply_t; 21162306a36Sopenharmony_ci 21262306a36Sopenharmony_ci 21362306a36Sopenharmony_ci 21462306a36Sopenharmony_ci 21562306a36Sopenharmony_ci/****************************************************************************/ 21662306a36Sopenharmony_ci/* SAS IO Unit Control Request */ 21762306a36Sopenharmony_ci/****************************************************************************/ 21862306a36Sopenharmony_ci 21962306a36Sopenharmony_citypedef struct _MSG_SAS_IOUNIT_CONTROL_REQUEST 22062306a36Sopenharmony_ci{ 22162306a36Sopenharmony_ci U8 Operation; /* 00h */ 22262306a36Sopenharmony_ci U8 Reserved1; /* 01h */ 22362306a36Sopenharmony_ci U8 ChainOffset; /* 02h */ 22462306a36Sopenharmony_ci U8 Function; /* 03h */ 22562306a36Sopenharmony_ci U16 DevHandle; /* 04h */ 22662306a36Sopenharmony_ci U8 IOCParameter; /* 06h */ 22762306a36Sopenharmony_ci U8 MsgFlags; /* 07h */ 22862306a36Sopenharmony_ci U32 MsgContext; /* 08h */ 22962306a36Sopenharmony_ci U8 TargetID; /* 0Ch */ 23062306a36Sopenharmony_ci U8 Bus; /* 0Dh */ 23162306a36Sopenharmony_ci U8 PhyNum; /* 0Eh */ 23262306a36Sopenharmony_ci U8 PrimFlags; /* 0Fh */ 23362306a36Sopenharmony_ci U32 Primitive; /* 10h */ 23462306a36Sopenharmony_ci U64 SASAddress; /* 14h */ 23562306a36Sopenharmony_ci U32 IOCParameterValue; /* 1Ch */ 23662306a36Sopenharmony_ci} MSG_SAS_IOUNIT_CONTROL_REQUEST, MPI_POINTER PTR_MSG_SAS_IOUNIT_CONTROL_REQUEST, 23762306a36Sopenharmony_ci SasIoUnitControlRequest_t, MPI_POINTER pSasIoUnitControlRequest_t; 23862306a36Sopenharmony_ci 23962306a36Sopenharmony_ci/* values for the Operation field */ 24062306a36Sopenharmony_ci#define MPI_SAS_OP_CLEAR_NOT_PRESENT (0x01) 24162306a36Sopenharmony_ci#define MPI_SAS_OP_CLEAR_ALL_PERSISTENT (0x02) 24262306a36Sopenharmony_ci#define MPI_SAS_OP_PHY_LINK_RESET (0x06) 24362306a36Sopenharmony_ci#define MPI_SAS_OP_PHY_HARD_RESET (0x07) 24462306a36Sopenharmony_ci#define MPI_SAS_OP_PHY_CLEAR_ERROR_LOG (0x08) 24562306a36Sopenharmony_ci#define MPI_SAS_OP_MAP_CURRENT (0x09) 24662306a36Sopenharmony_ci#define MPI_SAS_OP_SEND_PRIMITIVE (0x0A) 24762306a36Sopenharmony_ci#define MPI_SAS_OP_FORCE_FULL_DISCOVERY (0x0B) 24862306a36Sopenharmony_ci#define MPI_SAS_OP_TRANSMIT_PORT_SELECT_SIGNAL (0x0C) 24962306a36Sopenharmony_ci#define MPI_SAS_OP_TRANSMIT_REMOVE_DEVICE (0x0D) /* obsolete name */ 25062306a36Sopenharmony_ci#define MPI_SAS_OP_REMOVE_DEVICE (0x0D) 25162306a36Sopenharmony_ci#define MPI_SAS_OP_SET_IOC_PARAMETER (0x0E) 25262306a36Sopenharmony_ci#define MPI_SAS_OP_PRODUCT_SPECIFIC_MIN (0x80) 25362306a36Sopenharmony_ci 25462306a36Sopenharmony_ci/* values for the PrimFlags field */ 25562306a36Sopenharmony_ci#define MPI_SAS_PRIMFLAGS_SINGLE (0x08) 25662306a36Sopenharmony_ci#define MPI_SAS_PRIMFLAGS_TRIPLE (0x02) 25762306a36Sopenharmony_ci#define MPI_SAS_PRIMFLAGS_REDUNDANT (0x01) 25862306a36Sopenharmony_ci 25962306a36Sopenharmony_ci 26062306a36Sopenharmony_ci/* SAS IO Unit Control Reply */ 26162306a36Sopenharmony_citypedef struct _MSG_SAS_IOUNIT_CONTROL_REPLY 26262306a36Sopenharmony_ci{ 26362306a36Sopenharmony_ci U8 Operation; /* 00h */ 26462306a36Sopenharmony_ci U8 Reserved1; /* 01h */ 26562306a36Sopenharmony_ci U8 MsgLength; /* 02h */ 26662306a36Sopenharmony_ci U8 Function; /* 03h */ 26762306a36Sopenharmony_ci U16 DevHandle; /* 04h */ 26862306a36Sopenharmony_ci U8 IOCParameter; /* 06h */ 26962306a36Sopenharmony_ci U8 MsgFlags; /* 07h */ 27062306a36Sopenharmony_ci U32 MsgContext; /* 08h */ 27162306a36Sopenharmony_ci U16 Reserved4; /* 0Ch */ 27262306a36Sopenharmony_ci U16 IOCStatus; /* 0Eh */ 27362306a36Sopenharmony_ci U32 IOCLogInfo; /* 10h */ 27462306a36Sopenharmony_ci} MSG_SAS_IOUNIT_CONTROL_REPLY, MPI_POINTER PTR_MSG_SAS_IOUNIT_CONTROL_REPLY, 27562306a36Sopenharmony_ci SasIoUnitControlReply_t, MPI_POINTER pSasIoUnitControlReply_t; 27662306a36Sopenharmony_ci 27762306a36Sopenharmony_ci#endif 27862306a36Sopenharmony_ci 27962306a36Sopenharmony_ci 280