aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/ti/cpsw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/ti/cpsw.c')
-rw-r--r--drivers/net/ethernet/ti/cpsw.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index b4a85f5531ed..79974e31187a 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -1640,6 +1640,29 @@ static int cpsw_set_settings(struct net_device *ndev, struct ethtool_cmd *ecmd)
1640 return -EOPNOTSUPP; 1640 return -EOPNOTSUPP;
1641} 1641}
1642 1642
1643static void cpsw_get_wol(struct net_device *ndev, struct ethtool_wolinfo *wol)
1644{
1645 struct cpsw_priv *priv = netdev_priv(ndev);
1646 int slave_no = cpsw_slave_index(priv);
1647
1648 wol->supported = 0;
1649 wol->wolopts = 0;
1650
1651 if (priv->slaves[slave_no].phy)
1652 phy_ethtool_get_wol(priv->slaves[slave_no].phy, wol);
1653}
1654
1655static int cpsw_set_wol(struct net_device *ndev, struct ethtool_wolinfo *wol)
1656{
1657 struct cpsw_priv *priv = netdev_priv(ndev);
1658 int slave_no = cpsw_slave_index(priv);
1659
1660 if (priv->slaves[slave_no].phy)
1661 return phy_ethtool_set_wol(priv->slaves[slave_no].phy, wol);
1662 else
1663 return -EOPNOTSUPP;
1664}
1665
1643static const struct ethtool_ops cpsw_ethtool_ops = { 1666static const struct ethtool_ops cpsw_ethtool_ops = {
1644 .get_drvinfo = cpsw_get_drvinfo, 1667 .get_drvinfo = cpsw_get_drvinfo,
1645 .get_msglevel = cpsw_get_msglevel, 1668 .get_msglevel = cpsw_get_msglevel,
@@ -1653,6 +1676,8 @@ static const struct ethtool_ops cpsw_ethtool_ops = {
1653 .get_sset_count = cpsw_get_sset_count, 1676 .get_sset_count = cpsw_get_sset_count,
1654 .get_strings = cpsw_get_strings, 1677 .get_strings = cpsw_get_strings,
1655 .get_ethtool_stats = cpsw_get_ethtool_stats, 1678 .get_ethtool_stats = cpsw_get_ethtool_stats,
1679 .get_wol = cpsw_get_wol,
1680 .set_wol = cpsw_set_wol,
1656}; 1681};
1657 1682
1658static void cpsw_slave_init(struct cpsw_slave *slave, struct cpsw_priv *priv, 1683static void cpsw_slave_init(struct cpsw_slave *slave, struct cpsw_priv *priv,