linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / arch / i386 / pci / common.c
index 383827d..f6bc48d 100644 (file)
@@ -23,8 +23,10 @@ extern  void pcibios_sort(void);
 unsigned int pci_probe = PCI_PROBE_BIOS | PCI_PROBE_CONF1 | PCI_PROBE_CONF2 |
                                PCI_PROBE_MMCONF;
 
+int pci_routeirq;
 int pcibios_last_bus = -1;
-struct pci_bus *pci_root_bus = NULL;
+unsigned long pirq_table_addr;
+struct pci_bus *pci_root_bus;
 struct pci_raw_ops *raw_pci_ops;
 
 static int pci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value)
@@ -52,7 +54,7 @@ int pcibios_scanned;
  * This interrupt-safe spinlock protects all accesses to PCI
  * configuration space.
  */
-spinlock_t pci_config_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(pci_config_lock);
 
 /*
  * Several buggy motherboards address only 16 devices and mirror
@@ -70,7 +72,7 @@ static void __devinit pcibios_fixup_ghosts(struct pci_bus *b)
        int i;
 
        DBG("PCI: Scanning for ghost devices on bus %d\n", b->number);
-       for (ln=b->devices.next; ln != &b->devices; ln=ln->next) {
+       list_for_each(ln, &b->devices) {
                d = pci_dev_b(ln);
                if ((d->class >> 8) == PCI_CLASS_BRIDGE_HOST)
                        seen_host_bridge++;
@@ -130,9 +132,9 @@ struct pci_bus * __devinit pcibios_scan_root(int busnum)
                }
        }
 
-       printk("PCI: Probing PCI hardware (bus %02x)\n", busnum);
+       printk(KERN_DEBUG "PCI: Probing PCI hardware (bus %02x)\n", busnum);
 
-       return pci_scan_bus(busnum, &pci_root_ops, NULL);
+       return pci_scan_bus_parented(NULL, busnum, &pci_root_ops, NULL);
 }
 
 extern u8 pci_cache_line_size;
@@ -142,7 +144,7 @@ static int __init pcibios_init(void)
        struct cpuinfo_x86 *c = &boot_cpu_data;
 
        if (!raw_pci_ops) {
-               printk("PCI: System does not support PCI\n");
+               printk(KERN_WARNING "PCI: System does not support PCI\n");
                return 0;
        }
 
@@ -187,6 +189,9 @@ char * __devinit  pcibios_setup(char *str)
        } else if (!strcmp(str, "biosirq")) {
                pci_probe |= PCI_BIOS_IRQ_SCAN;
                return NULL;
+       } else if (!strncmp(str, "pirqaddr=", 9)) {
+               pirq_table_addr = simple_strtoul(str+9, NULL, 0);
+               return NULL;
        }
 #endif
 #ifdef CONFIG_PCI_DIRECT
@@ -227,6 +232,9 @@ char * __devinit  pcibios_setup(char *str)
        } else if (!strcmp(str, "assign-busses")) {
                pci_probe |= PCI_ASSIGN_ALL_BUSSES;
                return NULL;
+       } else if (!strcmp(str, "routeirq")) {
+               pci_routeirq = 1;
+               return NULL;
        }
        return str;
 }
@@ -245,3 +253,9 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
 
        return pcibios_enable_irq(dev);
 }
+
+void pcibios_disable_device (struct pci_dev *dev)
+{
+       if (pcibios_disable_irq)
+               pcibios_disable_irq(dev);
+}