Update r8168-dkms

This commit is contained in:
Andrey Rodionov 2020-04-06 23:58:10 +03:00
parent 20799754ff
commit 31f6708c67
5 changed files with 92 additions and 35 deletions

View file

@ -1,8 +1,8 @@
pkgbase = r8168-dkms
pkgdesc = A kernel module for Realtek 8168 network cards
pkgver = 8.047.05
pkgdesc = A kernel module for Realtek 8168 network cards (DKMS version)
pkgver = 8.048.02
pkgrel = 2
url = https://github.com/mtorromeo/r8168
url = https://github.com/simonbcn/r8168-dkms
install = r8168-dkms.install
arch = i686
arch = x86_64
@ -12,13 +12,11 @@ pkgbase = r8168-dkms
optdepends = linux-headers: Needed for build the module for Arch kernel
optdepends = linux-lts-headers: Needed for build the module for LTS Arch kernel
optdepends = linux-zen-headers: Needed for build the module for ZEN Arch kernel
conflicts = r8168
source = https://github.com/mtorromeo/r8168/archive/8.047.05/r8168-dkms-8.047.05.tar.gz
conflicts = r8168-dkms
source = https://github.com/simonbcn/r8168-dkms/archive/8.048.02/r8168-dkms-8.048.02.tar.gz
source = dkms.conf
source = kernel-5.4.patch
sha256sums = 1344bf3d8a1d01a1be8805b48940be1b946b5e694ca75bd14ed1c76fd4c3d67b
sha256sums = e1457d11651a25eefd8042afdfdd0380d29b37add5ca680a1ce067447295c76e
sha256sums = e33abcbc8fbe3129459ebc60be3b2f8ed55ddc53755f4956d6feb16c61c43250
sha256sums = be79c151c6323bb4d340e31e44fae25a36a93d317812fe5d75c54649ed2508b0
pkgname = r8168-dkms

View file

@ -0,0 +1,71 @@
diff --git a/src/r8168_n.c b/src/r8168_n.c
index 0df6041..557823e 100755
--- a/src/r8168_n.c
+++ b/src/r8168_n.c
@@ -456,7 +456,11 @@ static void rtl8168_hw_config(struct net_device *dev);
static void rtl8168_hw_start(struct net_device *dev);
static int rtl8168_close(struct net_device *dev);
static void rtl8168_set_rx_mode(struct net_device *dev);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
+static void rtl8168_tx_timeout(struct net_device *dev, unsigned int new_mtu);
+#else
static void rtl8168_tx_timeout(struct net_device *dev);
+#endif
static struct net_device_stats *rtl8168_get_stats(struct net_device *dev);
static int rtl8168_rx_interrupt(struct net_device *, struct rtl8168_private *, napi_budget);
static int rtl8168_change_mtu(struct net_device *dev, int new_mtu);
@@ -1615,7 +1619,14 @@ static int rtl8168_proc_open(struct inode *inode, struct file *file)
return single_open(file, show, dev);
}
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
+static const struct proc_ops rtl8168_proc_ops = {
+ .proc_open = rtl8168_proc_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = single_release,
+};
+#else
static const struct file_operations rtl8168_proc_fops = {
.open = rtl8168_proc_open,
.read = seq_read,
@@ -1623,6 +1634,7 @@ static const struct file_operations rtl8168_proc_fops = {
.release = single_release,
};
#endif
+#endif
/*
* Table of proc files we need to create.
@@ -1665,9 +1677,15 @@ static void rtl8168_proc_init(struct net_device *dev)
tp->proc_dir = dir;
proc_init_num++;
- for (f = rtl8168_proc_files; f->name[0]; f++) {
- if (!proc_create_data(f->name, S_IFREG | S_IRUGO, dir,
- &rtl8168_proc_fops, f->show)) {
+ for (f = rtl8168_proc_files; f->name[0]; f++) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
+ if (!proc_create_data(f->name, S_IFREG | S_IRUGO, dir,
+ &rtl8168_proc_ops, f->show))
+#else
+ if (!proc_create_data(f->name, S_IFREG | S_IRUGO, dir,
+ &rtl8168_proc_fops, f->show))
+#endif
+ {
printk("Unable to initialize "
"/proc/net/%s/%s/%s\n",
MODULENAME, dev->name, f->name);
@@ -27844,7 +27861,11 @@ static void rtl8168_reset_task(struct work_struct *work)
}
static void
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
+rtl8168_tx_timeout(struct net_device *dev, unsigned int txqueue)
+#else
rtl8168_tx_timeout(struct net_device *dev)
+#endif
{
struct rtl8168_private *tp = netdev_priv(dev);
unsigned long flags;

View file

@ -3,39 +3,39 @@
# Contributor: angelsl
_pkgbase=r8168
pkgname=${_pkgbase}-dkms
pkgver=8.047.05
pkgver=8.048.02
pkgrel=2
pkgdesc="A kernel module for Realtek 8168 network cards"
url="https://github.com/mtorromeo/r8168"
pkgdesc="A kernel module for Realtek 8168 network cards (DKMS version)"
url="https://github.com/simonbcn/r8168-dkms"
license=("GPL")
arch=('i686' 'x86_64')
depends=('glibc' 'dkms')
conflicts=("${_pkgbase}")
conflicts=("${pkgname}")
optdepends=('linux-headers: Needed for build the module for Arch kernel'
'linux-lts-headers: Needed for build the module for LTS Arch kernel'
'linux-zen-headers: Needed for build the module for ZEN Arch kernel')
source=(https://github.com/mtorromeo/r8168/archive/$pkgver/$pkgname-$pkgver.tar.gz
source=(https://github.com/simonbcn/r8168-dkms/archive/$pkgver/$pkgname-$pkgver.tar.gz
dkms.conf
kernel-5.4.patch)
0001-linux-5.6.patch)
install=r8168-dkms.install
prepare() {
cd "r8168-$pkgver"
patch -Np1 -i "${srcdir}/kernel-5.4.patch"
cd "$pkgname-$pkgver"
patch -Np1 < ../0001-linux-5.6.patch
}
package() {
install -Dm644 dkms.conf "${pkgdir}/usr/src/${_pkgbase}-${pkgver}/dkms.conf"
install -Dm644 dkms.conf "${pkgdir}/usr/src/${pkgname}-${pkgver}/dkms.conf"
sed -e "s/@PKGNAME@/${_pkgbase}/g" \
-e "s/@PKGVER@/${_pkgbase}/g" \
-i "${pkgdir}/usr/src/${_pkgbase}-${pkgver}/dkms.conf"
-i "${pkgdir}/usr/src/${pkgname}-${pkgver}/dkms.conf"
cd "${_pkgbase}-$pkgver"
cd "${pkgname}-$pkgver"
rm src/Makefile_linux24x
cp -dr --no-preserve='ownership' src "${pkgdir}/usr/src/${_pkgbase}-${pkgver}/src"
cp -dr --no-preserve='ownership' src "${pkgdir}/usr/src/${pkgname}-${pkgver}/src"
}
sha256sums=('1344bf3d8a1d01a1be8805b48940be1b946b5e694ca75bd14ed1c76fd4c3d67b'
sha256sums=('e1457d11651a25eefd8042afdfdd0380d29b37add5ca680a1ce067447295c76e'
'e33abcbc8fbe3129459ebc60be3b2f8ed55ddc53755f4956d6feb16c61c43250'
'be79c151c6323bb4d340e31e44fae25a36a93d317812fe5d75c54649ed2508b0')
'7d0c468036a6acd83d056d6c243b3ace8be34bf3d633aa24bf54b9c3595f8a0d')

View file

@ -1,12 +0,0 @@
diff -u -r r8168-8.047.05/src/r8168_n.c r8168-8.047.05-5.4/src/r8168_n.c
--- r8168-8.047.05/src/r8168_n.c 2019-11-25 18:01:38.000000000 +0000
+++ r8168-8.047.05-5.4/src/r8168_n.c 2019-11-25 23:36:15.427988367 +0000
@@ -56,7 +56,7 @@
#include <linux/rtnetlink.h>
#include <linux/completion.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) && LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0)
#include <linux/pci-aspm.h>
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,37)