Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 254315
b: refs/heads/master
c: 7fbafaa
h: refs/heads/master
i:
  254313: bf63e65
  254311: 0081cef
v: v3
  • Loading branch information
Henryk Dembkowski authored and Dan Williams committed Jul 3, 2011
1 parent b5706b5 commit 0812f59
Show file tree
Hide file tree
Showing 7 changed files with 185 additions and 255 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6e473dd112f95806a4bfd12eced5b73632d6c032
refs/heads/master: 7fbafaa51960cd2f2a7afa63829b4135c9682a75
3 changes: 0 additions & 3 deletions trunk/drivers/scsi/isci/core/sci_base_remote_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,6 @@ enum sci_base_remote_device_states {
* Simply the final state for the base remote device state machine.
*/
SCI_BASE_REMOTE_DEVICE_STATE_FINAL,

SCI_BASE_REMOTE_DEVICE_MAX_STATES

};

/**
Expand Down
284 changes: 129 additions & 155 deletions trunk/drivers/scsi/isci/core/scic_sds_remote_device.c

Large diffs are not rendered by default.

77 changes: 27 additions & 50 deletions trunk/drivers/scsi/isci/core/scic_sds_remote_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,21 @@ enum SCIC_SDS_SSP_REMOTE_DEVICE_READY_SUBSTATES {
SCIC_SDS_SSP_REMOTE_DEVICE_READY_SUBSTATE_INITIAL,

/**
* This is the ready operational substate for the remote device. This is the
* normal operational state for a remote device.
* This is the ready operational substate for the remote device.
* This is the normal operational state for a remote device.
*/
SCIC_SDS_SSP_REMOTE_DEVICE_READY_SUBSTATE_OPERATIONAL,

/**
* 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 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.
*/
SCIC_SDS_SSP_REMOTE_DEVICE_READY_SUBSTATE_SUSPENDED,

/**
* This is the final state that the device is placed in before a change to the
* base state machine.
* This is the final state that the device is placed in before a change
* to the base state machine.
*/
SCIC_SDS_SSP_REMOTE_DEVICE_READY_SUBSTATE_FINAL,

Expand All @@ -110,8 +111,8 @@ enum SCIC_SDS_SSP_REMOTE_DEVICE_READY_SUBSTATES {
/**
* enum SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATES -
*
* This is the enumeration for the struct scic_sds_remote_device ready substates for
* the STP remote device.
* This is the enumeration for the struct scic_sds_remote_device ready substates
* for the STP remote device.
*/
enum SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATES {
/**
Expand Down Expand Up @@ -161,13 +162,11 @@ enum SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATES {
SCIC_SDS_STP_REMOTE_DEVICE_READY_MAX_SUBSTATES
};


/**
* enum SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATES -
*
* This is the enumeration of the ready substates for the SMP REMOTE DEVICE.
*/

enum SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATES {
/**
* This is the ready operational substate for the remote device. This is the
Expand All @@ -184,9 +183,6 @@ enum SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATES {
SCIC_SDS_SMP_REMOTE_DEVICE_READY_MAX_SUBSTATES
};




/**
* struct scic_sds_remote_device - This structure contains the data for an SCU
* implementation of the SCU Core device data.
Expand Down Expand Up @@ -223,21 +219,22 @@ struct scic_sds_remote_device {
struct sci_sas_address device_address;

/**
* This filed is assinged the value of true if the device is directly attached
* to the port.
* This filed is assinged the value of true if the device is directly
* attached to the port.
*/
bool is_direct_attached;

#if !defined(DISABLE_ATAPI)
/**
* This filed is assinged the value of true if the device is an ATAPI device.
* This filed is assinged the value of true if the device is an ATAPI
* device.
*/
bool is_atapi;
#endif

/**
* This filed contains a pointer back to the port to which this device is
* assigned.
* This filed contains a pointer back to the port to which this device
* is assigned.
*/
struct scic_sds_port *owning_port;

Expand Down Expand Up @@ -284,29 +281,28 @@ struct scic_sds_remote_device {
* This field maintains the set of state handlers for the remote device
* object. These are changed each time the remote device enters a new state.
*/
struct scic_sds_remote_device_state_handler *state_handlers;
const struct scic_sds_remote_device_state_handler *state_handlers;
};


typedef enum sci_status (*SCIC_SDS_REMOTE_DEVICE_HANDLER_T)(
typedef enum sci_status (*scic_sds_remote_device_handler_t)(
struct scic_sds_remote_device *this_device);

typedef enum sci_status (*SCIC_SDS_REMOTE_DEVICE_SUSPEND_HANDLER_T)(
typedef enum sci_status (*scic_sds_remote_device_suspend_handler_t)(
struct scic_sds_remote_device *this_device,
u32 suspend_type);

typedef enum sci_status (*SCIC_SDS_REMOTE_DEVICE_RESUME_HANDLER_T)(
typedef enum sci_status (*scic_sds_remote_device_resume_handler_t)(
struct scic_sds_remote_device *this_device);

typedef enum sci_status (*SCIC_SDS_REMOTE_DEVICE_FRAME_HANDLER_T)(
typedef enum sci_status (*scic_sds_remote_device_frame_handler_t)(
struct scic_sds_remote_device *this_device,
u32 frame_index);

typedef enum sci_status (*SCIC_SDS_REMOTE_DEVICE_EVENT_HANDLER_T)(
typedef enum sci_status (*scic_sds_remote_device_event_handler_t)(
struct scic_sds_remote_device *this_device,
u32 event_code);

typedef void (*SCIC_SDS_REMOTE_DEVICE_READY_NOT_READY_HANDLER_T)(
typedef void (*scic_sds_remote_device_ready_not_ready_handler_t)(
struct scic_sds_remote_device *this_device);

/**
Expand All @@ -318,23 +314,18 @@ typedef void (*SCIC_SDS_REMOTE_DEVICE_READY_NOT_READY_HANDLER_T)(
*/
struct scic_sds_remote_device_state_handler {
struct sci_base_remote_device_state_handler parent;

SCIC_SDS_REMOTE_DEVICE_SUSPEND_HANDLER_T suspend_handler;
SCIC_SDS_REMOTE_DEVICE_RESUME_HANDLER_T resume_handler;

SCIC_SDS_REMOTE_DEVICE_EVENT_HANDLER_T event_handler;
SCIC_SDS_REMOTE_DEVICE_FRAME_HANDLER_T frame_handler;

scic_sds_remote_device_suspend_handler_t suspend_handler;
scic_sds_remote_device_resume_handler_t resume_handler;
scic_sds_remote_device_event_handler_t event_handler;
scic_sds_remote_device_frame_handler_t frame_handler;
};


extern const struct sci_base_state scic_sds_remote_device_state_table[];
extern const struct sci_base_state scic_sds_ssp_remote_device_ready_substate_table[];
extern const struct sci_base_state scic_sds_stp_remote_device_ready_substate_table[];
extern const struct sci_base_state scic_sds_smp_remote_device_ready_substate_table[];

extern struct scic_sds_remote_device_state_handler
scic_sds_remote_device_state_handler_table[];
extern const struct scic_sds_remote_device_state_handler scic_sds_remote_device_state_handler_table[];
extern struct scic_sds_remote_device_state_handler
scic_sds_ssp_remote_device_ready_substate_handler_table[];
extern struct scic_sds_remote_device_state_handler
Expand Down Expand Up @@ -480,10 +471,6 @@ extern struct scic_sds_remote_device_state_handler
#define scic_sds_remote_device_set_working_request(device, request) \
((device)->working_request = (request))

/* --------------------------------------------------------------------------- */



enum sci_status scic_sds_remote_device_frame_handler(
struct scic_sds_remote_device *this_device,
u32 frame_index);
Expand Down Expand Up @@ -525,10 +512,6 @@ bool scic_sds_remote_device_is_atapi(
#define scic_sds_remote_device_is_atapi(this_device) false
#endif /* !defined(DISABLE_ATAPI) */

/* --------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------- */

void scic_sds_remote_device_start_request(
struct scic_sds_remote_device *this_device,
struct scic_sds_request *the_request,
Expand All @@ -540,7 +523,6 @@ void scic_sds_remote_device_continue_request(
enum sci_status scic_sds_remote_device_default_start_handler(
struct sci_base_remote_device *this_device);


enum sci_status scic_sds_remote_device_default_fail_handler(
struct sci_base_remote_device *this_device);

Expand Down Expand Up @@ -577,8 +559,6 @@ enum sci_status scic_sds_remote_device_default_frame_handler(
struct scic_sds_remote_device *this_device,
u32 frame_index);

/* --------------------------------------------------------------------------- */

enum sci_status scic_sds_remote_device_ready_state_stop_handler(
struct sci_base_remote_device *device);

Expand All @@ -596,7 +576,4 @@ enum sci_status scic_sds_remote_device_general_event_handler(
enum sci_status scic_sds_ssp_remote_device_ready_suspended_substate_resume_handler(
struct scic_sds_remote_device *this_device);

/* --------------------------------------------------------------------------- */


#endif /* _SCIC_SDS_REMOTE_DEVICE_H_ */
26 changes: 13 additions & 13 deletions trunk/drivers/scsi/isci/core/scic_sds_remote_node_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ void scic_sds_remote_node_context_construct_buffer(
*/
static void scic_sds_remote_node_context_setup_to_resume(
struct scic_sds_remote_node_context *this_rnc,
SCICS_SDS_REMOTE_NODE_CONTEXT_CALLBACK the_callback,
scics_sds_remote_node_context_callback the_callback,
void *callback_parameter)
{
if (this_rnc->destination_state != SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_FINAL) {
Expand All @@ -216,7 +216,7 @@ static void scic_sds_remote_node_context_setup_to_resume(
*/
static void scic_sds_remote_node_context_setup_to_destory(
struct scic_sds_remote_node_context *this_rnc,
SCICS_SDS_REMOTE_NODE_CONTEXT_CALLBACK the_callback,
scics_sds_remote_node_context_callback the_callback,
void *callback_parameter)
{
this_rnc->destination_state = SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_FINAL;
Expand All @@ -234,7 +234,7 @@ static void scic_sds_remote_node_context_setup_to_destory(
*/
static enum sci_status scic_sds_remote_node_context_continue_to_resume_handler(
struct scic_sds_remote_node_context *this_rnc,
SCICS_SDS_REMOTE_NODE_CONTEXT_CALLBACK the_callback,
scics_sds_remote_node_context_callback the_callback,
void *callback_parameter)
{
if (this_rnc->destination_state == SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_READY) {
Expand All @@ -251,7 +251,7 @@ static enum sci_status scic_sds_remote_node_context_continue_to_resume_handler(

static enum sci_status scic_sds_remote_node_context_default_destruct_handler(
struct scic_sds_remote_node_context *this_rnc,
SCICS_SDS_REMOTE_NODE_CONTEXT_CALLBACK the_callback,
scics_sds_remote_node_context_callback the_callback,
void *callback_parameter)
{
dev_warn(scirdev_to_dev(this_rnc->device),
Expand All @@ -270,7 +270,7 @@ static enum sci_status scic_sds_remote_node_context_default_destruct_handler(
static enum sci_status scic_sds_remote_node_context_default_suspend_handler(
struct scic_sds_remote_node_context *this_rnc,
u32 suspend_type,
SCICS_SDS_REMOTE_NODE_CONTEXT_CALLBACK the_callback,
scics_sds_remote_node_context_callback the_callback,
void *callback_parameter)
{
dev_warn(scirdev_to_dev(this_rnc->device),
Expand All @@ -285,7 +285,7 @@ static enum sci_status scic_sds_remote_node_context_default_suspend_handler(

static enum sci_status scic_sds_remote_node_context_default_resume_handler(
struct scic_sds_remote_node_context *this_rnc,
SCICS_SDS_REMOTE_NODE_CONTEXT_CALLBACK the_callback,
scics_sds_remote_node_context_callback the_callback,
void *callback_parameter)
{
dev_warn(scirdev_to_dev(this_rnc->device),
Expand Down Expand Up @@ -372,7 +372,7 @@ static enum sci_status scic_sds_remote_node_context_success_start_task_handler(
*/
static enum sci_status scic_sds_remote_node_context_general_destruct_handler(
struct scic_sds_remote_node_context *this_rnc,
SCICS_SDS_REMOTE_NODE_CONTEXT_CALLBACK the_callback,
scics_sds_remote_node_context_callback the_callback,
void *callback_parameter)
{
scic_sds_remote_node_context_setup_to_destory(
Expand All @@ -391,7 +391,7 @@ static enum sci_status scic_sds_remote_node_context_general_destruct_handler(

static enum sci_status scic_sds_remote_node_context_initial_state_resume_handler(
struct scic_sds_remote_node_context *this_rnc,
SCICS_SDS_REMOTE_NODE_CONTEXT_CALLBACK the_callback,
scics_sds_remote_node_context_callback the_callback,
void *callback_parameter)
{
if (this_rnc->remote_node_index != SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX) {
Expand Down Expand Up @@ -449,7 +449,7 @@ static enum sci_status scic_sds_remote_node_context_posting_state_event_handler(

static enum sci_status scic_sds_remote_node_context_invalidating_state_destruct_handler(
struct scic_sds_remote_node_context *this_rnc,
SCICS_SDS_REMOTE_NODE_CONTEXT_CALLBACK the_callback,
scics_sds_remote_node_context_callback the_callback,
void *callback_parameter)
{
scic_sds_remote_node_context_setup_to_destory(
Expand Down Expand Up @@ -575,7 +575,7 @@ static enum sci_status scic_sds_remote_node_context_resuming_state_event_handler
static enum sci_status scic_sds_remote_node_context_ready_state_suspend_handler(
struct scic_sds_remote_node_context *this_rnc,
u32 suspend_type,
SCICS_SDS_REMOTE_NODE_CONTEXT_CALLBACK the_callback,
scics_sds_remote_node_context_callback the_callback,
void *callback_parameter)
{
this_rnc->user_callback = the_callback;
Expand Down Expand Up @@ -662,7 +662,7 @@ static enum sci_status scic_sds_remote_node_context_ready_state_event_handler(

static enum sci_status scic_sds_remote_node_context_tx_suspended_state_resume_handler(
struct scic_sds_remote_node_context *this_rnc,
SCICS_SDS_REMOTE_NODE_CONTEXT_CALLBACK the_callback,
scics_sds_remote_node_context_callback the_callback,
void *callback_parameter)
{
enum sci_status status;
Expand Down Expand Up @@ -737,7 +737,7 @@ static enum sci_status scic_sds_remote_node_context_suspended_start_task_handler

static enum sci_status scic_sds_remote_node_context_tx_rx_suspended_state_resume_handler(
struct scic_sds_remote_node_context *this_rnc,
SCICS_SDS_REMOTE_NODE_CONTEXT_CALLBACK the_callback,
scics_sds_remote_node_context_callback the_callback,
void *callback_parameter)
{
scic_sds_remote_node_context_setup_to_resume(
Expand All @@ -761,7 +761,7 @@ static enum sci_status scic_sds_remote_node_context_tx_rx_suspended_state_resume
*/
static enum sci_status scic_sds_remote_node_context_await_suspension_state_resume_handler(
struct scic_sds_remote_node_context *this_rnc,
SCICS_SDS_REMOTE_NODE_CONTEXT_CALLBACK the_callback,
scics_sds_remote_node_context_callback the_callback,
void *callback_parameter)
{
scic_sds_remote_node_context_setup_to_resume(
Expand Down
Loading

0 comments on commit 0812f59

Please sign in to comment.