Mechanically rename s/ng_timeout/ng_callout/g, s/ng_untimeout/ng_uncallout/g.
This is done to keep both versions in RELENG_5 and support both APIs. Reviewed by: scottl Approved by: julian (mentor), implicitly
This commit is contained in:
parent
be392b4025
commit
f9d9e1b4ec
@ -108,11 +108,11 @@
|
||||
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); \
|
||||
ng_uncallout(&(S)->t_##T, (S)->aarg); \
|
||||
} while (0)
|
||||
#define TIMER_RESTART(S, T) do { \
|
||||
TIMER_STOP(S, T); \
|
||||
ng_timeout(&(S)->t_##T, (S)->aarg, NULL, \
|
||||
ng_callout(&(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.c_flags & (CALLOUT_PENDING))
|
||||
|
@ -85,13 +85,13 @@ struct uni_timer {
|
||||
#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); \
|
||||
ng_uncallout(&FIELD.c, (UNI)->arg); \
|
||||
} while (0)
|
||||
#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); \
|
||||
ng_timeout(&FIELD.c, (UNI)->arg, NULL, \
|
||||
ng_callout(&FIELD.c, (UNI)->arg, NULL, \
|
||||
hz * (DUE) / 1000, FUNC, (ARG), 0); \
|
||||
} while (0)
|
||||
|
||||
|
@ -357,7 +357,7 @@ ng_hci_con_by_bdaddr(ng_hci_unit_p unit, bdaddr_p bdaddr, int link_type)
|
||||
|
||||
/*
|
||||
* Set HCI command timeout
|
||||
* XXX FIXME: check return code from ng_timeout
|
||||
* XXX FIXME: check return code from ng_callout
|
||||
*/
|
||||
|
||||
int
|
||||
@ -368,7 +368,7 @@ ng_hci_command_timeout(ng_hci_unit_p unit)
|
||||
"%s: %s - Duplicated command timeout!\n", __func__, NG_NODE_NAME(unit->node));
|
||||
|
||||
unit->state |= NG_HCI_UNIT_COMMAND_PENDING;
|
||||
ng_timeout(&unit->cmd_timo, unit->node, NULL,
|
||||
ng_callout(&unit->cmd_timo, unit->node, NULL,
|
||||
bluetooth_hci_command_timeout(),
|
||||
ng_hci_process_command_timeout, NULL, 0);
|
||||
|
||||
@ -386,7 +386,7 @@ ng_hci_command_untimeout(ng_hci_unit_p unit)
|
||||
panic(
|
||||
"%s: %s - No command timeout!\n", __func__, NG_NODE_NAME(unit->node));
|
||||
|
||||
if (ng_untimeout(&unit->cmd_timo, unit->node) == 0)
|
||||
if (ng_uncallout(&unit->cmd_timo, unit->node) == 0)
|
||||
return (ETIMEDOUT);
|
||||
|
||||
unit->state &= ~NG_HCI_UNIT_COMMAND_PENDING;
|
||||
@ -396,7 +396,7 @@ ng_hci_command_untimeout(ng_hci_unit_p unit)
|
||||
|
||||
/*
|
||||
* Set HCI connection timeout
|
||||
* XXX FIXME: check return code from ng_timeout
|
||||
* XXX FIXME: check return code from ng_callout
|
||||
*/
|
||||
|
||||
int
|
||||
@ -408,7 +408,7 @@ ng_hci_con_timeout(ng_hci_unit_con_p con)
|
||||
__func__, NG_NODE_NAME(con->unit->node));
|
||||
|
||||
con->flags |= NG_HCI_CON_TIMEOUT_PENDING;
|
||||
ng_timeout(&con->con_timo, con->unit->node, NULL,
|
||||
ng_callout(&con->con_timo, con->unit->node, NULL,
|
||||
bluetooth_hci_connect_timeout(),
|
||||
ng_hci_process_con_timeout, NULL,
|
||||
con->con_handle);
|
||||
@ -427,7 +427,7 @@ ng_hci_con_untimeout(ng_hci_unit_con_p con)
|
||||
panic(
|
||||
"%s: %s - No connection timeout!\n", __func__, NG_NODE_NAME(con->unit->node));
|
||||
|
||||
if (ng_untimeout(&con->con_timo, con->unit->node) == 0)
|
||||
if (ng_uncallout(&con->con_timo, con->unit->node) == 0)
|
||||
return (ETIMEDOUT);
|
||||
|
||||
con->flags &= ~NG_HCI_CON_TIMEOUT_PENDING;
|
||||
|
@ -191,7 +191,7 @@ ng_l2cap_con_unref(ng_l2cap_con_p con)
|
||||
|
||||
/*
|
||||
* Set auto disconnect timeout
|
||||
* XXX FIXME: check return code from ng_timeout
|
||||
* XXX FIXME: check return code from ng_callout
|
||||
*/
|
||||
|
||||
int
|
||||
@ -204,7 +204,7 @@ ng_l2cap_discon_timeout(ng_l2cap_con_p con)
|
||||
con->state, con->flags);
|
||||
|
||||
con->flags |= NG_L2CAP_CON_AUTO_DISCON_TIMO;
|
||||
ng_timeout(&con->con_timo, con->l2cap->node, NULL,
|
||||
ng_callout(&con->con_timo, con->l2cap->node, NULL,
|
||||
con->l2cap->discon_timo * hz,
|
||||
ng_l2cap_process_discon_timeout, NULL,
|
||||
con->con_handle);
|
||||
@ -225,7 +225,7 @@ ng_l2cap_discon_untimeout(ng_l2cap_con_p con)
|
||||
__func__, NG_NODE_NAME(con->l2cap->node),
|
||||
con->state, con->flags);
|
||||
|
||||
if (ng_untimeout(&con->con_timo, con->l2cap->node) == 0)
|
||||
if (ng_uncallout(&con->con_timo, con->l2cap->node) == 0)
|
||||
return (ETIMEDOUT);
|
||||
|
||||
con->flags &= ~NG_L2CAP_CON_AUTO_DISCON_TIMO;
|
||||
@ -453,7 +453,7 @@ ng_l2cap_cmd_by_ident(ng_l2cap_con_p con, u_int8_t ident)
|
||||
|
||||
/*
|
||||
* Set LP timeout
|
||||
* XXX FIXME: check return code from ng_timeout
|
||||
* XXX FIXME: check return code from ng_callout
|
||||
*/
|
||||
|
||||
int
|
||||
@ -466,7 +466,7 @@ ng_l2cap_lp_timeout(ng_l2cap_con_p con)
|
||||
con->state, con->flags);
|
||||
|
||||
con->flags |= NG_L2CAP_CON_LP_TIMO;
|
||||
ng_timeout(&con->con_timo, con->l2cap->node, NULL,
|
||||
ng_callout(&con->con_timo, con->l2cap->node, NULL,
|
||||
bluetooth_hci_connect_timeout(),
|
||||
ng_l2cap_process_lp_timeout, NULL,
|
||||
con->con_handle);
|
||||
@ -487,7 +487,7 @@ ng_l2cap_lp_untimeout(ng_l2cap_con_p con)
|
||||
__func__, NG_NODE_NAME(con->l2cap->node),
|
||||
con->state, con->flags);
|
||||
|
||||
if (ng_untimeout(&con->con_timo, con->l2cap->node) == 0)
|
||||
if (ng_uncallout(&con->con_timo, con->l2cap->node) == 0)
|
||||
return (ETIMEDOUT);
|
||||
|
||||
con->flags &= ~NG_L2CAP_CON_LP_TIMO;
|
||||
@ -497,7 +497,7 @@ ng_l2cap_lp_untimeout(ng_l2cap_con_p con)
|
||||
|
||||
/*
|
||||
* Set L2CAP command timeout
|
||||
* XXX FIXME: check return code from ng_timeout
|
||||
* XXX FIXME: check return code from ng_callout
|
||||
*/
|
||||
|
||||
int
|
||||
@ -513,7 +513,7 @@ ng_l2cap_command_timeout(ng_l2cap_cmd_p cmd, int timo)
|
||||
|
||||
arg = ((cmd->ident << 16) | cmd->con->con_handle);
|
||||
cmd->flags |= NG_L2CAP_CMD_PENDING;
|
||||
ng_timeout(&cmd->timo, cmd->con->l2cap->node, NULL, timo,
|
||||
ng_callout(&cmd->timo, cmd->con->l2cap->node, NULL, timo,
|
||||
ng_l2cap_process_command_timeout, NULL, arg);
|
||||
|
||||
return (0);
|
||||
@ -532,7 +532,7 @@ ng_l2cap_command_untimeout(ng_l2cap_cmd_p cmd)
|
||||
__func__, NG_NODE_NAME(cmd->con->l2cap->node),
|
||||
cmd->code, cmd->flags);
|
||||
|
||||
if (ng_untimeout(&cmd->timo, cmd->con->l2cap->node) == 0)
|
||||
if (ng_uncallout(&cmd->timo, cmd->con->l2cap->node) == 0)
|
||||
return (ETIMEDOUT);
|
||||
|
||||
cmd->flags &= ~NG_L2CAP_CMD_PENDING;
|
||||
|
@ -1074,8 +1074,8 @@ int ng_rmtype(struct ng_type *tp);
|
||||
int ng_snd_item(item_p item, int queue);
|
||||
int ng_send_fn(node_p node, hook_p hook, ng_item_fn *fn,
|
||||
void *arg1, int arg2);
|
||||
int ng_untimeout(struct callout *c, node_p node);
|
||||
int ng_timeout(struct callout *c, node_p node, hook_p hook, int ticks,
|
||||
int ng_uncallout(struct callout *c, node_p node);
|
||||
int ng_callout(struct callout *c, node_p node, hook_p hook, int ticks,
|
||||
ng_item_fn *fn, void * arg1, int arg2);
|
||||
/* We should mark callout mpsafe as soon as we mark netgraph ISR mpsafe */
|
||||
#define ng_callout_init(c) callout_init(c, 0)
|
||||
|
@ -3587,7 +3587,7 @@ ng_send_fn(node_p node, hook_p hook, ng_item_fn *fn, void * arg1, int arg2)
|
||||
* Official timeout routines for Netgraph nodes.
|
||||
*/
|
||||
static void
|
||||
ng_timeout_trapoline(void *arg)
|
||||
ng_callout_trapoline(void *arg)
|
||||
{
|
||||
item_p item = arg;
|
||||
|
||||
@ -3596,7 +3596,7 @@ ng_timeout_trapoline(void *arg)
|
||||
|
||||
|
||||
int
|
||||
ng_timeout(struct callout *c, node_p node, hook_p hook, int ticks,
|
||||
ng_callout(struct callout *c, node_p node, hook_p hook, int ticks,
|
||||
ng_item_fn *fn, void * arg1, int arg2)
|
||||
{
|
||||
item_p item;
|
||||
@ -3614,13 +3614,13 @@ ng_timeout(struct callout *c, node_p node, hook_p hook, int ticks,
|
||||
NGI_FN(item) = fn;
|
||||
NGI_ARG1(item) = arg1;
|
||||
NGI_ARG2(item) = arg2;
|
||||
callout_reset(c, ticks, &ng_timeout_trapoline, item);
|
||||
callout_reset(c, ticks, &ng_callout_trapoline, item);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* A special modified version of untimeout() */
|
||||
int
|
||||
ng_untimeout(struct callout *c, node_p node)
|
||||
ng_uncallout(struct callout *c, node_p node)
|
||||
{
|
||||
item_p item;
|
||||
int rval;
|
||||
@ -3635,7 +3635,7 @@ ng_untimeout(struct callout *c, node_p node)
|
||||
mtx_unlock_spin(&callout_lock);
|
||||
item = c->c_arg;
|
||||
/* Do an extra check */
|
||||
if ((rval > 0) && (c_func == &ng_timeout_trapoline) &&
|
||||
if ((rval > 0) && (c_func == &ng_callout_trapoline) &&
|
||||
(NGI_NODE(item) == node)) {
|
||||
/*
|
||||
* We successfully removed it from the queue before it ran
|
||||
|
@ -222,7 +222,7 @@ cisco_newhook(node_p node, hook_p hook, const char *name)
|
||||
NG_HOOK_SET_PRIVATE(hook, &sc->downstream);
|
||||
|
||||
/* Start keepalives */
|
||||
ng_timeout(&sc->handle, node, NULL, (hz * KEEPALIVE_SECS),
|
||||
ng_callout(&sc->handle, node, NULL, (hz * KEEPALIVE_SECS),
|
||||
&cisco_keepalive, (void *)sc, 0);
|
||||
} else if (strcmp(name, NG_CISCO_HOOK_INET) == 0) {
|
||||
sc->inet.hook = hook;
|
||||
@ -425,7 +425,7 @@ cisco_disconnect(hook_p hook)
|
||||
pep->hook = NULL;
|
||||
if (pep->af == 0xffff)
|
||||
/* If it is the downstream hook, stop the timers */
|
||||
ng_untimeout(&sc->handle, NG_HOOK_NODE(hook));
|
||||
ng_uncallout(&sc->handle, NG_HOOK_NODE(hook));
|
||||
}
|
||||
|
||||
/* If no more hooks, remove the node */
|
||||
@ -587,7 +587,7 @@ cisco_keepalive(node_p node, hook_p hook, void *arg1, int arg2)
|
||||
cisco_send(sc, CISCO_KEEPALIVE_REQ, sc->local_seq, sc->remote_seq);
|
||||
if (sc->seqRetries++ > 1)
|
||||
cisco_notify(sc, NGM_LINK_IS_DOWN);
|
||||
ng_timeout(&sc->handle, node, NULL, (hz * KEEPALIVE_SECS),
|
||||
ng_callout(&sc->handle, node, NULL, (hz * KEEPALIVE_SECS),
|
||||
&cisco_keepalive, (void *)sc, 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);
|
||||
ng_timeout(&sc->intr_ch, node, NULL, 0,
|
||||
ng_callout(&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);
|
||||
ng_timeout(&sc->intr_ch, node, NULL, 0,
|
||||
ng_callout(&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_uncallout(&sc->intr_ch, sc->node);
|
||||
sc->node->nd_flags &= ~NG_SOURCE_ACTIVE;
|
||||
getmicrotime(&sc->stats.endTime);
|
||||
sc->stats.elapsedTime = sc->stats.endTime;
|
||||
@ -626,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
|
||||
ng_timeout(&sc->intr_ch, node, NULL, NG_SOURCE_INTR_TICKS,
|
||||
ng_callout(&sc->intr_ch, node, NULL, NG_SOURCE_INTR_TICKS,
|
||||
ng_source_intr, sc, 0);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user