Lines Matching full:timeout

10 void net_timeout_set(struct net_timeout *timeout,  in net_timeout_set()  argument
16 timeout->timer_start = now; in net_timeout_set()
18 /* Highly unlikely, but a zero timeout isn't correctly handled by the in net_timeout_set()
22 timeout->wrap_counter = 0; in net_timeout_set()
23 timeout->timer_timeout = 0; in net_timeout_set()
28 timeout->wrap_counter = expire_timeout / in net_timeout_set()
30 timeout->timer_timeout = expire_timeout - in net_timeout_set()
32 (uint64_t)timeout->wrap_counter; in net_timeout_set()
34 /* The implementation requires that the fractional timeout be zero in net_timeout_set()
35 * only when the timeout has completed, so if the residual is zero in net_timeout_set()
36 * copy over one timeout from the wrap. in net_timeout_set()
38 if (timeout->timer_timeout == 0U) { in net_timeout_set()
39 timeout->timer_timeout = NET_TIMEOUT_MAX_VALUE; in net_timeout_set()
40 timeout->wrap_counter -= 1; in net_timeout_set()
44 int64_t net_timeout_deadline(const struct net_timeout *timeout, in net_timeout_deadline() argument
54 start -= (uint32_t)now - timeout->timer_start; in net_timeout_deadline()
57 deadline = start + timeout->timer_timeout; in net_timeout_deadline()
59 * (uint64_t)timeout->wrap_counter; in net_timeout_deadline()
64 uint32_t net_timeout_remaining(const struct net_timeout *timeout, in net_timeout_remaining() argument
67 int64_t ret = timeout->timer_timeout; in net_timeout_remaining()
69 ret += timeout->wrap_counter * (uint64_t)NET_TIMEOUT_MAX_VALUE; in net_timeout_remaining()
70 ret -= (int64_t)(int32_t)(now - timeout->timer_start); in net_timeout_remaining()
78 uint32_t net_timeout_evaluate(struct net_timeout *timeout, in net_timeout_evaluate() argument
87 elapsed = now - timeout->timer_start; in net_timeout_evaluate()
90 wraps = (timeout->wrap_counter > 0U); in net_timeout_evaluate()
93 : timeout->timer_timeout; in net_timeout_evaluate()
106 * the last portion of the full timeout, so return zero to indicate in net_timeout_evaluate()
107 * the timeout has completed. in net_timeout_evaluate()
118 timeout->timer_start = now; in net_timeout_evaluate()
120 timeout->wrap_counter -= 1; in net_timeout_evaluate()
128 if (timeout->timer_timeout > elapsed) { in net_timeout_evaluate()
129 timeout->timer_timeout -= elapsed; in net_timeout_evaluate()
131 timeout->timer_timeout += NET_TIMEOUT_MAX_VALUE - elapsed; in net_timeout_evaluate()
132 timeout->wrap_counter -= 1U; in net_timeout_evaluate()
135 return (timeout->wrap_counter == 0U) in net_timeout_evaluate()
136 ? timeout->timer_timeout in net_timeout_evaluate()