Coder Social home page Coder Social logo

Comments (4)

sruckh avatar sruckh commented on September 4, 2024

Same for CentOS 7 3.10.0-1160.25.1.el7.x86_64

from r8168.

WassimDhib avatar WassimDhib commented on September 4, 2024

same for CentOS Linux release 7.2.1511 (Core) 3.10.0-327.28.3.el7.x86_64

from r8168.

KJ7LNW avatar KJ7LNW commented on September 4, 2024

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.

KJ7LNW avatar KJ7LNW commented on September 4, 2024

Oh yah, and I hacked autogen to take kernel version as $1, so optional

from r8168.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.