diff options
author | Fuyun Liang <liangfuyun1@huawei.com> | 2017-11-03 12:18:28 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-11-03 21:36:49 +0900 |
commit | 80cb5f3d97aa22ce3aac2737da03d4679722c60f (patch) | |
tree | fdad7411a547db3e693f2e869fbd577163c62e15 /drivers/net/ethernet/hisilicon | |
parent | 3e1a8f10a1375133ea4a943f21138f00b4d06dc2 (diff) | |
download | linux-80cb5f3d97aa22ce3aac2737da03d4679722c60f.tar.bz2 |
net: hns3: add support for set_link_ksettings
This patch adds set_link_ksettings support for ethtool cmd.
Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Lipeng <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon')
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c index c7b8ebd14f33..7fe193b1ccaf 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 const struct ethtool_ops hns3_ethtool_ops = { .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) |