Received: by 10.223.164.221 with SMTP id h29csp2898639wrb; Thu, 2 Nov 2017 20:54:10 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TI+F8N3ARDxZTthY/2G7z69wYxB+nX2ypKwFlX9YF3aicmXFJy8PRaeJR4QoloVok151K6 X-Received: by 10.159.195.7 with SMTP id bd7mr5532234plb.43.1509681250680; Thu, 02 Nov 2017 20:54:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509681250; cv=none; d=google.com; s=arc-20160816; b=fObfiMQNtsTy1OxrDzw2pNv9sgG4CVXOXFk5y6EGS46Uj+MHtKH1bhYoKB5KXO4mp/ GK5bxbkQ5tCwIg5aVv0PhSXJ++OSgMSJ0nXbN/BSCSpjEVxWezFL/iFVuSZ+nSI/AfJS 5sEY0+eakskpigtbAOHSp9ax9v270i9Dgx7MGyJ4c7PZpcHRhy46c4A4vmKT2AxzvQtE dj3rJgn7mEh/h4m0tKsz7V1sQRGjrTK+JbH6D+oS/iTMARWo4Hz5nyUkO+PQGS4gsHO3 Yjrks9/iI/iTgdo3K+8OowbRtOyKdJqI9yKQAOZAuu98+8An9nBZSDIkyLwoG442C0r3 BIXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=ri5iFjs+UMx4Ub2LPhfS087myPn6xrZMUlEioBnKo5I=; b=xjLxtmLI86AjvSlvt5t8wjBrB9B6BG+XaCWZ9Uht5N9iDyu37CnE2+KIg4uikD+J9U LGSdcm0JfDwLBCR6/mEJ8ji8RPgoTwjLaKjDJ7WbTKEo8Z+quYkPeE3Cuz2P2+PNOAkg yZwDV5PfGC/oCJUnhWjf/Lc6PDcqDzfvmkGbIBR1rMzfyWeAb8Mf41tFiL9TpG5EunW9 KoDLlKIX5RzhqL1nixly/bHvzeNR9/2glMmQ/q79ez9quKWtNIZwcC2rq/EmmLILXGQt jNGiR51iAXV1F0eZ8OQcreJrnpRUK7rug80zVREmsdxZ8GHHjP8YbElL302p4QN1JBiS 1hvQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w9si3249922plp.208.2017.11.02.20.53.57; Thu, 02 Nov 2017 20:54:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753813AbdKCDvK (ORCPT + 97 others); Thu, 2 Nov 2017 23:51:10 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:9943 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752400AbdKCDvI (ORCPT ); Thu, 2 Nov 2017 23:51:08 -0400 Received: from 172.30.72.58 (EHLO DGGEMS411-HUB.china.huawei.com) ([172.30.72.58]) by dggrg04-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DKE90176; Fri, 03 Nov 2017 11:51:05 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.361.1; Fri, 3 Nov 2017 11:50:56 +0800 From: Lipeng To: CC: , , , , Subject: [PATCH net-next 5/6] net: hns3: add support for nway_reset Date: Fri, 3 Nov 2017 12:18:29 +0800 Message-ID: <1509682710-94908-6-git-send-email-lipeng321@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1509682710-94908-1-git-send-email-lipeng321@huawei.com> References: <1509682710-94908-1-git-send-email-lipeng321@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.71.200.31] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.59FBE7A9.0125,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: e3bf08667bd60c0020caaf620ee545fa Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fuyun Liang This patch adds nway_reset support for ethtool cmd. Signed-off-by: Fuyun Liang Signed-off-by: Lipeng --- .../net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c index 7fe193b..a21470c 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c @@ -832,6 +832,23 @@ static int hns3_set_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd) } } +static int hns3_nway_reset(struct net_device *netdev) +{ + struct phy_device *phy = netdev->phydev; + + if (!netif_running(netdev)) + return 0; + + /* Only support nway_reset for netdev with phy attached for now */ + if (!phy) + return -EOPNOTSUPP; + + if (phy->autoneg != AUTONEG_ENABLE) + return -EINVAL; + + return genphy_restart_aneg(phy); +} + static const struct ethtool_ops hns3_ethtool_ops = { .self_test = hns3_self_test, .get_drvinfo = hns3_get_drvinfo, @@ -850,6 +867,7 @@ static int hns3_set_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd) .set_rxfh = hns3_set_rss, .get_link_ksettings = hns3_get_link_ksettings, .set_link_ksettings = hns3_set_link_ksettings, + .nway_reset = hns3_nway_reset, }; void hns3_ethtool_set_ops(struct net_device *netdev) -- 1.9.1 From 1583063381143647173@xxx Fri Nov 03 16:34:47 +0000 2017 X-GM-THRID: 1582776461536220901 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread