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