Commit c040366b authored by Fuyun Liang's avatar Fuyun Liang Committed by David S. Miller

net: hns3: cleanup mac auto-negotiation state query in hclge_update_speed_duplex

When checking whether auto-negotiation is on, driver only needs to
check the value of mac.autoneg(SW) directly, and does not need to
query it from hardware. Because this value is always synchronized
with the auto-negotiation state of hardware.

This patch removes mac auto-negotiation state query in
hclge_update_speed_duplex().

Fixes: 46a3df9f (net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support)
Signed-off-by: default avatarFuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: default avatarLipeng <lipeng321@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 39e2151f
...@@ -2325,18 +2325,7 @@ static int hclge_update_speed_duplex(struct hclge_dev *hdev) ...@@ -2325,18 +2325,7 @@ static int hclge_update_speed_duplex(struct hclge_dev *hdev)
/* get the speed and duplex as autoneg'result from mac cmd when phy /* get the speed and duplex as autoneg'result from mac cmd when phy
* doesn't exit. * doesn't exit.
*/ */
if (mac.phydev) if (mac.phydev || !mac.autoneg)
return 0;
/* update mac->antoneg. */
ret = hclge_query_autoneg_result(hdev);
if (ret) {
dev_err(&hdev->pdev->dev,
"autoneg result query failed %d\n", ret);
return ret;
}
if (!mac.autoneg)
return 0; return 0;
ret = hclge_query_mac_an_speed_dup(hdev, &speed, &duplex); ret = hclge_query_mac_an_speed_dup(hdev, &speed, &duplex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment