diff options
author | jhb <jhb@FreeBSD.org> | 2006-12-12 19:27:01 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2006-12-12 19:27:01 +0000 |
commit | dfb2d953f134b786c0e5d0cd60880ef72844818e (patch) | |
tree | 8280306c3d817ae71cc7f8f42700414804b1538d /sys/amd64/pci | |
parent | f74d404e39ca043e02da454696983060b9f8bcd6 (diff) | |
download | FreeBSD-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/amd64/pci')
-rw-r--r-- | sys/amd64/pci/pci_bus.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/sys/amd64/pci/pci_bus.c b/sys/amd64/pci/pci_bus.c index 6efde3a..5384831 100644 --- a/sys/amd64/pci/pci_bus.c +++ b/sys/amd64/pci/pci_bus.c @@ -81,6 +81,28 @@ legacy_pcib_route_interrupt(device_t pcib, device_t dev, int pin) return (PCI_INVALID_IRQ); } +/* 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, @@ -322,9 +344,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, legacy_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 } |