diff options
author | Jesse Gilles <jgilles@multitech.com> | 2012-08-28 14:46:48 -0500 |
---|---|---|
committer | Jesse Gilles <jgilles@multitech.com> | 2012-08-28 14:46:48 -0500 |
commit | 8efda18df6ac54debdf651c7b9359ff04acd47af (patch) | |
tree | e8fcd32adb29d5b5c50f127ad800ea80d0a1237d /multitech/recipes/udev | |
parent | d79bc33723b2ceb98a34ef0c9b12827b867cf03f (diff) |
udev-165: add corecdp.rules for naming cellular modem ports
The rules add the following device names:
/dev/modemX
Where X is the number of the interface port on the modem, starting at 0
/dev/modem_atX
Where X is the number of a valid AT command port, starting at 0
Diffstat (limited to 'multitech/recipes/udev')
-rw-r--r-- | multitech/recipes/udev/udev-165/corecdp/corecdp.rules | 51 | ||||
-rw-r--r-- | multitech/recipes/udev/udev_165.bbappend | 10 |
2 files changed, 60 insertions, 1 deletions
diff --git a/multitech/recipes/udev/udev-165/corecdp/corecdp.rules b/multitech/recipes/udev/udev-165/corecdp/corecdp.rules new file mode 100644 index 0000000..e24c183 --- /dev/null +++ b/multitech/recipes/udev/udev-165/corecdp/corecdp.rules @@ -0,0 +1,51 @@ +ACTION=="remove", GOTO="corecdp_end" +SUBSYSTEM!="tty", GOTO="corecdp_end" +KERNEL!="ttyUSB[0-9]*|ttyACM[0-9]*|ttyS*", GOTO="corecdp_end" + +# use serial port by default, allow USB radios to overwrite link +KERNEL=="ttyS1", SYMLINK+="modem0", OPTIONS+="link_priority=-1" +KERNEL=="ttyS1", SYMLINK+="modem_at0", OPTIONS+="link_priority=-1" + +SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" +ENV{ID_IFACE}=="", GOTO="corecdp_end" + +# All modem ports +# H5 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="00", SYMLINK+="modem0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="02", SYMLINK+="modem1" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="04", SYMLINK+="modem2" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="06", SYMLINK+="modem3" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="08", SYMLINK+="modem4" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="0a", SYMLINK+="modem5" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="0c", SYMLINK+="modem6" +# EV3 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="00", SYMLINK+="modem0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="01", SYMLINK+="modem1" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="02", SYMLINK+="modem2" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="03", SYMLINK+="modem3" +# H4 +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="00", SYMLINK+="modem0" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="01", SYMLINK+="modem1" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="02", SYMLINK+="modem2" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="03", SYMLINK+="modem3" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="04", SYMLINK+="modem4" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="05", SYMLINK+="modem5" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="06", SYMLINK+="modem6" +# EV2 +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="0028", SYMLINK+="modem$env{ID_PORT}" + +# AT Command ports +# H5: ttyACM0, ttyACM3 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" +# EV3: ttyUSB2, ttyUSB3 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="02", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="03", SYMLINK+="modem_at1" +# H4: ttyUSB3, ttyUSB4, ttyUSB5 +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="03", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="04", SYMLINK+="modem_at1" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="05", SYMLINK+="modem_at2" +# EV2: ttyUSB0 +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="0028", ENV{ID_PORT}=="0", SYMLINK+="modem_at0" + +LABEL="corecdp_end" diff --git a/multitech/recipes/udev/udev_165.bbappend b/multitech/recipes/udev/udev_165.bbappend index 3a98f61..e87ff82 100644 --- a/multitech/recipes/udev/udev_165.bbappend +++ b/multitech/recipes/udev/udev_165.bbappend @@ -1,4 +1,12 @@ FILESEXTRA := "${THISDIR}" FILESPATHBASE =. "${FILESEXTRA}:" -PR .= ".corecdp1" +PR .= ".corecdp2" + +# add custom rules for persistent modem device names +SRC_URI += "file://corecdp.rules" + +do_install_append() { + install -d ${D}${sysconfdir}/udev/rules.d + install -m 644 ${WORKDIR}/corecdp.rules ${D}${sysconfdir}/udev/rules.d/ +} |