summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorrnoland <rnoland@FreeBSD.org>2008-09-19 19:11:35 +0000
committerrnoland <rnoland@FreeBSD.org>2008-09-19 19:11:35 +0000
commit7743c5ac0ad8a724e3c4d14578d438981b0950f3 (patch)
tree2636782346b449dcc29b7ce95ea78d7609a6539e /sys/dev/pci
parenta01a900ec7687c5273672829c5cc1bfbe4f09727 (diff)
downloadFreeBSD-src-7743c5ac0ad8a724e3c4d14578d438981b0950f3.zip
FreeBSD-src-7743c5ac0ad8a724e3c4d14578d438981b0950f3.tar.gz
pci_setup_intr() will only enable MSI/MSI-X for direct children. Add methods
to vga_pci.c to request on behalf of it's children. This causes vgapci to show up as the interrupt owner in vmstat -i, rather than the child device. Approved by: jhb(mentor)
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/vga_pci.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/sys/dev/pci/vga_pci.c b/sys/dev/pci/vga_pci.c
index bc929de..b163969 100644
--- a/sys/dev/pci/vga_pci.c
+++ b/sys/dev/pci/vga_pci.c
@@ -110,6 +110,22 @@ vga_pci_write_ivar(device_t dev, device_t child, int which, uintptr_t value)
return (EINVAL);
}
+static int
+vga_pci_setup_intr(device_t dev, device_t child, struct resource *irq,
+ int flags, driver_filter_t *filter, driver_intr_t *intr, void *arg,
+ void **cookiep)
+{
+ return (BUS_SETUP_INTR(device_get_parent(dev), dev, irq, flags,
+ filter, intr, arg, cookiep));
+}
+
+static int
+vga_pci_teardown_intr(device_t dev, device_t child, struct resource *irq,
+ void *cookie)
+{
+ return (BUS_TEARDOWN_INTR(device_get_parent(dev), dev, irq, cookie));
+}
+
static struct resource *
vga_pci_alloc_resource(device_t dev, device_t child, int type, int *rid,
u_long start, u_long end, u_long count, u_int flags)
@@ -311,8 +327,8 @@ static device_method_t vga_pci_methods[] = {
/* Bus interface */
DEVMETHOD(bus_read_ivar, vga_pci_read_ivar),
DEVMETHOD(bus_write_ivar, vga_pci_write_ivar),
- DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
- DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+ DEVMETHOD(bus_setup_intr, vga_pci_setup_intr),
+ DEVMETHOD(bus_teardown_intr, vga_pci_teardown_intr),
DEVMETHOD(bus_alloc_resource, vga_pci_alloc_resource),
DEVMETHOD(bus_release_resource, vga_pci_release_resource),
OpenPOWER on IntegriCloud