I have several usb->serial converters on a single USB bus. What I am
trying to do is figure out a reliable way to locate the serial devices
persistently. For example, if I have two devices ttyUSB0 and ttyUSB1 and I
hotplug a third it will become ttyUSB2. However, if the third device should
be placed topologically between the other two, then at the next reboot or
USB disconnect, etc, ttyUSB2 might switch places with ttyUSB1 for example.
So, clearly using the character devices would not be sufficient
identification. I would be satisfied if I could identify the serial devices
by USB paths, since this is less likely to change. Also, USB device paths
would be persistent at least across device additions (not counting hubs I
suppose) unlike the previous example. 

        Now, using the topology information in /proc/bus/usb/devices, I am
able to create a mapping between USB device numbers and device paths. This
combined with the fact that initially the ttyUSB numbers are assigned to
device numbers sequentially allows me to make a "fairly" persistent map.
However, this is still not good enough since get_free_serial "fills in the
holes" so to speak. That is, if I have ttyUSB0 and ttyUSB1 connected, and
unplug both and then plug what used to be ttyUSB1 back in first, it will
become ttyUSB0 even though the device paths are unchanged. Is there another
way?

        I suppose one possibility would be to have some kind of
/proc/usbserial that lists mappings something like:

        1/2/3/1 ttyUSB0
        1/4/4           ttyUSB1

        Is there another way? Parsing dmesg (or messages for that matter) is
not sufficient since these records can be lost.

Thanks for any ideas,

-poul


-------------------------------------------------------
In remembrance
www.osdn.com/911/
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

Reply via email to