summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJacek Danecki <Jacek.Danecki@intel.com>2011-05-03 04:21:07 +0000
committerDan Williams <dan.j.williams@intel.com>2011-07-03 04:04:47 -0700
commita98a7426bc91700ac8613701daf8470efe2ad2d2 (patch)
tree9392fe150740a22b97b01d91224adb8121b5fb6d /drivers
parentb9988b8e7fcd80404c60462dc223df8c1f31550d (diff)
isci: rnc state machine table c99 conversion
This makes the subsequent patches to delete rnc->state_handler more clear. Signed-off-by: Jacek Danecki <Jacek.Danecki@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/isci/remote_node_context.c124
-rw-r--r--drivers/scsi/isci/remote_node_context.h5
2 files changed, 58 insertions, 71 deletions
diff --git a/drivers/scsi/isci/remote_node_context.c b/drivers/scsi/isci/remote_node_context.c
index 49d2dc5374f4..5e85a18a06de 100644
--- a/drivers/scsi/isci/remote_node_context.c
+++ b/drivers/scsi/isci/remote_node_context.c
@@ -788,80 +788,70 @@ static enum sci_status scic_sds_remote_node_context_await_suspension_state_event
/* --------------------------------------------------------------------------- */
static struct scic_sds_remote_node_context_handlers
-scic_sds_remote_node_context_state_handler_table[
- SCIC_SDS_REMOTE_NODE_CONTEXT_MAX_STATES] =
-{
- /* SCIC_SDS_REMOTE_NODE_CONTEXT_INITIAL_STATE */
- {
- scic_sds_remote_node_context_default_destruct_handler,
- scic_sds_remote_node_context_default_suspend_handler,
- scic_sds_remote_node_context_initial_state_resume_handler,
- scic_sds_remote_node_context_default_start_io_handler,
- scic_sds_remote_node_context_default_start_task_handler,
- scic_sds_remote_node_context_default_event_handler
+scic_sds_remote_node_context_state_handler_table[] = {
+ [SCIC_SDS_REMOTE_NODE_CONTEXT_INITIAL_STATE] = {
+ .destruct_handler = scic_sds_remote_node_context_default_destruct_handler,
+ .suspend_handler = scic_sds_remote_node_context_default_suspend_handler,
+ .resume_handler = scic_sds_remote_node_context_initial_state_resume_handler,
+ .start_io_handler = scic_sds_remote_node_context_default_start_io_handler,
+ .start_task_handler = scic_sds_remote_node_context_default_start_task_handler,
+ .event_handler = scic_sds_remote_node_context_default_event_handler
},
- /* SCIC_SDS_REMOTE_NODE_CONTEXT_POSTING_STATE */
- {
- scic_sds_remote_node_context_general_destruct_handler,
- scic_sds_remote_node_context_default_suspend_handler,
- scic_sds_remote_node_context_continue_to_resume_handler,
- scic_sds_remote_node_context_default_start_io_handler,
- scic_sds_remote_node_context_default_start_task_handler,
- scic_sds_remote_node_context_posting_state_event_handler
+ [SCIC_SDS_REMOTE_NODE_CONTEXT_POSTING_STATE] = {
+ .destruct_handler = scic_sds_remote_node_context_general_destruct_handler,
+ .suspend_handler = scic_sds_remote_node_context_default_suspend_handler,
+ .resume_handler = scic_sds_remote_node_context_continue_to_resume_handler,
+ .start_io_handler = scic_sds_remote_node_context_default_start_io_handler,
+ .start_task_handler = scic_sds_remote_node_context_default_start_task_handler,
+ .event_handler = scic_sds_remote_node_context_posting_state_event_handler
},
- /* SCIC_SDS_REMOTE_NODE_CONTEXT_INVALIDATING_STATE */
- {
- scic_sds_remote_node_context_invalidating_state_destruct_handler,
- scic_sds_remote_node_context_default_suspend_handler,
- scic_sds_remote_node_context_continue_to_resume_handler,
- scic_sds_remote_node_context_default_start_io_handler,
- scic_sds_remote_node_context_default_start_task_handler,
- scic_sds_remote_node_context_invalidating_state_event_handler
+ [SCIC_SDS_REMOTE_NODE_CONTEXT_INVALIDATING_STATE] = {
+ .destruct_handler = scic_sds_remote_node_context_invalidating_state_destruct_handler,
+ .suspend_handler = scic_sds_remote_node_context_default_suspend_handler,
+ .resume_handler = scic_sds_remote_node_context_continue_to_resume_handler,
+ .start_io_handler = scic_sds_remote_node_context_default_start_io_handler,
+ .start_task_handler = scic_sds_remote_node_context_default_start_task_handler,
+ .event_handler = scic_sds_remote_node_context_invalidating_state_event_handler
},
- /* SCIC_SDS_REMOTE_NODE_CONTEXT_RESUMING_STATE */
- {
- scic_sds_remote_node_context_general_destruct_handler,
- scic_sds_remote_node_context_default_suspend_handler,
- scic_sds_remote_node_context_continue_to_resume_handler,
- scic_sds_remote_node_context_default_start_io_handler,
- scic_sds_remote_node_context_success_start_task_handler,
- scic_sds_remote_node_context_resuming_state_event_handler
+ [SCIC_SDS_REMOTE_NODE_CONTEXT_RESUMING_STATE] = {
+ .destruct_handler = scic_sds_remote_node_context_general_destruct_handler,
+ .suspend_handler = scic_sds_remote_node_context_default_suspend_handler,
+ .resume_handler = scic_sds_remote_node_context_continue_to_resume_handler,
+ .start_io_handler = scic_sds_remote_node_context_default_start_io_handler,
+ .start_task_handler = scic_sds_remote_node_context_success_start_task_handler,
+ .event_handler = scic_sds_remote_node_context_resuming_state_event_handler
},
- /* SCIC_SDS_REMOTE_NODE_CONTEXT_READY_STATE */
- {
- scic_sds_remote_node_context_general_destruct_handler,
- scic_sds_remote_node_context_ready_state_suspend_handler,
- scic_sds_remote_node_context_default_resume_handler,
- scic_sds_remote_node_context_ready_state_start_io_handler,
- scic_sds_remote_node_context_success_start_task_handler,
- scic_sds_remote_node_context_ready_state_event_handler
+ [SCIC_SDS_REMOTE_NODE_CONTEXT_READY_STATE] = {
+ .destruct_handler = scic_sds_remote_node_context_general_destruct_handler,
+ .suspend_handler = scic_sds_remote_node_context_ready_state_suspend_handler,
+ .resume_handler = scic_sds_remote_node_context_default_resume_handler,
+ .start_io_handler = scic_sds_remote_node_context_ready_state_start_io_handler,
+ .start_task_handler = scic_sds_remote_node_context_success_start_task_handler,
+ .event_handler = scic_sds_remote_node_context_ready_state_event_handler
},
- /* SCIC_SDS_REMOTE_NODE_CONTEXT_TX_SUSPENDED_STATE */
- {
- scic_sds_remote_node_context_general_destruct_handler,
- scic_sds_remote_node_context_default_suspend_handler,
- scic_sds_remote_node_context_tx_suspended_state_resume_handler,
- scic_sds_remote_node_context_default_start_io_handler,
- scic_sds_remote_node_context_suspended_start_task_handler,
- scic_sds_remote_node_context_default_event_handler
+ [SCIC_SDS_REMOTE_NODE_CONTEXT_TX_SUSPENDED_STATE] = {
+ .destruct_handler = scic_sds_remote_node_context_general_destruct_handler,
+ .suspend_handler = scic_sds_remote_node_context_default_suspend_handler,
+ .resume_handler = scic_sds_remote_node_context_tx_suspended_state_resume_handler,
+ .start_io_handler = scic_sds_remote_node_context_default_start_io_handler,
+ .start_task_handler = scic_sds_remote_node_context_suspended_start_task_handler,
+ .event_handler = scic_sds_remote_node_context_default_event_handler
},
- /* SCIC_SDS_REMOTE_NODE_CONTEXT_TX_RX_SUSPENDED_STATE */
- {
- scic_sds_remote_node_context_general_destruct_handler,
- scic_sds_remote_node_context_default_suspend_handler,
- scic_sds_remote_node_context_tx_rx_suspended_state_resume_handler,
- scic_sds_remote_node_context_default_start_io_handler,
- scic_sds_remote_node_context_suspended_start_task_handler,
- scic_sds_remote_node_context_default_event_handler
+ [SCIC_SDS_REMOTE_NODE_CONTEXT_TX_RX_SUSPENDED_STATE] = {
+ .destruct_handler = scic_sds_remote_node_context_general_destruct_handler,
+ .suspend_handler = scic_sds_remote_node_context_default_suspend_handler,
+ .resume_handler = scic_sds_remote_node_context_tx_rx_suspended_state_resume_handler,
+ .start_io_handler = scic_sds_remote_node_context_default_start_io_handler,
+ .start_task_handler = scic_sds_remote_node_context_suspended_start_task_handler,
+ .event_handler = scic_sds_remote_node_context_default_event_handler
},
- /* SCIC_SDS_REMOTE_NODE_CONTEXT_AWAIT_SUSPENSION_STATE */
- {
- scic_sds_remote_node_context_general_destruct_handler,
- scic_sds_remote_node_context_default_suspend_handler,
- scic_sds_remote_node_context_await_suspension_state_resume_handler,
- scic_sds_remote_node_context_default_start_io_handler,
- scic_sds_remote_node_context_await_suspension_state_start_task_handler,
- scic_sds_remote_node_context_await_suspension_state_event_handler
+ [SCIC_SDS_REMOTE_NODE_CONTEXT_AWAIT_SUSPENSION_STATE] = {
+ .destruct_handler = scic_sds_remote_node_context_general_destruct_handler,
+ .suspend_handler = scic_sds_remote_node_context_default_suspend_handler,
+ .resume_handler = scic_sds_remote_node_context_await_suspension_state_resume_handler,
+ .start_io_handler = scic_sds_remote_node_context_default_start_io_handler,
+ .start_task_handler = scic_sds_remote_node_context_await_suspension_state_start_task_handler,
+ .event_handler = scic_sds_remote_node_context_await_suspension_state_event_handler
}
};
diff --git a/drivers/scsi/isci/remote_node_context.h b/drivers/scsi/isci/remote_node_context.h
index bc7914beb0c5..540a49a9c94d 100644
--- a/drivers/scsi/isci/remote_node_context.h
+++ b/drivers/scsi/isci/remote_node_context.h
@@ -201,10 +201,7 @@ enum scis_sds_remote_node_context_states {
* there is a request to supend the remote node context or when there is a TC
* completion where the remote node will be suspended by the hardware.
*/
- SCIC_SDS_REMOTE_NODE_CONTEXT_AWAIT_SUSPENSION_STATE,
-
- SCIC_SDS_REMOTE_NODE_CONTEXT_MAX_STATES
-
+ SCIC_SDS_REMOTE_NODE_CONTEXT_AWAIT_SUSPENSION_STATE
};
/**