u32 scic_remote_device_get_object_size(void)
{
- return sizeof(struct scic_sds_remote_device)
- + sizeof(struct scic_sds_remote_node_context);
+ return sizeof (struct scic_sds_remote_device);
}
enum sci_status scic_remote_device_da_construct(
&remote_node_index);
if (status == SCI_SUCCESS) {
- sci_dev->rnc->remote_node_index = remote_node_index;
+ sci_dev->rnc.remote_node_index = remote_node_index;
scic_sds_port_get_attached_sas_address(
sci_dev->owning_port, &sci_dev->device_address);
sci_dev, discover_response);
status = scic_sds_controller_allocate_remote_node_context(
- scic, sci_dev, &sci_dev->rnc->remote_node_index);
+ scic, sci_dev, &sci_dev->rnc.remote_node_index);
if (status == SCI_SUCCESS) {
if (sci_dev->target_protocols.u.bits.attached_ssp_target) {
case SCU_EVENT_TYPE_RNC_OPS_MISC:
case SCU_EVENT_TYPE_RNC_SUSPEND_TX:
case SCU_EVENT_TYPE_RNC_SUSPEND_TX_RX:
- status = scic_sds_remote_node_context_event_handler(sci_dev->rnc, event_code);
+ status = scic_sds_remote_node_context_event_handler(&sci_dev->rnc, event_code);
break;
case SCU_EVENT_TYPE_PTX_SCHEDULE_EVENT:
status = SCI_SUCCESS;
/* Suspend the associated RNC */
- scic_sds_remote_node_context_suspend(sci_dev->rnc,
+ scic_sds_remote_node_context_suspend(&sci_dev->rnc,
SCI_SOFTWARE_SUSPENSION,
NULL, NULL);
{
enum sci_status status;
- status = scic_sds_remote_node_context_resume(sci_dev->rnc,
+ status = scic_sds_remote_node_context_resume(&sci_dev->rnc,
scic_sds_remote_device_resume_complete_handler, sci_dev);
if (status == SCI_SUCCESS)
scic = scic_sds_remote_device_get_controller(sci_dev);
scic_sds_controller_free_remote_node_context(scic, sci_dev,
- sci_dev->rnc->remote_node_index);
- sci_dev->rnc->remote_node_index = SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX;
+ sci_dev->rnc.remote_node_index);
+ sci_dev->rnc.remote_node_index = SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX;
sci_base_state_machine_change_state(&sci_dev->state_machine,
SCI_BASE_REMOTE_DEVICE_STATE_FINAL);
/*
* Destroy the remote node context
*/
- scic_sds_remote_node_context_destruct(sci_dev->rnc,
+ scic_sds_remote_node_context_destruct(&sci_dev->rnc,
scic_sds_cb_remote_device_rnc_destruct_complete, sci_dev);
/*
SCI_BASE_REMOTE_DEVICE_STATE_STOPPING);
if (sci_dev->started_request_count == 0) {
- scic_sds_remote_node_context_destruct(sci_dev->rnc,
+ scic_sds_remote_node_context_destruct(&sci_dev->rnc,
scic_sds_cb_remote_device_rnc_destruct_complete,
sci_dev);
} else
scic_sds_remote_device_get_port(sci_dev), sci_dev, request);
if (result == SCI_SUCCESS) {
- result = scic_sds_remote_node_context_start_task(
- sci_dev->rnc, request);
+ result = scic_sds_remote_node_context_start_task(&sci_dev->rnc,
+ request);
if (result == SCI_SUCCESS)
result = scic_sds_request_start(request);
scic_sds_remote_device_get_port(sci_dev), sci_dev, request);
if (result == SCI_SUCCESS) {
- result = scic_sds_remote_node_context_start_io(
- sci_dev->rnc, request);
+ result = scic_sds_remote_node_context_start_io(&sci_dev->rnc, request);
if (result == SCI_SUCCESS)
result = scic_sds_request_start(request);
scic_sds_remote_device_decrement_request_count(sci_dev);
if (scic_sds_remote_device_get_request_count(sci_dev) == 0)
- scic_sds_remote_node_context_destruct(sci_dev->rnc,
+ scic_sds_remote_node_context_destruct(&sci_dev->rnc,
scic_sds_cb_remote_device_rnc_destruct_complete,
sci_dev);
return SCI_SUCCESS;
scic_sds_remote_device_state_handler_table,
SCI_BASE_REMOTE_DEVICE_STATE_READY);
- scic->remote_device_sequence[sci_dev->rnc->remote_node_index]++;
+ scic->remote_device_sequence[sci_dev->rnc.remote_node_index]++;
if (sci_dev->has_ready_substate_machine)
sci_base_state_machine_start(&sci_dev->ready_substate_machine);
);
scic_sds_remote_node_context_suspend(
- sci_dev->rnc, SCI_SOFTWARE_SUSPENSION, NULL, NULL);
+ &sci_dev->rnc, SCI_SOFTWARE_SUSPENSION, NULL, NULL);
}
/**
{
struct scic_sds_remote_device *sci_dev = (struct scic_sds_remote_device *)object;
- scic_sds_remote_node_context_resume(sci_dev->rnc, NULL, NULL);
+ scic_sds_remote_node_context_resume(&sci_dev->rnc, NULL, NULL);
}
/**
{
sci_dev->owning_port = sci_port;
sci_dev->started_request_count = 0;
- sci_dev->rnc = (struct scic_sds_remote_node_context *) &sci_dev[1];
sci_dev->parent.private = NULL;
sci_base_state_machine_construct(
scic_sds_remote_node_context_construct(
sci_dev,
- sci_dev->rnc,
+ &sci_dev->rnc,
SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX
);
- sci_object_set_association(sci_dev->rnc, sci_dev);
+ sci_object_set_association(&sci_dev->rnc, sci_dev);
}
{
dma_addr_t dma_addr;
struct scic_sds_controller *controller;
- struct scic_sds_remote_device *target_device;
+ struct scic_sds_remote_device *sci_dev;
struct scic_sds_port *target_port;
struct scu_task_context *task_context;
task_context = scic_sds_request_get_task_context(sds_request);
controller = scic_sds_request_get_controller(sds_request);
- target_device = scic_sds_request_get_device(sds_request);
+ sci_dev = scic_sds_request_get_device(sds_request);
target_port = scic_sds_request_get_port(sds_request);
/*
task_context->priority = 0;
task_context->initiator_request = 1;
task_context->connection_rate =
- scic_remote_device_get_connection_rate(target_device);
+ scic_remote_device_get_connection_rate(sci_dev);
task_context->protocol_engine_index =
scic_sds_controller_get_protocol_engine_group(controller);
task_context->logical_port_index =
task_context->context_type = SCU_TASK_CONTEXT_TYPE;
/* 04h */
- task_context->remote_node_index =
- sds_request->target_device->rnc->remote_node_index;
+ task_context->remote_node_index = sci_dev->rnc.remote_node_index;
task_context->command_code = 0;
task_context->task_type = SCU_TASK_TYPE_SMP_REQUEST;
if (status != SCI_SUCCESS)
return status;
- status = scic_sds_remote_node_context_start_task(device->rnc, request);
+ status = scic_sds_remote_node_context_start_task(&device->rnc, request);
if (status != SCI_SUCCESS)
goto out;
* remote node context state machine will take the correct action when
* the remote node context is suspended and later resumed.
*/
- scic_sds_remote_node_context_suspend(device->rnc,
+ scic_sds_remote_node_context_suspend(&device->rnc,
SCI_SOFTWARE_SUSPENSION, NULL, NULL);
- scic_sds_remote_node_context_resume(device->rnc,
+ scic_sds_remote_node_context_resume(&device->rnc,
scic_sds_remote_device_continue_request,
device);
if (status != SCI_SUCCESS)
return status;
- status = scic_sds_remote_node_context_start_io(sci_dev->rnc, request);
+ status = scic_sds_remote_node_context_start_io(&sci_dev->rnc, request);
if (status != SCI_SUCCESS)
goto out;
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(
- sci_dev->rnc, NULL, NULL);
+ &sci_dev->rnc, NULL, NULL);
}
}
sci_dev->owning_port,
sci_dev,
request);
+ if (status != SCI_SUCCESS)
+ return status;
- if (status == SCI_SUCCESS) {
- status = scic_sds_remote_node_context_start_io(
- sci_dev->rnc,
- request);
+ status = scic_sds_remote_node_context_start_io(&sci_dev->rnc, request);
+ if (status != SCI_SUCCESS)
+ return status;
- if (status == SCI_SUCCESS)
- status = request->state_handlers->start_handler(request);
+ status = request->state_handlers->start_handler(request);
- scic_sds_remote_device_start_request(sci_dev,
- request,
- status);
- }
+ scic_sds_remote_device_start_request(sci_dev, request, status);
} else
status = SCI_FAILURE_INVALID_STATE;
{
enum sci_status status;
- status = scic_sds_remote_node_context_suspend(
- sci_dev->rnc, suspend_type, NULL, NULL
- );
+ status = scic_sds_remote_node_context_suspend(&sci_dev->rnc,
+ suspend_type, NULL, NULL);
return status;
}
sci_dev->working_request = NULL;
- if (scic_sds_remote_node_context_is_ready(sci_dev->rnc)) {
+ if (scic_sds_remote_node_context_is_ready(&sci_dev->rnc)) {
/*
* Since the RNC is ready, it's alright to finish completion
* processing (e.g. signal the remote device is ready). */
);
} else {
scic_sds_remote_node_context_resume(
- sci_dev->rnc,
+ &sci_dev->rnc,
scic_sds_stp_remote_device_ready_idle_substate_resume_complete_handler,
- sci_dev
- );
+ sci_dev);
}
}