linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: kernel notification to user space task
       [not found] <mailman.1017422340.6661.linux-kernel2news@redhat.com>
@ 2002-03-29 17:27 ` Pete Zaitcev
  0 siblings, 0 replies; 3+ messages in thread
From: Pete Zaitcev @ 2002-03-29 17:27 UTC (permalink / raw)
  To: Amol Kumar Lad; +Cc: linux-kernel

> I want my driver running in kernel to send a notification to this task when
> it detects some event.
> 
> for example..if my driver detects that interface 'eth0' is coming up, it
> should send a indication to user task saying 'network interface eth0 is up'

I think it's kind of FAQ. Have a thread waiting in your driver
with add_wait_queue and schedule(). When awoken, the even thread
can signal the main worker thread or do the job itself.

But first, make sure you are not served better with an
event driven main thread (e.g. open a file descriptor
into your driver, then use select() on it together with
all other of your descriptors).

-- Pete

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

* Re: kernel notification to user space task
       [not found] <7CFD7CA8510CD6118F950002A519EA3001067CAA@leonoid.in.ishoni.com>
@ 2002-03-29 20:06 ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2002-03-29 20:06 UTC (permalink / raw)
  To: Amol Kumar Lad; +Cc: 'linux-kernel@vger.kernel.org'

On Fri, Mar 29, 2002 at 10:50:13PM +0530, Amol Kumar Lad wrote:
> 
> for example..if my driver detects that interface 'eth0' is coming up, it
> should send a indication to user task saying 'network interface eth0 is up'

If this is not just a hypothetical example, this kind of userspace
notification is already present in the kernel.  /sbin/hotplug gets
called when ever any network interface is brought up or down.  See the
documentation at linux-hotplug.sf.net for more information if you're
curious.

thanks,

greg k-h

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

* RE: kernel notification to user space task
@ 2002-03-29 17:27 Hari Gadi
  0 siblings, 0 replies; 3+ messages in thread
From: Hari Gadi @ 2002-03-29 17:27 UTC (permalink / raw)
  To: Amol Kumar Lad, linux-kernel

Hi,
You can use signals like the example in the book rubini (see the asynchronous notification section).
http://www.xml.com/ldd/chapter/book/index.html

Be sure to download the examples (especially the "scull" example).
thanks,
Hari.

-----Original Message-----
From: Amol Kumar Lad [mailto:amolk@ishoni.com]
Sent: Friday, March 29, 2002 12:20 PM
To: 'linux-kernel@vger.kernel.org'
Subject: kernel notification to user space task


Hi,
  I have a user task running ...
I want my driver running in kernel to send a notification to this task when
it detects some event.

for example..if my driver detects that interface 'eth0' is coming up, it
should send a indication to user task saying 'network interface eth0 is up'

please cc me..

thanks
Amol

-
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/

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

end of thread, other threads:[~2002-03-29 20:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.1017422340.6661.linux-kernel2news@redhat.com>
2002-03-29 17:27 ` kernel notification to user space task Pete Zaitcev
2002-03-29 17:27 Hari Gadi
     [not found] <7CFD7CA8510CD6118F950002A519EA3001067CAA@leonoid.in.ishoni.com>
2002-03-29 20:06 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).