Re: Recognize USB devices by user-application

Greg KH <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
On Fri, Jul 06, 2007 at 10:09:39AM -0300, Ana Ravena Alcantara da Costa wrote:
> Hello!
> I am working with a kernel 2.4.25 embedded in a processor mpc5xxx from
> Freescale.
> I'm trying to make USB work at this kernel, but some details are still a
> litle obscure to me.
> All USB drivers are working well and I have enabled devfs for my devices
> be mounted at /dev/usb automatically.
> Therefore I don't know how user-application can know that a device had
> been connected or disconnected on USB bus.

Listen to the hotplug events sent to /sbin/hotplug, or watch the
/proc/bus/usb/devices file for changes.

Unfortunatly, 2.4 does not do this very well, the 2.6 kernel handles
this much better.

> Other problem is umount USB devices when they were disconnected. An
> example: I disconnected my USB-serial converter but still there is
> /dev/usb/tty/0 at my tree.

Does userspace still have the device open?

There was a reason we removed devfs from the 2.6 kernel tree :)

good luck,

greg k-h

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.