FreeBSD/sys/dev/isci/scil/scif_sas_controller.c
/**
 * @brief This method will check how many outstanding IOs currently and number
 * of IOs in high priority queue, if the overall number exceeds the max_tc,
 * return FALSE.
 *
 * @param[in] fw_controller The framework controller.
 *
 * @return BOOL Indicate whether there is sufficient resource to start an IO.
 * @retvalue TRUE The controller has sufficient resource.
 * @retvalue FALSE There is not sufficient resource available.
 */
@brief This method will check how many outstanding IOs currently and number
of IOs in high priority queue, if the overall number exceeds the max_tc,
return FALSE.

@param[in] fw_controller The framework controller.

@return BOOL Indicate whether there is sufficient resource to start an IO.
@retvalue TRUE The controller has sufficient resource.
@retvalue FALSE There is not sufficient resource available.
@brief This method will check how many outstanding IOs currently and number of IOs in high priority queue if the overall number exceeds the max_tc return FALSE . @param [ in ] fw_controller The framework controller . @return BOOL Indicate whether there is sufficient resource to start an IO . @retvalue TRUE The controller has sufficient resource . @retvalue FALSE There is not sufficient resource available .
BOOL scif_sas_controller_sufficient_resource(
   SCIF_SAS_CONTROLLER_T *fw_controller
)
{
   SCIF_SAS_DOMAIN_T * fw_domain;
   U32 domain_index;
   U32 outstanding_io_count = 0;
   U32 high_priority_io_count = 0;
   for(domain_index = 0; domain_index < SCI_MAX_DOMAINS; domain_index++)
   {
      fw_domain = &fw_controller->domains[domain_index];
      outstanding_io_count += fw_domain->request_list.element_count;
   }
   high_priority_io_count = sci_pool_count(fw_controller->hprq.pool);
   if ( (outstanding_io_count + high_priority_io_count) > SCI_MAX_IO_REQUESTS )
      return FALSE;
   return TRUE;
}
BOOL scif_sas_controller_sufficient_resource ( SCIF_SAS_CONTROLLER_T * fw_controller ) { SCIF_SAS_DOMAIN_T * fw_domain ; U32 domain_index ; U32 outstanding_io_count = 0 ; U32 high_priority_io_count = 0 ; for ( domain_index = 0 ; domain_index < SCI_MAX_DOMAINS ; domain_index ++ ) { fw_domain = & fw_controller -> domains [ domain_index ] ; outstanding_io_count += fw_domain -> request_list . element_count ; } high_priority_io_count = sci_pool_count ( fw_controller -> hprq . pool ) ; if ( ( outstanding_io_count + high_priority_io_count ) > SCI_MAX_IO_REQUESTS ) return FALSE ; return TRUE ; }
@brief This method will check how many outstanding IOs currently and number
 of IOs in high priority queue, if the overall number exceeds the max_tc,
 return FALSE.
@brief This method will check how many outstanding IOs currently and number of IOs in high priority queue if the overall number exceeds the max_tc return FALSE .