summaryrefslogtreecommitdiff
path: root/drivers/net/phy/phylink.c
diff options
context:
space:
mode:
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2023-06-01 09:48:20 +0100
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2024-05-07 10:49:37 +0100
commit4ea64709de3e26d088509d18bc4fd70f58e89f9c (patch)
tree6982cce198469e0ffb9b14605f84dce465928ef4 /drivers/net/phy/phylink.c
parent8b6466d265a37ca873b41a406d512be5d731ba93 (diff)
net: phylink: allow EEE management for SFPs without PHYs
Allow EEE management for SFPs without accessible PHYs. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'drivers/net/phy/phylink.c')
-rw-r--r--drivers/net/phy/phylink.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 10df48be457f..d60be55734a9 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -2848,6 +2848,8 @@ int phylink_init_eee(struct phylink *pl, bool clk_stop_enable)
if (pl->phydev)
ret = phy_init_eee(pl->phydev, clk_stop_enable);
+ else if (pl->sfp_bus && phylink_mac_supports_eee(pl))
+ ret = 0;
return ret;
}
@@ -2864,8 +2866,13 @@ int phylink_ethtool_get_eee(struct phylink *pl, struct ethtool_eee *eee)
ASSERT_RTNL();
- if (pl->phydev)
+ if (pl->phydev) {
ret = phy_ethtool_get_eee(pl->phydev, eee);
+ } else if (pl->sfp_bus && phylink_mac_supports_eee(pl)) {
+ /* For optical SFPs, ensure that eee->supported is nonzero. */
+ eee->supported = SUPPORTED_FIBRE;
+ ret = 0;
+ }
if (!ret && phylink_mac_supports_eee(pl)) {
/* Overwrite phylib's interpretation of configuration */
@@ -2905,6 +2912,8 @@ int phylink_ethtool_set_eee(struct phylink *pl, struct ethtool_eee *eee)
if (pl->phydev)
ret = phy_ethtool_set_eee(pl->phydev, eee);
+ else if (pl->sfp_bus && phylink_mac_supports_eee(pl))
+ ret = 0;
if (!ret && mac_eee) {
bool can_lpi, old_can_lpi;