From patchwork Sat May 25 11:58:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 1105314 X-Patchwork-Delegate: ynezz@true.cz Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=true.cz Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pMGvI6sL"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45B1y75mVdz9sB8 for ; Sat, 25 May 2019 21:59:59 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=sMvl8EeS+n324/u1js6EjUAaflFOult1H/uN1CWEYuw=; b=pMGvI6sL63486y G0eIxq4TBkYaxmWLRLTZZAGea0uONBbjGFELtiUFyZkZbd+hY7Wcc1p3qAXkYNR/2C+lcGeqoRnhu yFUrvxASRcg+mXTf9jY6+1Ta9h1BIanMpAXwIc9jJ2VAIz62nj4amCPzzXjfPUEpsfXwnx+7rQjdJ 1a0kyhMM6YPfKf9PVuCg9CBUwlBdyR7uF7HckPHe3DbS2wgKEfjnke4aZQjIq8xtZ31400+WgxEG/ BtKmBErifMAO9Evd7ZbT4HNmdltR7IdCY4JIpQ10CsVctVvbMZ5c1EjA9iT2HRODIxArfZV308ttT OtD+dw5jljLXV9AaTtyg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hUVL4-00047r-Aw; Sat, 25 May 2019 11:59:50 +0000 Received: from smtp-out.xnet.cz ([178.217.244.18]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hUVKI-0002zm-W1 for openwrt-devel@lists.openwrt.org; Sat, 25 May 2019 11:59:05 +0000 Received: from meh.true.cz (meh.true.cz [108.61.167.218]) (Authenticated sender: petr@true.cz) by smtp-out.xnet.cz (Postfix) with ESMTPSA id 7814F3A36; Sat, 25 May 2019 13:58:58 +0200 (CEST) Received: by meh.true.cz (OpenSMTPD) with ESMTP id d7721364; Sat, 25 May 2019 13:58:57 +0200 (CEST) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Date: Sat, 25 May 2019 13:58:41 +0200 Message-Id: <1558785521-31779-7-git-send-email-ynezz@true.cz> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1558785521-31779-1-git-send-email-ynezz@true.cz> References: <1558785521-31779-1-git-send-email-ynezz@true.cz> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190525_045903_220920_A7C9D363 X-CRM114-Status: GOOD ( 10.05 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [178.217.244.18 listed in list.dnswl.org] 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record Subject: [OpenWrt-Devel] [PATCH 6/6] ar71xx: ag71xx: update ethtool support X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Petr_=C5=A0tetiar?= , John Crispin Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Remove references to broken and mostly deprecated phy_ethtool_ioctl, use new {s,g}et_link_ksettings and add nway_reset which was previously handled in phy_ethtool_ioctl. Cc: John Crispin Ref: https://bugs.openwrt.org/index.php?do=details&task_id=1982 Signed-off-by: Petr Štetiar --- .../net/ethernet/atheros/ag71xx/ag71xx_ethtool.c | 48 +++++++--------------- 1 file changed, 14 insertions(+), 34 deletions(-) diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ethtool.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ethtool.c index a2eaba1a1e68..9e5a53e7fce2 100644 --- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ethtool.c +++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ethtool.c @@ -14,38 +14,6 @@ #include "ag71xx.h" #include -static int ag71xx_ethtool_get_settings(struct net_device *dev, - struct ethtool_cmd *cmd) -{ - struct ag71xx *ag = netdev_priv(dev); - struct phy_device *phydev = ag->phy_dev; - - if (!phydev) - return -ENODEV; - -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,14,0) - return phy_ethtool_gset(phydev, cmd); -#else - return phy_ethtool_ioctl(phydev, cmd); -#endif -} - -static int ag71xx_ethtool_set_settings(struct net_device *dev, - struct ethtool_cmd *cmd) -{ - struct ag71xx *ag = netdev_priv(dev); - struct phy_device *phydev = ag->phy_dev; - - if (!phydev) - return -ENODEV; - -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,14,0) - return phy_ethtool_sset(phydev, cmd); -#else - return phy_ethtool_ioctl(phydev, cmd); -#endif -} - static void ag71xx_ethtool_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) { @@ -127,14 +95,26 @@ static int ag71xx_ethtool_set_ringparam(struct net_device *dev, return err; } +static int ag71xx_ethtool_nway_reset(struct net_device *dev) +{ + struct ag71xx *ag = netdev_priv(dev); + struct phy_device *phydev = ag->phy_dev; + + if (!phydev) + return -ENODEV; + + return genphy_restart_aneg(phydev); +} + struct ethtool_ops ag71xx_ethtool_ops = { - .set_settings = ag71xx_ethtool_set_settings, - .get_settings = ag71xx_ethtool_get_settings, .get_drvinfo = ag71xx_ethtool_get_drvinfo, .get_msglevel = ag71xx_ethtool_get_msglevel, .set_msglevel = ag71xx_ethtool_set_msglevel, .get_ringparam = ag71xx_ethtool_get_ringparam, .set_ringparam = ag71xx_ethtool_set_ringparam, + .get_link_ksettings = phy_ethtool_get_link_ksettings, + .set_link_ksettings = phy_ethtool_set_link_ksettings, .get_link = ethtool_op_get_link, .get_ts_info = ethtool_op_get_ts_info, + .nway_reset = ag71xx_ethtool_nway_reset, };