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
40 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
41 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
42 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
43 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
44 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
46 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
47 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
48 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
49 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
50 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
54 #ifndef _SCI_STATUS_H_
55 #define _SCI_STATUS_H_
60 * @brief This file contains all of the return status codes utilized across
61 * the various sub-components in SCI.
70 * @brief This is the general return status enumeration for non-IO, non-task
71 * management related SCI interface methods.
73 typedef enum _SCI_STATUS
76 * This member indicates successful completion.
81 * This value indicates that the calling method completed successfully,
82 * but that the IO may have completed before having it's start method
83 * invoked. This occurs during SAT translation for requests that do
84 * not require an IO to the target or for any other requests that may
85 * be completed without having to submit IO.
87 SCI_SUCCESS_IO_COMPLETE_BEFORE_START,
90 * This Value indicates that the SCU hardware returned an early response
91 * because the io request specified more data than is returned by the
92 * target device (mode pages, inquiry data, etc.). The completion routine
93 * will handle this case to get the actual number of bytes transferred.
95 SCI_SUCCESS_IO_DONE_EARLY,
98 * This member indicates that the object for which a state change is
99 * being requested is already in said state.
101 SCI_WARNING_ALREADY_IN_STATE,
104 * This member indicates interrupt coalescence timer may cause SAS
105 * specification compliance issues (i.e. SMP target mode response
106 * frames must be returned within 1.9 milliseconds).
108 SCI_WARNING_TIMER_CONFLICT,
111 * This field indicates a sequence of action is not completed yet. Mostly,
112 * this status is used when multiple ATA commands are needed in a SATI translation.
114 SCI_WARNING_SEQUENCE_INCOMPLETE,
117 * This member indicates that there was a general failure.
122 * This member indicates that the SCI implementation is unable to complete
123 * an operation due to a critical flaw the prevents any further operation
124 * (i.e. an invalid pointer).
129 * This member indicates the calling function failed, because the state
130 * of the controller is in a state that prevents successful completion.
132 SCI_FAILURE_INVALID_STATE,
135 * This member indicates the calling function failed, because there is
136 * insufficient resources/memory to complete the request.
138 SCI_FAILURE_INSUFFICIENT_RESOURCES,
141 * This member indicates the calling function failed, because the
142 * controller object required for the operation can't be located.
144 SCI_FAILURE_CONTROLLER_NOT_FOUND,
147 * This member indicates the calling function failed, because the
148 * discovered controller type is not supported by the library.
150 SCI_FAILURE_UNSUPPORTED_CONTROLLER_TYPE,
153 * This member indicates the calling function failed, because the
154 * requested initialization data version isn't supported.
156 SCI_FAILURE_UNSUPPORTED_INIT_DATA_VERSION,
159 * This member indicates the calling function failed, because the
160 * requested configuration of SAS Phys into SAS Ports is not supported.
162 SCI_FAILURE_UNSUPPORTED_PORT_CONFIGURATION,
165 * This member indicates the calling function failed, because the
166 * requested protocol is not supported by the remote device, port,
169 SCI_FAILURE_UNSUPPORTED_PROTOCOL,
172 * This member indicates the calling function failed, because the
173 * requested information type is not supported by the SCI implementation.
175 SCI_FAILURE_UNSUPPORTED_INFORMATION_TYPE,
178 * This member indicates the calling function failed, because the
179 * device already exists.
181 SCI_FAILURE_DEVICE_EXISTS,
184 * This member indicates the calling function failed, because adding
185 * a phy to the object is not possible.
187 SCI_FAILURE_ADDING_PHY_UNSUPPORTED,
190 * This member indicates the calling function failed, because the
191 * requested information type is not supported by the SCI implementation.
193 SCI_FAILURE_UNSUPPORTED_INFORMATION_FIELD,
196 * This member indicates the calling function failed, because the SCI
197 * implementation does not support the supplied time limit.
199 SCI_FAILURE_UNSUPPORTED_TIME_LIMIT,
202 * This member indicates the calling method failed, because the SCI
203 * implementation does not contain the specified Phy.
205 SCI_FAILURE_INVALID_PHY,
208 * This member indicates the calling method failed, because the SCI
209 * implementation does not contain the specified Port.
211 SCI_FAILURE_INVALID_PORT,
214 * This member indicates the calling method was partly successful
215 * The port was reset but not all phys in port are operational
217 SCI_FAILURE_RESET_PORT_PARTIAL_SUCCESS,
220 * This member indicates that calling method failed
221 * The port reset did not complete because none of the phys are operational
223 SCI_FAILURE_RESET_PORT_FAILURE,
226 * This member indicates the calling method failed, because the SCI
227 * implementation does not contain the specified remote device.
229 SCI_FAILURE_INVALID_REMOTE_DEVICE,
232 * This member indicates the calling method failed, because the remote
233 * device is in a bad state and requires a reset.
235 SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED,
238 * This member indicates the calling method failed, because the SCI
239 * implementation does not contain or support the specified IO tag.
241 SCI_FAILURE_INVALID_IO_TAG,
244 * This member indicates that the operation failed and the user should
245 * check the response data associated with the IO.
247 SCI_FAILURE_IO_RESPONSE_VALID,
250 * This member indicates that the operation failed, the failure is
251 * controller implementation specific, and the response data associated
252 * with the request is not valid. You can query for the controller
253 * specific error information via scic_request_get_controller_status()
255 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR,
258 * This member indicated that the operation failed because the
259 * user requested this IO to be terminated.
261 SCI_FAILURE_IO_TERMINATED,
264 * This member indicates that the operation failed and the associated
265 * request requires a SCSI abort task to be sent to the target.
267 SCI_FAILURE_IO_REQUIRES_SCSI_ABORT,
270 * This member indicates that the operation failed because the supplied
271 * device could not be located.
273 SCI_FAILURE_DEVICE_NOT_FOUND,
276 * This member indicates that the operation failed because the
277 * objects association is required and is not correctly set.
279 SCI_FAILURE_INVALID_ASSOCIATION,
282 * This member indicates that the operation failed, because a timeout
288 * This member indicates that the operation failed, because the user
289 * specified a value that is either invalid or not supported.
291 SCI_FAILURE_INVALID_PARAMETER_VALUE,
294 * This value indicates that the operation failed, because the number
295 * of messages (MSI-X) is not supported.
297 SCI_FAILURE_UNSUPPORTED_MESSAGE_COUNT,
300 * This value indicates that the method failed due to a lack of
301 * available NCQ tags.
303 SCI_FAILURE_NO_NCQ_TAG_AVAILABLE,
306 * This value indicates that a protocol violation has occurred on the
309 SCI_FAILURE_PROTOCOL_VIOLATION,
312 * This value indicates a failure condition that retry may help to clear.
314 SCI_FAILURE_RETRY_REQUIRED,
317 * This field indicates the retry limit was reached when a retry is attempted
319 SCI_FAILURE_RETRY_LIMIT_REACHED,
322 * This member indicates the calling method was partly successful.
323 * Mostly, this status is used when a LUN_RESET issued to an expander attached
324 * STP device in READY NCQ substate needs to have RNC suspended/resumed
327 SCI_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS,
330 * This field indicates an illegal phy connection based on the routing attribute
331 * of both expander phy attached to each other.
333 SCI_FAILURE_ILLEGAL_ROUTING_ATTRIBUTE_CONFIGURATION,
336 * This field indicates a CONFIG ROUTE INFO command has a response with function result
337 * INDEX DOES NOT EXIST, usually means exceeding max route index.
339 SCI_FAILURE_EXCEED_MAX_ROUTE_INDEX,
342 * This value indicates that an unsupported PCI device ID has been
343 * specified. This indicates that attempts to invoke
344 * scic_library_allocate_controller() will fail.
346 SCI_FAILURE_UNSUPPORTED_PCI_DEVICE_ID
351 * @enum _SCI_IO_STATUS
352 * @brief This enumeration depicts all of the possible IO completion
353 * status values. Each value in this enumeration maps directly to
354 * a value in the SCI_STATUS enumeration. Please refer to that
355 * enumeration for detailed comments concerning what the status
357 * @todo Add the API to retrieve the SCU status from the core.
358 * @todo Check to see that the following status are properly handled:
359 * - SCI_IO_FAILURE_UNSUPPORTED_PROTOCOL
360 * - SCI_IO_FAILURE_INVALID_IO_TAG
362 typedef enum _SCI_IO_STATUS
364 SCI_IO_SUCCESS = SCI_SUCCESS,
365 SCI_IO_FAILURE = SCI_FAILURE,
366 SCI_IO_SUCCESS_COMPLETE_BEFORE_START = SCI_SUCCESS_IO_COMPLETE_BEFORE_START,
367 SCI_IO_SUCCESS_IO_DONE_EARLY = SCI_SUCCESS_IO_DONE_EARLY,
368 SCI_IO_FAILURE_INVALID_STATE = SCI_FAILURE_INVALID_STATE,
369 SCI_IO_FAILURE_INSUFFICIENT_RESOURCES = SCI_FAILURE_INSUFFICIENT_RESOURCES,
370 SCI_IO_FAILURE_UNSUPPORTED_PROTOCOL = SCI_FAILURE_UNSUPPORTED_PROTOCOL,
371 SCI_IO_FAILURE_RESPONSE_VALID = SCI_FAILURE_IO_RESPONSE_VALID,
372 SCI_IO_FAILURE_CONTROLLER_SPECIFIC_ERR = SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR,
373 SCI_IO_FAILURE_TERMINATED = SCI_FAILURE_IO_TERMINATED,
374 SCI_IO_FAILURE_REQUIRES_SCSI_ABORT = SCI_FAILURE_IO_REQUIRES_SCSI_ABORT,
375 SCI_IO_FAILURE_INVALID_PARAMETER_VALUE = SCI_FAILURE_INVALID_PARAMETER_VALUE,
376 SCI_IO_FAILURE_NO_NCQ_TAG_AVAILABLE = SCI_FAILURE_NO_NCQ_TAG_AVAILABLE,
377 SCI_IO_FAILURE_PROTOCOL_VIOLATION = SCI_FAILURE_PROTOCOL_VIOLATION,
379 SCI_IO_FAILURE_REMOTE_DEVICE_RESET_REQUIRED = SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED,
381 SCI_IO_FAILURE_RETRY_REQUIRED = SCI_FAILURE_RETRY_REQUIRED,
382 SCI_IO_FAILURE_RETRY_LIMIT_REACHED = SCI_FAILURE_RETRY_LIMIT_REACHED,
383 SCI_IO_FAILURE_INVALID_REMOTE_DEVICE = SCI_FAILURE_INVALID_REMOTE_DEVICE
387 * @enum _SCI_TASK_STATUS
388 * @brief This enumeration depicts all of the possible task completion
389 * status values. Each value in this enumeration maps directly to
390 * a value in the SCI_STATUS enumeration. Please refer to that
391 * enumeration for detailed comments concerning what the status
393 * @todo Check to see that the following status are properly handled:
395 typedef enum _SCI_TASK_STATUS
397 SCI_TASK_SUCCESS = SCI_SUCCESS,
398 SCI_TASK_FAILURE = SCI_FAILURE,
399 SCI_TASK_FAILURE_INVALID_STATE = SCI_FAILURE_INVALID_STATE,
400 SCI_TASK_FAILURE_INSUFFICIENT_RESOURCES = SCI_FAILURE_INSUFFICIENT_RESOURCES,
401 SCI_TASK_FAILURE_UNSUPPORTED_PROTOCOL = SCI_FAILURE_UNSUPPORTED_PROTOCOL,
402 SCI_TASK_FAILURE_INVALID_TAG = SCI_FAILURE_INVALID_IO_TAG,
403 SCI_TASK_FAILURE_RESPONSE_VALID = SCI_FAILURE_IO_RESPONSE_VALID,
404 SCI_TASK_FAILURE_CONTROLLER_SPECIFIC_ERR = SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR,
405 SCI_TASK_FAILURE_TERMINATED = SCI_FAILURE_IO_TERMINATED,
406 SCI_TASK_FAILURE_INVALID_PARAMETER_VALUE = SCI_FAILURE_INVALID_PARAMETER_VALUE,
408 SCI_TASK_FAILURE_REMOTE_DEVICE_RESET_REQUIRED = SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED,
409 SCI_TASK_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS = SCI_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS
415 #endif // __cplusplus
417 #endif // _SCI_STATUS_H_