From patchwork Sat May 25 11:58:36 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: 1105313 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="f/oAWwgC"; 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 45B1xz6P8vz9sB8 for ; Sat, 25 May 2019 21:59:51 +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=9bWZ/pwPVwX5zX3k1nADOH/duIkiE9kPovmoTubbG+I=; b=f/oAWwgCWCk3Md cqAUNRtF24LorxzRddp1mDRk7NAYwI0xeknPa/iblE7/9d5YL0iflAGZUy3LH1RD5D1TwQGU5K0F6 Ptm1E9SCFAK3rkvh2UwYrG6WSuoy8yiPa1n5LxamOomlzM7f8YEGgJLGBz4pwdso4G2KXVA77d57A T+y/QvHmPWbKA8O+oFNEg5kNeHq7bdePMZLH4iXCFy4CE+bepn8xxmoDzl9WOqTZ6Dr4AHUFvuPUS zid9xctqPkXOD/Ay3ZZerDzfMiYeZEU1tc4bHNC2DMff+uVnmGnntZM8LZojG0LoX58O5C1jzJBF3 d9Hwq18chWgyM7yaLC5g==; 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 1hUVKu-0003sP-LD; Sat, 25 May 2019 11:59:40 +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 1hUVKF-0002y2-Sn for openwrt-devel@lists.openwrt.org; Sat, 25 May 2019 11:59:03 +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 701DC3A31; Sat, 25 May 2019 13:58:56 +0200 (CEST) Received: by meh.true.cz (OpenSMTPD) with ESMTP id 3981b5d7; Sat, 25 May 2019 13:58:55 +0200 (CEST) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Date: Sat, 25 May 2019 13:58:36 +0200 Message-Id: <1558785521-31779-2-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_045900_078262_F281F659 X-CRM114-Status: UNSURE ( 9.17 ) X-CRM114-Notice: Please train this message. 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 1/6] kernel: generic: remove broken and obsolete phy_ethtool_ioctl 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 701-phy_extension.patch from 4.14 and 4.19 kernel, as it's currenlty broken and fixing doesn't make sense as most of it is deprecated anyway. Cc: John Crispin Ref: https://bugs.openwrt.org/index.php?do=details&task_id=1982 Signed-off-by: Petr Štetiar --- .../generic/pending-4.14/701-phy_extension.patch | 95 ---------------------- .../generic/pending-4.19/701-phy_extension.patch | 95 ---------------------- 2 files changed, 190 deletions(-) delete mode 100644 target/linux/generic/pending-4.14/701-phy_extension.patch delete mode 100644 target/linux/generic/pending-4.19/701-phy_extension.patch diff --git a/target/linux/generic/pending-4.14/701-phy_extension.patch b/target/linux/generic/pending-4.14/701-phy_extension.patch deleted file mode 100644 index 0f0b0e046777..000000000000 --- a/target/linux/generic/pending-4.14/701-phy_extension.patch +++ /dev/null @@ -1,95 +0,0 @@ -From: John Crispin -Subject: net: phy: add phy_ethtool_ioctl() - -Signed-off-by: John Crispin ---- - drivers/net/phy/phy.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ - include/linux/phy.h | 1 + - 2 files changed, 45 insertions(+) - ---- a/drivers/net/phy/phy.c -+++ b/drivers/net/phy/phy.c -@@ -382,6 +382,73 @@ void phy_ethtool_ksettings_get(struct ph - } - EXPORT_SYMBOL(phy_ethtool_ksettings_get); - -+static int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd) -+{ -+ cmd->supported = phydev->supported; -+ -+ cmd->advertising = phydev->advertising; -+ cmd->lp_advertising = phydev->lp_advertising; -+ -+ ethtool_cmd_speed_set(cmd, phydev->speed); -+ cmd->duplex = phydev->duplex; -+ if (phydev->interface == PHY_INTERFACE_MODE_MOCA) -+ cmd->port = PORT_BNC; -+ else -+ cmd->port = PORT_MII; -+ cmd->phy_address = phydev->mdio.addr; -+ cmd->transceiver = phy_is_internal(phydev) ? -+ XCVR_INTERNAL : XCVR_EXTERNAL; -+ cmd->autoneg = phydev->autoneg; -+ cmd->eth_tp_mdix_ctrl = phydev->mdix_ctrl; -+ cmd->eth_tp_mdix = phydev->mdix; -+ -+ return 0; -+} -+ -+int phy_ethtool_ioctl(struct phy_device *phydev, void *useraddr) -+{ -+ u32 cmd; -+ int tmp; -+ struct ethtool_cmd ecmd = { ETHTOOL_GSET }; -+ struct ethtool_value edata = { ETHTOOL_GLINK }; -+ -+ if (get_user(cmd, (u32 *) useraddr)) -+ return -EFAULT; -+ -+ switch (cmd) { -+ case ETHTOOL_GSET: -+ phy_ethtool_gset(phydev, &ecmd); -+ if (copy_to_user(useraddr, &ecmd, sizeof(ecmd))) -+ return -EFAULT; -+ return 0; -+ -+ case ETHTOOL_SSET: -+ if (copy_from_user(&ecmd, useraddr, sizeof(ecmd))) -+ return -EFAULT; -+ return phy_ethtool_sset(phydev, &ecmd); -+ -+ case ETHTOOL_NWAY_RST: -+ /* if autoneg is off, it's an error */ -+ tmp = phy_read(phydev, MII_BMCR); -+ if (tmp & BMCR_ANENABLE) { -+ tmp |= (BMCR_ANRESTART); -+ phy_write(phydev, MII_BMCR, tmp); -+ return 0; -+ } -+ return -EINVAL; -+ -+ case ETHTOOL_GLINK: -+ edata.data = (phy_read(phydev, -+ MII_BMSR) & BMSR_LSTATUS) ? 1 : 0; -+ if (copy_to_user(useraddr, &edata, sizeof(edata))) -+ return -EFAULT; -+ return 0; -+ } -+ -+ return -EOPNOTSUPP; -+} -+EXPORT_SYMBOL(phy_ethtool_ioctl); -+ - /** - * phy_mii_ioctl - generic PHY MII ioctl interface - * @phydev: the phy_device struct ---- a/include/linux/phy.h -+++ b/include/linux/phy.h -@@ -909,6 +909,7 @@ void phy_ethtool_ksettings_get(struct ph - struct ethtool_link_ksettings *cmd); - int phy_ethtool_ksettings_set(struct phy_device *phydev, - const struct ethtool_link_ksettings *cmd); -+int phy_ethtool_ioctl(struct phy_device *phydev, void *useraddr); - int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd); - int phy_start_interrupts(struct phy_device *phydev); - void phy_print_status(struct phy_device *phydev); diff --git a/target/linux/generic/pending-4.19/701-phy_extension.patch b/target/linux/generic/pending-4.19/701-phy_extension.patch deleted file mode 100644 index a340872e56a1..000000000000 --- a/target/linux/generic/pending-4.19/701-phy_extension.patch +++ /dev/null @@ -1,95 +0,0 @@ -From: John Crispin -Subject: net: phy: add phy_ethtool_ioctl() - -Signed-off-by: John Crispin ---- - drivers/net/phy/phy.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ - include/linux/phy.h | 1 + - 2 files changed, 45 insertions(+) - ---- a/drivers/net/phy/phy.c -+++ b/drivers/net/phy/phy.c -@@ -382,6 +382,73 @@ void phy_ethtool_ksettings_get(struct ph - } - EXPORT_SYMBOL(phy_ethtool_ksettings_get); - -+static int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd) -+{ -+ cmd->supported = phydev->supported; -+ -+ cmd->advertising = phydev->advertising; -+ cmd->lp_advertising = phydev->lp_advertising; -+ -+ ethtool_cmd_speed_set(cmd, phydev->speed); -+ cmd->duplex = phydev->duplex; -+ if (phydev->interface == PHY_INTERFACE_MODE_MOCA) -+ cmd->port = PORT_BNC; -+ else -+ cmd->port = PORT_MII; -+ cmd->phy_address = phydev->mdio.addr; -+ cmd->transceiver = phy_is_internal(phydev) ? -+ XCVR_INTERNAL : XCVR_EXTERNAL; -+ cmd->autoneg = phydev->autoneg; -+ cmd->eth_tp_mdix_ctrl = phydev->mdix_ctrl; -+ cmd->eth_tp_mdix = phydev->mdix; -+ -+ return 0; -+} -+ -+int phy_ethtool_ioctl(struct phy_device *phydev, void *useraddr) -+{ -+ u32 cmd; -+ int tmp; -+ struct ethtool_cmd ecmd = { ETHTOOL_GSET }; -+ struct ethtool_value edata = { ETHTOOL_GLINK }; -+ -+ if (get_user(cmd, (u32 *) useraddr)) -+ return -EFAULT; -+ -+ switch (cmd) { -+ case ETHTOOL_GSET: -+ phy_ethtool_gset(phydev, &ecmd); -+ if (copy_to_user(useraddr, &ecmd, sizeof(ecmd))) -+ return -EFAULT; -+ return 0; -+ -+ case ETHTOOL_SSET: -+ if (copy_from_user(&ecmd, useraddr, sizeof(ecmd))) -+ return -EFAULT; -+ return phy_ethtool_sset(phydev, &ecmd); -+ -+ case ETHTOOL_NWAY_RST: -+ /* if autoneg is off, it's an error */ -+ tmp = phy_read(phydev, MII_BMCR); -+ if (tmp & BMCR_ANENABLE) { -+ tmp |= (BMCR_ANRESTART); -+ phy_write(phydev, MII_BMCR, tmp); -+ return 0; -+ } -+ return -EINVAL; -+ -+ case ETHTOOL_GLINK: -+ edata.data = (phy_read(phydev, -+ MII_BMSR) & BMSR_LSTATUS) ? 1 : 0; -+ if (copy_to_user(useraddr, &edata, sizeof(edata))) -+ return -EFAULT; -+ return 0; -+ } -+ -+ return -EOPNOTSUPP; -+} -+EXPORT_SYMBOL(phy_ethtool_ioctl); -+ - /** - * phy_mii_ioctl - generic PHY MII ioctl interface - * @phydev: the phy_device struct ---- a/include/linux/phy.h -+++ b/include/linux/phy.h -@@ -1045,6 +1045,7 @@ void phy_ethtool_ksettings_get(struct ph - struct ethtool_link_ksettings *cmd); - int phy_ethtool_ksettings_set(struct phy_device *phydev, - const struct ethtool_link_ksettings *cmd); -+int phy_ethtool_ioctl(struct phy_device *phydev, void *useraddr); - int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd); - int phy_start_interrupts(struct phy_device *phydev); - void phy_print_status(struct phy_device *phydev); From patchwork Sat May 25 11:58:37 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: 1105309 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="LW1ldCrw"; 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 45B1xP4rkgz9sB8 for ; Sat, 25 May 2019 21:59:20 +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=Fc6EaRjAt5cwKtAPmR4i1F6Z/Cr/irLK4H9Ebq+2x6w=; b=LW1ldCrw0dSvM6 fLGXrOjCfdBb90c11RtnShKR+Ub/jPCKDr2bthhqn30tZmsvI6uvowEBe+asNpAJYLbCLaZLKvE8X 29qVLZ18vr9UwbXOGYboOi+1e6QvOGFMjEA5AY7p+eYAwY5hW+oehba7X/WFgkccBtTlLGW1sisRP 5PuTslLWOhJnvXjS1fnV3oM97u0V8OekkpUOUaKxzZ/eprWsirYO7aHd+xNONwU6MzZsRrbvmaz8X dhxDWVPUskR6Gy/jwauxKkarSp3TKSYEkt0Zwf1xXFk8BwocniMhRlLtcnkJhtOswRXOZVuWhDpo9 bk24PZ9T7PZalhe8BJ9A==; 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 1hUVKJ-000303-HA; Sat, 25 May 2019 11:59:03 +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 1hUVKF-0002y3-S1 for openwrt-devel@lists.openwrt.org; Sat, 25 May 2019 11:59:01 +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 C226A3A32; Sat, 25 May 2019 13:58:56 +0200 (CEST) Received: by meh.true.cz (OpenSMTPD) with ESMTP id 61cc407e; Sat, 25 May 2019 13:58:55 +0200 (CEST) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Date: Sat, 25 May 2019 13:58:37 +0200 Message-Id: <1558785521-31779-3-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_045900_062106_6E477D95 X-CRM114-Status: UNSURE ( 8.54 ) X-CRM114-Notice: Please train this message. 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 2/6] ramips: ethernet: remove unused SIOCETHTOOL ioctl handling 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 , Felix Fietkau Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This ioctl is currently routed through generic interface code. dev_ioctl dev_ethtool __ethtool_get_link_ksettings phy_ethtool_ioctl Cc: Felix Fietkau Cc: John Crispin Signed-off-by: Petr Štetiar --- .../files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c index 10d9fd7a3e67..b2c3d32c5549 100644 --- a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -1411,19 +1411,8 @@ static int fe_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) if (!priv->phy_dev) return -ENODEV; - switch (cmd) { - case SIOCETHTOOL: - return phy_ethtool_ioctl(priv->phy_dev, - (void *) ifr->ifr_data); - case SIOCGMIIPHY: - case SIOCGMIIREG: - case SIOCSMIIREG: - return phy_mii_ioctl(priv->phy_dev, ifr, cmd); - default: - break; - } - return -EOPNOTSUPP; + return phy_mii_ioctl(priv->phy_dev, ifr, cmd); } static int fe_change_mtu(struct net_device *dev, int new_mtu) From patchwork Sat May 25 11:58:38 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: 1105311 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="FOqzMiav"; 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 45B1xY5n3zz9sB8 for ; Sat, 25 May 2019 21:59:29 +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=mbTrNjudlmGvQ6WxNzj7PK6Y9i/ga4xYI11YcVF3kMI=; b=FOqzMiavuKJkBS 2WxzDTOnNmHOVY8MhfzRyA3DqdELEwVupXyX6krW5K+E9hnjmvr9UmhuraiJCrF2TMd9O+uR8uBDB +jZwJ2vC63a5cqcPIGrXerwOT7UZlTCrar1jPA7DI6e2HaJvZvBMv7u3hA8rJgYjwe6jLq6EiJE5V SPwKLBbe8VA+LffGzQJmgJz0fZS8+i5kvGSzpv+s1kzbU/agLItWXJZExqM0dD9N+svN4dVATIv3H b/PZP6/rd5COq/J4pghrXRuPu0YBKvgVQfuD2Xhl8lTQwD8cdCscoUkhW8E01VhdOlnRaNNu0wr90 U42e1EbPdPlZUXkFGOQw==; 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 1hUVKZ-0003Np-WB; Sat, 25 May 2019 11:59:20 +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 1hUVKG-0002y7-3q for openwrt-devel@lists.openwrt.org; Sat, 25 May 2019 11:59:02 +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 0F55D3A33; Sat, 25 May 2019 13:58:57 +0200 (CEST) Received: by meh.true.cz (OpenSMTPD) with ESMTP id 0e018727; Sat, 25 May 2019 13:58:56 +0200 (CEST) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Date: Sat, 25 May 2019 13:58:38 +0200 Message-Id: <1558785521-31779-4-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_045900_307130_113E793F X-CRM114-Status: UNSURE ( 8.90 ) X-CRM114-Notice: Please train this message. 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 3/6] ath79: ag71xx: remove unused SIOCETHTOOL ioctl handling 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?= , Chuanhong Guo , John Crispin Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This ioctl is currently routed through generic interface code: dev_ioctl dev_ethtool __ethtool_get_link_ksettings phy_ethtool_ioctl Cc: John Crispin Cc: Chuanhong Guo Signed-off-by: Petr Štetiar --- .../files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c index 8cff56a11a66..bcc9e227130c 100644 --- a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c +++ b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c @@ -946,18 +946,9 @@ err_drop: static int ag71xx_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) { struct ag71xx *ag = netdev_priv(dev); - int ret; - switch (cmd) { - case SIOCETHTOOL: - if (ag->phy_dev == NULL) - break; - - spin_lock_irq(&ag->lock); - ret = phy_ethtool_ioctl(ag->phy_dev, (void *) ifr->ifr_data); - spin_unlock_irq(&ag->lock); - return ret; + switch (cmd) { case SIOCSIFHWADDR: if (copy_from_user (dev->dev_addr, ifr->ifr_data, sizeof(dev->dev_addr))) From patchwork Sat May 25 11:58:39 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: 1105312 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="cM1XB0ey"; 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 45B1xv2gJ2z9sB8 for ; Sat, 25 May 2019 21:59:47 +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=lAUFplwhnymbMnnfCV/1tFWS56UQIxyk+k/mo/tmLWw=; b=cM1XB0eyteIOrz b0AbQNOkllsJ1Hd8PTqf8gbrP66YGqCK0knMyBk4HoFi1MdTuLehM19bOvyyyuhP8VxrxeIKmChVM P078C4B9waxsZ3YTD3/ntgj363XWci8oROs6T5Fp6Q1dAHv8stWmOmne8OGFfArSuD0YfNYtG9xlc tj71Tpnqjv+BpB0Q942b38Rzm6yZgVmOyyMcobOuTYhEIHf0BSh8m8F14z3RZWf7otrE7AmEpUmvr gglhG+wLodiBU1Gct7CNKUCi/d+0Wl863ru//Gj/k76HXihQ7qxJVMNwCs9hLukcNhbgrRtI9rF2N 02a/+yULq1qWs0U+DcOA==; 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 1hUVKl-0003dg-9Z; Sat, 25 May 2019 11:59:31 +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 1hUVKG-0002y8-5T for openwrt-devel@lists.openwrt.org; Sat, 25 May 2019 11:59:03 +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 7DAD53A34; Sat, 25 May 2019 13:58:57 +0200 (CEST) Received: by meh.true.cz (OpenSMTPD) with ESMTP id a556b046; Sat, 25 May 2019 13:58:56 +0200 (CEST) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Date: Sat, 25 May 2019 13:58:39 +0200 Message-Id: <1558785521-31779-5-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_045900_355828_E7777E8A X-CRM114-Status: UNSURE ( 7.54 ) X-CRM114-Notice: Please train this message. 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 4/6] ar71xx: ag71xx: remove unused SIOCETHTOOL ioctl handling 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?= , Felix Fietkau Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This ioctl is currently routed through generic interface code: dev_ioctl dev_ethtool __ethtool_get_link_ksettings phy_ethtool_ioctl Cc: Felix Fietkau Signed-off-by: Petr Štetiar --- .../files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c index 542d4915b300..2c0b4d241063 100644 --- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c +++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c @@ -845,18 +845,8 @@ err_drop: static int ag71xx_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) { struct ag71xx *ag = netdev_priv(dev); - int ret; switch (cmd) { - case SIOCETHTOOL: - if (ag->phy_dev == NULL) - break; - - spin_lock_irq(&ag->lock); - ret = phy_ethtool_ioctl(ag->phy_dev, (void *) ifr->ifr_data); - spin_unlock_irq(&ag->lock); - return ret; - case SIOCSIFHWADDR: if (copy_from_user (dev->dev_addr, ifr->ifr_data, sizeof(dev->dev_addr))) From patchwork Sat May 25 11:58:40 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: 1105315 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="pmWFd7lk"; 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 45B1yP3stGz9sBr for ; Sat, 25 May 2019 22:00:13 +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=hvnu60jZT6pO6V3s+kg+ozDU+Ij3Gza4/BflvftA+oU=; b=pmWFd7lkw8SzWJ dQJYTgpeA/tAT5Fo/KL9lDZ6ASzL6aVq24Ev31XRF7R4H3TN6S/bHuQQp/RyusX8AGOL6EGlUA4n9 +I0/o/t5aWWYZV8dk6uvAxgN1bbMb6reCE0TO5djyGXzNZibI2c7cHixunfp2egnG9Nr92hBide4K SgqyhoCKlj12SCi5+ozIQJdFPl+4MdsiUCvMzgqMKdv0Z0j93eMvgezrLFvqUc9lhnOShxu+9vRtq NUZA9TyZB9FXrAMm4aCEAzXRH8Eh+rCVFrNnOT6bRUbxN49HNV2gPXGGhmExYo9IXEISgiZyhdqSW hQj7A0F7nQ2gr3PIU+oQ==; 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 1hUVLE-0004NC-GH; Sat, 25 May 2019 12:00:00 +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-0002zn-W6 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 259883A35; Sat, 25 May 2019 13:58:58 +0200 (CEST) Received: by meh.true.cz (OpenSMTPD) with ESMTP id 5d957f7b; 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:40 +0200 Message-Id: <1558785521-31779-6-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_230934_CA15CFBE X-CRM114-Status: GOOD ( 10.12 ) 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 5/6] ath79: 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 ethtool doesn't work currently as phy_ethtool_ioctl expects user space pointer, but it's being passed kernel one. Fixing it doesn't make sense as {s,g}et_settings were deprecated anyway. So let's rather remove phy_ethtool_ioctl and use new {s,g}et_link_ksettings instead. While at it, update nway_reset as well. 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 | 40 ++++++++-------------- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ethtool.c b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ethtool.c index 6f37fda3876c..2cd7b1be8388 100644 --- a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ethtool.c +++ b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ethtool.c @@ -13,30 +13,6 @@ #include "ag71xx.h" -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; - - return phy_ethtool_ioctl(phydev, cmd); -} - -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; - - return phy_ethtool_ioctl(phydev, cmd); -} - static u32 ag71xx_ethtool_get_msglevel(struct net_device *dev) { struct ag71xx *ag = netdev_priv(dev); @@ -108,13 +84,25 @@ 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_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, }; 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, };