diff options
| -rw-r--r-- | drivers/pci/hotplug/fakephp.c | 6 | ||||
| -rw-r--r-- | drivers/pci/probe.c | 32 | ||||
| -rw-r--r-- | include/linux/pci.h | 3 |
3 files changed, 38 insertions, 3 deletions
diff --git a/drivers/pci/hotplug/fakephp.c b/drivers/pci/hotplug/fakephp.c index d8649e127298..16063745766e 100644 --- a/drivers/pci/hotplug/fakephp.c +++ b/drivers/pci/hotplug/fakephp.c | |||
| @@ -245,12 +245,12 @@ static int pci_rescan_slot(struct pci_dev *temp) | |||
| 245 | 245 | ||
| 246 | 246 | ||
| 247 | /** | 247 | /** |
| 248 | * pci_rescan_bus - Rescan PCI bus | 248 | * pci_rescan_bus_local - fakephp version of rescan PCI bus |
| 249 | * @bus: the PCI bus to rescan | 249 | * @bus: the PCI bus to rescan |
| 250 | * | 250 | * |
| 251 | * Call pci_rescan_slot for each possible function of the bus. | 251 | * Call pci_rescan_slot for each possible function of the bus. |
| 252 | */ | 252 | */ |
| 253 | static void pci_rescan_bus(const struct pci_bus *bus) | 253 | static void pci_rescan_bus_local(const struct pci_bus *bus) |
| 254 | { | 254 | { |
| 255 | unsigned int devfn; | 255 | unsigned int devfn; |
| 256 | struct pci_dev *dev; | 256 | struct pci_dev *dev; |
| @@ -291,7 +291,7 @@ static void pci_rescan_buses(const struct list_head *list) | |||
| 291 | const struct list_head *l; | 291 | const struct list_head *l; |
| 292 | list_for_each(l,list) { | 292 | list_for_each(l,list) { |
| 293 | const struct pci_bus *b = pci_bus_b(l); | 293 | const struct pci_bus *b = pci_bus_b(l); |
| 294 | pci_rescan_bus(b); | 294 | pci_rescan_bus_local(b); |
| 295 | pci_rescan_buses(&b->children); | 295 | pci_rescan_buses(&b->children); |
| 296 | } | 296 | } |
| 297 | } | 297 | } |
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index f69256c63b2b..60a8e5fec6c5 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
| @@ -1212,6 +1212,38 @@ struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent, | |||
| 1212 | EXPORT_SYMBOL(pci_scan_bus_parented); | 1212 | EXPORT_SYMBOL(pci_scan_bus_parented); |
| 1213 | 1213 | ||
| 1214 | #ifdef CONFIG_HOTPLUG | 1214 | #ifdef CONFIG_HOTPLUG |
| 1215 | /** | ||
| 1216 | * pci_rescan_bus - scan a PCI bus for devices. | ||
| 1217 | * @bus: PCI bus to scan | ||
| 1218 | * | ||
| 1219 | * Scan a PCI bus and child buses for new devices, adds them, | ||
| 1220 | * and enables them. | ||
| 1221 | * | ||
| 1222 | * Returns the max number of subordinate bus discovered. | ||
| 1223 | */ | ||
| 1224 | unsigned int __devinit pci_rescan_bus(struct pci_bus *bus) | ||
| 1225 | { | ||
| 1226 | unsigned int max; | ||
| 1227 | struct pci_dev *dev; | ||
| 1228 | |||
| 1229 | max = pci_scan_child_bus(bus); | ||
| 1230 | |||
| 1231 | up_read(&pci_bus_sem); | ||
| 1232 | list_for_each_entry(dev, &bus->devices, bus_list) | ||
| 1233 | if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE || | ||
| 1234 | dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) | ||
| 1235 | if (dev->subordinate) | ||
| 1236 | pci_bus_size_bridges(dev->subordinate); | ||
| 1237 | down_read(&pci_bus_sem); | ||
| 1238 | |||
| 1239 | pci_bus_assign_resources(bus); | ||
| 1240 | pci_enable_bridges(bus); | ||
| 1241 | pci_bus_add_devices(bus); | ||
| 1242 | |||
| 1243 | return max; | ||
| 1244 | } | ||
| 1245 | EXPORT_SYMBOL_GPL(pci_rescan_bus); | ||
| 1246 | |||
| 1215 | EXPORT_SYMBOL(pci_add_new_bus); | 1247 | EXPORT_SYMBOL(pci_add_new_bus); |
| 1216 | EXPORT_SYMBOL(pci_scan_slot); | 1248 | EXPORT_SYMBOL(pci_scan_slot); |
| 1217 | EXPORT_SYMBOL(pci_scan_bridge); | 1249 | EXPORT_SYMBOL(pci_scan_bridge); |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 50d94388e87c..6fb335b0d74f 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -726,6 +726,9 @@ int pci_back_from_sleep(struct pci_dev *dev); | |||
| 726 | 726 | ||
| 727 | /* Functions for PCI Hotplug drivers to use */ | 727 | /* Functions for PCI Hotplug drivers to use */ |
| 728 | int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); | 728 | int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); |
| 729 | #ifdef CONFIG_HOTPLUG | ||
| 730 | unsigned int pci_rescan_bus(struct pci_bus *bus); | ||
| 731 | #endif | ||
| 729 | 732 | ||
| 730 | /* Vital product data routines */ | 733 | /* Vital product data routines */ |
| 731 | ssize_t pci_read_vpd(struct pci_dev *dev, loff_t pos, size_t count, void *buf); | 734 | ssize_t pci_read_vpd(struct pci_dev *dev, loff_t pos, size_t count, void *buf); |
