summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2007-02-14 22:32:55 +0000
committerjhb <jhb@FreeBSD.org>2007-02-14 22:32:55 +0000
commitad38f4e20eb6f0ab76857cf4ad2083b4c4a615e4 (patch)
tree6679675f8da8538e1b34d7e10994ca1681aefafa /sys
parentb1f0030a0d0c6e0d83f55c962d44c40c1cb7c2d9 (diff)
downloadFreeBSD-src-ad38f4e20eb6f0ab76857cf4ad2083b4c4a615e4.zip
FreeBSD-src-ad38f4e20eb6f0ab76857cf4ad2083b4c4a615e4.tar.gz
- Fix an off by one error in pci_remap_msix_method() that effectively
broke the method as all the MSI-X table indices were off by one in the backend MD code. - Fix a cosmetic nit in the bootverbose printf in pci_alloc_msix_method().
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/pci.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index a2b9396..494a9b5 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -1142,7 +1142,7 @@ pci_alloc_msix_method(device_t dev, device_t child, int *count)
/* Unfinished range? */
if (run)
- printf("%d", irq);
+ printf("-%d", irq);
printf(" for MSI-X\n");
}
}
@@ -1221,8 +1221,16 @@ pci_remap_msix_method(device_t dev, device_t child, u_int *indices)
for (i = 0; i < cfg->msix.msix_alloc; i++) {
resource_list_add(&dinfo->resources, SYS_RES_IRQ, indices[i],
irqs[i], irqs[i], 1);
+
+ /*
+ * The indices in the backend code (PCIB_* methods and the
+ * MI helper routines for MD code such as pci_enable_msix())
+ * are all zero-based. However, the indices passed to this
+ * function are 1-based so that the correspond 1:1 with the
+ * SYS_RES_IRQ resource IDs.
+ */
error = PCIB_REMAP_MSIX(device_get_parent(dev), child,
- indices[i], irqs[i]);
+ indices[i] - 1, irqs[i]);
KASSERT(error == 0, ("Failed to remap MSI-X message"));
}
if (bootverbose) {
OpenPOWER on IntegriCloud