FreeBSD/sys/dev/isci/scil/scic_sds_controller.c
/**
 * @brief This method is called internally to determine whether the
 *        controller start process is complete.  This is only true when:
 *          - all links have been given an opportunity to start
 *          - have no indication of a connected device
 *          - have an indication of a connected device and it has
 *             finished the link training process.
 *
 * @param[in] this_controller This parameter specifies the controller
 *            object for which to start the next phy.
 *
 * @return BOOL
 */
@brief This method is called internally to determine whether the
controller start process is complete.  This is only true when:
- all links have been given an opportunity to start
- have no indication of a connected device
- have an indication of a connected device and it has
finished the link training process.

@param[in] this_controller This parameter specifies the controller
object for which to start the next phy.

@return BOOL
@brief This method is called internally to determine whether the controller start process is complete . This is only true when : - all links have been given an opportunity to start - have no indication of a connected device - have an indication of a connected device and it has finished the link training process . @param [ in ] this_controller This parameter specifies the controller object for which to start the next phy . @return BOOL
BOOL scic_sds_controller_is_start_complete(
   SCIC_SDS_CONTROLLER_T *this_controller
)
{
   U8 index;
   for (index = 0; index < SCI_MAX_PHYS; index++)
   {
      SCIC_SDS_PHY_T *the_phy = & this_controller->phy_table[index];
      if (
            (
                  this_controller->oem_parameters.sds1.controller.mode_type
               == SCIC_PORT_AUTOMATIC_CONFIGURATION_MODE
            )
         || (
               (
                  this_controller->oem_parameters.sds1.controller.mode_type
               == SCIC_PORT_MANUAL_CONFIGURATION_MODE
               )
            && (scic_sds_phy_get_port(the_phy) != SCI_INVALID_HANDLE)
            )
         )
      {
        if (
               (
                  (the_phy->is_in_link_training == FALSE)
               && (the_phy->parent.state_machine.current_state_id
                   == SCI_BASE_PHY_STATE_INITIAL)
               )
            || (
                  (the_phy->is_in_link_training == FALSE)
               && (the_phy->parent.state_machine.current_state_id
                   == SCI_BASE_PHY_STATE_STOPPED)
               )
            || (
                  (the_phy->is_in_link_training == TRUE)
               && (the_phy->parent.state_machine.current_state_id
                   == SCI_BASE_PHY_STATE_STARTING)
               )
            || (
                  this_controller->port_agent.phy_ready_mask
                  != this_controller->port_agent.phy_configured_mask
               )
            )
         {
            return FALSE;
         }
      }
   }
   return TRUE;
}
BOOL scic_sds_controller_is_start_complete ( SCIC_SDS_CONTROLLER_T * this_controller ) { U8 index ; for ( index = 0 ; index < SCI_MAX_PHYS ; index ++ ) { SCIC_SDS_PHY_T * the_phy = & this_controller -> phy_table [ index ] ; if ( ( this_controller -> oem_parameters . sds1 . controller . mode_type == SCIC_PORT_AUTOMATIC_CONFIGURATION_MODE ) || ( ( this_controller -> oem_parameters . sds1 . controller . mode_type == SCIC_PORT_MANUAL_CONFIGURATION_MODE ) && ( scic_sds_phy_get_port ( the_phy ) != SCI_INVALID_HANDLE ) ) ) { if ( ( ( the_phy -> is_in_link_training == FALSE ) && ( the_phy -> parent . state_machine . current_state_id == SCI_BASE_PHY_STATE_INITIAL ) ) || ( ( the_phy -> is_in_link_training == FALSE ) && ( the_phy -> parent . state_machine . current_state_id == SCI_BASE_PHY_STATE_STOPPED ) ) || ( ( the_phy -> is_in_link_training == TRUE ) && ( the_phy -> parent . state_machine . current_state_id == SCI_BASE_PHY_STATE_STARTING ) ) || ( this_controller -> port_agent . phy_ready_mask != this_controller -> port_agent . phy_configured_mask ) ) { return FALSE ; } } } return TRUE ; }
@brief This method is called internally to determine whether the
        controller start process is complete.
@brief This method is called internally to determine whether the controller start process is complete .
/**
          * The controller start operation is complete if and only
          * if:
          * - all links have been given an opportunity to start
          * - have no indication of a connected device
          * - have an indication of a connected device and it has
          *   finished the link training process.
          */