[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [PCI] Pcifront for ia64.



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID 93c785354dd13a9616469a8f2a4e75ac726f66c9
# Parent  23c37bc942da6cffaa9936784af7913a0a091675
[PCI] Pcifront for ia64.

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@xxxxxxxx>
---
 linux-2.6-xen-sparse/arch/ia64/Kconfig             |   15 +++++++
 linux-2.6-xen-sparse/drivers/xen/pcifront/pci_op.c |   15 ++++---
 linux-2.6-xen-sparse/drivers/xen/pcifront/xenbus.c |    1 
 linux-2.6-xen-sparse/include/xen/pcifront.h        |   42 ++++++++++++++++++++-
 4 files changed, 64 insertions(+), 9 deletions(-)

diff -r 23c37bc942da -r 93c785354dd1 linux-2.6-xen-sparse/arch/ia64/Kconfig
--- a/linux-2.6-xen-sparse/arch/ia64/Kconfig    Fri Jul 28 17:13:08 2006 +0100
+++ b/linux-2.6-xen-sparse/arch/ia64/Kconfig    Fri Jul 28 17:23:15 2006 +0100
@@ -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"
diff -r 23c37bc942da -r 93c785354dd1 
linux-2.6-xen-sparse/drivers/xen/pcifront/pci_op.c
--- a/linux-2.6-xen-sparse/drivers/xen/pcifront/pci_op.c        Fri Jul 28 
17:13:08 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/pcifront/pci_op.c        Fri Jul 28 
17:23:15 2006 +0100
@@ -105,7 +105,7 @@ static int pcifront_bus_read(struct pci_
                .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
                .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_d
                err = -ENOMEM;
                goto err_out;
        }
-       sd->domain = domain;
-       sd->pdev = pdev;
-
-       b = pci_scan_bus_parented(&pdev->xdev->dev, bus, &pcifront_bus_ops, sd);
+       pcifront_init_sd(sd, domain, pdev);
+
+       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;
        }
diff -r 23c37bc942da -r 93c785354dd1 
linux-2.6-xen-sparse/drivers/xen/pcifront/xenbus.c
--- a/linux-2.6-xen-sparse/drivers/xen/pcifront/xenbus.c        Fri Jul 28 
17:13:08 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/pcifront/xenbus.c        Fri Jul 28 
17:23:15 2006 +0100
@@ -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)
diff -r 23c37bc942da -r 93c785354dd1 linux-2.6-xen-sparse/include/xen/pcifront.h
--- a/linux-2.6-xen-sparse/include/xen/pcifront.h       Fri Jul 28 17:13:08 
2006 +0100
+++ b/linux-2.6-xen-sparse/include/xen/pcifront.h       Fri Jul 28 17:23:15 
2006 +0100
@@ -11,16 +11,30 @@
 
 #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
 }
 #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__ */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.