summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Heider2025-05-10 09:19:18 +0000
committerRobert Marko2025-05-13 20:02:19 +0000
commite80dfdb6c5e2040e055bf14308af53da8792a596 (patch)
treecf7b925d63e84d37e38bffe1eb2dac2aa8fd6eff
parentdcc440c7c91f3eb833ba54753d52301755f448e9 (diff)
downloadopenwrt-e80dfdb6c5e2040e055bf14308af53da8792a596.tar.gz
vrx518_ep: fix compilation error with kernel 6.12
PCI_IRQ_LEGACY was renamed to PCI_IRQ_INTX for kernel 6.10. Fix compilation error: /home/db/owrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-ipq40xx_generic/vrx518_ep-2.1.0/ep.c:469:69: error: 'PCI_IRQ_LEGACY' undeclared (first use in this function); did you mean 'NR_IRQS_LEGACY'? 469 | err = pci_alloc_irq_vectors(pdev, nvec, nvec, PCI_IRQ_MSI | PCI_IRQ_LEGACY); | ^~~~~~~~~~~~~~ | NR_IRQS_LEGACY Signed-off-by: Andre Heider <a.heider@gmail.com> Co-authored-by: Shiji Yang <yangshiji66@outlook.com> Link: https://github.com/openwrt/openwrt/pull/18744 Signed-off-by: Robert Marko <robimarko@gmail.com>
-rw-r--r--package/kernel/lantiq/vrx518_ep/patches/100-compat.patch22
1 files changed, 17 insertions, 5 deletions
diff --git a/package/kernel/lantiq/vrx518_ep/patches/100-compat.patch b/package/kernel/lantiq/vrx518_ep/patches/100-compat.patch
index a139c7a862..3457779776 100644
--- a/package/kernel/lantiq/vrx518_ep/patches/100-compat.patch
+++ b/package/kernel/lantiq/vrx518_ep/patches/100-compat.patch
@@ -1,6 +1,14 @@
--- a/ep.c
+++ b/ep.c
-@@ -373,23 +373,23 @@ int dc_ep_dev_info_req(int dev_idx, enum
+@@ -34,6 +34,7 @@
+ #include <linux/pci.h>
+ #include <linux/pci_regs.h>
+ #include <linux/platform_device.h>
++#include <linux/version.h>
+
+ #include "ep.h"
+ #include "aca.h"
+@@ -373,23 +374,23 @@ int dc_ep_dev_info_req(int dev_idx, enum
switch (module) {
case DC_EP_INT_PPE:
@@ -31,18 +39,22 @@
break;
}
-@@ -466,8 +466,8 @@ static int dc_ep_msi_enable(struct pci_d
+@@ -466,8 +467,12 @@ static int dc_ep_msi_enable(struct pci_d
return -EIO;
}
- err = pci_enable_msi_exact(pdev, nvec);
- if (err) {
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0))
+ err = pci_alloc_irq_vectors(pdev, nvec, nvec, PCI_IRQ_MSI | PCI_IRQ_LEGACY);
++#else
++ err = pci_alloc_irq_vectors(pdev, nvec, nvec, PCI_IRQ_MSI | PCI_IRQ_INTX);
++#endif
+ if (err < 0) {
dev_err(&pdev->dev,
"%s: Failed to enable MSI interrupts error code: %d\n",
__func__, err);
-@@ -589,15 +589,15 @@ static int dc_ep_probe(struct pci_dev *p
+@@ -589,15 +594,15 @@ static int dc_ep_probe(struct pci_dev *p
/* Target structures have a limit of 32 bit DMA pointers.
* DMA pointers can be wider than 32 bits by default on some systems.
*/
@@ -61,7 +73,7 @@
goto err_region;
}
-@@ -654,7 +654,7 @@ static int dc_ep_probe(struct pci_dev *p
+@@ -654,7 +659,7 @@ static int dc_ep_probe(struct pci_dev *p
goto err_iomap;
spin_lock(&dc_ep_lock);
@@ -70,7 +82,7 @@
spin_unlock(&dc_ep_lock);
#ifndef CONFIG_OF
-@@ -715,7 +715,7 @@ static void dc_ep_remove(struct pci_dev
+@@ -715,7 +720,7 @@ static void dc_ep_remove(struct pci_dev
dc_ep_icu_disable(priv);
pci_iounmap(pdev, priv->mem);
pci_release_region(pdev, DC_EP_BAR_NUM);