Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/wi/if_wi.c
Show First 20 Lines • Show All 551 Lines • ▼ Show 20 Lines | wi_shutdown(device_t dev) | ||||
wi_stop(sc, 1); | wi_stop(sc, 1); | ||||
WI_UNLOCK(sc); | WI_UNLOCK(sc); | ||||
return (0); | return (0); | ||||
} | } | ||||
void | void | ||||
wi_intr(void *arg) | wi_intr(void *arg) | ||||
{ | { | ||||
struct epoch_tracker et; | |||||
struct wi_softc *sc = arg; | struct wi_softc *sc = arg; | ||||
u_int16_t status; | u_int16_t status; | ||||
WI_LOCK(sc); | WI_LOCK(sc); | ||||
if (sc->wi_gone || !sc->sc_enabled || | if (sc->wi_gone || !sc->sc_enabled || | ||||
(sc->sc_flags & WI_FLAGS_RUNNING) == 0) { | (sc->sc_flags & WI_FLAGS_RUNNING) == 0) { | ||||
CSR_WRITE_2(sc, WI_INT_EN, 0); | CSR_WRITE_2(sc, WI_INT_EN, 0); | ||||
CSR_WRITE_2(sc, WI_EVENT_ACK, 0xFFFF); | CSR_WRITE_2(sc, WI_EVENT_ACK, 0xFFFF); | ||||
WI_UNLOCK(sc); | WI_UNLOCK(sc); | ||||
return; | return; | ||||
} | } | ||||
/* Disable interrupts. */ | /* Disable interrupts. */ | ||||
CSR_WRITE_2(sc, WI_INT_EN, 0); | CSR_WRITE_2(sc, WI_INT_EN, 0); | ||||
status = CSR_READ_2(sc, WI_EVENT_STAT); | status = CSR_READ_2(sc, WI_EVENT_STAT); | ||||
if (status & WI_EV_RX) | if (status & WI_EV_RX) { | ||||
NET_EPOCH_ENTER(et); | |||||
wi_rx_intr(sc); | wi_rx_intr(sc); | ||||
NET_EPOCH_EXIT(et); | |||||
} | |||||
if (status & WI_EV_ALLOC) | if (status & WI_EV_ALLOC) | ||||
wi_tx_intr(sc); | wi_tx_intr(sc); | ||||
if (status & WI_EV_TX_EXC) | if (status & WI_EV_TX_EXC) | ||||
wi_tx_ex_intr(sc); | wi_tx_ex_intr(sc); | ||||
if (status & WI_EV_INFO) | if (status & WI_EV_INFO) | ||||
wi_info_intr(sc); | wi_info_intr(sc); | ||||
if (mbufq_first(&sc->sc_snd) != NULL) | if (mbufq_first(&sc->sc_snd) != NULL) | ||||
wi_start(sc); | wi_start(sc); | ||||
▲ Show 20 Lines • Show All 1,498 Lines • Show Last 20 Lines |