src/dpdk/drivers/net/e1000/base/e1000_82575.c
s32 e1000_set_d3_lplu_state_82580(struct e1000_hw *hw, bool active)
{
	struct e1000_phy_info *phy = &hw->phy;
	u32 data;

	DEBUGFUNC("e1000_set_d3_lplu_state_82580");

	data = E1000_READ_REG(hw, E1000_82580_PHY_POWER_MGMT);

	if (!active) {
		data &= ~E1000_82580_PM_D3_LPLU;
		/*
		 * LPLU and SmartSpeed are mutually exclusive.  LPLU is used
		 * during Dx states where the power conservation is most
		 * important.  During driver activity we should enable
		 * SmartSpeed, so performance is maintained.
		 */
		if (phy->smart_speed == e1000_smart_speed_on)
			data |= E1000_82580_PM_SPD;
		else if (phy->smart_speed == e1000_smart_speed_off)
			data &= ~E1000_82580_PM_SPD;
	} else if ((phy->autoneg_advertised == E1000_ALL_SPEED_DUPLEX) ||
		   (phy->autoneg_advertised == E1000_ALL_NOT_GIG) ||
		   (phy->autoneg_advertised == E1000_ALL_10_SPEED)) {
		data |= E1000_82580_PM_D3_LPLU;
		/* When LPLU is enabled, we should disable SmartSpeed */
		data &= ~E1000_82580_PM_SPD;
	}

	E1000_WRITE_REG(hw, E1000_82580_PHY_POWER_MGMT, data);
	return E1000_SUCCESS;
}
/**
 *  e1000_set_d3_lplu_state_82580 - Sets low power link up state for D3
 *  @hw: pointer to the HW structure
 *  @active: boolean used to enable/disable lplu
 *
 *  Success returns 0, Failure returns 1
 *
 *  The low power link up (lplu) state is set to the power management level D3
 *  and SmartSpeed is disabled when active is true, else clear lplu for D3
 *  and enable Smartspeed.  LPLU and Smartspeed are mutually exclusive.  LPLU
 *  is used during Dx states where the power conservation is most important.
 *  During driver activity, SmartSpeed should be enabled so performance is
 *  maintained.
 **/
Sets low power link up state for D3
@hw: pointer to the HW structure
@active: boolean used to enable/disable lplu

Success returns 0, Failure returns 1

The low power link up (lplu) state is set to the power management level D3
and SmartSpeed is disabled when active is true, else clear lplu for D3
and enable Smartspeed.  LPLU and Smartspeed are mutually exclusive.  LPLU
is used during Dx states where the power conservation is most important.
During driver activity, SmartSpeed should be enabled so performance is
maintained.
Sets low power link up state for D3 @hw : pointer to the HW structure @active : boolean used to enable / disable lplu Success returns 0 Failure returns 1 The low power link up ( lplu ) state is set to the power management level D3 and SmartSpeed is disabled when active is true else clear lplu for D3 and enable Smartspeed . LPLU and Smartspeed are mutually exclusive . LPLU is used during Dx states where the power conservation is most important . During driver activity SmartSpeed should be enabled so performance is maintained .
s32 e1000_set_d3_lplu_state_82580(struct e1000_hw *hw, bool active)
{
	struct e1000_phy_info *phy = &hw->phy;
	u32 data;
	DEBUGFUNC("e1000_set_d3_lplu_state_82580");
	data = E1000_READ_REG(hw, E1000_82580_PHY_POWER_MGMT);
	if (!active) {
		data &= ~E1000_82580_PM_D3_LPLU;
		if (phy->smart_speed == e1000_smart_speed_on)
			data |= E1000_82580_PM_SPD;
		else if (phy->smart_speed == e1000_smart_speed_off)
			data &= ~E1000_82580_PM_SPD;
	} else if ((phy->autoneg_advertised == E1000_ALL_SPEED_DUPLEX) ||
		   (phy->autoneg_advertised == E1000_ALL_NOT_GIG) ||
		   (phy->autoneg_advertised == E1000_ALL_10_SPEED)) {
		data |= E1000_82580_PM_D3_LPLU;
		data &= ~E1000_82580_PM_SPD;
	}
	E1000_WRITE_REG(hw, E1000_82580_PHY_POWER_MGMT, data);
	return E1000_SUCCESS;
}
s32 e1000_set_d3_lplu_state_82580 ( struct e1000_hw * hw , bool active ) { struct e1000_phy_info * phy = & hw -> phy ; u32 data ; DEBUGFUNC ( " " ) ; data = E1000_READ_REG ( hw , E1000_82580_PHY_POWER_MGMT ) ; if ( ! active ) { data &= ~ E1000_82580_PM_D3_LPLU ; if ( phy -> smart_speed == e1000_smart_speed_on ) data |= E1000_82580_PM_SPD ; else if ( phy -> smart_speed == e1000_smart_speed_off ) data &= ~ E1000_82580_PM_SPD ; } else if ( ( phy -> autoneg_advertised == E1000_ALL_SPEED_DUPLEX ) || ( phy -> autoneg_advertised == E1000_ALL_NOT_GIG ) || ( phy -> autoneg_advertised == E1000_ALL_10_SPEED ) ) { data |= E1000_82580_PM_D3_LPLU ; data &= ~ E1000_82580_PM_SPD ; } E1000_WRITE_REG ( hw , E1000_82580_PHY_POWER_MGMT , data ) ; return E1000_SUCCESS ; }
e1000_set_d3_lplu_state_82580 - Sets low power link up state for D3
  @hw: pointer to the HW structure
  @active: boolean used to enable/disable lplu
e1000_set_d3_lplu_state_82580 - Sets low power link up state for D3 @hw : pointer to the HW structure @active : boolean used to enable / disable lplu
/*
		 * LPLU and SmartSpeed are mutually exclusive.  LPLU is used
		 * during Dx states where the power conservation is most
		 * important.  During driver activity we should enable
		 * SmartSpeed, so performance is maintained.
		 */ /* When LPLU is enabled, we should disable SmartSpeed */