Comments (4)
Same for CentOS 7 3.10.0-1160.25.1.el7.x86_64
from r8168.
same for CentOS Linux release 7.2.1511 (Core) 3.10.0-327.28.3.el7.x86_64
from r8168.
This patch works for el7 at least version 3.10.0-1127.19.1.el7.x86_64 .
Note that the patch is a hackjob, just commented lines and #if 0 &&
so clean it up if you intend to pull this patch into the repo.
Thanks!
diff --git a/autorun.sh b/autorun.sh
index 2c8ce76..ea7639b 100755
--- a/autorun.sh
+++ b/autorun.sh
@@ -4,12 +4,20 @@
# invoke insmod with all arguments we got
# and use a pathname, as insmod doesn't look in . by default
-TARGET_PATH=$(find /lib/modules/$(uname -r)/kernel/drivers/net/ethernet -name realtek -type d)
+KVER=$1
+
+if [ -n "$KVER" ]; then
+ shift;
+else
+ KVER=`uname -r`
+fi
+
+TARGET_PATH=$(find /lib/modules/$(echo $KVER)/kernel/drivers/net/ethernet -name realtek -type d)
if [ "$TARGET_PATH" = "" ]; then
- TARGET_PATH=$(find /lib/modules/$(uname -r)/kernel/drivers/net -name realtek -type d)
+ TARGET_PATH=$(find /lib/modules/$(echo $KVER)/kernel/drivers/net -name realtek -type d)
fi
if [ "$TARGET_PATH" = "" ]; then
- TARGET_PATH=/lib/modules/$(uname -r)/kernel/drivers/net
+ TARGET_PATH=/lib/modules/$(echo $KVER)/kernel/drivers/net
fi
echo
echo "Check old driver and unload it."
@@ -54,8 +62,8 @@ elif [ "$module" != "r8169" ]; then
fi
fi
-echo "DEPMOD $(uname -r)"
-depmod `uname -r`
+echo "DEPMOD $(echo $KVER)"
+depmod `echo $KVER`
echo "load module $module"
modprobe $module
@@ -75,7 +83,7 @@ fi
if [ "$is_update_initramfs" = "y" ]; then
if which update-initramfs >/dev/null ; then
echo "Updating initramfs. Please wait."
- update-initramfs -u -k $(uname -r)
+ update-initramfs -u -k $(echo $KVER)
else
echo "update-initramfs: command not found"
exit 1
diff --git a/src/r8168.h b/src/r8168.h
index be467a5..531d664 100755
--- a/src/r8168.h
+++ b/src/r8168.h
@@ -49,7 +49,7 @@ typedef int netdev_tx_t;
#define device_set_wakeup_enable(dev, val) do {} while (0)
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0)
+#if 0 && LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0)
static inline void ether_addr_copy(u8 *dst, const u8 *src)
0 [root@geekdesk:r8168]# git diff|cat
diff --git a/autorun.sh b/autorun.sh
index 2c8ce76..ea7639b 100755
--- a/autorun.sh
+++ b/autorun.sh
@@ -4,12 +4,20 @@
# invoke insmod with all arguments we got
# and use a pathname, as insmod doesn't look in . by default
-TARGET_PATH=$(find /lib/modules/$(uname -r)/kernel/drivers/net/ethernet -name realtek -type d)
+KVER=$1
+
+if [ -n "$KVER" ]; then
+ shift;
+else
+ KVER=`uname -r`
+fi
+
+TARGET_PATH=$(find /lib/modules/$(echo $KVER)/kernel/drivers/net/ethernet -name realtek -type d)
if [ "$TARGET_PATH" = "" ]; then
- TARGET_PATH=$(find /lib/modules/$(uname -r)/kernel/drivers/net -name realtek -type d)
+ TARGET_PATH=$(find /lib/modules/$(echo $KVER)/kernel/drivers/net -name realtek -type d)
fi
if [ "$TARGET_PATH" = "" ]; then
- TARGET_PATH=/lib/modules/$(uname -r)/kernel/drivers/net
+ TARGET_PATH=/lib/modules/$(echo $KVER)/kernel/drivers/net
fi
echo
echo "Check old driver and unload it."
@@ -54,8 +62,8 @@ elif [ "$module" != "r8169" ]; then
fi
fi
-echo "DEPMOD $(uname -r)"
-depmod `uname -r`
+echo "DEPMOD $(echo $KVER)"
+depmod `echo $KVER`
echo "load module $module"
modprobe $module
@@ -75,7 +83,7 @@ fi
if [ "$is_update_initramfs" = "y" ]; then
if which update-initramfs >/dev/null ; then
echo "Updating initramfs. Please wait."
- update-initramfs -u -k $(uname -r)
+ update-initramfs -u -k $(echo $KVER)
else
echo "update-initramfs: command not found"
exit 1
diff --git a/src/r8168.h b/src/r8168.h
index be467a5..531d664 100755
--- a/src/r8168.h
+++ b/src/r8168.h
@@ -49,7 +49,7 @@ typedef int netdev_tx_t;
#define device_set_wakeup_enable(dev, val) do {} while (0)
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0)
+#if 0 && LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0)
static inline void ether_addr_copy(u8 *dst, const u8 *src)
{
u16 *a = (u16 *)dst;
diff --git a/src/r8168_n.c b/src/r8168_n.c
index a44352f..c2cc0f3 100755
--- a/src/r8168_n.c
+++ b/src/r8168_n.c
@@ -25459,7 +25459,7 @@ static const struct net_device_ops rtl8168_netdev_ops = {
.ndo_get_stats = rtl8168_get_stats,
.ndo_start_xmit = rtl8168_start_xmit,
.ndo_tx_timeout = rtl8168_tx_timeout,
- .ndo_change_mtu = rtl8168_change_mtu,
+ //.ndo_change_mtu = rtl8168_change_mtu,
.ndo_set_mac_address = rtl8168_set_mac_address,
.ndo_do_ioctl = rtl8168_do_ioctl,
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)
@@ -28154,7 +28154,7 @@ process_pkt:
if (rtl8168_rx_vlan_skb(tp, desc, skb) < 0)
rtl8168_rx_skb(tp, skb);
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0)
- dev->last_rx = jiffies;
+ //dev->last_rx = jiffies;
#endif //LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0)
RTLDEV->stats.rx_bytes += pkt_size;
RTLDEV->stats.rx_packets++;
from r8168.
Oh yah, and I hacked autogen to take kernel version as $1, so optional
from r8168.
Related Issues (20)
- Same issue like with kernel's 8169 since last update
- new version 9.006.04 2021/08/19 seem to be out HOT 2
- Dell G3 with ubuntu 18.04 gets 100Mbps only
- Specify the license
- Kernel-5.17rc HOT 7
- [PATCH] Add support for building against an arbitrary kernel version
- Extra patch for K5.18x HOT 4
- how to ENABLE_FIBER_SUPPORT
- Error! Bad return status for module build on kernel: 5.18.0-zen1-1-zen (x86_64) HOT 2
- Kernel-5.19-rc1 patch HOT 7
- Additional patch for K6.1-rc HOT 1
- r8168 5.10.0-20-amd64 Debian KDE UI freezes and journal: eno1: esd_flag = 0x7bff ; eno1: cmd = 0xff, should be 0x07
- Fix for PopOS latest kernel 6.1.11 compile failure HOT 1
- create community branch HOT 1
- How to support pause frame and jumbo frame >1500 HOT 1
- AlmaLinux 9 Error
- Additional patch for K6.4.y+ HOT 1
- netlink error: link settings update failed netlink error: Invalid argument
- New version 8.053.00 HOT 1
- Linux 6.9 compat: initialization of βint (*)(struct net_device *, struct ethtool_keee *)β from incompatible pointer type βint (*)(struct net_device *, struct ethtool_eee *) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from r8168.