提交 95dbab9f 编写于 作者: P Peng Li 提交者: David S. Miller

net: hns3: check 1000M half for hns3_ethtool_ops.set_link_ksettings

Hip08 SOC does not support 1000M half, this patch adds 1000M half
check for hns3_ethtool_ops.set_link_ksettings, so the user can not
set 1000M half by ethtool.
Signed-off-by: NPeng Li <lipeng321@huawei.com>
Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 b571bc62
......@@ -648,6 +648,10 @@ static int hns3_get_link_ksettings(struct net_device *netdev,
static int hns3_set_link_ksettings(struct net_device *netdev,
const struct ethtool_link_ksettings *cmd)
{
/* Chip doesn't support this mode. */
if (cmd->base.speed == SPEED_1000 && cmd->base.duplex == DUPLEX_HALF)
return -EINVAL;
/* Only support ksettings_set for netdev with phy attached for now */
if (netdev->phydev)
return phy_ethtool_ksettings_set(netdev->phydev, cmd);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册