ia64/linux-2.6.18-xen.hg

changeset 584:72786307fa4c

pciif: do not depend on linux' msix_entries, and use a conversion loop
instead (already done in the frontend).

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Jul 02 13:36:55 2008 +0100 (2008-07-02)
parents 3643a33de277
children 6794141e7418
files drivers/xen/pciback/conf_space_capability_msi.c include/xen/interface/io/pciif.h
line diff
     1.1 --- a/drivers/xen/pciback/conf_space_capability_msi.c	Mon Jun 30 16:14:04 2008 +0100
     1.2 +++ b/drivers/xen/pciback/conf_space_capability_msi.c	Wed Jul 02 13:36:55 2008 +0100
     1.3 @@ -39,9 +39,21 @@ int pciback_enable_msix(struct pciback_d
     1.4  {
     1.5  	int result;
     1.6  
     1.7 -	result = pci_enable_msix(dev, op->msix_entries, op->value);
     1.8 +	if (op->value > SH_INFO_MAX_VEC)
     1.9 +		return -EINVAL;
    1.10 +	else {
    1.11 +		struct msix_entry entries[op->value];
    1.12 +		int i;
    1.13  
    1.14 -	op->value = result;
    1.15 +		for (i = 0; i < op->value; i++) {
    1.16 +			entries[i].entry = op.msix_entries[i].entry;
    1.17 +			entries[i].vector = op.msix_entries[i].vector;
    1.18 +		}
    1.19 +
    1.20 +		result = pci_enable_msix(dev, entries, op->value);
    1.21 +		op->value = result;
    1.22 +	}
    1.23 +
    1.24  	return result;
    1.25  }
    1.26  
     2.1 --- a/include/xen/interface/io/pciif.h	Mon Jun 30 16:14:04 2008 +0100
     2.2 +++ b/include/xen/interface/io/pciif.h	Wed Jul 02 13:36:55 2008 +0100
     2.3 @@ -54,6 +54,11 @@
     2.4   */
     2.5  #define SH_INFO_MAX_VEC     128
     2.6  
     2.7 +struct xen_msix_entry {
     2.8 +    uint16_t vector;
     2.9 +    uint16_t entry;
    2.10 +};
    2.11 +
    2.12  struct xen_pci_op {
    2.13      /* IN: what action to perform: XEN_PCI_OP_* */
    2.14      uint32_t cmd;
    2.15 @@ -75,7 +80,7 @@ struct xen_pci_op {
    2.16      /* IN: Contains extra infor for this operation */
    2.17      uint32_t info;
    2.18      /*IN:  param for msi-x */
    2.19 -    struct msix_entry msix_entries[SH_INFO_MAX_VEC];
    2.20 +    struct xen_msix_entry xen_msix_entries[SH_INFO_MAX_VEC];
    2.21  };
    2.22  
    2.23  struct xen_pci_sharedinfo {