[ale] Driver question

Stephan Uphoff ups at stups.com
Wed Sep 4 12:44:31 EDT 2002




include/linux/timer.h:


......

/*
 * In Linux 2.4, static timers have been removed from the kernel.
 * Timers may be dynamically created and destroyed, and should be initialized
 * by a call to init_timer() upon creation.
 *
 * The "data" field enables use of a common timeout function for several
 * timeouts. You can use this field to distinguish between the different
 * invocations.
 */
struct timer_list {
	struct list_head list;
	unsigned long expires;
	unsigned long data;
	void (*function)(unsigned long);
};

extern void add_timer(struct timer_list * timer);

.....





> I need to create a function in a driver that does a task every N
> seconds.  I can not find a simple piece of text that tells me hoe I can
> do this.
> 
> Example:
> 
> 
> doAllSums(void)
> {
> 
> 	// Do something
> }
> 
> I need doAllSums to calculate stats in my driver every 8 seconds. 
> Anyone here can help me?
> 
> 
> 
> 
> 
> ---
> This message has been sent through the ALE general discussion list.
> See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
> sent to listmaster at ale dot org.
> 
> 



---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list