Commit Graph

15 Commits

Author SHA1 Message Date
Aleksander Morgado
c7d8ac622a udev: fix tagging per interface number
Commit 7ff57f9808 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.
2016-09-18 15:43:30 +02:00
Aleksander Morgado
aa0e108107 udev: fix SUBSYSTEMS and ATTRS{idVendor} checks
Rules with a single condition where a parent property is checked with != don't
work properly. E.g.:
  SUBSYSTEMS!="usb", GOTO="end"
or:
  ATTRS{idVendor}!="abcd", GOTO="end"

Instead, we can mix both those previous parent rules and match them:
  SUBSYSTEMS=="usb",ATTRS{idVendor}=="abcd", GOTO="next"
  GOTO="end"
  LABEL="next"
  # Apply rules here
  LABEL="end"

In this case both SUBSYSTEMS and ATTRS conditions apply to the parent usb_device
(idVendor attribute is only available in the usb_device), so they apply to all
ports of the same device.
2016-09-18 14:08:20 +02:00
Aleksander Morgado
764bfbce9d mtk,udev: single 'usb' subsystems check 2016-08-06 12:57:44 +02:00
Aleksander Morgado
7ff57f9808 udev: replace ENV{.MM_USBIFNUM} conditions with ATTRS{bInterfaceNumber} 2016-08-06 10:41:52 +02:00
Ting-Yuan Huang
969189d42c plugin-manager: protect mm_plugin_{major,minor}_version
This patch makes declarations bind to definitions within the same module
to prevent the potential ambiguity if referenced directly.

AddressSanitizer think they violated one definition rule, although
those symbols are accessed by address through their modules and do
not depend on the order of the libararies loaded.
2016-05-28 13:59:54 +02:00
Lubomir Rintel
ff8f030d24 mtk: add D-Link DWM-156 A3 2016-05-04 09:49:43 -05:00
Aleksander Morgado
ffde429843 core: use G_SOURCE_REMOVE and G_SOURCE_CONTINUE in GSourceFuncs 2015-12-02 17:07:39 +01:00
Ben Chan
4669611412 broadband-modem,plugins: fix GMatchInfo leaks 2014-08-12 09:45:50 +02:00
Aleksander Morgado
7c347aa3ec port: store parent sysfs path in each MMPort 2014-06-23 18:12:27 +02:00
Aleksander Morgado
6f235b9948 ports: rename 'MMAtSerialPort' to 'MMPortSerialAt' 2014-02-13 13:40:01 +01:00
Aleksander Morgado
48585c250b udev: apply udev rules upon 'move' events as well
Otherwise, we may end up losing the tags we expect if the device gets a 'move'
event just after the initial 'add'.
2014-01-26 19:33:45 +01:00
Aleksander Morgado
c65c01703b mtk: fix GOTO tag in udev rules 2013-10-28 17:51:02 +01:00
Dan Williams
0755beff07 mtk: update udev rules to always match both VID/PID together
See commit c79d266e62.

    If the rules to tag specific USB interface numbers only apply on the PID, we'll
    end up seeing that if the port has a parent with another PID, and that other
    PID also has a rule, port will get tagged multiple times.
2013-09-16 11:54:16 -05:00
Dan Williams
872bd3e837 mtk: add D-Link DWM-156 udev rules
For HW version A5 and possibly later, which are based on MediaTek
chipsets instead of Qualcomm ones.
2013-09-16 11:54:16 -05:00
Quentin.Li
c22eca999b mtk: add plugin for various MediaTek devices
Signed-off-by: Quentin.Li <snowmanli88@gmail.com>
2013-09-16 11:53:58 -05:00