Re: Multiple ttyUSBX , no udev which is which

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 21, 2010 at 11:17:16PM +0000, John Ervin wrote:
> Hello,
> 
> I have multiple devices on an embedded 2.6 linux system that does not have udev.

There's your first problem, you should put udev on it :)

It doesn't take up much space, and is used on lots of embedded devices.
Why have you not tried it?

> These devices are using different usbserial-dependent drivers and link to one of 
> the ttyUSBX devices which have been setup. I see in the kernel logs that the 
> linkings are fine first to \dev\ttyUSB0, then to \dev\ttyUSB1. However how do I 
> tell this from userspace?

Look in /sys

> It seems that /sys has that information. However, looping through this directory 
> and matching Vendor and product IDs seems too cumbersome a solution. Is there a 
> more straightforward way? For instance can I open the \dev\ttyUSBX files and send
> an IOCTL to query the IDs?

How is looking at symlinks more cumbersome than an ioctl? :)

Anyway, yes, look at the symlinks, all the information you need is
there.  And no, there is no ioctl interface to get this information,
it's already there for you in the filesystem layout.

You could just use libudev, which will give you that information to a
program quite easily, if you need it.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux