summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2019-02-11 11:46:06 +0000
committerDavid S. Miller <davem@davemloft.net>2019-02-12 12:22:41 -0500
commit86e58135bc4ac68b41be11d82f1b1f87cb6119ba (patch)
tree0d2051c0e05817b3d852504f04b2466e33d64268 /drivers/net
parent0946cf1dc7b6da951b4eb3fbcfd8e926dd0e787b (diff)
downloadlinux-86e58135bc4ac68b41be11d82f1b1f87cb6119ba.tar.gz
linux-86e58135bc4ac68b41be11d82f1b1f87cb6119ba.tar.bz2
linux-86e58135bc4ac68b41be11d82f1b1f87cb6119ba.zip
net: phylink: add phylink_init_eee() helper
Provide phylink_init_eee() to allow MAC drivers to initialise PHY EEE from within the ethtool set_eee() method. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/phy/phylink.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index a148866cbb14..33f66dcd369a 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -1272,6 +1272,24 @@ int phylink_get_eee_err(struct phylink *pl)
EXPORT_SYMBOL_GPL(phylink_get_eee_err);
/**
+ * phylink_init_eee() - init and check the EEE features
+ * @pl: a pointer to a &struct phylink returned from phylink_create()
+ * @clk_stop_enable: allow PHY to stop receive clock
+ *
+ * Must be called either with RTNL held or within mac_link_up()
+ */
+int phylink_init_eee(struct phylink *pl, bool clk_stop_enable)
+{
+ int ret = -EOPNOTSUPP;
+
+ if (pl->phydev)
+ ret = phy_init_eee(pl->phydev, clk_stop_enable);
+
+ return ret;
+}
+EXPORT_SYMBOL_GPL(phylink_init_eee);
+
+/**
* phylink_ethtool_get_eee() - read the energy efficient ethernet parameters
* @pl: a pointer to a &struct phylink returned from phylink_create()
* @eee: a pointer to a &struct ethtool_eee for the read parameters