diff options
author | glebius <glebius@FreeBSD.org> | 2004-11-02 21:24:30 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2004-11-02 21:24:30 +0000 |
commit | a033067901d630caa7ecc38fcf8a0d416a4b6d3d (patch) | |
tree | a65f34c1266b3b9307271ab695db1b77e0055c9e /sys/netgraph/ng_source.c | |
parent | 8b6661b126d65e1e6be9c505085ca230e7f42f01 (diff) | |
download | FreeBSD-src-a033067901d630caa7ecc38fcf8a0d416a4b6d3d.zip FreeBSD-src-a033067901d630caa7ecc38fcf8a0d416a4b6d3d.tar.gz |
- Make ng_timeout() to use callout() interface instead of timeout().
- Remove callout-hacking from ng_untimeout().
Approved by: julian (mentor)
MFC after: 1 month
Diffstat (limited to 'sys/netgraph/ng_source.c')
-rw-r--r-- | sys/netgraph/ng_source.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sys/netgraph/ng_source.c b/sys/netgraph/ng_source.c index 291d9c9..809c7ff 100644 --- a/sys/netgraph/ng_source.c +++ b/sys/netgraph/ng_source.c @@ -87,7 +87,7 @@ struct privdata { struct ng_source_stats stats; struct ifqueue snd_queue; /* packets to send */ struct ifnet *output_ifp; - struct callout_handle intr_ch; + struct callout intr_ch; u_int64_t packets; /* packets to send */ u_int32_t queueOctets; }; @@ -219,8 +219,8 @@ ng_source_constructor(node_p node) NG_NODE_SET_PRIVATE(node, sc); sc->node = node; sc->snd_queue.ifq_maxlen = 2048; /* XXX not checked */ - callout_handle_init(&sc->intr_ch); /* XXX fix.. will - cause problems. */ + ng_callout_init(&sc->intr_ch); + return (0); } @@ -331,7 +331,7 @@ ng_source_rcvmsg(node_p node, item_p item, hook_p lasthook) timevalclear(&sc->stats.elapsedTime); timevalclear(&sc->stats.endTime); getmicrotime(&sc->stats.startTime); - sc->intr_ch = ng_timeout(node, NULL, 0, + ng_timeout(&sc->intr_ch, node, NULL, 0, ng_source_intr, sc, 0); } break; @@ -359,7 +359,7 @@ ng_source_rcvmsg(node_p node, item_p item, hook_p lasthook) timevalclear(&sc->stats.elapsedTime); timevalclear(&sc->stats.endTime); getmicrotime(&sc->stats.startTime); - sc->intr_ch = ng_timeout(node, NULL, 0, + ng_timeout(&sc->intr_ch, node, NULL, 0, ng_source_intr, sc, 0); } break; @@ -586,7 +586,7 @@ static void ng_source_stop (sc_p sc) { if (sc->node->nd_flags & NG_SOURCE_ACTIVE) { - ng_untimeout(sc->intr_ch, sc->node); + ng_untimeout(&sc->intr_ch, sc->node); sc->node->nd_flags &= ~NG_SOURCE_ACTIVE; getmicrotime(&sc->stats.endTime); sc->stats.elapsedTime = sc->stats.endTime; @@ -610,7 +610,6 @@ ng_source_intr(node_p node, hook_p hook, void *arg1, int arg2) KASSERT(sc != NULL, ("%s: null node private", __func__)); - callout_handle_init(&sc->intr_ch); if (sc->packets == 0 || sc->output.hook == NULL || (sc->node->nd_flags & NG_SOURCE_ACTIVE) == 0) { ng_source_stop(sc); @@ -627,7 +626,7 @@ ng_source_intr(node_p node, hook_p hook, void *arg1, int arg2) if (sc->packets == 0) ng_source_stop(sc); else - sc->intr_ch = ng_timeout(node, NULL, NG_SOURCE_INTR_TICKS, + ng_timeout(&sc->intr_ch, node, NULL, NG_SOURCE_INTR_TICKS, ng_source_intr, sc, 0); } |