diff options
author | jmallett <jmallett@FreeBSD.org> | 2011-03-16 08:56:22 +0000 |
---|---|---|
committer | jmallett <jmallett@FreeBSD.org> | 2011-03-16 08:56:22 +0000 |
commit | 67b7c6cf191c0e44cee8b101db10858edf82bf7b (patch) | |
tree | af95be18498336879096ae2bd19838360288a90f /sys | |
parent | bcf30d28120c09fd31e7d7728cfcefb712a55676 (diff) | |
download | FreeBSD-src-67b7c6cf191c0e44cee8b101db10858edf82bf7b.zip FreeBSD-src-67b7c6cf191c0e44cee8b101db10858edf82bf7b.tar.gz |
o) Tear down receive interrupt on detach.
Submitted by: Bhanu Prakash
Diffstat (limited to 'sys')
-rw-r--r-- | sys/mips/cavium/octe/ethernet-common.h | 2 | ||||
-rw-r--r-- | sys/mips/cavium/octe/ethernet.c | 9 | ||||
-rw-r--r-- | sys/mips/cavium/octe/octebus.c | 2 | ||||
-rw-r--r-- | sys/mips/cavium/octe/octebusvar.h | 1 |
4 files changed, 7 insertions, 7 deletions
diff --git a/sys/mips/cavium/octe/ethernet-common.h b/sys/mips/cavium/octe/ethernet-common.h index 7c0eea7..f9d4dc3 100644 --- a/sys/mips/cavium/octe/ethernet-common.h +++ b/sys/mips/cavium/octe/ethernet-common.h @@ -39,7 +39,7 @@ void cvm_oct_common_set_multicast_list(struct ifnet *ifp); void cvm_oct_common_set_mac_address(struct ifnet *ifp, const void *); int cvm_oct_init_module(device_t); -void cvm_oct_cleanup_module(void); +void cvm_oct_cleanup_module(device_t); /* * XXX/juli diff --git a/sys/mips/cavium/octe/ethernet.c b/sys/mips/cavium/octe/ethernet.c index 1b69354..3b035fa 100644 --- a/sys/mips/cavium/octe/ethernet.c +++ b/sys/mips/cavium/octe/ethernet.c @@ -250,7 +250,7 @@ static void cvm_oct_configure_common_hw(device_t bus) error = bus_setup_intr(bus, sc->sc_rx_irq, INTR_TYPE_NET | INTR_MPSAFE, cvm_oct_do_interrupt, NULL, cvm_oct_device, - NULL); + &sc->sc_rx_intr_cookie); if (error != 0) { device_printf(bus, "could not setup workq irq"); return; @@ -473,17 +473,16 @@ int cvm_oct_init_module(device_t bus) * * @return Zero on success */ -void cvm_oct_cleanup_module(void) +void cvm_oct_cleanup_module(device_t bus) { int port; + struct octebus_softc *sc = device_get_softc(bus); /* Disable POW interrupt */ cvmx_write_csr(CVMX_POW_WQ_INT_THRX(pow_receive_group), 0); -#if 0 /* Free the interrupt handler */ - free_irq(8 + pow_receive_group, cvm_oct_device); -#endif + bus_teardown_intr(bus, sc->sc_rx_irq, sc->sc_rx_intr_cookie); callout_stop(&cvm_oct_poll_timer); cvm_oct_rx_shutdown(); diff --git a/sys/mips/cavium/octe/octebus.c b/sys/mips/cavium/octe/octebus.c index ec67cf6..dde314d 100644 --- a/sys/mips/cavium/octe/octebus.c +++ b/sys/mips/cavium/octe/octebus.c @@ -112,7 +112,7 @@ octebus_attach(device_t dev) static int octebus_detach(device_t dev) { - cvm_oct_cleanup_module(); + cvm_oct_cleanup_module(dev); return (0); } diff --git a/sys/mips/cavium/octe/octebusvar.h b/sys/mips/cavium/octe/octebusvar.h index 061c020..bb488d4 100644 --- a/sys/mips/cavium/octe/octebusvar.h +++ b/sys/mips/cavium/octe/octebusvar.h @@ -33,6 +33,7 @@ struct octebus_softc { device_t sc_dev; struct resource *sc_rx_irq; + void *sc_rx_intr_cookie; struct resource *sc_rgmii_irq; struct resource *sc_spi_irq; |