FreeBSD/sys/dev/isci/scil/scic_sds_ssp_request.c
/**
 * @brief This method processes the completions transport layer (TL) status
 *        to determine if the RAW task management frame was sent successfully.
 *        If the raw frame was sent successfully, then the state for the
 *        task request transitions to waiting for a response frame.
 *
 * @param[in] this_request This parameter specifies the request for which
 *            the TC completion was received.
 * @param[in] completion_code This parameter indicates the completion status
 *            information for the TC.
 *
 * @return Indicate if the tc completion handler was successful.
 * @retval SCI_SUCCESS currently this method always returns success.
 */
@brief This method processes the completions transport layer (TL) status
to determine if the RAW task management frame was sent successfully.
If the raw frame was sent successfully, then the state for the
task request transitions to waiting for a response frame.

@param[in] this_request This parameter specifies the request for which
the TC completion was received.
@param[in] completion_code This parameter indicates the completion status
information for the TC.

@return Indicate if the tc completion handler was successful.
@retval SCI_SUCCESS currently this method always returns success.
@brief This method processes the completions transport layer ( TL ) status to determine if the RAW task management frame was sent successfully . If the raw frame was sent successfully then the state for the task request transitions to waiting for a response frame . @param [ in ] this_request This parameter specifies the request for which the TC completion was received . @param [ in ] completion_code This parameter indicates the completion status information for the TC . @return Indicate if the tc completion handler was successful . @retval SCI_SUCCESS currently this method always returns success .
static
SCI_STATUS scic_sds_ssp_task_request_await_tc_completion_tc_completion_handler(
   SCIC_SDS_REQUEST_T * this_request,
   U32                  completion_code
)
{
   SCIC_LOG_TRACE((
      sci_base_object_get_logger(this_request),
      SCIC_LOG_OBJECT_TASK_MANAGEMENT,
      "scic_sds_ssp_task_request_await_tc_completion_tc_completion_handler(0x%x, 0x%x) enter\n",
      this_request, completion_code
   ));
   switch (SCU_GET_COMPLETION_TL_STATUS(completion_code))
   {
   case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD):
      scic_sds_request_set_status(
         this_request, SCU_TASK_DONE_GOOD, SCI_SUCCESS
      );
      sci_base_state_machine_change_state(
         &this_request->started_substate_machine,
         SCIC_SDS_IO_REQUEST_STARTED_TASK_MGMT_SUBSTATE_AWAIT_TC_RESPONSE
      );
   break;
   case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_ACK_NAK_TO):
      SCIC_LOG_WARNING((
         sci_base_object_get_logger(this_request),
         SCIC_LOG_OBJECT_TASK_MANAGEMENT,
         "TaskRequest:0x%x CompletionCode:%x - ACK/NAK timeout\n",
         this_request, completion_code
      ));
      sci_base_state_machine_change_state(
         &this_request->started_substate_machine,
         SCIC_SDS_IO_REQUEST_STARTED_TASK_MGMT_SUBSTATE_AWAIT_TC_RESPONSE
      );
   break;
   default:
      scic_sds_request_set_status(
         this_request,
         SCU_NORMALIZE_COMPLETION_STATUS(completion_code),
         SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR
      );
      sci_base_state_machine_change_state(
         &this_request->parent.state_machine,
         SCI_BASE_REQUEST_STATE_COMPLETED
      );
   break;
   }
   return SCI_SUCCESS;
}
static SCI_STATUS scic_sds_ssp_task_request_await_tc_completion_tc_completion_handler ( SCIC_SDS_REQUEST_T * this_request , U32 completion_code ) { SCIC_LOG_TRACE ( ( sci_base_object_get_logger ( this_request ) , SCIC_LOG_OBJECT_TASK_MANAGEMENT , " \n " , this_request , completion_code ) ) ; switch ( SCU_GET_COMPLETION_TL_STATUS ( completion_code ) ) { case SCU_MAKE_COMPLETION_STATUS ( SCU_TASK_DONE_GOOD ) : scic_sds_request_set_status ( this_request , SCU_TASK_DONE_GOOD , SCI_SUCCESS ) ; sci_base_state_machine_change_state ( & this_request -> started_substate_machine , SCIC_SDS_IO_REQUEST_STARTED_TASK_MGMT_SUBSTATE_AWAIT_TC_RESPONSE ) ; break ; case SCU_MAKE_COMPLETION_STATUS ( SCU_TASK_DONE_ACK_NAK_TO ) : SCIC_LOG_WARNING ( ( sci_base_object_get_logger ( this_request ) , SCIC_LOG_OBJECT_TASK_MANAGEMENT , " \n " , this_request , completion_code ) ) ; sci_base_state_machine_change_state ( & this_request -> started_substate_machine , SCIC_SDS_IO_REQUEST_STARTED_TASK_MGMT_SUBSTATE_AWAIT_TC_RESPONSE ) ; break ; default : scic_sds_request_set_status ( this_request , SCU_NORMALIZE_COMPLETION_STATUS ( completion_code ) , SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR ) ; sci_base_state_machine_change_state ( & this_request -> parent . state_machine , SCI_BASE_REQUEST_STATE_COMPLETED ) ; break ; } return SCI_SUCCESS ; }
@brief This method processes the completions transport layer (TL) status
        to determine if the RAW task management frame was sent successfully.
@brief This method processes the completions transport layer ( TL ) status to determine if the RAW task management frame was sent successfully .
// Currently, the decision is to simply allow the task request to // timeout if the task IU wasn't received successfully. // There is a potential for receiving multiple task responses if we // decide to send the task IU again. // All other completion status cause the IO to be complete.  If a NAK // was received, then it is up to the user to retry the request.