drivers/scsi/isci/remote_device.h

Source file repositories/reference/linux-study-clean/drivers/scsi/isci/remote_device.h

File Facts

System
Linux kernel
Corpus path
drivers/scsi/isci/remote_device.h
Extension
.h
Size
12664 bytes
Lines
351
Domain
Driver Families
Bucket
drivers/scsi
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct isci_remote_device {
	#define IDEV_START_PENDING 0
	#define IDEV_STOP_PENDING 1
	#define IDEV_ALLOCATED 2
	#define IDEV_GONE 3
	#define IDEV_IO_READY 4
	#define IDEV_IO_NCQERROR 5
	#define IDEV_RNC_LLHANG_ENABLED 6
	#define IDEV_ABORT_PATH_ACTIVE 7
	#define IDEV_ABORT_PATH_RESUME_PENDING 8
	unsigned long flags;
	struct kref kref;
	struct isci_port *isci_port;
	struct domain_device *domain_dev;
	struct list_head node;
	struct sci_base_state_machine sm;
	u32 device_port_width;
	enum sas_linkrate connection_rate;
	struct isci_port *owning_port;
	struct sci_remote_node_context rnc;
	/* XXX unify with device reference counting and delete */
	u32 started_request_count;
	struct isci_request *working_request;
	u32 not_ready_reason;
	scics_sds_remote_node_context_callback abort_resume_cb;
	void *abort_resume_cbparam;
};

#define ISCI_REMOTE_DEVICE_START_TIMEOUT 5000

/* device reference routines must be called under sci_lock */
static inline struct isci_remote_device *isci_get_device(
	struct isci_remote_device *idev)
{
	if (idev)
		kref_get(&idev->kref);
	return idev;
}

static inline struct isci_remote_device *isci_lookup_device(struct domain_device *dev)
{
	struct isci_remote_device *idev = dev->lldd_dev;

	if (idev && !test_bit(IDEV_GONE, &idev->flags)) {
		kref_get(&idev->kref);
		return idev;
	}

	return NULL;
}

void isci_remote_device_release(struct kref *kref);
static inline void isci_put_device(struct isci_remote_device *idev)
{
	if (idev)
		kref_put(&idev->kref, isci_remote_device_release);
}

enum sci_status isci_remote_device_stop(struct isci_host *ihost,
					struct isci_remote_device *idev);
void isci_remote_device_nuke_requests(struct isci_host *ihost,
				      struct isci_remote_device *idev);
void isci_remote_device_gone(struct domain_device *domain_dev);
int isci_remote_device_found(struct domain_device *domain_dev);

/**
 * sci_remote_device_stop() - This method will stop both transmission and
 *    reception of link activity for the supplied remote device.  This method
 *    disables normal IO requests from flowing through to the remote device.
 * @remote_device: This parameter specifies the device to be stopped.
 * @timeout: This parameter specifies the number of milliseconds in which the
 *    stop operation should complete.
 *
 * An indication of whether the device was successfully stopped. SCI_SUCCESS
 * This value is returned if the transmission and reception for the device was
 * successfully stopped.
 */
enum sci_status sci_remote_device_stop(
	struct isci_remote_device *idev,
	u32 timeout);

/**
 * enum sci_remote_device_states - This enumeration depicts all the states
 *    for the common remote device state machine.
 * @SCI_DEV_INITIAL: Simply the initial state for the base remote device
 * state machine.
 *
 * @SCI_DEV_STOPPED: This state indicates that the remote device has
 * successfully been stopped.  In this state no new IO operations are
 * permitted.  This state is entered from the INITIAL state.  This state

Annotation

Implementation Notes