ia64/xen-unstable

changeset 10861:93c785354dd1

[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@bull.net>
author kfraser@localhost.localdomain
date Fri Jul 28 17:23:15 2006 +0100 (2006-07-28)
parents 23c37bc942da
children 12f75f4e2ea8
files 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
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/ia64/Kconfig	Fri Jul 28 17:13:08 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/ia64/Kconfig	Fri Jul 28 17:23:15 2006 +0100
     1.3 @@ -438,6 +438,21 @@ config PCI_DOMAINS
     1.4  	bool
     1.5  	default PCI
     1.6  
     1.7 +config XEN_PCIDEV_FRONTEND
     1.8 +	bool "Xen PCI Frontend"
     1.9 +	depends on PCI && XEN
    1.10 +	default y
    1.11 +	help
    1.12 +	  The PCI device frontend driver allows the kernel to import arbitrary
    1.13 +	  PCI devices from a PCI backend to support PCI driver domains.
    1.14 +
    1.15 +config XEN_PCIDEV_FE_DEBUG
    1.16 +	bool "Xen PCI Frontend Debugging"
    1.17 +	depends on XEN_PCIDEV_FRONTEND
    1.18 +	default n
    1.19 +	help
    1.20 +	  Enables some debug statements within the PCI Frontend.
    1.21 +
    1.22  source "drivers/pci/Kconfig"
    1.23  
    1.24  source "drivers/pci/hotplug/Kconfig"
     2.1 --- a/linux-2.6-xen-sparse/drivers/xen/pcifront/pci_op.c	Fri Jul 28 17:13:08 2006 +0100
     2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/pcifront/pci_op.c	Fri Jul 28 17:23:15 2006 +0100
     2.3 @@ -105,7 +105,7 @@ static int pcifront_bus_read(struct pci_
     2.4  		.size   = size,
     2.5  	};
     2.6  	struct pcifront_sd *sd = bus->sysdata;
     2.7 -	struct pcifront_device *pdev = sd->pdev;
     2.8 +	struct pcifront_device *pdev = pcifront_get_pdev(sd);
     2.9  
    2.10  	if (verbose_request)
    2.11  		dev_info(&pdev->xdev->dev,
    2.12 @@ -144,7 +144,7 @@ static int pcifront_bus_write(struct pci
    2.13  		.value  = val,
    2.14  	};
    2.15  	struct pcifront_sd *sd = bus->sysdata;
    2.16 -	struct pcifront_device *pdev = sd->pdev;
    2.17 +	struct pcifront_device *pdev = pcifront_get_pdev(sd);
    2.18  
    2.19  	if (verbose_request)
    2.20  		dev_info(&pdev->xdev->dev,
    2.21 @@ -207,12 +207,13 @@ int pcifront_scan_root(struct pcifront_d
    2.22  		err = -ENOMEM;
    2.23  		goto err_out;
    2.24  	}
    2.25 -	sd->domain = domain;
    2.26 -	sd->pdev = pdev;
    2.27 +	pcifront_init_sd(sd, domain, pdev);
    2.28  
    2.29 -	b = pci_scan_bus_parented(&pdev->xdev->dev, bus, &pcifront_bus_ops, sd);
    2.30 +	b = pci_scan_bus_parented(&pdev->xdev->dev, bus,
    2.31 +				  &pcifront_bus_ops, sd);
    2.32  	if (!b) {
    2.33 -		dev_err(&pdev->xdev->dev, "Error creating PCI Frontend Bus!\n");
    2.34 +		dev_err(&pdev->xdev->dev,
    2.35 +			"Error creating PCI Frontend Bus!\n");
    2.36  		err = -ENOMEM;
    2.37  		goto err_out;
    2.38  	}
     3.1 --- a/linux-2.6-xen-sparse/drivers/xen/pcifront/xenbus.c	Fri Jul 28 17:13:08 2006 +0100
     3.2 +++ b/linux-2.6-xen-sparse/drivers/xen/pcifront/xenbus.c	Fri Jul 28 17:23:15 2006 +0100
     3.3 @@ -7,6 +7,7 @@
     3.4  #include <linux/init.h>
     3.5  #include <linux/mm.h>
     3.6  #include <xen/xenbus.h>
     3.7 +#include <xen/gnttab.h>
     3.8  #include "pcifront.h"
     3.9  
    3.10  #define INVALID_GRANT_REF (0)
     4.1 --- a/linux-2.6-xen-sparse/include/xen/pcifront.h	Fri Jul 28 17:13:08 2006 +0100
     4.2 +++ b/linux-2.6-xen-sparse/include/xen/pcifront.h	Fri Jul 28 17:23:15 2006 +0100
     4.3 @@ -11,16 +11,30 @@
     4.4  
     4.5  #ifdef __KERNEL__
     4.6  
     4.7 +#ifndef __ia64__
     4.8 +
     4.9  struct pcifront_device;
    4.10 +struct pci_bus;
    4.11  
    4.12  struct pcifront_sd {
    4.13  	int domain;
    4.14  	struct pcifront_device *pdev;
    4.15  };
    4.16  
    4.17 -struct pci_bus;
    4.18 +static inline struct pcifront_device *
    4.19 +pcifront_get_pdev(struct pcifront_sd *sd)
    4.20 +{
    4.21 +	return sd->pdev;
    4.22 +}
    4.23  
    4.24 -#ifdef CONFIG_PCI_DOMAINS
    4.25 +static inline void pcifront_init_sd(struct pcifront_sd *sd, int domain,
    4.26 +				    struct pcifront_device *pdev)
    4.27 +{
    4.28 +	sd->domain = domain;
    4.29 +	sd->pdev = pdev;
    4.30 +}
    4.31 +
    4.32 +#if defined(CONFIG_PCI_DOMAINS)
    4.33  static inline int pci_domain_nr(struct pci_bus *bus)
    4.34  {
    4.35  	struct pcifront_sd *sd = bus->sysdata;
    4.36 @@ -32,6 +46,30 @@ static inline int pci_proc_domain(struct
    4.37  }
    4.38  #endif /* CONFIG_PCI_DOMAINS */
    4.39  
    4.40 +#else /* __ia64__ */
    4.41 +
    4.42 +#include <asm/pci.h>
    4.43 +#define pcifront_sd pci_controller
    4.44 +
    4.45 +static inline struct pcifront_device *
    4.46 +pcifront_get_pdev(struct pcifront_sd *sd)
    4.47 +{
    4.48 +	return (struct pcifront_device *)sd->platform_data;
    4.49 +}
    4.50 +
    4.51 +static inline void pcifront_init_sd(struct pcifront_sd *sd, int domain,
    4.52 +				    struct pcifront_device *pdev)
    4.53 +{
    4.54 +	sd->segment = domain;
    4.55 +	sd->acpi_handle = NULL;
    4.56 +	sd->iommu = NULL;
    4.57 +	sd->windows = 0;
    4.58 +	sd->window = NULL;
    4.59 +	sd->platform_data = pdev;
    4.60 +}
    4.61 +
    4.62 +#endif /* __ia64__ */
    4.63 +
    4.64  extern spinlock_t pci_bus_lock;
    4.65  
    4.66  #endif /* __KERNEL__ */