FreeBSD/sys/dev/isci/scil/scic_sds_controller.c
/**
 * This method is called when the SCIC_SDS_CONTROLLER is in the ready state
 * and the start task handler is called.
 *    - The remote device is requested to start the task request
 *    - if successful
 *       - assign the task to the io_request_table
 *       - post the request to the SCU hardware
 *
 * @param[in] controller This is SCI_BASE_CONTROLLER object which is cast
 *       into a SCIC_SDS_CONTROLLER object.
 * @param[in] remote_device This is SCI_BASE_REMOTE_DEVICE which is cast to a
 *       SCIC_SDS_REMOTE_DEVICE object.
 * @param[in] io_request This is the SCI_BASE_REQUEST which is cast to a
 *       SCIC_SDS_IO_REQUEST object.
 * @param[in] task_tag This is the task tag to be assigned to the task request
 *       or SCI_CONTROLLER_INVALID_IO_TAG.
 *
 * @return SCI_STATUS
 * @retval SCI_SUCCESS if the start io operation succeeds
 * @retval SCI_FAILURE_INSUFFICIENT_RESOURCES if the IO tag could not be
 *         allocated for the io request.
 * @retval SCI_FAILURE_INVALID_STATE if one or more objects are not in a valid
 *         state to accept io requests.
 *
 * @todo How does the io tag get assigned in this code path?
 */
This method is called when the SCIC_SDS_CONTROLLER is in the ready state
and the start task handler is called.
- The remote device is requested to start the task request
- if successful
- assign the task to the io_request_table
- post the request to the SCU hardware

@param[in] controller This is SCI_BASE_CONTROLLER object which is cast
into a SCIC_SDS_CONTROLLER object.
@param[in] remote_device This is SCI_BASE_REMOTE_DEVICE which is cast to a
SCIC_SDS_REMOTE_DEVICE object.
@param[in] io_request This is the SCI_BASE_REQUEST which is cast to a
SCIC_SDS_IO_REQUEST object.
@param[in] task_tag This is the task tag to be assigned to the task request
or SCI_CONTROLLER_INVALID_IO_TAG.

@return SCI_STATUS
@retval SCI_SUCCESS if the start io operation succeeds
@retval SCI_FAILURE_INSUFFICIENT_RESOURCES if the IO tag could not be
allocated for the io request.
@retval SCI_FAILURE_INVALID_STATE if one or more objects are not in a valid
state to accept io requests.


This method is called when the SCIC_SDS_CONTROLLER is in the ready state and the start task handler is called . - The remote device is requested to start the task request - if successful - assign the task to the io_request_table - post the request to the SCU hardware @param [ in ] controller This is SCI_BASE_CONTROLLER object which is cast into a SCIC_SDS_CONTROLLER object . @param [ in ] remote_device This is SCI_BASE_REMOTE_DEVICE which is cast to a SCIC_SDS_REMOTE_DEVICE object . @param [ in ] io_request This is the SCI_BASE_REQUEST which is cast to a SCIC_SDS_IO_REQUEST object . @param [ in ] task_tag This is the task tag to be assigned to the task request or SCI_CONTROLLER_INVALID_IO_TAG . @return SCI_STATUS @retval SCI_SUCCESS if the start io operation succeeds @retval SCI_FAILURE_INSUFFICIENT_RESOURCES if the IO tag could not be allocated for the io request . @retval SCI_FAILURE_INVALID_STATE if one or more objects are not in a valid state to accept io requests .
static
SCI_STATUS scic_sds_controller_ready_state_start_task_handler(
   SCI_BASE_CONTROLLER_T    *controller,
   SCI_BASE_REMOTE_DEVICE_T *remote_device,
   SCI_BASE_REQUEST_T       *io_request,
   U16                       task_tag
)
{
   SCIC_SDS_CONTROLLER_T    *this_controller = (SCIC_SDS_CONTROLLER_T *)
                                               controller;
   SCIC_SDS_REQUEST_T       *the_request     = (SCIC_SDS_REQUEST_T *)
                                               io_request;
   SCIC_SDS_REMOTE_DEVICE_T *the_device      = (SCIC_SDS_REMOTE_DEVICE_T *)
                                               remote_device;
   SCI_STATUS                status;
   status = scic_sds_remote_device_start_task(
               this_controller, the_device, the_request
            );
   if (status == SCI_SUCCESS)
   {
      this_controller->io_request_table[
         scic_sds_io_tag_get_index(the_request->io_tag)] = the_request;
      scic_sds_controller_post_request(
         this_controller,
         scic_sds_request_get_post_context(the_request)
      );
   }
   else if (status == SCI_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS)
   {
      this_controller->io_request_table[
         scic_sds_io_tag_get_index(the_request->io_tag)] = the_request;
      status = SCI_SUCCESS;
   }
   return status;
}
static SCI_STATUS scic_sds_controller_ready_state_start_task_handler ( SCI_BASE_CONTROLLER_T * controller , SCI_BASE_REMOTE_DEVICE_T * remote_device , SCI_BASE_REQUEST_T * io_request , U16 task_tag ) { SCIC_SDS_CONTROLLER_T * this_controller = ( SCIC_SDS_CONTROLLER_T * ) controller ; SCIC_SDS_REQUEST_T * the_request = ( SCIC_SDS_REQUEST_T * ) io_request ; SCIC_SDS_REMOTE_DEVICE_T * the_device = ( SCIC_SDS_REMOTE_DEVICE_T * ) remote_device ; SCI_STATUS status ; status = scic_sds_remote_device_start_task ( this_controller , the_device , the_request ) ; if ( status == SCI_SUCCESS ) { this_controller -> io_request_table [ scic_sds_io_tag_get_index ( the_request -> io_tag ) ] = the_request ; scic_sds_controller_post_request ( this_controller , scic_sds_request_get_post_context ( the_request ) ) ; } else if ( status == SCI_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS ) { this_controller -> io_request_table [ scic_sds_io_tag_get_index ( the_request -> io_tag ) ] = the_request ; status = SCI_SUCCESS ; } return status ; }
This method is called when the SCIC_SDS_CONTROLLER is in the ready state
 and the start task handler is called.
This method is called when the SCIC_SDS_CONTROLLER is in the ready state and the start task handler is called .
//We will let framework know this task request started successfully, //although core is still woring on starting the request (to post tc when //RNC is resumed.)