extern void add_timer(struct timer_list * timer); extern int del_timer(struct timer_list * timer); extern inline void init_timer(struct timer_list * timer);
struct timer_list {
struct timer_list *next;
struct timer_list *prev;
unsigned long expires;
unsigned long data;
void (*function)(unsigned long);
};
init_timer sets next and prev to NULL. This is required for the argument of add_timer. expires is the desired duration of the timer in jiffies, where there are HZ (typically 100) jiffies per second.
When the timer expires, function is called with data as its argument. It is the responsibility of function to delete the event. If the same function is managing several timers, the argument can be used to distinguish which one expired.