git: 157e93e0e813 - main - LinuxKPI: pci: rename PCI_IRQ_LEGACY to PCI_IRQ_INTX

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Thu, 17 Oct 2024 13:27:29 UTC
The branch main has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=157e93e0e8138fbaa6ab5d5b20b0c23f903667a6

commit 157e93e0e8138fbaa6ab5d5b20b0c23f903667a6
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2024-09-26 21:13:35 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2024-10-17 13:27:05 +0000

    LinuxKPI: pci: rename PCI_IRQ_LEGACY to PCI_IRQ_INTX
    
    PCI_IRQ_LEGACY was added in 366d68f28379 (likely) for rtw88 only.
    The define now got renamed and I cannot find any other use but
    rtw88 and rtw89.
    We keep the old name as comapt while driver updates are in
    progress enabling it defining LINUXKPI_VERSION for the two drivers.
    
    Sponsored by;   The FreeBSD Foundation
    MFC after:      3 days
    Differential Revision: https://reviews.freebsd.org/D46822
---
 sys/compat/linuxkpi/common/include/linux/pci.h | 8 ++++++--
 sys/compat/linuxkpi/common/src/linux_pci.c     | 2 +-
 sys/modules/rtw88/Makefile                     | 1 +
 sys/modules/rtw89/Makefile                     | 1 +
 4 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h
index a2de534fcb60..c6fc1195f71b 100644
--- a/sys/compat/linuxkpi/common/include/linux/pci.h
+++ b/sys/compat/linuxkpi/common/include/linux/pci.h
@@ -233,10 +233,14 @@ extern const char *pci_power_names[6];
 #define	PCI_L1SS_CTL1			0x8
 #define	PCI_L1SS_CTL1_L1SS_MASK		0xf
 
-#define	PCI_IRQ_LEGACY			0x01
+#define	PCI_IRQ_INTX			0x01
 #define	PCI_IRQ_MSI			0x02
 #define	PCI_IRQ_MSIX			0x04
-#define	PCI_IRQ_ALL_TYPES		(PCI_IRQ_MSIX|PCI_IRQ_MSI|PCI_IRQ_LEGACY)
+#define	PCI_IRQ_ALL_TYPES		(PCI_IRQ_MSIX|PCI_IRQ_MSI|PCI_IRQ_INTX)
+
+#if defined(LINUXKPI_VERSION) && (LINUXKPI_VERSION >= 60800)
+#define	PCI_IRQ_LEGACY			PCI_IRQ_INTX
+#endif
 
 struct pci_dev;
 
diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c
index 3376d93053dc..366731081072 100644
--- a/sys/compat/linuxkpi/common/src/linux_pci.c
+++ b/sys/compat/linuxkpi/common/src/linux_pci.c
@@ -1306,7 +1306,7 @@ out:
 		if (error == 0 && pdev->msi_enabled)
 			return (pdev->dev.irq_end - pdev->dev.irq_start);
 	}
-	if (flags & PCI_IRQ_LEGACY) {
+	if (flags & PCI_IRQ_INTX) {
 		if (pdev->irq)
 			return (1);
 	}
diff --git a/sys/modules/rtw88/Makefile b/sys/modules/rtw88/Makefile
index b0e6b59b708e..a63f769cb878 100644
--- a/sys/modules/rtw88/Makefile
+++ b/sys/modules/rtw88/Makefile
@@ -32,6 +32,7 @@ SRCS+=	opt_wlan.h opt_inet6.h opt_inet.h
 #CFLAGS+=	-ferror-limit=0
 
 CFLAGS+=	-DKBUILD_MODNAME='"rtw88"'
+CFLAGS+=	-DLINUXKPI_VERSION=60800
 
 CFLAGS+=	-I${DEVRTW88DIR}
 CFLAGS+=	${LINUXKPI_INCLUDES}
diff --git a/sys/modules/rtw89/Makefile b/sys/modules/rtw89/Makefile
index f13924e1aa5b..87e1b133867d 100644
--- a/sys/modules/rtw89/Makefile
+++ b/sys/modules/rtw89/Makefile
@@ -32,6 +32,7 @@ SRCS+=	${LINUXKPI_GENSRCS}
 SRCS+=	opt_wlan.h opt_inet6.h opt_inet.h opt_acpi.h
 
 CFLAGS+=	-DKBUILD_MODNAME='"rtw89"'
+CFLAGS+=	-DLINUXKPI_VERSION=60800
 
 CFLAGS+=	-I${DEVRTW89DIR}
 CFLAGS+=	${LINUXKPI_INCLUDES}