FreeBSD/sys/dev/isci/scil/scic_sds_controller.c
/**
 * @brief This method is the general timeout handler for the controller.
 *        It will take the correct timetout action based on the current
 *        controller state
 *
 * @param[in] controller This parameter indicates the controller on which
 *            a timeout occurred.
 *
 * @return none
 */
@brief This method is the general timeout handler for the controller.
It will take the correct timetout action based on the current
controller state

@param[in] controller This parameter indicates the controller on which
a timeout occurred.

@return none
@brief This method is the general timeout handler for the controller . It will take the correct timetout action based on the current controller state @param [ in ] controller This parameter indicates the controller on which a timeout occurred . @return none
void scic_sds_controller_timeout_handler(
   SCI_CONTROLLER_HANDLE_T controller
)
{
   SCI_BASE_CONTROLLER_STATES current_state;
   SCIC_SDS_CONTROLLER_T *this_controller;
   this_controller = (SCIC_SDS_CONTROLLER_T *)controller;
   current_state = sci_base_state_machine_get_state(
                      scic_sds_controller_get_base_state_machine(this_controller)
                   );
   if (current_state == SCI_BASE_CONTROLLER_STATE_STARTING)
   {
      scic_sds_controller_transition_to_ready(
         this_controller, SCI_FAILURE_TIMEOUT
      );
   }
   else if (current_state == SCI_BASE_CONTROLLER_STATE_STOPPING)
   {
      sci_base_state_machine_change_state(
         scic_sds_controller_get_base_state_machine(this_controller),
         SCI_BASE_CONTROLLER_STATE_FAILED
      );
      scic_cb_controller_stop_complete(controller, SCI_FAILURE_TIMEOUT);
   }
   else
   {
      SCIC_LOG_ERROR((
         sci_base_object_get_logger(this_controller),
         SCIC_LOG_OBJECT_CONTROLLER,
         "Controller timer fired when controller was not in a state being timed.\n"
      ));
   }
}
void scic_sds_controller_timeout_handler ( SCI_CONTROLLER_HANDLE_T controller ) { SCI_BASE_CONTROLLER_STATES current_state ; SCIC_SDS_CONTROLLER_T * this_controller ; this_controller = ( SCIC_SDS_CONTROLLER_T * ) controller ; current_state = sci_base_state_machine_get_state ( scic_sds_controller_get_base_state_machine ( this_controller ) ) ; if ( current_state == SCI_BASE_CONTROLLER_STATE_STARTING ) { scic_sds_controller_transition_to_ready ( this_controller , SCI_FAILURE_TIMEOUT ) ; } else if ( current_state == SCI_BASE_CONTROLLER_STATE_STOPPING ) { sci_base_state_machine_change_state ( scic_sds_controller_get_base_state_machine ( this_controller ) , SCI_BASE_CONTROLLER_STATE_FAILED ) ; scic_cb_controller_stop_complete ( controller , SCI_FAILURE_TIMEOUT ) ; } else { SCIC_LOG_ERROR ( ( sci_base_object_get_logger ( this_controller ) , SCIC_LOG_OBJECT_CONTROLLER , " \n " ) ) ; } }
@brief This method is the general timeout handler for the controller.
@brief This method is the general timeout handler for the controller .
/// @todo Now what do we want to do in this case?