Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
remote_device.h File Reference
#include <scsi/libsas.h>
#include <linux/kref.h>
#include "scu_remote_node_context.h"
#include "remote_node_context.h"
#include "port.h"

Go to the source code of this file.

Data Structures

struct  isci_remote_device
 

Macros

#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
 
#define ISCI_REMOTE_DEVICE_START_TIMEOUT   5000
 
#define REMOTE_DEV_STATES
 
#define C(a)   SCI_##a
 

Enumerations

enum  sci_remote_device_not_ready_reason_code {
  SCIC_REMOTE_DEVICE_NOT_READY_START_REQUESTED, SCIC_REMOTE_DEVICE_NOT_READY_STOP_REQUESTED, SCIC_REMOTE_DEVICE_NOT_READY_SATA_REQUEST_STARTED, SCIC_REMOTE_DEVICE_NOT_READY_SATA_SDB_ERROR_FIS_RECEIVED,
  SCIC_REMOTE_DEVICE_NOT_READY_SMP_REQUEST_STARTED, SCIC_REMOTE_DEVICE_NOT_READY_REASON_CODE_MAX
}
 

Functions

void isci_remote_device_release (struct kref *kref)
 
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)
 
enum sci_status sci_remote_device_stop (struct isci_remote_device *idev, u32 timeout)
 
enum sci_status sci_remote_device_reset (struct isci_remote_device *idev)
 
enum sci_status sci_remote_device_reset_complete (struct isci_remote_device *idev)
 
const chardev_state_name (enum sci_remote_device_states state)
 
void isci_dev_set_hang_detection_timeout (struct isci_remote_device *idev, u32 timeout)
 
enum sci_status sci_remote_device_frame_handler (struct isci_remote_device *idev, u32 frame_index)
 
enum sci_status sci_remote_device_event_handler (struct isci_remote_device *idev, u32 event_code)
 
enum sci_status sci_remote_device_start_io (struct isci_host *ihost, struct isci_remote_device *idev, struct isci_request *ireq)
 
enum sci_status sci_remote_device_start_task (struct isci_host *ihost, struct isci_remote_device *idev, struct isci_request *ireq)
 
enum sci_status sci_remote_device_complete_io (struct isci_host *ihost, struct isci_remote_device *idev, struct isci_request *ireq)
 
void sci_remote_device_post_request (struct isci_remote_device *idev, u32 request)
 
enum sci_status sci_remote_device_terminate_requests (struct isci_remote_device *idev)
 
int isci_remote_device_is_safe_to_abort (struct isci_remote_device *idev)
 
enum sci_status sci_remote_device_abort_requests_pending_abort (struct isci_remote_device *idev)
 
enum sci_status isci_remote_device_suspend (struct isci_host *ihost, struct isci_remote_device *idev)
 
enum sci_status sci_remote_device_resume (struct isci_remote_device *idev, scics_sds_remote_node_context_callback cb_fn, void *cb_p)
 
enum sci_status isci_remote_device_resume_from_abort (struct isci_host *ihost, struct isci_remote_device *idev)
 
enum sci_status isci_remote_device_reset (struct isci_host *ihost, struct isci_remote_device *idev)
 
enum sci_status isci_remote_device_reset_complete (struct isci_host *ihost, struct isci_remote_device *idev)
 
enum sci_status isci_remote_device_suspend_terminate (struct isci_host *ihost, struct isci_remote_device *idev, struct isci_request *ireq)
 
enum sci_status isci_remote_device_terminate_requests (struct isci_host *ihost, struct isci_remote_device *idev, struct isci_request *ireq)
 
enum sci_status sci_remote_device_suspend (struct isci_remote_device *idev, enum sci_remote_node_suspension_reasons reason)
 

Variables

enum sci_remote_device_states REMOTE_DEV_STATES
 

Macro Definition Documentation

#define C (   a)    SCI_##a

Definition at line 284 of file remote_device.h.

#define IDEV_ABORT_PATH_ACTIVE   7

Definition at line 89 of file remote_device.h.

#define IDEV_ABORT_PATH_RESUME_PENDING   8

Definition at line 90 of file remote_device.h.

#define IDEV_ALLOCATED   2

Definition at line 84 of file remote_device.h.

#define IDEV_GONE   3

Definition at line 85 of file remote_device.h.

#define IDEV_IO_NCQERROR   5

Definition at line 87 of file remote_device.h.

#define IDEV_IO_READY   4

Definition at line 86 of file remote_device.h.

#define IDEV_RNC_LLHANG_ENABLED   6

Definition at line 88 of file remote_device.h.

#define IDEV_START_PENDING   0

Definition at line 82 of file remote_device.h.

#define IDEV_STOP_PENDING   1

Definition at line 83 of file remote_device.h.

#define ISCI_REMOTE_DEVICE_START_TIMEOUT   5000

Definition at line 109 of file remote_device.h.

#define REMOTE_DEV_STATES
Value:
{\
C(DEV_INITIAL),\
C(DEV_STOPPED),\
C(DEV_STARTING),\
C(DEV_READY),\
C(STP_DEV_IDLE),\
C(STP_DEV_CMD),\
C(STP_DEV_NCQ),\
C(STP_DEV_NCQ_ERROR),\
C(STP_DEV_ATAPI_ERROR),\
C(STP_DEV_AWAIT_RESET),\
C(SMP_DEV_IDLE),\
C(SMP_DEV_CMD),\
C(DEV_STOPPING),\
C(DEV_FAILED),\
C(DEV_RESETTING),\
C(DEV_FINAL),\
}

enum sci_remote_device_states - This enumeration depicts all the states for the common remote device state machine. : Simply the initial state for the base remote device state machine.

: 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 is entered from the STOPPING state.

: This state indicates the the remote device is in the process of becoming ready (i.e. starting). In this state no new IO operations are permitted. This state is entered from the STOPPED state.

: This state indicates the remote device is now ready. Thus, the user is able to perform IO operations on the remote device. This state is entered from the STARTING state.

: This is the idle substate for the stp remote device. When there are no active IO for the device it is is in this state.

: This is the command state for for the STP remote device. This state is entered when the device is processing a non-NCQ command. The device object will fail any new start IO requests until this command is complete.

: This is the NCQ state for the STP remote device. This state is entered when the device is processing an NCQ reuqest. It will remain in this state so long as there is one or more NCQ requests being processed.

: This is the NCQ error state for the STP remote device. This state is entered when an SDB error FIS is received by the device object while in the NCQ state. The device object will only accept a READ LOG command while in this state.

: This is the ATAPI error state for the STP ATAPI remote device. This state is entered when ATAPI device sends error status FIS without data while the device object is in CMD state. A suspension event is expected in this state. The device object will resume right away.

: This is the READY substate indicates the device is waiting for the RESET task coming to be recovered from certain hardware specific error.

: This is the ready operational substate for the remote device. This is the normal operational state for a remote device.

: This is the suspended state for the remote device. This is the state that the device is placed in when a RNC suspend is received by the SCU hardware.

: This state indicates that the remote device is in the process of stopping. In this state no new IO operations are permitted, but existing IO operations are allowed to complete. This state is entered from the READY state. This state is entered from the FAILED state.

: This state indicates that the remote device has failed. In this state no new IO operations are permitted. This state is entered from the INITIALIZING state. This state is entered from the READY state.

: This state indicates the device is being reset. In this state no new IO operations are permitted. This state is entered from the READY state.

: Simply the final state for the base remote device state machine.

Definition at line 265 of file remote_device.h.

Enumeration Type Documentation

Enumerator:
SCIC_REMOTE_DEVICE_NOT_READY_START_REQUESTED 
SCIC_REMOTE_DEVICE_NOT_READY_STOP_REQUESTED 
SCIC_REMOTE_DEVICE_NOT_READY_SATA_REQUEST_STARTED 
SCIC_REMOTE_DEVICE_NOT_READY_SATA_SDB_ERROR_FIS_RECEIVED 
SCIC_REMOTE_DEVICE_NOT_READY_SMP_REQUEST_STARTED 
SCIC_REMOTE_DEVICE_NOT_READY_REASON_CODE_MAX 

Definition at line 64 of file remote_device.h.

Function Documentation

const char* dev_state_name ( enum sci_remote_device_states  state)

Definition at line 67 of file remote_device.c.

void isci_dev_set_hang_detection_timeout ( struct isci_remote_device idev,
u32  timeout 
)

Definition at line 1710 of file remote_device.c.

int isci_remote_device_found ( struct domain_device dev)

isci_remote_device_found() - This function is called by libsas when a remote device is discovered. A remote device object is created and started. the function then sleeps until the sci core device started message is received. : This parameter specifies the libsas domain device.

status, zero indicates success.

Definition at line 1613 of file remote_device.c.

void isci_remote_device_gone ( struct domain_device dev)

isci_remote_device_gone() - This function is called by libsas when a domain device is removed. : This parameter specifies the libsas domain device.

Definition at line 1591 of file remote_device.c.

int isci_remote_device_is_safe_to_abort ( struct isci_remote_device idev)

Definition at line 1684 of file remote_device.c.

void isci_remote_device_nuke_requests ( struct isci_host ihost,
struct isci_remote_device idev 
)
void isci_remote_device_release ( struct kref kref)

Definition at line 1533 of file remote_device.c.

enum sci_status isci_remote_device_reset ( struct isci_host ihost,
struct isci_remote_device idev 
)
enum sci_status isci_remote_device_reset_complete ( struct isci_host ihost,
struct isci_remote_device idev 
)

Definition at line 1696 of file remote_device.c.

enum sci_status isci_remote_device_resume_from_abort ( struct isci_host ihost,
struct isci_remote_device idev 
)

Definition at line 1408 of file remote_device.c.

enum sci_status isci_remote_device_stop ( struct isci_host ihost,
struct isci_remote_device idev 
)

isci_remote_device_stop() - This function is called internally to stop the remote device. : This parameter specifies the isci host object. : This parameter specifies the remote device.

The status of the ihost request to stop.

Definition at line 1557 of file remote_device.c.

enum sci_status isci_remote_device_suspend ( struct isci_host ihost,
struct isci_remote_device idev 
)
enum sci_status isci_remote_device_suspend_terminate ( struct isci_host ihost,
struct isci_remote_device idev,
struct isci_request ireq 
)

Definition at line 1658 of file remote_device.c.

enum sci_status isci_remote_device_terminate_requests ( struct isci_host ihost,
struct isci_remote_device idev,
struct isci_request ireq 
)

Definition at line 186 of file remote_device.c.

enum sci_status sci_remote_device_abort_requests_pending_abort ( struct isci_remote_device idev)

Definition at line 1690 of file remote_device.c.

enum sci_status sci_remote_device_complete_io ( struct isci_host ihost,
struct isci_remote_device idev,
struct isci_request ireq 
)

Definition at line 789 of file remote_device.c.

enum sci_status sci_remote_device_event_handler ( struct isci_remote_device idev,
u32  event_code 
)

Definition at line 567 of file remote_device.c.

enum sci_status sci_remote_device_frame_handler ( struct isci_remote_device idev,
u32  frame_index 
)

Definition at line 439 of file remote_device.c.

void sci_remote_device_post_request ( struct isci_remote_device idev,
u32  request 
)

Definition at line 953 of file remote_device.c.

enum sci_status sci_remote_device_reset ( struct isci_remote_device idev)

sci_remote_device_reset() - This method will reset the device making it ready for operation. This method must be called anytime the device is reset either through a SMP phy control or a port hard reset request. : This parameter specifies the device to be reset.

This method does not actually cause the device hardware to be reset. This method resets the software object so that it will be operational after a device hardware reset completes. An indication of whether the device reset was accepted. SCI_SUCCESS This value is returned if the device reset is started.

Definition at line 394 of file remote_device.c.

enum sci_status sci_remote_device_reset_complete ( struct isci_remote_device idev)

sci_remote_device_reset_complete() - This method informs the device object that the reset operation is complete and the device can resume operation again. : This parameter specifies the device which is to be informed of the reset complete operation.

An indication that the device is resuming operation. SCI_SUCCESS the device is resuming operation.

Definition at line 424 of file remote_device.c.

enum sci_status sci_remote_device_resume ( struct isci_remote_device idev,
scics_sds_remote_node_context_callback  cb_fn,
void cb_p 
)

Definition at line 1339 of file remote_device.c.

enum sci_status sci_remote_device_start_io ( struct isci_host ihost,
struct isci_remote_device idev,
struct isci_request ireq 
)

Definition at line 653 of file remote_device.c.

enum sci_status sci_remote_device_start_task ( struct isci_host ihost,
struct isci_remote_device idev,
struct isci_request ireq 
)

Definition at line 871 of file remote_device.c.

enum sci_status sci_remote_device_stop ( struct isci_remote_device idev,
u32  timeout 
)

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. : This parameter specifies the device to be stopped. : 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.

Definition at line 337 of file remote_device.c.

enum sci_status sci_remote_device_suspend ( struct isci_remote_device idev,
enum sci_remote_node_suspension_reasons  reason 
)

Definition at line 75 of file remote_device.c.

enum sci_status sci_remote_device_terminate_requests ( struct isci_remote_device idev)

Definition at line 331 of file remote_device.c.

Variable Documentation

enum sci_remote_device_states REMOTE_DEV_STATES

Definition at line 285 of file remote_device.h.