aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/files/drivers/net/phy/mvswitch.c
diff options
context:
space:
mode:
authorMathias Kresin <dev@kresin.me>2019-07-07 11:15:05 +0200
committerMathias Kresin <dev@kresin.me>2020-03-16 22:28:16 +0100
commit095598ce00e8ac8fe29f9b60e8d23327418fe5be (patch)
tree99785ff85191f4cb1a950bf3b526eaff959b7149 /target/linux/generic/files/drivers/net/phy/mvswitch.c
parent0270b1995bd3396177dfd17e3ef57efa71e845dc (diff)
downloadupstream-095598ce00e8ac8fe29f9b60e8d23327418fe5be.tar.gz
upstream-095598ce00e8ac8fe29f9b60e8d23327418fe5be.tar.bz2
upstream-095598ce00e8ac8fe29f9b60e8d23327418fe5be.zip
generic: make all phy drivers kernel 5.0 compatible
It adjusts the code to upstream changes from the commit 3c1bcc8614db ("net: ethernet: Convert phydev advertize and supported from u32 to link mode") Signed-off-by: Mathias Kresin <dev@kresin.me>
Diffstat (limited to 'target/linux/generic/files/drivers/net/phy/mvswitch.c')
-rw-r--r--target/linux/generic/files/drivers/net/phy/mvswitch.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/mvswitch.c b/target/linux/generic/files/drivers/net/phy/mvswitch.c
index 043978feb9..50a73e2f33 100644
--- a/target/linux/generic/files/drivers/net/phy/mvswitch.c
+++ b/target/linux/generic/files/drivers/net/phy/mvswitch.c
@@ -24,6 +24,7 @@
#include <linux/ethtool.h>
#include <linux/phy.h>
#include <linux/if_vlan.h>
+#include <linux/version.h>
#include <asm/io.h>
#include <asm/irq.h>
@@ -207,8 +208,14 @@ mvswitch_config_init(struct phy_device *pdev)
return -EINVAL;
printk("%s: Marvell 88E6060 PHY driver attached.\n", dev->name);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)
+ linkmode_zero(pdev->supported);
+ linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT, pdev->supported);
+ linkmode_copy(pdev->advertising, pdev->supported);
+#else
pdev->supported = ADVERTISED_100baseT_Full;
pdev->advertising = ADVERTISED_100baseT_Full;
+#endif
dev->phy_ptr = priv;
pdev->irq = PHY_POLL;
#ifdef HEADER_MODE