aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/ti
diff options
context:
space:
mode:
authorMatus Ujhelyi <ujhelyi.m@gmail.com>2013-08-20 01:59:38 -0400
committerDavid S. Miller <davem@davemloft.net>2013-08-21 02:50:15 -0400
commitd8a64420eb267bec9f4c99627deee4fa3bf4133e (patch)
tree89ad64eae7653c2d463cbb89d0ac165dc1880d3b /drivers/net/ethernet/ti
parentdbe34724c08ea25d39d31735120077013fbbb6fb (diff)
net: cpsw: Add support for wake-on-lan for cpsw
Some phy's can be configured to enable wake on lan (e.g. at803x or marvell 88E1318S). There is no way how to enable wol on CPSW with such connected phys. This patch adds this support. It is provided by calling the phy's related code. Tested on board with at8030x connected phy. Wol interrupt line is connected to GPIO0 on am335x. Signed-off-by: Matus Ujhelyi <ujhelyi.m@gmail.com> Acked-by: Mugunthan V N <mugunthanvnm@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ti')
-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,