From patchwork Mon Jun 17 14:25:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Healy X-Patchwork-Id: 251865 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 154ED2C00A0 for ; Tue, 18 Jun 2013 00:25:18 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754939Ab3FQOZN (ORCPT ); Mon, 17 Jun 2013 10:25:13 -0400 Received: from mail-ob0-f178.google.com ([209.85.214.178]:43543 "EHLO mail-ob0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751601Ab3FQOZM (ORCPT ); Mon, 17 Jun 2013 10:25:12 -0400 Received: by mail-ob0-f178.google.com with SMTP id fb19so3241233obc.9 for ; Mon, 17 Jun 2013 07:25:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=UYtEZe+v3+KJKErxAKMfORxC005rDwDhIfiwiHIHO3I=; b=DJeNUsrtewsJW6AV9Bjs1pu/I1koOnnWgPEWP58mhlhmKngQCUVCxl2sE56gyfJEJk gccT9FEr950ECD2taMsk1dzQL+OHB1bt68IcgUCwsVuhIAypTakuu+ZIQxLKHMY0dORH i23lYYoy1Fm5PHJXvW0dP+6A0xF81EQBqHwQr5XJGF70iwK+7NW1sFn6VHDSmrRaoiVt jjdm5E3MwTtX6i6tz+8AHx70e14Cnn7YHOwnGNb2Axy5Z4uGIjVP1UGC+8KSrxSwi3Ov 1auzE9MKJC9Umnqt28JkIxKBQfT3o3dDSaJoqbgOaFtjhbmllyr5mhsVEtjLtKMAW/uj CNHA== X-Received: by 10.182.72.170 with SMTP id e10mr8956406obv.62.1371479111727; Mon, 17 Jun 2013 07:25:11 -0700 (PDT) Received: from cphealy-desktop.gateway.2wire.net (99-73-211-50.lightspeed.irvnca.sbcglobal.net. [99.73.211.50]) by mx.google.com with ESMTPSA id i2sm16558078obz.11.2013.06.17.07.25.10 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Jun 2013 07:25:11 -0700 (PDT) From: cphealy@gmail.com To: "David S. Miller" , Fabio Estevam , Frank Li , Shawn Guo , Jim Baxter , netdev@vger.kernel.org Cc: Chris Healy Subject: [PATCH 1/1] fec: Add support to restart autonegotiate Date: Mon, 17 Jun 2013 07:25:06 -0700 Message-Id: <1371479106-2897-1-git-send-email-cphealy@gmail.com> X-Mailer: git-send-email 1.8.1.2 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Chris Healy Add ethtool operation to restart autonegotiation via the PHY. Tested on i.MX28EVK. Signed-off-by: Chris Healy --- 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)