git: 6890e327a86d - main - linuxkpi: pci: Add more functions needed by drm

From: Emmanuel Vadot <manu_at_FreeBSD.org>
Date: Mon, 08 Aug 2022 14:04:13 UTC
The branch main has been updated by manu:

URL: https://cgit.FreeBSD.org/src/commit/?id=6890e327a86da0c268f2b21637bce4891626ada0

commit 6890e327a86da0c268f2b21637bce4891626ada0
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2022-07-26 08:07:39 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2022-08-08 13:22:34 +0000

    linuxkpi: pci: Add more functions needed by drm
    
    Mostly stubs to satisfy building
    
    Reviewed by:    hselasky
    Obtained from:  drm-kmod
    Sponsored by:   Beckhoff Automation GmbH & Co. KG
    Differential Revision:  https://reviews.freebsd.org/D35938
---
 sys/compat/linuxkpi/common/include/linux/pci.h | 30 ++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h
index 695965673050..0652a250c697 100644
--- a/sys/compat/linuxkpi/common/include/linux/pci.h
+++ b/sys/compat/linuxkpi/common/include/linux/pci.h
@@ -1514,4 +1514,34 @@ linuxkpi_pcim_want_to_use_bus_functions(struct pci_dev *pdev)
 	pdev->want_iomap_res = true;
 }
 
+static inline bool
+pci_is_thunderbolt_attached(struct pci_dev *pdev)
+{
+
+	return (false);
+}
+
+static inline void *
+pci_platform_rom(struct pci_dev *pdev, size_t *size)
+{
+
+	return (NULL);
+}
+
+static inline void
+pci_ignore_hotplug(struct pci_dev *pdev)
+{
+}
+
+static inline int
+pcie_get_readrq(struct pci_dev *dev)
+{
+	u16 ctl;
+
+	if (pcie_capability_read_word(dev, PCI_EXP_DEVCTL, &ctl))
+		return (-EINVAL);
+
+	return (128 << ((ctl & PCI_EXP_DEVCTL_READRQ) >> 12));
+}
+
 #endif	/* _LINUXKPI_LINUX_PCI_H_ */