summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarlson2k (Evgeny Grin) <k2k@narod.ru>2022-06-16 14:14:44 +0300
committerSam James <sam@gentoo.org>2022-06-16 17:35:03 +0100
commitb6c29fdb0d3795cffabca4805bf11ac51b633351 (patch)
tree4a08793c4ecae668f54c9933c04f724effc769d1 /net-misc/r8125
parentsys-kernel/kpatch: remove unused patch (diff)
downloadgentoo-b6c29fdb0d3795cffabca4805bf11ac51b633351.tar.gz
gentoo-b6c29fdb0d3795cffabca4805bf11ac51b633351.tar.bz2
gentoo-b6c29fdb0d3795cffabca4805bf11ac51b633351.zip
net-misc/r8125: fixed build with kernel 5.18+
Bug: https://bugs.gentoo.org/852311 Signed-off-by: Karlson2k (Evgeny Grin) <k2k@narod.ru> Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'net-misc/r8125')
-rw-r--r--net-misc/r8125/files/r8125-9.008.00-linux-5.18.patch31
-rw-r--r--net-misc/r8125/r8125-9.008.00.ebuild1
2 files changed, 32 insertions, 0 deletions
diff --git a/net-misc/r8125/files/r8125-9.008.00-linux-5.18.patch b/net-misc/r8125/files/r8125-9.008.00-linux-5.18.patch
new file mode 100644
index 000000000000..6da1bdae6b6a
--- /dev/null
+++ b/net-misc/r8125/files/r8125-9.008.00-linux-5.18.patch
@@ -0,0 +1,31 @@
+Added compatibility with Linux Kernel 5.18+.
+
+Author: Karlson2k (Evgeny Grin)
+Gentoo bug: https://bugs.gentoo.org/852311
+
+diff --git a/src/r8125_n.c b/src/r8125_n.c
+
+--- a/src/r8125_n.c
++++ b/src/r8125_n.c
+@@ -11852,11 +11852,20 @@ rtl8125_init_board(struct pci_dev *pdev,
+
+ 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 // LINUX_VERSION_CODE >= KERNEL_VERSION(5,18,0)
++ !dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)) &&
++ !dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64))) {
++#endif // LINUX_VERSION_CODE >= KERNEL_VERSION(5,18,0)
+ 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 // LINUX_VERSION_CODE >= KERNEL_VERSION(5,18,0)
++ rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
++#endif // LINUX_VERSION_CODE >= KERNEL_VERSION(5,18,0)
+ if (rc < 0) {
+ #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)
+ if (netif_msg_probe(tp))
+
diff --git a/net-misc/r8125/r8125-9.008.00.ebuild b/net-misc/r8125/r8125-9.008.00.ebuild
index 7b0093e09b81..b848421ede7e 100644
--- a/net-misc/r8125/r8125-9.008.00.ebuild
+++ b/net-misc/r8125/r8125-9.008.00.ebuild
@@ -22,6 +22,7 @@ IUSE="+multi-tx-q ptp +rss use-firmware"
PATCHES=(
"${FILESDIR}/${PN}-9.008.00-linux-5.17.patch" # bug 839282
+ "${FILESDIR}/${PN}-9.008.00-linux-5.18.patch" # bug 852311
)
CONFIG_CHECK="~!R8169"