From: Michael Tremer Date: Sun, 19 May 2013 17:33:33 +0000 (+0200) Subject: Add whitelist of serial USB devices. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cd8ac7ca427d98d27464a8a3d92927284e7889d8;p=people%2Fstevee%2Fnetwork.git Add whitelist of serial USB devices. 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. --- diff --git a/udev/rules.d/50-serial-whitelist.rules b/udev/rules.d/50-serial-whitelist.rules new file mode 100644 index 00000000..8ce10f7d --- /dev/null +++ b/udev/rules.d/50-serial-whitelist.rules @@ -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" diff --git a/udev/rules.d/60-net.rules b/udev/rules.d/60-net.rules index e5d24b9b..78d6963b 100644 --- a/udev/rules.d/60-net.rules +++ b/udev/rules.d/60-net.rules @@ -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"