FreeBSD/sys/dev/isci/scil/scif_sas_controller_state_handlers.c
/**
 * @brief This method provides READY state specific handling for
 *        when a user attempts to start an internal request. If the high
 *        priority IO is also internal, this method will schedule its timer.
 *
 * @param[in]  controller This parameter specifies the controller object
 *             on which the user is attempting to perform a start IO
 *             operation.
 * @param[in]  remote_device This parameter specifies the remote deivce
 *             object on which the user is attempting to perform a start IO
 *             operation.
 * @param[in]  io_request This parameter specifies the IO request to be
 *             started.
 * @param[in]  io_tag This parameter specifies the optional allocated
 *             IO tag.  Please reference scif_controller_start_io() for
 *             more information.
 *
 * @return This method returns an indication of whether the start IO
 *         operation succeeded.
 * @retval SCI_SUCCESS This value is returned when the start IO operation
 *         begins successfully.
 */
@brief This method provides READY state specific handling for
when a user attempts to start an internal request. If the high
priority IO is also internal, this method will schedule its timer.

@param[in]  controller This parameter specifies the controller object
on which the user is attempting to perform a start IO
operation.
@param[in]  remote_device This parameter specifies the remote deivce
object on which the user is attempting to perform a start IO
operation.
@param[in]  io_request This parameter specifies the IO request to be
started.
@param[in]  io_tag This parameter specifies the optional allocated
IO tag.  Please reference scif_controller_start_io() for
more information.

@return This method returns an indication of whether the start IO
operation succeeded.
@retval SCI_SUCCESS This value is returned when the start IO operation
begins successfully.
@brief This method provides READY state specific handling for when a user attempts to start an internal request . If the high priority IO is also internal this method will schedule its timer . @param [ in ] controller This parameter specifies the controller object on which the user is attempting to perform a start IO operation . @param [ in ] remote_device This parameter specifies the remote deivce object on which the user is attempting to perform a start IO operation . @param [ in ] io_request This parameter specifies the IO request to be started . @param [ in ] io_tag This parameter specifies the optional allocated IO tag . Please reference scif_controller_start_io () for more information . @return This method returns an indication of whether the start IO operation succeeded . @retval SCI_SUCCESS This value is returned when the start IO operation begins successfully .
static
SCI_STATUS scif_sas_controller_ready_start_high_priority_io_handler(
   SCI_BASE_CONTROLLER_T    * controller,
   SCI_BASE_REMOTE_DEVICE_T * remote_device,
   SCI_BASE_REQUEST_T       * io_request,
   U16                        io_tag
)
{
   SCI_STATUS status;
   SCIF_SAS_IO_REQUEST_T * fw_io = (SCIF_SAS_IO_REQUEST_T *)io_request;
   SCIF_LOG_TRACE((
      sci_base_object_get_logger(controller),
      SCIF_LOG_OBJECT_CONTROLLER | SCIF_LOG_OBJECT_IO_REQUEST,
      "scif_sas_controller_ready_start_high_priority_io_handler(0x%x, 0x%x, 0x%x, 0x%x) enter\n",
      controller, remote_device, io_request, io_tag
   ));
   status = scif_sas_controller_common_start_high_priority_io_handler(
               controller, remote_device, io_request, io_tag);
   if (status == SCI_SUCCESS)
   {
      if (fw_io->parent.is_internal)
      {
         SCIF_SAS_INTERNAL_IO_REQUEST_T * fw_internal_io =
            (SCIF_SAS_INTERNAL_IO_REQUEST_T *)fw_io;
         scif_cb_timer_start(
            (SCI_CONTROLLER_HANDLE_T)controller,
             fw_internal_io->internal_io_timer,
             SCIF_SAS_INTERNAL_REQUEST_TIMEOUT
         );
      }
   }
   else
   {
      SCIF_LOG_TRACE((
         sci_base_object_get_logger(controller),
         SCIF_LOG_OBJECT_CONTROLLER | SCIF_LOG_OBJECT_IO_REQUEST,
         "scif_controller_start_high_priority_io(0x%x, 0x%x), starting io failed\n",
         controller, fw_io
      ));
   }
   return status;
}
static SCI_STATUS scif_sas_controller_ready_start_high_priority_io_handler ( SCI_BASE_CONTROLLER_T * controller , SCI_BASE_REMOTE_DEVICE_T * remote_device , SCI_BASE_REQUEST_T * io_request , U16 io_tag ) { SCI_STATUS status ; SCIF_SAS_IO_REQUEST_T * fw_io = ( SCIF_SAS_IO_REQUEST_T * ) io_request ; SCIF_LOG_TRACE ( ( sci_base_object_get_logger ( controller ) , SCIF_LOG_OBJECT_CONTROLLER | SCIF_LOG_OBJECT_IO_REQUEST , " \n " , controller , remote_device , io_request , io_tag ) ) ; status = scif_sas_controller_common_start_high_priority_io_handler ( controller , remote_device , io_request , io_tag ) ; if ( status == SCI_SUCCESS ) { if ( fw_io -> parent . is_internal ) { SCIF_SAS_INTERNAL_IO_REQUEST_T * fw_internal_io = ( SCIF_SAS_INTERNAL_IO_REQUEST_T * ) fw_io ; scif_cb_timer_start ( ( SCI_CONTROLLER_HANDLE_T ) controller , fw_internal_io -> internal_io_timer , SCIF_SAS_INTERNAL_REQUEST_TIMEOUT ) ; } } else { SCIF_LOG_TRACE ( ( sci_base_object_get_logger ( controller ) , SCIF_LOG_OBJECT_CONTROLLER | SCIF_LOG_OBJECT_IO_REQUEST , " \n " , controller , fw_io ) ) ; } return status ; }
@brief This method provides READY state specific handling for
        when a user attempts to start an internal request.
@brief This method provides READY state specific handling for when a user attempts to start an internal request .
//External io could also be put in high priority queue. i.e. the //smp request for EA Target Reset. //start the timer for internal io //If failed to start, most likely the device or domain is not in //correct state, and the IO has been cleaned up in controller's start //high priority IO handler. We should just continue to start the next //IO in the HP queue.