svn commit: r219695 - head/sys/mips/cavium/octe

Juli Mallett jmallett at FreeBSD.org
Wed Mar 16 08:56:23 UTC 2011


Author: jmallett
Date: Wed Mar 16 08:56:22 2011
New Revision: 219695
URL: http://svn.freebsd.org/changeset/base/219695

Log:
  o) Tear down receive interrupt on detach.
  
  Submitted by:	Bhanu Prakash

Modified:
  head/sys/mips/cavium/octe/ethernet-common.h
  head/sys/mips/cavium/octe/ethernet.c
  head/sys/mips/cavium/octe/octebus.c
  head/sys/mips/cavium/octe/octebusvar.h

Modified: head/sys/mips/cavium/octe/ethernet-common.h
==============================================================================
--- head/sys/mips/cavium/octe/ethernet-common.h	Wed Mar 16 08:51:36 2011	(r219694)
+++ head/sys/mips/cavium/octe/ethernet-common.h	Wed Mar 16 08:56:22 2011	(r219695)
@@ -39,7 +39,7 @@ void cvm_oct_common_set_multicast_list(s
 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

Modified: head/sys/mips/cavium/octe/ethernet.c
==============================================================================
--- head/sys/mips/cavium/octe/ethernet.c	Wed Mar 16 08:51:36 2011	(r219694)
+++ head/sys/mips/cavium/octe/ethernet.c	Wed Mar 16 08:56:22 2011	(r219695)
@@ -250,7 +250,7 @@ static void cvm_oct_configure_common_hw(
 
         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();

Modified: head/sys/mips/cavium/octe/octebus.c
==============================================================================
--- head/sys/mips/cavium/octe/octebus.c	Wed Mar 16 08:51:36 2011	(r219694)
+++ head/sys/mips/cavium/octe/octebus.c	Wed Mar 16 08:56:22 2011	(r219695)
@@ -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);
 }
 

Modified: head/sys/mips/cavium/octe/octebusvar.h
==============================================================================
--- head/sys/mips/cavium/octe/octebusvar.h	Wed Mar 16 08:51:36 2011	(r219694)
+++ head/sys/mips/cavium/octe/octebusvar.h	Wed Mar 16 08:56:22 2011	(r219695)
@@ -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;


More information about the svn-src-all mailing list