summaryrefslogtreecommitdiffstats
path: root/sys/netgraph
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2004-11-04 12:33:55 +0000
committerharti <harti@FreeBSD.org>2004-11-04 12:33:55 +0000
commit1b4394c3588852abd6770a9c524cf9a9487fb603 (patch)
tree0992d96efb3f5716fa8876b181cb9d4e12992349 /sys/netgraph
parent27e302a86b65c2d82a3601b7d1f56add77a4316b (diff)
downloadFreeBSD-src-1b4394c3588852abd6770a9c524cf9a9487fb603.zip
FreeBSD-src-1b4394c3588852abd6770a9c524cf9a9487fb603.tar.gz
Adapt to the new ng_timeout/ng_untimeout arguments. These now use
the callout instead of the timeout interface. Submitted by: glebius
Diffstat (limited to 'sys/netgraph')
-rw-r--r--sys/netgraph/atm/sscop/ng_sscop_cust.h13
-rw-r--r--sys/netgraph/atm/uni/ng_uni_cust.h15
2 files changed, 11 insertions, 17 deletions
diff --git a/sys/netgraph/atm/sscop/ng_sscop_cust.h b/sys/netgraph/atm/sscop/ng_sscop_cust.h
index bf9dd8a..6a1b403 100644
--- a/sys/netgraph/atm/sscop/ng_sscop_cust.h
+++ b/sys/netgraph/atm/sscop/ng_sscop_cust.h
@@ -105,18 +105,16 @@
/*
* Timer support.
*/
-typedef struct callout_handle sscop_timer_t;
-#define TIMER_INIT(S, T) callout_handle_init(&(S)->t_##T)
+typedef struct callout sscop_timer_t;
+#define TIMER_INIT(S, T) ng_callout_init(&(S)->t_##T)
#define TIMER_STOP(S,T) do { \
- ng_untimeout((S)->t_##T, (S)->aarg); \
- callout_handle_init(&(S)->t_##T); \
+ ng_untimeout(&(S)->t_##T, (S)->aarg); \
} while (0)
#define TIMER_RESTART(S, T) do { \
- TIMER_STOP(S, T); \
- (S)->t_##T = ng_timeout((S)->aarg, NULL, \
+ ng_timeout(&(S)->t_##T, (S)->aarg, NULL, \
hz * (S)->timer##T / 1000, T##_func, (S), 0); \
} while (0)
-#define TIMER_ISACT(S, T) ((S)->t_##T.callout != NULL)
+#define TIMER_ISACT(S, T) ((S)->t_##T.c_flags & (CALLOUT_PENDING))
/*
* This assumes, that the user argument is the node pointer.
@@ -127,7 +125,6 @@ T##_func(node_p node, hook_p hook, void *arg1, int arg2) \
{ \
struct sscop *sscop = arg1; \
\
- callout_handle_init(&sscop->t_##T); \
VERBOSE(sscop, SSCOP_DBG_TIMER, (sscop, sscop->aarg, \
"timer_" #T " expired")); \
sscop_signal(sscop, SIG_T_##N, NULL); \
diff --git a/sys/netgraph/atm/uni/ng_uni_cust.h b/sys/netgraph/atm/uni/ng_uni_cust.h
index 121d7ab..cff9dd9 100644
--- a/sys/netgraph/atm/uni/ng_uni_cust.h
+++ b/sys/netgraph/atm/uni/ng_uni_cust.h
@@ -79,19 +79,19 @@ void ng_uni_free(enum unimem, void *, const char *, u_int);
* Timers
*/
struct uni_timer {
- struct callout_handle c;
+ struct callout c;
};
-#define _TIMER_INIT(X,T) callout_handle_init(&(X)->T.c)
+#define _TIMER_INIT(X,T) ng_callout_init(&(X)->T.c)
#define _TIMER_DESTROY(UNI,FIELD) _TIMER_STOP(UNI,FIELD)
#define _TIMER_STOP(UNI,FIELD) do { \
- ng_untimeout(FIELD.c, (UNI)->arg); \
- callout_handle_init(&FIELD.c); \
+ ng_untimeout(&FIELD.c, (UNI)->arg); \
} while (0)
-#define TIMER_ISACT(UNI,T) ((UNI)->T.c.callout != NULL)
+#define TIMER_ISACT(UNI,T) ((UNI)->T.c.c_flags & (CALLOUT_ACTIVE | \
+ CALLOUT_PENDING))
#define _TIMER_START(UNI,ARG,FIELD,DUE,FUNC) do { \
_TIMER_STOP(UNI, FIELD); \
- FIELD.c = ng_timeout((UNI)->arg, NULL, \
+ ng_timeout(&FIELD.c, (UNI)->arg, NULL, \
hz * (DUE) / 1000, FUNC, (ARG), 0); \
} while (0)
@@ -102,7 +102,6 @@ _##T##_func(node_p node, hook_p hook, void *arg1, int arg2) \
{ \
struct uni *uni = (struct uni *)arg1; \
\
- callout_handle_init(&uni->T.c); \
(F)(uni); \
uni_work(uni); \
}
@@ -118,7 +117,6 @@ _##T##_func(node_p node, hook_p hook, void *arg1, int arg2) \
struct call *call = (struct call *)arg1; \
struct uni *uni = call->uni; \
\
- callout_handle_init(&call->T.c); \
(F)(call); \
uni_work(uni); \
}
@@ -134,7 +132,6 @@ _##T##_func(node_p node, hook_p hook, void *arg1, int arg2) \
struct party *party = (struct party *)arg1; \
struct uni *uni = party->call->uni; \
\
- callout_handle_init(&party->T.c); \
(F)(party); \
uni_work(uni); \
}
OpenPOWER on IntegriCloud