]> git.ipfire.org Git - people/stevee/network.git/commitdiff
Add whitelist of serial USB devices.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 19 May 2013 17:33:33 +0000 (19:33 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 19 May 2013 17:33:33 +0000 (19:33 +0200)
If you connect a USB serial adapter to the system, it
will automatically be checked if it is a modem.
We do that by sending AT commands to them and wait for a
response. Some devices that are not a modem may get confused
by that, so we whitelist them here.

udev/rules.d/50-serial-whitelist.rules [new file with mode: 0644]
udev/rules.d/60-net.rules

diff --git a/udev/rules.d/50-serial-whitelist.rules b/udev/rules.d/50-serial-whitelist.rules
new file mode 100644 (file)
index 0000000..8ce10f7
--- /dev/null
@@ -0,0 +1,21 @@
+
+# This file helps us to handle serial (USB) devices, that are not a
+# modem. We try to detect modems by sending AT commands to them and
+# wait for a response. Other devices may get confused by that, so
+# we maintain this whitelist that they won't be tested at all.
+
+# Skip all other actions except add and change.
+ACTION!="add|change", GOTO="skip_usb_serial_devices_whitelist"
+
+# Skip everything that is not ttyUSB*.
+KERNEL!="ttyUSB*", GOTO="skip_usb_serial_devices_whitelist"
+
+## Whitelist
+
+# Globalscale Dreamplug JTAG/UART adapter
+ATTRS{idVendor}=="9e88", ATTRS{idProduct}=="9e8f", ENV{NETWORK_USB_SERIAL_DEVICE_IGNORE}="1"
+
+# Prolific Technology, Inc. PL2303 Serial Port
+ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", ENV{NETWORK_USB_SERIAL_DEVICE_IGNORE}="1"
+
+LABEL="skip_usb_serial_devices_whitelist"
index e5d24b9beb184c753932a4ade5174be0073492ab..78d6963b08bbdca5be8672d544d27b9d76c16faa 100644 (file)
@@ -8,4 +8,4 @@ ACTION=="add", SUBSYSTEM=="net", PROGRAM="/usr/lib/udev/network-hotplug-rename",
 SUBSYSTEM=="net", RUN+="/usr/lib/udev/network-hotplug"
 
 # Handle all serial devices (like modems and so on...).
-KERNEL=="ttyUSB*", RUN+="/usr/lib/udev/network-hotplug-serial"
+KERNEL=="ttyUSB*", ENV{NETWORK_USB_SERIAL_DEVICE_IGNORE}!="1", RUN+="/usr/lib/udev/network-hotplug-serial"