mirror of
https://github.com/void-linux/void-packages.git
synced 2025-10-17 07:55:24 +02:00
72 lines
3.4 KiB
Diff
72 lines
3.4 KiB
Diff
From ffc1396e3e550960da9944488e173bd0049b4825 Mon Sep 17 00:00:00 2001
|
|
From: vboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f>
|
|
Date: Fri, 23 Nov 2018 11:17:22 +0000
|
|
Subject: [PATCH] NetAdp: Linux 4.20 compatibility fix (bugref:4567) In struct
|
|
ethtool_ops, the get_settings member is renamed get_link_ksettings. Inspired
|
|
by Larry Finger's patch. Thank you Larry Finger
|
|
|
|
git-svn-id: http://www.virtualbox.org/svn/vbox@75684 cfe28804-0f27-0410-a406-dd0f0b0b656f
|
|
---
|
|
.../VBoxNetAdp/linux/VBoxNetAdp-linux.c | 26 +++++++++++++++++++
|
|
1 file changed, 26 insertions(+)
|
|
|
|
diff --git a/trunk/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c b/trunk/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c
|
|
index 881103a12f..16d8996623 100644
|
|
--- src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c
|
|
+++ src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c
|
|
@@ -84,7 +84,11 @@ static long VBoxNetAdpLinuxIOCtlUnlocked(struct file *pFilp,
|
|
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36) */
|
|
|
|
static void vboxNetAdpEthGetDrvinfo(struct net_device *dev, struct ethtool_drvinfo *info);
|
|
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)
|
|
+static int vboxNetAdpEthGetLinkSettings(struct net_device *pNetDev, struct ethtool_link_ksettings *pLinkSettings);
|
|
+#else /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0) */
|
|
static int vboxNetAdpEthGetSettings(struct net_device *dev, struct ethtool_cmd *cmd);
|
|
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0) */
|
|
|
|
|
|
/*********************************************************************************************************************************
|
|
@@ -133,7 +137,11 @@ static struct ethtool_ops gEthToolOpsVBoxNetAdp =
|
|
# endif
|
|
{
|
|
.get_drvinfo = vboxNetAdpEthGetDrvinfo,
|
|
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)
|
|
+ .get_link_ksettings = vboxNetAdpEthGetLinkSettings,
|
|
+# else /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0) */
|
|
.get_settings = vboxNetAdpEthGetSettings,
|
|
+# endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0) */
|
|
.get_link = ethtool_op_get_link,
|
|
};
|
|
|
|
@@ -205,6 +213,23 @@ static void vboxNetAdpEthGetDrvinfo(struct net_device *pNetDev, struct ethtool_d
|
|
}
|
|
|
|
|
|
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)
|
|
+/* ethtool_ops::get_link_ksettings */
|
|
+static int vboxNetAdpEthGetLinkSettings(struct net_device *pNetDev, struct ethtool_link_ksettings *pLinkSettings)
|
|
+{
|
|
+ /* We just need to set field we care for, the rest is done by ethtool_get_link_ksettings() helper in ethtool. */
|
|
+ ethtool_link_ksettings_zero_link_mode(pLinkSettings, supported);
|
|
+ ethtool_link_ksettings_zero_link_mode(pLinkSettings, advertising);
|
|
+ ethtool_link_ksettings_zero_link_mode(pLinkSettings, lp_advertising);
|
|
+ pLinkSettings->base.speed = SPEED_10;
|
|
+ pLinkSettings->base.duplex = DUPLEX_FULL;
|
|
+ pLinkSettings->base.port = PORT_TP;
|
|
+ pLinkSettings->base.phy_address = 0;
|
|
+ pLinkSettings->base.transceiver = XCVR_INTERNAL;
|
|
+ pLinkSettings->base.autoneg = AUTONEG_DISABLE;
|
|
+ return 0;
|
|
+}
|
|
+#else /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0) */
|
|
/* ethtool_ops::get_settings */
|
|
static int vboxNetAdpEthGetSettings(struct net_device *pNetDev, struct ethtool_cmd *cmd)
|
|
{
|
|
@@ -224,6 +249,7 @@ static int vboxNetAdpEthGetSettings(struct net_device *pNetDev, struct ethtool_c
|
|
cmd->maxrxpkt = 0;
|
|
return 0;
|
|
}
|
|
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0) */
|
|
|
|
|
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
|