2 * Copyright (c) 2004 LSI Logic Corporation.
6 * Title: MPI Serial Attached SCSI structures and definitions
7 * Creation Date: August 19, 2004
9 * mpi_sas.h Version: 01.05.02
14 * Date Version Description
15 * -------- -------- ------------------------------------------------------
16 * 08-19-04 01.05.01 Original release.
17 * 08-30-05 01.05.02 Added DeviceInfo bit for SEP.
18 * Added PrimFlags and Primitive field to SAS IO Unit
19 * Control request, and added a new operation code.
20 * --------------------------------------------------------------------------
28 * Values for SASStatus.
30 #define MPI_SASSTATUS_SUCCESS (0x00)
31 #define MPI_SASSTATUS_UNKNOWN_ERROR (0x01)
32 #define MPI_SASSTATUS_INVALID_FRAME (0x02)
33 #define MPI_SASSTATUS_UTC_BAD_DEST (0x03)
34 #define MPI_SASSTATUS_UTC_BREAK_RECEIVED (0x04)
35 #define MPI_SASSTATUS_UTC_CONNECT_RATE_NOT_SUPPORTED (0x05)
36 #define MPI_SASSTATUS_UTC_PORT_LAYER_REQUEST (0x06)
37 #define MPI_SASSTATUS_UTC_PROTOCOL_NOT_SUPPORTED (0x07)
38 #define MPI_SASSTATUS_UTC_STP_RESOURCES_BUSY (0x08)
39 #define MPI_SASSTATUS_UTC_WRONG_DESTINATION (0x09)
40 #define MPI_SASSTATUS_SHORT_INFORMATION_UNIT (0x0A)
41 #define MPI_SASSTATUS_LONG_INFORMATION_UNIT (0x0B)
42 #define MPI_SASSTATUS_XFER_RDY_INCORRECT_WRITE_DATA (0x0C)
43 #define MPI_SASSTATUS_XFER_RDY_REQUEST_OFFSET_ERROR (0x0D)
44 #define MPI_SASSTATUS_XFER_RDY_NOT_EXPECTED (0x0E)
45 #define MPI_SASSTATUS_DATA_INCORRECT_DATA_LENGTH (0x0F)
46 #define MPI_SASSTATUS_DATA_TOO_MUCH_READ_DATA (0x10)
47 #define MPI_SASSTATUS_DATA_OFFSET_ERROR (0x11)
48 #define MPI_SASSTATUS_SDSF_NAK_RECEIVED (0x12)
49 #define MPI_SASSTATUS_SDSF_CONNECTION_FAILED (0x13)
50 #define MPI_SASSTATUS_INITIATOR_RESPONSE_TIMEOUT (0x14)
54 * Values for the SAS DeviceInfo field used in SAS Device Status Change Event
55 * data and SAS IO Unit Configuration pages.
57 #define MPI_SAS_DEVICE_INFO_SEP (0x00004000)
58 #define MPI_SAS_DEVICE_INFO_ATAPI_DEVICE (0x00002000)
59 #define MPI_SAS_DEVICE_INFO_LSI_DEVICE (0x00001000)
60 #define MPI_SAS_DEVICE_INFO_DIRECT_ATTACH (0x00000800)
61 #define MPI_SAS_DEVICE_INFO_SSP_TARGET (0x00000400)
62 #define MPI_SAS_DEVICE_INFO_STP_TARGET (0x00000200)
63 #define MPI_SAS_DEVICE_INFO_SMP_TARGET (0x00000100)
64 #define MPI_SAS_DEVICE_INFO_SATA_DEVICE (0x00000080)
65 #define MPI_SAS_DEVICE_INFO_SSP_INITIATOR (0x00000040)
66 #define MPI_SAS_DEVICE_INFO_STP_INITIATOR (0x00000020)
67 #define MPI_SAS_DEVICE_INFO_SMP_INITIATOR (0x00000010)
68 #define MPI_SAS_DEVICE_INFO_SATA_HOST (0x00000008)
70 #define MPI_SAS_DEVICE_INFO_MASK_DEVICE_TYPE (0x00000007)
71 #define MPI_SAS_DEVICE_INFO_NO_DEVICE (0x00000000)
72 #define MPI_SAS_DEVICE_INFO_END_DEVICE (0x00000001)
73 #define MPI_SAS_DEVICE_INFO_EDGE_EXPANDER (0x00000002)
74 #define MPI_SAS_DEVICE_INFO_FANOUT_EXPANDER (0x00000003)
78 /*****************************************************************************
80 * 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
82 *****************************************************************************/
84 /****************************************************************************/
85 /* Serial Management Protocol Passthrough Request */
86 /****************************************************************************/
88 typedef struct _MSG_SMP_PASSTHROUGH_REQUEST
90 U8 PassthroughFlags; /* 00h */
91 U8 PhysicalPort; /* 01h */
92 U8 ChainOffset; /* 02h */
93 U8 Function; /* 03h */
94 U16 RequestDataLength; /* 04h */
95 U8 ConnectionRate; /* 06h */
96 U8 MsgFlags; /* 07h */
97 U32 MsgContext; /* 08h */
98 U32 Reserved1; /* 0Ch */
99 U64 SASAddress; /* 10h */
100 U32 Reserved2; /* 18h */
101 U32 Reserved3; /* 1Ch */
102 SGE_SIMPLE_UNION SGL; /* 20h */
103 } MSG_SMP_PASSTHROUGH_REQUEST, MPI_POINTER PTR_MSG_SMP_PASSTHROUGH_REQUEST,
104 SmpPassthroughRequest_t, MPI_POINTER pSmpPassthroughRequest_t;
106 /* values for PassthroughFlags field */
107 #define MPI_SMP_PT_REQ_PT_FLAGS_IMMEDIATE (0x80)
109 /* values for ConnectionRate field */
110 #define MPI_SMP_PT_REQ_CONNECT_RATE_NEGOTIATED (0x00)
111 #define MPI_SMP_PT_REQ_CONNECT_RATE_1_5 (0x08)
112 #define MPI_SMP_PT_REQ_CONNECT_RATE_3_0 (0x09)
115 /* Serial Management Protocol Passthrough Reply */
116 typedef struct _MSG_SMP_PASSTHROUGH_REPLY
118 U8 PassthroughFlags; /* 00h */
119 U8 PhysicalPort; /* 01h */
120 U8 MsgLength; /* 02h */
121 U8 Function; /* 03h */
122 U16 ResponseDataLength; /* 04h */
123 U8 Reserved1; /* 06h */
124 U8 MsgFlags; /* 07h */
125 U32 MsgContext; /* 08h */
126 U8 Reserved2; /* 0Ch */
127 U8 SASStatus; /* 0Dh */
128 U16 IOCStatus; /* 0Eh */
129 U32 IOCLogInfo; /* 10h */
130 U32 Reserved3; /* 14h */
131 U8 ResponseData[4]; /* 18h */
132 } MSG_SMP_PASSTHROUGH_REPLY, MPI_POINTER PTR_MSG_SMP_PASSTHROUGH_REPLY,
133 SmpPassthroughReply_t, MPI_POINTER pSmpPassthroughReply_t;
135 #define MPI_SMP_PT_REPLY_PT_FLAGS_IMMEDIATE (0x80)
138 /****************************************************************************/
139 /* SATA Passthrough Request */
140 /****************************************************************************/
142 typedef struct _MSG_SATA_PASSTHROUGH_REQUEST
144 U8 TargetID; /* 00h */
146 U8 ChainOffset; /* 02h */
147 U8 Function; /* 03h */
148 U16 PassthroughFlags; /* 04h */
149 U8 ConnectionRate; /* 06h */
150 U8 MsgFlags; /* 07h */
151 U32 MsgContext; /* 08h */
152 U32 Reserved1; /* 0Ch */
153 U32 Reserved2; /* 10h */
154 U32 Reserved3; /* 14h */
155 U32 DataLength; /* 18h */
156 U8 CommandFIS[20]; /* 1Ch */
157 SGE_SIMPLE_UNION SGL; /* 30h */
158 } MSG_SATA_PASSTHROUGH_REQUEST, MPI_POINTER PTR_MSG_SATA_PASSTHROUGH_REQUEST,
159 SataPassthroughRequest_t, MPI_POINTER pSataPassthroughRequest_t;
161 /* values for PassthroughFlags field */
162 #define MPI_SATA_PT_REQ_PT_FLAGS_RESET_DEVICE (0x0200)
163 #define MPI_SATA_PT_REQ_PT_FLAGS_EXECUTE_DIAG (0x0100)
164 #define MPI_SATA_PT_REQ_PT_FLAGS_DMA_QUEUED (0x0080)
165 #define MPI_SATA_PT_REQ_PT_FLAGS_PACKET_COMMAND (0x0040)
166 #define MPI_SATA_PT_REQ_PT_FLAGS_DMA (0x0020)
167 #define MPI_SATA_PT_REQ_PT_FLAGS_PIO (0x0010)
168 #define MPI_SATA_PT_REQ_PT_FLAGS_UNSPECIFIED_VU (0x0004)
169 #define MPI_SATA_PT_REQ_PT_FLAGS_WRITE (0x0002)
170 #define MPI_SATA_PT_REQ_PT_FLAGS_READ (0x0001)
172 /* values for ConnectionRate field */
173 #define MPI_SATA_PT_REQ_CONNECT_RATE_NEGOTIATED (0x00)
174 #define MPI_SATA_PT_REQ_CONNECT_RATE_1_5 (0x08)
175 #define MPI_SATA_PT_REQ_CONNECT_RATE_3_0 (0x09)
178 /* SATA Passthrough Reply */
179 typedef struct _MSG_SATA_PASSTHROUGH_REPLY
181 U8 TargetID; /* 00h */
183 U8 MsgLength; /* 02h */
184 U8 Function; /* 03h */
185 U16 PassthroughFlags; /* 04h */
186 U8 Reserved1; /* 06h */
187 U8 MsgFlags; /* 07h */
188 U32 MsgContext; /* 08h */
189 U8 Reserved2; /* 0Ch */
190 U8 SASStatus; /* 0Dh */
191 U16 IOCStatus; /* 0Eh */
192 U32 IOCLogInfo; /* 10h */
193 U8 StatusFIS[20]; /* 14h */
194 U32 StatusControlRegisters; /* 28h */
195 U32 TransferCount; /* 2Ch */
196 } MSG_SATA_PASSTHROUGH_REPLY, MPI_POINTER PTR_MSG_SATA_PASSTHROUGH_REPLY,
197 SataPassthroughReply_t, MPI_POINTER pSataPassthroughReply_t;
202 /****************************************************************************/
203 /* SAS IO Unit Control Request */
204 /****************************************************************************/
206 typedef struct _MSG_SAS_IOUNIT_CONTROL_REQUEST
208 U8 Operation; /* 00h */
209 U8 Reserved1; /* 01h */
210 U8 ChainOffset; /* 02h */
211 U8 Function; /* 03h */
212 U16 Reserved2; /* 04h */
213 U8 Reserved3; /* 06h */
214 U8 MsgFlags; /* 07h */
215 U32 MsgContext; /* 08h */
216 U8 TargetID; /* 0Ch */
219 U8 PrimFlags; /* 0Fh */
220 U32 Primitive; /* 10h */
221 U64 SASAddress; /* 14h */
222 U32 Reserved4; /* 1Ch */
223 } MSG_SAS_IOUNIT_CONTROL_REQUEST, MPI_POINTER PTR_MSG_SAS_IOUNIT_CONTROL_REQUEST,
224 SasIoUnitControlRequest_t, MPI_POINTER pSasIoUnitControlRequest_t;
226 /* values for the Operation field */
227 #define MPI_SAS_OP_CLEAR_NOT_PRESENT (0x01)
228 #define MPI_SAS_OP_CLEAR_ALL_PERSISTENT (0x02)
229 #define MPI_SAS_OP_PHY_LINK_RESET (0x06)
230 #define MPI_SAS_OP_PHY_HARD_RESET (0x07)
231 #define MPI_SAS_OP_PHY_CLEAR_ERROR_LOG (0x08)
232 #define MPI_SAS_OP_MAP_CURRENT (0x09)
233 #define MPI_SAS_OP_SEND_PRIMITIVE (0x0A)
235 /* values for the PrimFlags field */
236 #define MPI_SAS_PRIMFLAGS_SINGLE (0x08)
237 #define MPI_SAS_PRIMFLAGS_TRIPLE (0x02)
238 #define MPI_SAS_PRIMFLAGS_REDUNDANT (0x01)
241 /* SAS IO Unit Control Reply */
242 typedef struct _MSG_SAS_IOUNIT_CONTROL_REPLY
244 U8 Operation; /* 00h */
245 U8 Reserved1; /* 01h */
246 U8 MsgLength; /* 02h */
247 U8 Function; /* 03h */
248 U16 Reserved2; /* 04h */
249 U8 Reserved3; /* 06h */
250 U8 MsgFlags; /* 07h */
251 U32 MsgContext; /* 08h */
252 U16 Reserved4; /* 0Ch */
253 U16 IOCStatus; /* 0Eh */
254 U32 IOCLogInfo; /* 10h */
255 } MSG_SAS_IOUNIT_CONTROL_REPLY, MPI_POINTER PTR_MSG_SAS_IOUNIT_CONTROL_REPLY,
256 SasIoUnitControlReply_t, MPI_POINTER pSasIoUnitControlReply_t;