From c7d8ac622a56142325af1e9b51d0cce1f06eaa3d Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Sun, 18 Sep 2016 15:43:30 +0200 Subject: udev: fix tagging per interface number Commit 7ff57f9808f35d434b638a67b84481271c67c90e introduced a change to try to use ATTRS{bInterfaceNumber} as a common way to match by interface number, but this logic is broken because all the rules that we use to match by interface number (attribute in the interface device) also require matching by idVendor and idProduct (attributes in the physdev device), and udev rules forbid matches from more than one parent device at a time. We could use ATTR{bInterfaceNumber} (instead of ATTRS) to tag the actual USB interface device, but that would require a change in all the plugins to look for the tag not in the TTY device, but in its parent. So, recover the original behavior, where a hidden property is created containing the first bInterfaceNumber found in the list of parent devices, and then run the matches against idVendor and idProduct only if the hidden property is found with the expected value. --- plugins/cinterion/77-mm-cinterion-port-types.rules | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins/cinterion') diff --git a/plugins/cinterion/77-mm-cinterion-port-types.rules b/plugins/cinterion/77-mm-cinterion-port-types.rules index d92e19e5..f43f0b8e 100644 --- a/plugins/cinterion/77-mm-cinterion-port-types.rules +++ b/plugins/cinterion/77-mm-cinterion-port-types.rules @@ -5,7 +5,8 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="1e2d", GOTO="mm_cinterion_port_types" GOTO="mm_cinterion_port_types_end" LABEL="mm_cinterion_port_types" +SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" -ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="0053", ATTRS{bInterfaceNumber}=="01", ENV{ID_MM_CINTERION_PORT_TYPE_GPS}="1" +ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="0053", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_CINTERION_PORT_TYPE_GPS}="1" LABEL="mm_cinterion_port_types_end" -- cgit v1.2.3-70-g09d2