kernel: bump 5.4 to 5.4.80
[openwrt/openwrt.git] / target / linux / rtl838x / patches-5.4 / 704-drivers-net-phy-eee-support-for-rtl838x.patch
1 --- a/drivers/net/phy/phylink.c
2 +++ b/drivers/net/phy/phylink.c
3 @@ -1242,6 +1242,11 @@ int phylink_ethtool_ksettings_set(struct
4
5 /* If we have a PHY, configure the phy */
6 if (pl->phydev) {
7 + if (pl->phydev->drv->get_port && pl->phydev->drv->set_port) {
8 + if(pl->phydev->drv->get_port(pl->phydev) != kset->base.port) {
9 + pl->phydev->drv->set_port(pl->phydev, kset->base.port);
10 + }
11 + }
12 ret = phy_ethtool_ksettings_set(pl->phydev, &our_kset);
13 if (ret)
14 return ret;
15 @@ -1420,8 +1425,11 @@ int phylink_ethtool_get_eee(struct phyli
16
17 ASSERT_RTNL();
18
19 - if (pl->phydev)
20 + if (pl->phydev) {
21 + if (pl->phydev->drv->get_eee)
22 + return pl->phydev->drv->get_eee(pl->phydev, eee);
23 ret = phy_ethtool_get_eee(pl->phydev, eee);
24 + }
25
26 return ret;
27 }
28 @@ -1438,9 +1446,11 @@ int phylink_ethtool_set_eee(struct phyli
29
30 ASSERT_RTNL();
31
32 - if (pl->phydev)
33 + if (pl->phydev) {
34 + if (pl->phydev->drv->set_eee)
35 + return pl->phydev->drv->set_eee(pl->phydev, eee);
36 ret = phy_ethtool_set_eee(pl->phydev, eee);
37 -
38 + }
39 return ret;
40 }
41 EXPORT_SYMBOL_GPL(phylink_ethtool_set_eee);