Skip to content

Commit 0c963e8

Browse files
hwlfydavem330
authored andcommitted
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: e2cb1de ("net: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support") Signed-off-by: Fuyun Liang <[email protected]> Signed-off-by: Peng Li <[email protected]> Signed-off-by: Salil Mehta <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c5ef83c commit 0c963e8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5169,12 +5169,6 @@ static int hclge_set_pauseparam(struct hnae3_handle *handle, u32 auto_neg,
51695169
struct phy_device *phydev = hdev->hw.mac.phydev;
51705170
u32 fc_autoneg;
51715171

5172-
/* Only support flow control negotiation for netdev with
5173-
* phy attached for now.
5174-
*/
5175-
if (!phydev)
5176-
return -EOPNOTSUPP;
5177-
51785172
fc_autoneg = hclge_get_autoneg(handle);
51795173
if (auto_neg != fc_autoneg) {
51805174
dev_info(&hdev->pdev->dev,
@@ -5193,6 +5187,12 @@ static int hclge_set_pauseparam(struct hnae3_handle *handle, u32 auto_neg,
51935187
if (!fc_autoneg)
51945188
return hclge_cfg_pauseparam(hdev, rx_en, tx_en);
51955189

5190+
/* Only support flow control negotiation for netdev with
5191+
* phy attached for now.
5192+
*/
5193+
if (!phydev)
5194+
return -EOPNOTSUPP;
5195+
51965196
return phy_start_aneg(phydev);
51975197
}
51985198

0 commit comments

Comments
 (0)