Pull out the MSI/MSI-X handling calls to simplify future intrng

integration.

Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Andrew Turner 2016-04-20 13:23:06 +00:00
parent 03815ec1db
commit cf9c1ecfd2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=298343

View File

@ -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
};
@ -314,6 +320,43 @@ thunder_pem_adjust_resource(device_t dev, device_t child, int type,
return (rman_adjust_resource(res, start, end));
}
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)
{