diff options
author | Paul Mackerras <paulus@samba.org> | 2005-08-18 14:33:01 +1000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-09-08 15:04:30 -0700 |
commit | cecf4864cf52a4a243a62b2856a6a155edbb55e8 (patch) | |
tree | ffbf170ed0208e81e9561dca3ad7786c362a7024 /include/linux | |
parent | 1d2450a4a6eb656798c6282b5ffc8e5f9f52ac14 (diff) | |
download | linux-3.10-cecf4864cf52a4a243a62b2856a6a155edbb55e8.tar.gz linux-3.10-cecf4864cf52a4a243a62b2856a6a155edbb55e8.tar.bz2 linux-3.10-cecf4864cf52a4a243a62b2856a6a155edbb55e8.zip |
[PATCH] PCI: Add pci_walk_bus function to PCI core (nonrecursive)
The PCI error recovery infrastructure needs to be able to contact all
the drivers affected by a PCI error event, which may mean traversing
all the devices under a given PCI-PCI bridge. This patch adds a
function to the PCI core that traverses all the PCI devices on a PCI
bus and under any PCI-PCI bridges on that bus (and so on), calling a
given function for each device. This provides a way for the error
recovery code to iterate through all devices that are affected by an
error event.
This version is not implemented as a recursive function. Instead,
when we reach a PCI-PCI bridge, we set the pointers to start doing the
devices on the bus under the bridge, and when we reach the end of a
bus's devices, we use the bus->self pointer to go back up to the next
higher bus and continue doing its devices.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/pci.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index 8878ccff9e3..b0e24471328 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -434,6 +434,9 @@ const struct pci_device_id *pci_match_device(struct pci_driver *drv, struct pci_ const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, struct pci_dev *dev); int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass); +void pci_walk_bus(struct pci_bus *top, void (*cb)(struct pci_dev *, void *), + void *userdata); + /* kmem_cache style wrapper around pci_alloc_consistent() */ #include <linux/dmapool.h> |