aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2007-02-14 22:32:55 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2007-02-14 22:32:55 +0000
commitea3f508362f9a4c46874690b4609b0567e581962 (patch)
tree6679675f8da8538e1b34d7e10994ca1681aefafa /sys
parent4ccac64eed9d681041c7966e4cb49dabd10d6219 (diff)
Notes
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 a2b9396fa32e..494a9b5cd9e1 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) {