FreeBSD/sys/dev/isci/scil/scif_sas_controller.c
/**
 * @brief This method clear affiliation for all the EA SATA devices associated
 *        to this controller.
 *
 * @param[in] fw_controller This parameter specifies the framework
 *            controller object for whose remote devices are to be stopped.
 *
 * @return This method returns a value indicating if the operation completed.
 * @retval SCI_COMPLETE This value indicates that all the EA SATA devices'
 *         affiliation was cleared.
 * @retval SCI_INCOMPLETE This value indicates clear affiliation activity is
 *         yet to be completed.
 */
@brief This method clear affiliation for all the EA SATA devices associated
to this controller.

@param[in] fw_controller This parameter specifies the framework
controller object for whose remote devices are to be stopped.

@return This method returns a value indicating if the operation completed.
@retval SCI_COMPLETE This value indicates that all the EA SATA devices'
affiliation was cleared.
@retval SCI_INCOMPLETE This value indicates clear affiliation activity is
yet to be completed.
@brief This method clear affiliation for all the EA SATA devices associated to this controller . @param [ in ] fw_controller This parameter specifies the framework controller object for whose remote devices are to be stopped . @return This method returns a value indicating if the operation completed . @retval SCI_COMPLETE This value indicates that all the EA SATA devices ' affiliation was cleared . @retval SCI_INCOMPLETE This value indicates clear affiliation activity is yet to be completed .
SCI_STATUS scif_sas_controller_clear_affiliation(
   SCIF_SAS_CONTROLLER_T * fw_controller
)
{
   U8 index;
   SCI_STATUS status;
   SCIF_SAS_DOMAIN_T * fw_domain;
   SCIF_LOG_TRACE((
      sci_base_object_get_logger(fw_controller),
      SCIF_LOG_OBJECT_CONTROLLER,
      "scif_sas_controller_clear_affiliation(0x%x) enter\n",
      fw_controller
   ));
   index = fw_controller->current_domain_to_clear_affiliation;
   if (index < SCI_MAX_DOMAINS)
   {
      fw_domain = &fw_controller->domains[index];
      scif_sas_domain_cancel_smp_activities(fw_domain);
      scif_sas_domain_start_clear_affiliation(fw_domain);
      status = SCI_WARNING_SEQUENCE_INCOMPLETE;
   }
   else
   {  
      scif_sas_controller_continue_to_stop(fw_controller);
      status = SCI_SUCCESS;
   }
   return status;
}
SCI_STATUS scif_sas_controller_clear_affiliation ( SCIF_SAS_CONTROLLER_T * fw_controller ) { U8 index ; SCI_STATUS status ; SCIF_SAS_DOMAIN_T * fw_domain ; SCIF_LOG_TRACE ( ( sci_base_object_get_logger ( fw_controller ) , SCIF_LOG_OBJECT_CONTROLLER , " \n " , fw_controller ) ) ; index = fw_controller -> current_domain_to_clear_affiliation ; if ( index < SCI_MAX_DOMAINS ) { fw_domain = & fw_controller -> domains [ index ] ; scif_sas_domain_cancel_smp_activities ( fw_domain ) ; scif_sas_domain_start_clear_affiliation ( fw_domain ) ; status = SCI_WARNING_SEQUENCE_INCOMPLETE ; } else { scif_sas_controller_continue_to_stop ( fw_controller ) ; status = SCI_SUCCESS ; } return status ; }
@brief This method clear affiliation for all the EA SATA devices associated
        to this controller.
@brief This method clear affiliation for all the EA SATA devices associated to this controller .
//Need to stop all the on-going smp activities before clearing affiliation. //the controller has done clear affiliation work to all its domains.