Lines Matching full:timeout
117 struct dl_list timeout; member
238 dl_list_init(&eloop.timeout); in eloop_init()
848 struct eloop_timeout *timeout, *tmp; in eloop_register_timeout() local
851 timeout = os_zalloc(sizeof(*timeout)); in eloop_register_timeout()
852 if (timeout == NULL) in eloop_register_timeout()
854 if (os_get_reltime(&timeout->time) < 0) { in eloop_register_timeout()
855 os_free(timeout); in eloop_register_timeout()
858 now_sec = timeout->time.sec; in eloop_register_timeout()
859 timeout->time.sec += secs; in eloop_register_timeout()
860 if (timeout->time.sec < now_sec) { in eloop_register_timeout()
862 * Integer overflow - assume long enough timeout to be assumed in eloop_register_timeout()
863 * to be infinite, i.e., the timeout would never happen. in eloop_register_timeout()
865 wpa_printf(MSG_DEBUG, "ELOOP: Too long timeout (secs=%u) to " in eloop_register_timeout()
867 os_free(timeout); in eloop_register_timeout()
870 timeout->time.usec += usecs; in eloop_register_timeout()
871 while (timeout->time.usec >= 1000000) { in eloop_register_timeout()
872 timeout->time.sec++; in eloop_register_timeout()
873 timeout->time.usec -= 1000000; in eloop_register_timeout()
875 timeout->eloop_data = eloop_data; in eloop_register_timeout()
876 timeout->user_data = user_data; in eloop_register_timeout()
877 timeout->handler = handler; in eloop_register_timeout()
878 wpa_trace_add_ref(timeout, eloop, eloop_data); in eloop_register_timeout()
879 wpa_trace_add_ref(timeout, user, user_data); in eloop_register_timeout()
880 wpa_trace_record(timeout); in eloop_register_timeout()
885 dl_list_for_each(tmp, &eloop.timeout, struct eloop_timeout, list) { in eloop_register_timeout()
886 if (os_reltime_before(&timeout->time, &tmp->time)) { in eloop_register_timeout()
887 dl_list_add(tmp->list.prev, &timeout->list); in eloop_register_timeout()
895 dl_list_add_tail(&eloop.timeout, &timeout->list); in eloop_register_timeout()
905 static void eloop_remove_timeout(struct eloop_timeout *timeout) in eloop_remove_timeout() argument
910 dl_list_del(&timeout->list); in eloop_remove_timeout()
911 wpa_trace_remove_ref(timeout, eloop, timeout->eloop_data); in eloop_remove_timeout()
912 wpa_trace_remove_ref(timeout, user, timeout->user_data); in eloop_remove_timeout()
913 os_free(timeout); in eloop_remove_timeout()
923 struct eloop_timeout *timeout, *prev; in eloop_cancel_timeout() local
926 dl_list_for_each_safe(timeout, prev, &eloop.timeout, in eloop_cancel_timeout()
928 if (timeout->handler == handler && in eloop_cancel_timeout()
929 (timeout->eloop_data == eloop_data || in eloop_cancel_timeout()
931 (timeout->user_data == user_data || in eloop_cancel_timeout()
933 eloop_remove_timeout(timeout); in eloop_cancel_timeout()
946 struct eloop_timeout *timeout, *prev; in eloop_cancel_timeout_one() local
953 dl_list_for_each_safe(timeout, prev, &eloop.timeout, in eloop_cancel_timeout_one()
955 if (timeout->handler == handler && in eloop_cancel_timeout_one()
956 (timeout->eloop_data == eloop_data) && in eloop_cancel_timeout_one()
957 (timeout->user_data == user_data)) { in eloop_cancel_timeout_one()
959 if (os_reltime_before(&now, &timeout->time)) in eloop_cancel_timeout_one()
960 os_reltime_sub(&timeout->time, &now, remaining); in eloop_cancel_timeout_one()
961 eloop_remove_timeout(timeout); in eloop_cancel_timeout_one()
976 dl_list_for_each(tmp, &eloop.timeout, struct eloop_timeout, list) { in eloop_is_timeout_registered()
1000 dl_list_for_each(tmp, &eloop.timeout, struct eloop_timeout, list) { in eloop_deplete_timeout()
1032 dl_list_for_each(tmp, &eloop.timeout, struct eloop_timeout, list) { in eloop_replenish_timeout()
1193 (!dl_list_empty(&eloop.timeout) || eloop.readers.count > 0 || in eloop_run()
1195 struct eloop_timeout *timeout; in eloop_run() local
1210 timeout = dl_list_first(&eloop.timeout, struct eloop_timeout, in eloop_run()
1212 if (timeout) { in eloop_run()
1214 if (os_reltime_before(&now, &timeout->time)) in eloop_run()
1215 os_reltime_sub(&timeout->time, &now, &tv); in eloop_run()
1237 timeout ? timeout_ms : -1); in eloop_run()
1244 timeout ? &_tv : NULL); in eloop_run()
1260 timeout ? &ts : NULL); in eloop_run()
1290 timeout = dl_list_first(&eloop.timeout, struct eloop_timeout, in eloop_run()
1292 if (timeout) { in eloop_run()
1294 if (!os_reltime_before(&now, &timeout->time)) { in eloop_run()
1295 void *eloop_data = timeout->eloop_data; in eloop_run()
1296 void *user_data = timeout->user_data; in eloop_run()
1298 timeout->handler; in eloop_run()
1299 eloop_remove_timeout(timeout); in eloop_run()
1313 * same FD in the signal or timeout handlers, so we in eloop_run()
1358 struct eloop_timeout *timeout, *prev; in eloop_destroy() local
1362 dl_list_for_each_safe(timeout, prev, &eloop.timeout, in eloop_destroy()
1365 sec = timeout->time.sec - now.sec; in eloop_destroy()
1366 usec = timeout->time.usec - now.usec; in eloop_destroy()
1367 if (timeout->time.usec < now.usec) { in eloop_destroy()
1371 wpa_printf(MSG_INFO, "ELOOP: remaining timeout: %d.%06d " in eloop_destroy()
1373 sec, usec, timeout->eloop_data, timeout->user_data, in eloop_destroy()
1374 timeout->handler); in eloop_destroy()
1375 wpa_trace_dump_funcname("eloop unregistered timeout handler", in eloop_destroy()
1376 timeout->handler); in eloop_destroy()
1377 wpa_trace_dump("eloop timeout", timeout); in eloop_destroy()
1378 eloop_remove_timeout(timeout); in eloop_destroy()