[IA64] Altix pcibus_to_node implementation
[linux-2.6.git] / arch / ia64 / sn / pci / pcibr / pcibr_provider.c
index 9bc4de4..b95e928 100644 (file)
 #include "xtalk/xwidgetdev.h"
 #include "xtalk/hubdev.h"
 
+int
+sal_pcibr_slot_enable(struct pcibus_info *soft, int device, void *resp)
+{
+       struct ia64_sal_retval ret_stuff;
+       uint64_t busnum;
+
+       ret_stuff.status = 0;
+       ret_stuff.v0 = 0;
+
+       busnum = soft->pbi_buscommon.bs_persist_busnum;
+       SAL_CALL_NOLOCK(ret_stuff, (u64) SN_SAL_IOIF_SLOT_ENABLE, (u64) busnum,
+                       (u64) device, (u64) resp, 0, 0, 0, 0);
+
+       return (int)ret_stuff.v0;
+}
+
+int
+sal_pcibr_slot_disable(struct pcibus_info *soft, int device, int action,
+                      void *resp)
+{
+       struct ia64_sal_retval ret_stuff;
+       uint64_t busnum;
+
+       ret_stuff.status = 0;
+       ret_stuff.v0 = 0;
+
+       busnum = soft->pbi_buscommon.bs_persist_busnum;
+       SAL_CALL_NOLOCK(ret_stuff, (u64) SN_SAL_IOIF_SLOT_DISABLE,
+                       (u64) busnum, (u64) device, (u64) action,
+                       (u64) resp, 0, 0, 0);
+
+       return (int)ret_stuff.v0;
+}
+
 static int sal_pcibr_error_interrupt(struct pcibus_info *soft)
 {
        struct ia64_sal_retval ret_stuff;
@@ -51,7 +85,7 @@ pcibr_error_intr_handler(int irq, void *arg, struct pt_regs *regs)
 }
 
 void *
-pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft)
+pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *controller)
 {
        int nasid, cnode, j;
        struct hubdev_info *hubdev_info;
@@ -124,6 +158,14 @@ pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft)
        memset(soft->pbi_int_ate_resource.ate, 0,
               (soft->pbi_int_ate_size * sizeof(uint64_t)));
 
+       if (prom_bussoft->bs_asic_type == PCIIO_ASIC_TYPE_TIOCP)
+               /*
+                * TIO PCI Bridge with no closest node information.
+                * FIXME: Find another way to determine the closest node
+                */
+               controller->node = -1;
+       else
+               controller->node = cnode;
        return soft;
 }
 
@@ -187,3 +229,6 @@ pcibr_init_provider(void)
 
        return 0;
 }
+
+EXPORT_SYMBOL_GPL(sal_pcibr_slot_enable);
+EXPORT_SYMBOL_GPL(sal_pcibr_slot_disable);