Commit 7fbafaa5 authored by Henryk Dembkowski's avatar Henryk Dembkowski Committed by Dan Williams

isci: remote device and node cleanup step1

c99 the struct initializers (scic_sds_remote_device_state_handler_table[]):
	1/ allows grep to consistently show method name associations.  The
	   naming is mostly consistent (except when it isn't) so this guarantees
	   coverage of present and future exception cases.
	2/ let's the compiler guarantee that the state table array entry
	   correlates with an actual state name and detect accidental reordering or
	   deletion of states.
	3/ allows default handler's to be identified easily

Change names from upper to low letters

Cleanup empty lines
Signed-off-by: default avatarHenryk Dembkowski <henryk.dembkowski@intel.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 6e473dd1
...@@ -130,9 +130,6 @@ enum sci_base_remote_device_states { ...@@ -130,9 +130,6 @@ enum sci_base_remote_device_states {
* Simply the final state for the base remote device state machine. * Simply the final state for the base remote device state machine.
*/ */
SCI_BASE_REMOTE_DEVICE_STATE_FINAL, SCI_BASE_REMOTE_DEVICE_STATE_FINAL,
SCI_BASE_REMOTE_DEVICE_MAX_STATES
}; };
/** /**
......
...@@ -87,20 +87,21 @@ enum SCIC_SDS_SSP_REMOTE_DEVICE_READY_SUBSTATES { ...@@ -87,20 +87,21 @@ enum SCIC_SDS_SSP_REMOTE_DEVICE_READY_SUBSTATES {
SCIC_SDS_SSP_REMOTE_DEVICE_READY_SUBSTATE_INITIAL, SCIC_SDS_SSP_REMOTE_DEVICE_READY_SUBSTATE_INITIAL,
/** /**
* This is the ready operational substate for the remote device. This is the * This is the ready operational substate for the remote device.
* normal operational state for a remote device. * This is the normal operational state for a remote device.
*/ */
SCIC_SDS_SSP_REMOTE_DEVICE_READY_SUBSTATE_OPERATIONAL, SCIC_SDS_SSP_REMOTE_DEVICE_READY_SUBSTATE_OPERATIONAL,
/** /**
* This is the suspended state for the remote device. This is the state that * This is the suspended state for the remote device. This is the state
* the device is placed in when a RNC suspend is received by the SCU hardware. * that the device is placed in when a RNC suspend is received by
* the SCU hardware.
*/ */
SCIC_SDS_SSP_REMOTE_DEVICE_READY_SUBSTATE_SUSPENDED, SCIC_SDS_SSP_REMOTE_DEVICE_READY_SUBSTATE_SUSPENDED,
/** /**
* This is the final state that the device is placed in before a change to the * This is the final state that the device is placed in before a change
* base state machine. * to the base state machine.
*/ */
SCIC_SDS_SSP_REMOTE_DEVICE_READY_SUBSTATE_FINAL, SCIC_SDS_SSP_REMOTE_DEVICE_READY_SUBSTATE_FINAL,
...@@ -110,8 +111,8 @@ enum SCIC_SDS_SSP_REMOTE_DEVICE_READY_SUBSTATES { ...@@ -110,8 +111,8 @@ enum SCIC_SDS_SSP_REMOTE_DEVICE_READY_SUBSTATES {
/** /**
* enum SCIC_SDS_STP_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 * This is the enumeration for the struct scic_sds_remote_device ready substates
* the STP remote device. * for the STP remote device.
*/ */
enum SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATES { enum SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATES {
/** /**
...@@ -161,13 +162,11 @@ enum SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATES { ...@@ -161,13 +162,11 @@ enum SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATES {
SCIC_SDS_STP_REMOTE_DEVICE_READY_MAX_SUBSTATES SCIC_SDS_STP_REMOTE_DEVICE_READY_MAX_SUBSTATES
}; };
/** /**
* enum SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATES - * enum SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATES -
* *
* This is the enumeration of the ready substates for the SMP REMOTE DEVICE. * This is the enumeration of the ready substates for the SMP REMOTE DEVICE.
*/ */
enum SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATES { enum SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATES {
/** /**
* This is the ready operational substate for the remote device. This is the * This is the ready operational substate for the remote device. This is the
...@@ -184,9 +183,6 @@ enum SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATES { ...@@ -184,9 +183,6 @@ enum SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATES {
SCIC_SDS_SMP_REMOTE_DEVICE_READY_MAX_SUBSTATES SCIC_SDS_SMP_REMOTE_DEVICE_READY_MAX_SUBSTATES
}; };
/** /**
* struct scic_sds_remote_device - This structure contains the data for an SCU * struct scic_sds_remote_device - This structure contains the data for an SCU
* implementation of the SCU Core device data. * implementation of the SCU Core device data.
...@@ -223,21 +219,22 @@ struct scic_sds_remote_device { ...@@ -223,21 +219,22 @@ struct scic_sds_remote_device {
struct sci_sas_address device_address; struct sci_sas_address device_address;
/** /**
* This filed is assinged the value of true if the device is directly attached * This filed is assinged the value of true if the device is directly
* to the port. * attached to the port.
*/ */
bool is_direct_attached; bool is_direct_attached;
#if !defined(DISABLE_ATAPI) #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; bool is_atapi;
#endif #endif
/** /**
* This filed contains a pointer back to the port to which this device is * This filed contains a pointer back to the port to which this device
* assigned. * is assigned.
*/ */
struct scic_sds_port *owning_port; struct scic_sds_port *owning_port;
...@@ -284,29 +281,28 @@ struct scic_sds_remote_device { ...@@ -284,29 +281,28 @@ struct scic_sds_remote_device {
* This field maintains the set of state handlers for the 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. * 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); 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, struct scic_sds_remote_device *this_device,
u32 suspend_type); 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); 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, struct scic_sds_remote_device *this_device,
u32 frame_index); 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, struct scic_sds_remote_device *this_device,
u32 event_code); 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); struct scic_sds_remote_device *this_device);
/** /**
...@@ -318,23 +314,18 @@ typedef void (*SCIC_SDS_REMOTE_DEVICE_READY_NOT_READY_HANDLER_T)( ...@@ -318,23 +314,18 @@ typedef void (*SCIC_SDS_REMOTE_DEVICE_READY_NOT_READY_HANDLER_T)(
*/ */
struct scic_sds_remote_device_state_handler { struct scic_sds_remote_device_state_handler {
struct sci_base_remote_device_state_handler parent; struct sci_base_remote_device_state_handler parent;
scic_sds_remote_device_suspend_handler_t suspend_handler;
SCIC_SDS_REMOTE_DEVICE_SUSPEND_HANDLER_T suspend_handler; scic_sds_remote_device_resume_handler_t resume_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_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_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_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_stp_remote_device_ready_substate_table[];
extern const struct sci_base_state scic_sds_smp_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 extern const struct scic_sds_remote_device_state_handler scic_sds_remote_device_state_handler_table[];
scic_sds_remote_device_state_handler_table[];
extern struct scic_sds_remote_device_state_handler extern struct scic_sds_remote_device_state_handler
scic_sds_ssp_remote_device_ready_substate_handler_table[]; scic_sds_ssp_remote_device_ready_substate_handler_table[];
extern struct scic_sds_remote_device_state_handler extern struct scic_sds_remote_device_state_handler
...@@ -480,10 +471,6 @@ extern struct scic_sds_remote_device_state_handler ...@@ -480,10 +471,6 @@ extern struct scic_sds_remote_device_state_handler
#define scic_sds_remote_device_set_working_request(device, request) \ #define scic_sds_remote_device_set_working_request(device, request) \
((device)->working_request = (request)) ((device)->working_request = (request))
/* --------------------------------------------------------------------------- */
enum sci_status scic_sds_remote_device_frame_handler( enum sci_status scic_sds_remote_device_frame_handler(
struct scic_sds_remote_device *this_device, struct scic_sds_remote_device *this_device,
u32 frame_index); u32 frame_index);
...@@ -525,10 +512,6 @@ bool scic_sds_remote_device_is_atapi( ...@@ -525,10 +512,6 @@ bool scic_sds_remote_device_is_atapi(
#define scic_sds_remote_device_is_atapi(this_device) false #define scic_sds_remote_device_is_atapi(this_device) false
#endif /* !defined(DISABLE_ATAPI) */ #endif /* !defined(DISABLE_ATAPI) */
/* --------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------- */
void scic_sds_remote_device_start_request( void scic_sds_remote_device_start_request(
struct scic_sds_remote_device *this_device, struct scic_sds_remote_device *this_device,
struct scic_sds_request *the_request, struct scic_sds_request *the_request,
...@@ -540,7 +523,6 @@ void scic_sds_remote_device_continue_request( ...@@ -540,7 +523,6 @@ void scic_sds_remote_device_continue_request(
enum sci_status scic_sds_remote_device_default_start_handler( enum sci_status scic_sds_remote_device_default_start_handler(
struct sci_base_remote_device *this_device); struct sci_base_remote_device *this_device);
enum sci_status scic_sds_remote_device_default_fail_handler( enum sci_status scic_sds_remote_device_default_fail_handler(
struct sci_base_remote_device *this_device); struct sci_base_remote_device *this_device);
...@@ -577,8 +559,6 @@ enum sci_status scic_sds_remote_device_default_frame_handler( ...@@ -577,8 +559,6 @@ enum sci_status scic_sds_remote_device_default_frame_handler(
struct scic_sds_remote_device *this_device, struct scic_sds_remote_device *this_device,
u32 frame_index); u32 frame_index);
/* --------------------------------------------------------------------------- */
enum sci_status scic_sds_remote_device_ready_state_stop_handler( enum sci_status scic_sds_remote_device_ready_state_stop_handler(
struct sci_base_remote_device *device); struct sci_base_remote_device *device);
...@@ -596,7 +576,4 @@ enum sci_status scic_sds_remote_device_general_event_handler( ...@@ -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( enum sci_status scic_sds_ssp_remote_device_ready_suspended_substate_resume_handler(
struct scic_sds_remote_device *this_device); struct scic_sds_remote_device *this_device);
/* --------------------------------------------------------------------------- */
#endif /* _SCIC_SDS_REMOTE_DEVICE_H_ */ #endif /* _SCIC_SDS_REMOTE_DEVICE_H_ */
...@@ -195,7 +195,7 @@ void scic_sds_remote_node_context_construct_buffer( ...@@ -195,7 +195,7 @@ void scic_sds_remote_node_context_construct_buffer(
*/ */
static void scic_sds_remote_node_context_setup_to_resume( static void scic_sds_remote_node_context_setup_to_resume(
struct scic_sds_remote_node_context *this_rnc, 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) void *callback_parameter)
{ {
if (this_rnc->destination_state != SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_FINAL) { if (this_rnc->destination_state != SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_FINAL) {
...@@ -216,7 +216,7 @@ static void scic_sds_remote_node_context_setup_to_resume( ...@@ -216,7 +216,7 @@ static void scic_sds_remote_node_context_setup_to_resume(
*/ */
static void scic_sds_remote_node_context_setup_to_destory( static void scic_sds_remote_node_context_setup_to_destory(
struct scic_sds_remote_node_context *this_rnc, 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) void *callback_parameter)
{ {
this_rnc->destination_state = SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_FINAL; this_rnc->destination_state = SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_FINAL;
...@@ -234,7 +234,7 @@ static void scic_sds_remote_node_context_setup_to_destory( ...@@ -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( static enum sci_status scic_sds_remote_node_context_continue_to_resume_handler(
struct scic_sds_remote_node_context *this_rnc, 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) void *callback_parameter)
{ {
if (this_rnc->destination_state == SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_READY) { if (this_rnc->destination_state == SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_READY) {
...@@ -251,7 +251,7 @@ static enum sci_status scic_sds_remote_node_context_continue_to_resume_handler( ...@@ -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( static enum sci_status scic_sds_remote_node_context_default_destruct_handler(
struct scic_sds_remote_node_context *this_rnc, 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) void *callback_parameter)
{ {
dev_warn(scirdev_to_dev(this_rnc->device), dev_warn(scirdev_to_dev(this_rnc->device),
...@@ -270,7 +270,7 @@ static enum sci_status scic_sds_remote_node_context_default_destruct_handler( ...@@ -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( static enum sci_status scic_sds_remote_node_context_default_suspend_handler(
struct scic_sds_remote_node_context *this_rnc, struct scic_sds_remote_node_context *this_rnc,
u32 suspend_type, u32 suspend_type,
SCICS_SDS_REMOTE_NODE_CONTEXT_CALLBACK the_callback, scics_sds_remote_node_context_callback the_callback,
void *callback_parameter) void *callback_parameter)
{ {
dev_warn(scirdev_to_dev(this_rnc->device), dev_warn(scirdev_to_dev(this_rnc->device),
...@@ -285,7 +285,7 @@ static enum sci_status scic_sds_remote_node_context_default_suspend_handler( ...@@ -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( static enum sci_status scic_sds_remote_node_context_default_resume_handler(
struct scic_sds_remote_node_context *this_rnc, 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) void *callback_parameter)
{ {
dev_warn(scirdev_to_dev(this_rnc->device), dev_warn(scirdev_to_dev(this_rnc->device),
...@@ -372,7 +372,7 @@ static enum sci_status scic_sds_remote_node_context_success_start_task_handler( ...@@ -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( static enum sci_status scic_sds_remote_node_context_general_destruct_handler(
struct scic_sds_remote_node_context *this_rnc, 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) void *callback_parameter)
{ {
scic_sds_remote_node_context_setup_to_destory( scic_sds_remote_node_context_setup_to_destory(
...@@ -391,7 +391,7 @@ static enum sci_status scic_sds_remote_node_context_general_destruct_handler( ...@@ -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( static enum sci_status scic_sds_remote_node_context_initial_state_resume_handler(
struct scic_sds_remote_node_context *this_rnc, 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) void *callback_parameter)
{ {
if (this_rnc->remote_node_index != SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX) { if (this_rnc->remote_node_index != SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX) {
...@@ -449,7 +449,7 @@ static enum sci_status scic_sds_remote_node_context_posting_state_event_handler( ...@@ -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( static enum sci_status scic_sds_remote_node_context_invalidating_state_destruct_handler(
struct scic_sds_remote_node_context *this_rnc, 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) void *callback_parameter)
{ {
scic_sds_remote_node_context_setup_to_destory( scic_sds_remote_node_context_setup_to_destory(
...@@ -575,7 +575,7 @@ static enum sci_status scic_sds_remote_node_context_resuming_state_event_handler ...@@ -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( static enum sci_status scic_sds_remote_node_context_ready_state_suspend_handler(
struct scic_sds_remote_node_context *this_rnc, struct scic_sds_remote_node_context *this_rnc,
u32 suspend_type, u32 suspend_type,
SCICS_SDS_REMOTE_NODE_CONTEXT_CALLBACK the_callback, scics_sds_remote_node_context_callback the_callback,
void *callback_parameter) void *callback_parameter)
{ {
this_rnc->user_callback = the_callback; this_rnc->user_callback = the_callback;
...@@ -662,7 +662,7 @@ static enum sci_status scic_sds_remote_node_context_ready_state_event_handler( ...@@ -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( static enum sci_status scic_sds_remote_node_context_tx_suspended_state_resume_handler(
struct scic_sds_remote_node_context *this_rnc, 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) void *callback_parameter)
{ {
enum sci_status status; enum sci_status status;
...@@ -737,7 +737,7 @@ static enum sci_status scic_sds_remote_node_context_suspended_start_task_handler ...@@ -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( static enum sci_status scic_sds_remote_node_context_tx_rx_suspended_state_resume_handler(
struct scic_sds_remote_node_context *this_rnc, 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) void *callback_parameter)
{ {
scic_sds_remote_node_context_setup_to_resume( scic_sds_remote_node_context_setup_to_resume(
...@@ -761,7 +761,7 @@ static enum sci_status scic_sds_remote_node_context_tx_rx_suspended_state_resume ...@@ -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( static enum sci_status scic_sds_remote_node_context_await_suspension_state_resume_handler(
struct scic_sds_remote_node_context *this_rnc, 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) void *callback_parameter)
{ {
scic_sds_remote_node_context_setup_to_resume( scic_sds_remote_node_context_setup_to_resume(
......
...@@ -67,8 +67,6 @@ ...@@ -67,8 +67,6 @@
#include "sci_base_state.h" #include "sci_base_state.h"
#include "sci_base_state_machine.h" #include "sci_base_state_machine.h"
/* --------------------------------------------------------------------------- */
/** /**
* *
* *
...@@ -85,77 +83,71 @@ struct scic_sds_request; ...@@ -85,77 +83,71 @@ struct scic_sds_request;
struct scic_sds_remote_device; struct scic_sds_remote_device;
struct scic_sds_remote_node_context; struct scic_sds_remote_node_context;
typedef void (*SCICS_SDS_REMOTE_NODE_CONTEXT_CALLBACK)(void *); typedef void (*scics_sds_remote_node_context_callback)(void *);
typedef enum sci_status (*SCIC_SDS_REMOTE_NODE_CONTEXT_OPERATION)( typedef enum sci_status (*scic_sds_remote_node_context_operation)(
struct scic_sds_remote_node_context *this_rnc, 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 void *callback_parameter
); );
typedef enum sci_status (*SCIC_SDS_REMOTE_NODE_CONTEXT_SUSPEND_OPERATION)( typedef enum sci_status (*scic_sds_remote_node_context_suspend_operation)(
struct scic_sds_remote_node_context *this_rnc, struct scic_sds_remote_node_context *this_rnc,
u32 suspension_type, u32 suspension_type,
SCICS_SDS_REMOTE_NODE_CONTEXT_CALLBACK the_callback, scics_sds_remote_node_context_callback the_callback,
void *callback_parameter void *callback_parameter
); );
typedef enum sci_status (*SCIC_SDS_REMOTE_NODE_CONTEXT_IO_REQUEST)( typedef enum sci_status (*scic_sds_remote_node_context_io_request)(
struct scic_sds_remote_node_context *this_rnc, struct scic_sds_remote_node_context *this_rnc,
struct scic_sds_request *the_request struct scic_sds_request *the_request
); );
typedef enum sci_status (*SCIC_SDS_REMOTE_NODE_CONTEXT_EVENT_HANDLER)( typedef enum sci_status (*scic_sds_remote_node_context_event_handler)(
struct scic_sds_remote_node_context *this_rnc, struct scic_sds_remote_node_context *this_rnc,
u32 event_code u32 event_code
); );
/* --------------------------------------------------------------------------- */
struct scic_sds_remote_node_context_handlers { struct scic_sds_remote_node_context_handlers {
/** /**
* This handle is invoked to stop the RNC. The callback is invoked when after * This handle is invoked to stop the RNC. The callback is invoked when after
* the hardware notification that the RNC has been invalidated. * the hardware notification that the RNC has been invalidated.
*/ */
SCIC_SDS_REMOTE_NODE_CONTEXT_OPERATION destruct_handler; scic_sds_remote_node_context_operation destruct_handler;
/** /**
* This handler is invoked when there is a request to suspend the RNC. The * This handler is invoked when there is a request to suspend the RNC. The
* callback is invoked after the hardware notification that the remote node is * callback is invoked after the hardware notification that the remote node is
* suspended. * suspended.
*/ */
SCIC_SDS_REMOTE_NODE_CONTEXT_SUSPEND_OPERATION suspend_handler; scic_sds_remote_node_context_suspend_operation suspend_handler;
/** /**
* This handler is invoked when there is a request to resume the RNC. The * This handler is invoked when there is a request to resume the RNC. The
* callback is invoked when after the RNC has reached the ready state. * callback is invoked when after the RNC has reached the ready state.
*/ */
SCIC_SDS_REMOTE_NODE_CONTEXT_OPERATION resume_handler; scic_sds_remote_node_context_operation resume_handler;
/** /**
* This handler is invoked when there is a request to start an io request * This handler is invoked when there is a request to start an io request
* operation. * operation.
*/ */
SCIC_SDS_REMOTE_NODE_CONTEXT_IO_REQUEST start_io_handler; scic_sds_remote_node_context_io_request start_io_handler;
/** /**
* This handler is invoked when there is a request to start a task request * This handler is invoked when there is a request to start a task request
* operation. * operation.
*/ */
SCIC_SDS_REMOTE_NODE_CONTEXT_IO_REQUEST start_task_handler; scic_sds_remote_node_context_io_request start_task_handler;
/** /**
* This handler is invoked where there is an RNC event that must be processed. * This handler is invoked where there is an RNC event that must be processed.
*/ */
SCIC_SDS_REMOTE_NODE_CONTEXT_EVENT_HANDLER event_handler; scic_sds_remote_node_context_event_handler event_handler;
}; };
/* --------------------------------------------------------------------------- */
/** /**
*
*
* This is the enumeration of the remote node context states. * This is the enumeration of the remote node context states.
*/ */
enum scis_sds_remote_node_context_states { enum scis_sds_remote_node_context_states {
...@@ -232,8 +224,6 @@ enum SCIC_SDS_REMOTE_NODE_CONTEXT_DESTINATION_STATE { ...@@ -232,8 +224,6 @@ enum SCIC_SDS_REMOTE_NODE_CONTEXT_DESTINATION_STATE {
* associated with the remote node context object. The remote node context * associated with the remote node context object. The remote node context
* (RNC) object models the the remote device information necessary to manage * (RNC) object models the the remote device information necessary to manage
* the silicon RNC. * the silicon RNC.
*
*
*/ */
struct scic_sds_remote_node_context { struct scic_sds_remote_node_context {
/* /*
...@@ -273,7 +263,7 @@ struct scic_sds_remote_node_context { ...@@ -273,7 +263,7 @@ struct scic_sds_remote_node_context {
* This field contains the callback function that the user requested to be * This field contains the callback function that the user requested to be
* called when the requested state transition is complete. * called when the requested state transition is complete.
*/ */
SCICS_SDS_REMOTE_NODE_CONTEXT_CALLBACK user_callback; scics_sds_remote_node_context_callback user_callback;
/** /**
* This field contains the parameter that is called when the user requested * This field contains the parameter that is called when the user requested
...@@ -289,16 +279,12 @@ struct scic_sds_remote_node_context { ...@@ -289,16 +279,12 @@ struct scic_sds_remote_node_context {
struct scic_sds_remote_node_context_handlers *state_handlers; struct scic_sds_remote_node_context_handlers *state_handlers;
}; };
/* --------------------------------------------------------------------------- */
extern const struct sci_base_state scic_sds_remote_node_context_state_table[]; extern const struct sci_base_state scic_sds_remote_node_context_state_table[];
extern struct scic_sds_remote_node_context_handlers extern struct scic_sds_remote_node_context_handlers
scic_sds_remote_node_context_state_handler_table[ scic_sds_remote_node_context_state_handler_table[
SCIC_SDS_REMOTE_NODE_CONTEXT_MAX_STATES]; SCIC_SDS_REMOTE_NODE_CONTEXT_MAX_STATES];
/* --------------------------------------------------------------------------- */
void scic_sds_remote_node_context_construct( void scic_sds_remote_node_context_construct(
struct scic_sds_remote_device *device, struct scic_sds_remote_device *device,
struct scic_sds_remote_node_context *rnc, struct scic_sds_remote_node_context *rnc,
...@@ -307,7 +293,6 @@ void scic_sds_remote_node_context_construct( ...@@ -307,7 +293,6 @@ void scic_sds_remote_node_context_construct(
void scic_sds_remote_node_context_construct_buffer( void scic_sds_remote_node_context_construct_buffer(
struct scic_sds_remote_node_context *rnc); struct scic_sds_remote_node_context *rnc);
bool scic_sds_remote_node_context_is_ready( bool scic_sds_remote_node_context_is_ready(
struct scic_sds_remote_node_context *this_rnc); struct scic_sds_remote_node_context *this_rnc);
...@@ -335,7 +320,4 @@ bool scic_sds_remote_node_context_is_ready( ...@@ -335,7 +320,4 @@ bool scic_sds_remote_node_context_is_ready(
#define scic_sds_remote_node_context_start_task(rnc, task) \ #define scic_sds_remote_node_context_start_task(rnc, task) \
((rnc)->state_handlers->start_task_handler(rnc, task)) ((rnc)->state_handlers->start_task_handler(rnc, task))
/* --------------------------------------------------------------------------- */
#endif /* _SCIC_SDS_REMOTE_NODE_CONTEXT_H_ */ #endif /* _SCIC_SDS_REMOTE_NODE_CONTEXT_H_ */
...@@ -192,7 +192,7 @@ static enum sci_status scic_sds_stp_remote_device_ready_substate_start_request_h ...@@ -192,7 +192,7 @@ static enum sci_status scic_sds_stp_remote_device_ready_substate_start_request_h
scic_sds_remote_node_context_resume( scic_sds_remote_node_context_resume(
this_device->rnc, this_device->rnc,
(SCICS_SDS_REMOTE_NODE_CONTEXT_CALLBACK) (scics_sds_remote_node_context_callback)
scic_sds_remote_device_continue_request, scic_sds_remote_device_continue_request,
this_device); this_device);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment