Lines Matching refs:timeout
105 struct dl_list timeout; member
164 dl_list_init(&eloop.timeout); in eloop_init()
771 struct eloop_timeout *timeout, *tmp; in eloop_register_timeout() local
774 timeout = os_zalloc(sizeof(*timeout)); in eloop_register_timeout()
775 if (timeout == NULL) in eloop_register_timeout()
777 if (os_get_reltime(&timeout->time) < 0) { in eloop_register_timeout()
778 os_free(timeout); in eloop_register_timeout()
781 now_sec = timeout->time.sec; in eloop_register_timeout()
782 timeout->time.sec += secs; in eloop_register_timeout()
783 if (timeout->time.sec < now_sec) { in eloop_register_timeout()
790 os_free(timeout); in eloop_register_timeout()
793 timeout->time.usec += usecs; in eloop_register_timeout()
794 while (timeout->time.usec >= 1000000) { in eloop_register_timeout()
795 timeout->time.sec++; in eloop_register_timeout()
796 timeout->time.usec -= 1000000; in eloop_register_timeout()
798 timeout->eloop_data = eloop_data; in eloop_register_timeout()
799 timeout->user_data = user_data; in eloop_register_timeout()
800 timeout->handler = handler; in eloop_register_timeout()
801 wpa_trace_add_ref(timeout, eloop, eloop_data); in eloop_register_timeout()
802 wpa_trace_add_ref(timeout, user, user_data); in eloop_register_timeout()
803 wpa_trace_record(timeout); in eloop_register_timeout()
806 dl_list_for_each(tmp, &eloop.timeout, struct eloop_timeout, list) { in eloop_register_timeout()
807 if (os_reltime_before(&timeout->time, &tmp->time)) { in eloop_register_timeout()
808 dl_list_add(tmp->list.prev, &timeout->list); in eloop_register_timeout()
812 dl_list_add_tail(&eloop.timeout, &timeout->list); in eloop_register_timeout()
818 static void eloop_remove_timeout(struct eloop_timeout *timeout) in eloop_remove_timeout() argument
820 dl_list_del(&timeout->list); in eloop_remove_timeout()
821 wpa_trace_remove_ref(timeout, eloop, timeout->eloop_data); in eloop_remove_timeout()
822 wpa_trace_remove_ref(timeout, user, timeout->user_data); in eloop_remove_timeout()
823 os_free(timeout); in eloop_remove_timeout()
830 struct eloop_timeout *timeout, *prev; in eloop_cancel_timeout() local
833 dl_list_for_each_safe(timeout, prev, &eloop.timeout, in eloop_cancel_timeout()
835 if (timeout->handler == handler && in eloop_cancel_timeout()
836 (timeout->eloop_data == eloop_data || in eloop_cancel_timeout()
838 (timeout->user_data == user_data || in eloop_cancel_timeout()
840 eloop_remove_timeout(timeout); in eloop_cancel_timeout()
853 struct eloop_timeout *timeout, *prev; in eloop_cancel_timeout_one() local
860 dl_list_for_each_safe(timeout, prev, &eloop.timeout, in eloop_cancel_timeout_one()
862 if (timeout->handler == handler && in eloop_cancel_timeout_one()
863 (timeout->eloop_data == eloop_data) && in eloop_cancel_timeout_one()
864 (timeout->user_data == user_data)) { in eloop_cancel_timeout_one()
866 if (os_reltime_before(&now, &timeout->time)) in eloop_cancel_timeout_one()
867 os_reltime_sub(&timeout->time, &now, remaining); in eloop_cancel_timeout_one()
868 eloop_remove_timeout(timeout); in eloop_cancel_timeout_one()
881 dl_list_for_each(tmp, &eloop.timeout, struct eloop_timeout, list) { in eloop_is_timeout_registered()
899 dl_list_for_each(tmp, &eloop.timeout, struct eloop_timeout, list) { in eloop_deplete_timeout()
931 dl_list_for_each(tmp, &eloop.timeout, struct eloop_timeout, list) { in eloop_replenish_timeout()
1089 (!dl_list_empty(&eloop.timeout) || eloop.readers.count > 0 || in eloop_run()
1091 struct eloop_timeout *timeout; in eloop_run() local
1106 timeout = dl_list_first(&eloop.timeout, struct eloop_timeout, in eloop_run()
1108 if (timeout) { in eloop_run()
1110 if (os_reltime_before(&now, &timeout->time)) in eloop_run()
1111 os_reltime_sub(&timeout->time, &now, &tv); in eloop_run()
1133 timeout ? timeout_ms : -1); in eloop_run()
1140 timeout ? &_tv : NULL); in eloop_run()
1156 timeout ? &ts : NULL); in eloop_run()
1186 timeout = dl_list_first(&eloop.timeout, struct eloop_timeout, in eloop_run()
1188 if (timeout) { in eloop_run()
1190 if (!os_reltime_before(&now, &timeout->time)) { in eloop_run()
1191 void *eloop_data = timeout->eloop_data; in eloop_run()
1192 void *user_data = timeout->user_data; in eloop_run()
1194 timeout->handler; in eloop_run()
1195 eloop_remove_timeout(timeout); in eloop_run()
1254 struct eloop_timeout *timeout, *prev; in eloop_destroy() local
1258 dl_list_for_each_safe(timeout, prev, &eloop.timeout, in eloop_destroy()
1261 sec = timeout->time.sec - now.sec; in eloop_destroy()
1262 usec = timeout->time.usec - now.usec; in eloop_destroy()
1263 if (timeout->time.usec < now.usec) { in eloop_destroy()
1269 sec, usec, timeout->eloop_data, timeout->user_data, in eloop_destroy()
1270 timeout->handler); in eloop_destroy()
1272 timeout->handler); in eloop_destroy()
1273 wpa_trace_dump("eloop timeout", timeout); in eloop_destroy()
1274 eloop_remove_timeout(timeout); in eloop_destroy()