Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/stge/if_stge.c
Show First 20 Lines • Show All 1,480 Lines • ▼ Show 20 Lines | if ((status & IS_HostError) != 0) { | ||||
device_printf(sc->sc_dev, | device_printf(sc->sc_dev, | ||||
"Host interface error, resetting...\n"); | "Host interface error, resetting...\n"); | ||||
reinit = 1; | reinit = 1; | ||||
goto force_init; | goto force_init; | ||||
} | } | ||||
/* Receive interrupts. */ | /* Receive interrupts. */ | ||||
if ((status & IS_RxDMAComplete) != 0) { | if ((status & IS_RxDMAComplete) != 0) { | ||||
stge_rxeof(sc); | NET_EPOCH_WRAP(stge_rxeof, (sc)); | ||||
if ((status & IS_RFDListEnd) != 0) | if ((status & IS_RFDListEnd) != 0) | ||||
CSR_WRITE_4(sc, STGE_DMACtrl, | CSR_WRITE_4(sc, STGE_DMACtrl, | ||||
DMAC_RxDMAPollNow); | DMAC_RxDMAPollNow); | ||||
} | } | ||||
/* Transmit interrupts. */ | /* Transmit interrupts. */ | ||||
if ((status & (IS_TxDMAComplete | IS_TxComplete)) != 0) | if ((status & (IS_TxDMAComplete | IS_TxComplete)) != 0) | ||||
stge_txeof(sc); | stge_txeof(sc); | ||||
▲ Show 20 Lines • Show All 290 Lines • ▼ Show 20 Lines | stge_poll(struct ifnet *ifp, enum poll_cmd cmd, int count) | ||||
sc = ifp->if_softc; | sc = ifp->if_softc; | ||||
STGE_LOCK(sc); | STGE_LOCK(sc); | ||||
if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { | if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { | ||||
STGE_UNLOCK(sc); | STGE_UNLOCK(sc); | ||||
return (rx_npkts); | return (rx_npkts); | ||||
} | } | ||||
sc->sc_cdata.stge_rxcycles = count; | sc->sc_cdata.stge_rxcycles = count; | ||||
rx_npkts = stge_rxeof(sc); | rx_npkts = NET_EPOCH_WRAP_RET(stge_rxeof, (sc)); | ||||
stge_txeof(sc); | stge_txeof(sc); | ||||
if (cmd == POLL_AND_CHECK_STATUS) { | if (cmd == POLL_AND_CHECK_STATUS) { | ||||
status = CSR_READ_2(sc, STGE_IntStatus); | status = CSR_READ_2(sc, STGE_IntStatus); | ||||
status &= sc->sc_IntEnable; | status &= sc->sc_IntEnable; | ||||
if (status != 0) { | if (status != 0) { | ||||
if ((status & IS_HostError) != 0) { | if ((status & IS_HostError) != 0) { | ||||
device_printf(sc->sc_dev, | device_printf(sc->sc_dev, | ||||
▲ Show 20 Lines • Show All 797 Lines • Show Last 20 Lines |