Received: by 10.223.164.221 with SMTP id h29csp2898044wrb; Thu, 2 Nov 2017 20:53:21 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QvrctIiG05P2ANpUr81YyuSK0oArYcOXYS8DymKhY3n+176MaGTfrOMY46QUljSeSU8pIc X-Received: by 10.99.95.70 with SMTP id t67mr5732372pgb.409.1509681201058; Thu, 02 Nov 2017 20:53:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509681201; cv=none; d=google.com; s=arc-20160816; b=yaxlGf4oWBgDFO3XFgBnos6Se4Hj1OPjoYb4EwmSs3Ko4ctsqOCLfbSEaGhozQ44KY Tn9w6cbRqJpEyNgBJWlaN3jENYF1aV9cOZEO5GM69OqGNficxXFr0x0LvhRrMzZ8h8b6 3ftGPVE9s7bN2M4HOmL/aP+s5SeErXjGQBK2ikeDmuw4LCqyAsyxBKv6M1m6KT4dx9WI 0PNwzNIrfRwexCCGWfYLTveYM20AVclWiZGcA4cwj7LPZEA50yDY5r08Rn3uB2BsGGqN /PxuA5C16H73u9rwDepbSm5rCD7q9v4v+Oz8AeUBZVmACOYx//iJcL8DRG6U3aP8cvjC jrEA== 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=b4WRQ1koyRmVzJI16bIcJfwknxHDSXY4clq2/lXq0ew=; b=wEgyRxgHzxD7gfj0xq0dMWMGuOeJHDdCiJtNLITGUC0zr+c1Ll5fUWayq2sV6F1bm6 AfrJqxwk4gEWPYBXF1utByJzlxiLLfZD9Er1GYlbCWZjKJsW3k6EPj3EAGCOF6k56UAE Ecw8jt+38ROgYAoxn4QpoRUoneOw/p10g3lWZHikizWCj3GPyKQH+yyTMyrhSPhQkGN/ 8mnU/1cqGgEd62DqoWmz7I3FQeX+6DIvKbAhvzRaPFMExth3LMgySP9dq5yAksBFxD1H 1nw8dH2u4OY4UJDTC2L/xBjjUw1oYB+7HyymgWG+IkA6uTyDoHSpXP9nNebAF/V9361J 57bw== 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 y9si3091763plt.235.2017.11.02.20.53.07; Thu, 02 Nov 2017 20:53:21 -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 S934793AbdKCDvU (ORCPT + 97 others); Thu, 2 Nov 2017 23:51:20 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:9940 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752406AbdKCDvI (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 DKE90170; Fri, 03 Nov 2017 11:51:04 +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 4/6] net: hns3: add support for set_link_ksettings Date: Fri, 3 Nov 2017 12:18:28 +0800 Message-ID: <1509682710-94908-5-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.59FBE7A8.00E9,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: 345db4616405e480b21036159adf6d23 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 set_link_ksettings support for ethtool cmd. Signed-off-by: Fuyun Liang Signed-off-by: Lipeng --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c index c7b8ebd..7fe193b 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c @@ -653,6 +653,16 @@ static int hns3_get_link_ksettings(struct net_device *netdev, return 0; } +static int hns3_set_link_ksettings(struct net_device *netdev, + const struct ethtool_link_ksettings *cmd) +{ + /* Only support ksettings_set for netdev with phy attached for now */ + if (netdev->phydev) + return phy_ethtool_ksettings_set(netdev->phydev, cmd); + + return -EOPNOTSUPP; +} + static u32 hns3_get_rss_key_size(struct net_device *netdev) { struct hnae3_handle *h = hns3_get_handle(netdev); @@ -839,6 +849,7 @@ static int hns3_set_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd) .get_rxfh = hns3_get_rss, .set_rxfh = hns3_set_rss, .get_link_ksettings = hns3_get_link_ksettings, + .set_link_ksettings = hns3_set_link_ksettings, }; void hns3_ethtool_set_ops(struct net_device *netdev) -- 1.9.1 From 1583229322846841117@xxx Sun Nov 05 12:32:22 +0000 2017 X-GM-THRID: 1582708919119150420 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread