Changeset View
Changeset View
Standalone View
Standalone View
sys/arm/allwinner/if_awg.c
Show First 20 Lines • Show All 1,007 Lines • ▼ Show 20 Lines | if (prog > 0) { | ||||
sc->tx.next = i; | sc->tx.next = i; | ||||
if_setdrvflagbits(ifp, 0, IFF_DRV_OACTIVE); | if_setdrvflagbits(ifp, 0, IFF_DRV_OACTIVE); | ||||
} | } | ||||
} | } | ||||
static void | static void | ||||
awg_intr(void *arg) | awg_intr(void *arg) | ||||
{ | { | ||||
struct epoch_tracker et; | |||||
struct awg_softc *sc; | struct awg_softc *sc; | ||||
uint32_t val; | uint32_t val; | ||||
sc = arg; | sc = arg; | ||||
AWG_LOCK(sc); | AWG_LOCK(sc); | ||||
val = RD4(sc, EMAC_INT_STA); | val = RD4(sc, EMAC_INT_STA); | ||||
WR4(sc, EMAC_INT_STA, val); | WR4(sc, EMAC_INT_STA, val); | ||||
if (val & RX_INT) | if (val & RX_INT) { | ||||
NET_EPOCH_ENTER(et); | |||||
kib: This is a style violation. | |||||
Done Inline ActionsYou mean the variable should be declared on top of the function? hselasky: You mean the variable should be declared on top of the function? | |||||
awg_rxintr(sc); | awg_rxintr(sc); | ||||
NET_EPOCH_EXIT(et); | |||||
} | |||||
if (val & TX_INT) | if (val & TX_INT) | ||||
awg_txeof(sc); | awg_txeof(sc); | ||||
if (val & (TX_INT | TX_BUF_UA_INT)) { | if (val & (TX_INT | TX_BUF_UA_INT)) { | ||||
if (!if_sendq_empty(sc->ifp)) | if (!if_sendq_empty(sc->ifp)) | ||||
awg_start_locked(sc); | awg_start_locked(sc); | ||||
} | } | ||||
AWG_UNLOCK(sc); | AWG_UNLOCK(sc); | ||||
} | } | ||||
#ifdef DEVICE_POLLING | #ifdef DEVICE_POLLING | ||||
static int | static int | ||||
awg_poll(if_t ifp, enum poll_cmd cmd, int count) | awg_poll(if_t ifp, enum poll_cmd cmd, int count) | ||||
{ | { | ||||
struct epoch_tracker et; | |||||
struct awg_softc *sc; | struct awg_softc *sc; | ||||
uint32_t val; | uint32_t val; | ||||
int rx_npkts; | int rx_npkts; | ||||
sc = if_getsoftc(ifp); | sc = if_getsoftc(ifp); | ||||
rx_npkts = 0; | rx_npkts = 0; | ||||
AWG_LOCK(sc); | AWG_LOCK(sc); | ||||
if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) { | if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) { | ||||
AWG_UNLOCK(sc); | AWG_UNLOCK(sc); | ||||
return (0); | return (0); | ||||
} | } | ||||
NET_EPOCH_ENTER(et); | |||||
rx_npkts = awg_rxintr(sc); | rx_npkts = awg_rxintr(sc); | ||||
NET_EPOCH_EXIT(et); | |||||
awg_txeof(sc); | awg_txeof(sc); | ||||
if (!if_sendq_empty(ifp)) | if (!if_sendq_empty(ifp)) | ||||
awg_start_locked(sc); | awg_start_locked(sc); | ||||
if (cmd == POLL_AND_CHECK_STATUS) { | if (cmd == POLL_AND_CHECK_STATUS) { | ||||
val = RD4(sc, EMAC_INT_STA); | val = RD4(sc, EMAC_INT_STA); | ||||
if (val != 0) | if (val != 0) | ||||
WR4(sc, EMAC_INT_STA, val); | WR4(sc, EMAC_INT_STA, val); | ||||
▲ Show 20 Lines • Show All 897 Lines • Show Last 20 Lines |
This is a style violation.