lkml.org 
[lkml]   [2003]   [May]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: How to notify a user process from within a driver
Lee, Shuyu wrote:

> For example, assuming there are 8 input lines on my hardware, and the user
> wants to be notified in the following three cases:
> 1) input on Line 1 only,
> 2) input on either Line 2 or Line 3,
> 3) input on both Line 4 and Line 5,
> how do I pass that info to the driver? Also, other than POLLERR and POLLHUP,
> can I pass back to the user more descriptive error messages?

One to do something like this is to use signals. You could use ioctl for
userspace to register with the driver, and to query the status. When the
correct combination of inputs occurs, you thwap the process with a SIGUSR1,
which tells it to wake up and query the input line status.

Alternately, you could use ioctl for configuration and wait on a socket for
notification as to when to query the status.

Finally, you could use ioctl for configuration and write a byte to the socket
when the right event happens, the byte being a bitmap of the 8 input lines.

Chris


--
Chris Friesen | MailStop: 043/33/F10
Nortel Networks | work: (613) 765-0557
3500 Carling Avenue | fax: (613) 765-2986
Nepean, ON K2H 8E9 Canada | email: cfriesen@nortelnetworks.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:35    [W:0.554 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site