FreeBSD/sys/dev/isci/scil/scic_sds_controller.c
/**
 * @brief This method inserts the phy in the stagger spinup control queue.
 *
 * @param[in] this_controller
 * @param[in] the_phy
 */
@brief This method inserts the phy in the stagger spinup control queue.
@brief This method inserts the phy in the stagger spinup control queue .
void scic_sds_controller_power_control_queue_insert(
   SCIC_SDS_CONTROLLER_T *this_controller,
   SCIC_SDS_PHY_T        *the_phy
)
{
   ASSERT (the_phy != NULL);
   if( this_controller->power_control.remote_devices_granted_power <
       this_controller->oem_parameters.sds1.controller.max_number_concurrent_device_spin_up
     )
   {
      this_controller->power_control.remote_devices_granted_power ++;
      scic_sds_phy_consume_power_handler(the_phy);
      scic_sds_controller_power_control_timer_restart (this_controller);
   }
   else
   {
      U8 i;
      SCIC_SDS_PHY_T * current_phy;
      for(i = 0; i < SCI_MAX_PHYS; i++)
      {
         current_phy = &this_controller->phy_table[i];
         if (current_phy->parent.state_machine.current_state_id == SCI_BASE_PHY_STATE_READY &&
             current_phy->protocol == SCIC_SDS_PHY_PROTOCOL_SAS &&
             current_phy->phy_type.sas.identify_address_frame_buffer.sas_address.high
                == the_phy->phy_type.sas.identify_address_frame_buffer.sas_address.high &&
             current_phy->phy_type.sas.identify_address_frame_buffer.sas_address.low
                == the_phy->phy_type.sas.identify_address_frame_buffer.sas_address.low)
         {
            scic_sds_phy_consume_power_handler(the_phy);
            break;
         }
      }
      if (i == SCI_MAX_PHYS)
      {
         this_controller->power_control.requesters[the_phy->phy_index] = the_phy;
         this_controller->power_control.phys_waiting++;
      }
   }
}
void scic_sds_controller_power_control_queue_insert ( SCIC_SDS_CONTROLLER_T * this_controller , SCIC_SDS_PHY_T * the_phy ) { ASSERT ( the_phy != NULL ) ; if ( this_controller -> power_control . remote_devices_granted_power < this_controller -> oem_parameters . sds1 . controller . max_number_concurrent_device_spin_up ) { this_controller -> power_control . remote_devices_granted_power ++ ; scic_sds_phy_consume_power_handler ( the_phy ) ; scic_sds_controller_power_control_timer_restart ( this_controller ) ; } else { U8 i ; SCIC_SDS_PHY_T * current_phy ; for ( i = 0 ; i < SCI_MAX_PHYS ; i ++ ) { current_phy = & this_controller -> phy_table [ i ] ; if ( current_phy -> parent . state_machine . current_state_id == SCI_BASE_PHY_STATE_READY && current_phy -> protocol == SCIC_SDS_PHY_PROTOCOL_SAS && current_phy -> phy_type . sas . identify_address_frame_buffer . sas_address . high == the_phy -> phy_type . sas . identify_address_frame_buffer . sas_address . high && current_phy -> phy_type . sas . identify_address_frame_buffer . sas_address . low == the_phy -> phy_type . sas . identify_address_frame_buffer . sas_address . low ) { scic_sds_phy_consume_power_handler ( the_phy ) ; break ; } } if ( i == SCI_MAX_PHYS ) { this_controller -> power_control . requesters [ the_phy -> phy_index ] = the_phy ; this_controller -> power_control . phys_waiting ++ ; } } }
@brief This method inserts the phy in the stagger spinup control queue.
@brief This method inserts the phy in the stagger spinup control queue .
//stop and start the power_control timer. When the timer fires, the //no_of_devices_granted_power will be set to 0 //there are phys, attached to the same sas address as this phy, are already //in READY state, this phy don't need wait. //Add the phy in the waiting list