]>
Commit | Line | Data |
---|---|---|
1f71d8bf JR |
1 | --- r8168-8.049.02/src/r8168_n.c~ 2022-05-25 16:48:22.000000000 +0200 |
2 | +++ r8168-8.049.02/src/r8168_n.c 2022-05-25 16:56:57.575961627 +0200 | |
3 | @@ -3665,9 +3665,15 @@ | |
4 | txd->opts2 = 0; | |
5 | while (1) { | |
6 | memset(tmpAddr, pattern++, len - 14); | |
7 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) | |
8 | pci_dma_sync_single_for_device(tp->pci_dev, | |
9 | le64_to_cpu(mapping), | |
10 | len, DMA_TO_DEVICE); | |
11 | +#else | |
12 | + dma_sync_single_for_device(&tp->pci_dev->dev, | |
13 | + le64_to_cpu(mapping), | |
14 | + len, DMA_TO_DEVICE); | |
15 | +#endif | |
16 | txd->opts1 = cpu_to_le32(DescOwn | FirstFrag | LastFrag | len); | |
17 | ||
18 | RTL_W32(tp, RxConfig, RTL_R32(tp, RxConfig) | AcceptMyPhys); | |
19 | @@ -3693,7 +3699,11 @@ | |
20 | if (rx_len == len) { | |
21 | dma_sync_single_for_cpu(tp_to_dev(tp), le64_to_cpu(rxd->addr), tp->rx_buf_sz, DMA_FROM_DEVICE); | |
22 | i = memcmp(skb->data, rx_skb->data, rx_len); | |
23 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) | |
24 | pci_dma_sync_single_for_device(tp->pci_dev, le64_to_cpu(rxd->addr), tp->rx_buf_sz, DMA_FROM_DEVICE); | |
25 | +#else | |
26 | + dma_sync_single_for_device(&tp->pci_dev->dev, le64_to_cpu(rxd->addr), tp->rx_buf_sz, DMA_FROM_DEVICE); | |
27 | +#endif | |
28 | if (i == 0) { | |
29 | // dev_printk(KERN_INFO, tp_to_dev(tp), "loopback test finished\n",rx_len,len); | |
30 | break; | |
31 | @@ -25175,11 +25175,20 @@ | |
32 | ||
33 | if ((sizeof(dma_addr_t) > 4) && | |
34 | use_dac && | |
35 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) | |
36 | !pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) && | |
37 | !pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64))) { | |
38 | +#else | |
39 | + !dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)) && | |
40 | + !dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64))) { | |
41 | +#endif | |
42 | dev->features |= NETIF_F_HIGHDMA; | |
43 | } else { | |
44 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) | |
45 | rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); | |
46 | +#else | |
47 | + rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32)); | |
48 | +#endif | |
49 | if (rc < 0) { | |
50 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) | |
51 | if (netif_msg_probe(tp)) |