Using %s{product} and %s{bInterfaceNumber} in UDEV rules

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

 



Hello,

in a quest to get static name for our devices, I started with following
rule:

SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", ATTRS{manufacturer}=="IKDA", \
                   SYMLINK="%s{product}_%s{serial}"

This produces links like
lrwxrwxrwx  1 root root           7  8. Nov 17:07 FTDIJTAG_0002 -> ttyUSB1

However when the connected device has more interfaces, this doesn't work
out for interfaces other then the last.

I tried
SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", ATTRS{manufacturer}=="IKDA", \
                   SYMLINK="%s{product}_%s{serial}_%s{bInterfaceNumver}"

but that only produces a link like:
lrwxrwxrwx  1 root root           7  8. Nov 17:09 FTDIJTAG_0002_

Digging deeper with
udevadm info -a  -p `udevadm info -q path -n /dev/ttyUSB2`

I find ATTRS{bInterfaceNumber}=="01" on the second level of parents
while ATTRS{manufacturer}=="IKDA" is on the third level. The Udevadm info
says:
> A rule to match, can be composed by the attributes of the device
> and the attributes from one single parent device.

So this probably breaks the "one single parent device" rule.

Is my wish flawed? Udev? Any way to get around?

B.t.w. the devices in question are FTDI ftdi_sio devices with the default
VID/PID but custom manufacturer/product and unique serial. 

Thanks
-- 
Uwe Bonnes                bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
--
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