summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Staaf <robotboy@chromium.org>2015-05-04 08:54:02 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-05-06 22:53:18 +0000
commit9bdffe0513bea3d78544c6a9159b66652e7892a1 (patch)
tree7d5cd905b7378117954b19060d12a7387f767c76
parent7eae25ba10d4c53f80b85a25865f66ffc8f08aeb (diff)
downloadchrome-ec-9bdffe0513bea3d78544c6a9159b66652e7892a1.tar.gz
CCD: Disable ModemManager for CCD USB consoles
ModemManager likes to play with serial ports it shouldn't play with, mark our serial ports as off limits. This also bumps the ordering of this rules file just past the udev default rules because it uses environment variables populated by that file. Signed-off-by: Anton Staaf <robotboy@chromium.org> BRANCH=None BUG=None TEST=install new rules file, delete old rules file verify that symlinks to TTY's are still created verify that ModemManager leaves them alone now Change-Id: I4ded95192d78b5b1bbc661ca5b762e18307d2d60 Reviewed-on: https://chromium-review.googlesource.com/269743 Trybot-Ready: Anton Staaf <robotboy@chromium.org> Tested-by: Anton Staaf <robotboy@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org> Commit-Queue: Anton Staaf <robotboy@chromium.org>
-rw-r--r--extra/usb_serial/50-google-serial.rules14
-rw-r--r--extra/usb_serial/51-google-serial.rules33
2 files changed, 33 insertions, 14 deletions
diff --git a/extra/usb_serial/50-google-serial.rules b/extra/usb_serial/50-google-serial.rules
deleted file mode 100644
index ee2db62543..0000000000
--- a/extra/usb_serial/50-google-serial.rules
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# Match a Google device with an interface that supports the simple serial
-# driver.
-#
-# The first rule matches the google VID and records the product name, USB bus
-# number and USB device path (the device path is the list of hub ports between
-# the root and the device). This becomes a unique name under which the second
-# rule creates the symlinks to the serial devices. The second rule will only
-# fire if the .GOOGLE_CCD_NAME variable has been set by the first rule. If
-# some other udev rule has set the same name previously, there would be a
-# conflict, so this name is chosen to be verbose and likely unique.
-#
-SUBSYSTEMS=="usb", ATTRS{idVendor}=="18d1", ENV{.GOOGLE_CCD_NAME}="$attr{product}-$attr{busnum}-$attr{devpath}"
-SUBSYSTEMS=="usb", ENV{.GOOGLE_CCD_NAME}!="", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="50", ATTRS{bInterfaceProtocol}=="01", OPTIONS+="string_escape=replace", SYMLINK+="google/$env{.GOOGLE_CCD_NAME}/serial/$attr{interface}"
diff --git a/extra/usb_serial/51-google-serial.rules b/extra/usb_serial/51-google-serial.rules
new file mode 100644
index 0000000000..3dedac1b1f
--- /dev/null
+++ b/extra/usb_serial/51-google-serial.rules
@@ -0,0 +1,33 @@
+#
+# Rules for Google Case Closed Debugging devices.
+#
+# The first rule matches the google VID and records the product name, USB bus
+# number and USB device path (the device path is the list of hub ports between
+# the root and the device). This becomes a unique directory name under which
+# later rules can create symlinks. If this rule doesn't match udev will skip
+# the rest of this files rules.
+#
+# This rule intentionally matches using SUBSYSTEMS and ATTRS instead of
+# SUBSYSTEM and ATTR so that the GOOGLE_CCD_NAME is available to all nodes
+# that descend from a Google USB device (this includes all USB interface nodes
+# as well as all of the TTY nodes derived from CCD USB interfaces).
+#
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="18d1", ENV{GOOGLE_CCD_NAME}="$attr{product}-$attr{busnum}-$attr{devpath}"
+
+#
+# Force ModemManager to ignore all Google case closed debug devices. It would
+# be better to just ignore the case closed debug serial console interfaces, but
+# ModemManager doesn't look at the usb_interface udev node, it looks at the
+# usb_device node, so you have to mark the entire device as incompatible with
+# ModemManager.
+#
+# This node could lose the match against the usb_device DEVTYPE and still work,
+# it would just add extraneous ID_MM_DEVICE_IGNORE tags to the TTY and USB
+# interface nodes.
+#
+SUBSYSTEM=="usb", ENV{GOOGLE_CCD_NAME}!="", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="*:ff5001:*", ENV{ID_MM_DEVICE_IGNORE}="1"
+
+#
+# Construct a symlink to a TTY generated from a CCD USB serial interface.
+#
+SUBSYSTEM=="tty", ENV{GOOGLE_CCD_NAME}!="", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="50", ATTRS{bInterfaceProtocol}=="01", OPTIONS+="string_escape=replace", SYMLINK+="google/$env{GOOGLE_CCD_NAME}/serial/$attr{interface}"