aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Thornley <david.thornley@touchstargroup.com>2018-06-22 16:25:22 +1000
committerJohn Crispin <john@phrozen.org>2018-06-22 09:45:08 +0200
commitc4a0c0718af301076809b700d243be6bcf4a958d (patch)
tree2e10540a9b3f6069860eb48c53250568079a6623
parent2ac5800fd945e41f27954942afa6742c2b6c9781 (diff)
downloadupstream-c4a0c0718af301076809b700d243be6bcf4a958d.tar.gz
upstream-c4a0c0718af301076809b700d243be6bcf4a958d.tar.bz2
upstream-c4a0c0718af301076809b700d243be6bcf4a958d.zip
wwan: Add support for Gemalto Cinterion cellular modules
Includes specific support for PH8(1e2d-0053) / ELS61(1e2d-005b) modules. Note for ELS61, the serial driver changes from serial option(ttyUSB) to usb-cdc (ttyACM). Two additional fixes in this commit resolve issues with ttyACM devices: - * wwan.sh - sys-fs has a subdirectory indirection (*/tty/ttyACMx) which was not handled properly * wwan.usb - dependent scripts were not included, so this never actually called proto_set_available for example (and relied on inadvertent call for ttyUSB case) Signed-off-by: David Thornley <david.thornley@touchstargroup.com> (cherry picked from commit cb262b09396edd171eb3903e50ce5ddeb593f963)
-rw-r--r--package/network/utils/wwan/files/data/1e2d-00536
-rw-r--r--package/network/utils/wwan/files/data/1e2d-005b5
-rwxr-xr-xpackage/network/utils/wwan/files/wwan.sh2
-rw-r--r--package/network/utils/wwan/files/wwan.usb5
4 files changed, 17 insertions, 1 deletions
diff --git a/package/network/utils/wwan/files/data/1e2d-0053 b/package/network/utils/wwan/files/data/1e2d-0053
new file mode 100644
index 0000000000..e83f04c380
--- /dev/null
+++ b/package/network/utils/wwan/files/data/1e2d-0053
@@ -0,0 +1,6 @@
+{
+ "desc": "Cinterion PH8",
+ "control": 2,
+ "data": 3
+}
+
diff --git a/package/network/utils/wwan/files/data/1e2d-005b b/package/network/utils/wwan/files/data/1e2d-005b
new file mode 100644
index 0000000000..6678ff080c
--- /dev/null
+++ b/package/network/utils/wwan/files/data/1e2d-005b
@@ -0,0 +1,5 @@
+{
+ "desc": "Cinterion ELS61",
+ "control": 1,
+ "data": 0
+}
diff --git a/package/network/utils/wwan/files/wwan.sh b/package/network/utils/wwan/files/wwan.sh
index 2e9d73f1e2..e0bd4c8727 100755
--- a/package/network/utils/wwan/files/wwan.sh
+++ b/package/network/utils/wwan/files/wwan.sh
@@ -59,7 +59,7 @@ proto_wwan_setup() {
json_set_namespace $old_cb
[ -n "$control" -a -n "$data" ] && {
- ttys=$(ls -d /sys/bus/usb/devices/$devicename/${devicename}*/tty* | sed "s/.*\///g" | tr "\n" " ")
+ ttys=$(ls -d /sys/bus/usb/devices/$devicename/${devicename}*/tty?* /sys/bus/usb/devices/$devicename/${devicename}*/tty/tty?* | sed "s/.*\///g" | tr "\n" " ")
ctl_device=/dev/$(echo $ttys | cut -d" " -f $((control + 1)))
dat_device=/dev/$(echo $ttys | cut -d" " -f $((data + 1)))
driver=comgt
diff --git a/package/network/utils/wwan/files/wwan.usb b/package/network/utils/wwan/files/wwan.usb
index 507b002d14..b757c1c2ab 100644
--- a/package/network/utils/wwan/files/wwan.usb
+++ b/package/network/utils/wwan/files/wwan.usb
@@ -1,5 +1,10 @@
+#!/bin/sh
+
[ "$ACTION" = add -a "$DEVTYPE" = usb_device ] || exit 0
+. /lib/functions.sh
+. /lib/netifd/netifd-proto.sh
+
vid=$(cat /sys$DEVPATH/idVendor)
pid=$(cat /sys$DEVPATH/idProduct)
[ -f "/lib/network/wwan/$vid:$pid" ] || exit 0