diff options
author | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2023-06-01 09:48:20 +0100 |
---|---|---|
committer | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2024-04-16 16:51:04 +0100 |
commit | 5de9ed47abfe7547ff008e97992ba2650e47a20d (patch) | |
tree | a993d3758fdede23cdb57ee3071470f2c93e8a8e /drivers | |
parent | 1a853040b7a762b0dab068ba736d1ae6b1adae85 (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')
-rw-r--r-- | drivers/net/phy/phylink.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 1009a5ff6afc..e96eded31e4c 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -2845,6 +2845,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; } @@ -2861,8 +2863,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 */ @@ -2902,6 +2909,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; |