提交 0c963e8c 编写于 作者: F Fuyun Liang 提交者: David S. Miller

net: hns3: Fix to support autoneg only for port attached with phy

This patch adds a check to support autoneg(ethtool -A) only when PHY
is attached with the port.

Fixes: e2cb1dec ("net: hns3: Add HNS3 VF HCL(Hardware Compatibility
Layer) Support")
Signed-off-by: NFuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: NPeng Li <lipeng321@huawei.com>
Signed-off-by: NSalil Mehta <salil.mehta@huawei.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 c5ef83cb
...@@ -5169,12 +5169,6 @@ static int hclge_set_pauseparam(struct hnae3_handle *handle, u32 auto_neg, ...@@ -5169,12 +5169,6 @@ static int hclge_set_pauseparam(struct hnae3_handle *handle, u32 auto_neg,
struct phy_device *phydev = hdev->hw.mac.phydev; struct phy_device *phydev = hdev->hw.mac.phydev;
u32 fc_autoneg; u32 fc_autoneg;
/* Only support flow control negotiation for netdev with
* phy attached for now.
*/
if (!phydev)
return -EOPNOTSUPP;
fc_autoneg = hclge_get_autoneg(handle); fc_autoneg = hclge_get_autoneg(handle);
if (auto_neg != fc_autoneg) { if (auto_neg != fc_autoneg) {
dev_info(&hdev->pdev->dev, dev_info(&hdev->pdev->dev,
...@@ -5193,6 +5187,12 @@ static int hclge_set_pauseparam(struct hnae3_handle *handle, u32 auto_neg, ...@@ -5193,6 +5187,12 @@ static int hclge_set_pauseparam(struct hnae3_handle *handle, u32 auto_neg,
if (!fc_autoneg) if (!fc_autoneg)
return hclge_cfg_pauseparam(hdev, rx_en, tx_en); return hclge_cfg_pauseparam(hdev, rx_en, tx_en);
/* Only support flow control negotiation for netdev with
* phy attached for now.
*/
if (!phydev)
return -EOPNOTSUPP;
return phy_start_aneg(phydev); return phy_start_aneg(phydev);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册