提交 0132dd23 编写于 作者: S shenhao 提交者: Yang Yingliang

net: hns3: disable auto-negotiation off with 1000M setting in ethtool

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

--------------------------------------------

The 802.3 specification does not specify the behavior of
auto-negotiation off with 1000M in phy. Therefore, some phy
compatibility issues occur. This patch forbids the setting of
this unreasonable mode by ethtool in driver.
Signed-off-by: NYufeng Mo <moyufeng@huawei.com>
Signed-off-by: Nshenhao <shenhao21@huawei.com>
Reviewed-by: NZhong Zhaohui <zhongzhaohui@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 7af710de
......@@ -776,8 +776,13 @@ static int hns3_set_link_ksettings(struct net_device *netdev,
cmd->base.duplex);
/* Only support ksettings_set for netdev with phy attached for now */
if (netdev->phydev)
if (netdev->phydev) {
if (cmd->base.speed == SPEED_1000 &&
cmd->base.autoneg == AUTONEG_DISABLE)
return -EINVAL;
return phy_ethtool_ksettings_set(netdev->phydev, cmd);
}
if (handle->pdev->revision == 0x20)
return -EOPNOTSUPP;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册