2 * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0
4 * This file is provided under a dual BSD/GPLv2 license. When using or
5 * redistributing this file, you may do so under either license.
9 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of version 2 of the GNU General Public License as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
23 * The full GNU General Public License is included in this distribution
24 * in the file called LICENSE.GPL.
28 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
29 * All rights reserved.
31 * Redistribution and use in source and binary forms, with or without
32 * modification, are permitted provided that the following conditions
35 * * Redistributions of source code must retain the above copyright
36 * notice, this list of conditions and the following disclaimer.
37 * * Redistributions in binary form must reproduce the above copyright
38 * notice, this list of conditions and the following disclaimer in
39 * the documentation and/or other materials provided with the
42 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
43 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
44 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
45 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
46 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
47 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
48 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
49 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
50 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
51 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
52 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
56 #ifndef _SCI_STATUS_H_
57 #define _SCI_STATUS_H_
62 * @brief This file contains all of the return status codes utilized across
63 * the various sub-components in SCI.
72 * @brief This is the general return status enumeration for non-IO, non-task
73 * management related SCI interface methods.
75 typedef enum _SCI_STATUS
78 * This member indicates successful completion.
83 * This value indicates that the calling method completed successfully,
84 * but that the IO may have completed before having it's start method
85 * invoked. This occurs during SAT translation for requests that do
86 * not require an IO to the target or for any other requests that may
87 * be completed without having to submit IO.
89 SCI_SUCCESS_IO_COMPLETE_BEFORE_START,
92 * This Value indicates that the SCU hardware returned an early response
93 * because the io request specified more data than is returned by the
94 * target device (mode pages, inquiry data, etc.). The completion routine
95 * will handle this case to get the actual number of bytes transferred.
97 SCI_SUCCESS_IO_DONE_EARLY,
100 * This member indicates that the object for which a state change is
101 * being requested is already in said state.
103 SCI_WARNING_ALREADY_IN_STATE,
106 * This member indicates interrupt coalescence timer may cause SAS
107 * specification compliance issues (i.e. SMP target mode response
108 * frames must be returned within 1.9 milliseconds).
110 SCI_WARNING_TIMER_CONFLICT,
113 * This field indicates a sequence of action is not completed yet. Mostly,
114 * this status is used when multiple ATA commands are needed in a SATI translation.
116 SCI_WARNING_SEQUENCE_INCOMPLETE,
119 * This member indicates that there was a general failure.
124 * This member indicates that the SCI implementation is unable to complete
125 * an operation due to a critical flaw the prevents any further operation
126 * (i.e. an invalid pointer).
131 * This member indicates the calling function failed, because the state
132 * of the controller is in a state that prevents successful completion.
134 SCI_FAILURE_INVALID_STATE,
137 * This member indicates the calling function failed, because there is
138 * insufficient resources/memory to complete the request.
140 SCI_FAILURE_INSUFFICIENT_RESOURCES,
143 * This member indicates the calling function failed, because the
144 * controller object required for the operation can't be located.
146 SCI_FAILURE_CONTROLLER_NOT_FOUND,
149 * This member indicates the calling function failed, because the
150 * discovered controller type is not supported by the library.
152 SCI_FAILURE_UNSUPPORTED_CONTROLLER_TYPE,
155 * This member indicates the calling function failed, because the
156 * requested initialization data version isn't supported.
158 SCI_FAILURE_UNSUPPORTED_INIT_DATA_VERSION,
161 * This member indicates the calling function failed, because the
162 * requested configuration of SAS Phys into SAS Ports is not supported.
164 SCI_FAILURE_UNSUPPORTED_PORT_CONFIGURATION,
167 * This member indicates the calling function failed, because the
168 * requested protocol is not supported by the remote device, port,
171 SCI_FAILURE_UNSUPPORTED_PROTOCOL,
174 * This member indicates the calling function failed, because the
175 * requested information type is not supported by the SCI implementation.
177 SCI_FAILURE_UNSUPPORTED_INFORMATION_TYPE,
180 * This member indicates the calling function failed, because the
181 * device already exists.
183 SCI_FAILURE_DEVICE_EXISTS,
186 * This member indicates the calling function failed, because adding
187 * a phy to the object is not possible.
189 SCI_FAILURE_ADDING_PHY_UNSUPPORTED,
192 * This member indicates the calling function failed, because the
193 * requested information type is not supported by the SCI implementation.
195 SCI_FAILURE_UNSUPPORTED_INFORMATION_FIELD,
198 * This member indicates the calling function failed, because the SCI
199 * implementation does not support the supplied time limit.
201 SCI_FAILURE_UNSUPPORTED_TIME_LIMIT,
204 * This member indicates the calling method failed, because the SCI
205 * implementation does not contain the specified Phy.
207 SCI_FAILURE_INVALID_PHY,
210 * This member indicates the calling method failed, because the SCI
211 * implementation does not contain the specified Port.
213 SCI_FAILURE_INVALID_PORT,
216 * This member indicates the calling method was partly successful
217 * The port was reset but not all phys in port are operational
219 SCI_FAILURE_RESET_PORT_PARTIAL_SUCCESS,
222 * This member indicates that calling method failed
223 * The port reset did not complete because none of the phys are operational
225 SCI_FAILURE_RESET_PORT_FAILURE,
228 * This member indicates the calling method failed, because the SCI
229 * implementation does not contain the specified remote device.
231 SCI_FAILURE_INVALID_REMOTE_DEVICE,
234 * This member indicates the calling method failed, because the remote
235 * device is in a bad state and requires a reset.
237 SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED,
240 * This member indicates the calling method failed, because the SCI
241 * implementation does not contain or support the specified IO tag.
243 SCI_FAILURE_INVALID_IO_TAG,
246 * This member indicates that the operation failed and the user should
247 * check the response data associated with the IO.
249 SCI_FAILURE_IO_RESPONSE_VALID,
252 * This member indicates that the operation failed, the failure is
253 * controller implementation specific, and the response data associated
254 * with the request is not valid. You can query for the controller
255 * specific error information via scic_request_get_controller_status()
257 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR,
260 * This member indicated that the operation failed because the
261 * user requested this IO to be terminated.
263 SCI_FAILURE_IO_TERMINATED,
266 * This member indicates that the operation failed and the associated
267 * request requires a SCSI abort task to be sent to the target.
269 SCI_FAILURE_IO_REQUIRES_SCSI_ABORT,
272 * This member indicates that the operation failed because the supplied
273 * device could not be located.
275 SCI_FAILURE_DEVICE_NOT_FOUND,
278 * This member indicates that the operation failed because the
279 * objects association is required and is not correctly set.
281 SCI_FAILURE_INVALID_ASSOCIATION,
284 * This member indicates that the operation failed, because a timeout
290 * This member indicates that the operation failed, because the user
291 * specified a value that is either invalid or not supported.
293 SCI_FAILURE_INVALID_PARAMETER_VALUE,
296 * This value indicates that the operation failed, because the number
297 * of messages (MSI-X) is not supported.
299 SCI_FAILURE_UNSUPPORTED_MESSAGE_COUNT,
302 * This value indicates that the method failed due to a lack of
303 * available NCQ tags.
305 SCI_FAILURE_NO_NCQ_TAG_AVAILABLE,
308 * This value indicates that a protocol violation has occurred on the
311 SCI_FAILURE_PROTOCOL_VIOLATION,
314 * This value indicates a failure condition that retry may help to clear.
316 SCI_FAILURE_RETRY_REQUIRED,
319 * This field indicates the retry limit was reached when a retry is attempted
321 SCI_FAILURE_RETRY_LIMIT_REACHED,
324 * This member indicates the calling method was partly successful.
325 * Mostly, this status is used when a LUN_RESET issued to an expander attached
326 * STP device in READY NCQ substate needs to have RNC suspended/resumed
329 SCI_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS,
332 * This field indicates an illegal phy connection based on the routing attribute
333 * of both expander phy attached to each other.
335 SCI_FAILURE_ILLEGAL_ROUTING_ATTRIBUTE_CONFIGURATION,
338 * This field indicates a CONFIG ROUTE INFO command has a response with function result
339 * INDEX DOES NOT EXIST, usually means exceeding max route index.
341 SCI_FAILURE_EXCEED_MAX_ROUTE_INDEX,
344 * This value indicates that an unsupported PCI device ID has been
345 * specified. This indicates that attempts to invoke
346 * scic_library_allocate_controller() will fail.
348 SCI_FAILURE_UNSUPPORTED_PCI_DEVICE_ID
353 * @enum _SCI_IO_STATUS
354 * @brief This enumeration depicts all of the possible IO completion
355 * status values. Each value in this enumeration maps directly to
356 * a value in the SCI_STATUS enumeration. Please refer to that
357 * enumeration for detailed comments concerning what the status
359 * @todo Add the API to retrieve the SCU status from the core.
360 * @todo Check to see that the following status are properly handled:
361 * - SCI_IO_FAILURE_UNSUPPORTED_PROTOCOL
362 * - SCI_IO_FAILURE_INVALID_IO_TAG
364 typedef enum _SCI_IO_STATUS
366 SCI_IO_SUCCESS = SCI_SUCCESS,
367 SCI_IO_FAILURE = SCI_FAILURE,
368 SCI_IO_SUCCESS_COMPLETE_BEFORE_START = SCI_SUCCESS_IO_COMPLETE_BEFORE_START,
369 SCI_IO_SUCCESS_IO_DONE_EARLY = SCI_SUCCESS_IO_DONE_EARLY,
370 SCI_IO_FAILURE_INVALID_STATE = SCI_FAILURE_INVALID_STATE,
371 SCI_IO_FAILURE_INSUFFICIENT_RESOURCES = SCI_FAILURE_INSUFFICIENT_RESOURCES,
372 SCI_IO_FAILURE_UNSUPPORTED_PROTOCOL = SCI_FAILURE_UNSUPPORTED_PROTOCOL,
373 SCI_IO_FAILURE_RESPONSE_VALID = SCI_FAILURE_IO_RESPONSE_VALID,
374 SCI_IO_FAILURE_CONTROLLER_SPECIFIC_ERR = SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR,
375 SCI_IO_FAILURE_TERMINATED = SCI_FAILURE_IO_TERMINATED,
376 SCI_IO_FAILURE_REQUIRES_SCSI_ABORT = SCI_FAILURE_IO_REQUIRES_SCSI_ABORT,
377 SCI_IO_FAILURE_INVALID_PARAMETER_VALUE = SCI_FAILURE_INVALID_PARAMETER_VALUE,
378 SCI_IO_FAILURE_NO_NCQ_TAG_AVAILABLE = SCI_FAILURE_NO_NCQ_TAG_AVAILABLE,
379 SCI_IO_FAILURE_PROTOCOL_VIOLATION = SCI_FAILURE_PROTOCOL_VIOLATION,
381 SCI_IO_FAILURE_REMOTE_DEVICE_RESET_REQUIRED = SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED,
383 SCI_IO_FAILURE_RETRY_REQUIRED = SCI_FAILURE_RETRY_REQUIRED,
384 SCI_IO_FAILURE_RETRY_LIMIT_REACHED = SCI_FAILURE_RETRY_LIMIT_REACHED,
385 SCI_IO_FAILURE_INVALID_REMOTE_DEVICE = SCI_FAILURE_INVALID_REMOTE_DEVICE
389 * @enum _SCI_TASK_STATUS
390 * @brief This enumeration depicts all of the possible task completion
391 * status values. Each value in this enumeration maps directly to
392 * a value in the SCI_STATUS enumeration. Please refer to that
393 * enumeration for detailed comments concerning what the status
395 * @todo Check to see that the following status are properly handled:
397 typedef enum _SCI_TASK_STATUS
399 SCI_TASK_SUCCESS = SCI_SUCCESS,
400 SCI_TASK_FAILURE = SCI_FAILURE,
401 SCI_TASK_FAILURE_INVALID_STATE = SCI_FAILURE_INVALID_STATE,
402 SCI_TASK_FAILURE_INSUFFICIENT_RESOURCES = SCI_FAILURE_INSUFFICIENT_RESOURCES,
403 SCI_TASK_FAILURE_UNSUPPORTED_PROTOCOL = SCI_FAILURE_UNSUPPORTED_PROTOCOL,
404 SCI_TASK_FAILURE_INVALID_TAG = SCI_FAILURE_INVALID_IO_TAG,
405 SCI_TASK_FAILURE_RESPONSE_VALID = SCI_FAILURE_IO_RESPONSE_VALID,
406 SCI_TASK_FAILURE_CONTROLLER_SPECIFIC_ERR = SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR,
407 SCI_TASK_FAILURE_TERMINATED = SCI_FAILURE_IO_TERMINATED,
408 SCI_TASK_FAILURE_INVALID_PARAMETER_VALUE = SCI_FAILURE_INVALID_PARAMETER_VALUE,
410 SCI_TASK_FAILURE_REMOTE_DEVICE_RESET_REQUIRED = SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED,
411 SCI_TASK_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS = SCI_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS
417 #endif // __cplusplus
419 #endif // _SCI_STATUS_H_