diff options
Diffstat (limited to 'sys/dev/mge/if_mge.c')
-rw-r--r-- | sys/dev/mge/if_mge.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sys/dev/mge/if_mge.c b/sys/dev/mge/if_mge.c index 43a7a18..2373f0c 100644 --- a/sys/dev/mge/if_mge.c +++ b/sys/dev/mge/if_mge.c @@ -106,7 +106,7 @@ static void mge_ver_params(struct mge_softc *sc); static void mge_intrs_ctrl(struct mge_softc *sc, int enable); static void mge_intr_rx(void *arg); -static void mge_intr_rx_locked(struct mge_softc *sc, int count); +static int mge_intr_rx_locked(struct mge_softc *sc, int count); static void mge_intr_tx(void *arg); static void mge_intr_tx_locked(struct mge_softc *sc); static void mge_intr_misc(void *arg); @@ -569,17 +569,18 @@ mge_reinit_rx(struct mge_softc *sc) #ifdef DEVICE_POLLING static poll_handler_t mge_poll; -static void +static int mge_poll(struct ifnet *ifp, enum poll_cmd cmd, int count) { struct mge_softc *sc = ifp->if_softc; uint32_t int_cause, int_cause_ext; + int rx_npkts = 0; MGE_GLOBAL_LOCK(sc); if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { MGE_GLOBAL_UNLOCK(sc); - return; + return (rx_npkts); } if (cmd == POLL_AND_CHECK_STATUS) { @@ -597,9 +598,10 @@ mge_poll(struct ifnet *ifp, enum poll_cmd cmd, int count) } mge_intr_tx_locked(sc); - mge_intr_rx_locked(sc, count); + rx_npkts = mge_intr_rx_locked(sc, count); MGE_GLOBAL_UNLOCK(sc); + return (rx_npkts); } #endif /* DEVICE_POLLING */ @@ -1013,7 +1015,7 @@ mge_intr_rx(void *arg) { } -static void +static int mge_intr_rx_locked(struct mge_softc *sc, int count) { struct ifnet *ifp = sc->ifp; @@ -1021,6 +1023,7 @@ mge_intr_rx_locked(struct mge_softc *sc, int count) uint16_t bufsize; struct mge_desc_wrapper* dw; struct mbuf *mb; + int rx_npkts = 0; MGE_RECEIVE_LOCK_ASSERT(sc); @@ -1059,6 +1062,7 @@ mge_intr_rx_locked(struct mge_softc *sc, int count) MGE_RECEIVE_UNLOCK(sc); (*ifp->if_input)(ifp, mb); MGE_RECEIVE_LOCK(sc); + rx_npkts++; } dw->mge_desc->byte_count = 0; @@ -1071,7 +1075,7 @@ mge_intr_rx_locked(struct mge_softc *sc, int count) count -= 1; } - return; + return (rx_npkts); } static void |