Commit 32bc9b46 authored by Chris Healy's avatar Chris Healy Committed by David S. Miller

fec: Add support to restart autonegotiate

Add ethtool operation to restart autonegotiation via the PHY.

Tested on i.MX28EVK.
Signed-off-by: default avatarChris Healy <cphealy@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cedb743f
...@@ -1435,6 +1435,17 @@ static int fec_enet_set_pauseparam(struct net_device *ndev, ...@@ -1435,6 +1435,17 @@ static int fec_enet_set_pauseparam(struct net_device *ndev,
return 0; return 0;
} }
static int fec_enet_nway_reset(struct net_device *dev)
{
struct fec_enet_private *fep = netdev_priv(dev);
struct phy_device *phydev = fep->phy_dev;
if (!phydev)
return -ENODEV;
return genphy_restart_aneg(phydev);
}
static const struct ethtool_ops fec_enet_ethtool_ops = { static const struct ethtool_ops fec_enet_ethtool_ops = {
.get_pauseparam = fec_enet_get_pauseparam, .get_pauseparam = fec_enet_get_pauseparam,
.set_pauseparam = fec_enet_set_pauseparam, .set_pauseparam = fec_enet_set_pauseparam,
...@@ -1443,6 +1454,7 @@ static const struct ethtool_ops fec_enet_ethtool_ops = { ...@@ -1443,6 +1454,7 @@ static const struct ethtool_ops fec_enet_ethtool_ops = {
.get_drvinfo = fec_enet_get_drvinfo, .get_drvinfo = fec_enet_get_drvinfo,
.get_link = ethtool_op_get_link, .get_link = ethtool_op_get_link,
.get_ts_info = fec_enet_get_ts_info, .get_ts_info = fec_enet_get_ts_info,
.nway_reset = fec_enet_nway_reset,
}; };
static int fec_enet_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd) static int fec_enet_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment