Skip to content

Commit

Permalink
net: hns3: add support for set_link_ksettings
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Fuyun Liang authored and David S. Miller committed Nov 3, 2017
1 parent 3e1a8f1 commit 80cb5f3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 80cb5f3

Please sign in to comment.