1/* 2 * Copyright (c) 2000-2007 LSI Corporation. 3 * 4 * 5 * Name: mpi2_sas.h 6 * Title: MPI Serial Attached SCSI structures and definitions 7 * Creation Date: February 9, 2007 8 * 9 * mpi2.h Version: 02.00.03 10 * 11 * Version History 12 * --------------- 13 * 14 * Date Version Description 15 * -------- -------- ------------------------------------------------------ 16 * 04-30-07 02.00.00 Corresponds to Fusion-MPT MPI Specification Rev A. 17 * 06-26-07 02.00.01 Added Clear All Persistent Operation to SAS IO Unit 18 * Control Request. 19 * 10-02-08 02.00.02 Added Set IOC Parameter Operation to SAS IO Unit Control 20 * Request. 21 * 10-28-09 02.00.03 Changed the type of SGL in MPI2_SATA_PASSTHROUGH_REQUEST 22 * to MPI2_SGE_IO_UNION since it supports chained SGLs. 23 * -------------------------------------------------------------------------- 24 */ 25 26#ifndef MPI2_SAS_H 27#define MPI2_SAS_H 28 29/* 30 * Values for SASStatus. 31 */ 32#define MPI2_SASSTATUS_SUCCESS (0x00) 33#define MPI2_SASSTATUS_UNKNOWN_ERROR (0x01) 34#define MPI2_SASSTATUS_INVALID_FRAME (0x02) 35#define MPI2_SASSTATUS_UTC_BAD_DEST (0x03) 36#define MPI2_SASSTATUS_UTC_BREAK_RECEIVED (0x04) 37#define MPI2_SASSTATUS_UTC_CONNECT_RATE_NOT_SUPPORTED (0x05) 38#define MPI2_SASSTATUS_UTC_PORT_LAYER_REQUEST (0x06) 39#define MPI2_SASSTATUS_UTC_PROTOCOL_NOT_SUPPORTED (0x07) 40#define MPI2_SASSTATUS_UTC_STP_RESOURCES_BUSY (0x08) 41#define MPI2_SASSTATUS_UTC_WRONG_DESTINATION (0x09) 42#define MPI2_SASSTATUS_SHORT_INFORMATION_UNIT (0x0A) 43#define MPI2_SASSTATUS_LONG_INFORMATION_UNIT (0x0B) 44#define MPI2_SASSTATUS_XFER_RDY_INCORRECT_WRITE_DATA (0x0C) 45#define MPI2_SASSTATUS_XFER_RDY_REQUEST_OFFSET_ERROR (0x0D) 46#define MPI2_SASSTATUS_XFER_RDY_NOT_EXPECTED (0x0E) 47#define MPI2_SASSTATUS_DATA_INCORRECT_DATA_LENGTH (0x0F) 48#define MPI2_SASSTATUS_DATA_TOO_MUCH_READ_DATA (0x10) 49#define MPI2_SASSTATUS_DATA_OFFSET_ERROR (0x11) 50#define MPI2_SASSTATUS_SDSF_NAK_RECEIVED (0x12) 51#define MPI2_SASSTATUS_SDSF_CONNECTION_FAILED (0x13) 52#define MPI2_SASSTATUS_INITIATOR_RESPONSE_TIMEOUT (0x14) 53 54 55/* 56 * Values for the SAS DeviceInfo field used in SAS Device Status Change Event 57 * data and SAS Configuration pages. 58 */ 59#define MPI2_SAS_DEVICE_INFO_SEP (0x00004000) 60#define MPI2_SAS_DEVICE_INFO_ATAPI_DEVICE (0x00002000) 61#define MPI2_SAS_DEVICE_INFO_LSI_DEVICE (0x00001000) 62#define MPI2_SAS_DEVICE_INFO_DIRECT_ATTACH (0x00000800) 63#define MPI2_SAS_DEVICE_INFO_SSP_TARGET (0x00000400) 64#define MPI2_SAS_DEVICE_INFO_STP_TARGET (0x00000200) 65#define MPI2_SAS_DEVICE_INFO_SMP_TARGET (0x00000100) 66#define MPI2_SAS_DEVICE_INFO_SATA_DEVICE (0x00000080) 67#define MPI2_SAS_DEVICE_INFO_SSP_INITIATOR (0x00000040) 68#define MPI2_SAS_DEVICE_INFO_STP_INITIATOR (0x00000020) 69#define MPI2_SAS_DEVICE_INFO_SMP_INITIATOR (0x00000010) 70#define MPI2_SAS_DEVICE_INFO_SATA_HOST (0x00000008) 71 72#define MPI2_SAS_DEVICE_INFO_MASK_DEVICE_TYPE (0x00000007) 73#define MPI2_SAS_DEVICE_INFO_NO_DEVICE (0x00000000) 74#define MPI2_SAS_DEVICE_INFO_END_DEVICE (0x00000001) 75#define MPI2_SAS_DEVICE_INFO_EDGE_EXPANDER (0x00000002) 76#define MPI2_SAS_DEVICE_INFO_FANOUT_EXPANDER (0x00000003) 77 78 79/***************************************************************************** 80* 81* SAS Messages 82* 83*****************************************************************************/ 84 85/**************************************************************************** 86* SMP Passthrough messages 87****************************************************************************/ 88 89/* SMP Passthrough Request Message */ 90typedef struct _MPI2_SMP_PASSTHROUGH_REQUEST 91{ 92 U8 PassthroughFlags; /* 0x00 */ 93 U8 PhysicalPort; /* 0x01 */ 94 U8 ChainOffset; /* 0x02 */ 95 U8 Function; /* 0x03 */ 96 U16 RequestDataLength; /* 0x04 */ 97 U8 SGLFlags; /* 0x06 */ 98 U8 MsgFlags; /* 0x07 */ 99 U8 VP_ID; /* 0x08 */ 100 U8 VF_ID; /* 0x09 */ 101 U16 Reserved1; /* 0x0A */ 102 U32 Reserved2; /* 0x0C */ 103 U64 SASAddress; /* 0x10 */ 104 U32 Reserved3; /* 0x18 */ 105 U32 Reserved4; /* 0x1C */ 106 MPI2_SIMPLE_SGE_UNION SGL; /* 0x20 */ 107} MPI2_SMP_PASSTHROUGH_REQUEST, MPI2_POINTER PTR_MPI2_SMP_PASSTHROUGH_REQUEST, 108 Mpi2SmpPassthroughRequest_t, MPI2_POINTER pMpi2SmpPassthroughRequest_t; 109 110/* values for PassthroughFlags field */ 111#define MPI2_SMP_PT_REQ_PT_FLAGS_IMMEDIATE (0x80) 112 113/* values for SGLFlags field are in the SGL section of mpi2.h */ 114 115 116/* SMP Passthrough Reply Message */ 117typedef struct _MPI2_SMP_PASSTHROUGH_REPLY 118{ 119 U8 PassthroughFlags; /* 0x00 */ 120 U8 PhysicalPort; /* 0x01 */ 121 U8 MsgLength; /* 0x02 */ 122 U8 Function; /* 0x03 */ 123 U16 ResponseDataLength; /* 0x04 */ 124 U8 SGLFlags; /* 0x06 */ 125 U8 MsgFlags; /* 0x07 */ 126 U8 VP_ID; /* 0x08 */ 127 U8 VF_ID; /* 0x09 */ 128 U16 Reserved1; /* 0x0A */ 129 U8 Reserved2; /* 0x0C */ 130 U8 SASStatus; /* 0x0D */ 131 U16 IOCStatus; /* 0x0E */ 132 U32 IOCLogInfo; /* 0x10 */ 133 U32 Reserved3; /* 0x14 */ 134 U8 ResponseData[4]; /* 0x18 */ 135} MPI2_SMP_PASSTHROUGH_REPLY, MPI2_POINTER PTR_MPI2_SMP_PASSTHROUGH_REPLY, 136 Mpi2SmpPassthroughReply_t, MPI2_POINTER pMpi2SmpPassthroughReply_t; 137 138/* values for PassthroughFlags field */ 139#define MPI2_SMP_PT_REPLY_PT_FLAGS_IMMEDIATE (0x80) 140 141/* values for SASStatus field are at the top of this file */ 142 143 144/**************************************************************************** 145* SATA Passthrough messages 146****************************************************************************/ 147 148/* SATA Passthrough Request Message */ 149typedef struct _MPI2_SATA_PASSTHROUGH_REQUEST 150{ 151 U16 DevHandle; /* 0x00 */ 152 U8 ChainOffset; /* 0x02 */ 153 U8 Function; /* 0x03 */ 154 U16 PassthroughFlags; /* 0x04 */ 155 U8 SGLFlags; /* 0x06 */ 156 U8 MsgFlags; /* 0x07 */ 157 U8 VP_ID; /* 0x08 */ 158 U8 VF_ID; /* 0x09 */ 159 U16 Reserved1; /* 0x0A */ 160 U32 Reserved2; /* 0x0C */ 161 U32 Reserved3; /* 0x10 */ 162 U32 Reserved4; /* 0x14 */ 163 U32 DataLength; /* 0x18 */ 164 U8 CommandFIS[20]; /* 0x1C */ 165 MPI2_SGE_IO_UNION SGL; /* 0x20 */ 166} MPI2_SATA_PASSTHROUGH_REQUEST, MPI2_POINTER PTR_MPI2_SATA_PASSTHROUGH_REQUEST, 167 Mpi2SataPassthroughRequest_t, MPI2_POINTER pMpi2SataPassthroughRequest_t; 168 169/* values for PassthroughFlags field */ 170#define MPI2_SATA_PT_REQ_PT_FLAGS_EXECUTE_DIAG (0x0100) 171#define MPI2_SATA_PT_REQ_PT_FLAGS_DMA (0x0020) 172#define MPI2_SATA_PT_REQ_PT_FLAGS_PIO (0x0010) 173#define MPI2_SATA_PT_REQ_PT_FLAGS_UNSPECIFIED_VU (0x0004) 174#define MPI2_SATA_PT_REQ_PT_FLAGS_WRITE (0x0002) 175#define MPI2_SATA_PT_REQ_PT_FLAGS_READ (0x0001) 176 177/* values for SGLFlags field are in the SGL section of mpi2.h */ 178 179 180/* SATA Passthrough Reply Message */ 181typedef struct _MPI2_SATA_PASSTHROUGH_REPLY 182{ 183 U16 DevHandle; /* 0x00 */ 184 U8 MsgLength; /* 0x02 */ 185 U8 Function; /* 0x03 */ 186 U16 PassthroughFlags; /* 0x04 */ 187 U8 SGLFlags; /* 0x06 */ 188 U8 MsgFlags; /* 0x07 */ 189 U8 VP_ID; /* 0x08 */ 190 U8 VF_ID; /* 0x09 */ 191 U16 Reserved1; /* 0x0A */ 192 U8 Reserved2; /* 0x0C */ 193 U8 SASStatus; /* 0x0D */ 194 U16 IOCStatus; /* 0x0E */ 195 U32 IOCLogInfo; /* 0x10 */ 196 U8 StatusFIS[20]; /* 0x14 */ 197 U32 StatusControlRegisters; /* 0x28 */ 198 U32 TransferCount; /* 0x2C */ 199} MPI2_SATA_PASSTHROUGH_REPLY, MPI2_POINTER PTR_MPI2_SATA_PASSTHROUGH_REPLY, 200 Mpi2SataPassthroughReply_t, MPI2_POINTER pMpi2SataPassthroughReply_t; 201 202/* values for SASStatus field are at the top of this file */ 203 204 205/**************************************************************************** 206* SAS IO Unit Control messages 207****************************************************************************/ 208 209/* SAS IO Unit Control Request Message */ 210typedef struct _MPI2_SAS_IOUNIT_CONTROL_REQUEST 211{ 212 U8 Operation; /* 0x00 */ 213 U8 Reserved1; /* 0x01 */ 214 U8 ChainOffset; /* 0x02 */ 215 U8 Function; /* 0x03 */ 216 U16 DevHandle; /* 0x04 */ 217 U8 IOCParameter; /* 0x06 */ 218 U8 MsgFlags; /* 0x07 */ 219 U8 VP_ID; /* 0x08 */ 220 U8 VF_ID; /* 0x09 */ 221 U16 Reserved3; /* 0x0A */ 222 U16 Reserved4; /* 0x0C */ 223 U8 PhyNum; /* 0x0E */ 224 U8 PrimFlags; /* 0x0F */ 225 U32 Primitive; /* 0x10 */ 226 U8 LookupMethod; /* 0x14 */ 227 U8 Reserved5; /* 0x15 */ 228 U16 SlotNumber; /* 0x16 */ 229 U64 LookupAddress; /* 0x18 */ 230 U32 IOCParameterValue; /* 0x20 */ 231 U32 Reserved7; /* 0x24 */ 232 U32 Reserved8; /* 0x28 */ 233} MPI2_SAS_IOUNIT_CONTROL_REQUEST, 234 MPI2_POINTER PTR_MPI2_SAS_IOUNIT_CONTROL_REQUEST, 235 Mpi2SasIoUnitControlRequest_t, MPI2_POINTER pMpi2SasIoUnitControlRequest_t; 236 237/* values for the Operation field */ 238#define MPI2_SAS_OP_CLEAR_ALL_PERSISTENT (0x02) 239#define MPI2_SAS_OP_PHY_LINK_RESET (0x06) 240#define MPI2_SAS_OP_PHY_HARD_RESET (0x07) 241#define MPI2_SAS_OP_PHY_CLEAR_ERROR_LOG (0x08) 242#define MPI2_SAS_OP_SEND_PRIMITIVE (0x0A) 243#define MPI2_SAS_OP_FORCE_FULL_DISCOVERY (0x0B) 244#define MPI2_SAS_OP_TRANSMIT_PORT_SELECT_SIGNAL (0x0C) 245#define MPI2_SAS_OP_REMOVE_DEVICE (0x0D) 246#define MPI2_SAS_OP_LOOKUP_MAPPING (0x0E) 247#define MPI2_SAS_OP_SET_IOC_PARAMETER (0x0F) 248#define MPI2_SAS_OP_PRODUCT_SPECIFIC_MIN (0x80) 249 250/* values for the PrimFlags field */ 251#define MPI2_SAS_PRIMFLAGS_SINGLE (0x08) 252#define MPI2_SAS_PRIMFLAGS_TRIPLE (0x02) 253#define MPI2_SAS_PRIMFLAGS_REDUNDANT (0x01) 254 255/* values for the LookupMethod field */ 256#define MPI2_SAS_LOOKUP_METHOD_SAS_ADDRESS (0x01) 257#define MPI2_SAS_LOOKUP_METHOD_SAS_ENCLOSURE_SLOT (0x02) 258#define MPI2_SAS_LOOKUP_METHOD_SAS_DEVICE_NAME (0x03) 259 260 261/* SAS IO Unit Control Reply Message */ 262typedef struct _MPI2_SAS_IOUNIT_CONTROL_REPLY 263{ 264 U8 Operation; /* 0x00 */ 265 U8 Reserved1; /* 0x01 */ 266 U8 MsgLength; /* 0x02 */ 267 U8 Function; /* 0x03 */ 268 U16 DevHandle; /* 0x04 */ 269 U8 IOCParameter; /* 0x06 */ 270 U8 MsgFlags; /* 0x07 */ 271 U8 VP_ID; /* 0x08 */ 272 U8 VF_ID; /* 0x09 */ 273 U16 Reserved3; /* 0x0A */ 274 U16 Reserved4; /* 0x0C */ 275 U16 IOCStatus; /* 0x0E */ 276 U32 IOCLogInfo; /* 0x10 */ 277} MPI2_SAS_IOUNIT_CONTROL_REPLY, 278 MPI2_POINTER PTR_MPI2_SAS_IOUNIT_CONTROL_REPLY, 279 Mpi2SasIoUnitControlReply_t, MPI2_POINTER pMpi2SasIoUnitControlReply_t; 280 281 282#endif 283