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>
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"
.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,
.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,
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;
}
#include <linux/init.h>
#include <linux/mm.h>
#include <xen/xenbus.h>
+#include <xen/gnttab.h>
#include "pcifront.h"
#define INVALID_GRANT_REF (0)
#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;
}
#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__ */