FreeBSD/sys/dev/isci/scil/scic_sds_controller.c
/**
 * @brief This is the method provided to handle completions when interrupt
 *        polling is in use.
 *
 * @param[in] controller
 *
 * @return none
 */
@brief This is the method provided to handle completions when interrupt
polling is in use.

@param[in] controller

@return none
@brief This is the method provided to handle completions when interrupt polling is in use . @param [ in ] controller @return none
static
void scic_sds_controller_polling_completion_handler(
   SCI_CONTROLLER_HANDLE_T controller
)
{
   SCIC_SDS_CONTROLLER_T *this_controller = (SCIC_SDS_CONTROLLER_T *)controller;
   SCIC_LOG_TRACE((
      sci_base_object_get_logger(controller),
      SCIC_LOG_OBJECT_CONTROLLER,
      "scic_sds_controller_polling_completion_handler(0x%d) enter\n",
      controller
   ));
   if (this_controller->encountered_fatal_error == TRUE)
   {
      SCIC_LOG_ERROR((
         sci_base_object_get_logger(this_controller),
         SCIC_LOG_OBJECT_CONTROLLER,
         "SCIC Controller has encountered a fatal error.\n"
      ));
      sci_base_state_machine_change_state(
         scic_sds_controller_get_base_state_machine(this_controller),
         SCI_BASE_CONTROLLER_STATE_FAILED
      );
   }
   else if (scic_sds_controller_completion_queue_has_entries(this_controller))
   {
      if (this_controller->restrict_completions == FALSE)
         scic_sds_controller_process_completions(this_controller);
      else
         scic_sds_controller_transitioned_process_completions(this_controller);
   }
   SMU_ISR_WRITE(
      this_controller,
      (U32)(SMU_ISR_COMPLETION | SMU_ISR_QUEUE_ERROR | SMU_ISR_QUEUE_SUSPEND)
   );
}
static void scic_sds_controller_polling_completion_handler ( SCI_CONTROLLER_HANDLE_T controller ) { SCIC_SDS_CONTROLLER_T * this_controller = ( SCIC_SDS_CONTROLLER_T * ) controller ; SCIC_LOG_TRACE ( ( sci_base_object_get_logger ( controller ) , SCIC_LOG_OBJECT_CONTROLLER , " \n " , controller ) ) ; if ( this_controller -> encountered_fatal_error == TRUE ) { SCIC_LOG_ERROR ( ( sci_base_object_get_logger ( this_controller ) , SCIC_LOG_OBJECT_CONTROLLER , " \n " ) ) ; sci_base_state_machine_change_state ( scic_sds_controller_get_base_state_machine ( this_controller ) , SCI_BASE_CONTROLLER_STATE_FAILED ) ; } else if ( scic_sds_controller_completion_queue_has_entries ( this_controller ) ) { if ( this_controller -> restrict_completions == FALSE ) scic_sds_controller_process_completions ( this_controller ) ; else scic_sds_controller_transitioned_process_completions ( this_controller ) ; } SMU_ISR_WRITE ( this_controller , ( U32 ) ( SMU_ISR_COMPLETION | SMU_ISR_QUEUE_ERROR | SMU_ISR_QUEUE_SUSPEND ) ) ; }
@brief This is the method provided to handle completions when interrupt
        polling is in use.
@brief This is the method provided to handle completions when interrupt polling is in use .
/*
    * The interrupt handler does not adjust the CQ's
    * get pointer.  So, SCU's INTx pin stays asserted during the
    * interrupt handler even though it tries to clear the interrupt
    * source.  Therefore, the completion handler must ensure that the
    * interrupt source is cleared.  Otherwise, we get a spurious
    * interrupt for which the interrupt handler will not issue a
    * corresponding completion event. Also, we unmask interrupts.
    */