ed29dcd3e61ef1a73e751ed92816040a61e8920e
[openwrt/staging/wigyori.git] /
1 From 2d9ce64862705b33397d54dafecc5f51d8b1bb06 Mon Sep 17 00:00:00 2001
2 From: Eric Woudstra <ericwouds@gmail.com>
3 Date: Tue, 9 Apr 2024 09:30:15 +0200
4 Subject: [PATCH] net: phy: realtek: add rtl822x_c45_get_features() to set
5 supported port
6
7 Sets ETHTOOL_LINK_MODE_TP_BIT in phydev->supported.
8
9 Signed-off-by: Eric Woudstra <ericwouds@gmail.com>
10 Reviewed-by: Andrew Lunn <andrew@lunn.ch>
11 Signed-off-by: David S. Miller <davem@davemloft.net>
12 ---
13 drivers/net/phy/realtek.c | 10 ++++++++++
14 1 file changed, 10 insertions(+)
15
16 --- a/drivers/net/phy/realtek.c
17 +++ b/drivers/net/phy/realtek.c
18 @@ -843,6 +843,14 @@ static int rtl822xb_read_status(struct p
19 return 0;
20 }
21
22 +static int rtl822x_c45_get_features(struct phy_device *phydev)
23 +{
24 + linkmode_set_bit(ETHTOOL_LINK_MODE_TP_BIT,
25 + phydev->supported);
26 +
27 + return genphy_c45_pma_read_abilities(phydev);
28 +}
29 +
30 static int rtl822x_c45_config_aneg(struct phy_device *phydev)
31 {
32 bool changed = false;
33 @@ -1272,6 +1280,7 @@ static struct phy_driver realtek_drvs[]
34 .name = "RTL8221B-VB-CG 2.5Gbps PHY (C45)",
35 .config_init = rtl822xb_config_init,
36 .get_rate_matching = rtl822xb_get_rate_matching,
37 + .get_features = rtl822x_c45_get_features,
38 .config_aneg = rtl822x_c45_config_aneg,
39 .read_status = rtl822xb_c45_read_status,
40 .suspend = genphy_c45_pma_suspend,
41 @@ -1293,6 +1302,7 @@ static struct phy_driver realtek_drvs[]
42 .name = "RTL8221B-VN-CG 2.5Gbps PHY (C45)",
43 .config_init = rtl822xb_config_init,
44 .get_rate_matching = rtl822xb_get_rate_matching,
45 + .get_features = rtl822x_c45_get_features,
46 .config_aneg = rtl822x_c45_config_aneg,
47 .read_status = rtl822xb_c45_read_status,
48 .suspend = genphy_c45_pma_suspend,