From: cphealy@gmail.com
To: "David S. Miller" <davem@davemloft.net>,
Fabio Estevam <fabio.estevam@freescale.com>,
Frank Li <Frank.Li@freescale.com>,
Shawn Guo <shawn.guo@linaro.org>,
Jim Baxter <jim_baxter@mentor.com>,
netdev@vger.kernel.org
Cc: Chris Healy <cphealy@gmail.com>
Subject: [PATCH 1/1] fec: Add support to restart autonegotiate
Date: Mon, 17 Jun 2013 07:25:06 -0700 [thread overview]
Message-ID: <1371479106-2897-1-git-send-email-cphealy@gmail.com> (raw)
From: Chris Healy <cphealy@gmail.com>
Add ethtool operation to restart autonegotiation via the PHY.
Tested on i.MX28EVK.
Signed-off-by: Chris Healy <cphealy@gmail.com>
---
drivers/net/ethernet/freescale/fec_main.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index a667015..a327492 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1436,6 +1436,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,
@@ -1444,6 +1455,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)
--
1.8.1.2
next reply other threads:[~2013-06-17 14:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-17 14:25 cphealy [this message]
2013-06-17 23:34 ` [PATCH 1/1] fec: Add support to restart autonegotiate David Miller
-- strict thread matches above, loose matches on Subject: below --
2013-06-17 0:04 cphealy
2013-06-17 13:44 ` Sergei Shtylyov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1371479106-2897-1-git-send-email-cphealy@gmail.com \
--to=cphealy@gmail.com \
--cc=Frank.Li@freescale.com \
--cc=davem@davemloft.net \
--cc=fabio.estevam@freescale.com \
--cc=jim_baxter@mentor.com \
--cc=netdev@vger.kernel.org \
--cc=shawn.guo@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).