162306a36Sopenharmony_ci/*
262306a36Sopenharmony_ci * This file is provided under a dual BSD/GPLv2 license.  When using or
362306a36Sopenharmony_ci * redistributing this file, you may do so under either license.
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * GPL LICENSE SUMMARY
662306a36Sopenharmony_ci *
762306a36Sopenharmony_ci * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
862306a36Sopenharmony_ci *
962306a36Sopenharmony_ci * This program is free software; you can redistribute it and/or modify
1062306a36Sopenharmony_ci * it under the terms of version 2 of the GNU General Public License as
1162306a36Sopenharmony_ci * published by the Free Software Foundation.
1262306a36Sopenharmony_ci *
1362306a36Sopenharmony_ci * This program is distributed in the hope that it will be useful, but
1462306a36Sopenharmony_ci * WITHOUT ANY WARRANTY; without even the implied warranty of
1562306a36Sopenharmony_ci * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1662306a36Sopenharmony_ci * General Public License for more details.
1762306a36Sopenharmony_ci *
1862306a36Sopenharmony_ci * You should have received a copy of the GNU General Public License
1962306a36Sopenharmony_ci * along with this program; if not, write to the Free Software
2062306a36Sopenharmony_ci * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
2162306a36Sopenharmony_ci * The full GNU General Public License is included in this distribution
2262306a36Sopenharmony_ci * in the file called LICENSE.GPL.
2362306a36Sopenharmony_ci *
2462306a36Sopenharmony_ci * BSD LICENSE
2562306a36Sopenharmony_ci *
2662306a36Sopenharmony_ci * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
2762306a36Sopenharmony_ci * All rights reserved.
2862306a36Sopenharmony_ci *
2962306a36Sopenharmony_ci * Redistribution and use in source and binary forms, with or without
3062306a36Sopenharmony_ci * modification, are permitted provided that the following conditions
3162306a36Sopenharmony_ci * are met:
3262306a36Sopenharmony_ci *
3362306a36Sopenharmony_ci *   * Redistributions of source code must retain the above copyright
3462306a36Sopenharmony_ci *     notice, this list of conditions and the following disclaimer.
3562306a36Sopenharmony_ci *   * Redistributions in binary form must reproduce the above copyright
3662306a36Sopenharmony_ci *     notice, this list of conditions and the following disclaimer in
3762306a36Sopenharmony_ci *     the documentation and/or other materials provided with the
3862306a36Sopenharmony_ci *     distribution.
3962306a36Sopenharmony_ci *   * Neither the name of Intel Corporation nor the names of its
4062306a36Sopenharmony_ci *     contributors may be used to endorse or promote products derived
4162306a36Sopenharmony_ci *     from this software without specific prior written permission.
4262306a36Sopenharmony_ci *
4362306a36Sopenharmony_ci * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4462306a36Sopenharmony_ci * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
4562306a36Sopenharmony_ci * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
4662306a36Sopenharmony_ci * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
4762306a36Sopenharmony_ci * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
4862306a36Sopenharmony_ci * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
4962306a36Sopenharmony_ci * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
5062306a36Sopenharmony_ci * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
5162306a36Sopenharmony_ci * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
5262306a36Sopenharmony_ci * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
5362306a36Sopenharmony_ci * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5462306a36Sopenharmony_ci */
5562306a36Sopenharmony_ci
5662306a36Sopenharmony_ci#ifndef _ISCI_REMOTE_DEVICE_H_
5762306a36Sopenharmony_ci#define _ISCI_REMOTE_DEVICE_H_
5862306a36Sopenharmony_ci#include <scsi/libsas.h>
5962306a36Sopenharmony_ci#include <linux/kref.h>
6062306a36Sopenharmony_ci#include "scu_remote_node_context.h"
6162306a36Sopenharmony_ci#include "remote_node_context.h"
6262306a36Sopenharmony_ci#include "port.h"
6362306a36Sopenharmony_ci
6462306a36Sopenharmony_cienum sci_remote_device_not_ready_reason_code {
6562306a36Sopenharmony_ci	SCIC_REMOTE_DEVICE_NOT_READY_START_REQUESTED,
6662306a36Sopenharmony_ci	SCIC_REMOTE_DEVICE_NOT_READY_STOP_REQUESTED,
6762306a36Sopenharmony_ci	SCIC_REMOTE_DEVICE_NOT_READY_SATA_REQUEST_STARTED,
6862306a36Sopenharmony_ci	SCIC_REMOTE_DEVICE_NOT_READY_SATA_SDB_ERROR_FIS_RECEIVED,
6962306a36Sopenharmony_ci	SCIC_REMOTE_DEVICE_NOT_READY_SMP_REQUEST_STARTED,
7062306a36Sopenharmony_ci	SCIC_REMOTE_DEVICE_NOT_READY_REASON_CODE_MAX
7162306a36Sopenharmony_ci};
7262306a36Sopenharmony_ci
7362306a36Sopenharmony_ci/**
7462306a36Sopenharmony_ci * isci_remote_device - isci representation of a sas expander / end point
7562306a36Sopenharmony_ci * @device_port_width: hw setting for number of simultaneous connections
7662306a36Sopenharmony_ci * @connection_rate: per-taskcontext connection rate for this device
7762306a36Sopenharmony_ci * @working_request: SATA requests have no tag we for unaccelerated
7862306a36Sopenharmony_ci *                   protocols we need a method to associate unsolicited
7962306a36Sopenharmony_ci *                   frames with a pending request
8062306a36Sopenharmony_ci */
8162306a36Sopenharmony_cistruct isci_remote_device {
8262306a36Sopenharmony_ci	#define IDEV_START_PENDING 0
8362306a36Sopenharmony_ci	#define IDEV_STOP_PENDING 1
8462306a36Sopenharmony_ci	#define IDEV_ALLOCATED 2
8562306a36Sopenharmony_ci	#define IDEV_GONE 3
8662306a36Sopenharmony_ci	#define IDEV_IO_READY 4
8762306a36Sopenharmony_ci	#define IDEV_IO_NCQERROR 5
8862306a36Sopenharmony_ci	#define IDEV_RNC_LLHANG_ENABLED 6
8962306a36Sopenharmony_ci	#define IDEV_ABORT_PATH_ACTIVE 7
9062306a36Sopenharmony_ci	#define IDEV_ABORT_PATH_RESUME_PENDING 8
9162306a36Sopenharmony_ci	unsigned long flags;
9262306a36Sopenharmony_ci	struct kref kref;
9362306a36Sopenharmony_ci	struct isci_port *isci_port;
9462306a36Sopenharmony_ci	struct domain_device *domain_dev;
9562306a36Sopenharmony_ci	struct list_head node;
9662306a36Sopenharmony_ci	struct sci_base_state_machine sm;
9762306a36Sopenharmony_ci	u32 device_port_width;
9862306a36Sopenharmony_ci	enum sas_linkrate connection_rate;
9962306a36Sopenharmony_ci	struct isci_port *owning_port;
10062306a36Sopenharmony_ci	struct sci_remote_node_context rnc;
10162306a36Sopenharmony_ci	/* XXX unify with device reference counting and delete */
10262306a36Sopenharmony_ci	u32 started_request_count;
10362306a36Sopenharmony_ci	struct isci_request *working_request;
10462306a36Sopenharmony_ci	u32 not_ready_reason;
10562306a36Sopenharmony_ci	scics_sds_remote_node_context_callback abort_resume_cb;
10662306a36Sopenharmony_ci	void *abort_resume_cbparam;
10762306a36Sopenharmony_ci};
10862306a36Sopenharmony_ci
10962306a36Sopenharmony_ci#define ISCI_REMOTE_DEVICE_START_TIMEOUT 5000
11062306a36Sopenharmony_ci
11162306a36Sopenharmony_ci/* device reference routines must be called under sci_lock */
11262306a36Sopenharmony_cistatic inline struct isci_remote_device *isci_get_device(
11362306a36Sopenharmony_ci	struct isci_remote_device *idev)
11462306a36Sopenharmony_ci{
11562306a36Sopenharmony_ci	if (idev)
11662306a36Sopenharmony_ci		kref_get(&idev->kref);
11762306a36Sopenharmony_ci	return idev;
11862306a36Sopenharmony_ci}
11962306a36Sopenharmony_ci
12062306a36Sopenharmony_cistatic inline struct isci_remote_device *isci_lookup_device(struct domain_device *dev)
12162306a36Sopenharmony_ci{
12262306a36Sopenharmony_ci	struct isci_remote_device *idev = dev->lldd_dev;
12362306a36Sopenharmony_ci
12462306a36Sopenharmony_ci	if (idev && !test_bit(IDEV_GONE, &idev->flags)) {
12562306a36Sopenharmony_ci		kref_get(&idev->kref);
12662306a36Sopenharmony_ci		return idev;
12762306a36Sopenharmony_ci	}
12862306a36Sopenharmony_ci
12962306a36Sopenharmony_ci	return NULL;
13062306a36Sopenharmony_ci}
13162306a36Sopenharmony_ci
13262306a36Sopenharmony_civoid isci_remote_device_release(struct kref *kref);
13362306a36Sopenharmony_cistatic inline void isci_put_device(struct isci_remote_device *idev)
13462306a36Sopenharmony_ci{
13562306a36Sopenharmony_ci	if (idev)
13662306a36Sopenharmony_ci		kref_put(&idev->kref, isci_remote_device_release);
13762306a36Sopenharmony_ci}
13862306a36Sopenharmony_ci
13962306a36Sopenharmony_cienum sci_status isci_remote_device_stop(struct isci_host *ihost,
14062306a36Sopenharmony_ci					struct isci_remote_device *idev);
14162306a36Sopenharmony_civoid isci_remote_device_nuke_requests(struct isci_host *ihost,
14262306a36Sopenharmony_ci				      struct isci_remote_device *idev);
14362306a36Sopenharmony_civoid isci_remote_device_gone(struct domain_device *domain_dev);
14462306a36Sopenharmony_ciint isci_remote_device_found(struct domain_device *domain_dev);
14562306a36Sopenharmony_ci
14662306a36Sopenharmony_ci/**
14762306a36Sopenharmony_ci * sci_remote_device_stop() - This method will stop both transmission and
14862306a36Sopenharmony_ci *    reception of link activity for the supplied remote device.  This method
14962306a36Sopenharmony_ci *    disables normal IO requests from flowing through to the remote device.
15062306a36Sopenharmony_ci * @remote_device: This parameter specifies the device to be stopped.
15162306a36Sopenharmony_ci * @timeout: This parameter specifies the number of milliseconds in which the
15262306a36Sopenharmony_ci *    stop operation should complete.
15362306a36Sopenharmony_ci *
15462306a36Sopenharmony_ci * An indication of whether the device was successfully stopped. SCI_SUCCESS
15562306a36Sopenharmony_ci * This value is returned if the transmission and reception for the device was
15662306a36Sopenharmony_ci * successfully stopped.
15762306a36Sopenharmony_ci */
15862306a36Sopenharmony_cienum sci_status sci_remote_device_stop(
15962306a36Sopenharmony_ci	struct isci_remote_device *idev,
16062306a36Sopenharmony_ci	u32 timeout);
16162306a36Sopenharmony_ci
16262306a36Sopenharmony_ci/**
16362306a36Sopenharmony_ci * sci_remote_device_reset() - This method will reset the device making it
16462306a36Sopenharmony_ci *    ready for operation. This method must be called anytime the device is
16562306a36Sopenharmony_ci *    reset either through a SMP phy control or a port hard reset request.
16662306a36Sopenharmony_ci * @remote_device: This parameter specifies the device to be reset.
16762306a36Sopenharmony_ci *
16862306a36Sopenharmony_ci * This method does not actually cause the device hardware to be reset. This
16962306a36Sopenharmony_ci * method resets the software object so that it will be operational after a
17062306a36Sopenharmony_ci * device hardware reset completes. An indication of whether the device reset
17162306a36Sopenharmony_ci * was accepted. SCI_SUCCESS This value is returned if the device reset is
17262306a36Sopenharmony_ci * started.
17362306a36Sopenharmony_ci */
17462306a36Sopenharmony_cienum sci_status sci_remote_device_reset(
17562306a36Sopenharmony_ci	struct isci_remote_device *idev);
17662306a36Sopenharmony_ci
17762306a36Sopenharmony_ci/**
17862306a36Sopenharmony_ci * sci_remote_device_reset_complete() - This method informs the device object
17962306a36Sopenharmony_ci *    that the reset operation is complete and the device can resume operation
18062306a36Sopenharmony_ci *    again.
18162306a36Sopenharmony_ci * @remote_device: This parameter specifies the device which is to be informed
18262306a36Sopenharmony_ci *    of the reset complete operation.
18362306a36Sopenharmony_ci *
18462306a36Sopenharmony_ci * An indication that the device is resuming operation. SCI_SUCCESS the device
18562306a36Sopenharmony_ci * is resuming operation.
18662306a36Sopenharmony_ci */
18762306a36Sopenharmony_cienum sci_status sci_remote_device_reset_complete(
18862306a36Sopenharmony_ci	struct isci_remote_device *idev);
18962306a36Sopenharmony_ci
19062306a36Sopenharmony_ci/**
19162306a36Sopenharmony_ci * enum sci_remote_device_states - This enumeration depicts all the states
19262306a36Sopenharmony_ci *    for the common remote device state machine.
19362306a36Sopenharmony_ci * @SCI_DEV_INITIAL: Simply the initial state for the base remote device
19462306a36Sopenharmony_ci * state machine.
19562306a36Sopenharmony_ci *
19662306a36Sopenharmony_ci * @SCI_DEV_STOPPED: This state indicates that the remote device has
19762306a36Sopenharmony_ci * successfully been stopped.  In this state no new IO operations are
19862306a36Sopenharmony_ci * permitted.  This state is entered from the INITIAL state.  This state
19962306a36Sopenharmony_ci * is entered from the STOPPING state.
20062306a36Sopenharmony_ci *
20162306a36Sopenharmony_ci * @SCI_DEV_STARTING: This state indicates the the remote device is in
20262306a36Sopenharmony_ci * the process of becoming ready (i.e. starting).  In this state no new
20362306a36Sopenharmony_ci * IO operations are permitted.  This state is entered from the STOPPED
20462306a36Sopenharmony_ci * state.
20562306a36Sopenharmony_ci *
20662306a36Sopenharmony_ci * @SCI_DEV_READY: This state indicates the remote device is now ready.
20762306a36Sopenharmony_ci * Thus, the user is able to perform IO operations on the remote device.
20862306a36Sopenharmony_ci * This state is entered from the STARTING state.
20962306a36Sopenharmony_ci *
21062306a36Sopenharmony_ci * @SCI_STP_DEV_IDLE: This is the idle substate for the stp remote
21162306a36Sopenharmony_ci * device.  When there are no active IO for the device it is is in this
21262306a36Sopenharmony_ci * state.
21362306a36Sopenharmony_ci *
21462306a36Sopenharmony_ci * @SCI_STP_DEV_CMD: This is the command state for for the STP remote
21562306a36Sopenharmony_ci * device.  This state is entered when the device is processing a
21662306a36Sopenharmony_ci * non-NCQ command.  The device object will fail any new start IO
21762306a36Sopenharmony_ci * requests until this command is complete.
21862306a36Sopenharmony_ci *
21962306a36Sopenharmony_ci * @SCI_STP_DEV_NCQ: This is the NCQ state for the STP remote device.
22062306a36Sopenharmony_ci * This state is entered when the device is processing an NCQ reuqest.
22162306a36Sopenharmony_ci * It will remain in this state so long as there is one or more NCQ
22262306a36Sopenharmony_ci * requests being processed.
22362306a36Sopenharmony_ci *
22462306a36Sopenharmony_ci * @SCI_STP_DEV_NCQ_ERROR: This is the NCQ error state for the STP
22562306a36Sopenharmony_ci * remote device.  This state is entered when an SDB error FIS is
22662306a36Sopenharmony_ci * received by the device object while in the NCQ state.  The device
22762306a36Sopenharmony_ci * object will only accept a READ LOG command while in this state.
22862306a36Sopenharmony_ci *
22962306a36Sopenharmony_ci * @SCI_STP_DEV_ATAPI_ERROR: This is the ATAPI error state for the STP
23062306a36Sopenharmony_ci * ATAPI remote device.  This state is entered when ATAPI device sends
23162306a36Sopenharmony_ci * error status FIS without data while the device object is in CMD
23262306a36Sopenharmony_ci * state.  A suspension event is expected in this state.  The device
23362306a36Sopenharmony_ci * object will resume right away.
23462306a36Sopenharmony_ci *
23562306a36Sopenharmony_ci * @SCI_STP_DEV_AWAIT_RESET: This is the READY substate indicates the
23662306a36Sopenharmony_ci * device is waiting for the RESET task coming to be recovered from
23762306a36Sopenharmony_ci * certain hardware specific error.
23862306a36Sopenharmony_ci *
23962306a36Sopenharmony_ci * @SCI_SMP_DEV_IDLE: This is the ready operational substate for the
24062306a36Sopenharmony_ci * remote device.  This is the normal operational state for a remote
24162306a36Sopenharmony_ci * device.
24262306a36Sopenharmony_ci *
24362306a36Sopenharmony_ci * @SCI_SMP_DEV_CMD: This is the suspended state for the remote device.
24462306a36Sopenharmony_ci * This is the state that the device is placed in when a RNC suspend is
24562306a36Sopenharmony_ci * received by the SCU hardware.
24662306a36Sopenharmony_ci *
24762306a36Sopenharmony_ci * @SCI_DEV_STOPPING: This state indicates that the remote device is in
24862306a36Sopenharmony_ci * the process of stopping.  In this state no new IO operations are
24962306a36Sopenharmony_ci * permitted, but existing IO operations are allowed to complete.  This
25062306a36Sopenharmony_ci * state is entered from the READY state.  This state is entered from
25162306a36Sopenharmony_ci * the FAILED state.
25262306a36Sopenharmony_ci *
25362306a36Sopenharmony_ci * @SCI_DEV_FAILED: This state indicates that the remote device has
25462306a36Sopenharmony_ci * failed.  In this state no new IO operations are permitted.  This
25562306a36Sopenharmony_ci * state is entered from the INITIALIZING state.  This state is entered
25662306a36Sopenharmony_ci * from the READY state.
25762306a36Sopenharmony_ci *
25862306a36Sopenharmony_ci * @SCI_DEV_RESETTING: This state indicates the device is being reset.
25962306a36Sopenharmony_ci * In this state no new IO operations are permitted.  This state is
26062306a36Sopenharmony_ci * entered from the READY state.
26162306a36Sopenharmony_ci *
26262306a36Sopenharmony_ci * @SCI_DEV_FINAL: Simply the final state for the base remote device
26362306a36Sopenharmony_ci * state machine.
26462306a36Sopenharmony_ci */
26562306a36Sopenharmony_ci#define REMOTE_DEV_STATES {\
26662306a36Sopenharmony_ci	C(DEV_INITIAL),\
26762306a36Sopenharmony_ci	C(DEV_STOPPED),\
26862306a36Sopenharmony_ci	C(DEV_STARTING),\
26962306a36Sopenharmony_ci	C(DEV_READY),\
27062306a36Sopenharmony_ci	C(STP_DEV_IDLE),\
27162306a36Sopenharmony_ci	C(STP_DEV_CMD),\
27262306a36Sopenharmony_ci	C(STP_DEV_NCQ),\
27362306a36Sopenharmony_ci	C(STP_DEV_NCQ_ERROR),\
27462306a36Sopenharmony_ci	C(STP_DEV_ATAPI_ERROR),\
27562306a36Sopenharmony_ci	C(STP_DEV_AWAIT_RESET),\
27662306a36Sopenharmony_ci	C(SMP_DEV_IDLE),\
27762306a36Sopenharmony_ci	C(SMP_DEV_CMD),\
27862306a36Sopenharmony_ci	C(DEV_STOPPING),\
27962306a36Sopenharmony_ci	C(DEV_FAILED),\
28062306a36Sopenharmony_ci	C(DEV_RESETTING),\
28162306a36Sopenharmony_ci	C(DEV_FINAL),\
28262306a36Sopenharmony_ci	}
28362306a36Sopenharmony_ci#undef C
28462306a36Sopenharmony_ci#define C(a) SCI_##a
28562306a36Sopenharmony_cienum sci_remote_device_states REMOTE_DEV_STATES;
28662306a36Sopenharmony_ci#undef C
28762306a36Sopenharmony_ciconst char *dev_state_name(enum sci_remote_device_states state);
28862306a36Sopenharmony_ci
28962306a36Sopenharmony_cistatic inline struct isci_remote_device *rnc_to_dev(struct sci_remote_node_context *rnc)
29062306a36Sopenharmony_ci{
29162306a36Sopenharmony_ci	struct isci_remote_device *idev;
29262306a36Sopenharmony_ci
29362306a36Sopenharmony_ci	idev = container_of(rnc, typeof(*idev), rnc);
29462306a36Sopenharmony_ci
29562306a36Sopenharmony_ci	return idev;
29662306a36Sopenharmony_ci}
29762306a36Sopenharmony_ci
29862306a36Sopenharmony_cistatic inline void sci_remote_device_decrement_request_count(struct isci_remote_device *idev)
29962306a36Sopenharmony_ci{
30062306a36Sopenharmony_ci	/* XXX delete this voodoo when converting to the top-level device
30162306a36Sopenharmony_ci	 * reference count
30262306a36Sopenharmony_ci	 */
30362306a36Sopenharmony_ci	if (WARN_ONCE(idev->started_request_count == 0,
30462306a36Sopenharmony_ci		      "%s: tried to decrement started_request_count past 0!?",
30562306a36Sopenharmony_ci			__func__))
30662306a36Sopenharmony_ci		/* pass */;
30762306a36Sopenharmony_ci	else
30862306a36Sopenharmony_ci		idev->started_request_count--;
30962306a36Sopenharmony_ci}
31062306a36Sopenharmony_ci
31162306a36Sopenharmony_civoid isci_dev_set_hang_detection_timeout(struct isci_remote_device *idev, u32 timeout);
31262306a36Sopenharmony_ci
31362306a36Sopenharmony_cienum sci_status sci_remote_device_frame_handler(
31462306a36Sopenharmony_ci	struct isci_remote_device *idev,
31562306a36Sopenharmony_ci	u32 frame_index);
31662306a36Sopenharmony_ci
31762306a36Sopenharmony_cienum sci_status sci_remote_device_event_handler(
31862306a36Sopenharmony_ci	struct isci_remote_device *idev,
31962306a36Sopenharmony_ci	u32 event_code);
32062306a36Sopenharmony_ci
32162306a36Sopenharmony_cienum sci_status sci_remote_device_start_io(
32262306a36Sopenharmony_ci	struct isci_host *ihost,
32362306a36Sopenharmony_ci	struct isci_remote_device *idev,
32462306a36Sopenharmony_ci	struct isci_request *ireq);
32562306a36Sopenharmony_ci
32662306a36Sopenharmony_cienum sci_status sci_remote_device_start_task(
32762306a36Sopenharmony_ci	struct isci_host *ihost,
32862306a36Sopenharmony_ci	struct isci_remote_device *idev,
32962306a36Sopenharmony_ci	struct isci_request *ireq);
33062306a36Sopenharmony_ci
33162306a36Sopenharmony_cienum sci_status sci_remote_device_complete_io(
33262306a36Sopenharmony_ci	struct isci_host *ihost,
33362306a36Sopenharmony_ci	struct isci_remote_device *idev,
33462306a36Sopenharmony_ci	struct isci_request *ireq);
33562306a36Sopenharmony_ci
33662306a36Sopenharmony_civoid sci_remote_device_post_request(
33762306a36Sopenharmony_ci	struct isci_remote_device *idev,
33862306a36Sopenharmony_ci	u32 request);
33962306a36Sopenharmony_ci
34062306a36Sopenharmony_cienum sci_status sci_remote_device_terminate_requests(
34162306a36Sopenharmony_ci	struct isci_remote_device *idev);
34262306a36Sopenharmony_ci
34362306a36Sopenharmony_ciint isci_remote_device_is_safe_to_abort(
34462306a36Sopenharmony_ci	struct isci_remote_device *idev);
34562306a36Sopenharmony_ci
34662306a36Sopenharmony_cienum sci_status
34762306a36Sopenharmony_cisci_remote_device_abort_requests_pending_abort(
34862306a36Sopenharmony_ci	struct isci_remote_device *idev);
34962306a36Sopenharmony_ci
35062306a36Sopenharmony_cienum sci_status isci_remote_device_suspend(
35162306a36Sopenharmony_ci	struct isci_host *ihost,
35262306a36Sopenharmony_ci	struct isci_remote_device *idev);
35362306a36Sopenharmony_ci
35462306a36Sopenharmony_cienum sci_status sci_remote_device_resume(
35562306a36Sopenharmony_ci	struct isci_remote_device *idev,
35662306a36Sopenharmony_ci	scics_sds_remote_node_context_callback cb_fn,
35762306a36Sopenharmony_ci	void *cb_p);
35862306a36Sopenharmony_ci
35962306a36Sopenharmony_cienum sci_status isci_remote_device_resume_from_abort(
36062306a36Sopenharmony_ci	struct isci_host *ihost,
36162306a36Sopenharmony_ci	struct isci_remote_device *idev);
36262306a36Sopenharmony_ci
36362306a36Sopenharmony_cienum sci_status isci_remote_device_reset(
36462306a36Sopenharmony_ci	struct isci_host *ihost,
36562306a36Sopenharmony_ci	struct isci_remote_device *idev);
36662306a36Sopenharmony_ci
36762306a36Sopenharmony_cienum sci_status isci_remote_device_reset_complete(
36862306a36Sopenharmony_ci	struct isci_host *ihost,
36962306a36Sopenharmony_ci	struct isci_remote_device *idev);
37062306a36Sopenharmony_ci
37162306a36Sopenharmony_cienum sci_status isci_remote_device_suspend_terminate(
37262306a36Sopenharmony_ci	struct isci_host *ihost,
37362306a36Sopenharmony_ci	struct isci_remote_device *idev,
37462306a36Sopenharmony_ci	struct isci_request *ireq);
37562306a36Sopenharmony_ci
37662306a36Sopenharmony_cienum sci_status isci_remote_device_terminate_requests(
37762306a36Sopenharmony_ci	struct isci_host *ihost,
37862306a36Sopenharmony_ci	struct isci_remote_device *idev,
37962306a36Sopenharmony_ci	struct isci_request *ireq);
38062306a36Sopenharmony_cienum sci_status sci_remote_device_suspend(struct isci_remote_device *idev,
38162306a36Sopenharmony_ci					  enum sci_remote_node_suspension_reasons reason);
38262306a36Sopenharmony_ci#endif /* !defined(_ISCI_REMOTE_DEVICE_H_) */
383