You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

retry.h 818B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef _GPXE_RETRY_H
  2. #define _GPXE_RETRY_H
  3. /** @file
  4. *
  5. * Retry timers
  6. *
  7. */
  8. #include <gpxe/list.h>
  9. /** A retry timer */
  10. struct retry_timer {
  11. /** List of active timers */
  12. struct list_head list;
  13. /** Timeout value (in ticks) */
  14. unsigned long timeout;
  15. /** Start time (in ticks) */
  16. unsigned long start;
  17. /** Retry count */
  18. unsigned int count;
  19. /** Timer expired callback
  20. *
  21. * @v timer Retry timer
  22. * @v fail Failure indicator
  23. *
  24. * The timer will already be stopped when this method is
  25. * called. The failure indicator will be True if the retry
  26. * timeout has already exceeded @c MAX_TIMEOUT.
  27. */
  28. void ( * expired ) ( struct retry_timer *timer, int over );
  29. };
  30. extern void start_timer ( struct retry_timer *timer );
  31. extern void stop_timer ( struct retry_timer *timer );
  32. #endif /* _GPXE_RETRY_H */