summaryrefslogtreecommitdiff
path: root/drivers/pci/pci.h
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2024-03-12 12:14:20 -0500
committerBjorn Helgaas <bhelgaas@google.com>2024-03-12 12:14:20 -0500
commit47c94b2de5cd86c98dc5a6c84c97024669b0ccac (patch)
tree43aeccc882b971e7fae497d11b0c48a8c99a69fb /drivers/pci/pci.h
parent239981b66966e8f9c1c2eb020aaff61c82f56ae6 (diff)
parent815a3909ead7440e2827042e5ec618f4396f022c (diff)
Merge branch 'pci/devres'
- Unmap MMIO mappings in pci_iounmap() to avoid a leak when ARCH_HAS_GENERIC_IOPORT_MAP is defined (Philipp Stanner) - Move pci_iomap.c to drivers/pci/ since it's all PCI-related (Philipp Stanner) - Move other PCI-related devres code from lib/devres.c to drivers/pci/ (Philipp Stanner) - Move other devres code from pci.c to devres.c (Philipp Stanner) * pci/devres: PCI: Move devres code from pci.c to devres.c PCI: Move PCI-specific devres code to drivers/pci/ PCI: Move pci_iomap.c to drivers/pci/ pci_iounmap(): Fix MMIO mapping leak
Diffstat (limited to 'drivers/pci/pci.h')
-rw-r--r--drivers/pci/pci.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index ba7543cc9de0..50fdcd5980cc 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -809,6 +809,27 @@ static inline pci_power_t mid_pci_get_power_state(struct pci_dev *pdev)
#endif
/*
+ * Managed PCI resources. This manages device on/off, INTx/MSI/MSI-X
+ * on/off and BAR regions. pci_dev itself records MSI/MSI-X status, so
+ * there's no need to track it separately. pci_devres is initialized
+ * when a device is enabled using managed PCI device enable interface.
+ *
+ * TODO: Struct pci_devres and find_pci_dr() only need to be here because
+ * they're used in pci.c. Port or move these functions to devres.c and
+ * then remove them from here.
+ */
+struct pci_devres {
+ unsigned int enabled:1;
+ unsigned int pinned:1;
+ unsigned int orig_intx:1;
+ unsigned int restore_intx:1;
+ unsigned int mwi:1;
+ u32 region_mask;
+};
+
+struct pci_devres *find_pci_dr(struct pci_dev *pdev);
+
+/*
* Config Address for PCI Configuration Mechanism #1
*
* See PCI Local Bus Specification, Revision 3.0,