aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2019-04-04 11:31:28 +0200
committerRafał Miłecki <rafal@milecki.pl>2019-04-04 11:35:53 +0200
commit8dacd75ea8869b0616b6be1a2156dc5e8c9eac9e (patch)
treeea1119bb2f8080c4240bc2ede07e8921ac0a0af4 /target/linux/generic
parentebed4b6dd066499d99089c4fb09cf8fddd199045 (diff)
downloadupstream-8dacd75ea8869b0616b6be1a2156dc5e8c9eac9e.tar.gz
upstream-8dacd75ea8869b0616b6be1a2156dc5e8c9eac9e.tar.bz2
upstream-8dacd75ea8869b0616b6be1a2156dc5e8c9eac9e.zip
kernel: b53: add support for kernels 5.0+
It adjusts b53 code to upstream changes from the commit 3c1bcc8614db ("net: ethernet: Convert phydev advertize and supported from u32 to link mode"). Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'target/linux/generic')
-rw-r--r--target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c b/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c
index 5934befc9e..6de8623612 100644
--- a/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c
+++ b/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c
@@ -294,12 +294,22 @@ static int b53_phy_probe(struct phy_device *phydev)
if (ret)
return ret;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)
+ linkmode_zero(phydev->supported);
+ if (is5325(dev) || is5365(dev))
+ linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT, phydev->supported);
+ else
+ linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, phydev->supported);
+
+ linkmode_copy(phydev->advertising, phydev->supported);
+#else
if (is5325(dev) || is5365(dev))
phydev->supported = SUPPORTED_100baseT_Full;
else
phydev->supported = SUPPORTED_1000baseT_Full;
phydev->advertising = phydev->supported;
+#endif
ret = b53_switch_register(dev);
if (ret) {