]> xenbits.xensource.com Git - xen.git/commitdiff
[PCI] Pcifront for ia64.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 28 Jul 2006 16:23:15 +0000 (17:23 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 28 Jul 2006 16:23:15 +0000 (17:23 +0100)
Added in Kconfig.
On ia64, use ia64 sysdata instead of pcifront genuine one.
Fix a warning on xenbus.c

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
linux-2.6-xen-sparse/arch/ia64/Kconfig
linux-2.6-xen-sparse/drivers/xen/pcifront/pci_op.c
linux-2.6-xen-sparse/drivers/xen/pcifront/xenbus.c
linux-2.6-xen-sparse/include/xen/pcifront.h

index 63a51952905daca8136f456cc84f6d37ed5e40a2..a74eeffde4618e305dd43791efcc32b8beb7e4df 100644 (file)
@@ -438,6 +438,21 @@ config PCI_DOMAINS
        bool
        default PCI
 
+config XEN_PCIDEV_FRONTEND
+       bool "Xen PCI Frontend"
+       depends on PCI && XEN
+       default y
+       help
+         The PCI device frontend driver allows the kernel to import arbitrary
+         PCI devices from a PCI backend to support PCI driver domains.
+
+config XEN_PCIDEV_FE_DEBUG
+       bool "Xen PCI Frontend Debugging"
+       depends on XEN_PCIDEV_FRONTEND
+       default n
+       help
+         Enables some debug statements within the PCI Frontend.
+
 source "drivers/pci/Kconfig"
 
 source "drivers/pci/hotplug/Kconfig"
index 38906ade6e001512e622e944d9184eb82df88377..6be14aebdc31358eacfabb3af1e6589b9307c6cc 100644 (file)
@@ -105,7 +105,7 @@ static int pcifront_bus_read(struct pci_bus *bus, unsigned int devfn,
                .size   = size,
        };
        struct pcifront_sd *sd = bus->sysdata;
-       struct pcifront_device *pdev = sd->pdev;
+       struct pcifront_device *pdev = pcifront_get_pdev(sd);
 
        if (verbose_request)
                dev_info(&pdev->xdev->dev,
@@ -144,7 +144,7 @@ static int pcifront_bus_write(struct pci_bus *bus, unsigned int devfn,
                .value  = val,
        };
        struct pcifront_sd *sd = bus->sysdata;
-       struct pcifront_device *pdev = sd->pdev;
+       struct pcifront_device *pdev = pcifront_get_pdev(sd);
 
        if (verbose_request)
                dev_info(&pdev->xdev->dev,
@@ -207,12 +207,13 @@ int pcifront_scan_root(struct pcifront_device *pdev,
                err = -ENOMEM;
                goto err_out;
        }
-       sd->domain = domain;
-       sd->pdev = pdev;
+       pcifront_init_sd(sd, domain, pdev);
 
-       b = pci_scan_bus_parented(&pdev->xdev->dev, bus, &pcifront_bus_ops, sd);
+       b = pci_scan_bus_parented(&pdev->xdev->dev, bus,
+                                 &pcifront_bus_ops, sd);
        if (!b) {
-               dev_err(&pdev->xdev->dev, "Error creating PCI Frontend Bus!\n");
+               dev_err(&pdev->xdev->dev,
+                       "Error creating PCI Frontend Bus!\n");
                err = -ENOMEM;
                goto err_out;
        }
index 10d86812d843f04861f1ee54c41c3cf5da4318b9..f3a642e5b67b442ac54fb073beead5debc59eb4f 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/init.h>
 #include <linux/mm.h>
 #include <xen/xenbus.h>
+#include <xen/gnttab.h>
 #include "pcifront.h"
 
 #define INVALID_GRANT_REF (0)
index 51b170a0fc74165e503ac8b210c70360d4a40003..17c843ade14c65cb670123cf8b9472b5d4bd7a6e 100644 (file)
 
 #ifdef __KERNEL__
 
+#ifndef __ia64__
+
 struct pcifront_device;
+struct pci_bus;
 
 struct pcifront_sd {
        int domain;
        struct pcifront_device *pdev;
 };
 
-struct pci_bus;
+static inline struct pcifront_device *
+pcifront_get_pdev(struct pcifront_sd *sd)
+{
+       return sd->pdev;
+}
 
-#ifdef CONFIG_PCI_DOMAINS
+static inline void pcifront_init_sd(struct pcifront_sd *sd, int domain,
+                                   struct pcifront_device *pdev)
+{
+       sd->domain = domain;
+       sd->pdev = pdev;
+}
+
+#if defined(CONFIG_PCI_DOMAINS)
 static inline int pci_domain_nr(struct pci_bus *bus)
 {
        struct pcifront_sd *sd = bus->sysdata;
@@ -32,6 +46,30 @@ static inline int pci_proc_domain(struct pci_bus *bus)
 }
 #endif /* CONFIG_PCI_DOMAINS */
 
+#else /* __ia64__ */
+
+#include <asm/pci.h>
+#define pcifront_sd pci_controller
+
+static inline struct pcifront_device *
+pcifront_get_pdev(struct pcifront_sd *sd)
+{
+       return (struct pcifront_device *)sd->platform_data;
+}
+
+static inline void pcifront_init_sd(struct pcifront_sd *sd, int domain,
+                                   struct pcifront_device *pdev)
+{
+       sd->segment = domain;
+       sd->acpi_handle = NULL;
+       sd->iommu = NULL;
+       sd->windows = 0;
+       sd->window = NULL;
+       sd->platform_data = pdev;
+}
+
+#endif /* __ia64__ */
+
 extern spinlock_t pci_bus_lock;
 
 #endif /* __KERNEL__ */