]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/blobdiff - arch/x86/pci/common.c
Merge tag 'for-3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
[can-eth-gw-linux.git] / arch / x86 / pci / common.c
index 720e973fc34a31b856998715165f7fc50ec9ec6d..1b1dda90a945ede1550294e83dfc51d7a2f9f663 100644 (file)
@@ -17,6 +17,7 @@
 #include <asm/io.h>
 #include <asm/smp.h>
 #include <asm/pci_x86.h>
+#include <asm/setup.h>
 
 unsigned int pci_probe = PCI_PROBE_BIOS | PCI_PROBE_CONF1 | PCI_PROBE_CONF2 |
                                PCI_PROBE_MMCONF;
@@ -608,6 +609,35 @@ unsigned int pcibios_assign_all_busses(void)
        return (pci_probe & PCI_ASSIGN_ALL_BUSSES) ? 1 : 0;
 }
 
+int pcibios_add_device(struct pci_dev *dev)
+{
+       struct setup_data *data;
+       struct pci_setup_rom *rom;
+       u64 pa_data;
+
+       pa_data = boot_params.hdr.setup_data;
+       while (pa_data) {
+               data = phys_to_virt(pa_data);
+
+               if (data->type == SETUP_PCI) {
+                       rom = (struct pci_setup_rom *)data;
+
+                       if ((pci_domain_nr(dev->bus) == rom->segment) &&
+                           (dev->bus->number == rom->bus) &&
+                           (PCI_SLOT(dev->devfn) == rom->device) &&
+                           (PCI_FUNC(dev->devfn) == rom->function) &&
+                           (dev->vendor == rom->vendor) &&
+                           (dev->device == rom->devid)) {
+                               dev->rom = pa_data +
+                                     offsetof(struct pci_setup_rom, romdata);
+                               dev->romlen = rom->pcilen;
+                       }
+               }
+               pa_data = data->next;
+       }
+       return 0;
+}
+
 int pcibios_enable_device(struct pci_dev *dev, int mask)
 {
        int err;
@@ -626,7 +656,7 @@ void pcibios_disable_device (struct pci_dev *dev)
                pcibios_disable_irq(dev);
 }
 
-int pci_ext_cfg_avail(struct pci_dev *dev)
+int pci_ext_cfg_avail(void)
 {
        if (raw_pci_ext_ops)
                return 1;