FreeBSD/sys/dev/isci/scil/scic_sds_controller.c
/**
 * @brief This method is called internally by the controller object to
 *        start the next phy on the controller.  If all the phys have
 *        been starte, then this method will attempt to transition the
 *        controller to the READY state and inform the user
 *        (scic_cb_controller_start_complete()).
 *
 * @param[in] this_controller This parameter specifies the controller
 *            object for which to start the next phy.
 *
 * @return SCI_STATUS
 */
@brief This method is called internally by the controller object to
start the next phy on the controller.  If all the phys have
been starte, then this method will attempt to transition the
controller to the READY state and inform the user
(scic_cb_controller_start_complete()).

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


@brief This method is called internally by the controller object to start the next phy on the controller . If all the phys have been starte then this method will attempt to transition the controller to the READY state and inform the user ( scic_cb_controller_start_complete () ) . @param [ in ] this_controller This parameter specifies the controller object for which to start the next phy .
SCI_STATUS scic_sds_controller_start_next_phy(
   SCIC_SDS_CONTROLLER_T *this_controller
)
{
   SCI_STATUS status;
   status = SCI_SUCCESS;
   if (this_controller->phy_startup_timer_pending == FALSE)
   {
      if (this_controller->next_phy_to_start == SCI_MAX_PHYS)
      {
         if (scic_sds_controller_is_start_complete(this_controller) == TRUE)
         {
            scic_sds_controller_transition_to_ready(
               this_controller, SCI_SUCCESS
            );
         }
      }
      else
      {
         SCIC_SDS_PHY_T * the_phy;
         the_phy = &this_controller->phy_table[this_controller->next_phy_to_start];
         if (
               this_controller->oem_parameters.sds1.controller.mode_type
            == SCIC_PORT_MANUAL_CONFIGURATION_MODE
            )
         {
            if (scic_sds_phy_get_port(the_phy) == SCI_INVALID_HANDLE)
            {
               this_controller->next_phy_to_start++;
                The PHY was never added to a PORT in MPC mode so start the next phy in sequence
                This phy will never go link up and will not draw power the OEM parameters either
                configured the phy incorrectly for the PORT or it was never assigned to a PORT
               return scic_sds_controller_start_next_phy(this_controller);
            }
         }
         status = scic_phy_start(the_phy);
         if (status == SCI_SUCCESS)
         {
            scic_sds_controller_phy_timer_start(this_controller);
         }
         else
         {
            SCIC_LOG_WARNING((
               sci_base_object_get_logger(this_controller),
               SCIC_LOG_OBJECT_CONTROLLER | SCIC_LOG_OBJECT_PHY,
               "Controller stop operation failed to stop phy %d because of status %d.\n",
               this_controller->phy_table[this_controller->next_phy_to_start].phy_index,
               status
            ));
         }
         this_controller->next_phy_to_start++;
      }
   }
   return status;
}
SCI_STATUS scic_sds_controller_start_next_phy ( SCIC_SDS_CONTROLLER_T * this_controller ) { SCI_STATUS status ; status = SCI_SUCCESS ; if ( this_controller -> phy_startup_timer_pending == FALSE ) { if ( this_controller -> next_phy_to_start == SCI_MAX_PHYS ) { if ( scic_sds_controller_is_start_complete ( this_controller ) == TRUE ) { scic_sds_controller_transition_to_ready ( this_controller , SCI_SUCCESS ) ; } } else { SCIC_SDS_PHY_T * the_phy ; the_phy = & this_controller -> phy_table [ this_controller -> next_phy_to_start ] ; if ( this_controller -> oem_parameters . sds1 . controller . mode_type == SCIC_PORT_MANUAL_CONFIGURATION_MODE ) { if ( scic_sds_phy_get_port ( the_phy ) == SCI_INVALID_HANDLE ) { this_controller -> next_phy_to_start ++ ; return scic_sds_controller_start_next_phy ( this_controller ) ; } } status = scic_phy_start ( the_phy ) ; if ( status == SCI_SUCCESS ) { scic_sds_controller_phy_timer_start ( this_controller ) ; } else { SCIC_LOG_WARNING ( ( sci_base_object_get_logger ( this_controller ) , SCIC_LOG_OBJECT_CONTROLLER | SCIC_LOG_OBJECT_PHY , " \n " , this_controller -> phy_table [ this_controller -> next_phy_to_start ] . phy_index , status ) ) ; } this_controller -> next_phy_to_start ++ ; } } return status ; }
@brief This method is called internally by the controller object to
        start the next phy on the controller.
@brief This method is called internally by the controller object to start the next phy on the controller .
// The controller has successfully finished the start process. // Inform the SCI Core user and transition to the READY state. // Caution recursion ahead be forwarned // // The PHY was never added to a PORT in MPC mode so start the next phy in sequence // This phy will never go link up and will not draw power the OEM parameters either // configured the phy incorrectly for the PORT or it was never assigned to a PORT