[arch-commits] Commit in r8168/trunk (PKGBUILD linux518.patch)

Jan Steffens heftig at gemini.archlinux.org
Tue May 24 21:33:20 UTC 2022


    Date: Tuesday, May 24, 2022 @ 21:33:20
  Author: heftig
Revision: 1210261

Add patch for Linux 5.18

Added:
  r8168/trunk/linux518.patch
Modified:
  r8168/trunk/PKGBUILD

----------------+
 PKGBUILD       |   11 +++++++++--
 linux518.patch |   52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 61 insertions(+), 2 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2022-05-24 21:16:44 UTC (rev 1210260)
+++ PKGBUILD	2022-05-24 21:33:20 UTC (rev 1210261)
@@ -11,11 +11,18 @@
 arch=('x86_64')
 makedepends=('linux-headers')
 source=(https://github.com/mtorromeo/r8168/archive/$pkgver/$pkgname-$pkgver.tar.gz
-        https://github.com/mtorromeo/r8168/releases/download/$pkgver/$pkgname-$pkgver.tar.gz.asc)
+        https://github.com/mtorromeo/r8168/releases/download/$pkgver/$pkgname-$pkgver.tar.gz.asc
+        linux518.patch)
 sha256sums=('15b06890230d7c7b92635d981a6f07c4562b0b3eeb55f43b127bdfbb50dda5e1'
-            'SKIP')
+            'SKIP'
+            'd8d542770e504775600f686d03412a37cc32489872be7aeb388b5b08d9806096')
 validpgpkeys=('0CADAACF70F64C654E131B3111675C743429DDEF') # Massimiliano Torromeo <massimiliano.torromeo at gmail.com>
 
+prepare() {
+	cd "$pkgname-$pkgver"
+	patch -Np1 -i ../linux518.patch
+}
+
 build() {
 	cd "$pkgname-$pkgver"
 	# avoid using the Makefile directly -- it doesn't understand

Added: linux518.patch
===================================================================
--- linux518.patch	                        (rev 0)
+++ linux518.patch	2022-05-24 21:33:20 UTC (rev 1210261)
@@ -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))



More information about the arch-commits mailing list