fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / include / asm-ia64 / sn / pcidev.h
index ed4031d..9fe89a9 100644 (file)
@@ -3,17 +3,27 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 1992 - 1997, 2000-2004 Silicon Graphics, Inc. All rights reserved.
+ * Copyright (C) 1992 - 1997, 2000-2006 Silicon Graphics, Inc. All rights reserved.
  */
 #ifndef _ASM_IA64_SN_PCI_PCIDEV_H
 #define _ASM_IA64_SN_PCI_PCIDEV_H
 
 #include <linux/pci.h>
 
-extern struct sn_irq_info **sn_irq;
+/*
+ * In ia64, pci_dev->sysdata must be a *pci_controller. To provide access to
+ * the pcidev_info structs for all devices under a controller, we keep a
+ * list of pcidev_info under pci_controller->platform_data.
+ */
+struct sn_platform_data {
+       void *provider_soft;
+       struct list_head pcidev_info;
+};
 
-#define SN_PCIDEV_INFO(pci_dev) \
-        ((struct pcidev_info *)(pci_dev)->sysdata)
+#define SN_PLATFORM_DATA(busdev) \
+       ((struct sn_platform_data *)(PCI_CONTROLLER(busdev)->platform_data))
+
+#define SN_PCIDEV_INFO(dev)    sn_pcidev_info_get(dev)
 
 /*
  * Given a pci_bus, return the sn pcibus_bussoft struct.  Note that
@@ -21,8 +31,10 @@ extern struct sn_irq_info **sn_irq;
  */
 
 #define SN_PCIBUS_BUSSOFT(pci_bus) \
-        ((struct pcibus_bussoft *)(PCI_CONTROLLER((pci_bus))->platform_data))
+       ((struct pcibus_bussoft *)(SN_PLATFORM_DATA(pci_bus)->provider_soft))
 
+#define SN_PCIBUS_BUSSOFT_INFO(pci_bus) \
+       ((struct pcibus_info *)(SN_PLATFORM_DATA(pci_bus)->provider_soft))
 /*
  * Given a struct pci_dev, return the sn pcibus_bussoft struct.  Note
  * that this is not equivalent to SN_PCIBUS_BUSSOFT(pci_dev->bus) due
@@ -41,8 +53,8 @@ extern struct sn_irq_info **sn_irq;
 #define PCIIO_VENDOR_ID_NONE   (-1)
 
 struct pcidev_info {
-       uint64_t                pdi_pio_mapped_addr[7]; /* 6 BARs PLUS 1 ROM */
-       uint64_t                pdi_slot_host_handle;   /* Bus and devfn Host pci_dev */
+       u64             pdi_pio_mapped_addr[7]; /* 6 BARs PLUS 1 ROM */
+       u64             pdi_slot_host_handle;   /* Bus and devfn Host pci_dev */
 
        struct pcibus_bussoft   *pdi_pcibus_info;       /* Kernel common bus soft */
        struct pcidev_info      *pdi_host_pcidev_info;  /* Kernel Host pci_dev */
@@ -50,9 +62,18 @@ struct pcidev_info {
 
        struct sn_irq_info      *pdi_sn_irq_info;
        struct sn_pcibus_provider *pdi_provider;        /* sn pci ops */
+       struct pci_dev          *host_pci_dev;          /* host bus link */
+       struct list_head        pdi_list;               /* List of pcidev_info */
 };
 
 extern void sn_irq_fixup(struct pci_dev *pci_dev,
                         struct sn_irq_info *sn_irq_info);
-
+extern void sn_irq_unfixup(struct pci_dev *pci_dev);
+extern struct pcidev_info * sn_pcidev_info_get(struct pci_dev *);
+extern void sn_bus_store_sysdata(struct pci_dev *dev);
+extern void sn_bus_free_sysdata(void);
+extern void sn_generate_path(struct pci_bus *pci_bus, char *address);
+extern void sn_pci_fixup_slot(struct pci_dev *dev);
+extern void sn_pci_unfixup_slot(struct pci_dev *dev);
+extern void sn_irq_lh_init(void);
 #endif                         /* _ASM_IA64_SN_PCI_PCIDEV_H */