Re: How to assign a unique name for a USB CDC device in /dev directory?

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

 



Hi Ramya,

On Thu, 7 Apr 2011 15:06:57 +0530 you wrote:
> 
> Please let me know, if there is any way to do this. Any suggestions
> would be appreciated.

Yes, there is, but it's not kernel-related so it's out of scope for
this list. Check out how "persistent naming" is achieved with UDEV.
It's not always easy, but it's entirely a user-space issue.

You need to find some way to identify your device uniquely. With the
persistent-net rules that is the MAC address, with persistent-cd it's
the bus ID. When I wanted to do something similar with a USB-serial
device I used the device's serial number (in combination with the
product name, so that other USB-serial converters behaved per default).

If your device is a one-off and you never want to use more than one 
of it, then a simple hand-written UDEV rule will do. It will look 
something like:

KERNEL=="ttyACM*", ACTION=="add", ATTRS{serial}=="xxx", ATTRS{product}=="yyy", SYMLINK+="mydev"

In my case we are building several systems each with (potentially)
several devices that must have unique identities. I had to write
complex rules to auto-generate the UDEV rule for each such device in
the order they are _FIRST_ plugged in (as opposed to the order they're
detected from each power-up).

Cheers,
Rob
--
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