fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / arch / ia64 / sn / pci / pcibr / pcibr_provider.c
index 98f716b..6846dc9 100644 (file)
@@ -3,7 +3,7 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 2001-2004 Silicon Graphics, Inc. All rights reserved.
+ * Copyright (C) 2001-2004, 2006 Silicon Graphics, Inc. All rights reserved.
  */
 
 #include <linux/interrupt.h>
@@ -74,12 +74,28 @@ static int sal_pcibr_error_interrupt(struct pcibus_info *soft)
        return (int)ret_stuff.v0;
 }
 
+u16 sn_ioboard_to_pci_bus(struct pci_bus *pci_bus)
+{
+       s64 rc;
+       u16 ioboard;
+       nasid_t nasid = NASID_GET(SN_PCIBUS_BUSSOFT(pci_bus)->bs_base);
+
+       rc = ia64_sn_sysctl_ioboard_get(nasid, &ioboard);
+       if (rc) {
+               printk(KERN_WARNING "ia64_sn_sysctl_ioboard_get failed: %ld\n",
+                      rc);
+               return 0;
+       }
+
+       return ioboard;
+}
+
 /* 
  * PCI Bridge Error interrupt handler.  Gets invoked whenever a PCI 
  * bridge sends an error interrupt.
  */
 static irqreturn_t
-pcibr_error_intr_handler(int irq, void *arg, struct pt_regs *regs)
+pcibr_error_intr_handler(int irq, void *arg)
 {
        struct pcibus_info *soft = (struct pcibus_info *)arg;
 
@@ -93,7 +109,6 @@ void *
 pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *controller)
 {
        int nasid, cnode, j;
-       cnodeid_t near_cnode;
        struct hubdev_info *hubdev_info;
        struct pcibus_info *soft;
        struct sn_flush_device_kernel *sn_flush_device_kernel;
@@ -122,8 +137,8 @@ pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
        /*
         * register the bridge's error interrupt handler
         */
-       if (request_irq(SGI_PCIASIC_ERROR, (void *)pcibr_error_intr_handler,
-                       SA_SHIRQ, "PCIBR error", (void *)(soft))) {
+       if (request_irq(SGI_PCIASIC_ERROR, pcibr_error_intr_handler,
+                       IRQF_SHARED, "PCIBR error", (void *)(soft))) {
                printk(KERN_WARNING
                       "pcibr cannot allocate interrupt for error handler\n");
        }
@@ -170,20 +185,6 @@ pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
                return NULL;
        }
 
-       if (prom_bussoft->bs_asic_type == PCIIO_ASIC_TYPE_TIOCP) {
-               /* TIO PCI Bridge: find nearest node with CPUs */
-               int e = sn_hwperf_get_nearest_node(cnode, NULL, &near_cnode);
-
-               if (e < 0) {
-                       near_cnode = (cnodeid_t)-1; /* use any node */
-                       printk(KERN_WARNING "pcibr_bus_fixup: failed to find "
-                               "near node with CPUs to TIO node %d, err=%d\n",
-                               cnode, e);
-               }
-               controller->node = near_cnode;
-       }
-       else
-               controller->node = cnode;
        return soft;
 }
 
@@ -255,3 +256,4 @@ pcibr_init_provider(void)
 
 EXPORT_SYMBOL_GPL(sal_pcibr_slot_enable);
 EXPORT_SYMBOL_GPL(sal_pcibr_slot_disable);
+EXPORT_SYMBOL_GPL(sn_ioboard_to_pci_bus);