PERFORCE change 125305 for review

Oleksandr Tymoshenko gonzo at FreeBSD.org
Sat Aug 18 08:53:50 PDT 2007


http://perforce.freebsd.org/chv.cgi?CH=125305

Change 125305 by gonzo at gonzo_jeeves on 2007/08/18 15:53:14

	o Make admsw function as interrupt filter

Affected files ...

.. //depot/projects/mips2/src/sys/mips/mips32/adm5120/if_admsw.c#2 edit

Differences ...

==== //depot/projects/mips2/src/sys/mips/mips32/adm5120/if_admsw.c#2 (text+ko) ====

@@ -147,7 +147,7 @@
 static int	admsw_mediachange(struct ifnet *);
 static void	admsw_mediastatus(struct ifnet *, struct ifmediareq *);
 
-static void	admsw_intr(void *);
+static int	admsw_intr(void *);
 
 /* bus entry points */
 static int	admsw_probe(device_t dev);
@@ -415,8 +415,8 @@
                 return (ENXIO);
         }
 
-	if ((error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, NULL, 
-	    admsw_intr, sc, &sc->sc_ih)) != 0) {
+	if ((error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, 
+	    admsw_intr, NULL, sc, &sc->sc_ih)) != 0) {
                 device_printf(dev, 
                     "WARNING: unable to register interrupt handler\n");
                 return (error);
@@ -847,7 +847,7 @@
  *
  *	Interrupt service routine.
  */
-static void
+static int
 admsw_intr(void *arg)
 {
 	struct admsw_softc *sc = arg;
@@ -857,7 +857,7 @@
 	REG_WRITE(ADMSW_INT_ST, pending);
 
 	if (sc->ndevs == 0)
-		return;
+		return (FILTER_STRAY);
 
 	if ((pending & ADMSW_INTR_RHD) != 0)
 		admsw_rxintr(sc, 1);
@@ -871,6 +871,7 @@
 	if ((pending & ADMSW_INTR_SLD) != 0)
 		admsw_txintr(sc, 0);
 
+	return (FILTER_HANDLED);
 }
 
 /*


More information about the p4-projects mailing list