diff options
Diffstat (limited to 'drivers/net/ethernet/ti/cpsw.c')
-rw-r--r-- | drivers/net/ethernet/ti/cpsw.c | 25 |
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 | ||
1643 | static 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 | |||
1655 | static 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 | |||
1643 | static const struct ethtool_ops cpsw_ethtool_ops = { | 1666 | static 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 | ||
1658 | static void cpsw_slave_init(struct cpsw_slave *slave, struct cpsw_priv *priv, | 1683 | static void cpsw_slave_init(struct cpsw_slave *slave, struct cpsw_priv *priv, |