Skip to content

Commit

Permalink
net: hns3: disable auto-negotiation off with 1000M setting in ethtool
Browse files Browse the repository at this point in the history
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: Yufeng Mo <moyufeng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Yufeng Mo authored and Jakub Kicinski committed May 11, 2020
1 parent b4401a0 commit 81c287e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -773,8 +773,13 @@ static int hns3_set_link_ksettings(struct net_device *netdev,
cmd->base.autoneg, cmd->base.speed, 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;
Expand Down

0 comments on commit 81c287e

Please sign in to comment.