]> git.pld-linux.org Git - packages/r8168.git/commitdiff
- fix building kernel modules for 5.18
authorJan Rękorajski <baggins@pld-linux.org>
Wed, 25 May 2022 15:04:09 +0000 (17:04 +0200)
committerJan Rękorajski <baggins@pld-linux.org>
Wed, 25 May 2022 15:04:09 +0000 (17:04 +0200)
kernel-5.18.patch [new file with mode: 0644]
r8168.spec

diff --git a/kernel-5.18.patch b/kernel-5.18.patch
new file mode 100644 (file)
index 0000000..3d05b49
--- /dev/null
@@ -0,0 +1,51 @@
+--- r8168-8.049.02/src/r8168_n.c~      2022-05-25 16:48:22.000000000 +0200
++++ r8168-8.049.02/src/r8168_n.c       2022-05-25 16:56:57.575961627 +0200
+@@ -3665,9 +3665,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->pci_dev->dev,
++                                               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);
+@@ -3693,7 +3699,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->pci_dev->dev, 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;
+@@ -25175,11 +25175,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))
index 4e5ca247eb39288ec8dac80b001dab648a40e92f..f350e090fc36a74d748a151aa8bcfec5dcaf0aef 100644 (file)
@@ -20,6 +20,7 @@ URL:          http://www.realtek.com.tw/
 Source0:       %{pname}-%{version}.tar.bz2
 # Source0-md5: 9c2191ca3ff85102bc18a41916eceb8b
 Patch0:                kernel-5.17.patch
+Patch1:                kernel-5.18.patch
 BuildRequires: rpmbuild(macros) >= 1.701
 %{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}
 BuildRoot:     %{tmpdir}/%{pname}-%{version}-root-%(id -u -n)
@@ -72,6 +73,7 @@ Express Gigabit Ethernet.\
 %prep
 %setup -q -n %{pname}-%{version}
 %patch0 -p1
+%patch1 -p1
 
 %build
 %{expand:%build_kernel_packages}
This page took 0.154863 seconds and 4 git commands to generate.