2 * This file is provided under a dual BSD/GPLv2 license. When using or
3 * redistributing this file, you may do so under either license.
7 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of version 2 of the GNU General Public License as
11 * published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
21 * The full GNU General Public License is included in this distribution
22 * in the file called LICENSE.GPL.
26 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
27 * All rights reserved.
29 * Redistribution and use in source and binary forms, with or without
30 * modification, are permitted provided that the following conditions
33 * * Redistributions of source code must retain the above copyright
34 * notice, this list of conditions and the following disclaimer.
35 * * Redistributions in binary form must reproduce the above copyright
36 * notice, this list of conditions and the following disclaimer in
37 * the documentation and/or other materials provided with the
39 * * Neither the name of Intel Corporation nor the names of its
40 * contributors may be used to endorse or promote products derived
41 * from this software without specific prior written permission.
43 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
44 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
45 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
46 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
47 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
48 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
49 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
50 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
51 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
52 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
53 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
56 #ifndef _SCI_STATUS_H_
57 #define _SCI_STATUS_H_
60 * This file contains all of the return status codes utilized across the
61 * various sub-components in SCI.
68 * enum _SCI_STATUS - This is the general return status enumeration for non-IO,
69 * non-task management related SCI interface methods.
75 * This member indicates successful completion.
80 * This value indicates that the calling method completed successfully,
81 * but that the IO may have completed before having it's start method
82 * invoked. This occurs during SAT translation for requests that do
83 * not require an IO to the target or for any other requests that may
84 * be completed without having to submit IO.
86 SCI_SUCCESS_IO_COMPLETE_BEFORE_START,
89 * This Value indicates that the SCU hardware returned an early response
90 * because the io request specified more data than is returned by the
91 * target device (mode pages, inquiry data, etc.). The completion routine
92 * will handle this case to get the actual number of bytes transferred.
94 SCI_SUCCESS_IO_DONE_EARLY,
97 * This member indicates that the object for which a state change is
98 * being requested is already in said state.
100 SCI_WARNING_ALREADY_IN_STATE,
103 * This member indicates interrupt coalescence timer may cause SAS
104 * specification compliance issues (i.e. SMP target mode response
105 * frames must be returned within 1.9 milliseconds).
107 SCI_WARNING_TIMER_CONFLICT,
110 * This field indicates a sequence of action is not completed yet. Mostly,
111 * this status is used when multiple ATA commands are needed in a SATI translation.
113 SCI_WARNING_SEQUENCE_INCOMPLETE,
116 * This member indicates that there was a general failure.
121 * This member indicates that the SCI implementation is unable to complete
122 * an operation due to a critical flaw the prevents any further operation
123 * (i.e. an invalid pointer).
128 * This member indicates the calling function failed, because the state
129 * of the controller is in a state that prevents successful completion.
131 SCI_FAILURE_INVALID_STATE,
134 * This member indicates the calling function failed, because there is
135 * insufficient resources/memory to complete the request.
137 SCI_FAILURE_INSUFFICIENT_RESOURCES,
140 * This member indicates the calling function failed, because the
141 * controller object required for the operation can't be located.
143 SCI_FAILURE_CONTROLLER_NOT_FOUND,
146 * This member indicates the calling function failed, because the
147 * discovered controller type is not supported by the library.
149 SCI_FAILURE_UNSUPPORTED_CONTROLLER_TYPE,
152 * This member indicates the calling function failed, because the
153 * requested initialization data version isn't supported.
155 SCI_FAILURE_UNSUPPORTED_INIT_DATA_VERSION,
158 * This member indicates the calling function failed, because the
159 * requested configuration of SAS Phys into SAS Ports is not supported.
161 SCI_FAILURE_UNSUPPORTED_PORT_CONFIGURATION,
164 * This member indicates the calling function failed, because the
165 * requested protocol is not supported by the remote device, port,
168 SCI_FAILURE_UNSUPPORTED_PROTOCOL,
171 * This member indicates the calling function failed, because the
172 * requested information type is not supported by the SCI implementation.
174 SCI_FAILURE_UNSUPPORTED_INFORMATION_TYPE,
177 * This member indicates the calling function failed, because the
178 * device already exists.
180 SCI_FAILURE_DEVICE_EXISTS,
183 * This member indicates the calling function failed, because adding
184 * a phy to the object is not possible.
186 SCI_FAILURE_ADDING_PHY_UNSUPPORTED,
189 * This member indicates the calling function failed, because the
190 * requested information type is not supported by the SCI implementation.
192 SCI_FAILURE_UNSUPPORTED_INFORMATION_FIELD,
195 * This member indicates the calling function failed, because the SCI
196 * implementation does not support the supplied time limit.
198 SCI_FAILURE_UNSUPPORTED_TIME_LIMIT,
201 * This member indicates the calling method failed, because the SCI
202 * implementation does not contain the specified Phy.
204 SCI_FAILURE_INVALID_PHY,
207 * This member indicates the calling method failed, because the SCI
208 * implementation does not contain the specified Port.
210 SCI_FAILURE_INVALID_PORT,
213 * This member indicates the calling method was partly successful
214 * The port was reset but not all phys in port are operational
216 SCI_FAILURE_RESET_PORT_PARTIAL_SUCCESS,
219 * This member indicates that calling method failed
220 * The port reset did not complete because none of the phys are operational
222 SCI_FAILURE_RESET_PORT_FAILURE,
225 * This member indicates the calling method failed, because the SCI
226 * implementation does not contain the specified remote device.
228 SCI_FAILURE_INVALID_REMOTE_DEVICE,
231 * This member indicates the calling method failed, because the remote
232 * device is in a bad state and requires a reset.
234 SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED,
237 * This member indicates the calling method failed, because the SCI
238 * implementation does not contain or support the specified IO tag.
240 SCI_FAILURE_INVALID_IO_TAG,
243 * This member indicates that the operation failed and the user should
244 * check the response data associated with the IO.
246 SCI_FAILURE_IO_RESPONSE_VALID,
249 * This member indicates that the operation failed, the failure is
250 * controller implementation specific, and the response data associated
251 * with the request is not valid. You can query for the controller
252 * specific error information via scic_controller_get_request_status()
254 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR,
257 * This member indicated that the operation failed because the
258 * user requested this IO to be terminated.
260 SCI_FAILURE_IO_TERMINATED,
263 * This member indicates that the operation failed and the associated
264 * request requires a SCSI abort task to be sent to the target.
266 SCI_FAILURE_IO_REQUIRES_SCSI_ABORT,
269 * This member indicates that the operation failed because the supplied
270 * device could not be located.
272 SCI_FAILURE_DEVICE_NOT_FOUND,
275 * This member indicates that the operation failed because the
276 * objects association is required and is not correctly set.
278 SCI_FAILURE_INVALID_ASSOCIATION,
281 * This member indicates that the operation failed, because a timeout
287 * This member indicates that the operation failed, because the user
288 * specified a value that is either invalid or not supported.
290 SCI_FAILURE_INVALID_PARAMETER_VALUE,
293 * This value indicates that the operation failed, because the number
294 * of messages (MSI-X) is not supported.
296 SCI_FAILURE_UNSUPPORTED_MESSAGE_COUNT,
299 * This value indicates that the method failed due to a lack of
300 * available NCQ tags.
302 SCI_FAILURE_NO_NCQ_TAG_AVAILABLE,
305 * This value indicates that a protocol violation has occurred on the
308 SCI_FAILURE_PROTOCOL_VIOLATION,
311 * This value indicates a failure condition that retry may help to clear.
313 SCI_FAILURE_RETRY_REQUIRED,
316 * This field indicates the retry limit was reached when a retry is attempted
318 SCI_FAILURE_RETRY_LIMIT_REACHED,
321 * This member indicates the calling method was partly successful.
322 * Mostly, this status is used when a LUN_RESET issued to an expander attached
323 * STP device in READY NCQ substate needs to have RNC suspended/resumed
326 SCI_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS,
329 * This field indicates an illegal phy connection based on the routing attribute
330 * of both expander phy attached to each other.
332 SCI_FAILURE_ILLEGAL_ROUTING_ATTRIBUTE_CONFIGURATION,
335 * This field indicates a CONFIG ROUTE INFO command has a response with function result
336 * INDEX DOES NOT EXIST, usually means exceeding max route index.
338 SCI_FAILURE_EXCEED_MAX_ROUTE_INDEX,
341 * This value indicates that an unsupported PCI device ID has been
342 * specified. This indicates that attempts to invoke
343 * scic_library_allocate_controller() will fail.
345 SCI_FAILURE_UNSUPPORTED_PCI_DEVICE_ID
350 * enum _SCI_IO_STATUS - This enumeration depicts all of the possible IO
351 * completion status values. Each value in this enumeration maps directly
352 * to a value in the enum sci_status enumeration. Please refer to that
353 * enumeration for detailed comments concerning what the status represents.
355 * Add the API to retrieve the SCU status from the core. Check to see that the
356 * following status are properly handled: - SCI_IO_FAILURE_UNSUPPORTED_PROTOCOL
357 * - SCI_IO_FAILURE_INVALID_IO_TAG
360 SCI_IO_SUCCESS = SCI_SUCCESS,
361 SCI_IO_FAILURE = SCI_FAILURE,
362 SCI_IO_SUCCESS_COMPLETE_BEFORE_START = SCI_SUCCESS_IO_COMPLETE_BEFORE_START,
363 SCI_IO_SUCCESS_IO_DONE_EARLY = SCI_SUCCESS_IO_DONE_EARLY,
364 SCI_IO_FAILURE_INVALID_STATE = SCI_FAILURE_INVALID_STATE,
365 SCI_IO_FAILURE_INSUFFICIENT_RESOURCES = SCI_FAILURE_INSUFFICIENT_RESOURCES,
366 SCI_IO_FAILURE_UNSUPPORTED_PROTOCOL = SCI_FAILURE_UNSUPPORTED_PROTOCOL,
367 SCI_IO_FAILURE_RESPONSE_VALID = SCI_FAILURE_IO_RESPONSE_VALID,
368 SCI_IO_FAILURE_CONTROLLER_SPECIFIC_ERR = SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR,
369 SCI_IO_FAILURE_TERMINATED = SCI_FAILURE_IO_TERMINATED,
370 SCI_IO_FAILURE_REQUIRES_SCSI_ABORT = SCI_FAILURE_IO_REQUIRES_SCSI_ABORT,
371 SCI_IO_FAILURE_INVALID_PARAMETER_VALUE = SCI_FAILURE_INVALID_PARAMETER_VALUE,
372 SCI_IO_FAILURE_NO_NCQ_TAG_AVAILABLE = SCI_FAILURE_NO_NCQ_TAG_AVAILABLE,
373 SCI_IO_FAILURE_PROTOCOL_VIOLATION = SCI_FAILURE_PROTOCOL_VIOLATION,
375 SCI_IO_FAILURE_REMOTE_DEVICE_RESET_REQUIRED = SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED,
377 SCI_IO_FAILURE_RETRY_REQUIRED = SCI_FAILURE_RETRY_REQUIRED,
378 SCI_IO_FAILURE_RETRY_LIMIT_REACHED = SCI_FAILURE_RETRY_LIMIT_REACHED,
379 SCI_IO_FAILURE_INVALID_REMOTE_DEVICE = SCI_FAILURE_INVALID_REMOTE_DEVICE
383 * enum _SCI_TASK_STATUS - This enumeration depicts all of the possible task
384 * completion status values. Each value in this enumeration maps directly
385 * to a value in the enum sci_status enumeration. Please refer to that
386 * enumeration for detailed comments concerning what the status represents.
388 * Check to see that the following status are properly handled:
390 enum sci_task_status {
391 SCI_TASK_SUCCESS = SCI_SUCCESS,
392 SCI_TASK_FAILURE = SCI_FAILURE,
393 SCI_TASK_FAILURE_INVALID_STATE = SCI_FAILURE_INVALID_STATE,
394 SCI_TASK_FAILURE_INSUFFICIENT_RESOURCES = SCI_FAILURE_INSUFFICIENT_RESOURCES,
395 SCI_TASK_FAILURE_UNSUPPORTED_PROTOCOL = SCI_FAILURE_UNSUPPORTED_PROTOCOL,
396 SCI_TASK_FAILURE_INVALID_TAG = SCI_FAILURE_INVALID_IO_TAG,
397 SCI_TASK_FAILURE_RESPONSE_VALID = SCI_FAILURE_IO_RESPONSE_VALID,
398 SCI_TASK_FAILURE_CONTROLLER_SPECIFIC_ERR = SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR,
399 SCI_TASK_FAILURE_TERMINATED = SCI_FAILURE_IO_TERMINATED,
400 SCI_TASK_FAILURE_INVALID_PARAMETER_VALUE = SCI_FAILURE_INVALID_PARAMETER_VALUE,
402 SCI_TASK_FAILURE_REMOTE_DEVICE_RESET_REQUIRED = SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED,
403 SCI_TASK_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS = SCI_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS
408 #endif /* _SCI_STATUS_H_ */