Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9269e0e8 authored by Dan Williams's avatar Dan Williams
Browse files

isci: add some type safety to the state machine interface



Now that any given object type only has one state_machine we can use
container_of() to get back to the given state machine owner.

Reported-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent f34d9e5d
Loading
Loading
Loading
Loading
+16 −16
Original line number Diff line number Diff line
@@ -1404,17 +1404,17 @@ static void isci_user_parameters_get(
	u->max_number_concurrent_device_spin_up = max_concurr_spinup;
}

static void scic_sds_controller_initial_state_enter(void *object)
static void scic_sds_controller_initial_state_enter(struct sci_base_state_machine *sm)
{
	struct scic_sds_controller *scic = object;
	struct scic_sds_controller *scic = container_of(sm, typeof(*scic), state_machine);

	sci_base_state_machine_change_state(&scic->state_machine,
			SCI_BASE_CONTROLLER_STATE_RESET);
}

static inline void scic_sds_controller_starting_state_exit(void *object)
static inline void scic_sds_controller_starting_state_exit(struct sci_base_state_machine *sm)
{
	struct scic_sds_controller *scic = object;
	struct scic_sds_controller *scic = container_of(sm, typeof(*scic), state_machine);

	isci_timer_stop(scic->timeout_timer);
}
@@ -1539,17 +1539,17 @@ static enum sci_status scic_controller_set_interrupt_coalescence(
}


static void scic_sds_controller_ready_state_enter(void *object)
static void scic_sds_controller_ready_state_enter(struct sci_base_state_machine *sm)
{
	struct scic_sds_controller *scic = object;
	struct scic_sds_controller *scic = container_of(sm, typeof(*scic), state_machine);

	/* set the default interrupt coalescence number and timeout value. */
	scic_controller_set_interrupt_coalescence(scic, 0x10, 250);
}

static void scic_sds_controller_ready_state_exit(void *object)
static void scic_sds_controller_ready_state_exit(struct sci_base_state_machine *sm)
{
	struct scic_sds_controller *scic = object;
	struct scic_sds_controller *scic = container_of(sm, typeof(*scic), state_machine);

	/* disable interrupt coalescence. */
	scic_controller_set_interrupt_coalescence(scic, 0, 0);
@@ -1638,9 +1638,9 @@ static enum sci_status scic_sds_controller_stop_devices(struct scic_sds_controll
	return status;
}

static void scic_sds_controller_stopping_state_enter(void *object)
static void scic_sds_controller_stopping_state_enter(struct sci_base_state_machine *sm)
{
	struct scic_sds_controller *scic = object;
	struct scic_sds_controller *scic = container_of(sm, typeof(*scic), state_machine);

	/* Stop all of the components for this controller */
	scic_sds_controller_stop_phys(scic);
@@ -1648,9 +1648,9 @@ static void scic_sds_controller_stopping_state_enter(void *object)
	scic_sds_controller_stop_devices(scic);
}

static void scic_sds_controller_stopping_state_exit(void *object)
static void scic_sds_controller_stopping_state_exit(struct sci_base_state_machine *sm)
{
	struct scic_sds_controller *scic = object;
	struct scic_sds_controller *scic = container_of(sm, typeof(*scic), state_machine);

	isci_timer_stop(scic->timeout_timer);
}
@@ -1679,9 +1679,9 @@ static void scic_sds_controller_reset_hardware(struct scic_sds_controller *scic)
	writel(0, &scic->scu_registers->sdma.unsolicited_frame_get_pointer);
}

static void scic_sds_controller_resetting_state_enter(void *object)
static void scic_sds_controller_resetting_state_enter(struct sci_base_state_machine *sm)
{
	struct scic_sds_controller *scic = object;
	struct scic_sds_controller *scic = container_of(sm, typeof(*scic), state_machine);

	scic_sds_controller_reset_hardware(scic);
	sci_base_state_machine_change_state(&scic->state_machine,
@@ -1785,7 +1785,7 @@ static enum sci_status scic_controller_construct(struct scic_sds_controller *sci
	u8 i;

	sci_base_state_machine_construct(&scic->state_machine,
		scic, scic_sds_controller_state_table,
					 scic_sds_controller_state_table,
					 SCI_BASE_CONTROLLER_STATE_INITIAL);

	sci_base_state_machine_start(&scic->state_machine);
+34 −36
Original line number Diff line number Diff line
@@ -1026,81 +1026,80 @@ enum sci_status scic_sds_phy_frame_handler(struct scic_sds_phy *sci_phy,
	
}

static void scic_sds_phy_starting_initial_substate_enter(void *object)
static void scic_sds_phy_starting_initial_substate_enter(struct sci_base_state_machine *sm)
{
	struct scic_sds_phy *sci_phy = object;
	struct scic_sds_phy *sci_phy = container_of(sm, typeof(*sci_phy), state_machine);

	/* This is just an temporary state go off to the starting state */
	sci_base_state_machine_change_state(&sci_phy->state_machine,
					    SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_OSSP_EN);
}

static void scic_sds_phy_starting_await_sas_power_substate_enter(void *object)
static void scic_sds_phy_starting_await_sas_power_substate_enter(struct sci_base_state_machine *sm)
{
	struct scic_sds_phy *sci_phy = object;
	struct scic_sds_phy *sci_phy = container_of(sm, typeof(*sci_phy), state_machine);
	struct scic_sds_controller *scic = sci_phy->owning_port->owning_controller;

	scic_sds_controller_power_control_queue_insert(scic, sci_phy);
}

static void scic_sds_phy_starting_await_sas_power_substate_exit(void *object)
static void scic_sds_phy_starting_await_sas_power_substate_exit(struct sci_base_state_machine *sm)
{
	struct scic_sds_phy *sci_phy = object;
	struct scic_sds_phy *sci_phy = container_of(sm, typeof(*sci_phy), state_machine);
	struct scic_sds_controller *scic = sci_phy->owning_port->owning_controller;

	scic_sds_controller_power_control_queue_remove(scic, sci_phy);
}

static void scic_sds_phy_starting_await_sata_power_substate_enter(void *object)
static void scic_sds_phy_starting_await_sata_power_substate_enter(struct sci_base_state_machine *sm)
{
	struct scic_sds_phy *sci_phy = object;
	struct scic_sds_phy *sci_phy = container_of(sm, typeof(*sci_phy), state_machine);
	struct scic_sds_controller *scic = sci_phy->owning_port->owning_controller;

	scic_sds_controller_power_control_queue_insert(scic, sci_phy);
}

static void scic_sds_phy_starting_await_sata_power_substate_exit(void *object)
static void scic_sds_phy_starting_await_sata_power_substate_exit(struct sci_base_state_machine *sm)
{
	struct scic_sds_phy *sci_phy = object;
	struct scic_sds_phy *sci_phy = container_of(sm, typeof(*sci_phy), state_machine);
	struct scic_sds_controller *scic = sci_phy->owning_port->owning_controller;

	scic_sds_controller_power_control_queue_remove(scic, sci_phy);
}

static void scic_sds_phy_starting_await_sata_phy_substate_enter(void *object)
static void scic_sds_phy_starting_await_sata_phy_substate_enter(struct sci_base_state_machine *sm)
{
	struct scic_sds_phy *sci_phy = object;
	struct scic_sds_phy *sci_phy = container_of(sm, typeof(*sci_phy), state_machine);

	isci_timer_start(sci_phy->sata_timeout_timer,
			 SCIC_SDS_SATA_LINK_TRAINING_TIMEOUT);
}

static void scic_sds_phy_starting_await_sata_phy_substate_exit(void *object)
static void scic_sds_phy_starting_await_sata_phy_substate_exit(struct sci_base_state_machine *sm)
{
	struct scic_sds_phy *sci_phy = object;
	struct scic_sds_phy *sci_phy = container_of(sm, typeof(*sci_phy), state_machine);

	isci_timer_stop(sci_phy->sata_timeout_timer);
}

static void scic_sds_phy_starting_await_sata_speed_substate_enter(void *object)
static void scic_sds_phy_starting_await_sata_speed_substate_enter(struct sci_base_state_machine *sm)
{
	struct scic_sds_phy *sci_phy = object;
	struct scic_sds_phy *sci_phy = container_of(sm, typeof(*sci_phy), state_machine);

	isci_timer_start(sci_phy->sata_timeout_timer,
			 SCIC_SDS_SATA_LINK_TRAINING_TIMEOUT);
}

static void scic_sds_phy_starting_await_sata_speed_substate_exit(
	void *object)
static void scic_sds_phy_starting_await_sata_speed_substate_exit(struct sci_base_state_machine *sm)
{
	struct scic_sds_phy *sci_phy = object;
	struct scic_sds_phy *sci_phy = container_of(sm, typeof(*sci_phy), state_machine);

	isci_timer_stop(sci_phy->sata_timeout_timer);
}

static void scic_sds_phy_starting_await_sig_fis_uf_substate_enter(void *object)
static void scic_sds_phy_starting_await_sig_fis_uf_substate_enter(struct sci_base_state_machine *sm)
{
	struct scic_sds_phy *sci_phy = object;
	struct scic_sds_phy *sci_phy = container_of(sm, typeof(*sci_phy), state_machine);

	if (scic_sds_port_link_detected(sci_phy->owning_port, sci_phy)) {

@@ -1118,16 +1117,16 @@ static void scic_sds_phy_starting_await_sig_fis_uf_substate_enter(void *object)
		sci_phy->is_in_link_training = false;
}

static void scic_sds_phy_starting_await_sig_fis_uf_substate_exit(void *object)
static void scic_sds_phy_starting_await_sig_fis_uf_substate_exit(struct sci_base_state_machine *sm)
{
	struct scic_sds_phy *sci_phy = object;
	struct scic_sds_phy *sci_phy = container_of(sm, typeof(*sci_phy), state_machine);

	isci_timer_stop(sci_phy->sata_timeout_timer);
}

static void scic_sds_phy_starting_final_substate_enter(void *object)
static void scic_sds_phy_starting_final_substate_enter(struct sci_base_state_machine *sm)
{
	struct scic_sds_phy *sci_phy = object;
	struct scic_sds_phy *sci_phy = container_of(sm, typeof(*sci_phy), state_machine);

	/* State machine has run to completion so exit out and change
	 * the base state machine to the ready state
@@ -1217,9 +1216,9 @@ static void scu_link_layer_tx_hard_reset(
	       &sci_phy->link_layer_registers->phy_configuration);
}

static void scic_sds_phy_stopped_state_enter(void *object)
static void scic_sds_phy_stopped_state_enter(struct sci_base_state_machine *sm)
{
	struct scic_sds_phy *sci_phy = object;
	struct scic_sds_phy *sci_phy = container_of(sm, typeof(*sci_phy), state_machine);
	struct scic_sds_port *sci_port = sci_phy->owning_port;
	struct scic_sds_controller *scic = sci_port->owning_controller;
	struct isci_host *ihost = scic_to_ihost(scic);
@@ -1242,9 +1241,9 @@ static void scic_sds_phy_stopped_state_enter(void *object)
					      sci_phy);
}

static void scic_sds_phy_starting_state_enter(void *object)
static void scic_sds_phy_starting_state_enter(struct sci_base_state_machine *sm)
{
	struct scic_sds_phy *sci_phy = object;
	struct scic_sds_phy *sci_phy = container_of(sm, typeof(*sci_phy), state_machine);

	scu_link_layer_stop_protocol_engine(sci_phy);
	scu_link_layer_start_oob(sci_phy);
@@ -1262,9 +1261,9 @@ static void scic_sds_phy_starting_state_enter(void *object)
					    SCIC_SDS_PHY_STARTING_SUBSTATE_INITIAL);
}

static void scic_sds_phy_ready_state_enter(void *object)
static void scic_sds_phy_ready_state_enter(struct sci_base_state_machine *sm)
{
	struct scic_sds_phy *sci_phy = object;
	struct scic_sds_phy *sci_phy = container_of(sm, typeof(*sci_phy), state_machine);

	scic_sds_controller_link_up(scic_sds_phy_get_controller(sci_phy),
				    phy_get_non_dummy_port(sci_phy),
@@ -1272,16 +1271,16 @@ static void scic_sds_phy_ready_state_enter(void *object)

}

static void scic_sds_phy_ready_state_exit(void *object)
static void scic_sds_phy_ready_state_exit(struct sci_base_state_machine *sm)
{
	struct scic_sds_phy *sci_phy = object;
	struct scic_sds_phy *sci_phy = container_of(sm, typeof(*sci_phy), state_machine);

	scic_sds_phy_suspend(sci_phy);
}

static void scic_sds_phy_resetting_state_enter(void *object)
static void scic_sds_phy_resetting_state_enter(struct sci_base_state_machine *sm)
{
	struct scic_sds_phy *sci_phy = object;
	struct scic_sds_phy *sci_phy = container_of(sm, typeof(*sci_phy), state_machine);

	/* The phy is being reset, therefore deactivate it from the port.  In
	 * the resetting state we don't notify the user regarding link up and
@@ -1351,7 +1350,6 @@ void scic_sds_phy_construct(struct scic_sds_phy *sci_phy,
			    struct scic_sds_port *owning_port, u8 phy_index)
{
	sci_base_state_machine_construct(&sci_phy->state_machine,
					 sci_phy,
					 scic_sds_phy_state_table,
					 SCI_BASE_PHY_STATE_INITIAL);

+22 −23
Original line number Diff line number Diff line
@@ -1133,9 +1133,9 @@ scic_sds_port_resume_port_task_scheduler(struct scic_sds_port *port)
	writel(pts_control_value, &port->port_task_scheduler_registers->control);
}

static void scic_sds_port_ready_substate_waiting_enter(void *object)
static void scic_sds_port_ready_substate_waiting_enter(struct sci_base_state_machine *sm)
{
	struct scic_sds_port *sci_port = object;
	struct scic_sds_port *sci_port = container_of(sm, typeof(*sci_port), state_machine);

	scic_sds_port_suspend_port_task_scheduler(sci_port);

@@ -1148,10 +1148,10 @@ static void scic_sds_port_ready_substate_waiting_enter(void *object)
	}
}

static void scic_sds_port_ready_substate_operational_enter(void *object)
static void scic_sds_port_ready_substate_operational_enter(struct sci_base_state_machine *sm)
{
	u32 index;
	struct scic_sds_port *sci_port = object;
	struct scic_sds_port *sci_port = container_of(sm, typeof(*sci_port), state_machine);
	struct scic_sds_controller *scic = sci_port->owning_controller;
	struct isci_host *ihost = scic_to_ihost(scic);
	struct isci_port *iport = sci_port_to_iport(sci_port);
@@ -1210,9 +1210,9 @@ static void scic_sds_port_invalidate_dummy_remote_node(struct scic_sds_port *sci
 * exiting the SCIC_SDS_PORT_READY_SUBSTATE_OPERATIONAL. This function reports
 * the port not ready and suspends the port task scheduler. none
 */
static void scic_sds_port_ready_substate_operational_exit(void *object)
static void scic_sds_port_ready_substate_operational_exit(struct sci_base_state_machine *sm)
{
	struct scic_sds_port *sci_port = object;
	struct scic_sds_port *sci_port = container_of(sm, typeof(*sci_port), state_machine);
	struct scic_sds_controller *scic = sci_port->owning_controller;
	struct isci_host *ihost = scic_to_ihost(scic);
	struct isci_port *iport = sci_port_to_iport(sci_port);
@@ -1230,9 +1230,9 @@ static void scic_sds_port_ready_substate_operational_exit(void *object)
		scic_sds_port_invalidate_dummy_remote_node(sci_port);
}

static void scic_sds_port_ready_substate_configuring_enter(void *object)
static void scic_sds_port_ready_substate_configuring_enter(struct sci_base_state_machine *sm)
{
	struct scic_sds_port *sci_port = object;
	struct scic_sds_port *sci_port = container_of(sm, typeof(*sci_port), state_machine);
	struct scic_sds_controller *scic = sci_port->owning_controller;
	struct isci_host *ihost = scic_to_ihost(scic);
	struct isci_port *iport = sci_port_to_iport(sci_port);
@@ -1247,9 +1247,9 @@ static void scic_sds_port_ready_substate_configuring_enter(void *object)
					  SCIC_SDS_PORT_READY_SUBSTATE_OPERATIONAL);
}

static void scic_sds_port_ready_substate_configuring_exit(void *object)
static void scic_sds_port_ready_substate_configuring_exit(struct sci_base_state_machine *sm)
{
	struct scic_sds_port *sci_port = object;
	struct scic_sds_port *sci_port = container_of(sm, typeof(*sci_port), state_machine);

	scic_sds_port_suspend_port_task_scheduler(sci_port);
	if (sci_port->ready_exit)
@@ -1710,9 +1710,9 @@ static void scic_sds_port_post_dummy_remote_node(struct scic_sds_port *sci_port)
	scic_sds_controller_post_request(scic, command);
}

static void scic_sds_port_stopped_state_enter(void *object)
static void scic_sds_port_stopped_state_enter(struct sci_base_state_machine *sm)
{
	struct scic_sds_port *sci_port = object;
	struct scic_sds_port *sci_port = container_of(sm, typeof(*sci_port), state_machine);

	if (sci_port->state_machine.previous_state_id == SCI_BASE_PORT_STATE_STOPPING) {
		/*
@@ -1723,17 +1723,17 @@ static void scic_sds_port_stopped_state_enter(void *object)
	}
}

static void scic_sds_port_stopped_state_exit(void *object)
static void scic_sds_port_stopped_state_exit(struct sci_base_state_machine *sm)
{
	struct scic_sds_port *sci_port = object;
	struct scic_sds_port *sci_port = container_of(sm, typeof(*sci_port), state_machine);

	/* Enable and suspend the port task scheduler */
	scic_sds_port_enable_port_task_scheduler(sci_port);
}

static void scic_sds_port_ready_state_enter(void *object)
static void scic_sds_port_ready_state_enter(struct sci_base_state_machine *sm)
{
	struct scic_sds_port *sci_port = object;
	struct scic_sds_port *sci_port = container_of(sm, typeof(*sci_port), state_machine);
	struct scic_sds_controller *scic = sci_port->owning_controller;
	struct isci_host *ihost = scic_to_ihost(scic);
	struct isci_port *iport = sci_port_to_iport(sci_port);
@@ -1753,25 +1753,25 @@ static void scic_sds_port_ready_state_enter(void *object)
				  SCIC_SDS_PORT_READY_SUBSTATE_WAITING);
}

static void scic_sds_port_resetting_state_exit(void *object)
static void scic_sds_port_resetting_state_exit(struct sci_base_state_machine *sm)
{
	struct scic_sds_port *sci_port = object;
	struct scic_sds_port *sci_port = container_of(sm, typeof(*sci_port), state_machine);

	isci_timer_stop(sci_port->timer_handle);
}

static void scic_sds_port_stopping_state_exit(void *object)
static void scic_sds_port_stopping_state_exit(struct sci_base_state_machine *sm)
{
	struct scic_sds_port *sci_port = object;
	struct scic_sds_port *sci_port = container_of(sm, typeof(*sci_port), state_machine);

	isci_timer_stop(sci_port->timer_handle);

	scic_sds_port_destroy_dummy_resources(sci_port);
}

static void scic_sds_port_failed_state_enter(void *object)
static void scic_sds_port_failed_state_enter(struct sci_base_state_machine *sm)
{
	struct scic_sds_port *sci_port = object;
	struct scic_sds_port *sci_port = container_of(sm, typeof(*sci_port), state_machine);
	struct isci_port *iport = sci_port_to_iport(sci_port);

	isci_port_hard_reset_complete(iport, SCI_FAILURE_TIMEOUT);
@@ -1813,7 +1813,6 @@ void scic_sds_port_construct(struct scic_sds_port *sci_port, u8 index,
			     struct scic_sds_controller *scic)
{
	sci_base_state_machine_construct(&sci_port->state_machine,
					 sci_port,
					 scic_sds_port_state_table,
					 SCI_BASE_PORT_STATE_STOPPED);

+30 −35
Original line number Diff line number Diff line
@@ -807,9 +807,9 @@ static void scic_sds_stp_remote_device_ready_idle_substate_resume_complete_handl
		isci_remote_device_ready(scic_to_ihost(scic), idev);
}

static void scic_sds_remote_device_initial_state_enter(void *object)
static void scic_sds_remote_device_initial_state_enter(struct sci_base_state_machine *sm)
{
	struct scic_sds_remote_device *sci_dev = object;
	struct scic_sds_remote_device *sci_dev = container_of(sm, typeof(*sci_dev), state_machine);

	/* Initial state is a transitional state to the stopped state */
	sci_base_state_machine_change_state(&sci_dev->state_machine,
@@ -904,9 +904,9 @@ static void isci_remote_device_stop_complete(struct isci_host *ihost,
	isci_remote_device_deconstruct(ihost, idev);
}

static void scic_sds_remote_device_stopped_state_enter(void *object)
static void scic_sds_remote_device_stopped_state_enter(struct sci_base_state_machine *sm)
{
	struct scic_sds_remote_device *sci_dev = object;
	struct scic_sds_remote_device *sci_dev = container_of(sm, typeof(*sci_dev), state_machine);
	struct scic_sds_controller *scic = sci_dev->owning_port->owning_controller;
	struct isci_remote_device *idev = sci_dev_to_idev(sci_dev);
	u32 prev_state;
@@ -921,9 +921,9 @@ static void scic_sds_remote_device_stopped_state_enter(void *object)
	scic_sds_controller_remote_device_stopped(scic, sci_dev);
}

static void scic_sds_remote_device_starting_state_enter(void *object)
static void scic_sds_remote_device_starting_state_enter(struct sci_base_state_machine *sm)
{
	struct scic_sds_remote_device *sci_dev = object;
	struct scic_sds_remote_device *sci_dev = container_of(sm, typeof(*sci_dev), state_machine);
	struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
	struct isci_host *ihost = scic_to_ihost(scic);
	struct isci_remote_device *idev = sci_dev_to_idev(sci_dev);
@@ -932,9 +932,9 @@ static void scic_sds_remote_device_starting_state_enter(void *object)
				     SCIC_REMOTE_DEVICE_NOT_READY_START_REQUESTED);
}

static void scic_sds_remote_device_ready_state_enter(void *object)
static void scic_sds_remote_device_ready_state_enter(struct sci_base_state_machine *sm)
{
	struct scic_sds_remote_device *sci_dev = object;
	struct scic_sds_remote_device *sci_dev = container_of(sm, typeof(*sci_dev), state_machine);
	struct scic_sds_controller *scic = sci_dev->owning_port->owning_controller;
	struct isci_remote_device *idev = sci_dev_to_idev(sci_dev);
	struct domain_device *dev = idev->domain_dev;
@@ -951,9 +951,9 @@ static void scic_sds_remote_device_ready_state_enter(void *object)
		isci_remote_device_ready(scic_to_ihost(scic), idev);
}

static void scic_sds_remote_device_ready_state_exit(void *object)
static void scic_sds_remote_device_ready_state_exit(struct sci_base_state_machine *sm)
{
	struct scic_sds_remote_device *sci_dev = object;
	struct scic_sds_remote_device *sci_dev = container_of(sm, typeof(*sci_dev), state_machine);
	struct domain_device *dev = sci_dev_to_domain(sci_dev);

	if (dev->dev_type == SAS_END_DEV) {
@@ -965,24 +965,24 @@ static void scic_sds_remote_device_ready_state_exit(void *object)
	}
}

static void scic_sds_remote_device_resetting_state_enter(void *object)
static void scic_sds_remote_device_resetting_state_enter(struct sci_base_state_machine *sm)
{
	struct scic_sds_remote_device *sci_dev = object;
	struct scic_sds_remote_device *sci_dev = container_of(sm, typeof(*sci_dev), state_machine);

	scic_sds_remote_node_context_suspend(
		&sci_dev->rnc, SCI_SOFTWARE_SUSPENSION, NULL, NULL);
}

static void scic_sds_remote_device_resetting_state_exit(void *object)
static void scic_sds_remote_device_resetting_state_exit(struct sci_base_state_machine *sm)
{
	struct scic_sds_remote_device *sci_dev = object;
	struct scic_sds_remote_device *sci_dev = container_of(sm, typeof(*sci_dev), state_machine);

	scic_sds_remote_node_context_resume(&sci_dev->rnc, NULL, NULL);
}

static void scic_sds_stp_remote_device_ready_idle_substate_enter(void *object)
static void scic_sds_stp_remote_device_ready_idle_substate_enter(struct sci_base_state_machine *sm)
{
	struct scic_sds_remote_device *sci_dev = object;
	struct scic_sds_remote_device *sci_dev = container_of(sm, typeof(*sci_dev), state_machine);

	sci_dev->working_request = NULL;
	if (scic_sds_remote_node_context_is_ready(&sci_dev->rnc)) {
@@ -997,9 +997,9 @@ static void scic_sds_stp_remote_device_ready_idle_substate_enter(void *object)
	}
}

static void scic_sds_stp_remote_device_ready_cmd_substate_enter(void *object)
static void scic_sds_stp_remote_device_ready_cmd_substate_enter(struct sci_base_state_machine *sm)
{
	struct scic_sds_remote_device *sci_dev = object;
	struct scic_sds_remote_device *sci_dev = container_of(sm, typeof(*sci_dev), state_machine);
	struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);

	BUG_ON(sci_dev->working_request == NULL);
@@ -1008,9 +1008,9 @@ static void scic_sds_stp_remote_device_ready_cmd_substate_enter(void *object)
				     SCIC_REMOTE_DEVICE_NOT_READY_SATA_REQUEST_STARTED);
}

static void scic_sds_stp_remote_device_ready_ncq_error_substate_enter(void *object)
static void scic_sds_stp_remote_device_ready_ncq_error_substate_enter(struct sci_base_state_machine *sm)
{
	struct scic_sds_remote_device *sci_dev = object;
	struct scic_sds_remote_device *sci_dev = container_of(sm, typeof(*sci_dev), state_machine);
	struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
	struct isci_remote_device *idev = sci_dev_to_idev(sci_dev);

@@ -1019,17 +1019,17 @@ static void scic_sds_stp_remote_device_ready_ncq_error_substate_enter(void *obje
					     sci_dev->not_ready_reason);
}

static void scic_sds_smp_remote_device_ready_idle_substate_enter(void *object)
static void scic_sds_smp_remote_device_ready_idle_substate_enter(struct sci_base_state_machine *sm)
{
	struct scic_sds_remote_device *sci_dev = object;
	struct scic_sds_remote_device *sci_dev = container_of(sm, typeof(*sci_dev), state_machine);
	struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);

	isci_remote_device_ready(scic_to_ihost(scic), sci_dev_to_idev(sci_dev));
}

static void scic_sds_smp_remote_device_ready_cmd_substate_enter(void *object)
static void scic_sds_smp_remote_device_ready_cmd_substate_enter(struct sci_base_state_machine *sm)
{
	struct scic_sds_remote_device *sci_dev = object;
	struct scic_sds_remote_device *sci_dev = container_of(sm, typeof(*sci_dev), state_machine);
	struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);

	BUG_ON(sci_dev->working_request == NULL);
@@ -1038,9 +1038,9 @@ static void scic_sds_smp_remote_device_ready_cmd_substate_enter(void *object)
				     SCIC_REMOTE_DEVICE_NOT_READY_SMP_REQUEST_STARTED);
}

static void scic_sds_smp_remote_device_ready_cmd_substate_exit(void *object)
static void scic_sds_smp_remote_device_ready_cmd_substate_exit(struct sci_base_state_machine *sm)
{
	struct scic_sds_remote_device *sci_dev = object;
	struct scic_sds_remote_device *sci_dev = container_of(sm, typeof(*sci_dev), state_machine);

	sci_dev->working_request = NULL;
}
@@ -1102,16 +1102,11 @@ static void scic_remote_device_construct(struct scic_sds_port *sci_port,
	sci_dev->owning_port = sci_port;
	sci_dev->started_request_count = 0;

	sci_base_state_machine_construct(
		&sci_dev->state_machine,
		sci_dev,
	sci_base_state_machine_construct(&sci_dev->state_machine,
					 scic_sds_remote_device_state_table,
		SCI_BASE_REMOTE_DEVICE_STATE_INITIAL
		);
					 SCI_BASE_REMOTE_DEVICE_STATE_INITIAL);

	sci_base_state_machine_start(
		&sci_dev->state_machine
		);
	sci_base_state_machine_start(&sci_dev->state_machine);

	scic_sds_remote_node_context_construct(&sci_dev->rnc,
					       SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX);
+17 −22

File changed.

Preview size limit exceeded, changes collapsed.

Loading