Skip to content

Commit b55498f

Browse files
hkallweitkuba-moo
authored andcommitted
net: phy: add phy_disable_eee
If a MAC driver doesn't support EEE, then the PHY shouldn't advertise it. Add phy_disable_eee() for this purpose. Signed-off-by: Heiner Kallweit <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent e8f3323 commit b55498f

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

drivers/net/phy/phy_device.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3003,6 +3003,22 @@ void phy_support_eee(struct phy_device *phydev)
30033003
}
30043004
EXPORT_SYMBOL(phy_support_eee);
30053005

3006+
/**
3007+
* phy_disable_eee - Disable EEE for the PHY
3008+
* @phydev: Target phy_device struct
3009+
*
3010+
* This function is used by MAC drivers for MAC's which don't support EEE.
3011+
* It disables EEE on the PHY layer.
3012+
*/
3013+
void phy_disable_eee(struct phy_device *phydev)
3014+
{
3015+
linkmode_zero(phydev->supported_eee);
3016+
linkmode_zero(phydev->advertising_eee);
3017+
phydev->eee_cfg.tx_lpi_enabled = false;
3018+
phydev->eee_cfg.eee_enabled = false;
3019+
}
3020+
EXPORT_SYMBOL_GPL(phy_disable_eee);
3021+
30063022
/**
30073023
* phy_support_sym_pause - Enable support of symmetrical pause
30083024
* @phydev: target phy_device struct

include/linux/phy.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2071,6 +2071,7 @@ void phy_advertise_eee_all(struct phy_device *phydev);
20712071
void phy_support_sym_pause(struct phy_device *phydev);
20722072
void phy_support_asym_pause(struct phy_device *phydev);
20732073
void phy_support_eee(struct phy_device *phydev);
2074+
void phy_disable_eee(struct phy_device *phydev);
20742075
void phy_set_sym_pause(struct phy_device *phydev, bool rx, bool tx,
20752076
bool autoneg);
20762077
void phy_set_asym_pause(struct phy_device *phydev, bool rx, bool tx);

0 commit comments

Comments
 (0)