ia64/linux-2.6.18-xen.hg

changeset 657:7ec0d9030d8a

MSI-X: Fix pciback_enable_msix().
Signed-off-by: Yu Zhao <yu.zhao@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Sep 04 15:10:11 2008 +0100 (2008-09-04)
parents c47b7e47ab19
children 2dc7ebf488b9
files drivers/xen/pciback/conf_space_capability_msi.c
line diff
     1.1 --- a/drivers/xen/pciback/conf_space_capability_msi.c	Thu Sep 04 11:30:39 2008 +0100
     1.2 +++ b/drivers/xen/pciback/conf_space_capability_msi.c	Thu Sep 04 15:10:11 2008 +0100
     1.3 @@ -37,23 +37,27 @@ int pciback_disable_msi(struct pciback_d
     1.4  int pciback_enable_msix(struct pciback_device *pdev,
     1.5  		struct pci_dev *dev, struct xen_pci_op *op)
     1.6  {
     1.7 +	int i;
     1.8  	int result;
     1.9 +	struct msix_entry entries[op->value];
    1.10  
    1.11  	if (op->value > SH_INFO_MAX_VEC)
    1.12  		return -EINVAL;
    1.13 -	else {
    1.14 -		struct msix_entry entries[op->value];
    1.15 -		int i;
    1.16  
    1.17 -		for (i = 0; i < op->value; i++) {
    1.18 -			entries[i].entry = op->msix_entries[i].entry;
    1.19 -			entries[i].vector = op->msix_entries[i].vector;
    1.20 -		}
    1.21 +	for (i = 0; i < op->value; i++) {
    1.22 +		entries[i].entry = op->msix_entries[i].entry;
    1.23 +		entries[i].vector = op->msix_entries[i].vector;
    1.24 +	}
    1.25  
    1.26 -		result = pci_enable_msix(dev, entries, op->value);
    1.27 -		op->value = result;
    1.28 +	result = pci_enable_msix(dev, entries, op->value);
    1.29 +
    1.30 +	for (i = 0; i < op->value; i++) {
    1.31 +		op->msix_entries[i].entry = entries[i].entry;
    1.32 +		op->msix_entries[i].vector = entries[i].vector;
    1.33  	}
    1.34  
    1.35 +	op->value = result;
    1.36 +
    1.37  	return result;
    1.38  }
    1.39