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 complete a task request.
 *
 * @param[in]  controller This parameter specifies the controller object
 *             on which the user is attempting to perform a complete task
 *             operation.
 * @param[in]  remote_device This parameter specifies the remote deivce
 *             object on which the user is attempting to perform a start
 *             task operation.
 * @param[in]  task_request This parameter specifies the task management
 *             request to be started.
 *
 * @return This method returns an indication of whether the complete task
 *         operation succeeded.
 * @retval SCI_SUCCESS This value is returned when the complete task operation
 *         begins successfully.
 */
@brief This method provides READY state specific handling for
when a user attempts to complete a task request.

@param[in]  controller This parameter specifies the controller object
on which the user is attempting to perform a complete task
operation.
@param[in]  remote_device This parameter specifies the remote deivce
object on which the user is attempting to perform a start
task operation.
@param[in]  task_request This parameter specifies the task management
request to be started.

@return This method returns an indication of whether the complete task
operation succeeded.
@retval SCI_SUCCESS This value is returned when the complete task operation
begins successfully.
@brief This method provides READY state specific handling for when a user attempts to complete a task request . @param [ in ] controller This parameter specifies the controller object on which the user is attempting to perform a complete task operation . @param [ in ] remote_device This parameter specifies the remote deivce object on which the user is attempting to perform a start task operation . @param [ in ] task_request This parameter specifies the task management request to be started . @return This method returns an indication of whether the complete task operation succeeded . @retval SCI_SUCCESS This value is returned when the complete task operation begins successfully .
static
SCI_STATUS scif_sas_controller_ready_complete_task_handler(
   SCI_BASE_CONTROLLER_T    * controller,
   SCI_BASE_REMOTE_DEVICE_T * remote_device,
   SCI_BASE_REQUEST_T       * task_request
)
{
   SCIF_SAS_CONTROLLER_T    *fw_controller = (SCIF_SAS_CONTROLLER_T*)controller;
   SCIF_SAS_REMOTE_DEVICE_T *fw_device = (SCIF_SAS_REMOTE_DEVICE_T*)remote_device;
   SCIF_SAS_TASK_REQUEST_T  *fw_task = (SCIF_SAS_TASK_REQUEST_T*)task_request;
   SCI_STATUS                status;
   SCI_STATUS                core_status;
   SCIF_LOG_TRACE((
      sci_base_object_get_logger(fw_controller),
      SCIF_LOG_OBJECT_CONTROLLER | SCIF_LOG_OBJECT_TASK_MANAGEMENT,
      "scif_sas_controller_ready_complete_task_handler(0x%x, 0x%x, 0x%x) enter\n",
      controller, remote_device, task_request
   ));
   status = fw_device->domain->state_handlers->complete_task_handler(
               &fw_device->domain->parent, remote_device, task_request
            );
   if (scif_sas_task_request_get_function(fw_task)
          == SCI_SAS_HARD_RESET)
   {
      return status;
   }
   fw_task->parent.state_handlers->destruct_handler(&fw_task->parent.parent);
   core_status = scic_controller_complete_task(
                    fw_controller->core_object,
                    fw_device->core_object,
                    fw_task->parent.core_object
                 );
   if (status == SCI_SUCCESS)
      status = core_status;
   if (status != SCI_SUCCESS)
   {
      SCIF_LOG_WARNING((
         sci_base_object_get_logger(fw_controller),
         SCIF_LOG_OBJECT_CONTROLLER,
         "Controller:0x%x TaskRequest:0x%x Status:0x%x CoreStatus:0x%x "
         "failed to complete\n",
         fw_controller, fw_task, status, core_status
      ));
   }
   return status;
}
static SCI_STATUS scif_sas_controller_ready_complete_task_handler ( SCI_BASE_CONTROLLER_T * controller , SCI_BASE_REMOTE_DEVICE_T * remote_device , SCI_BASE_REQUEST_T * task_request ) { SCIF_SAS_CONTROLLER_T * fw_controller = ( SCIF_SAS_CONTROLLER_T * ) controller ; SCIF_SAS_REMOTE_DEVICE_T * fw_device = ( SCIF_SAS_REMOTE_DEVICE_T * ) remote_device ; SCIF_SAS_TASK_REQUEST_T * fw_task = ( SCIF_SAS_TASK_REQUEST_T * ) task_request ; SCI_STATUS status ; SCI_STATUS core_status ; SCIF_LOG_TRACE ( ( sci_base_object_get_logger ( fw_controller ) , SCIF_LOG_OBJECT_CONTROLLER | SCIF_LOG_OBJECT_TASK_MANAGEMENT , " \n " , controller , remote_device , task_request ) ) ; status = fw_device -> domain -> state_handlers -> complete_task_handler ( & fw_device -> domain -> parent , remote_device , task_request ) ; if ( scif_sas_task_request_get_function ( fw_task ) == SCI_SAS_HARD_RESET ) { return status ; } fw_task -> parent . state_handlers -> destruct_handler ( & fw_task -> parent . parent ) ; core_status = scic_controller_complete_task ( fw_controller -> core_object , fw_device -> core_object , fw_task -> parent . core_object ) ; if ( status == SCI_SUCCESS ) status = core_status ; if ( status != SCI_SUCCESS ) { SCIF_LOG_WARNING ( ( sci_base_object_get_logger ( fw_controller ) , SCIF_LOG_OBJECT_CONTROLLER , " " " \n " , fw_controller , fw_task , status , core_status ) ) ; } return status ; }
@brief This method provides READY state specific handling for
        when a user attempts to complete a task request.
@brief This method provides READY state specific handling for when a user attempts to complete a task request .
//No more things to do in the core, since this task is for Target Reset. // Ask the core to finish processing for this task request.