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>
openwrt-19.07
Rafał Miłecki 2019-04-04 11:31:28 +02:00
parent ebed4b6dd0
commit 8dacd75ea8
1 changed files with 10 additions and 0 deletions

View File

@ -294,12 +294,22 @@ static int b53_phy_probe(struct phy_device *phydev)
if (ret) if (ret)
return 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)) if (is5325(dev) || is5365(dev))
phydev->supported = SUPPORTED_100baseT_Full; phydev->supported = SUPPORTED_100baseT_Full;
else else
phydev->supported = SUPPORTED_1000baseT_Full; phydev->supported = SUPPORTED_1000baseT_Full;
phydev->advertising = phydev->supported; phydev->advertising = phydev->supported;
#endif
ret = b53_switch_register(dev); ret = b53_switch_register(dev);
if (ret) { if (ret) {