public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Friesen <cfriesen@nortelnetworks.com>
To: "Lee, Shuyu" <SLee@cognex.com>
Cc: linux-kernel@vger.kernel.org,
	"'root@chaos.analogic.com'" <root@chaos.analogic.com>,
	"'Alan Cox'" <alan@lxorguk.ukuu.org.uk>
Subject: Re: How to notify a user process from within a driver
Date: Thu, 01 May 2003 18:37:33 -0400	[thread overview]
Message-ID: <3EB1A1AD.8070107@nortelnetworks.com> (raw)
In-Reply-To: 6AF24836F3EB074BA5C922466F9E92E10791B532@prince.pc.cognex.com

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


  parent reply	other threads:[~2003-05-01 22:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-01 21:54 How to notify a user process from within a driver Lee, Shuyu
2003-05-01 22:29 ` Hua Zhong
2003-05-01 22:37 ` Chris Friesen [this message]
2003-05-02 11:53 ` Richard B. Johnson
  -- strict thread matches above, loose matches on Subject: below --
2003-05-01 19:23 Lee, Shuyu
2003-05-01 19:09 ` Alan Cox
2003-05-01 19:32 ` Richard B. Johnson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3EB1A1AD.8070107@nortelnetworks.com \
    --to=cfriesen@nortelnetworks.com \
    --cc=SLee@cognex.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=root@chaos.analogic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox