summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Northon2022-08-14 06:33:55 -0400
committerPatrick Northon2022-08-14 06:33:55 -0400
commit9152b0f15de37f1544f4d8e726ff4945b326b11a (patch)
treeda6627eeeada8ed38ce6acc013fb11994c381a7c
parentede41e28df3595152ace289489a151087835152d (diff)
downloadaur-9152b0f15de37f1544f4d8e726ff4945b326b11a.tar.gz
Add kernel 5.19 patch.
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD25
-rw-r--r--linux-5.18.patch52
-rw-r--r--linux-5.19.patch41
4 files changed, 111 insertions, 13 deletions
diff --git a/.SRCINFO b/.SRCINFO
index c545857e4248..c009f1a3973f 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = r8168-dkms
pkgdesc = A kernel module for Realtek 8168 network cards (DKMS version)
pkgver = 8.050.03
- pkgrel = 2
+ pkgrel = 3
url = https://github.com/mtorromeo/r8168
install = r8168-dkms.install
arch = i686
@@ -14,9 +14,11 @@ pkgbase = r8168-dkms
conflicts = r8168
source = r8168-dkms::git+https://github.com/mtorromeo/r8168.git
source = dkms.conf
- source = linux518.patch::https://raw.githubusercontent.com/archlinux/svntogit-community/packages/r8168/trunk/linux518.patch
+ source = linux-5.18.patch
+ source = linux-5.19.patch
sha256sums = SKIP
sha256sums = e33abcbc8fbe3129459ebc60be3b2f8ed55ddc53755f4956d6feb16c61c43250
sha256sums = d8d542770e504775600f686d03412a37cc32489872be7aeb388b5b08d9806096
+ sha256sums = f5e08919764bc56d4f11b23fcb7cece663cae3f591992a0ca2be760e6890a9f8
pkgname = r8168-dkms
diff --git a/PKGBUILD b/PKGBUILD
index fc74aa4cd65f..5b992b630d81 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -8,7 +8,7 @@
_pkgbase=r8168
pkgname=${_pkgbase}-dkms
pkgver=8.050.03
-pkgrel=2
+pkgrel=3
pkgdesc="A kernel module for Realtek 8168 network cards (DKMS version)"
url="https://github.com/mtorromeo/r8168"
license=("GPL")
@@ -19,24 +19,27 @@ conflicts=("${_pkgbase}")
provides=("${_pkgbase}")
source=("r8168-dkms::git+https://github.com/mtorromeo/r8168.git"
"dkms.conf"
- "linux518.patch::https://raw.githubusercontent.com/archlinux/svntogit-community/packages/r8168/trunk/linux518.patch")
+ "linux-5.18.patch"
+ 'linux-5.19.patch')
sha256sums=('SKIP'
'e33abcbc8fbe3129459ebc60be3b2f8ed55ddc53755f4956d6feb16c61c43250'
- 'd8d542770e504775600f686d03412a37cc32489872be7aeb388b5b08d9806096')
+ 'd8d542770e504775600f686d03412a37cc32489872be7aeb388b5b08d9806096'
+ 'f5e08919764bc56d4f11b23fcb7cece663cae3f591992a0ca2be760e6890a9f8')
install=r8168-dkms.install
prepare() {
- cd "$pkgname"
- patch -Np1 -i ../linux518.patch
+ cd "$pkgname"
+ patch -Np1 -i '../linux-5.18.patch'
+ patch -Np1 -i '../linux-5.19.patch'
}
package() {
- install -Dm644 dkms.conf "${pkgdir}/usr/src/${_pkgbase}-${pkgver}/dkms.conf"
+ install -Dm644 dkms.conf "${pkgdir}/usr/src/${_pkgbase}-${pkgver}/dkms.conf"
- sed -e "s/@PKGNAME@/${_pkgbase}/g" \
- -e "s/@PKGVER@/${pkgver}/g" \
- -i "${pkgdir}/usr/src/${_pkgbase}-${pkgver}/dkms.conf"
+ sed -e "s/@PKGNAME@/${_pkgbase}/g" \
+ -e "s/@PKGVER@/${pkgver}/g" \
+ -i "${pkgdir}/usr/src/${_pkgbase}-${pkgver}/dkms.conf"
- cd "${pkgname}"
- cp -dr --no-preserve='ownership' src "${pkgdir}/usr/src/${_pkgbase}-${pkgver}/src"
+ cd "${pkgname}"
+ cp -dr --no-preserve='ownership' src "${pkgdir}/usr/src/${_pkgbase}-${pkgver}/src"
}
diff --git a/linux-5.18.patch b/linux-5.18.patch
new file mode 100644
index 000000000000..aa0dd866ae0b
--- /dev/null
+++ b/linux-5.18.patch
@@ -0,0 +1,52 @@
+diff -u -r r8168-8.050.00/src/r8168_n.c r8168-8.050.00-linux518/src/r8168_n.c
+--- r8168-8.050.00/src/r8168_n.c 2022-05-06 09:48:25.000000000 +0000
++++ r8168-8.050.00-linux518/src/r8168_n.c 2022-05-24 21:31:05.802807395 +0000
+@@ -3698,9 +3698,15 @@
+ txd->opts2 = 0;
+ while (1) {
+ memset(tmpAddr, pattern++, len - 14);
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
+ pci_dma_sync_single_for_device(tp->pci_dev,
+ le64_to_cpu(mapping),
+ len, DMA_TO_DEVICE);
++#else
++ dma_sync_single_for_device(tp_to_dev(tp),
++ le64_to_cpu(mapping),
++ len, DMA_TO_DEVICE);
++#endif
+ txd->opts1 = cpu_to_le32(DescOwn | FirstFrag | LastFrag | len);
+
+ RTL_W32(tp, RxConfig, RTL_R32(tp, RxConfig) | AcceptMyPhys);
+@@ -3726,7 +3732,11 @@
+ if (rx_len == len) {
+ dma_sync_single_for_cpu(tp_to_dev(tp), le64_to_cpu(rxd->addr), tp->rx_buf_sz, DMA_FROM_DEVICE);
+ i = memcmp(skb->data, rx_skb->data, rx_len);
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
+ pci_dma_sync_single_for_device(tp->pci_dev, le64_to_cpu(rxd->addr), tp->rx_buf_sz, DMA_FROM_DEVICE);
++#else
++ dma_sync_single_for_device(tp_to_dev(tp), le64_to_cpu(rxd->addr), tp->rx_buf_sz, DMA_FROM_DEVICE);
++#endif
+ if (i == 0) {
+ // dev_printk(KERN_INFO, tp_to_dev(tp), "loopback test finished\n",rx_len,len);
+ break;
+@@ -26403,11 +26413,20 @@
+
+ if ((sizeof(dma_addr_t) > 4) &&
+ use_dac &&
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
+ !pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) &&
+ !pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64))) {
++#else
++ !dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)) &&
++ !dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64))) {
++#endif
+ dev->features |= NETIF_F_HIGHDMA;
+ } else {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
+ rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
++#else
++ rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
++#endif
+ if (rc < 0) {
+ #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)
+ if (netif_msg_probe(tp))
diff --git a/linux-5.19.patch b/linux-5.19.patch
new file mode 100644
index 000000000000..3342bfa14b23
--- /dev/null
+++ b/linux-5.19.patch
@@ -0,0 +1,41 @@
+diff -u -r r8168-8.050.03/src/r8168_n.c r8168-8.050.03-linux519/src/r8168_n.c
+--- r8168-8.050.03/src/r8168_n.c 2022-08-04 07:29:41.416222834 +0000
++++ r8168-8.050.03-linux519/src/r8168_n.c 2022-08-04 07:38:13.202069962 +0000
+@@ -26898,6 +26898,10 @@
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
+ if ((tp->mcfg == CFG_METHOD_1) || (tp->mcfg == CFG_METHOD_2) || (tp->mcfg == CFG_METHOD_3)) {
+ dev->hw_features &= ~NETIF_F_IPV6_CSUM;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0)
++ netif_set_tso_max_size(dev, LSO_32K);
++ netif_set_tso_max_segs(dev, NIC_MAX_PHYS_BUF_COUNT_LSO_64K);
++#else
+ netif_set_gso_max_size(dev, LSO_32K);
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)
+ dev->gso_max_segs = NIC_MAX_PHYS_BUF_COUNT_LSO_64K;
+@@ -26905,6 +26909,7 @@
+ dev->gso_min_segs = NIC_MIN_PHYS_BUF_COUNT;
+ #endif //LINUX_VERSION_CODE < KERNEL_VERSION(4,7,0)
+ #endif //LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)
++#endif //LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0)
+ } else {
+ dev->hw_features |= NETIF_F_IPV6_CSUM;
+ dev->features |= NETIF_F_IPV6_CSUM;
+@@ -26912,6 +26917,10 @@
+ dev->hw_features |= NETIF_F_TSO6;
+ //dev->features |= NETIF_F_TSO6;
+ }
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0)
++ netif_set_tso_max_size(dev, LSO_64K);
++ netif_set_tso_max_segs(dev, NIC_MAX_PHYS_BUF_COUNT_LSO2);
++#else
+ netif_set_gso_max_size(dev, LSO_64K);
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)
+ dev->gso_max_segs = NIC_MAX_PHYS_BUF_COUNT_LSO2;
+@@ -26919,6 +26928,7 @@
+ dev->gso_min_segs = NIC_MIN_PHYS_BUF_COUNT;
+ #endif //LINUX_VERSION_CODE < KERNEL_VERSION(4,7,0)
+ #endif //LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)
++#endif //LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0)
+ }
+ #endif //LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
+ #endif //LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)