I have a USBTMC device that has a usbtmc interface. The interface has bInterfaceClass, bInterfaceSubClass, and bInterfaceProtocol attributes with values 'fe', '3', and '1' respectively. The question is how to write a udev rule that matches attributes on an interface of the device. It appears that matching starts the device level, and can only look "upward" at the device's parents, but cannot look "downward" (down the sysfs tree) into the device's interface(s).
I'm able to write a working rule that matches based on the VID/PID:
SUBSYSTEM=="usb", ATTR{idProduct}=="5c18", ATTR{idVendor}=="2a8d", MODE:="0660", GROUP="plugdev"
but a rule like this does NOT work:
SUBSYSTEM=="usb", ATTR{bInterfaceClass}=="fe", ATTR{bInterfaceSubClass}=="03", MODE:="0660", GROUP="plugdev"
The following shows a listing of the device, and shows the attributes of the interface found under 1-1:1.0:
me@box:/sys/bus/usb/devices/1-1$ ls
1-1:1.0 bcdDevice bDeviceProtocol bMaxPacketSize0 bNumInterfaces descriptors devpath idProduct manufacturer power removable serial tx_lanes version
authorized bConfigurationValue bDeviceSubClass bMaxPower busnum dev driver idVendor maxchild product remove speed uevent
avoid_reset_quirk bDeviceClass bmAttributes bNumConfigurations configuration devnum ep_00 ltm_capable port quirks rx_lanes subsystem urbnum
me@box:/sys/bus/usb/devices/1-1$ cat 1-1\:1.0/bInterfaceClass
fe
me@box:/sys/bus/usb/devices/1-1$ cat 1-1\:1.0/bInterfaceSubClass
03
me@box:/sys/bus/usb/devices/1-1$ cat 1-1\:1.0/bInterfaceProtocol
01
me@box:/sys/bus/usb/devices/1-1$
The command: udevadm info -a -n
lists device ATTR that can be used, as well as parent ATTRS. None of these include the (child) interface attributes.
Any help would be appreciated.