#include <sys/cdefs.h>
#include <dev/isci/scil/intel_sat.h>
#include <dev/isci/scil/intel_ata.h>
#include <dev/isci/scil/intel_sata.h>
#include <dev/isci/scil/scic_remote_device.h>
#include <dev/isci/scil/scic_user_callback.h>
#include <dev/isci/scil/scic_sds_logger.h>
#include <dev/isci/scil/scic_sds_controller.h>
#include <dev/isci/scil/scic_sds_port.h>
#include <dev/isci/scil/scic_sds_remote_device.h>
#include <dev/isci/scil/scic_sds_request.h>
#include <dev/isci/scil/scu_event_codes.h>
#include <dev/isci/scil/scu_completion_codes.h>
#include <dev/isci/scil/sci_base_state.h>
static
SCI_STATUS scic_sds_stp_remote_device_complete_request(
SCI_BASE_REMOTE_DEVICE_T * device,
SCI_BASE_REQUEST_T * request
)
{
SCIC_SDS_REMOTE_DEVICE_T * this_device = (SCIC_SDS_REMOTE_DEVICE_T *)device;
SCIC_SDS_REQUEST_T * the_request = (SCIC_SDS_REQUEST_T *)request;
SCI_STATUS status;
status = scic_sds_io_request_complete(the_request);
if (status == SCI_SUCCESS)
{
status = scic_sds_port_complete_io(
this_device->owning_port, this_device, the_request
);
if (status == SCI_SUCCESS)
{
scic_sds_remote_device_decrement_request_count(this_device);
if (the_request->sci_status == SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED)
{
sci_base_state_machine_change_state(
&this_device->ready_substate_machine,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_AWAIT_RESET
);
}
else if (scic_sds_remote_device_get_request_count(this_device) == 0)
{
sci_base_state_machine_change_state(
&this_device->ready_substate_machine,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_IDLE
);
}
}
}
if (status != SCI_SUCCESS)
{
SCIC_LOG_ERROR((
sci_base_object_get_logger(this_device),
SCIC_LOG_OBJECT_STP_REMOTE_TARGET,
"Port:0x%x Device:0x%x Request:0x%x Status:0x%x could not complete\n",
this_device->owning_port, this_device, the_request, status
));
}
return status;
}
static
SCI_STATUS scic_sds_stp_remote_device_ready_substate_start_request_handler(
SCI_BASE_REMOTE_DEVICE_T * device,
SCI_BASE_REQUEST_T * request
)
{
SCI_STATUS status;
SCIC_SDS_REMOTE_DEVICE_T * this_device = (SCIC_SDS_REMOTE_DEVICE_T *)device;
SCIC_SDS_REQUEST_T * this_request = (SCIC_SDS_REQUEST_T *)request;
status = this_device->owning_port->state_handlers->start_io_handler(
this_device->owning_port,
this_device,
this_request
);
if (SCI_SUCCESS == status)
{
status =
scic_sds_remote_node_context_start_task(this_device->rnc, this_request);
if (SCI_SUCCESS == status)
{
status = this_request->state_handlers->parent.start_handler(request);
}
if (status == SCI_SUCCESS)
{
this_device->working_request = this_request;
sci_base_state_machine_change_state(
&this_device->ready_substate_machine,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_CMD
);
scic_sds_remote_node_context_suspend(
this_device->rnc, SCI_SOFTWARE_SUSPENSION, NULL, NULL);
scic_sds_remote_node_context_resume(
this_device->rnc,
(SCIC_SDS_REMOTE_NODE_CONTEXT_CALLBACK)
scic_sds_remote_device_continue_request,
this_device);
}
scic_sds_remote_device_start_request(this_device,this_request,status);
return SCI_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS;
}
return status;
}
static
SCI_STATUS scic_sds_stp_remote_device_ready_idle_substate_start_io_handler(
SCI_BASE_REMOTE_DEVICE_T * device,
SCI_BASE_REQUEST_T * request
)
{
SCI_STATUS status;
SCIC_SDS_REMOTE_DEVICE_T * this_device = (SCIC_SDS_REMOTE_DEVICE_T *)device;
SCIC_SDS_REQUEST_T * io_request = (SCIC_SDS_REQUEST_T *)request;
status = this_device->owning_port->state_handlers->start_io_handler(
this_device->owning_port,
this_device,
io_request
);
if (status == SCI_SUCCESS)
{
status =
scic_sds_remote_node_context_start_io(this_device->rnc, io_request);
if (status == SCI_SUCCESS)
{
status = io_request->state_handlers->parent.start_handler(request);
}
if (status == SCI_SUCCESS)
{
if (io_request->sat_protocol == SAT_PROTOCOL_FPDMA)
{
sci_base_state_machine_change_state(
&this_device->ready_substate_machine,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ
);
}
else
{
this_device->working_request = io_request;
sci_base_state_machine_change_state(
&this_device->ready_substate_machine,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_CMD
);
}
}
scic_sds_remote_device_start_request(this_device, io_request, status);
}
return status;
}
static
SCI_STATUS scic_sds_stp_remote_device_ready_idle_substate_event_handler(
SCIC_SDS_REMOTE_DEVICE_T * this_device,
U32 event_code
)
{
SCI_STATUS status;
status = scic_sds_remote_device_general_event_handler(this_device, event_code);
if (status == SCI_SUCCESS)
{
if ((scu_get_event_type(event_code) == SCU_EVENT_TYPE_RNC_SUSPEND_TX
|| scu_get_event_type(event_code) == SCU_EVENT_TYPE_RNC_SUSPEND_TX_RX)
&& (this_device->rnc->destination_state != SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_READY))
{
status = scic_sds_remote_node_context_resume(
this_device->rnc, NULL, NULL);
}
}
return status;
}
static
SCI_STATUS scic_sds_stp_remote_device_ready_ncq_substate_start_io_handler(
SCI_BASE_REMOTE_DEVICE_T * device,
SCI_BASE_REQUEST_T * request
)
{
SCI_STATUS status;
SCIC_SDS_REMOTE_DEVICE_T * this_device = (SCIC_SDS_REMOTE_DEVICE_T *)device;
SCIC_SDS_REQUEST_T * io_request = (SCIC_SDS_REQUEST_T *)request;
if (io_request->sat_protocol == SAT_PROTOCOL_FPDMA)
{
status = this_device->owning_port->state_handlers->start_io_handler(
this_device->owning_port,
this_device,
io_request
);
if (status == SCI_SUCCESS)
{
status = scic_sds_remote_node_context_start_io(this_device->rnc, io_request);
if (status == SCI_SUCCESS)
{
status = io_request->state_handlers->parent.start_handler(request);
}
scic_sds_remote_device_start_request(this_device, io_request, status);
}
}
else
{
status = SCI_FAILURE_INVALID_STATE;
}
return status;
}
static
SCI_STATUS scic_sds_stp_remote_device_ready_ncq_substate_event_handler(
SCIC_SDS_REMOTE_DEVICE_T * this_device,
U32 event_code
)
{
SCI_STATUS status;
status = scic_sds_remote_device_general_event_handler(this_device, event_code);
switch (scu_get_event_code(event_code))
{
case SCU_EVENT_TL_RNC_SUSPEND_TX:
case SCU_EVENT_TL_RNC_SUSPEND_TX_RX:
break;
case SCU_EVENT_TL_RNC_SUSPEND_TX_DONE_DATA_LEN_ERR:
case SCU_EVENT_TL_RNC_SUSPEND_TX_DONE_OFFSET_ERR:
case SCU_EVENT_TL_RNC_SUSPEND_TX_DONE_DMASETUP_DIERR:
case SCU_EVENT_TL_RNC_SUSPEND_TX_DONE_XFERCNT_ERR:
case SCU_EVENT_TL_RNC_SUSPEND_TX_RX_DONE_PLD_LEN_ERR:
this_device->not_ready_reason =
SCIC_REMOTE_DEVICE_NOT_READY_SATA_SDB_ERROR_FIS_RECEIVED;
sci_base_state_machine_change_state(
&this_device->ready_substate_machine,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ_ERROR
);
SCIC_LOG_WARNING((
sci_base_object_get_logger(this_device),
SCIC_LOG_OBJECT_STP_REMOTE_TARGET,
"SCIC Remote device 0x%x received driver suspend event %x while in ncq ready substate %d\n",
this_device, event_code, sci_base_state_machine_get_state(&this_device->ready_substate_machine)
));
status = scic_sds_remote_device_resume(this_device);
break;
case SCU_EVENT_POST_RCN_RELEASE:
SCIC_LOG_INFO((
sci_base_object_get_logger(this_device),
SCIC_LOG_OBJECT_STP_REMOTE_TARGET,
"SCIC Remote device 0x%x received driver release event %x while in the ready substate %d\n",
this_device, event_code, sci_base_state_machine_get_state(&this_device->ready_substate_machine)
));
break;
default:
SCIC_LOG_WARNING((
sci_base_object_get_logger(this_device),
SCIC_LOG_OBJECT_STP_REMOTE_TARGET,
"SCIC Remote device 0x%x received driver unexpected event %x while in the ready substate %d\n",
this_device, event_code, sci_base_state_machine_get_state(&this_device->ready_substate_machine)
));
status = SCI_FAILURE_INVALID_STATE;
break;
}
return status;
}
static
SCI_STATUS scic_sds_stp_remote_device_ready_ncq_substate_frame_handler(
SCIC_SDS_REMOTE_DEVICE_T * this_device,
U32 frame_index
)
{
SCI_STATUS status;
SATA_FIS_HEADER_T * frame_header;
status = scic_sds_unsolicited_frame_control_get_header(
&(scic_sds_remote_device_get_controller(this_device)->uf_control),
frame_index,
(void **)&frame_header
);
if (status == SCI_SUCCESS)
{
if (
(frame_header->fis_type == SATA_FIS_TYPE_SETDEVBITS)
&& (frame_header->status & ATA_STATUS_REG_ERROR_BIT)
)
{
this_device->not_ready_reason =
SCIC_REMOTE_DEVICE_NOT_READY_SATA_SDB_ERROR_FIS_RECEIVED;
sci_base_state_machine_change_state(
&this_device->ready_substate_machine,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ_ERROR
);
}
else if (
(frame_header->fis_type == SATA_FIS_TYPE_REGD2H)
&& (frame_header->status & ATA_STATUS_REG_ERROR_BIT)
)
{
this_device->not_ready_reason =
SCIC_REMOTE_DEVICE_NOT_READY_SATA_SDB_ERROR_FIS_RECEIVED;
sci_base_state_machine_change_state(
&this_device->ready_substate_machine,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ_ERROR
);
}
else
{
status = SCI_FAILURE;
}
scic_sds_controller_release_frame(
scic_sds_remote_device_get_controller(this_device), frame_index
);
}
return status;
}
static
SCI_STATUS scic_sds_stp_remote_device_ready_cmd_substate_start_io_handler(
SCI_BASE_REMOTE_DEVICE_T * device,
SCI_BASE_REQUEST_T * request
)
{
return SCI_FAILURE_INVALID_STATE;
}
static
SCI_STATUS scic_sds_stp_remote_device_ready_cmd_substate_suspend_handler(
SCIC_SDS_REMOTE_DEVICE_T * this_device,
U32 suspend_type
)
{
SCI_STATUS status;
status = scic_sds_remote_node_context_suspend(
this_device->rnc, suspend_type, NULL, NULL
);
return status;
}
static
SCI_STATUS scic_sds_stp_remote_device_ready_cmd_substate_frame_handler(
SCIC_SDS_REMOTE_DEVICE_T * this_device,
U32 frame_index
)
{
SCI_STATUS status;
status = scic_sds_io_request_frame_handler(
this_device->working_request,
frame_index
);
return status;
}
static
SCI_STATUS scic_sds_stp_remote_device_ready_await_reset_substate_start_io_handler(
SCI_BASE_REMOTE_DEVICE_T * device,
SCI_BASE_REQUEST_T * request
)
{
return SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED;
}
static
SCI_STATUS scic_sds_stp_remote_device_ready_await_reset_substate_complete_request_handler(
SCI_BASE_REMOTE_DEVICE_T * device,
SCI_BASE_REQUEST_T * request
)
{
SCIC_SDS_REMOTE_DEVICE_T * this_device = (SCIC_SDS_REMOTE_DEVICE_T *)device;
SCIC_SDS_REQUEST_T * the_request = (SCIC_SDS_REQUEST_T *)request;
SCI_STATUS status;
status = scic_sds_io_request_complete(the_request);
if (status == SCI_SUCCESS)
{
status = scic_sds_port_complete_io(
this_device->owning_port, this_device, the_request
);
if (status == SCI_SUCCESS)
scic_sds_remote_device_decrement_request_count(this_device);
}
if (status != SCI_SUCCESS)
{
SCIC_LOG_ERROR((
sci_base_object_get_logger(this_device),
SCIC_LOG_OBJECT_STP_REMOTE_TARGET,
"Port:0x%x Device:0x%x Request:0x%x Status:0x%x could not complete\n",
this_device->owning_port, this_device, the_request, status
));
}
return status;
}
#if !defined(DISABLE_ATAPI)
static
SCI_STATUS scic_sds_stp_remote_device_ready_atapi_error_substate_event_handler(
SCIC_SDS_REMOTE_DEVICE_T * this_device,
U32 event_code
)
{
SCI_STATUS status;
status = scic_sds_remote_device_general_event_handler(this_device, event_code);
if (status == SCI_SUCCESS)
{
if (scu_get_event_type(event_code) == SCU_EVENT_TYPE_RNC_SUSPEND_TX
|| scu_get_event_type(event_code) == SCU_EVENT_TYPE_RNC_SUSPEND_TX_RX)
{
status = scic_sds_remote_node_context_resume(
this_device->rnc,
(SCIC_SDS_REMOTE_NODE_CONTEXT_CALLBACK)
this_device->working_request->state_handlers->parent.complete_handler,
(void *)this_device->working_request
);
}
}
return status;
}
#endif
SCIC_SDS_REMOTE_DEVICE_STATE_HANDLER_T
scic_sds_stp_remote_device_ready_substate_handler_table[
SCIC_SDS_STP_REMOTE_DEVICE_READY_MAX_SUBSTATES] =
{
{
{
scic_sds_remote_device_default_start_handler,
scic_sds_remote_device_ready_state_stop_handler,
scic_sds_remote_device_default_fail_handler,
scic_sds_remote_device_default_destruct_handler,
scic_sds_remote_device_ready_state_reset_handler,
scic_sds_remote_device_default_reset_complete_handler,
scic_sds_stp_remote_device_ready_idle_substate_start_io_handler,
scic_sds_remote_device_default_complete_request_handler,
scic_sds_remote_device_default_continue_request_handler,
scic_sds_stp_remote_device_ready_substate_start_request_handler,
scic_sds_remote_device_default_complete_request_handler
},
scic_sds_remote_device_default_suspend_handler,
scic_sds_remote_device_default_resume_handler,
scic_sds_stp_remote_device_ready_idle_substate_event_handler,
scic_sds_remote_device_default_frame_handler
},
{
{
scic_sds_remote_device_default_start_handler,
scic_sds_remote_device_ready_state_stop_handler,
scic_sds_remote_device_default_fail_handler,
scic_sds_remote_device_default_destruct_handler,
scic_sds_remote_device_ready_state_reset_handler,
scic_sds_remote_device_default_reset_complete_handler,
scic_sds_stp_remote_device_ready_cmd_substate_start_io_handler,
scic_sds_stp_remote_device_complete_request,
scic_sds_remote_device_default_continue_request_handler,
scic_sds_stp_remote_device_ready_substate_start_request_handler,
scic_sds_stp_remote_device_complete_request,
},
scic_sds_stp_remote_device_ready_cmd_substate_suspend_handler,
scic_sds_remote_device_default_resume_handler,
scic_sds_remote_device_general_event_handler,
scic_sds_stp_remote_device_ready_cmd_substate_frame_handler
},
{
{
scic_sds_remote_device_default_start_handler,
scic_sds_remote_device_ready_state_stop_handler,
scic_sds_remote_device_default_fail_handler,
scic_sds_remote_device_default_destruct_handler,
scic_sds_remote_device_ready_state_reset_handler,
scic_sds_remote_device_default_reset_complete_handler,
scic_sds_stp_remote_device_ready_ncq_substate_start_io_handler,
scic_sds_stp_remote_device_complete_request,
scic_sds_remote_device_default_continue_request_handler,
scic_sds_stp_remote_device_ready_substate_start_request_handler,
scic_sds_stp_remote_device_complete_request
},
scic_sds_remote_device_default_suspend_handler,
scic_sds_remote_device_default_resume_handler,
scic_sds_stp_remote_device_ready_ncq_substate_event_handler,
scic_sds_stp_remote_device_ready_ncq_substate_frame_handler
},
{
{
scic_sds_remote_device_default_start_handler,
scic_sds_remote_device_ready_state_stop_handler,
scic_sds_remote_device_default_fail_handler,
scic_sds_remote_device_default_destruct_handler,
scic_sds_remote_device_ready_state_reset_handler,
scic_sds_remote_device_default_reset_complete_handler,
scic_sds_remote_device_default_start_request_handler,
scic_sds_stp_remote_device_complete_request,
scic_sds_remote_device_default_continue_request_handler,
scic_sds_stp_remote_device_ready_substate_start_request_handler,
scic_sds_stp_remote_device_complete_request
},
scic_sds_remote_device_default_suspend_handler,
scic_sds_remote_device_default_resume_handler,
scic_sds_remote_device_general_event_handler,
scic_sds_remote_device_general_frame_handler
},
#if !defined(DISABLE_ATAPI)
{
{
scic_sds_remote_device_default_start_handler,
scic_sds_remote_device_ready_state_stop_handler,
scic_sds_remote_device_default_fail_handler,
scic_sds_remote_device_default_destruct_handler,
scic_sds_remote_device_ready_state_reset_handler,
scic_sds_remote_device_default_reset_complete_handler,
scic_sds_remote_device_default_start_request_handler,
scic_sds_stp_remote_device_complete_request,
scic_sds_remote_device_default_continue_request_handler,
scic_sds_stp_remote_device_ready_substate_start_request_handler,
scic_sds_stp_remote_device_complete_request
},
scic_sds_remote_device_default_suspend_handler,
scic_sds_remote_device_default_resume_handler,
scic_sds_stp_remote_device_ready_atapi_error_substate_event_handler,
scic_sds_remote_device_general_frame_handler
},
#endif
{
{
scic_sds_remote_device_default_start_handler,
scic_sds_remote_device_ready_state_stop_handler,
scic_sds_remote_device_default_fail_handler,
scic_sds_remote_device_default_destruct_handler,
scic_sds_remote_device_ready_state_reset_handler,
scic_sds_remote_device_default_reset_complete_handler,
scic_sds_stp_remote_device_ready_await_reset_substate_start_io_handler,
scic_sds_stp_remote_device_ready_await_reset_substate_complete_request_handler,
scic_sds_remote_device_default_continue_request_handler,
scic_sds_stp_remote_device_ready_substate_start_request_handler,
scic_sds_stp_remote_device_complete_request
},
scic_sds_remote_device_default_suspend_handler,
scic_sds_remote_device_default_resume_handler,
scic_sds_remote_device_general_event_handler,
scic_sds_remote_device_general_frame_handler
}
};
static
void scic_sds_stp_remote_device_ready_idle_substate_resume_complete_handler(
void * user_cookie
)
{
SCIC_SDS_REMOTE_DEVICE_T * this_device;
this_device = (SCIC_SDS_REMOTE_DEVICE_T *)user_cookie;
if (this_device->ready_substate_machine.previous_state_id
!= SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ)
{
scic_cb_remote_device_ready(
scic_sds_remote_device_get_controller(this_device), this_device
);
}
}
static
void scic_sds_stp_remote_device_ready_idle_substate_enter(
SCI_BASE_OBJECT_T * device
)
{
SCIC_SDS_REMOTE_DEVICE_T * this_device;
this_device = (SCIC_SDS_REMOTE_DEVICE_T *)device;
SET_STATE_HANDLER(
this_device,
scic_sds_stp_remote_device_ready_substate_handler_table,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_IDLE
);
this_device->working_request = NULL;
if (scic_sds_remote_node_context_is_ready(this_device->rnc))
{
scic_sds_stp_remote_device_ready_idle_substate_resume_complete_handler(
this_device
);
}
else
{
scic_sds_remote_node_context_resume(
this_device->rnc,
scic_sds_stp_remote_device_ready_idle_substate_resume_complete_handler,
this_device
);
}
}
static
void scic_sds_stp_remote_device_ready_cmd_substate_enter(
SCI_BASE_OBJECT_T * device
)
{
SCIC_SDS_REMOTE_DEVICE_T * this_device;
this_device = (SCIC_SDS_REMOTE_DEVICE_T *)device;
ASSERT(this_device->working_request != NULL);
SET_STATE_HANDLER(
this_device,
scic_sds_stp_remote_device_ready_substate_handler_table,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_CMD
);
scic_cb_remote_device_not_ready(
scic_sds_remote_device_get_controller(this_device),
this_device,
SCIC_REMOTE_DEVICE_NOT_READY_SATA_REQUEST_STARTED
);
}
static
void scic_sds_stp_remote_device_ready_ncq_substate_enter(
SCI_BASE_OBJECT_T * device
)
{
SCIC_SDS_REMOTE_DEVICE_T * this_device;
this_device = (SCIC_SDS_REMOTE_DEVICE_T *)device;
SET_STATE_HANDLER(
this_device,
scic_sds_stp_remote_device_ready_substate_handler_table,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ
);
}
static
void scic_sds_stp_remote_device_ready_ncq_error_substate_enter(
SCI_BASE_OBJECT_T * device
)
{
SCIC_SDS_REMOTE_DEVICE_T * this_device;
this_device = (SCIC_SDS_REMOTE_DEVICE_T *)device;
SET_STATE_HANDLER(
this_device,
scic_sds_stp_remote_device_ready_substate_handler_table,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ_ERROR
);
if(this_device->not_ready_reason ==
SCIC_REMOTE_DEVICE_NOT_READY_SATA_SDB_ERROR_FIS_RECEIVED)
{
scic_cb_remote_device_not_ready(
scic_sds_remote_device_get_controller(this_device),
this_device,
this_device->not_ready_reason
);
}
}
static
void scic_sds_stp_remote_device_ready_await_reset_substate_enter(
SCI_BASE_OBJECT_T * device
)
{
SCIC_SDS_REMOTE_DEVICE_T * this_device;
this_device = (SCIC_SDS_REMOTE_DEVICE_T *)device;
SET_STATE_HANDLER(
this_device,
scic_sds_stp_remote_device_ready_substate_handler_table,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_AWAIT_RESET
);
}
#if !defined(DISABLE_ATAPI)
static
void scic_sds_stp_remote_device_ready_atapi_error_substate_enter(
SCI_BASE_OBJECT_T * device
)
{
SCIC_SDS_REMOTE_DEVICE_T * this_device;
this_device = (SCIC_SDS_REMOTE_DEVICE_T *)device;
SET_STATE_HANDLER(
this_device,
scic_sds_stp_remote_device_ready_substate_handler_table,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_ATAPI_ERROR
);
}
#endif
SCI_BASE_STATE_T
scic_sds_stp_remote_device_ready_substate_table[
SCIC_SDS_STP_REMOTE_DEVICE_READY_MAX_SUBSTATES] =
{
{
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_IDLE,
scic_sds_stp_remote_device_ready_idle_substate_enter,
NULL
},
{
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_CMD,
scic_sds_stp_remote_device_ready_cmd_substate_enter,
NULL
},
{
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ,
scic_sds_stp_remote_device_ready_ncq_substate_enter,
NULL
},
{
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ_ERROR,
scic_sds_stp_remote_device_ready_ncq_error_substate_enter,
NULL
},
#if !defined(DISABLE_ATAPI)
{
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_ATAPI_ERROR,
scic_sds_stp_remote_device_ready_atapi_error_substate_enter,
NULL
},
#endif
{
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_AWAIT_RESET,
scic_sds_stp_remote_device_ready_await_reset_substate_enter,
NULL
}
};