diff options
author | Alex Williamson <alex.williamson@redhat.com> | 2014-05-22 19:07:30 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2014-05-28 13:46:24 -0400 |
commit | c25dc82899e67a32fdcfb20dd72a37fc236fde2e (patch) | |
tree | 5db0bd880c1b2fbfb3435e68b991216e2a770cf2 /include/linux/pci.h | |
parent | c9eaa447e77efe77b7fa4c953bd62de8297fd6c5 (diff) |
PCI: Add DMA alias iterator
In a mixed PCI/PCI-X/PCIe topology, bridges can take ownership of
transactions, replacing the original requester ID with their own.
Sometimes we just want to know the resulting device or resulting alias;
other times we want each step in the chain. This iterator allows either
usage. When an endpoint is connected via an unbroken chain of PCIe
switches and root ports, it has no alias and its requester ID is visible to
the root bus. When PCI/X get in the way, we pick up aliases for bridges.
The reason why we potentially care about each step in the path is because
of PCI-X. PCI-X has the concept of a requester ID, but bridges may or may
not take ownership of various types of transactions. We therefore leave it
to the consumer of this function to prune out what they don't care about
rather than attempt to flatten the alias ourselves.
Tested-by: George Spelvin <linux@horizon.com>
Tested-by: Pat Erley <pat-lkml@erley.org>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r-- | include/linux/pci.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index aab57b4abe7f..14b074bbc841 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -1795,6 +1795,10 @@ static inline struct eeh_dev *pci_dev_to_eeh_dev(struct pci_dev *pdev) | |||
1795 | } | 1795 | } |
1796 | #endif | 1796 | #endif |
1797 | 1797 | ||
1798 | int pci_for_each_dma_alias(struct pci_dev *pdev, | ||
1799 | int (*fn)(struct pci_dev *pdev, | ||
1800 | u16 alias, void *data), void *data); | ||
1801 | |||
1798 | /** | 1802 | /** |
1799 | * pci_find_upstream_pcie_bridge - find upstream PCIe-to-PCI bridge of a device | 1803 | * pci_find_upstream_pcie_bridge - find upstream PCIe-to-PCI bridge of a device |
1800 | * @pdev: the PCI device | 1804 | * @pdev: the PCI device |