1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33#ifndef MPI_SAS_H
34#define MPI_SAS_H
35
36
37
38
39
40#define MPI_SASSTATUS_SUCCESS (0x00)
41#define MPI_SASSTATUS_UNKNOWN_ERROR (0x01)
42#define MPI_SASSTATUS_INVALID_FRAME (0x02)
43#define MPI_SASSTATUS_UTC_BAD_DEST (0x03)
44#define MPI_SASSTATUS_UTC_BREAK_RECEIVED (0x04)
45#define MPI_SASSTATUS_UTC_CONNECT_RATE_NOT_SUPPORTED (0x05)
46#define MPI_SASSTATUS_UTC_PORT_LAYER_REQUEST (0x06)
47#define MPI_SASSTATUS_UTC_PROTOCOL_NOT_SUPPORTED (0x07)
48#define MPI_SASSTATUS_UTC_STP_RESOURCES_BUSY (0x08)
49#define MPI_SASSTATUS_UTC_WRONG_DESTINATION (0x09)
50#define MPI_SASSTATUS_SHORT_INFORMATION_UNIT (0x0A)
51#define MPI_SASSTATUS_LONG_INFORMATION_UNIT (0x0B)
52#define MPI_SASSTATUS_XFER_RDY_INCORRECT_WRITE_DATA (0x0C)
53#define MPI_SASSTATUS_XFER_RDY_REQUEST_OFFSET_ERROR (0x0D)
54#define MPI_SASSTATUS_XFER_RDY_NOT_EXPECTED (0x0E)
55#define MPI_SASSTATUS_DATA_INCORRECT_DATA_LENGTH (0x0F)
56#define MPI_SASSTATUS_DATA_TOO_MUCH_READ_DATA (0x10)
57#define MPI_SASSTATUS_DATA_OFFSET_ERROR (0x11)
58#define MPI_SASSTATUS_SDSF_NAK_RECEIVED (0x12)
59#define MPI_SASSTATUS_SDSF_CONNECTION_FAILED (0x13)
60#define MPI_SASSTATUS_INITIATOR_RESPONSE_TIMEOUT (0x14)
61
62
63
64
65
66
67#define MPI_SAS_DEVICE_INFO_PRODUCT_SPECIFIC (0xF0000000)
68
69#define MPI_SAS_DEVICE_INFO_SEP (0x00004000)
70#define MPI_SAS_DEVICE_INFO_ATAPI_DEVICE (0x00002000)
71#define MPI_SAS_DEVICE_INFO_LSI_DEVICE (0x00001000)
72#define MPI_SAS_DEVICE_INFO_DIRECT_ATTACH (0x00000800)
73#define MPI_SAS_DEVICE_INFO_SSP_TARGET (0x00000400)
74#define MPI_SAS_DEVICE_INFO_STP_TARGET (0x00000200)
75#define MPI_SAS_DEVICE_INFO_SMP_TARGET (0x00000100)
76#define MPI_SAS_DEVICE_INFO_SATA_DEVICE (0x00000080)
77#define MPI_SAS_DEVICE_INFO_SSP_INITIATOR (0x00000040)
78#define MPI_SAS_DEVICE_INFO_STP_INITIATOR (0x00000020)
79#define MPI_SAS_DEVICE_INFO_SMP_INITIATOR (0x00000010)
80#define MPI_SAS_DEVICE_INFO_SATA_HOST (0x00000008)
81
82#define MPI_SAS_DEVICE_INFO_MASK_DEVICE_TYPE (0x00000007)
83#define MPI_SAS_DEVICE_INFO_NO_DEVICE (0x00000000)
84#define MPI_SAS_DEVICE_INFO_END_DEVICE (0x00000001)
85#define MPI_SAS_DEVICE_INFO_EDGE_EXPANDER (0x00000002)
86#define MPI_SAS_DEVICE_INFO_FANOUT_EXPANDER (0x00000003)
87
88
89
90
91
92
93
94
95
96
97
98
99
100typedef struct _MSG_SMP_PASSTHROUGH_REQUEST
101{
102 U8 PassthroughFlags;
103 U8 PhysicalPort;
104 U8 ChainOffset;
105 U8 Function;
106 U16 RequestDataLength;
107 U8 ConnectionRate;
108 U8 MsgFlags;
109 U32 MsgContext;
110 U32 Reserved1;
111 U64 SASAddress;
112 U32 Reserved2;
113 U32 Reserved3;
114 SGE_SIMPLE_UNION SGL;
115} MSG_SMP_PASSTHROUGH_REQUEST, MPI_POINTER PTR_MSG_SMP_PASSTHROUGH_REQUEST,
116 SmpPassthroughRequest_t, MPI_POINTER pSmpPassthroughRequest_t;
117
118
119#define MPI_SMP_PT_REQ_PT_FLAGS_IMMEDIATE (0x80)
120
121
122#define MPI_SMP_PT_REQ_CONNECT_RATE_NEGOTIATED (0x00)
123#define MPI_SMP_PT_REQ_CONNECT_RATE_1_5 (0x08)
124#define MPI_SMP_PT_REQ_CONNECT_RATE_3_0 (0x09)
125
126
127
128typedef struct _MSG_SMP_PASSTHROUGH_REPLY
129{
130 U8 PassthroughFlags;
131 U8 PhysicalPort;
132 U8 MsgLength;
133 U8 Function;
134 U16 ResponseDataLength;
135 U8 Reserved1;
136 U8 MsgFlags;
137 U32 MsgContext;
138 U8 Reserved2;
139 U8 SASStatus;
140 U16 IOCStatus;
141 U32 IOCLogInfo;
142 U32 Reserved3;
143 U8 ResponseData[4];
144} MSG_SMP_PASSTHROUGH_REPLY, MPI_POINTER PTR_MSG_SMP_PASSTHROUGH_REPLY,
145 SmpPassthroughReply_t, MPI_POINTER pSmpPassthroughReply_t;
146
147#define MPI_SMP_PT_REPLY_PT_FLAGS_IMMEDIATE (0x80)
148
149
150
151
152
153
154typedef struct _MSG_SATA_PASSTHROUGH_REQUEST
155{
156 U8 TargetID;
157 U8 Bus;
158 U8 ChainOffset;
159 U8 Function;
160 U16 PassthroughFlags;
161 U8 ConnectionRate;
162 U8 MsgFlags;
163 U32 MsgContext;
164 U32 Reserved1;
165 U32 Reserved2;
166 U32 Reserved3;
167 U32 DataLength;
168 U8 CommandFIS[20];
169 SGE_SIMPLE_UNION SGL;
170} MSG_SATA_PASSTHROUGH_REQUEST, MPI_POINTER PTR_MSG_SATA_PASSTHROUGH_REQUEST,
171 SataPassthroughRequest_t, MPI_POINTER pSataPassthroughRequest_t;
172
173
174#define MPI_SATA_PT_REQ_PT_FLAGS_RESET_DEVICE (0x0200)
175#define MPI_SATA_PT_REQ_PT_FLAGS_EXECUTE_DIAG (0x0100)
176#define MPI_SATA_PT_REQ_PT_FLAGS_DMA_QUEUED (0x0080)
177#define MPI_SATA_PT_REQ_PT_FLAGS_PACKET_COMMAND (0x0040)
178#define MPI_SATA_PT_REQ_PT_FLAGS_DMA (0x0020)
179#define MPI_SATA_PT_REQ_PT_FLAGS_PIO (0x0010)
180#define MPI_SATA_PT_REQ_PT_FLAGS_UNSPECIFIED_VU (0x0004)
181#define MPI_SATA_PT_REQ_PT_FLAGS_WRITE (0x0002)
182#define MPI_SATA_PT_REQ_PT_FLAGS_READ (0x0001)
183
184
185#define MPI_SATA_PT_REQ_CONNECT_RATE_NEGOTIATED (0x00)
186#define MPI_SATA_PT_REQ_CONNECT_RATE_1_5 (0x08)
187#define MPI_SATA_PT_REQ_CONNECT_RATE_3_0 (0x09)
188
189
190
191typedef struct _MSG_SATA_PASSTHROUGH_REPLY
192{
193 U8 TargetID;
194 U8 Bus;
195 U8 MsgLength;
196 U8 Function;
197 U16 PassthroughFlags;
198 U8 Reserved1;
199 U8 MsgFlags;
200 U32 MsgContext;
201 U8 Reserved2;
202 U8 SASStatus;
203 U16 IOCStatus;
204 U32 IOCLogInfo;
205 U8 StatusFIS[20];
206 U32 StatusControlRegisters;
207 U32 TransferCount;
208} MSG_SATA_PASSTHROUGH_REPLY, MPI_POINTER PTR_MSG_SATA_PASSTHROUGH_REPLY,
209 SataPassthroughReply_t, MPI_POINTER pSataPassthroughReply_t;
210
211
212
213
214
215
216
217
218typedef struct _MSG_SAS_IOUNIT_CONTROL_REQUEST
219{
220 U8 Operation;
221 U8 Reserved1;
222 U8 ChainOffset;
223 U8 Function;
224 U16 DevHandle;
225 U8 IOCParameter;
226 U8 MsgFlags;
227 U32 MsgContext;
228 U8 TargetID;
229 U8 Bus;
230 U8 PhyNum;
231 U8 PrimFlags;
232 U32 Primitive;
233 U64 SASAddress;
234 U32 IOCParameterValue;
235} MSG_SAS_IOUNIT_CONTROL_REQUEST, MPI_POINTER PTR_MSG_SAS_IOUNIT_CONTROL_REQUEST,
236 SasIoUnitControlRequest_t, MPI_POINTER pSasIoUnitControlRequest_t;
237
238
239#define MPI_SAS_OP_CLEAR_NOT_PRESENT (0x01)
240#define MPI_SAS_OP_CLEAR_ALL_PERSISTENT (0x02)
241#define MPI_SAS_OP_PHY_LINK_RESET (0x06)
242#define MPI_SAS_OP_PHY_HARD_RESET (0x07)
243#define MPI_SAS_OP_PHY_CLEAR_ERROR_LOG (0x08)
244#define MPI_SAS_OP_MAP_CURRENT (0x09)
245#define MPI_SAS_OP_SEND_PRIMITIVE (0x0A)
246#define MPI_SAS_OP_FORCE_FULL_DISCOVERY (0x0B)
247#define MPI_SAS_OP_TRANSMIT_PORT_SELECT_SIGNAL (0x0C)
248#define MPI_SAS_OP_TRANSMIT_REMOVE_DEVICE (0x0D)
249#define MPI_SAS_OP_REMOVE_DEVICE (0x0D)
250#define MPI_SAS_OP_SET_IOC_PARAMETER (0x0E)
251#define MPI_SAS_OP_PRODUCT_SPECIFIC_MIN (0x80)
252
253
254#define MPI_SAS_PRIMFLAGS_SINGLE (0x08)
255#define MPI_SAS_PRIMFLAGS_TRIPLE (0x02)
256#define MPI_SAS_PRIMFLAGS_REDUNDANT (0x01)
257
258
259
260typedef struct _MSG_SAS_IOUNIT_CONTROL_REPLY
261{
262 U8 Operation;
263 U8 Reserved1;
264 U8 MsgLength;
265 U8 Function;
266 U16 DevHandle;
267 U8 IOCParameter;
268 U8 MsgFlags;
269 U32 MsgContext;
270 U16 Reserved4;
271 U16 IOCStatus;
272 U32 IOCLogInfo;
273} MSG_SAS_IOUNIT_CONTROL_REPLY, MPI_POINTER PTR_MSG_SAS_IOUNIT_CONTROL_REPLY,
274 SasIoUnitControlReply_t, MPI_POINTER pSasIoUnitControlReply_t;
275
276#endif
277
278
279