Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/smc/if_smc.c
Show First 20 Lines • Show All 667 Lines • ▼ Show 20 Lines | next_packet: | ||||
* See if there's anything else to do. | * See if there's anything else to do. | ||||
*/ | */ | ||||
smc_start(ifp); | smc_start(ifp); | ||||
} | } | ||||
static void | static void | ||||
smc_task_rx(void *context, int pending) | smc_task_rx(void *context, int pending) | ||||
{ | { | ||||
struct epoch_tracker et; | |||||
u_int packet, status, len; | u_int packet, status, len; | ||||
uint8_t *data; | uint8_t *data; | ||||
struct ifnet *ifp; | struct ifnet *ifp; | ||||
struct smc_softc *sc; | struct smc_softc *sc; | ||||
struct mbuf *m, *mhead, *mtail; | struct mbuf *m, *mhead, *mtail; | ||||
(void)pending; | (void)pending; | ||||
ifp = (struct ifnet *)context; | ifp = (struct ifnet *)context; | ||||
▲ Show 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | smc_task_rx(void *context, int pending) | ||||
} | } | ||||
sc->smc_mask |= RCV_INT; | sc->smc_mask |= RCV_INT; | ||||
if ((ifp->if_capenable & IFCAP_POLLING) == 0) | if ((ifp->if_capenable & IFCAP_POLLING) == 0) | ||||
smc_write_1(sc, MSK, sc->smc_mask); | smc_write_1(sc, MSK, sc->smc_mask); | ||||
SMC_UNLOCK(sc); | SMC_UNLOCK(sc); | ||||
NET_EPOCH_ENTER(et); | |||||
while (mhead != NULL) { | while (mhead != NULL) { | ||||
m = mhead; | m = mhead; | ||||
mhead = mhead->m_next; | mhead = mhead->m_next; | ||||
m->m_next = NULL; | m->m_next = NULL; | ||||
if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); | if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); | ||||
(*ifp->if_input)(ifp, m); | (*ifp->if_input)(ifp, m); | ||||
} | } | ||||
NET_EPOCH_EXIT(et); | |||||
} | } | ||||
#ifdef DEVICE_POLLING | #ifdef DEVICE_POLLING | ||||
static int | static int | ||||
smc_poll(struct ifnet *ifp, enum poll_cmd cmd, int count) | smc_poll(struct ifnet *ifp, enum poll_cmd cmd, int count) | ||||
{ | { | ||||
struct smc_softc *sc; | struct smc_softc *sc; | ||||
▲ Show 20 Lines • Show All 538 Lines • Show Last 20 Lines |