aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic
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
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')
-rw-r--r--target/linux/generic/files/drivers/net/phy/adm6996.c7
-rw-r--r--target/linux/generic/files/drivers/net/phy/mvswitch.c7
-rw-r--r--target/linux/generic/files/drivers/net/phy/psb6970.c7
3 files changed, 21 insertions, 0 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/adm6996.c b/target/linux/generic/files/drivers/net/phy/adm6996.c
index 42928bab07..cce95f563b 100644
--- a/target/linux/generic/files/drivers/net/phy/adm6996.c
+++ b/target/linux/generic/files/drivers/net/phy/adm6996.c
@@ -37,6 +37,7 @@
#include <linux/ethtool.h>
#include <linux/phy.h>
#include <linux/switch.h>
+#include <linux/version.h>
#include <asm/io.h>
#include <asm/irq.h>
@@ -1047,8 +1048,14 @@ static int adm6996_config_init(struct phy_device *pdev)
struct adm6996_priv *priv;
int ret;
+#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
if (pdev->mdio.addr != 0) {
pr_info ("%s: PHY overlaps ADM6996, providing fixed PHY 0x%x.\n"
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
diff --git a/target/linux/generic/files/drivers/net/phy/psb6970.c b/target/linux/generic/files/drivers/net/phy/psb6970.c
index c1a381c052..97fb62ace2 100644
--- a/target/linux/generic/files/drivers/net/phy/psb6970.c
+++ b/target/linux/generic/files/drivers/net/phy/psb6970.c
@@ -16,6 +16,7 @@
#include <linux/netdevice.h>
#include <linux/switch.h>
#include <linux/phy.h>
+#include <linux/version.h>
#define PSB6970_MAX_VLANS 16
#define PSB6970_NUM_PORTS 7
@@ -325,7 +326,13 @@ static int psb6970_config_init(struct phy_device *pdev)
return 0;
}
+#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 = pdev->advertising = SUPPORTED_100baseT_Full;
+#endif
mutex_init(&priv->reg_mutex);
priv->read = psb6970_mii_read;