Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ctau/if_ct.c
Show First 20 Lines • Show All 242 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Activate interrupt handler from DDK. | * Activate interrupt handler from DDK. | ||||
*/ | */ | ||||
static void ct_intr (void *arg) | static void ct_intr (void *arg) | ||||
{ | { | ||||
bdrv_t *bd = arg; | bdrv_t *bd = arg; | ||||
ct_board_t *b = bd->board; | ct_board_t *b = bd->board; | ||||
#ifndef NETGRAPH | #ifndef NETGRAPH | ||||
struct epoch_tracker et; | |||||
int i; | int i; | ||||
#endif | #endif | ||||
int s = splimp (); | int s = splimp (); | ||||
CT_LOCK (bd); | CT_LOCK (bd); | ||||
/* Turn LED on. */ | /* Turn LED on. */ | ||||
ct_led (b, 1); | ct_led (b, 1); | ||||
ct_int_handler (b); | ct_int_handler (b); | ||||
/* Turn LED off 50 msec later. */ | /* Turn LED off 50 msec later. */ | ||||
callout_reset (&led_timo[b->num], hz/20, ct_led_off, b); | callout_reset (&led_timo[b->num], hz/20, ct_led_off, b); | ||||
CT_UNLOCK (bd); | CT_UNLOCK (bd); | ||||
splx (s); | splx (s); | ||||
#ifndef NETGRAPH | #ifndef NETGRAPH | ||||
NET_EPOCH_ENTER(et); | |||||
/* Pass packets in a lock-free state */ | /* Pass packets in a lock-free state */ | ||||
for (i = 0; i < NCHAN && b->chan[i].type; i++) { | for (i = 0; i < NCHAN && b->chan[i].type; i++) { | ||||
drv_t *d = b->chan[i].sys; | drv_t *d = b->chan[i].sys; | ||||
struct mbuf *m; | struct mbuf *m; | ||||
if (!d || !d->running) | if (!d || !d->running) | ||||
continue; | continue; | ||||
while (_IF_QLEN(&d->queue)) { | while (_IF_QLEN(&d->queue)) { | ||||
IF_DEQUEUE (&d->queue,m); | IF_DEQUEUE (&d->queue,m); | ||||
if (!m) | if (!m) | ||||
continue; | continue; | ||||
sppp_input (d->ifp, m); | sppp_input (d->ifp, m); | ||||
} | } | ||||
} | } | ||||
NET_EPOCH_EXIT(et); | |||||
#endif | #endif | ||||
} | } | ||||
static int probe_irq (ct_board_t *b, int irq) | static int probe_irq (ct_board_t *b, int irq) | ||||
{ | { | ||||
int mask, busy, cnt; | int mask, busy, cnt; | ||||
/* Clear pending irq, if any. */ | /* Clear pending irq, if any. */ | ||||
▲ Show 20 Lines • Show All 1,919 Lines • Show Last 20 Lines |