aboutsummaryrefslogtreecommitdiff
path: root/sys/x86/pci/pci_bus.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2012-03-29 19:03:22 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2012-03-29 19:03:22 +0000
commit0d95597ca9bf2cbe6081f13b60320fc99c7eeb9c (patch)
tree16d6f5200857c5f9b1d5733c5b7289fa5ebbdc2d /sys/x86/pci/pci_bus.c
parent46092aeec08ee89e493904d0972667ebd6326a17 (diff)
downloadsrc-0d95597ca9bf2cbe6081f13b60320fc99c7eeb9c.tar.gz
src-0d95597ca9bf2cbe6081f13b60320fc99c7eeb9c.zip
Notes
Diffstat (limited to 'sys/x86/pci/pci_bus.c')
-rw-r--r--sys/x86/pci/pci_bus.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/sys/x86/pci/pci_bus.c b/sys/x86/pci/pci_bus.c
index 995e71431205..4363e7b5422d 100644
--- a/sys/x86/pci/pci_bus.c
+++ b/sys/x86/pci/pci_bus.c
@@ -112,14 +112,28 @@ legacy_pcib_alloc_msix(device_t pcib, device_t dev, int *irq)
return (PCIB_ALLOC_MSIX(device_get_parent(bus), dev, irq));
}
-static int
+int
legacy_pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr,
uint32_t *data)
{
- device_t bus;
+ device_t bus, hostb;
+ int error, func, slot;
bus = device_get_parent(pcib);
- return (PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data));
+ error = PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data);
+ if (error)
+ return (error);
+
+ slot = legacy_get_pcislot(pcib);
+ func = legacy_get_pcifunc(pcib);
+ if (slot == -1 || func == -1)
+ return (0);
+ hostb = pci_find_bsf(0, slot, func);
+ KASSERT(hostb != NULL, ("%s: missing hostb for 0:%d:%d", __func__,
+ slot, func));
+ pci_ht_map_msi(hostb, *addr);
+ return (0);
+
}
static const char *
@@ -453,6 +467,8 @@ legacy_pcib_identify(driver_t *driver, device_t parent)
"pcib", busnum);
device_set_desc(child, s);
legacy_set_pcibus(child, busnum);
+ legacy_set_pcislot(child, slot);
+ legacy_set_pcifunc(child, func);
found = 1;
if (id == 0x12258086)