Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Aug 2007 15:53:49 GMT
From:      Oleksandr Tymoshenko <gonzo@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 125305 for review
Message-ID:  <200708181553.l7IFrnHx043241@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=125305

Change 125305 by gonzo@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);
 }
 
 /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200708181553.l7IFrnHx043241>