Lines Matching defs:tp
65 timer_Stop(struct pppTimer *tp)
72 StopTimerNoBlock(tp);
77 timer_Start(struct pppTimer *tp)
88 if (tp->state != TIMER_STOPPED)
89 StopTimerNoBlock(tp);
91 if (tp->load == 0) {
92 log_Printf(LogTIMER, "%s timer[%p] has 0 load!\n", tp->name, tp);
98 * We just need to insert tp in the correct relative place. We don't
106 if (ticks + t->rest >= tp->load)
112 tp->state = TIMER_RUNNING;
113 tp->rest = tp->load - ticks;
117 "timer[%p], delta = %ld\n", tp->name, tp, t->name, t, tp->rest);
119 log_Printf(LogTIMER, "timer_Start: Inserting %s timer[%p]\n", tp->name, tp);
121 /* Insert given *tp just before *t */
122 tp->next = t;
124 pt->next = tp;
126 TimerList = tp;
130 t->rest -= tp->rest;
136 StopTimerNoBlock(struct pppTimer *tp)
147 if (tp->state == TIMER_STOPPED)
151 for (t = TimerList; t != tp && t != NULL; t = t->next)
164 t->next->rest += RESTVAL(itimer); /* t (tp) was the first in the list */
173 for (t = ExpiredList; t != tp && t != NULL; t = t->enext)
181 } else if (tp->state == TIMER_RUNNING)
182 log_Printf(LogERROR, "Oops, %s timer not found!!\n", tp->name);
185 tp->next = tp->enext = NULL;
186 tp->state = TIMER_STOPPED;
192 struct pppTimer *tp, *exp, *next;
203 tp = TimerList;
204 if (tp) {
205 tp->rest = 0;
210 tp->state = TIMER_EXPIRED;
211 next = tp->next;
212 tp->enext = exp;
213 exp = tp;
214 tp = next;
215 } while (tp && tp->rest == 0);
217 TimerList = tp;