summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Healy <cphealy@gmail.com>2013-06-17 18:25:06 +0400
committerDavid S. Miller <davem@davemloft.net>2013-06-18 03:34:14 +0400
commit32bc9b46d840d08e1c8f58eaf500d0e596c33659 (patch)
treef6f67d111b0fa05643241e402e28973de40182b0
parentcedb743f3e8db12cc76a706888792497953e93bb (diff)
downloadlinux-32bc9b46d840d08e1c8f58eaf500d0e596c33659.tar.xz
fec: Add support to restart autonegotiate
Add ethtool operation to restart autonegotiation via the PHY. Tested on i.MX28EVK. Signed-off-by: Chris Healy <cphealy@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/freescale/fec_main.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index c540055e4f4f..46f2544fd1a7 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1435,6 +1435,17 @@ static int fec_enet_set_pauseparam(struct net_device *ndev,
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 = {
.get_pauseparam = fec_enet_get_pauseparam,
.set_pauseparam = fec_enet_set_pauseparam,
@@ -1443,6 +1454,7 @@ static const struct ethtool_ops fec_enet_ethtool_ops = {
.get_drvinfo = fec_enet_get_drvinfo,
.get_link = ethtool_op_get_link,
.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)