svn commit: r193105 - in head/sys/dev: lmc nge

Attilio Rao attilio at FreeBSD.org
Sat May 30 18:39:23 UTC 2009


Author: attilio
Date: Sat May 30 18:39:22 2009
New Revision: 193105
URL: http://svn.freebsd.org/changeset/base/193105

Log:
  Unbreak build.
  
  Pointy hat to:	attilio

Modified:
  head/sys/dev/lmc/if_lmc.c
  head/sys/dev/lmc/if_lmc.h
  head/sys/dev/nge/if_nge.c

Modified: head/sys/dev/lmc/if_lmc.c
==============================================================================
--- head/sys/dev/lmc/if_lmc.c	Sat May 30 18:23:55 2009	(r193104)
+++ head/sys/dev/lmc/if_lmc.c	Sat May 30 18:39:22 2009	(r193105)
@@ -3976,12 +3976,13 @@ fbsd_poll(struct ifnet *ifp, enum poll_c
     {
     /* Last call -- reenable card interrupts. */
     WRITE_CSR(TLP_INT_ENBL, TLP_INT_TXRX);
-    return;
+    return 0;
     }
 #endif
 
   sc->quota = count;
   core_interrupt(sc, (cmd==POLL_AND_CHECK_STATUS));
+  return 0;
   }
 
 # endif  /* (__FreeBSD__ && DEVICE_POLLING) */

Modified: head/sys/dev/lmc/if_lmc.h
==============================================================================
--- head/sys/dev/lmc/if_lmc.h	Sat May 30 18:23:55 2009	(r193104)
+++ head/sys/dev/lmc/if_lmc.h	Sat May 30 18:39:22 2009	(r193105)
@@ -1571,7 +1571,7 @@ static void core_interrupt(void *, int);
 static void user_interrupt(softc_t *, int);
 #if BSD
 # if (defined(__FreeBSD__) && defined(DEVICE_POLLING))
-static void fbsd_poll(struct ifnet *, enum poll_cmd, int);
+static int fbsd_poll(struct ifnet *, enum poll_cmd, int);
 # endif
 static intr_return_t bsd_interrupt(void *);
 #endif /* BSD */

Modified: head/sys/dev/nge/if_nge.c
==============================================================================
--- head/sys/dev/nge/if_nge.c	Sat May 30 18:23:55 2009	(r193104)
+++ head/sys/dev/nge/if_nge.c	Sat May 30 18:39:22 2009	(r193105)
@@ -157,7 +157,7 @@ static int nge_encap(struct nge_softc *,
 #ifndef __NO_STRICT_ALIGNMENT
 static __inline void nge_fixup_rx(struct mbuf *);
 #endif
-static void nge_rxeof(struct nge_softc *);
+static int nge_rxeof(struct nge_softc *);
 static void nge_txeof(struct nge_softc *);
 static void nge_intr(void *);
 static void nge_tick(void *);
@@ -1575,20 +1575,21 @@ nge_fixup_rx(struct mbuf *m)
  * A frame has been uploaded: pass the resulting mbuf chain up to
  * the higher level protocols.
  */
-static void
+static int
 nge_rxeof(struct nge_softc *sc)
 {
 	struct mbuf *m;
 	struct ifnet *ifp;
 	struct nge_desc *cur_rx;
 	struct nge_rxdesc *rxd;
-	int cons, prog, total_len;
+	int cons, prog, rx_npkts, total_len;
 	uint32_t cmdsts, extsts;
 
 	NGE_LOCK_ASSERT(sc);
 
 	ifp = sc->nge_ifp;
 	cons = sc->nge_cdata.nge_rx_cons;
+	rx_npkts = 0;
 
 	bus_dmamap_sync(sc->nge_cdata.nge_rx_ring_tag,
 	    sc->nge_cdata.nge_rx_ring_map,
@@ -1734,6 +1735,7 @@ nge_rxeof(struct nge_softc *sc)
 		NGE_UNLOCK(sc);
 		(*ifp->if_input)(ifp, m);
 		NGE_LOCK(sc);
+		rx_npkts++;
 	}
 
 	if (prog > 0) {
@@ -1742,6 +1744,7 @@ nge_rxeof(struct nge_softc *sc)
 		    sc->nge_cdata.nge_rx_ring_map,
 		    BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
 	}
+	return (rx_npkts);
 }
 
 /*
@@ -1888,17 +1891,18 @@ nge_stats_update(struct nge_softc *sc)
 #ifdef DEVICE_POLLING
 static poll_handler_t nge_poll;
 
-static void
+static int
 nge_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
 {
 	struct nge_softc *sc;
+	int rx_npkts = 0;
 
 	sc = ifp->if_softc;
 
 	NGE_LOCK(sc);
 	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
 		NGE_UNLOCK(sc);
-		return;
+		return (rx_npkts);
 	}
 
 	/*
@@ -1909,7 +1913,7 @@ nge_poll(struct ifnet *ifp, enum poll_cm
 	 * and then call the interrupt routine.
 	 */
 	sc->rxcycles = count;
-	nge_rxeof(sc);
+	rx_npkts = nge_rxeof(sc);
 	nge_txeof(sc);
 	if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
 		nge_start_locked(ifp);
@@ -1921,7 +1925,7 @@ nge_poll(struct ifnet *ifp, enum poll_cm
 		status = CSR_READ_4(sc, NGE_ISR);
 
 		if ((status & (NGE_ISR_RX_ERR|NGE_ISR_RX_OFLOW)) != 0)
-			nge_rxeof(sc);
+			rx_npkts += nge_rxeof(sc);
 
 		if ((status & NGE_ISR_RX_IDLE) != 0)
 			NGE_SETBIT(sc, NGE_CSR, NGE_CSR_RX_ENABLE);
@@ -1932,6 +1936,7 @@ nge_poll(struct ifnet *ifp, enum poll_cm
 		}
 	}
 	NGE_UNLOCK(sc);
+	return (rx_npkts);
 }
 #endif /* DEVICE_POLLING */
 


More information about the svn-src-all mailing list