FreeBSD/sys/dev/isci/scil/scic_sds_controller.c
/**
 * @brief This is the method provided to handle completions for a single
 *        MSIX message.
 *
 * @param[in] controller
 */
@brief This is the method provided to handle completions for a single
MSIX message.

@param[in] controller
@brief This is the method provided to handle completions for a single MSIX message . @param [ in ] controller
static
void scic_sds_controller_single_vector_completion_handler(
   SCI_CONTROLLER_HANDLE_T controller
)
{
   U32 interrupt_status;
   SCIC_SDS_CONTROLLER_T *this_controller;
   this_controller = (SCIC_SDS_CONTROLLER_T *)controller;
   SCIC_LOG_TRACE((
      sci_base_object_get_logger(controller),
      SCIC_LOG_OBJECT_CONTROLLER,
      "scic_sds_controller_single_vector_completion_handler(0x%d) enter\n",
      controller
   ));
   interrupt_status = SMU_ISR_READ(this_controller);
   interrupt_status &= (SMU_ISR_QUEUE_ERROR | SMU_ISR_QUEUE_SUSPEND);
   if (interrupt_status & SMU_ISR_QUEUE_ERROR)
   {
      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
      );
      return;
   }
   if (
           (interrupt_status & SMU_ISR_QUEUE_SUSPEND)
        && !scic_sds_controller_completion_queue_has_entries(this_controller)
      )
   {
      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
      );
      return;
   }
   if (scic_sds_controller_completion_queue_has_entries(this_controller))
   {
      scic_sds_controller_process_completions(this_controller);
      SMU_ISR_WRITE(
         this_controller,
         (SMU_ISR_COMPLETION | SMU_ISR_QUEUE_SUSPEND)
      );
   }
   SMU_IMR_WRITE(this_controller, 0x00000000);
}
static void scic_sds_controller_single_vector_completion_handler ( SCI_CONTROLLER_HANDLE_T controller ) { U32 interrupt_status ; SCIC_SDS_CONTROLLER_T * this_controller ; this_controller = ( SCIC_SDS_CONTROLLER_T * ) controller ; SCIC_LOG_TRACE ( ( sci_base_object_get_logger ( controller ) , SCIC_LOG_OBJECT_CONTROLLER , " \n " , controller ) ) ; interrupt_status = SMU_ISR_READ ( this_controller ) ; interrupt_status &= ( SMU_ISR_QUEUE_ERROR | SMU_ISR_QUEUE_SUSPEND ) ; if ( interrupt_status & SMU_ISR_QUEUE_ERROR ) { 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 ) ; return ; } if ( ( interrupt_status & SMU_ISR_QUEUE_SUSPEND ) && ! scic_sds_controller_completion_queue_has_entries ( this_controller ) ) { 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 ) ; return ; } if ( scic_sds_controller_completion_queue_has_entries ( this_controller ) ) { scic_sds_controller_process_completions ( this_controller ) ; SMU_ISR_WRITE ( this_controller , ( SMU_ISR_COMPLETION | SMU_ISR_QUEUE_SUSPEND ) ) ; } SMU_IMR_WRITE ( this_controller , 0x00000000 ) ; }
@brief This is the method provided to handle completions for a single
        MSIX message.
@brief This is the method provided to handle completions for a single MSIX message .
// We have a fatal condition and must reset the controller // Leave the interrupt mask in place and get the controller reset // We have a fatal condtion and must reset the controller // Leave the interrupt mask in place and get the controller reset // We dont care which interrupt got us to processing the completion queu // so clear them both.