mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [newbie] timer in module
@ 2001-05-18 11:54 sebastien person
  2001-05-18 12:32 ` Bart Trojanowski
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: sebastien person @ 2001-05-18 11:54 UTC (permalink / raw)
  To: liste noyau linux

Hi,

I have a network module that need to regularly get data from network
adaptater.
But I don't know if it safe to do a loop with a timer in the module.
e.g. I want to do something like that after ifconfig call :

while(1)
{
	timer call()
	get data()	//	these datas are specific to device
}

but I'm scared that will block the driver.
I've no experience of a regularly call that let the hand to the module.
My aim is to do a get data call every x seconds (x is variable).

Is it better to let an external program executing timer call and get data
call
via ioctl ?

In the case of a network module wich is able to send and receive data,
whats happen if the driver is sollicited when he received or send data ?
the tbusy bit is it designed to avoid this case ?

The module is it able to execute two different parts of the module code
at the same time ? (receiving data and handle a higher layer request)

thanks for any comments.

sebastien person

^ permalink raw reply	[flat|nested] 8+ messages in thread
* [newbie] timer in module
@ 2001-05-22 10:53 sebastien person
  0 siblings, 0 replies; 8+ messages in thread
From: sebastien person @ 2001-05-22 10:53 UTC (permalink / raw)
  To: liste noyau linux



Début du message transféré :

Date: Tue, 22 May 2001 11:39:30 +0200
From: sebastien person <sebastien.person@sycomore.fr>
To: Bart Trojanowski <bart@jukie.net>
Subject: Re: [newbie] timer in module (fwd)


Le Mon, 21 May 2001 19:35:25 -0400 (EDT)
Bart Trojanowski <bart@jukie.net> a ecrit :

> 
> this was my first post on this thread.
> 
> I did miss one call and that was add_timer(), after that you can call
> mod_timer to change the next time the timer fires.

ok, to using mod_timer we must hace already used one time  add_timer ?

> Let me know if you need anything else.

So I've succeed to use a timer but with the struct timer_list.
I've found some example in rubini's book [oreilly], but I'm not sure
if the declaration of timer must be global ?
e.g If I do a timer call in a local function, whith a timer_list struct 
local, and when the scheduler handle the timer interrupt although I am
already out of local function... what's happen (oops ?)

And also I want to ensure that I can put whatever I want in the data
field.

thanks for all your advices.

> 
> Bart.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2001-05-22 10:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-18 11:54 [newbie] timer in module sebastien person
2001-05-18 12:32 ` Bart Trojanowski
2001-05-18 12:43 ` Alan Cox
2001-05-18 13:28 ` sebastien person
2001-05-18 13:53   ` Alan Cox
2001-05-18 13:33 ` sebastien person
2001-05-18 13:54   ` Richard B. Johnson
2001-05-22 10:53 sebastien person

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®