summaryrefslogtreecommitdiffstats
path: root/sys/i386/pci
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2006-12-12 19:27:01 +0000
committerjhb <jhb@FreeBSD.org>2006-12-12 19:27:01 +0000
commitdfb2d953f134b786c0e5d0cd60880ef72844818e (patch)
tree8280306c3d817ae71cc7f8f42700414804b1538d /sys/i386/pci
parentf74d404e39ca043e02da454696983060b9f8bcd6 (diff)
downloadFreeBSD-src-dfb2d953f134b786c0e5d0cd60880ef72844818e.zip
FreeBSD-src-dfb2d953f134b786c0e5d0cd60880ef72844818e.tar.gz
Give Host-PCI bridge drivers their own pcib_alloc_msi() and
pcib_alloc_msix() methods instead of using the method from the generic PCI-PCI bridge driver as the PCI-PCI methods will be gaining some PCI-PCI specific logic soon.
Diffstat (limited to 'sys/i386/pci')
-rw-r--r--sys/i386/pci/pci_bus.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/sys/i386/pci/pci_bus.c b/sys/i386/pci/pci_bus.c
index a91d214..8c1a532 100644
--- a/sys/i386/pci/pci_bus.c
+++ b/sys/i386/pci/pci_bus.c
@@ -77,6 +77,28 @@ legacy_pcib_write_config(device_t dev, int bus, int slot, int func,
pci_cfgregwrite(bus, slot, func, reg, data, bytes);
}
+/* Pass MSI alloc requests up to the nexus. */
+
+static int
+legacy_pcib_alloc_msi(device_t pcib, device_t dev, int count, int maxcount,
+ int *irqs)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSI(device_get_parent(bus), dev, count, maxcount,
+ irqs));
+}
+
+static int
+legacy_pcib_alloc_msix(device_t pcib, device_t dev, int index, int *irq)
+{
+ device_t bus;
+
+ bus = device_get_parent(pcib);
+ return (PCIB_ALLOC_MSIX(device_get_parent(bus), dev, index, irq));
+}
+
static const char *
legacy_pcib_is_host_bridge(int bus, int slot, int func,
uint32_t id, uint8_t class, uint8_t subclass,
@@ -534,9 +556,9 @@ static device_method_t legacy_pcib_methods[] = {
DEVMETHOD(pcib_read_config, legacy_pcib_read_config),
DEVMETHOD(pcib_write_config, legacy_pcib_write_config),
DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt),
- DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi),
+ DEVMETHOD(pcib_alloc_msi, legacy_pcib_alloc_msi),
DEVMETHOD(pcib_release_msi, pcib_release_msi),
- DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix),
+ DEVMETHOD(pcib_alloc_msix, legacy_pcib_alloc_msix),
DEVMETHOD(pcib_release_msix, pcib_release_msix),
{ 0, 0 }
OpenPOWER on IntegriCloud