From 71124f92a67aa2d407a3f789da045a40bd1c6fc9 Mon Sep 17 00:00:00 2001 From: lean Date: Fri, 8 Jul 2022 19:51:58 +0800 Subject: [PATCH] r8125: add kernel 5.18 support --- .../lean/r8125/patches/020-5.18-support.patch | 23 +++++++++++++++++++ target/linux/x86/Makefile | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 package/lean/r8125/patches/020-5.18-support.patch diff --git a/package/lean/r8125/patches/020-5.18-support.patch b/package/lean/r8125/patches/020-5.18-support.patch new file mode 100644 index 000000000..a2bb7fcef --- /dev/null +++ b/package/lean/r8125/patches/020-5.18-support.patch @@ -0,0 +1,23 @@ +--- a/src/r8125_n.c ++++ b/src/r8125_n.c +@@ -11952,11 +11952,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/target/linux/x86/Makefile b/target/linux/x86/Makefile index bf5e62379..717a75211 100644 --- a/target/linux/x86/Makefile +++ b/target/linux/x86/Makefile @@ -18,7 +18,7 @@ KERNELNAME:=bzImage include $(INCLUDE_DIR)/target.mk DEFAULT_PACKAGES += partx-utils mkf2fs e2fsprogs kmod-button-hotplug kmod-usb-hid kmod-mmc kmod-sdhci usbutils pciutils \ -kmod-alx kmod-e1000e kmod-igb kmod-igc kmod-igbvf kmod-iavf kmod-bnx2x kmod-pcnet32 kmod-tulip kmod-via-velocity kmod-vmxnet3 kmod-i40e kmod-i40evf kmod-8139cp kmod-8139too kmod-fs-f2fs cfdisk \ +kmod-alx kmod-e1000e kmod-igb kmod-igc kmod-igbvf kmod-iavf kmod-bnx2x kmod-pcnet32 kmod-tulip kmod-via-velocity kmod-vmxnet3 kmod-i40e kmod-i40evf kmod-r8125 kmod-8139cp kmod-8139too kmod-fs-f2fs cfdisk \ htop lm-sensors autocore-x86 automount autosamba luci-app-adbyby-plus luci-app-ipsec-vpnd luci-proto-bonding \ luci-app-unblockmusic luci-app-zerotier luci-app-xlnetacc ddns-scripts_aliyun ddns-scripts_dnspod ca-bundle luci-app-wireguard luci-app-ttyd \ kmod-sound-hda-core kmod-sound-hda-codec-realtek kmod-sound-hda-codec-via kmod-sound-via82xx kmod-sound-hda-intel kmod-sound-hda-codec-hdmi kmod-sound-i8x0 kmod-usb-audio \