diff options
author | Gleb Smirnoff <glebius@FreeBSD.org> | 2004-11-02 21:24:30 +0000 |
---|---|---|
committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2004-11-02 21:24:30 +0000 |
commit | 30bef41b8a6db1ca5e6c41b5e3566a21178f9086 (patch) | |
tree | a65f34c1266b3b9307271ab695db1b77e0055c9e /sys/netgraph/ng_source.c | |
parent | 32672ba88dcd1a26432090b2fd38b4bf0e3e2a5c (diff) | |
download | src-30bef41b8a6db1ca5e6c41b5e3566a21178f9086.tar.gz src-30bef41b8a6db1ca5e6c41b5e3566a21178f9086.zip |
- Make ng_timeout() to use callout() interface instead of timeout().
- Remove callout-hacking from ng_untimeout().
Approved by: julian (mentor)
MFC after: 1 month
Notes
Notes:
svn path=/head/; revision=137138
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 291d9c948d71..809c7ffe5853 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); } |