linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* implementing hotplug event
@ 2003-12-29  5:19 Jon Smirl
  2003-12-30  0:39 ` Greg KH
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jon Smirl @ 2003-12-29  5:19 UTC (permalink / raw)
  To: linux-hotplug

My driver can catch $ACTION now. I also added the code to my class driver to
make it send out the same info as a PCI hotplug event. Now my userspace app
needs to open the newly loaded device driver, how do I reliably find it? I know
that it is at /dev/dri/cardX but what if the user is replacing /dev with /udev
or /devfs? I know the major/minor I could just mknode in my program too.

==Jon Smirl
jonsmirl@yahoo.com

__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id\x1278&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

* Re: implementing hotplug event
  2003-12-29  5:19 implementing hotplug event Jon Smirl
@ 2003-12-30  0:39 ` Greg KH
  2003-12-30  1:48 ` Jon Smirl
  2003-12-30 22:43 ` Greg KH
  2 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2003-12-30  0:39 UTC (permalink / raw)
  To: linux-hotplug

On Sun, Dec 28, 2003 at 09:19:41PM -0800, Jon Smirl wrote:
> My driver can catch $ACTION now.

You mean your userspace program, right?

> I also added the code to my class driver to make it send out the same
> info as a PCI hotplug event.

That's good.

> Now my userspace app needs to open the newly loaded device driver, how
> do I reliably find it? I know that it is at /dev/dri/cardX but what if
> the user is replacing /dev with /udev or /devfs? I know the
> major/minor I could just mknode in my program too.

To be safe, you can always just read the sysfs "dev" file, and do a
mknod with that information.  Otherwise you could query udev as to what
it has named your device, but we don't have those hooks in udev just
yet...  someday soon...

thanks,

greg k-h


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id\x1278&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

* Re: implementing hotplug event
  2003-12-29  5:19 implementing hotplug event Jon Smirl
  2003-12-30  0:39 ` Greg KH
@ 2003-12-30  1:48 ` Jon Smirl
  2003-12-30 22:43 ` Greg KH
  2 siblings, 0 replies; 4+ messages in thread
From: Jon Smirl @ 2003-12-30  1:48 UTC (permalink / raw)
  To: linux-hotplug

--- Greg KH <greg@kroah.com> wrote:
> > Now my userspace app needs to open the newly loaded device driver, how
> > do I reliably find it? I know that it is at /dev/dri/cardX but what if
> > the user is replacing /dev with /udev or /devfs? I know the
> > major/minor I could just mknode in my program too.
> 
> To be safe, you can always just read the sysfs "dev" file, and do a
> mknod with that information.  Otherwise you could query udev as to what
> it has named your device, but we don't have those hooks in udev just
> yet...  someday soon...

I just sent the major/minor to the hotplug event in the environment variables,
it seemed easier than sending out the slot id and finding "dev" in sysfs. Doing
mknod from the user space app seems to be the most reliable scheme.



==Jon Smirl
jonsmirl@yahoo.com

__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id\x1278&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

* Re: implementing hotplug event
  2003-12-29  5:19 implementing hotplug event Jon Smirl
  2003-12-30  0:39 ` Greg KH
  2003-12-30  1:48 ` Jon Smirl
@ 2003-12-30 22:43 ` Greg KH
  2 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2003-12-30 22:43 UTC (permalink / raw)
  To: linux-hotplug

On Mon, Dec 29, 2003 at 05:48:51PM -0800, Jon Smirl wrote:
> --- Greg KH <greg@kroah.com> wrote:
> > > Now my userspace app needs to open the newly loaded device driver, how
> > > do I reliably find it? I know that it is at /dev/dri/cardX but what if
> > > the user is replacing /dev with /udev or /devfs? I know the
> > > major/minor I could just mknode in my program too.
> > 
> > To be safe, you can always just read the sysfs "dev" file, and do a
> > mknod with that information.  Otherwise you could query udev as to what
> > it has named your device, but we don't have those hooks in udev just
> > yet...  someday soon...
> 
> I just sent the major/minor to the hotplug event in the environment variables,
> it seemed easier than sending out the slot id and finding "dev" in sysfs. Doing
> mknod from the user space app seems to be the most reliable scheme.

True, as long as your userapp is running as root :)

thanks,

greg k-h


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id\x1278&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

end of thread, other threads:[~2003-12-30 22:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-29  5:19 implementing hotplug event Jon Smirl
2003-12-30  0:39 ` Greg KH
2003-12-30  1:48 ` Jon Smirl
2003-12-30 22:43 ` 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).