Dan Williams | 6f231dd | 2011-07-02 22:56:22 -0700 | [diff] [blame] | 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 | |
Dan Williams | 88f3b62 | 2011-04-22 19:18:03 -0700 | [diff] [blame] | 56 | #ifndef _ISCI_REMOTE_DEVICE_H_ |
Dan Williams | 6f231dd | 2011-07-02 22:56:22 -0700 | [diff] [blame] | 57 | #define _ISCI_REMOTE_DEVICE_H_ |
Dan Williams | 88f3b62 | 2011-04-22 19:18:03 -0700 | [diff] [blame] | 58 | #include <scsi/libsas.h> |
Dan Williams | 209fae1 | 2011-06-13 17:39:44 -0700 | [diff] [blame] | 59 | #include <linux/kref.h> |
Dan Williams | 88f3b62 | 2011-04-22 19:18:03 -0700 | [diff] [blame] | 60 | #include "scu_remote_node_context.h" |
| 61 | #include "remote_node_context.h" |
| 62 | #include "port.h" |
Dan Williams | 6f231dd | 2011-07-02 22:56:22 -0700 | [diff] [blame] | 63 | |
Dan Williams | 89a7301 | 2011-06-30 19:14:33 -0700 | [diff] [blame] | 64 | enum sci_remote_device_not_ready_reason_code { |
Dan Williams | 88f3b62 | 2011-04-22 19:18:03 -0700 | [diff] [blame] | 65 | SCIC_REMOTE_DEVICE_NOT_READY_START_REQUESTED, |
| 66 | SCIC_REMOTE_DEVICE_NOT_READY_STOP_REQUESTED, |
| 67 | SCIC_REMOTE_DEVICE_NOT_READY_SATA_REQUEST_STARTED, |
| 68 | SCIC_REMOTE_DEVICE_NOT_READY_SATA_SDB_ERROR_FIS_RECEIVED, |
| 69 | SCIC_REMOTE_DEVICE_NOT_READY_SMP_REQUEST_STARTED, |
Dan Williams | 88f3b62 | 2011-04-22 19:18:03 -0700 | [diff] [blame] | 70 | SCIC_REMOTE_DEVICE_NOT_READY_REASON_CODE_MAX |
Dan Williams | 88f3b62 | 2011-04-22 19:18:03 -0700 | [diff] [blame] | 71 | }; |
| 72 | |
Dan Williams | 78a6f06 | 2011-06-30 16:31:37 -0700 | [diff] [blame] | 73 | /** |
| 74 | * isci_remote_device - isci representation of a sas expander / end point |
| 75 | * @device_port_width: hw setting for number of simultaneous connections |
| 76 | * @connection_rate: per-taskcontext connection rate for this device |
| 77 | * @working_request: SATA requests have no tag we for unaccelerated |
| 78 | * protocols we need a method to associate unsolicited |
| 79 | * frames with a pending request |
| 80 | */ |
Dan Williams | 6f231dd | 2011-07-02 22:56:22 -0700 | [diff] [blame] | 81 | struct isci_remote_device { |
Dan Williams | 6ad31fe | 2011-03-04 12:10:29 -0800 | [diff] [blame] | 82 | #define IDEV_START_PENDING 0 |
| 83 | #define IDEV_STOP_PENDING 1 |
Dan Williams | d9c3739 | 2011-03-03 17:59:32 -0800 | [diff] [blame] | 84 | #define IDEV_ALLOCATED 2 |
Dan Williams | 5a99832 | 2011-12-12 20:32:09 -0800 | [diff] [blame] | 85 | #define IDEV_GONE 3 |
| 86 | #define IDEV_IO_READY 4 |
| 87 | #define IDEV_IO_NCQERROR 5 |
Jeff Skirvin | 9608b64 | 2012-03-08 22:42:00 -0800 | [diff] [blame] | 88 | #define IDEV_RNC_LLHANG_ENABLED 6 |
Jeff Skirvin | 0c3ce38 | 2012-03-08 22:42:02 -0800 | [diff] [blame] | 89 | #define IDEV_ABORT_PATH_ACTIVE 7 |
Jeff Skirvin | 0cce165 | 2012-03-08 22:42:04 -0800 | [diff] [blame] | 90 | #define IDEV_ABORT_PATH_RESUME_PENDING 8 |
Dan Williams | 6ad31fe | 2011-03-04 12:10:29 -0800 | [diff] [blame] | 91 | unsigned long flags; |
Dan Williams | 209fae1 | 2011-06-13 17:39:44 -0700 | [diff] [blame] | 92 | struct kref kref; |
Dan Williams | 6f231dd | 2011-07-02 22:56:22 -0700 | [diff] [blame] | 93 | struct isci_port *isci_port; |
| 94 | struct domain_device *domain_dev; |
Dan Williams | 6f231dd | 2011-07-02 22:56:22 -0700 | [diff] [blame] | 95 | struct list_head node; |
Dan Williams | 78a6f06 | 2011-06-30 16:31:37 -0700 | [diff] [blame] | 96 | struct sci_base_state_machine sm; |
| 97 | u32 device_port_width; |
| 98 | enum sas_linkrate connection_rate; |
Dan Williams | 78a6f06 | 2011-06-30 16:31:37 -0700 | [diff] [blame] | 99 | struct isci_port *owning_port; |
Dan Williams | 89a7301 | 2011-06-30 19:14:33 -0700 | [diff] [blame] | 100 | struct sci_remote_node_context rnc; |
Dan Williams | 78a6f06 | 2011-06-30 16:31:37 -0700 | [diff] [blame] | 101 | /* XXX unify with device reference counting and delete */ |
| 102 | u32 started_request_count; |
| 103 | struct isci_request *working_request; |
| 104 | u32 not_ready_reason; |
Jeff Skirvin | 0cce165 | 2012-03-08 22:42:04 -0800 | [diff] [blame] | 105 | scics_sds_remote_node_context_callback abort_resume_cb; |
| 106 | void *abort_resume_cbparam; |
Dan Williams | 6f231dd | 2011-07-02 22:56:22 -0700 | [diff] [blame] | 107 | }; |
| 108 | |
Dan Williams | 6f231dd | 2011-07-02 22:56:22 -0700 | [diff] [blame] | 109 | #define ISCI_REMOTE_DEVICE_START_TIMEOUT 5000 |
| 110 | |
Dan Williams | 89a7301 | 2011-06-30 19:14:33 -0700 | [diff] [blame] | 111 | /* device reference routines must be called under sci_lock */ |
Jeff Skirvin | 5b6bf22 | 2012-03-08 22:41:51 -0800 | [diff] [blame] | 112 | static inline struct isci_remote_device *isci_get_device( |
Jeff Skirvin | 14aaa9f | 2012-03-08 22:41:54 -0800 | [diff] [blame] | 113 | struct isci_remote_device *idev) |
Jeff Skirvin | 5b6bf22 | 2012-03-08 22:41:51 -0800 | [diff] [blame] | 114 | { |
Jeff Skirvin | 5b6bf22 | 2012-03-08 22:41:51 -0800 | [diff] [blame] | 115 | if (idev) |
| 116 | kref_get(&idev->kref); |
| 117 | return idev; |
| 118 | } |
| 119 | |
Dan Williams | 209fae1 | 2011-06-13 17:39:44 -0700 | [diff] [blame] | 120 | static inline struct isci_remote_device *isci_lookup_device(struct domain_device *dev) |
| 121 | { |
| 122 | struct isci_remote_device *idev = dev->lldd_dev; |
| 123 | |
| 124 | if (idev && !test_bit(IDEV_GONE, &idev->flags)) { |
| 125 | kref_get(&idev->kref); |
| 126 | return idev; |
| 127 | } |
| 128 | |
| 129 | return NULL; |
| 130 | } |
| 131 | |
| 132 | void isci_remote_device_release(struct kref *kref); |
| 133 | static inline void isci_put_device(struct isci_remote_device *idev) |
| 134 | { |
| 135 | if (idev) |
| 136 | kref_put(&idev->kref, isci_remote_device_release); |
| 137 | } |
| 138 | |
Dan Williams | 6ad31fe | 2011-03-04 12:10:29 -0800 | [diff] [blame] | 139 | enum sci_status isci_remote_device_stop(struct isci_host *ihost, |
| 140 | struct isci_remote_device *idev); |
Dan Williams | 4393aa4 | 2011-03-31 13:10:44 -0700 | [diff] [blame] | 141 | void isci_remote_device_nuke_requests(struct isci_host *ihost, |
| 142 | struct isci_remote_device *idev); |
Dan Williams | 4393aa4 | 2011-03-31 13:10:44 -0700 | [diff] [blame] | 143 | void isci_remote_device_gone(struct domain_device *domain_dev); |
| 144 | int isci_remote_device_found(struct domain_device *domain_dev); |
Jeff Skirvin | 5412e25 | 2011-10-27 15:05:27 -0700 | [diff] [blame] | 145 | |
Dan Williams | 88f3b62 | 2011-04-22 19:18:03 -0700 | [diff] [blame] | 146 | /** |
Dan Williams | 89a7301 | 2011-06-30 19:14:33 -0700 | [diff] [blame] | 147 | * sci_remote_device_stop() - This method will stop both transmission and |
Dan Williams | 88f3b62 | 2011-04-22 19:18:03 -0700 | [diff] [blame] | 148 | * reception of link activity for the supplied remote device. This method |
| 149 | * disables normal IO requests from flowing through to the remote device. |
| 150 | * @remote_device: This parameter specifies the device to be stopped. |
| 151 | * @timeout: This parameter specifies the number of milliseconds in which the |
| 152 | * stop operation should complete. |
| 153 | * |
| 154 | * An indication of whether the device was successfully stopped. SCI_SUCCESS |
| 155 | * This value is returned if the transmission and reception for the device was |
| 156 | * successfully stopped. |
| 157 | */ |
Dan Williams | 89a7301 | 2011-06-30 19:14:33 -0700 | [diff] [blame] | 158 | enum sci_status sci_remote_device_stop( |
Dan Williams | 78a6f06 | 2011-06-30 16:31:37 -0700 | [diff] [blame] | 159 | struct isci_remote_device *idev, |
Dan Williams | 88f3b62 | 2011-04-22 19:18:03 -0700 | [diff] [blame] | 160 | u32 timeout); |
| 161 | |
| 162 | /** |
Dan Williams | 89a7301 | 2011-06-30 19:14:33 -0700 | [diff] [blame] | 163 | * sci_remote_device_reset() - This method will reset the device making it |
Dan Williams | 88f3b62 | 2011-04-22 19:18:03 -0700 | [diff] [blame] | 164 | * ready for operation. This method must be called anytime the device is |
| 165 | * reset either through a SMP phy control or a port hard reset request. |
| 166 | * @remote_device: This parameter specifies the device to be reset. |
| 167 | * |
| 168 | * This method does not actually cause the device hardware to be reset. This |
| 169 | * method resets the software object so that it will be operational after a |
| 170 | * device hardware reset completes. An indication of whether the device reset |
| 171 | * was accepted. SCI_SUCCESS This value is returned if the device reset is |
| 172 | * started. |
| 173 | */ |
Dan Williams | 89a7301 | 2011-06-30 19:14:33 -0700 | [diff] [blame] | 174 | enum sci_status sci_remote_device_reset( |
Dan Williams | 78a6f06 | 2011-06-30 16:31:37 -0700 | [diff] [blame] | 175 | struct isci_remote_device *idev); |
Dan Williams | 88f3b62 | 2011-04-22 19:18:03 -0700 | [diff] [blame] | 176 | |
| 177 | /** |
Dan Williams | 89a7301 | 2011-06-30 19:14:33 -0700 | [diff] [blame] | 178 | * sci_remote_device_reset_complete() - This method informs the device object |
Dan Williams | 88f3b62 | 2011-04-22 19:18:03 -0700 | [diff] [blame] | 179 | * that the reset operation is complete and the device can resume operation |
| 180 | * again. |
| 181 | * @remote_device: This parameter specifies the device which is to be informed |
| 182 | * of the reset complete operation. |
| 183 | * |
| 184 | * An indication that the device is resuming operation. SCI_SUCCESS the device |
| 185 | * is resuming operation. |
| 186 | */ |
Dan Williams | 89a7301 | 2011-06-30 19:14:33 -0700 | [diff] [blame] | 187 | enum sci_status sci_remote_device_reset_complete( |
Dan Williams | 78a6f06 | 2011-06-30 16:31:37 -0700 | [diff] [blame] | 188 | struct isci_remote_device *idev); |
Dan Williams | 88f3b62 | 2011-04-22 19:18:03 -0700 | [diff] [blame] | 189 | |
Dan Williams | 88f3b62 | 2011-04-22 19:18:03 -0700 | [diff] [blame] | 190 | /** |
Dan Williams | 89a7301 | 2011-06-30 19:14:33 -0700 | [diff] [blame] | 191 | * enum sci_remote_device_states - This enumeration depicts all the states |
Dan Williams | 88f3b62 | 2011-04-22 19:18:03 -0700 | [diff] [blame] | 192 | * for the common remote device state machine. |
Dan Williams | d7a0ccd | 2012-02-10 01:18:44 -0800 | [diff] [blame] | 193 | * @SCI_DEV_INITIAL: Simply the initial state for the base remote device |
| 194 | * state machine. |
Dan Williams | 88f3b62 | 2011-04-22 19:18:03 -0700 | [diff] [blame] | 195 | * |
Dan Williams | d7a0ccd | 2012-02-10 01:18:44 -0800 | [diff] [blame] | 196 | * @SCI_DEV_STOPPED: This state indicates that the remote device has |
| 197 | * successfully been stopped. In this state no new IO operations are |
| 198 | * permitted. This state is entered from the INITIAL state. This state |
| 199 | * is entered from the STOPPING state. |
Dan Williams | 88f3b62 | 2011-04-22 19:18:03 -0700 | [diff] [blame] | 200 | * |
Dan Williams | d7a0ccd | 2012-02-10 01:18:44 -0800 | [diff] [blame] | 201 | * @SCI_DEV_STARTING: This state indicates the the remote device is in |
| 202 | * the process of becoming ready (i.e. starting). In this state no new |
| 203 | * IO operations are permitted. This state is entered from the STOPPED |
| 204 | * state. |
| 205 | * |
| 206 | * @SCI_DEV_READY: This state indicates the remote device is now ready. |
| 207 | * Thus, the user is able to perform IO operations on the remote device. |
| 208 | * This state is entered from the STARTING state. |
| 209 | * |
| 210 | * @SCI_STP_DEV_IDLE: This is the idle substate for the stp remote |
| 211 | * device. When there are no active IO for the device it is is in this |
| 212 | * state. |
| 213 | * |
| 214 | * @SCI_STP_DEV_CMD: This is the command state for for the STP remote |
| 215 | * device. This state is entered when the device is processing a |
| 216 | * non-NCQ command. The device object will fail any new start IO |
| 217 | * requests until this command is complete. |
| 218 | * |
| 219 | * @SCI_STP_DEV_NCQ: This is the NCQ state for the STP remote device. |
| 220 | * This state is entered when the device is processing an NCQ reuqest. |
| 221 | * It will remain in this state so long as there is one or more NCQ |
| 222 | * requests being processed. |
| 223 | * |
| 224 | * @SCI_STP_DEV_NCQ_ERROR: This is the NCQ error state for the STP |
| 225 | * remote device. This state is entered when an SDB error FIS is |
| 226 | * received by the device object while in the NCQ state. The device |
| 227 | * object will only accept a READ LOG command while in this state. |
| 228 | * |
| 229 | * @SCI_STP_DEV_ATAPI_ERROR: This is the ATAPI error state for the STP |
| 230 | * ATAPI remote device. This state is entered when ATAPI device sends |
| 231 | * error status FIS without data while the device object is in CMD |
| 232 | * state. A suspension event is expected in this state. The device |
| 233 | * object will resume right away. |
| 234 | * |
| 235 | * @SCI_STP_DEV_AWAIT_RESET: This is the READY substate indicates the |
| 236 | * device is waiting for the RESET task coming to be recovered from |
| 237 | * certain hardware specific error. |
| 238 | * |
| 239 | * @SCI_SMP_DEV_IDLE: This is the ready operational substate for the |
| 240 | * remote device. This is the normal operational state for a remote |
| 241 | * device. |
| 242 | * |
| 243 | * @SCI_SMP_DEV_CMD: This is the suspended state for the remote device. |
| 244 | * This is the state that the device is placed in when a RNC suspend is |
| 245 | * received by the SCU hardware. |
| 246 | * |
| 247 | * @SCI_DEV_STOPPING: This state indicates that the remote device is in |
| 248 | * the process of stopping. In this state no new IO operations are |
| 249 | * permitted, but existing IO operations are allowed to complete. This |
| 250 | * state is entered from the READY state. This state is entered from |
| 251 | * the FAILED state. |
| 252 | * |
| 253 | * @SCI_DEV_FAILED: This state indicates that the remote device has |
| 254 | * failed. In this state no new IO operations are permitted. This |
| 255 | * state is entered from the INITIALIZING state. This state is entered |
| 256 | * from the READY state. |
| 257 | * |
| 258 | * @SCI_DEV_RESETTING: This state indicates the device is being reset. |
| 259 | * In this state no new IO operations are permitted. This state is |
| 260 | * entered from the READY state. |
| 261 | * |
| 262 | * @SCI_DEV_FINAL: Simply the final state for the base remote device |
| 263 | * state machine. |
Dan Williams | 88f3b62 | 2011-04-22 19:18:03 -0700 | [diff] [blame] | 264 | */ |
Dan Williams | d7a0ccd | 2012-02-10 01:18:44 -0800 | [diff] [blame] | 265 | #define REMOTE_DEV_STATES {\ |
| 266 | C(DEV_INITIAL),\ |
| 267 | C(DEV_STOPPED),\ |
| 268 | C(DEV_STARTING),\ |
| 269 | C(DEV_READY),\ |
| 270 | C(STP_DEV_IDLE),\ |
| 271 | C(STP_DEV_CMD),\ |
| 272 | C(STP_DEV_NCQ),\ |
| 273 | C(STP_DEV_NCQ_ERROR),\ |
| 274 | C(STP_DEV_ATAPI_ERROR),\ |
| 275 | C(STP_DEV_AWAIT_RESET),\ |
| 276 | C(SMP_DEV_IDLE),\ |
| 277 | C(SMP_DEV_CMD),\ |
| 278 | C(DEV_STOPPING),\ |
| 279 | C(DEV_FAILED),\ |
| 280 | C(DEV_RESETTING),\ |
| 281 | C(DEV_FINAL),\ |
| 282 | } |
| 283 | #undef C |
| 284 | #define C(a) SCI_##a |
| 285 | enum sci_remote_device_states REMOTE_DEV_STATES; |
| 286 | #undef C |
| 287 | const char *dev_state_name(enum sci_remote_device_states state); |
Dan Williams | 88f3b62 | 2011-04-22 19:18:03 -0700 | [diff] [blame] | 288 | |
Dan Williams | 89a7301 | 2011-06-30 19:14:33 -0700 | [diff] [blame] | 289 | static inline struct isci_remote_device *rnc_to_dev(struct sci_remote_node_context *rnc) |
Dan Williams | 88f3b62 | 2011-04-22 19:18:03 -0700 | [diff] [blame] | 290 | { |
Dan Williams | 78a6f06 | 2011-06-30 16:31:37 -0700 | [diff] [blame] | 291 | struct isci_remote_device *idev; |
Dan Williams | 88f3b62 | 2011-04-22 19:18:03 -0700 | [diff] [blame] | 292 | |
Dan Williams | 78a6f06 | 2011-06-30 16:31:37 -0700 | [diff] [blame] | 293 | idev = container_of(rnc, typeof(*idev), rnc); |
Dan Williams | a1a113b | 2011-04-21 18:44:45 -0700 | [diff] [blame] | 294 | |
Maciej Patelczyk | 5d937e9 | 2011-04-28 22:06:21 +0000 | [diff] [blame] | 295 | return idev; |
| 296 | } |
| 297 | |
Dan Williams | a1a113b | 2011-04-21 18:44:45 -0700 | [diff] [blame] | 298 | static inline bool dev_is_expander(struct domain_device *dev) |
| 299 | { |
James Bottomley | aa9f832 | 2013-05-07 14:44:06 -0700 | [diff] [blame] | 300 | return dev->dev_type == SAS_EDGE_EXPANDER_DEVICE || dev->dev_type == SAS_FANOUT_EXPANDER_DEVICE; |
Dan Williams | a1a113b | 2011-04-21 18:44:45 -0700 | [diff] [blame] | 301 | } |
| 302 | |
Dan Williams | 34a9915 | 2011-07-01 02:25:15 -0700 | [diff] [blame] | 303 | static inline void sci_remote_device_decrement_request_count(struct isci_remote_device *idev) |
| 304 | { |
| 305 | /* XXX delete this voodoo when converting to the top-level device |
| 306 | * reference count |
| 307 | */ |
| 308 | if (WARN_ONCE(idev->started_request_count == 0, |
| 309 | "%s: tried to decrement started_request_count past 0!?", |
| 310 | __func__)) |
| 311 | /* pass */; |
| 312 | else |
| 313 | idev->started_request_count--; |
| 314 | } |
Dan Williams | 88f3b62 | 2011-04-22 19:18:03 -0700 | [diff] [blame] | 315 | |
Jeff Skirvin | 9608b64 | 2012-03-08 22:42:00 -0800 | [diff] [blame] | 316 | void isci_dev_set_hang_detection_timeout(struct isci_remote_device *idev, u32 timeout); |
Jeff Skirvin | 6f48844 | 2012-03-08 22:41:48 -0800 | [diff] [blame] | 317 | |
Dan Williams | 89a7301 | 2011-06-30 19:14:33 -0700 | [diff] [blame] | 318 | enum sci_status sci_remote_device_frame_handler( |
Dan Williams | 78a6f06 | 2011-06-30 16:31:37 -0700 | [diff] [blame] | 319 | struct isci_remote_device *idev, |
Dan Williams | 88f3b62 | 2011-04-22 19:18:03 -0700 | [diff] [blame] | 320 | u32 frame_index); |
| 321 | |
Dan Williams | 89a7301 | 2011-06-30 19:14:33 -0700 | [diff] [blame] | 322 | enum sci_status sci_remote_device_event_handler( |
Dan Williams | 78a6f06 | 2011-06-30 16:31:37 -0700 | [diff] [blame] | 323 | struct isci_remote_device *idev, |
Dan Williams | 88f3b62 | 2011-04-22 19:18:03 -0700 | [diff] [blame] | 324 | u32 event_code); |
| 325 | |
Dan Williams | 89a7301 | 2011-06-30 19:14:33 -0700 | [diff] [blame] | 326 | enum sci_status sci_remote_device_start_io( |
Dan Williams | d9dcb4b | 2011-06-30 17:38:32 -0700 | [diff] [blame] | 327 | struct isci_host *ihost, |
Dan Williams | 78a6f06 | 2011-06-30 16:31:37 -0700 | [diff] [blame] | 328 | struct isci_remote_device *idev, |
Dan Williams | 5076a1a | 2011-06-27 14:57:03 -0700 | [diff] [blame] | 329 | struct isci_request *ireq); |
Dan Williams | 88f3b62 | 2011-04-22 19:18:03 -0700 | [diff] [blame] | 330 | |
Dan Williams | 89a7301 | 2011-06-30 19:14:33 -0700 | [diff] [blame] | 331 | enum sci_status sci_remote_device_start_task( |
Dan Williams | d9dcb4b | 2011-06-30 17:38:32 -0700 | [diff] [blame] | 332 | struct isci_host *ihost, |
Dan Williams | 78a6f06 | 2011-06-30 16:31:37 -0700 | [diff] [blame] | 333 | struct isci_remote_device *idev, |
Dan Williams | 5076a1a | 2011-06-27 14:57:03 -0700 | [diff] [blame] | 334 | struct isci_request *ireq); |
Dan Williams | ab2e8f7 | 2011-04-27 16:32:45 -0700 | [diff] [blame] | 335 | |
Dan Williams | 89a7301 | 2011-06-30 19:14:33 -0700 | [diff] [blame] | 336 | enum sci_status sci_remote_device_complete_io( |
Dan Williams | d9dcb4b | 2011-06-30 17:38:32 -0700 | [diff] [blame] | 337 | struct isci_host *ihost, |
Dan Williams | 78a6f06 | 2011-06-30 16:31:37 -0700 | [diff] [blame] | 338 | struct isci_remote_device *idev, |
Dan Williams | 5076a1a | 2011-06-27 14:57:03 -0700 | [diff] [blame] | 339 | struct isci_request *ireq); |
Dan Williams | 88f3b62 | 2011-04-22 19:18:03 -0700 | [diff] [blame] | 340 | |
Dan Williams | 89a7301 | 2011-06-30 19:14:33 -0700 | [diff] [blame] | 341 | void sci_remote_device_post_request( |
Dan Williams | 78a6f06 | 2011-06-30 16:31:37 -0700 | [diff] [blame] | 342 | struct isci_remote_device *idev, |
Dan Williams | 88f3b62 | 2011-04-22 19:18:03 -0700 | [diff] [blame] | 343 | u32 request); |
| 344 | |
Jeff Skirvin | 726980d | 2012-03-08 22:41:50 -0800 | [diff] [blame] | 345 | enum sci_status sci_remote_device_terminate_requests( |
| 346 | struct isci_remote_device *idev); |
| 347 | |
| 348 | int isci_remote_device_is_safe_to_abort( |
| 349 | struct isci_remote_device *idev); |
| 350 | |
| 351 | enum sci_status |
| 352 | sci_remote_device_abort_requests_pending_abort( |
| 353 | struct isci_remote_device *idev); |
Jeff Skirvin | 5b6bf22 | 2012-03-08 22:41:51 -0800 | [diff] [blame] | 354 | |
| 355 | enum sci_status isci_remote_device_suspend( |
| 356 | struct isci_host *ihost, |
| 357 | struct isci_remote_device *idev); |
| 358 | |
| 359 | enum sci_status sci_remote_device_resume( |
| 360 | struct isci_remote_device *idev, |
| 361 | scics_sds_remote_node_context_callback cb_fn, |
| 362 | void *cb_p); |
| 363 | |
Jeff Skirvin | 31a38ef | 2012-03-08 22:42:01 -0800 | [diff] [blame] | 364 | enum sci_status isci_remote_device_resume_from_abort( |
Jeff Skirvin | 5b6bf22 | 2012-03-08 22:41:51 -0800 | [diff] [blame] | 365 | struct isci_host *ihost, |
Jeff Skirvin | 31a38ef | 2012-03-08 22:42:01 -0800 | [diff] [blame] | 366 | struct isci_remote_device *idev); |
Jeff Skirvin | 5b6bf22 | 2012-03-08 22:41:51 -0800 | [diff] [blame] | 367 | |
| 368 | enum sci_status isci_remote_device_reset( |
| 369 | struct isci_host *ihost, |
| 370 | struct isci_remote_device *idev); |
| 371 | |
| 372 | enum sci_status isci_remote_device_reset_complete( |
| 373 | struct isci_host *ihost, |
| 374 | struct isci_remote_device *idev); |
Jeff Skirvin | 14aaa9f | 2012-03-08 22:41:54 -0800 | [diff] [blame] | 375 | |
| 376 | enum sci_status isci_remote_device_suspend_terminate( |
| 377 | struct isci_host *ihost, |
| 378 | struct isci_remote_device *idev, |
| 379 | struct isci_request *ireq); |
| 380 | |
| 381 | enum sci_status isci_remote_device_terminate_requests( |
| 382 | struct isci_host *ihost, |
| 383 | struct isci_remote_device *idev, |
| 384 | struct isci_request *ireq); |
Jeff Skirvin | 8780516 | 2012-03-08 22:42:09 -0800 | [diff] [blame] | 385 | enum sci_status sci_remote_device_suspend(struct isci_remote_device *idev, |
| 386 | enum sci_remote_node_suspension_reasons reason); |
Dan Williams | 6f231dd | 2011-07-02 22:56:22 -0700 | [diff] [blame] | 387 | #endif /* !defined(_ISCI_REMOTE_DEVICE_H_) */ |