diff options
author | andrew <andrew@FreeBSD.org> | 2016-04-20 13:23:06 +0000 |
---|---|---|
committer | andrew <andrew@FreeBSD.org> | 2016-04-20 13:23:06 +0000 |
commit | cb592fde3d0e10ef4e3ec9b362332aa7fcbe742e (patch) | |
tree | 5649c83c30b68a1616c5048dc0fedececc5b9ae4 /sys/arm64 | |
parent | c58cd7252a1f46406e5eba6d068569bd1a26db6d (diff) | |
download | FreeBSD-src-cb592fde3d0e10ef4e3ec9b362332aa7fcbe742e.zip FreeBSD-src-cb592fde3d0e10ef4e3ec9b362332aa7fcbe742e.tar.gz |
Pull out the MSI/MSI-X handling calls to simplify future intrng
integration.
Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys/arm64')
-rw-r--r-- | sys/arm64/cavium/thunder_pcie_pem.c | 53 |
1 files changed, 48 insertions, 5 deletions
diff --git a/sys/arm64/cavium/thunder_pcie_pem.c b/sys/arm64/cavium/thunder_pcie_pem.c index 09ea206..b9c4c87 100644 --- a/sys/arm64/cavium/thunder_pcie_pem.c +++ b/sys/arm64/cavium/thunder_pcie_pem.c @@ -126,6 +126,11 @@ static int thunder_pem_adjust_resource(device_t, device_t, int, struct resource *, rman_res_t, rman_res_t); static struct resource * thunder_pem_alloc_resource(device_t, device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); +static int thunder_pem_alloc_msi(device_t, device_t, int, int, int *); +static int thunder_pem_release_msi(device_t, device_t, int, int *); +static int thunder_pem_map_msi(device_t, device_t, int, uint64_t *, uint32_t *); +static int thunder_pem_alloc_msix(device_t, device_t, int *); +static int thunder_pem_release_msix(device_t, device_t, int); static int thunder_pem_attach(device_t); static int thunder_pem_deactivate_resource(device_t, device_t, int, int, struct resource *); @@ -169,11 +174,12 @@ static device_method_t thunder_pem_methods[] = { DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), - DEVMETHOD(pcib_map_msi, arm_map_msi), - DEVMETHOD(pcib_alloc_msix, arm_alloc_msix), - DEVMETHOD(pcib_release_msix, arm_release_msix), - DEVMETHOD(pcib_alloc_msi, arm_alloc_msi), - DEVMETHOD(pcib_release_msi, arm_release_msi), + DEVMETHOD(pcib_map_msi, thunder_pem_map_msi), + DEVMETHOD(pcib_alloc_msix, thunder_pem_alloc_msix), + DEVMETHOD(pcib_release_msix, thunder_pem_release_msix), + DEVMETHOD(pcib_alloc_msi, thunder_pem_alloc_msi), + DEVMETHOD(pcib_release_msi, thunder_pem_release_msi), + DEVMETHOD_END }; @@ -315,6 +321,43 @@ thunder_pem_adjust_resource(device_t dev, device_t child, int type, } static int +thunder_pem_alloc_msi(device_t pci, device_t child, int count, int maxcount, + int *irqs) +{ + + return (arm_alloc_msi(pci, child, count, maxcount, irqs)); +} + +static int +thunder_pem_release_msi(device_t pci, device_t child, int count, int *irqs) +{ + + return (arm_release_msi(pci, child, count, irqs)); +} + +static int +thunder_pem_map_msi(device_t pci, device_t child, int irq, uint64_t *addr, + uint32_t *data) +{ + + return (arm_map_msi(pci, child, irq, addr, data)); +} + +static int +thunder_pem_alloc_msix(device_t pci, device_t child, int *irq) +{ + + return (arm_alloc_msix(pci, child, irq)); +} + +static int +thunder_pem_release_msix(device_t pci, device_t child, int irq) +{ + + return (arm_release_msix(pci, child, irq)); +} + +static int thunder_pem_identify(device_t dev) { struct thunder_pem_softc *sc; |