FreeBSD/sys/dev/isci/scil/scic_sds_stp_remote_device.c
/**
 * This method will handle the start io operation for a sata device that is in
 * the command idle state.
 *    - Evalute the type of IO request to be started
 *    - If its an NCQ request change to NCQ substate
 *    - If its any other command change to the CMD substate
 *
 * @note If this is a softreset we may want to have a different substate.
 *
 * @param [in] device
 * @param [in] request
 *
 * @return SCI_STATUS
 */
This method will handle the start io operation for a sata device that is in
the command idle state.
- Evalute the type of IO request to be started
- If its an NCQ request change to NCQ substate
- If its any other command change to the CMD substate

@note If this is a softreset we may want to have a different substate.

@param [in] device
@param [in] request


This method will handle the start io operation for a sata device that is in the command idle state . - Evalute the type of IO request to be started - If its an NCQ request change to NCQ substate - If its any other command change to the CMD substate @note If this is a softreset we may want to have a different substate . @param [ in ] device @param [ in ] request
static
SCI_STATUS scic_sds_stp_remote_device_ready_idle_substate_start_io_handler(
   SCI_BASE_REMOTE_DEVICE_T * device,
   SCI_BASE_REQUEST_T       * request
)
{
   SCI_STATUS status;
   SCIC_SDS_REMOTE_DEVICE_T * this_device = (SCIC_SDS_REMOTE_DEVICE_T *)device;
   SCIC_SDS_REQUEST_T       * io_request  = (SCIC_SDS_REQUEST_T       *)request;
   status = this_device->owning_port->state_handlers->start_io_handler(
      this_device->owning_port,
      this_device,
      io_request
   );
   if (status == SCI_SUCCESS)
   {
      status =
         scic_sds_remote_node_context_start_io(this_device->rnc, io_request);
      if (status == SCI_SUCCESS)
      {
         status = io_request->state_handlers->parent.start_handler(request);
      }
      if (status == SCI_SUCCESS)
      {
         if (io_request->sat_protocol == SAT_PROTOCOL_FPDMA)
         {
            sci_base_state_machine_change_state(
               &this_device->ready_substate_machine,
               SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ
            );
         }
         else
         {
            this_device->working_request = io_request;
            sci_base_state_machine_change_state(
               &this_device->ready_substate_machine,
               SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_CMD
            );
         }
      }
      scic_sds_remote_device_start_request(this_device, io_request, status);
   }
   return status;
}
static SCI_STATUS scic_sds_stp_remote_device_ready_idle_substate_start_io_handler ( SCI_BASE_REMOTE_DEVICE_T * device , SCI_BASE_REQUEST_T * request ) { SCI_STATUS status ; SCIC_SDS_REMOTE_DEVICE_T * this_device = ( SCIC_SDS_REMOTE_DEVICE_T * ) device ; SCIC_SDS_REQUEST_T * io_request = ( SCIC_SDS_REQUEST_T * ) request ; status = this_device -> owning_port -> state_handlers -> start_io_handler ( this_device -> owning_port , this_device , io_request ) ; if ( status == SCI_SUCCESS ) { status = scic_sds_remote_node_context_start_io ( this_device -> rnc , io_request ) ; if ( status == SCI_SUCCESS ) { status = io_request -> state_handlers -> parent . start_handler ( request ) ; } if ( status == SCI_SUCCESS ) { if ( io_request -> sat_protocol == SAT_PROTOCOL_FPDMA ) { sci_base_state_machine_change_state ( & this_device -> ready_substate_machine , SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ ) ; } else { this_device -> working_request = io_request ; sci_base_state_machine_change_state ( & this_device -> ready_substate_machine , SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_CMD ) ; } } scic_sds_remote_device_start_request ( this_device , io_request , status ) ; } return status ; }
This method will handle the start io operation for a sata device that is in
 the command idle state.
This method will handle the start io operation for a sata device that is in the command idle state .
// Will the port allow the io request to start?