How to poll multiple devices in kernel ?
From: Matthieu H. (mhameau_at_gmail.com)
Date: 02/28/05
- Previous message: Robert Redelmeier: "Re: Dvorak's idea"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 28 Feb 2005 06:58:01 -0800
Hello everybody,
I'm a beginner in driver and module programming, and I need some help:
I designed a driver that need to listen at multiple devices (network
device, serial device, USB device) for incoming data.
Once received, that data should be accessible to user space through
the "read" function.
That's why I cannot use the poll/select functions from user space.
My first idea is to make a kernel thread for EACH device that do a
blocking read. When data comes, read returns and fills a global buffer
(protected with mutexes). Do you think it is a good idea?
Second idea is to make only ONE kernel thread that will call an
equivalent to the poll/select function inside the kernel. When data
arrives, i should test which device can be read and etc...
I think it's a better idea than the first one, but i don't know how to
do that.
What do you think? Any coments and/or help are welcome!
I already look for info everywhere but people always talk about poll
implementation of the struct file_operation and nothing else :(
Thanks by advance!
Matt
- Previous message: Robert Redelmeier: "Re: Dvorak's idea"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|