isci.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541
  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 __ISCI_H__
  56. #define __ISCI_H__
  57. #include <linux/interrupt.h>
  58. #define DRV_NAME "isci"
  59. #define SCI_PCI_BAR_COUNT 2
  60. #define SCI_NUM_MSI_X_INT 2
  61. #define SCI_SMU_BAR 0
  62. #define SCI_SMU_BAR_SIZE (16*1024)
  63. #define SCI_SCU_BAR 1
  64. #define SCI_SCU_BAR_SIZE (4*1024*1024)
  65. #define SCI_IO_SPACE_BAR0 2
  66. #define SCI_IO_SPACE_BAR1 3
  67. #define ISCI_CAN_QUEUE_VAL 250 /* < SCI_MAX_IO_REQUESTS ? */
  68. #define SCIC_CONTROLLER_STOP_TIMEOUT 5000
  69. #define SCI_CONTROLLER_INVALID_IO_TAG 0xFFFF
  70. enum sci_controller_mode {
  71. SCI_MODE_SPEED,
  72. SCI_MODE_SIZE /* deprecated */
  73. };
  74. #define SCI_MAX_PHYS (4)
  75. #define SCI_MAX_PORTS SCI_MAX_PHYS
  76. #define SCI_MIN_SMP_PHYS (38)
  77. #define SCI_MAX_SMP_PHYS (384) /* not silicon constrained */
  78. #define SCI_MAX_REMOTE_DEVICES (256)
  79. #define SCI_MIN_REMOTE_DEVICES (16)
  80. #define SCI_MAX_IO_REQUESTS (256)
  81. #define SCI_MIN_IO_REQUESTS (1)
  82. #define SCI_MAX_MSIX_MESSAGES (2)
  83. #define SCI_MAX_SCATTER_GATHER_ELEMENTS 130 /* not silicon constrained */
  84. #define SCI_MIN_SCATTER_GATHER_ELEMENTS 1
  85. #define SCI_MAX_CONTROLLERS 2
  86. #define SCI_MAX_DOMAINS SCI_MAX_PORTS
  87. /* 2 indicates the maximum number of UFs that can occur for a given IO request.
  88. * The hardware handles reception of additional unsolicited frames while all
  89. * UFs are in use, by holding off the transmitting device. This number could
  90. * be theoretically reduced to 1, but 2 provides for more reliable operation.
  91. * During SATA PIO operation, it is possible under some conditions for there to
  92. * be 3 separate FISes received, back to back to back (PIO Setup, Data, D2H
  93. * Register). It is unlikely to have all 3 pending all at once without some of
  94. * them already being processed.
  95. */
  96. #define SCU_MIN_UNSOLICITED_FRAMES (1)
  97. #define SCU_MIN_CRITICAL_NOTIFICATIONS (24)
  98. #define SCU_MIN_EVENTS (4)
  99. #define SCU_MIN_COMPLETION_QUEUE_SCRATCH (2)
  100. #define SCU_MIN_COMPLETION_QUEUE_ENTRIES (SCU_MIN_CRITICAL_NOTIFICATIONS \
  101. + SCU_MIN_EVENTS \
  102. + SCU_MIN_UNSOLICITED_FRAMES \
  103. + SCI_MIN_IO_REQUESTS \
  104. + SCU_MIN_COMPLETION_QUEUE_SCRATCH)
  105. #define SCU_MAX_CRITICAL_NOTIFICATIONS (384)
  106. #define SCU_MAX_EVENTS (128)
  107. #define SCU_MAX_UNSOLICITED_FRAMES (128)
  108. #define SCU_MAX_COMPLETION_QUEUE_SCRATCH (128)
  109. #define SCU_MAX_COMPLETION_QUEUE_ENTRIES (SCU_MAX_CRITICAL_NOTIFICATIONS \
  110. + SCU_MAX_EVENTS \
  111. + SCU_MAX_UNSOLICITED_FRAMES \
  112. + SCI_MAX_IO_REQUESTS \
  113. + SCU_MAX_COMPLETION_QUEUE_SCRATCH)
  114. #if !defined(ENABLE_MINIMUM_MEMORY_MODE)
  115. #define SCU_UNSOLICITED_FRAME_COUNT SCU_MAX_UNSOLICITED_FRAMES
  116. #define SCU_CRITICAL_NOTIFICATION_COUNT SCU_MAX_CRITICAL_NOTIFICATIONS
  117. #define SCU_EVENT_COUNT SCU_MAX_EVENTS
  118. #define SCU_COMPLETION_QUEUE_SCRATCH SCU_MAX_COMPLETION_QUEUE_SCRATCH
  119. #define SCU_IO_REQUEST_COUNT SCI_MAX_IO_REQUESTS
  120. #define SCU_IO_REQUEST_SGE_COUNT SCI_MAX_SCATTER_GATHER_ELEMENTS
  121. #define SCU_COMPLETION_QUEUE_COUNT SCU_MAX_COMPLETION_QUEUE_ENTRIES
  122. #else
  123. #define SCU_UNSOLICITED_FRAME_COUNT SCU_MIN_UNSOLICITED_FRAMES
  124. #define SCU_CRITICAL_NOTIFICATION_COUNT SCU_MIN_CRITICAL_NOTIFICATIONS
  125. #define SCU_EVENT_COUNT SCU_MIN_EVENTS
  126. #define SCU_COMPLETION_QUEUE_SCRATCH SCU_MIN_COMPLETION_QUEUE_SCRATCH
  127. #define SCU_IO_REQUEST_COUNT SCI_MIN_IO_REQUESTS
  128. #define SCU_IO_REQUEST_SGE_COUNT SCI_MIN_SCATTER_GATHER_ELEMENTS
  129. #define SCU_COMPLETION_QUEUE_COUNT SCU_MIN_COMPLETION_QUEUE_ENTRIES
  130. #endif /* !defined(ENABLE_MINIMUM_MEMORY_OPERATION) */
  131. /**
  132. *
  133. *
  134. * The SCU_COMPLETION_QUEUE_COUNT constant indicates the size of the completion
  135. * queue into which the hardware DMAs 32-bit quantas (completion entries).
  136. */
  137. /**
  138. *
  139. *
  140. * This queue must be programmed to a power of 2 size (e.g. 32, 64, 1024, etc.).
  141. */
  142. #if (SCU_COMPLETION_QUEUE_COUNT != 16) && \
  143. (SCU_COMPLETION_QUEUE_COUNT != 32) && \
  144. (SCU_COMPLETION_QUEUE_COUNT != 64) && \
  145. (SCU_COMPLETION_QUEUE_COUNT != 128) && \
  146. (SCU_COMPLETION_QUEUE_COUNT != 256) && \
  147. (SCU_COMPLETION_QUEUE_COUNT != 512) && \
  148. (SCU_COMPLETION_QUEUE_COUNT != 1024)
  149. #error "SCU_COMPLETION_QUEUE_COUNT must be set to a power of 2."
  150. #endif
  151. #if SCU_MIN_UNSOLICITED_FRAMES > SCU_MAX_UNSOLICITED_FRAMES
  152. #error "Invalid configuration of unsolicited frame constants"
  153. #endif /* SCU_MIN_UNSOLICITED_FRAMES > SCU_MAX_UNSOLICITED_FRAMES */
  154. #define SCU_MIN_UF_TABLE_ENTRIES (8)
  155. #define SCU_ABSOLUTE_MAX_UNSOLICITED_FRAMES (4096)
  156. #define SCU_UNSOLICITED_FRAME_BUFFER_SIZE (1024)
  157. #define SCU_INVALID_FRAME_INDEX (0xFFFF)
  158. #define SCU_IO_REQUEST_MAX_SGE_SIZE (0x00FFFFFF)
  159. #define SCU_IO_REQUEST_MAX_TRANSFER_LENGTH (0x00FFFFFF)
  160. /*
  161. * Determine the size of the unsolicited frame array including
  162. * unused buffers. */
  163. #if SCU_UNSOLICITED_FRAME_COUNT <= SCU_MIN_UF_TABLE_ENTRIES
  164. #define SCU_UNSOLICITED_FRAME_CONTROL_ARRAY_SIZE SCU_MIN_UF_TABLE_ENTRIES
  165. #else
  166. #define SCU_UNSOLICITED_FRAME_CONTROL_ARRAY_SIZE SCU_MAX_UNSOLICITED_FRAMES
  167. #endif /* SCU_UNSOLICITED_FRAME_COUNT <= SCU_MIN_UF_TABLE_ENTRIES */
  168. /**
  169. * enum sci_status - This is the general return status enumeration for non-IO,
  170. * non-task management related SCI interface methods.
  171. *
  172. *
  173. */
  174. enum sci_status {
  175. /**
  176. * This member indicates successful completion.
  177. */
  178. SCI_SUCCESS = 0,
  179. /**
  180. * This value indicates that the calling method completed successfully,
  181. * but that the IO may have completed before having it's start method
  182. * invoked. This occurs during SAT translation for requests that do
  183. * not require an IO to the target or for any other requests that may
  184. * be completed without having to submit IO.
  185. */
  186. SCI_SUCCESS_IO_COMPLETE_BEFORE_START,
  187. /**
  188. * This Value indicates that the SCU hardware returned an early response
  189. * because the io request specified more data than is returned by the
  190. * target device (mode pages, inquiry data, etc.). The completion routine
  191. * will handle this case to get the actual number of bytes transferred.
  192. */
  193. SCI_SUCCESS_IO_DONE_EARLY,
  194. /**
  195. * This member indicates that the object for which a state change is
  196. * being requested is already in said state.
  197. */
  198. SCI_WARNING_ALREADY_IN_STATE,
  199. /**
  200. * This member indicates interrupt coalescence timer may cause SAS
  201. * specification compliance issues (i.e. SMP target mode response
  202. * frames must be returned within 1.9 milliseconds).
  203. */
  204. SCI_WARNING_TIMER_CONFLICT,
  205. /**
  206. * This field indicates a sequence of action is not completed yet. Mostly,
  207. * this status is used when multiple ATA commands are needed in a SATI translation.
  208. */
  209. SCI_WARNING_SEQUENCE_INCOMPLETE,
  210. /**
  211. * This member indicates that there was a general failure.
  212. */
  213. SCI_FAILURE,
  214. /**
  215. * This member indicates that the SCI implementation is unable to complete
  216. * an operation due to a critical flaw the prevents any further operation
  217. * (i.e. an invalid pointer).
  218. */
  219. SCI_FATAL_ERROR,
  220. /**
  221. * This member indicates the calling function failed, because the state
  222. * of the controller is in a state that prevents successful completion.
  223. */
  224. SCI_FAILURE_INVALID_STATE,
  225. /**
  226. * This member indicates the calling function failed, because there is
  227. * insufficient resources/memory to complete the request.
  228. */
  229. SCI_FAILURE_INSUFFICIENT_RESOURCES,
  230. /**
  231. * This member indicates the calling function failed, because the
  232. * controller object required for the operation can't be located.
  233. */
  234. SCI_FAILURE_CONTROLLER_NOT_FOUND,
  235. /**
  236. * This member indicates the calling function failed, because the
  237. * discovered controller type is not supported by the library.
  238. */
  239. SCI_FAILURE_UNSUPPORTED_CONTROLLER_TYPE,
  240. /**
  241. * This member indicates the calling function failed, because the
  242. * requested initialization data version isn't supported.
  243. */
  244. SCI_FAILURE_UNSUPPORTED_INIT_DATA_VERSION,
  245. /**
  246. * This member indicates the calling function failed, because the
  247. * requested configuration of SAS Phys into SAS Ports is not supported.
  248. */
  249. SCI_FAILURE_UNSUPPORTED_PORT_CONFIGURATION,
  250. /**
  251. * This member indicates the calling function failed, because the
  252. * requested protocol is not supported by the remote device, port,
  253. * or controller.
  254. */
  255. SCI_FAILURE_UNSUPPORTED_PROTOCOL,
  256. /**
  257. * This member indicates the calling function failed, because the
  258. * requested information type is not supported by the SCI implementation.
  259. */
  260. SCI_FAILURE_UNSUPPORTED_INFORMATION_TYPE,
  261. /**
  262. * This member indicates the calling function failed, because the
  263. * device already exists.
  264. */
  265. SCI_FAILURE_DEVICE_EXISTS,
  266. /**
  267. * This member indicates the calling function failed, because adding
  268. * a phy to the object is not possible.
  269. */
  270. SCI_FAILURE_ADDING_PHY_UNSUPPORTED,
  271. /**
  272. * This member indicates the calling function failed, because the
  273. * requested information type is not supported by the SCI implementation.
  274. */
  275. SCI_FAILURE_UNSUPPORTED_INFORMATION_FIELD,
  276. /**
  277. * This member indicates the calling function failed, because the SCI
  278. * implementation does not support the supplied time limit.
  279. */
  280. SCI_FAILURE_UNSUPPORTED_TIME_LIMIT,
  281. /**
  282. * This member indicates the calling method failed, because the SCI
  283. * implementation does not contain the specified Phy.
  284. */
  285. SCI_FAILURE_INVALID_PHY,
  286. /**
  287. * This member indicates the calling method failed, because the SCI
  288. * implementation does not contain the specified Port.
  289. */
  290. SCI_FAILURE_INVALID_PORT,
  291. /**
  292. * This member indicates the calling method was partly successful
  293. * The port was reset but not all phys in port are operational
  294. */
  295. SCI_FAILURE_RESET_PORT_PARTIAL_SUCCESS,
  296. /**
  297. * This member indicates that calling method failed
  298. * The port reset did not complete because none of the phys are operational
  299. */
  300. SCI_FAILURE_RESET_PORT_FAILURE,
  301. /**
  302. * This member indicates the calling method failed, because the SCI
  303. * implementation does not contain the specified remote device.
  304. */
  305. SCI_FAILURE_INVALID_REMOTE_DEVICE,
  306. /**
  307. * This member indicates the calling method failed, because the remote
  308. * device is in a bad state and requires a reset.
  309. */
  310. SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED,
  311. /**
  312. * This member indicates the calling method failed, because the SCI
  313. * implementation does not contain or support the specified IO tag.
  314. */
  315. SCI_FAILURE_INVALID_IO_TAG,
  316. /**
  317. * This member indicates that the operation failed and the user should
  318. * check the response data associated with the IO.
  319. */
  320. SCI_FAILURE_IO_RESPONSE_VALID,
  321. /**
  322. * This member indicates that the operation failed, the failure is
  323. * controller implementation specific, and the response data associated
  324. * with the request is not valid. You can query for the controller
  325. * specific error information via scic_controller_get_request_status()
  326. */
  327. SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR,
  328. /**
  329. * This member indicated that the operation failed because the
  330. * user requested this IO to be terminated.
  331. */
  332. SCI_FAILURE_IO_TERMINATED,
  333. /**
  334. * This member indicates that the operation failed and the associated
  335. * request requires a SCSI abort task to be sent to the target.
  336. */
  337. SCI_FAILURE_IO_REQUIRES_SCSI_ABORT,
  338. /**
  339. * This member indicates that the operation failed because the supplied
  340. * device could not be located.
  341. */
  342. SCI_FAILURE_DEVICE_NOT_FOUND,
  343. /**
  344. * This member indicates that the operation failed because the
  345. * objects association is required and is not correctly set.
  346. */
  347. SCI_FAILURE_INVALID_ASSOCIATION,
  348. /**
  349. * This member indicates that the operation failed, because a timeout
  350. * occurred.
  351. */
  352. SCI_FAILURE_TIMEOUT,
  353. /**
  354. * This member indicates that the operation failed, because the user
  355. * specified a value that is either invalid or not supported.
  356. */
  357. SCI_FAILURE_INVALID_PARAMETER_VALUE,
  358. /**
  359. * This value indicates that the operation failed, because the number
  360. * of messages (MSI-X) is not supported.
  361. */
  362. SCI_FAILURE_UNSUPPORTED_MESSAGE_COUNT,
  363. /**
  364. * This value indicates that the method failed due to a lack of
  365. * available NCQ tags.
  366. */
  367. SCI_FAILURE_NO_NCQ_TAG_AVAILABLE,
  368. /**
  369. * This value indicates that a protocol violation has occurred on the
  370. * link.
  371. */
  372. SCI_FAILURE_PROTOCOL_VIOLATION,
  373. /**
  374. * This value indicates a failure condition that retry may help to clear.
  375. */
  376. SCI_FAILURE_RETRY_REQUIRED,
  377. /**
  378. * This field indicates the retry limit was reached when a retry is attempted
  379. */
  380. SCI_FAILURE_RETRY_LIMIT_REACHED,
  381. /**
  382. * This member indicates the calling method was partly successful.
  383. * Mostly, this status is used when a LUN_RESET issued to an expander attached
  384. * STP device in READY NCQ substate needs to have RNC suspended/resumed
  385. * before posting TC.
  386. */
  387. SCI_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS,
  388. /**
  389. * This field indicates an illegal phy connection based on the routing attribute
  390. * of both expander phy attached to each other.
  391. */
  392. SCI_FAILURE_ILLEGAL_ROUTING_ATTRIBUTE_CONFIGURATION,
  393. /**
  394. * This field indicates a CONFIG ROUTE INFO command has a response with function result
  395. * INDEX DOES NOT EXIST, usually means exceeding max route index.
  396. */
  397. SCI_FAILURE_EXCEED_MAX_ROUTE_INDEX,
  398. /**
  399. * This value indicates that an unsupported PCI device ID has been
  400. * specified. This indicates that attempts to invoke
  401. * scic_library_allocate_controller() will fail.
  402. */
  403. SCI_FAILURE_UNSUPPORTED_PCI_DEVICE_ID
  404. };
  405. /**
  406. * enum sci_io_status - This enumeration depicts all of the possible IO
  407. * completion status values. Each value in this enumeration maps directly
  408. * to a value in the enum sci_status enumeration. Please refer to that
  409. * enumeration for detailed comments concerning what the status represents.
  410. *
  411. * Add the API to retrieve the SCU status from the core. Check to see that the
  412. * following status are properly handled: - SCI_IO_FAILURE_UNSUPPORTED_PROTOCOL
  413. * - SCI_IO_FAILURE_INVALID_IO_TAG
  414. */
  415. enum sci_io_status {
  416. SCI_IO_SUCCESS = SCI_SUCCESS,
  417. SCI_IO_FAILURE = SCI_FAILURE,
  418. SCI_IO_SUCCESS_COMPLETE_BEFORE_START = SCI_SUCCESS_IO_COMPLETE_BEFORE_START,
  419. SCI_IO_SUCCESS_IO_DONE_EARLY = SCI_SUCCESS_IO_DONE_EARLY,
  420. SCI_IO_FAILURE_INVALID_STATE = SCI_FAILURE_INVALID_STATE,
  421. SCI_IO_FAILURE_INSUFFICIENT_RESOURCES = SCI_FAILURE_INSUFFICIENT_RESOURCES,
  422. SCI_IO_FAILURE_UNSUPPORTED_PROTOCOL = SCI_FAILURE_UNSUPPORTED_PROTOCOL,
  423. SCI_IO_FAILURE_RESPONSE_VALID = SCI_FAILURE_IO_RESPONSE_VALID,
  424. SCI_IO_FAILURE_CONTROLLER_SPECIFIC_ERR = SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR,
  425. SCI_IO_FAILURE_TERMINATED = SCI_FAILURE_IO_TERMINATED,
  426. SCI_IO_FAILURE_REQUIRES_SCSI_ABORT = SCI_FAILURE_IO_REQUIRES_SCSI_ABORT,
  427. SCI_IO_FAILURE_INVALID_PARAMETER_VALUE = SCI_FAILURE_INVALID_PARAMETER_VALUE,
  428. SCI_IO_FAILURE_NO_NCQ_TAG_AVAILABLE = SCI_FAILURE_NO_NCQ_TAG_AVAILABLE,
  429. SCI_IO_FAILURE_PROTOCOL_VIOLATION = SCI_FAILURE_PROTOCOL_VIOLATION,
  430. SCI_IO_FAILURE_REMOTE_DEVICE_RESET_REQUIRED = SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED,
  431. SCI_IO_FAILURE_RETRY_REQUIRED = SCI_FAILURE_RETRY_REQUIRED,
  432. SCI_IO_FAILURE_RETRY_LIMIT_REACHED = SCI_FAILURE_RETRY_LIMIT_REACHED,
  433. SCI_IO_FAILURE_INVALID_REMOTE_DEVICE = SCI_FAILURE_INVALID_REMOTE_DEVICE
  434. };
  435. /**
  436. * enum sci_task_status - This enumeration depicts all of the possible task
  437. * completion status values. Each value in this enumeration maps directly
  438. * to a value in the enum sci_status enumeration. Please refer to that
  439. * enumeration for detailed comments concerning what the status represents.
  440. *
  441. * Check to see that the following status are properly handled:
  442. */
  443. enum sci_task_status {
  444. SCI_TASK_SUCCESS = SCI_SUCCESS,
  445. SCI_TASK_FAILURE = SCI_FAILURE,
  446. SCI_TASK_FAILURE_INVALID_STATE = SCI_FAILURE_INVALID_STATE,
  447. SCI_TASK_FAILURE_INSUFFICIENT_RESOURCES = SCI_FAILURE_INSUFFICIENT_RESOURCES,
  448. SCI_TASK_FAILURE_UNSUPPORTED_PROTOCOL = SCI_FAILURE_UNSUPPORTED_PROTOCOL,
  449. SCI_TASK_FAILURE_INVALID_TAG = SCI_FAILURE_INVALID_IO_TAG,
  450. SCI_TASK_FAILURE_RESPONSE_VALID = SCI_FAILURE_IO_RESPONSE_VALID,
  451. SCI_TASK_FAILURE_CONTROLLER_SPECIFIC_ERR = SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR,
  452. SCI_TASK_FAILURE_TERMINATED = SCI_FAILURE_IO_TERMINATED,
  453. SCI_TASK_FAILURE_INVALID_PARAMETER_VALUE = SCI_FAILURE_INVALID_PARAMETER_VALUE,
  454. SCI_TASK_FAILURE_REMOTE_DEVICE_RESET_REQUIRED = SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED,
  455. SCI_TASK_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS = SCI_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS
  456. };
  457. extern unsigned char no_outbound_task_to;
  458. extern u16 ssp_max_occ_to;
  459. extern u16 stp_max_occ_to;
  460. extern u16 ssp_inactive_to;
  461. extern u16 stp_inactive_to;
  462. extern unsigned char phy_gen;
  463. extern unsigned char max_concurr_spinup;
  464. irqreturn_t isci_msix_isr(int vec, void *data);
  465. irqreturn_t isci_intx_isr(int vec, void *data);
  466. irqreturn_t isci_error_isr(int vec, void *data);
  467. struct scic_sds_controller;
  468. bool scic_sds_controller_isr(struct scic_sds_controller *scic);
  469. void scic_sds_controller_completion_handler(struct scic_sds_controller *scic);
  470. bool scic_sds_controller_error_isr(struct scic_sds_controller *scic);
  471. void scic_sds_controller_error_handler(struct scic_sds_controller *scic);
  472. #endif /* __ISCI_H__ */