Skip to content

Commit 439adf8

Browse files
hwlfydavem330
authored andcommitted
net: hns3: fix a bug for phy supported feature initialization
This patch fixes a bug for phy supported feature initialization. Currently, the value of phydev->supported is initialized by kernel. So it includes many features that we do not support, such as SUPPORTED_FIBRE and SUPPORTED_BNC. This patch fixes it. Fixes: 256727d (net: hns3: Add MDIO support to HNS3 Ethernet driver for hip08 SoC) Signed-off-by: Fuyun Liang <[email protected]> Signed-off-by: Lipeng <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d63671d commit 439adf8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
#include "hclge_main.h"
1515
#include "hclge_mdio.h"
1616

17+
#define HCLGE_PHY_SUPPORTED_FEATURES (SUPPORTED_Autoneg | \
18+
SUPPORTED_TP | \
19+
SUPPORTED_Pause | \
20+
PHY_10BT_FEATURES | \
21+
PHY_100BT_FEATURES | \
22+
PHY_1000BT_FEATURES)
23+
1724
enum hclge_mdio_c22_op_seq {
1825
HCLGE_MDIO_C22_WRITE = 1,
1926
HCLGE_MDIO_C22_READ = 2
@@ -195,6 +202,9 @@ int hclge_mac_start_phy(struct hclge_dev *hdev)
195202
return ret;
196203
}
197204

205+
phydev->supported &= HCLGE_PHY_SUPPORTED_FEATURES;
206+
phydev->advertising = phydev->supported;
207+
198208
phy_start(phydev);
199209

200210
return 0;

0 commit comments

Comments
 (0)