Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ale/if_ale.c
Show First 20 Lines • Show All 2,240 Lines • ▼ Show 20 Lines | ale_intr(void *arg) | ||||
taskqueue_enqueue(sc->ale_tq, &sc->ale_int_task); | taskqueue_enqueue(sc->ale_tq, &sc->ale_int_task); | ||||
return (FILTER_HANDLED); | return (FILTER_HANDLED); | ||||
} | } | ||||
static void | static void | ||||
ale_int_task(void *arg, int pending) | ale_int_task(void *arg, int pending) | ||||
{ | { | ||||
struct epoch_tracker et; | |||||
struct ale_softc *sc; | struct ale_softc *sc; | ||||
struct ifnet *ifp; | struct ifnet *ifp; | ||||
uint32_t status; | uint32_t status; | ||||
int more; | int more; | ||||
sc = (struct ale_softc *)arg; | sc = (struct ale_softc *)arg; | ||||
status = CSR_READ_4(sc, ALE_INTR_STATUS); | status = CSR_READ_4(sc, ALE_INTR_STATUS); | ||||
ALE_LOCK(sc); | ALE_LOCK(sc); | ||||
if (sc->ale_morework != 0) | if (sc->ale_morework != 0) | ||||
status |= INTR_RX_PKT; | status |= INTR_RX_PKT; | ||||
if ((status & ALE_INTRS) == 0) | if ((status & ALE_INTRS) == 0) | ||||
goto done; | goto done; | ||||
/* Acknowledge interrupts but still disable interrupts. */ | /* Acknowledge interrupts but still disable interrupts. */ | ||||
CSR_WRITE_4(sc, ALE_INTR_STATUS, status | INTR_DIS_INT); | CSR_WRITE_4(sc, ALE_INTR_STATUS, status | INTR_DIS_INT); | ||||
ifp = sc->ale_ifp; | ifp = sc->ale_ifp; | ||||
more = 0; | more = 0; | ||||
if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { | if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { | ||||
NET_EPOCH_ENTER(et); | |||||
more = ale_rxeof(sc, sc->ale_process_limit); | more = ale_rxeof(sc, sc->ale_process_limit); | ||||
NET_EPOCH_EXIT(et); | |||||
if (more == EAGAIN) | if (more == EAGAIN) | ||||
sc->ale_morework = 1; | sc->ale_morework = 1; | ||||
else if (more == EIO) { | else if (more == EIO) { | ||||
sc->ale_stats.reset_brk_seq++; | sc->ale_stats.reset_brk_seq++; | ||||
ifp->if_drv_flags &= ~IFF_DRV_RUNNING; | ifp->if_drv_flags &= ~IFF_DRV_RUNNING; | ||||
ale_init_locked(sc); | ale_init_locked(sc); | ||||
ALE_UNLOCK(sc); | ALE_UNLOCK(sc); | ||||
return; | return; | ||||
▲ Show 20 Lines • Show All 811 Lines • Show Last 20 Lines |