2008-02-02 22:32:23 +01:00
|
|
|
/* Core PCI functionality used only by PCI hotplug */
|
|
|
|
|
|
|
|
#include <linux/pci.h>
|
2011-05-27 15:37:25 +02:00
|
|
|
#include <linux/export.h>
|
2008-02-02 22:32:23 +01:00
|
|
|
#include "pci.h"
|
|
|
|
|
2014-04-15 00:11:40 +02:00
|
|
|
int pci_hp_add_bridge(struct pci_dev *dev)
|
2012-05-18 21:46:34 +02:00
|
|
|
{
|
|
|
|
struct pci_bus *parent = dev->bus;
|
|
|
|
int pass, busnr, start = parent->busn_res.start;
|
|
|
|
int end = parent->busn_res.end;
|
|
|
|
|
|
|
|
for (busnr = start; busnr <= end; busnr++) {
|
|
|
|
if (!pci_find_bus(pci_domain_nr(parent), busnr))
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (busnr-- > end) {
|
|
|
|
printk(KERN_ERR "No bus number available for hot-added bridge %s\n",
|
|
|
|
pci_name(dev));
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
for (pass = 0; pass < 2; pass++)
|
|
|
|
busnr = pci_scan_bridge(parent, dev, busnr, pass);
|
|
|
|
if (!dev->subordinate)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EXPORT_SYMBOL_GPL(pci_hp_add_bridge);
|