net: hns: bug fix of ethtool show the speed
authorDaode Huang <huangdaode@hisilicon.com>
Sat, 1 Apr 2017 11:03:35 +0000 (12:03 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Apr 2017 21:48:43 +0000 (14:48 -0700)
When run ethtool ethX on hns driver, the speed will show
as "Unknown". The base.speed is not correct assigned,
this patch fix this bug.

Signed-off-by: Daode Huang <huangdaode@hisilicon.com>
Reviewed-by: Yisen Zhuang <yisen.zhuang@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns/hns_ethtool.c

index 3ac2183dbd2119e0746d35510fcfc1e390ab6d9b..3404eacaed7f9cff0a7128cb7580edc0ea8cf6e8 100644 (file)
@@ -146,7 +146,7 @@ static int hns_nic_get_link_ksettings(struct net_device *net_dev,
 
        /* When there is no phy, autoneg is off. */
        cmd->base.autoneg = false;
-       cmd->base.cmd = speed;
+       cmd->base.speed = speed;
        cmd->base.duplex = duplex;
 
        if (net_dev->phydev)