sci_status.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  1. /*
  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.
  4. *
  5. * GPL LICENSE SUMMARY
  6. *
  7. * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
  8. *
  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.
  12. *
  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.
  17. *
  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.
  23. *
  24. * BSD LICENSE
  25. *
  26. * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
  27. * All rights reserved.
  28. *
  29. * Redistribution and use in source and binary forms, with or without
  30. * modification, are permitted provided that the following conditions
  31. * are met:
  32. *
  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
  38. * distribution.
  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.
  42. *
  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.
  54. */
  55. #ifndef _SCI_STATUS_H_
  56. #define _SCI_STATUS_H_
  57. /**
  58. * This file contains all of the return status codes utilized across the
  59. * various sub-components in SCI.
  60. *
  61. *
  62. */
  63. /**
  64. * enum sci_status - This is the general return status enumeration for non-IO,
  65. * non-task management related SCI interface methods.
  66. *
  67. *
  68. */
  69. enum sci_status {
  70. /**
  71. * This member indicates successful completion.
  72. */
  73. SCI_SUCCESS = 0,
  74. /**
  75. * This value indicates that the calling method completed successfully,
  76. * but that the IO may have completed before having it's start method
  77. * invoked. This occurs during SAT translation for requests that do
  78. * not require an IO to the target or for any other requests that may
  79. * be completed without having to submit IO.
  80. */
  81. SCI_SUCCESS_IO_COMPLETE_BEFORE_START,
  82. /**
  83. * This Value indicates that the SCU hardware returned an early response
  84. * because the io request specified more data than is returned by the
  85. * target device (mode pages, inquiry data, etc.). The completion routine
  86. * will handle this case to get the actual number of bytes transferred.
  87. */
  88. SCI_SUCCESS_IO_DONE_EARLY,
  89. /**
  90. * This member indicates that the object for which a state change is
  91. * being requested is already in said state.
  92. */
  93. SCI_WARNING_ALREADY_IN_STATE,
  94. /**
  95. * This member indicates interrupt coalescence timer may cause SAS
  96. * specification compliance issues (i.e. SMP target mode response
  97. * frames must be returned within 1.9 milliseconds).
  98. */
  99. SCI_WARNING_TIMER_CONFLICT,
  100. /**
  101. * This field indicates a sequence of action is not completed yet. Mostly,
  102. * this status is used when multiple ATA commands are needed in a SATI translation.
  103. */
  104. SCI_WARNING_SEQUENCE_INCOMPLETE,
  105. /**
  106. * This member indicates that there was a general failure.
  107. */
  108. SCI_FAILURE,
  109. /**
  110. * This member indicates that the SCI implementation is unable to complete
  111. * an operation due to a critical flaw the prevents any further operation
  112. * (i.e. an invalid pointer).
  113. */
  114. SCI_FATAL_ERROR,
  115. /**
  116. * This member indicates the calling function failed, because the state
  117. * of the controller is in a state that prevents successful completion.
  118. */
  119. SCI_FAILURE_INVALID_STATE,
  120. /**
  121. * This member indicates the calling function failed, because there is
  122. * insufficient resources/memory to complete the request.
  123. */
  124. SCI_FAILURE_INSUFFICIENT_RESOURCES,
  125. /**
  126. * This member indicates the calling function failed, because the
  127. * controller object required for the operation can't be located.
  128. */
  129. SCI_FAILURE_CONTROLLER_NOT_FOUND,
  130. /**
  131. * This member indicates the calling function failed, because the
  132. * discovered controller type is not supported by the library.
  133. */
  134. SCI_FAILURE_UNSUPPORTED_CONTROLLER_TYPE,
  135. /**
  136. * This member indicates the calling function failed, because the
  137. * requested initialization data version isn't supported.
  138. */
  139. SCI_FAILURE_UNSUPPORTED_INIT_DATA_VERSION,
  140. /**
  141. * This member indicates the calling function failed, because the
  142. * requested configuration of SAS Phys into SAS Ports is not supported.
  143. */
  144. SCI_FAILURE_UNSUPPORTED_PORT_CONFIGURATION,
  145. /**
  146. * This member indicates the calling function failed, because the
  147. * requested protocol is not supported by the remote device, port,
  148. * or controller.
  149. */
  150. SCI_FAILURE_UNSUPPORTED_PROTOCOL,
  151. /**
  152. * This member indicates the calling function failed, because the
  153. * requested information type is not supported by the SCI implementation.
  154. */
  155. SCI_FAILURE_UNSUPPORTED_INFORMATION_TYPE,
  156. /**
  157. * This member indicates the calling function failed, because the
  158. * device already exists.
  159. */
  160. SCI_FAILURE_DEVICE_EXISTS,
  161. /**
  162. * This member indicates the calling function failed, because adding
  163. * a phy to the object is not possible.
  164. */
  165. SCI_FAILURE_ADDING_PHY_UNSUPPORTED,
  166. /**
  167. * This member indicates the calling function failed, because the
  168. * requested information type is not supported by the SCI implementation.
  169. */
  170. SCI_FAILURE_UNSUPPORTED_INFORMATION_FIELD,
  171. /**
  172. * This member indicates the calling function failed, because the SCI
  173. * implementation does not support the supplied time limit.
  174. */
  175. SCI_FAILURE_UNSUPPORTED_TIME_LIMIT,
  176. /**
  177. * This member indicates the calling method failed, because the SCI
  178. * implementation does not contain the specified Phy.
  179. */
  180. SCI_FAILURE_INVALID_PHY,
  181. /**
  182. * This member indicates the calling method failed, because the SCI
  183. * implementation does not contain the specified Port.
  184. */
  185. SCI_FAILURE_INVALID_PORT,
  186. /**
  187. * This member indicates the calling method was partly successful
  188. * The port was reset but not all phys in port are operational
  189. */
  190. SCI_FAILURE_RESET_PORT_PARTIAL_SUCCESS,
  191. /**
  192. * This member indicates that calling method failed
  193. * The port reset did not complete because none of the phys are operational
  194. */
  195. SCI_FAILURE_RESET_PORT_FAILURE,
  196. /**
  197. * This member indicates the calling method failed, because the SCI
  198. * implementation does not contain the specified remote device.
  199. */
  200. SCI_FAILURE_INVALID_REMOTE_DEVICE,
  201. /**
  202. * This member indicates the calling method failed, because the remote
  203. * device is in a bad state and requires a reset.
  204. */
  205. SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED,
  206. /**
  207. * This member indicates the calling method failed, because the SCI
  208. * implementation does not contain or support the specified IO tag.
  209. */
  210. SCI_FAILURE_INVALID_IO_TAG,
  211. /**
  212. * This member indicates that the operation failed and the user should
  213. * check the response data associated with the IO.
  214. */
  215. SCI_FAILURE_IO_RESPONSE_VALID,
  216. /**
  217. * This member indicates that the operation failed, the failure is
  218. * controller implementation specific, and the response data associated
  219. * with the request is not valid. You can query for the controller
  220. * specific error information via scic_controller_get_request_status()
  221. */
  222. SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR,
  223. /**
  224. * This member indicated that the operation failed because the
  225. * user requested this IO to be terminated.
  226. */
  227. SCI_FAILURE_IO_TERMINATED,
  228. /**
  229. * This member indicates that the operation failed and the associated
  230. * request requires a SCSI abort task to be sent to the target.
  231. */
  232. SCI_FAILURE_IO_REQUIRES_SCSI_ABORT,
  233. /**
  234. * This member indicates that the operation failed because the supplied
  235. * device could not be located.
  236. */
  237. SCI_FAILURE_DEVICE_NOT_FOUND,
  238. /**
  239. * This member indicates that the operation failed because the
  240. * objects association is required and is not correctly set.
  241. */
  242. SCI_FAILURE_INVALID_ASSOCIATION,
  243. /**
  244. * This member indicates that the operation failed, because a timeout
  245. * occurred.
  246. */
  247. SCI_FAILURE_TIMEOUT,
  248. /**
  249. * This member indicates that the operation failed, because the user
  250. * specified a value that is either invalid or not supported.
  251. */
  252. SCI_FAILURE_INVALID_PARAMETER_VALUE,
  253. /**
  254. * This value indicates that the operation failed, because the number
  255. * of messages (MSI-X) is not supported.
  256. */
  257. SCI_FAILURE_UNSUPPORTED_MESSAGE_COUNT,
  258. /**
  259. * This value indicates that the method failed due to a lack of
  260. * available NCQ tags.
  261. */
  262. SCI_FAILURE_NO_NCQ_TAG_AVAILABLE,
  263. /**
  264. * This value indicates that a protocol violation has occurred on the
  265. * link.
  266. */
  267. SCI_FAILURE_PROTOCOL_VIOLATION,
  268. /**
  269. * This value indicates a failure condition that retry may help to clear.
  270. */
  271. SCI_FAILURE_RETRY_REQUIRED,
  272. /**
  273. * This field indicates the retry limit was reached when a retry is attempted
  274. */
  275. SCI_FAILURE_RETRY_LIMIT_REACHED,
  276. /**
  277. * This member indicates the calling method was partly successful.
  278. * Mostly, this status is used when a LUN_RESET issued to an expander attached
  279. * STP device in READY NCQ substate needs to have RNC suspended/resumed
  280. * before posting TC.
  281. */
  282. SCI_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS,
  283. /**
  284. * This field indicates an illegal phy connection based on the routing attribute
  285. * of both expander phy attached to each other.
  286. */
  287. SCI_FAILURE_ILLEGAL_ROUTING_ATTRIBUTE_CONFIGURATION,
  288. /**
  289. * This field indicates a CONFIG ROUTE INFO command has a response with function result
  290. * INDEX DOES NOT EXIST, usually means exceeding max route index.
  291. */
  292. SCI_FAILURE_EXCEED_MAX_ROUTE_INDEX,
  293. /**
  294. * This value indicates that an unsupported PCI device ID has been
  295. * specified. This indicates that attempts to invoke
  296. * scic_library_allocate_controller() will fail.
  297. */
  298. SCI_FAILURE_UNSUPPORTED_PCI_DEVICE_ID
  299. };
  300. /**
  301. * enum sci_io_status - This enumeration depicts all of the possible IO
  302. * completion status values. Each value in this enumeration maps directly
  303. * to a value in the enum sci_status enumeration. Please refer to that
  304. * enumeration for detailed comments concerning what the status represents.
  305. *
  306. * Add the API to retrieve the SCU status from the core. Check to see that the
  307. * following status are properly handled: - SCI_IO_FAILURE_UNSUPPORTED_PROTOCOL
  308. * - SCI_IO_FAILURE_INVALID_IO_TAG
  309. */
  310. enum sci_io_status {
  311. SCI_IO_SUCCESS = SCI_SUCCESS,
  312. SCI_IO_FAILURE = SCI_FAILURE,
  313. SCI_IO_SUCCESS_COMPLETE_BEFORE_START = SCI_SUCCESS_IO_COMPLETE_BEFORE_START,
  314. SCI_IO_SUCCESS_IO_DONE_EARLY = SCI_SUCCESS_IO_DONE_EARLY,
  315. SCI_IO_FAILURE_INVALID_STATE = SCI_FAILURE_INVALID_STATE,
  316. SCI_IO_FAILURE_INSUFFICIENT_RESOURCES = SCI_FAILURE_INSUFFICIENT_RESOURCES,
  317. SCI_IO_FAILURE_UNSUPPORTED_PROTOCOL = SCI_FAILURE_UNSUPPORTED_PROTOCOL,
  318. SCI_IO_FAILURE_RESPONSE_VALID = SCI_FAILURE_IO_RESPONSE_VALID,
  319. SCI_IO_FAILURE_CONTROLLER_SPECIFIC_ERR = SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR,
  320. SCI_IO_FAILURE_TERMINATED = SCI_FAILURE_IO_TERMINATED,
  321. SCI_IO_FAILURE_REQUIRES_SCSI_ABORT = SCI_FAILURE_IO_REQUIRES_SCSI_ABORT,
  322. SCI_IO_FAILURE_INVALID_PARAMETER_VALUE = SCI_FAILURE_INVALID_PARAMETER_VALUE,
  323. SCI_IO_FAILURE_NO_NCQ_TAG_AVAILABLE = SCI_FAILURE_NO_NCQ_TAG_AVAILABLE,
  324. SCI_IO_FAILURE_PROTOCOL_VIOLATION = SCI_FAILURE_PROTOCOL_VIOLATION,
  325. SCI_IO_FAILURE_REMOTE_DEVICE_RESET_REQUIRED = SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED,
  326. SCI_IO_FAILURE_RETRY_REQUIRED = SCI_FAILURE_RETRY_REQUIRED,
  327. SCI_IO_FAILURE_RETRY_LIMIT_REACHED = SCI_FAILURE_RETRY_LIMIT_REACHED,
  328. SCI_IO_FAILURE_INVALID_REMOTE_DEVICE = SCI_FAILURE_INVALID_REMOTE_DEVICE
  329. };
  330. /**
  331. * enum sci_task_status - This enumeration depicts all of the possible task
  332. * completion status values. Each value in this enumeration maps directly
  333. * to a value in the enum sci_status enumeration. Please refer to that
  334. * enumeration for detailed comments concerning what the status represents.
  335. *
  336. * Check to see that the following status are properly handled:
  337. */
  338. enum sci_task_status {
  339. SCI_TASK_SUCCESS = SCI_SUCCESS,
  340. SCI_TASK_FAILURE = SCI_FAILURE,
  341. SCI_TASK_FAILURE_INVALID_STATE = SCI_FAILURE_INVALID_STATE,
  342. SCI_TASK_FAILURE_INSUFFICIENT_RESOURCES = SCI_FAILURE_INSUFFICIENT_RESOURCES,
  343. SCI_TASK_FAILURE_UNSUPPORTED_PROTOCOL = SCI_FAILURE_UNSUPPORTED_PROTOCOL,
  344. SCI_TASK_FAILURE_INVALID_TAG = SCI_FAILURE_INVALID_IO_TAG,
  345. SCI_TASK_FAILURE_RESPONSE_VALID = SCI_FAILURE_IO_RESPONSE_VALID,
  346. SCI_TASK_FAILURE_CONTROLLER_SPECIFIC_ERR = SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR,
  347. SCI_TASK_FAILURE_TERMINATED = SCI_FAILURE_IO_TERMINATED,
  348. SCI_TASK_FAILURE_INVALID_PARAMETER_VALUE = SCI_FAILURE_INVALID_PARAMETER_VALUE,
  349. SCI_TASK_FAILURE_REMOTE_DEVICE_RESET_REQUIRED = SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED,
  350. SCI_TASK_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS = SCI_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS
  351. };
  352. #endif /* _SCI_STATUS_H_ */