vserver 2.0 rc7
[linux-2.6.git] / drivers / acpi / pci_irq.c
index a475019..8dbf802 100644 (file)
@@ -42,8 +42,8 @@
 #define _COMPONENT             ACPI_PCI_COMPONENT
 ACPI_MODULE_NAME               ("pci_irq")
 
-struct acpi_prt_list           acpi_prt;
-DEFINE_SPINLOCK(acpi_prt_lock);
+static struct acpi_prt_list    acpi_prt;
+static DEFINE_SPINLOCK(acpi_prt_lock);
 
 /* --------------------------------------------------------------------------
                          PCI IRQ Routing Table (PRT) Support
@@ -281,7 +281,8 @@ acpi_pci_irq_lookup (
        int                     device,
        int                     pin,
        int                     *edge_level,
-       int                     *active_high_low)
+       int                     *active_high_low,
+       char                    **link)
 {
        struct acpi_prt_entry   *entry = NULL;
        int segment = pci_domain_nr(bus);
@@ -301,7 +302,8 @@ acpi_pci_irq_lookup (
        }
        
        if (entry->link.handle) {
-               irq = acpi_pci_link_get_irq(entry->link.handle, entry->link.index, edge_level, active_high_low);
+               irq = acpi_pci_link_get_irq(entry->link.handle,
+                       entry->link.index, edge_level, active_high_low, link);
                if (irq < 0) {
                        ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid IRQ link routing entry\n"));
                        return_VALUE(-1);
@@ -327,7 +329,8 @@ acpi_pci_irq_derive (
        struct pci_dev          *dev,
        int                     pin,
        int                     *edge_level,
-       int                     *active_high_low)
+       int                     *active_high_low,
+       char                    **link)
 {
        struct pci_dev          *bridge = dev;
        int                     irq = -1;
@@ -360,7 +363,7 @@ acpi_pci_irq_derive (
                }
 
                irq = acpi_pci_irq_lookup(bridge->bus, PCI_SLOT(bridge->devfn),
-                       pin, edge_level, active_high_low);
+                       pin, edge_level, active_high_low, link);
        }
 
        if (irq < 0) {
@@ -388,7 +391,7 @@ acpi_pci_irq_enable (
        u8                      pin = 0;
        int                     edge_level = ACPI_LEVEL_SENSITIVE;
        int                     active_high_low = ACPI_ACTIVE_LOW;
-       extern int              via_interrupt_line_quirk;
+       char                    *link = NULL;
 
        ACPI_FUNCTION_TRACE("acpi_pci_irq_enable");
 
@@ -411,25 +414,28 @@ acpi_pci_irq_enable (
         * First we check the PCI IRQ routing table (PRT) for an IRQ.  PRT
         * values override any BIOS-assigned IRQs set during boot.
         */
-       irq = acpi_pci_irq_lookup(dev->bus, PCI_SLOT(dev->devfn), pin, &edge_level, &active_high_low);
+       irq = acpi_pci_irq_lookup(dev->bus, PCI_SLOT(dev->devfn), pin,
+               &edge_level, &active_high_low, &link);
 
        /*
         * If no PRT entry was found, we'll try to derive an IRQ from the
         * device's parent bridge.
         */
        if (irq < 0)
-               irq = acpi_pci_irq_derive(dev, pin, &edge_level, &active_high_low);
+               irq = acpi_pci_irq_derive(dev, pin, &edge_level,
+                       &active_high_low, &link);
  
        /*
         * No IRQ known to the ACPI subsystem - maybe the BIOS / 
         * driver reported one, then use it. Exit in any case.
         */
        if (irq < 0) {
-               printk(KERN_WARNING PREFIX "PCI interrupt %s[%c]: no GSI",
+               printk(KERN_WARNING PREFIX "PCI Interrupt %s[%c]: no GSI",
                        pci_name(dev), ('A' + pin));
                /* Interrupt Line values above 0xF are forbidden */
                if (dev->irq >= 0 && (dev->irq <= 0xF)) {
                        printk(" - using IRQ %d\n", dev->irq);
+                       acpi_register_gsi(dev->irq, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW);
                        return_VALUE(0);
                }
                else {
@@ -438,14 +444,15 @@ acpi_pci_irq_enable (
                }
        }
 
-       if (via_interrupt_line_quirk)
-               pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq & 15);
-
        dev->irq = acpi_register_gsi(irq, edge_level, active_high_low);
 
-       printk(KERN_INFO PREFIX "PCI interrupt %s[%c] -> GSI %u "
-               "(%s, %s) -> IRQ %d\n",
-               pci_name(dev), 'A' + pin, irq,
+       printk(KERN_INFO PREFIX "PCI Interrupt %s[%c] -> ",
+               pci_name(dev), 'A' + pin);
+
+       if (link)
+               printk("Link [%s] -> ", link);
+
+       printk("GSI %u (%s, %s) -> IRQ %d\n", irq,
                (edge_level == ACPI_LEVEL_SENSITIVE) ? "level" : "edge",
                (active_high_low == ACPI_ACTIVE_LOW) ? "low" : "high",
                dev->irq);
@@ -482,14 +489,14 @@ acpi_pci_irq_disable (
         * First we check the PCI IRQ routing table (PRT) for an IRQ.
         */
        gsi = acpi_pci_irq_lookup(dev->bus, PCI_SLOT(dev->devfn), pin,
-                                 &edge_level, &active_high_low);
+                                 &edge_level, &active_high_low, NULL);
        /*
         * If no PRT entry was found, we'll try to derive an IRQ from the
         * device's parent bridge.
         */
        if (gsi < 0)
                gsi = acpi_pci_irq_derive(dev, pin,
-                                         &edge_level, &active_high_low);
+                                         &edge_level, &active_high_low, NULL);
        if (gsi < 0)
                return_VOID;