Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/sge/if_sge.c
Show First 20 Lines • Show All 1,325 Lines • ▼ Show 20 Lines | sge_tick(void *arg) | ||||
sge_txeof(sc); | sge_txeof(sc); | ||||
sge_watchdog(sc); | sge_watchdog(sc); | ||||
callout_reset(&sc->sge_stat_ch, hz, sge_tick, sc); | callout_reset(&sc->sge_stat_ch, hz, sge_tick, sc); | ||||
} | } | ||||
static void | static void | ||||
sge_intr(void *arg) | sge_intr(void *arg) | ||||
{ | { | ||||
struct epoch_tracker et; | |||||
struct sge_softc *sc; | struct sge_softc *sc; | ||||
struct ifnet *ifp; | struct ifnet *ifp; | ||||
uint32_t status; | uint32_t status; | ||||
sc = arg; | sc = arg; | ||||
SGE_LOCK(sc); | SGE_LOCK(sc); | ||||
ifp = sc->sge_ifp; | ifp = sc->sge_ifp; | ||||
Show All 15 Lines | sge_intr(void *arg) | ||||
* will increase number of register access and is not correct | * will increase number of register access and is not correct | ||||
* way to handle interrupt moderation but there seems to be | * way to handle interrupt moderation but there seems to be | ||||
* no other way at this time. | * no other way at this time. | ||||
*/ | */ | ||||
for (;;) { | for (;;) { | ||||
if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) | if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) | ||||
break; | break; | ||||
if ((status & (INTR_RX_DONE | INTR_RX_IDLE)) != 0) { | if ((status & (INTR_RX_DONE | INTR_RX_IDLE)) != 0) { | ||||
NET_EPOCH_ENTER(et); | |||||
sge_rxeof(sc); | sge_rxeof(sc); | ||||
NET_EPOCH_EXIT(et); | |||||
/* Wakeup Rx MAC. */ | /* Wakeup Rx MAC. */ | ||||
if ((status & INTR_RX_IDLE) != 0) | if ((status & INTR_RX_IDLE) != 0) | ||||
CSR_WRITE_4(sc, RX_CTL, | CSR_WRITE_4(sc, RX_CTL, | ||||
0x1a00 | 0x000c | RX_CTL_POLL | RX_CTL_ENB); | 0x1a00 | 0x000c | RX_CTL_POLL | RX_CTL_ENB); | ||||
} | } | ||||
if ((status & (INTR_TX_DONE | INTR_TX_IDLE)) != 0) | if ((status & (INTR_TX_DONE | INTR_TX_IDLE)) != 0) | ||||
sge_txeof(sc); | sge_txeof(sc); | ||||
status = CSR_READ_4(sc, IntrStatus); | status = CSR_READ_4(sc, IntrStatus); | ||||
▲ Show 20 Lines • Show All 534 Lines • Show Last 20 Lines |