提交 09d7da13 编写于 作者: D Dave Jiang 提交者: Dan Williams

isci: Remove event_* calls as they are just wrappers

Removed isci_event_* calls and call those functions directly.
Reported-by: NChristoph Hellwig <hch@infradead.org>
Signed-off-by: NDave Jiang <dave.jiang@intel.com>
Signed-off-by: NDan Williams <dan.j.williams@intel.com>
上级 52ae18ac
...@@ -9,7 +9,7 @@ EXTRA_CFLAGS += -Idrivers/scsi/isci/core/ -Idrivers/scsi/isci/ ...@@ -9,7 +9,7 @@ EXTRA_CFLAGS += -Idrivers/scsi/isci/core/ -Idrivers/scsi/isci/
obj-$(CONFIG_SCSI_ISCI) += isci.o obj-$(CONFIG_SCSI_ISCI) += isci.o
isci-objs := init.o phy.o request.o sata.o \ isci-objs := init.o phy.o request.o sata.o \
remote_device.o port.o timers.o \ remote_device.o port.o timers.o \
host.o task.o events.o probe_roms.o \ host.o task.o probe_roms.o \
core/scic_sds_controller.o \ core/scic_sds_controller.o \
core/scic_sds_remote_device.o \ core/scic_sds_remote_device.o \
core/scic_sds_request.o \ core/scic_sds_request.o \
......
...@@ -681,8 +681,7 @@ void scic_sds_controller_copy_task_context( ...@@ -681,8 +681,7 @@ void scic_sds_controller_copy_task_context(
struct scic_sds_controller *this_controller, struct scic_sds_controller *this_controller,
struct scic_sds_request *this_request); struct scic_sds_request *this_request);
void scic_sds_controller_timeout_handler( void scic_sds_controller_timeout_handler(void *controller);
struct scic_sds_controller *controller);
void scic_sds_controller_initialize_power_control( void scic_sds_controller_initialize_power_control(
struct scic_sds_controller *this_controller); struct scic_sds_controller *this_controller);
......
...@@ -369,15 +369,20 @@ enum sci_status scic_sds_phy_initialize( ...@@ -369,15 +369,20 @@ enum sci_status scic_sds_phy_initialize(
struct scu_transport_layer_registers __iomem *transport_layer_registers, struct scu_transport_layer_registers __iomem *transport_layer_registers,
struct scu_link_layer_registers __iomem *link_layer_registers) struct scu_link_layer_registers __iomem *link_layer_registers)
{ {
struct scic_sds_controller *scic = scic_sds_phy_get_controller(sci_phy);
struct isci_host *ihost = sci_object_get_association(scic);
/* Create the SIGNATURE FIS Timeout timer for this phy */ /* Create the SIGNATURE FIS Timeout timer for this phy */
sci_phy->sata_timeout_timer = isci_event_timer_create( sci_phy->sata_timeout_timer =
scic_sds_phy_get_controller(sci_phy), isci_timer_create(
scic_sds_phy_sata_timeout, ihost,
sci_phy sci_phy,
); scic_sds_phy_sata_timeout);
/* Perfrom the initialization of the TL hardware */ /* Perfrom the initialization of the TL hardware */
scic_sds_phy_transport_layer_initialization(sci_phy, transport_layer_registers); scic_sds_phy_transport_layer_initialization(
sci_phy,
transport_layer_registers);
/* Perofrm the initialization of the PE hardware */ /* Perofrm the initialization of the PE hardware */
scic_sds_phy_link_layer_initialization(sci_phy, link_layer_registers); scic_sds_phy_link_layer_initialization(sci_phy, link_layer_registers);
...@@ -387,8 +392,7 @@ enum sci_status scic_sds_phy_initialize( ...@@ -387,8 +392,7 @@ enum sci_status scic_sds_phy_initialize(
* transition to the stopped state. */ * transition to the stopped state. */
sci_base_state_machine_change_state( sci_base_state_machine_change_state(
scic_sds_phy_get_base_state_machine(sci_phy), scic_sds_phy_get_base_state_machine(sci_phy),
SCI_BASE_PHY_STATE_STOPPED SCI_BASE_PHY_STATE_STOPPED);
);
return SCI_SUCCESS; return SCI_SUCCESS;
} }
...@@ -1742,49 +1746,42 @@ static void scic_sds_phy_starting_await_sata_power_substate_exit( ...@@ -1742,49 +1746,42 @@ static void scic_sds_phy_starting_await_sata_power_substate_exit(
/** /**
* *
* @object: This is the struct sci_base_object which is cast to a struct scic_sds_phy object. * @object: This is the struct sci_base_object which is cast to a
* struct scic_sds_phy object.
* *
* This method will perform the actions required by the struct scic_sds_phy on * This function will perform the actions required by the struct scic_sds_phy on
* entering the SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SATA_PHY_EN. - Set the * entering the SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SATA_PHY_EN. - Set the
* struct scic_sds_phy object state handlers for this state. none * struct scic_sds_phy object state handlers for this state. none
*/ */
static void scic_sds_phy_starting_await_sata_phy_substate_enter( static void scic_sds_phy_starting_await_sata_phy_substate_enter(
struct sci_base_object *object) struct sci_base_object *object)
{ {
struct scic_sds_phy *this_phy; struct scic_sds_phy *sci_phy = (struct scic_sds_phy *)object;
this_phy = (struct scic_sds_phy *)object;
scic_sds_phy_set_starting_substate_handlers( scic_sds_phy_set_starting_substate_handlers(
this_phy, SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SATA_PHY_EN sci_phy,
); SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SATA_PHY_EN);
isci_event_timer_start( isci_timer_start(sci_phy->sata_timeout_timer,
scic_sds_phy_get_controller(this_phy), SCIC_SDS_SATA_LINK_TRAINING_TIMEOUT);
this_phy->sata_timeout_timer,
SCIC_SDS_SATA_LINK_TRAINING_TIMEOUT
);
} }
/** /**
* *
* @object: This is the struct sci_base_object which is cast to a struct scic_sds_phy object. * @object: This is the struct sci_base_object which is cast to a
* struct scic_sds_phy object.
* *
* This method will perform the actions required by the struct scic_sds_phy on exiting * This method will perform the actions required by the struct scic_sds_phy
* on exiting
* the SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SATA_SPEED_EN. - stop the timer * the SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SATA_SPEED_EN. - stop the timer
* that was started on entry to await sata phy event notification none * that was started on entry to await sata phy event notification none
*/ */
static void scic_sds_phy_starting_await_sata_phy_substate_exit( static inline void scic_sds_phy_starting_await_sata_phy_substate_exit(
struct sci_base_object *object) struct sci_base_object *object)
{ {
struct scic_sds_phy *this_phy; struct scic_sds_phy *sci_phy = (struct scic_sds_phy *)object;
this_phy = (struct scic_sds_phy *)object;
isci_event_timer_stop( isci_timer_stop(sci_phy->sata_timeout_timer);
scic_sds_phy_get_controller(this_phy),
this_phy->sata_timeout_timer
);
} }
/** /**
...@@ -1798,104 +1795,92 @@ static void scic_sds_phy_starting_await_sata_phy_substate_exit( ...@@ -1798,104 +1795,92 @@ static void scic_sds_phy_starting_await_sata_phy_substate_exit(
static void scic_sds_phy_starting_await_sata_speed_substate_enter( static void scic_sds_phy_starting_await_sata_speed_substate_enter(
struct sci_base_object *object) struct sci_base_object *object)
{ {
struct scic_sds_phy *this_phy; struct scic_sds_phy *sci_phy = (struct scic_sds_phy *)object;
this_phy = (struct scic_sds_phy *)object;
scic_sds_phy_set_starting_substate_handlers( scic_sds_phy_set_starting_substate_handlers(
this_phy, SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SATA_SPEED_EN sci_phy,
); SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SATA_SPEED_EN);
isci_event_timer_start( isci_timer_start(sci_phy->sata_timeout_timer,
scic_sds_phy_get_controller(this_phy), SCIC_SDS_SATA_LINK_TRAINING_TIMEOUT);
this_phy->sata_timeout_timer,
SCIC_SDS_SATA_LINK_TRAINING_TIMEOUT
);
} }
/** /**
* *
* @object: This is the struct sci_base_object which is cast to a struct scic_sds_phy object. * @object: This is the struct sci_base_object which is cast to a
* struct scic_sds_phy object.
* *
* This method will perform the actions required by the struct scic_sds_phy on exiting * This function will perform the actions required by the
* struct scic_sds_phy on exiting
* the SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SATA_SPEED_EN. - stop the timer * the SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SATA_SPEED_EN. - stop the timer
* that was started on entry to await sata phy event notification none * that was started on entry to await sata phy event notification none
*/ */
static void scic_sds_phy_starting_await_sata_speed_substate_exit( static inline void scic_sds_phy_starting_await_sata_speed_substate_exit(
struct sci_base_object *object) struct sci_base_object *object)
{ {
struct scic_sds_phy *this_phy; struct scic_sds_phy *sci_phy = (struct scic_sds_phy *)object;
this_phy = (struct scic_sds_phy *)object; isci_timer_stop(sci_phy->sata_timeout_timer);
isci_event_timer_stop(
scic_sds_phy_get_controller(this_phy),
this_phy->sata_timeout_timer
);
} }
/** /**
* *
* @object: This is the struct sci_base_object which is cast to a struct scic_sds_phy object. * @object: This is the struct sci_base_object which is cast to a
* struct scic_sds_phy object.
* *
* This method will perform the actions required by the struct scic_sds_phy on * This function will perform the actions required by the struct scic_sds_phy on
* entering the SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SIG_FIS_UF. - Set the * entering the SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SIG_FIS_UF. - Set the
* struct scic_sds_phy object state handlers for this state. - Start the SIGNATURE FIS * struct scic_sds_phy object state handlers for this state.
* - Start the SIGNATURE FIS
* timeout timer none * timeout timer none
*/ */
static void scic_sds_phy_starting_await_sig_fis_uf_substate_enter( static void scic_sds_phy_starting_await_sig_fis_uf_substate_enter(
struct sci_base_object *object) struct sci_base_object *object)
{ {
bool continue_to_ready_state; bool continue_to_ready_state;
struct scic_sds_phy *this_phy; struct scic_sds_phy *sci_phy = (struct scic_sds_phy *)object;
this_phy = (struct scic_sds_phy *)object;
scic_sds_phy_set_starting_substate_handlers( scic_sds_phy_set_starting_substate_handlers(
this_phy, SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SIG_FIS_UF sci_phy,
); SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SIG_FIS_UF);
continue_to_ready_state = scic_sds_port_link_detected( continue_to_ready_state = scic_sds_port_link_detected(
this_phy->owning_port, sci_phy->owning_port,
this_phy sci_phy);
);
if (continue_to_ready_state) { if (continue_to_ready_state) {
/* /*
* Clear the PE suspend condition so we can actually receive SIG FIS * Clear the PE suspend condition so we can actually
* The hardware will not respond to the XRDY until the PE suspend * receive SIG FIS
* condition is cleared. */ * The hardware will not respond to the XRDY until the PE
scic_sds_phy_resume(this_phy); * suspend condition is cleared.
*/
scic_sds_phy_resume(sci_phy);
isci_event_timer_start( isci_timer_start(sci_phy->sata_timeout_timer,
scic_sds_phy_get_controller(this_phy), SCIC_SDS_SIGNATURE_FIS_TIMEOUT);
this_phy->sata_timeout_timer, } else
SCIC_SDS_SIGNATURE_FIS_TIMEOUT sci_phy->is_in_link_training = false;
);
} else {
this_phy->is_in_link_training = false;
}
} }
/** /**
* *
* @object: This is the struct sci_base_object which is cast to a struct scic_sds_phy object. * @object: This is the struct sci_base_object which is cast to a
* struct scic_sds_phy object.
* *
* This method will perform the actions required by the struct scic_sds_phy on exiting * This function will perform the actions required by the
* struct scic_sds_phy on exiting
* the SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SIG_FIS_UF. - Stop the SIGNATURE * the SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SIG_FIS_UF. - Stop the SIGNATURE
* FIS timeout timer. none * FIS timeout timer. none
*/ */
static void scic_sds_phy_starting_await_sig_fis_uf_substate_exit( static inline void scic_sds_phy_starting_await_sig_fis_uf_substate_exit(
struct sci_base_object *object) struct sci_base_object *object)
{ {
struct scic_sds_phy *this_phy; struct scic_sds_phy *sci_phy;
this_phy = (struct scic_sds_phy *)object; sci_phy = (struct scic_sds_phy *)object;
isci_event_timer_stop( isci_timer_stop(sci_phy->sata_timeout_timer);
scic_sds_phy_get_controller(this_phy),
this_phy->sata_timeout_timer
);
} }
/** /**
...@@ -2158,27 +2143,30 @@ enum sci_status scic_sds_phy_default_consume_power_handler( ...@@ -2158,27 +2143,30 @@ enum sci_status scic_sds_phy_default_consume_power_handler(
/** /**
* *
* @phy: This is the struct sci_base_phy object which is cast into a struct scic_sds_phy * @phy: This is the struct sci_base_phy object which is cast into a
* object. * struct scic_sds_phy object.
* *
* This method takes the struct scic_sds_phy from a stopped state and attempts to * This method takes the struct scic_sds_phy from a stopped state and
* start it. - The phy state machine is transitioned to the * attempts to start it. - The phy state machine is transitioned to the
* SCI_BASE_PHY_STATE_STARTING. enum sci_status SCI_SUCCESS * SCI_BASE_PHY_STATE_STARTING. enum sci_status SCI_SUCCESS
*/ */
static enum sci_status scic_sds_phy_stopped_state_start_handler(struct sci_base_phy *phy) static enum sci_status scic_sds_phy_stopped_state_start_handler(
struct sci_base_phy *phy)
{ {
struct scic_sds_phy *this_phy; struct scic_sds_phy *sci_phy = (struct scic_sds_phy *)phy;
struct scic_sds_controller *scic = scic_sds_phy_get_controller(sci_phy);
this_phy = (struct scic_sds_phy *)phy; struct isci_host *ihost = sci_object_get_association(scic);
/* Create the SIGNATURE FIS Timeout timer for this phy */ /* Create the SIGNATURE FIS Timeout timer for this phy */
this_phy->sata_timeout_timer = isci_event_timer_create( sci_phy->sata_timeout_timer =
scic_sds_phy_get_controller(this_phy), isci_timer_create(
scic_sds_phy_sata_timeout, this_phy); ihost,
sci_phy,
scic_sds_phy_sata_timeout);
if (this_phy->sata_timeout_timer != NULL) { if (sci_phy->sata_timeout_timer != NULL) {
sci_base_state_machine_change_state( sci_base_state_machine_change_state(
scic_sds_phy_get_base_state_machine(this_phy), scic_sds_phy_get_base_state_machine(sci_phy),
SCI_BASE_PHY_STATE_STARTING); SCI_BASE_PHY_STATE_STARTING);
} }
...@@ -2525,14 +2513,16 @@ static void scic_sds_phy_initial_state_enter( ...@@ -2525,14 +2513,16 @@ static void scic_sds_phy_initial_state_enter(
* @object: This is the struct sci_base_object which is cast to a * @object: This is the struct sci_base_object which is cast to a
* struct scic_sds_phy object. * struct scic_sds_phy object.
* *
* This method will perform the actions required by the struct scic_sds_phy on * This function will perform the actions required by the struct scic_sds_phy on
* entering the SCI_BASE_PHY_STATE_INITIAL. - This function sets the state * entering the SCI_BASE_PHY_STATE_INITIAL. - This function sets the state
* handlers for the phy object base state machine initial state. - The SCU * handlers for the phy object base state machine initial state. - The SCU
* hardware is requested to stop the protocol engine. none * hardware is requested to stop the protocol engine. none
*/ */
static void scic_sds_phy_stopped_state_enter(struct sci_base_object *object) static void scic_sds_phy_stopped_state_enter(struct sci_base_object *object)
{ {
struct scic_sds_phy *sci_phy; struct scic_sds_phy *sci_phy = (struct scic_sds_phy *)object;
struct scic_sds_controller *scic = scic_sds_phy_get_controller(sci_phy);
struct isci_host *ihost = sci_object_get_association(scic);
sci_phy = (struct scic_sds_phy *)object; sci_phy = (struct scic_sds_phy *)object;
...@@ -2541,11 +2531,11 @@ static void scic_sds_phy_stopped_state_enter(struct sci_base_object *object) ...@@ -2541,11 +2531,11 @@ static void scic_sds_phy_stopped_state_enter(struct sci_base_object *object)
* reset state * reset state
*/ */
scic_sds_phy_set_base_state_handlers(sci_phy, SCI_BASE_PHY_STATE_STOPPED); scic_sds_phy_set_base_state_handlers(sci_phy,
SCI_BASE_PHY_STATE_STOPPED);
if (sci_phy->sata_timeout_timer != NULL) { if (sci_phy->sata_timeout_timer != NULL) {
isci_event_timer_destroy(scic_sds_phy_get_controller(sci_phy), isci_del_timer(ihost, sci_phy->sata_timeout_timer);
sci_phy->sata_timeout_timer);
sci_phy->sata_timeout_timer = NULL; sci_phy->sata_timeout_timer = NULL;
} }
...@@ -2554,7 +2544,8 @@ static void scic_sds_phy_stopped_state_enter(struct sci_base_object *object) ...@@ -2554,7 +2544,8 @@ static void scic_sds_phy_stopped_state_enter(struct sci_base_object *object)
if (sci_phy->parent.state_machine.previous_state_id != if (sci_phy->parent.state_machine.previous_state_id !=
SCI_BASE_PHY_STATE_INITIAL) SCI_BASE_PHY_STATE_INITIAL)
scic_sds_controller_link_down(scic_sds_phy_get_controller(sci_phy), scic_sds_controller_link_down(
scic_sds_phy_get_controller(sci_phy),
scic_sds_phy_get_port(sci_phy), scic_sds_phy_get_port(sci_phy),
sci_phy); sci_phy);
} }
......
...@@ -431,46 +431,47 @@ static void scic_sds_mpc_agent_link_up( ...@@ -431,46 +431,47 @@ static void scic_sds_mpc_agent_link_up(
* assigned port. * assigned port.
* @phy: This is the phy object which has gone link down. * @phy: This is the phy object which has gone link down.
* *
* This method handles the manual port configuration link down notifications. * This function handles the manual port configuration link down notifications.
* Since all ports and phys are associated at initialization time we just turn * Since all ports and phys are associated at initialization time we just turn
* around and notifiy the port object of the link down event. If this PHY is * around and notifiy the port object of the link down event. If this PHY is
* not associated with a port there is no action taken. Is it possible to get a * not associated with a port there is no action taken. Is it possible to get a
* link down notification from a phy that has no assocoated port? * link down notification from a phy that has no assocoated port?
*/ */
static void scic_sds_mpc_agent_link_down( static void scic_sds_mpc_agent_link_down(
struct scic_sds_controller *controller, struct scic_sds_controller *scic,
struct scic_sds_port_configuration_agent *port_agent, struct scic_sds_port_configuration_agent *port_agent,
struct scic_sds_port *port, struct scic_sds_port *sci_port,
struct scic_sds_phy *phy) struct scic_sds_phy *sci_phy)
{ {
if (port != NULL) { if (sci_port != NULL) {
/* /*
* If we can form a new port from the remainder of the phys then we want * If we can form a new port from the remainder of the phys
* to start the timer to allow the SCI User to cleanup old devices and * then we want to start the timer to allow the SCI User to
* rediscover the port before rebuilding the port with the phys that * cleanup old devices and rediscover the port before
* remain in the ready state. */ * rebuilding the port with the phys that remain in the ready
port_agent->phy_ready_mask &= ~(1 << scic_sds_phy_get_index(phy)); * state.
port_agent->phy_configured_mask &= ~(1 << scic_sds_phy_get_index(phy)); */
port_agent->phy_ready_mask &=
~(1 << scic_sds_phy_get_index(sci_phy));
port_agent->phy_configured_mask &=
~(1 << scic_sds_phy_get_index(sci_phy));
/* /*
* Check to see if there are more phys waiting to be configured into a port. * Check to see if there are more phys waiting to be
* If there are allow the SCI User to tear down this port, if necessary, and * configured into a port. If there are allow the SCI User
* then reconstruc the port after the timeout. */ * to tear down this port, if necessary, and then reconstruct
if ( * the port after the timeout.
(port_agent->phy_configured_mask == 0x0000) */
&& (port_agent->phy_ready_mask != 0x0000) if ((port_agent->phy_configured_mask == 0x0000) &&
&& !port_agent->timer_pending (port_agent->phy_ready_mask != 0x0000) &&
) { !port_agent->timer_pending) {
port_agent->timer_pending = true; port_agent->timer_pending = true;
isci_event_timer_start( isci_timer_start(port_agent->timer,
controller, SCIC_SDS_MPC_RECONFIGURATION_TIMEOUT);
port_agent->timer,
SCIC_SDS_MPC_RECONFIGURATION_TIMEOUT
);
} }
scic_sds_port_link_down(port, phy); scic_sds_port_link_down(sci_port, sci_phy);
} }
} }
...@@ -535,19 +536,18 @@ static enum sci_status scic_sds_apc_agent_validate_phy_configuration( ...@@ -535,19 +536,18 @@ static enum sci_status scic_sds_apc_agent_validate_phy_configuration(
* the next time period. This could be caused by either a link down event or a * the next time period. This could be caused by either a link down event or a
* link up event where we can not yet tell to which port a phy belongs. * link up event where we can not yet tell to which port a phy belongs.
*/ */
static void scic_sds_apc_agent_start_timer( static inline void scic_sds_apc_agent_start_timer(
struct scic_sds_controller *controller, struct scic_sds_controller *scic,
struct scic_sds_port_configuration_agent *port_agent, struct scic_sds_port_configuration_agent *port_agent,
struct scic_sds_phy *phy, struct scic_sds_phy *sci_phy,
u32 timeout) u32 timeout)
{ {
if (port_agent->timer_pending) { if (port_agent->timer_pending)
isci_event_timer_stop(controller, port_agent->timer); isci_timer_stop(port_agent->timer);
}
port_agent->timer_pending = true; port_agent->timer_pending = true;
isci_event_timer_start(controller, port_agent->timer, timeout); isci_timer_start(port_agent->timer, timeout);
} }
/** /**
...@@ -816,45 +816,46 @@ void scic_sds_port_configuration_agent_construct( ...@@ -816,45 +816,46 @@ void scic_sds_port_configuration_agent_construct(
* This method will construct the port configuration agent for this controller. * This method will construct the port configuration agent for this controller.
*/ */
enum sci_status scic_sds_port_configuration_agent_initialize( enum sci_status scic_sds_port_configuration_agent_initialize(
struct scic_sds_controller *controller, struct scic_sds_controller *scic,
struct scic_sds_port_configuration_agent *port_agent) struct scic_sds_port_configuration_agent *port_agent)
{ {
enum sci_status status = SCI_SUCCESS; enum sci_status status = SCI_SUCCESS;
enum SCIC_PORT_CONFIGURATION_MODE mode; enum SCIC_PORT_CONFIGURATION_MODE mode;
struct isci_host *ihost = sci_object_get_association(scic);
mode = controller->oem_parameters.sds1.controller.mode_type; mode = scic->oem_parameters.sds1.controller.mode_type;
if (mode == SCIC_PORT_MANUAL_CONFIGURATION_MODE) { if (mode == SCIC_PORT_MANUAL_CONFIGURATION_MODE) {
status = scic_sds_mpc_agent_validate_phy_configuration(controller, port_agent); status = scic_sds_mpc_agent_validate_phy_configuration(
scic, port_agent);
port_agent->link_up_handler = scic_sds_mpc_agent_link_up; port_agent->link_up_handler = scic_sds_mpc_agent_link_up;
port_agent->link_down_handler = scic_sds_mpc_agent_link_down; port_agent->link_down_handler = scic_sds_mpc_agent_link_down;
port_agent->timer = isci_event_timer_create( port_agent->timer = isci_timer_create(
controller, ihost,
scic_sds_mpc_agent_timeout_handler, scic,
controller scic_sds_mpc_agent_timeout_handler);
);
} else { } else {
status = scic_sds_apc_agent_validate_phy_configuration(controller, port_agent); status = scic_sds_apc_agent_validate_phy_configuration(
scic, port_agent);
port_agent->link_up_handler = scic_sds_apc_agent_link_up; port_agent->link_up_handler = scic_sds_apc_agent_link_up;
port_agent->link_down_handler = scic_sds_apc_agent_link_down; port_agent->link_down_handler = scic_sds_apc_agent_link_down;
port_agent->timer = isci_event_timer_create( port_agent->timer = isci_timer_create(
controller, ihost,
scic_sds_apc_agent_timeout_handler, scic,
controller scic_sds_apc_agent_timeout_handler);
);
} }
/* Make sure we have actually gotten a timer */ /* Make sure we have actually gotten a timer */
if ((status == SCI_SUCCESS) && (port_agent->timer == NULL)) { if ((status == SCI_SUCCESS) && (port_agent->timer == NULL)) {
dev_err(scic_to_dev(controller), dev_err(scic_to_dev(scic),
"%s: Controller 0x%p automatic port configuration " "%s: Controller 0x%p automatic port configuration "
"agent could not get timer.\n", "agent could not get timer.\n",
__func__, __func__,
controller); scic);
status = SCI_FAILURE; status = SCI_FAILURE;
} }
......
...@@ -1795,7 +1795,7 @@ static void scic_sds_remote_device_initial_state_enter( ...@@ -1795,7 +1795,7 @@ static void scic_sds_remote_device_initial_state_enter(
* @object: This is the struct sci_base_object that is cast into a * @object: This is the struct sci_base_object that is cast into a
* struct scic_sds_remote_device. * struct scic_sds_remote_device.
* *
* This is the enter method for the SCI_BASE_REMOTE_DEVICE_STATE_INITIAL it * This is the enter function for the SCI_BASE_REMOTE_DEVICE_STATE_INITIAL it
* sets the stopped state handlers and if this state is entered from the * sets the stopped state handlers and if this state is entered from the
* SCI_BASE_REMOTE_DEVICE_STATE_STOPPING then the SCI User is informed that the * SCI_BASE_REMOTE_DEVICE_STATE_STOPPING then the SCI User is informed that the
* device stop is complete. none * device stop is complete. none
...@@ -1803,30 +1803,29 @@ static void scic_sds_remote_device_initial_state_enter( ...@@ -1803,30 +1803,29 @@ static void scic_sds_remote_device_initial_state_enter(
static void scic_sds_remote_device_stopped_state_enter( static void scic_sds_remote_device_stopped_state_enter(
struct sci_base_object *object) struct sci_base_object *object)
{ {
struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)object; struct scic_sds_remote_device *sci_dev =
(struct scic_sds_remote_device *)object;
struct scic_sds_controller *scic =
scic_sds_remote_device_get_controller(sci_dev);
struct isci_host *ihost = sci_object_get_association(scic);
struct isci_remote_device *idev =
sci_object_get_association(sci_dev);
SET_STATE_HANDLER( SET_STATE_HANDLER(sci_dev,
this_device,
scic_sds_remote_device_state_handler_table, scic_sds_remote_device_state_handler_table,
SCI_BASE_REMOTE_DEVICE_STATE_STOPPED SCI_BASE_REMOTE_DEVICE_STATE_STOPPED);
);
/* /*
* If we are entering from the stopping state let the SCI User know that * If we are entering from the stopping state let the SCI User know that
* the stop operation has completed. */ * the stop operation has completed.
if (this_device->parent.state_machine.previous_state_id */
== SCI_BASE_REMOTE_DEVICE_STATE_STOPPING) { if (sci_dev->parent.state_machine.previous_state_id ==
isci_event_remote_device_stop_complete( SCI_BASE_REMOTE_DEVICE_STATE_STOPPING)
scic_sds_remote_device_get_controller(this_device), isci_remote_device_stop_complete(ihost, idev, SCI_SUCCESS);
this_device,
SCI_SUCCESS
);
}
scic_sds_controller_remote_device_stopped( scic_sds_controller_remote_device_stopped(
scic_sds_remote_device_get_controller(this_device), scic_sds_remote_device_get_controller(sci_dev),
this_device sci_dev);
);
} }
/** /**
...@@ -1834,29 +1833,28 @@ static void scic_sds_remote_device_stopped_state_enter( ...@@ -1834,29 +1833,28 @@ static void scic_sds_remote_device_stopped_state_enter(
* @object: This is the struct sci_base_object that is cast into a * @object: This is the struct sci_base_object that is cast into a
* struct scic_sds_remote_device. * struct scic_sds_remote_device.
* *
* This is the enter method for the SCI_BASE_REMOTE_DEVICE_STATE_STARTING it * This is the enter function for the SCI_BASE_REMOTE_DEVICE_STATE_STARTING it
* sets the starting state handlers, sets the device not ready, and posts the * sets the starting state handlers, sets the device not ready, and posts the
* remote node context to the hardware. none * remote node context to the hardware. none
*/ */
static void scic_sds_remote_device_starting_state_enter( static void scic_sds_remote_device_starting_state_enter(
struct sci_base_object *object) struct sci_base_object *object)
{ {
struct scic_sds_controller *the_controller; struct scic_sds_controller *scic;
struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)object; struct scic_sds_remote_device *sci_dev =
(struct scic_sds_remote_device *)object;
struct isci_remote_device *idev = sci_object_get_association(sci_dev);
the_controller = scic_sds_remote_device_get_controller(this_device); scic = scic_sds_remote_device_get_controller(sci_dev);
SET_STATE_HANDLER( SET_STATE_HANDLER(
this_device, sci_dev,
scic_sds_remote_device_state_handler_table, scic_sds_remote_device_state_handler_table,
SCI_BASE_REMOTE_DEVICE_STATE_STARTING SCI_BASE_REMOTE_DEVICE_STATE_STARTING);
);
isci_event_remote_device_not_ready( isci_remote_device_not_ready(
the_controller, idev,
this_device, SCIC_REMOTE_DEVICE_NOT_READY_START_REQUESTED);
SCIC_REMOTE_DEVICE_NOT_READY_START_REQUESTED
);
} }
/** /**
...@@ -1864,27 +1862,29 @@ static void scic_sds_remote_device_starting_state_enter( ...@@ -1864,27 +1862,29 @@ static void scic_sds_remote_device_starting_state_enter(
* @object: This is the struct sci_base_object that is cast into a * @object: This is the struct sci_base_object that is cast into a
* struct scic_sds_remote_device. * struct scic_sds_remote_device.
* *
* This is the exit method for the SCI_BASE_REMOTE_DEVICE_STATE_STARTING it * This is the exit function for the SCI_BASE_REMOTE_DEVICE_STATE_STARTING it
* reports that the device start is complete. none * reports that the device start is complete. none
*/ */
static void scic_sds_remote_device_starting_state_exit( static void scic_sds_remote_device_starting_state_exit(
struct sci_base_object *object) struct sci_base_object *object)
{ {
struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)object; struct scic_sds_remote_device *sci_dev =
(struct scic_sds_remote_device *)object;
struct scic_sds_controller *scic =
scic_sds_remote_device_get_controller(sci_dev);
struct isci_host *ihost = sci_object_get_association(scic);
struct isci_remote_device *idev = sci_object_get_association(sci_dev);
/* /*
* / @todo Check the device object for the proper return code for this * @todo Check the device object for the proper return code for this
* / callback */ * callback
isci_event_remote_device_start_complete( */
scic_sds_remote_device_get_controller(this_device), isci_remote_device_start_complete(ihost, idev, SCI_SUCCESS);
this_device,
SCI_SUCCESS
);
scic_sds_controller_remote_device_started( scic_sds_controller_remote_device_started(
scic_sds_remote_device_get_controller(this_device), scic_sds_remote_device_get_controller(sci_dev),
this_device sci_dev);
);
} }
/** /**
...@@ -1892,30 +1892,28 @@ static void scic_sds_remote_device_starting_state_exit( ...@@ -1892,30 +1892,28 @@ static void scic_sds_remote_device_starting_state_exit(
* @object: This is the struct sci_base_object that is cast into a * @object: This is the struct sci_base_object that is cast into a
* struct scic_sds_remote_device. * struct scic_sds_remote_device.
* *
* This is the enter method for the SCI_BASE_REMOTE_DEVICE_STATE_READY it sets * This is the enter function for the SCI_BASE_REMOTE_DEVICE_STATE_READY it sets
* the ready state handlers, and starts the ready substate machine. none * the ready state handlers, and starts the ready substate machine. none
*/ */
static void scic_sds_remote_device_ready_state_enter( static void scic_sds_remote_device_ready_state_enter(
struct sci_base_object *object) struct sci_base_object *object)
{ {
struct scic_sds_controller *the_controller; struct scic_sds_remote_device *sci_dev =
struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)object; (struct scic_sds_remote_device *)object;
struct isci_remote_device *idev = sci_object_get_association(sci_dev);
struct scic_sds_controller *scic
= scic_sds_remote_device_get_controller(sci_dev);
the_controller = scic_sds_remote_device_get_controller(this_device); SET_STATE_HANDLER(sci_dev,
SET_STATE_HANDLER(
this_device,
scic_sds_remote_device_state_handler_table, scic_sds_remote_device_state_handler_table,
SCI_BASE_REMOTE_DEVICE_STATE_READY SCI_BASE_REMOTE_DEVICE_STATE_READY);
);
the_controller->remote_device_sequence[this_device->rnc->remote_node_index]++; scic->remote_device_sequence[sci_dev->rnc->remote_node_index]++;
if (this_device->has_ready_substate_machine) { if (sci_dev->has_ready_substate_machine)
sci_base_state_machine_start(&this_device->ready_substate_machine); sci_base_state_machine_start(&sci_dev->ready_substate_machine);
} else { else
isci_event_remote_device_ready(the_controller, this_device); isci_remote_device_ready(idev);
}
} }
/** /**
...@@ -1923,26 +1921,22 @@ static void scic_sds_remote_device_ready_state_enter( ...@@ -1923,26 +1921,22 @@ static void scic_sds_remote_device_ready_state_enter(
* @object: This is the struct sci_base_object that is cast into a * @object: This is the struct sci_base_object that is cast into a
* struct scic_sds_remote_device. * struct scic_sds_remote_device.
* *
* This is the exit method for the SCI_BASE_REMOTE_DEVICE_STATE_READY it does * This is the exit function for the SCI_BASE_REMOTE_DEVICE_STATE_READY it does
* nothing. none * nothing. none
*/ */
static void scic_sds_remote_device_ready_state_exit( static void scic_sds_remote_device_ready_state_exit(
struct sci_base_object *object) struct sci_base_object *object)
{ {
struct scic_sds_controller *the_controller; struct scic_sds_remote_device *sci_dev =
struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)object; (struct scic_sds_remote_device *)object;
struct isci_remote_device *idev = sci_object_get_association(sci_dev);
the_controller = scic_sds_remote_device_get_controller(this_device); if (sci_dev->has_ready_substate_machine)
sci_base_state_machine_stop(&sci_dev->ready_substate_machine);
if (this_device->has_ready_substate_machine) { else
sci_base_state_machine_stop(&this_device->ready_substate_machine); isci_remote_device_not_ready(
} else { idev,
isci_event_remote_device_not_ready( SCIC_REMOTE_DEVICE_NOT_READY_STOP_REQUESTED);
the_controller,
this_device,
SCIC_REMOTE_DEVICE_NOT_READY_STOP_REQUESTED
);
}
} }
/** /**
......
...@@ -2077,30 +2077,24 @@ static void scic_sds_request_started_state_exit( ...@@ -2077,30 +2077,24 @@ static void scic_sds_request_started_state_exit(
static void scic_sds_request_completed_state_enter( static void scic_sds_request_completed_state_enter(
struct sci_base_object *object) struct sci_base_object *object)
{ {
struct scic_sds_request *this_request = (struct scic_sds_request *)object; struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
struct scic_sds_controller *scic =
scic_sds_request_get_controller(sci_req);
struct isci_host *ihost = sci_object_get_association(scic);
struct isci_request *ireq = sci_object_get_association(sci_req);
SET_STATE_HANDLER(
this_request, SET_STATE_HANDLER(sci_req,
scic_sds_request_state_handler_table, scic_sds_request_state_handler_table,
SCI_BASE_REQUEST_STATE_COMPLETED SCI_BASE_REQUEST_STATE_COMPLETED);
);
/* Tell the SCI_USER that the IO request is complete */ /* Tell the SCI_USER that the IO request is complete */
if (this_request->is_task_management_request == false) { if (sci_req->is_task_management_request == false)
isci_event_io_request_complete( isci_request_io_request_complete(ihost,
scic_sds_request_get_controller(this_request), ireq,
scic_sds_request_get_device(this_request), sci_req->sci_status);
this_request, else
this_request->sci_status isci_task_request_complete(ihost, ireq, sci_req->sci_status);
);
} else {
isci_event_task_request_complete(
scic_sds_request_get_controller(this_request),
scic_sds_request_get_device(this_request),
this_request,
this_request->sci_status
);
}
} }
/** /**
......
...@@ -250,22 +250,23 @@ const struct scic_sds_remote_device_state_handler scic_sds_smp_remote_device_rea ...@@ -250,22 +250,23 @@ const struct scic_sds_remote_device_state_handler scic_sds_smp_remote_device_rea
* struct scic_sds_remote_device. * struct scic_sds_remote_device.
* *
* This is the SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_IDLE enter method. * This is the SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_IDLE enter method.
* This method sets the ready cmd substate handlers and reports the device as * This function sets the ready cmd substate handlers and reports the device as
* ready. none * ready. none
*/ */
static void scic_sds_smp_remote_device_ready_idle_substate_enter( static inline void scic_sds_smp_remote_device_ready_idle_substate_enter(
struct sci_base_object *object) struct sci_base_object *object)
{ {
struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)object; struct scic_sds_remote_device *sci_dev =
(struct scic_sds_remote_device *)object;
struct isci_remote_device *idev = sci_object_get_association(sci_dev);
SET_STATE_HANDLER( SET_STATE_HANDLER(
this_device, sci_dev,
scic_sds_smp_remote_device_ready_substate_handler_table, scic_sds_smp_remote_device_ready_substate_handler_table,
SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_IDLE SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_IDLE);
);
isci_event_remote_device_ready( isci_remote_device_ready(idev);
scic_sds_remote_device_get_controller(this_device), this_device);
} }
/** /**
...@@ -274,27 +275,26 @@ static void scic_sds_smp_remote_device_ready_idle_substate_enter( ...@@ -274,27 +275,26 @@ static void scic_sds_smp_remote_device_ready_idle_substate_enter(
* struct scic_sds_remote_device. * struct scic_sds_remote_device.
* *
* This is the SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_CMD enter method. This * This is the SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_CMD enter method. This
* method sets the remote device objects ready cmd substate handlers, and * function sets the remote device objects ready cmd substate handlers, and
* notify core user that the device is not ready. none * notify core user that the device is not ready. none
*/ */
static void scic_sds_smp_remote_device_ready_cmd_substate_enter( static void scic_sds_smp_remote_device_ready_cmd_substate_enter(
struct sci_base_object *object) struct sci_base_object *object)
{ {
struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)object; struct scic_sds_remote_device *sci_dev =
(struct scic_sds_remote_device *)object;
struct isci_remote_device *idev = sci_object_get_association(sci_dev);
BUG_ON(this_device->working_request == NULL); BUG_ON(sci_dev->working_request == NULL);
SET_STATE_HANDLER( SET_STATE_HANDLER(
this_device, sci_dev,
scic_sds_smp_remote_device_ready_substate_handler_table, scic_sds_smp_remote_device_ready_substate_handler_table,
SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_CMD SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_CMD);
);
isci_event_remote_device_not_ready( isci_remote_device_not_ready(
scic_sds_remote_device_get_controller(this_device), idev,
this_device, SCIC_REMOTE_DEVICE_NOT_READY_SMP_REQUEST_STARTED);
SCIC_REMOTE_DEVICE_NOT_READY_SMP_REQUEST_STARTED
);
} }
/** /**
......
...@@ -677,23 +677,22 @@ const struct scic_sds_remote_device_state_handler scic_sds_stp_remote_device_rea ...@@ -677,23 +677,22 @@ const struct scic_sds_remote_device_state_handler scic_sds_stp_remote_device_rea
* * STP REMOTE DEVICE READY SUBSTATE PRIVATE METHODS * * STP REMOTE DEVICE READY SUBSTATE PRIVATE METHODS
* ***************************************************************************** */ * ***************************************************************************** */
static void scic_sds_stp_remote_device_ready_idle_substate_resume_complete_handler( static inline void
scic_sds_stp_remote_device_ready_idle_substate_resume_complete_handler(
void *user_cookie) void *user_cookie)
{ {
struct scic_sds_remote_device *this_device; struct scic_sds_remote_device *sci_dev =
(struct scic_sds_remote_device *)user_cookie;
this_device = (struct scic_sds_remote_device *)user_cookie; struct isci_remote_device *idev = sci_object_get_association(sci_dev);
/* /*
* For NCQ operation we do not issue a * For NCQ operation we do not issue a
* scic_cb_remote_device_not_ready(). As a result, avoid sending * scic_cb_remote_device_not_ready(). As a result, avoid sending
* the ready notification. */ * the ready notification.
if (this_device->ready_substate_machine.previous_state_id */
!= SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ) { if (sci_dev->ready_substate_machine.previous_state_id !=
isci_event_remote_device_ready( SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ)
scic_sds_remote_device_get_controller(this_device), this_device isci_remote_device_ready(idev);
);
}
} }
/* /*
...@@ -749,26 +748,23 @@ static void scic_sds_stp_remote_device_ready_idle_substate_enter( ...@@ -749,26 +748,23 @@ static void scic_sds_stp_remote_device_ready_idle_substate_enter(
* struct scic_sds_remote_device object. * struct scic_sds_remote_device object.
* *
*/ */
static void scic_sds_stp_remote_device_ready_cmd_substate_enter( static inline void scic_sds_stp_remote_device_ready_cmd_substate_enter(
struct sci_base_object *device) struct sci_base_object *device)
{ {
struct scic_sds_remote_device *this_device; struct scic_sds_remote_device *sci_dev =
(struct scic_sds_remote_device *)device;
struct isci_remote_device *idev = sci_object_get_association(sci_dev);
this_device = (struct scic_sds_remote_device *)device; BUG_ON(sci_dev->working_request == NULL);
BUG_ON(this_device->working_request == NULL);
SET_STATE_HANDLER( SET_STATE_HANDLER(
this_device, sci_dev,
scic_sds_stp_remote_device_ready_substate_handler_table, scic_sds_stp_remote_device_ready_substate_handler_table,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_CMD SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_CMD);
);
isci_event_remote_device_not_ready( isci_remote_device_not_ready(
scic_sds_remote_device_get_controller(this_device), idev,
this_device, SCIC_REMOTE_DEVICE_NOT_READY_SATA_REQUEST_STARTED);
SCIC_REMOTE_DEVICE_NOT_READY_SATA_REQUEST_STARTED
);
} }
/* /*
...@@ -807,27 +803,21 @@ static void scic_sds_stp_remote_device_ready_ncq_substate_enter( ...@@ -807,27 +803,21 @@ static void scic_sds_stp_remote_device_ready_ncq_substate_enter(
* struct scic_sds_remote_device object. * struct scic_sds_remote_device object.
* *
*/ */
static void scic_sds_stp_remote_device_ready_ncq_error_substate_enter( static inline void scic_sds_stp_remote_device_ready_ncq_error_substate_enter(
struct sci_base_object *device) struct sci_base_object *device)
{ {
struct scic_sds_remote_device *this_device; struct scic_sds_remote_device *sci_dev =
(struct scic_sds_remote_device *)device;
this_device = (struct scic_sds_remote_device *)device; struct isci_remote_device *idev = sci_object_get_association(sci_dev);
SET_STATE_HANDLER( SET_STATE_HANDLER(
this_device, sci_dev,
scic_sds_stp_remote_device_ready_substate_handler_table, scic_sds_stp_remote_device_ready_substate_handler_table,
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ_ERROR SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ_ERROR);
);
if (this_device->not_ready_reason == if (sci_dev->not_ready_reason ==
SCIC_REMOTE_DEVICE_NOT_READY_SATA_SDB_ERROR_FIS_RECEIVED) { SCIC_REMOTE_DEVICE_NOT_READY_SATA_SDB_ERROR_FIS_RECEIVED)
isci_event_remote_device_not_ready( isci_remote_device_not_ready(idev, sci_dev->not_ready_reason);
scic_sds_remote_device_get_controller(this_device),
this_device,
this_device->not_ready_reason
);
}
} }
/* /*
......
此差异已折叠。
/*
* This file is provided under a dual BSD/GPLv2 license. When using or
* redistributing this file, you may do so under either license.
*
* GPL LICENSE SUMMARY
*
* Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
* The full GNU General Public License is included in this distribution
* in the file called LICENSE.GPL.
*
* BSD LICENSE
*
* Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _ISCI_EVENT_H_
#define _ISCI_EVENT_H_
/**
* isci_event_timer_create() - This callback method asks the user to create a
* timer and provide a handle for this timer for use in further timer
* interactions.
* @controller: This parameter specifies the controller with which this timer
* is to be associated.
* @timer_callback: This parameter specifies the callback method to be invoked
* whenever the timer expires.
* @cookie: This parameter specifies a piece of information that the user must
* retain. This cookie is to be supplied by the user anytime a timeout
* occurs for the created timer.
*
* The "timer_callback" method should be executed in a mutually exlusive manner
* from the controller completion handler handler. This method returns a handle
* to a timer object created by the user. The handle will be utilized for all
* further interactions relating to this timer.
*/
void *isci_event_timer_create(
struct scic_sds_controller *controller,
void (*timer_callback)(void *),
void *cookie);
/**
* isci_event_timer_start() - This callback method asks the user to start the
* supplied timer.
* @controller: This parameter specifies the controller with which this timer
* is to associated.
* @timer: This parameter specifies the timer to be started.
* @milliseconds: This parameter specifies the number of milliseconds for which
* to stall. The operating system driver is allowed to round this value up
* where necessary.
*
* All timers in the system started by the SCI Core are one shot timers.
* Therefore, the SCI user should make sure that it removes the timer from it's
* list when a timer actually fires. Additionally, SCI Core user's should be
* able to handle calls from the SCI Core to stop a timer that may already be
* stopped. none
*/
void isci_event_timer_start(
struct scic_sds_controller *controller,
void *timer,
u32 milliseconds);
/**
* isci_event_timer_stop() - This callback method asks the user to stop the
* supplied timer.
* @controller: This parameter specifies the controller with which this timer
* is to associated.
* @timer: This parameter specifies the timer to be stopped.
*
*/
void isci_event_timer_stop(
struct scic_sds_controller *controller,
void *timer);
void isci_event_timer_destroy(struct scic_sds_controller *scic, void *timer);
/**
* isci_event_controller_start_complete() - This user callback will inform the
* user that the controller has finished the start process.
* @controller: This parameter specifies the controller that was started.
* @completion_status: This parameter specifies the results of the start
* operation. SCI_SUCCESS indicates successful completion.
*
*/
void isci_event_controller_start_complete(
struct scic_sds_controller *controller,
enum sci_status completion_status);
/**
* isci_event_controller_stop_complete() - This user callback will inform the
* user that the controller has finished the stop process.
* @controller: This parameter specifies the controller that was stopped.
* @completion_status: This parameter specifies the results of the stop
* operation. SCI_SUCCESS indicates successful completion.
*
*/
void isci_event_controller_stop_complete(
struct scic_sds_controller *controller,
enum sci_status completion_status);
/**
* isci_event_io_request_complete() - This user callback will inform the user
* that an IO request has completed.
* @controller: This parameter specifies the controller on which the IO is
* completing.
* @remote_device: This parameter specifies the remote device on which this IO
* request is completing.
* @io_request: This parameter specifies the IO request that has completed.
* @completion_status: This parameter specifies the results of the IO request
* operation. SCI_SUCCESS indicates successful completion.
*
*/
void isci_event_io_request_complete(
struct scic_sds_controller *controller,
struct scic_sds_remote_device *remote_device,
struct scic_sds_request *scic_io_request,
enum sci_io_status completion_status);
/**
* isci_event_task_request_complete() - This user callback will inform the user
* that a task management request completed.
* @controller: This parameter specifies the controller on which the task
* management request is completing.
* @remote_device: This parameter specifies the remote device on which this
* task management request is completing.
* @task_request: This parameter specifies the task management request that has
* completed.
* @completion_status: This parameter specifies the results of the IO request
* operation. SCI_SUCCESS indicates successful completion.
*
*/
void isci_event_task_request_complete(
struct scic_sds_controller *controller,
struct scic_sds_remote_device *remote_device,
struct scic_sds_request *scic_task_request,
enum sci_task_status completion_status);
/**
* isci_event_port_stop_complete() - This method informs the user when a stop
* operation on the port has completed.
* @controller: This parameter represents the controller which contains the
* port.
* @port: This parameter specifies the SCI port object for which the callback
* is being invoked.
* @completion_status: This parameter specifies the status for the operation
* being completed.
*
*/
void isci_event_port_stop_complete(
struct scic_sds_controller *controller,
struct scic_sds_port *port,
enum sci_status completion_status);
/**
* isci_event_port_hard_reset_complete() - This method informs the user when a
* hard reset on the port has completed. This hard reset could have been
* initiated by the user or by the remote port.
* @controller: This parameter represents the controller which contains the
* port.
* @port: This parameter specifies the SCI port object for which the callback
* is being invoked.
* @completion_status: This parameter specifies the status for the operation
* being completed.
*
*/
void isci_event_port_hard_reset_complete(
struct scic_sds_controller *controller,
struct scic_sds_port *port,
enum sci_status completion_status);
/**
* isci_event_port_ready() - This method informs the user that the port is now
* in a ready state and can be utilized to issue IOs.
* @controller: This parameter represents the controller which contains the
* port.
* @port: This parameter specifies the SCI port object for which the callback
* is being invoked.
*
*/
void isci_event_port_ready(
struct scic_sds_controller *controller,
struct scic_sds_port *port);
/**
* isci_event_port_not_ready() - This method informs the user that the port is
* now not in a ready (i.e. busy) state and can't be utilized to issue IOs.
* @controller: This parameter represents the controller which contains the
* port.
* @port: This parameter specifies the SCI port object for which the callback
* is being invoked.
* @reason_code: This parameter specifies the reason for the port not ready
* callback.
*
*/
void isci_event_port_not_ready(
struct scic_sds_controller *controller,
struct scic_sds_port *port,
u32 reason_code);
/**
* isci_event_port_invalid_link_up() - This method informs the SCI Core user
* that a phy/link became ready, but the phy is not allowed in the port. In
* some situations the underlying hardware only allows for certain phy to port
* mappings. If these mappings are violated, then this API is invoked.
* @controller: This parameter represents the controller which contains the
* port.
* @port: This parameter specifies the SCI port object for which the callback
* is being invoked.
* @phy: This parameter specifies the phy that came ready, but the phy can't be
* a valid member of the port.
*
*/
void isci_event_port_invalid_link_up(
struct scic_sds_controller *controller,
struct scic_sds_port *port,
struct scic_sds_phy *phy);
/**
* isci_event_port_bc_change_primitive_received() - This callback method informs
* the user that a broadcast change primitive was received.
* @controller: This parameter represents the controller which contains the
* port.
* @port: This parameter specifies the SCI port object for which the callback
* is being invoked. For instances where the phy on which the primitive was
* received is not part of a port, this parameter will be
* NULL.
* @phy: This parameter specifies the phy on which the primitive was received.
*
*/
void isci_event_port_bc_change_primitive_received(
struct scic_sds_controller *controller,
struct scic_sds_port *port,
struct scic_sds_phy *phy);
/**
* isci_event_port_link_up() - This callback method informs the user that a phy
* has become operational and is capable of communicating with the remote
* end point.
* @controller: This parameter represents the controller associated with the
* phy.
* @port: This parameter specifies the port object for which the user callback
* is being invoked. There may be conditions where this parameter can be
* NULL
* @phy: This parameter specifies the phy object for which the user callback is
* being invoked.
*
*/
void isci_event_port_link_up(
struct scic_sds_controller *controller,
struct scic_sds_port *port,
struct scic_sds_phy *phy);
/**
* isci_event_port_link_down() - This callback method informs the user that a
* phy is no longer operational and is not capable of communicating with the
* remote end point.
* @controller: This parameter represents the controller associated with the
* phy.
* @port: This parameter specifies the port object for which the user callback
* is being invoked. There may be conditions where this parameter can be
* NULL
* @phy: This parameter specifies the phy object for which the user callback is
* being invoked.
*
*/
void isci_event_port_link_down(
struct scic_sds_controller *controller,
struct scic_sds_port *port,
struct scic_sds_phy *phy);
/**
* isci_event_remote_device_start_complete() - This user callback method will
* inform the user that a start operation has completed.
* @controller: This parameter specifies the core controller associated with
* the completion callback.
* @remote_device: This parameter specifies the remote device associated with
* the completion callback.
* @completion_status: This parameter specifies the completion status for the
* operation.
*
*/
void isci_event_remote_device_start_complete(
struct scic_sds_controller *controller,
struct scic_sds_remote_device *remote_device,
enum sci_status completion_status);
/**
* isci_event_remote_device_stop_complete() - This user callback method will
* inform the user that a stop operation has completed.
* @controller: This parameter specifies the core controller associated with
* the completion callback.
* @remote_device: This parameter specifies the remote device associated with
* the completion callback.
* @completion_status: This parameter specifies the completion status for the
* operation.
*
*/
void isci_event_remote_device_stop_complete(
struct scic_sds_controller *controller,
struct scic_sds_remote_device *remote_device,
enum sci_status completion_status);
/**
* isci_event_remote_device_ready() - This user callback method will inform the
* user that a remote device is now capable of handling IO requests.
* @controller: This parameter specifies the core controller associated with
* the completion callback.
* @remote_device: This parameter specifies the remote device associated with
* the callback.
*
*/
void isci_event_remote_device_ready(
struct scic_sds_controller *controller,
struct scic_sds_remote_device *remote_device);
/**
* isci_event_remote_device_not_ready() - This user callback method will inform
* the user that a remote device is no longer capable of handling IO
* requests (until a ready callback is invoked).
* @controller: This parameter specifies the core controller associated with
* the completion callback.
* @remote_device: This parameter specifies the remote device associated with
* the callback.
* @reason_code: This paramete specifies the reason the remote device is not
* ready.
*
*/
void isci_event_remote_device_not_ready(
struct scic_sds_controller *controller,
struct scic_sds_remote_device *remote_device,
u32 reason_code);
#endif
...@@ -71,7 +71,6 @@ ...@@ -71,7 +71,6 @@
#include "timers.h" #include "timers.h"
#include "sci_status.h" #include "sci_status.h"
#include "request.h" #include "request.h"
#include "events.h"
#include "task.h" #include "task.h"
#include "sata.h" #include "sata.h"
......
...@@ -279,9 +279,7 @@ void isci_port_link_up( ...@@ -279,9 +279,7 @@ void isci_port_link_up(
* @port: This parameter specifies the isci port with the active link. * @port: This parameter specifies the isci port with the active link.
* *
*/ */
void isci_port_link_down( void isci_port_link_down(struct isci_host *isci_host, struct isci_phy *isci_phy,
struct isci_host *isci_host,
struct isci_phy *isci_phy,
struct isci_port *isci_port) struct isci_port *isci_port)
{ {
struct isci_remote_device *isci_device; struct isci_remote_device *isci_device;
...@@ -358,9 +356,7 @@ void isci_port_formed( ...@@ -358,9 +356,7 @@ void isci_port_formed(
* @port: This parameter specifies the sci port with the active link. * @port: This parameter specifies the sci port with the active link.
* *
*/ */
void isci_port_ready( void isci_port_ready(struct isci_host *isci_host, struct isci_port *isci_port)
struct isci_host *isci_host,
struct isci_port *isci_port)
{ {
dev_dbg(&isci_host->pdev->dev, dev_dbg(&isci_host->pdev->dev,
"%s: isci_port = %p\n", __func__, isci_port); "%s: isci_port = %p\n", __func__, isci_port);
...@@ -378,9 +374,7 @@ void isci_port_ready( ...@@ -378,9 +374,7 @@ void isci_port_ready(
* @port: This parameter specifies the sci port with the active link. * @port: This parameter specifies the sci port with the active link.
* *
*/ */
void isci_port_not_ready( void isci_port_not_ready(struct isci_host *isci_host, struct isci_port *isci_port)
struct isci_host *isci_host,
struct isci_port *isci_port)
{ {
dev_dbg(&isci_host->pdev->dev, dev_dbg(&isci_host->pdev->dev,
"%s: isci_port = %p\n", __func__, isci_port); "%s: isci_port = %p\n", __func__, isci_port);
...@@ -394,8 +388,7 @@ void isci_port_not_ready( ...@@ -394,8 +388,7 @@ void isci_port_not_ready(
* process. * process.
* *
*/ */
void isci_port_hard_reset_complete( void isci_port_hard_reset_complete(struct isci_port *isci_port,
struct isci_port *isci_port,
enum sci_status completion_status) enum sci_status completion_status)
{ {
dev_dbg(&isci_port->isci_host->pdev->dev, dev_dbg(&isci_port->isci_host->pdev->dev,
...@@ -480,3 +473,35 @@ int isci_port_perform_hard_reset( ...@@ -480,3 +473,35 @@ int isci_port_perform_hard_reset(
return ret; return ret;
} }
/**
* isci_port_invalid_link_up() - This function informs the SCI Core user that
* a phy/link became ready, but the phy is not allowed in the port. In some
* situations the underlying hardware only allows for certain phy to port
* mappings. If these mappings are violated, then this API is invoked.
* @controller: This parameter represents the controller which contains the
* port.
* @port: This parameter specifies the SCI port object for which the callback
* is being invoked.
* @phy: This parameter specifies the phy that came ready, but the phy can't be
* a valid member of the port.
*
*/
void isci_port_invalid_link_up(struct scic_sds_controller *scic,
struct scic_sds_port *sci_port,
struct scic_sds_phy *phy)
{
struct isci_host *ihost =
(struct isci_host *)sci_object_get_association(scic);
dev_warn(&ihost->pdev->dev, "Invalid link up!\n");
}
void isci_port_stop_complete(struct scic_sds_controller *scic,
struct scic_sds_port *sci_port,
enum sci_status completion_status)
{
struct isci_host *ihost = sci_object_get_association(scic);
dev_dbg(&ihost->pdev->dev, "Port stop complete\n");
}
...@@ -147,5 +147,15 @@ int isci_port_perform_hard_reset( ...@@ -147,5 +147,15 @@ int isci_port_perform_hard_reset(
struct isci_port *isci_port_ptr, struct isci_port *isci_port_ptr,
struct isci_phy *isci_phy_ptr); struct isci_phy *isci_phy_ptr);
void isci_port_invalid_link_up(
struct scic_sds_controller *scic,
struct scic_sds_port *sci_port,
struct scic_sds_phy *phy);
void isci_port_stop_complete(
struct scic_sds_controller *scic,
struct scic_sds_port *sci_port,
enum sci_status completion_status);
#endif /* !defined(_ISCI_PORT_H_) */ #endif /* !defined(_ISCI_PORT_H_) */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册