Skip to content

Commit

Permalink
isci: state machine cleanup
Browse files Browse the repository at this point in the history
This cleans up several areas of the state machine mechanism:

 o Rename sci_base_state_machine_change_state to sci_change_state
 o Remove sci_base_state_machine_get_state function
 o Rename 'state_machine' struct member to 'sm' in client structs
 o Shorten the name of request states
 o Shorten state machine state names as follows:
        SCI_BASE_CONTROLLER_STATE_xxx to SCIC_xxx
        SCI_BASE_PHY_STATE_xxx to SCI_PHY_xxx
        SCIC_SDS_PHY_STARTING_SUBSTATE_xxx to SCI_PHY_SUB_xxx
        SCI_BASE_PORT_STATE_xxx to SCI_PORT_xxx and
        SCIC_SDS_PORT_READY_SUBSTATE_xxx to SCI_PORT_SUB_xxx
        SCI_BASE_REMOTE_DEVICE_STATE_xxx to SCI_DEV_xxx
        SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_xxx to SCI_STP_DEV_xxx
        SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_xxx to SCI_SMP_DEV_xxx
        SCIC_SDS_REMOTE_NODE_CONTEXT_xxx_STATE to SCI_RNC_xxx

Signed-off-by: Edmund Nadolski <edmund.nadolski@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
  • Loading branch information
Edmund Nadolski authored and Dan Williams committed Jul 3, 2011
1 parent 8d2c65c commit e301370
Show file tree
Hide file tree
Showing 15 changed files with 1,076 additions and 1,160 deletions.
201 changes: 89 additions & 112 deletions drivers/scsi/isci/host.c

Large diffs are not rendered by default.

25 changes: 11 additions & 14 deletions drivers/scsi/isci/host.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ struct scic_sds_controller {
* This field contains the information for the base controller state
* machine.
*/
struct sci_base_state_machine state_machine;
struct sci_base_state_machine sm;

/**
* Timer for controller start/stop operations.
Expand Down Expand Up @@ -359,7 +359,7 @@ enum scic_sds_controller_states {
/**
* Simply the initial state for the base controller state machine.
*/
SCI_BASE_CONTROLLER_STATE_INITIAL = 0,
SCIC_INITIAL = 0,

/**
* This state indicates that the controller is reset. The memory for
Expand All @@ -368,36 +368,36 @@ enum scic_sds_controller_states {
* This state is entered from the INITIAL state.
* This state is entered from the RESETTING state.
*/
SCI_BASE_CONTROLLER_STATE_RESET,
SCIC_RESET,

/**
* This state is typically an action state that indicates the controller
* is in the process of initialization. In this state no new IO operations
* are permitted.
* This state is entered from the RESET state.
*/
SCI_BASE_CONTROLLER_STATE_INITIALIZING,
SCIC_INITIALIZING,

/**
* This state indicates that the controller has been successfully
* initialized. In this state no new IO operations are permitted.
* This state is entered from the INITIALIZING state.
*/
SCI_BASE_CONTROLLER_STATE_INITIALIZED,
SCIC_INITIALIZED,

/**
* This state indicates the the controller 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 INITIALIZED state.
*/
SCI_BASE_CONTROLLER_STATE_STARTING,
SCIC_STARTING,

/**
* This state indicates the controller is now ready. Thus, the user
* is able to perform IO operations on the controller.
* This state is entered from the STARTING state.
*/
SCI_BASE_CONTROLLER_STATE_READY,
SCIC_READY,

/**
* This state is typically an action state that indicates the controller
Expand All @@ -408,22 +408,22 @@ enum scic_sds_controller_states {
* This state is entered from the FAILED state.
* This state is entered from the STOPPED state.
*/
SCI_BASE_CONTROLLER_STATE_RESETTING,
SCIC_RESETTING,

/**
* This state indicates that the controller 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.
*/
SCI_BASE_CONTROLLER_STATE_STOPPING,
SCIC_STOPPING,

/**
* This state indicates that the controller has successfully been stopped.
* In this state no new IO operations are permitted.
* This state is entered from the STOPPING state.
*/
SCI_BASE_CONTROLLER_STATE_STOPPED,
SCIC_STOPPED,

/**
* This state indicates that the controller could not successfully be
Expand All @@ -433,10 +433,7 @@ enum scic_sds_controller_states {
* This state is entered from the STOPPING state.
* This state is entered from the RESETTING state.
*/
SCI_BASE_CONTROLLER_STATE_FAILED,

SCI_BASE_CONTROLLER_MAX_STATES

SCIC_FAILED,
};


Expand Down
Loading

0 comments on commit e301370

Please sign in to comment.