aboutsummaryrefslogtreecommitdiffstats
path: root/package/network
diff options
context:
space:
mode:
authorLech Perczak <lech.perczak@gmail.com>2022-03-31 21:16:34 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2022-04-16 14:02:11 +0200
commited7957810c0aee04943559be9b0ed23431ee0654 (patch)
tree8ed8a53837107aff31e170cfde69b7f3092bc76a /package/network
parentb2940bb8b2878ce193f2edaee3e7d4c44f4a2065 (diff)
downloadupstream-ed7957810c0aee04943559be9b0ed23431ee0654.tar.gz
upstream-ed7957810c0aee04943559be9b0ed23431ee0654.tar.bz2
upstream-ed7957810c0aee04943559be9b0ed23431ee0654.zip
comgt: ncm: try to detect interface for ttyACM ports
Some modems expose ttyACM as their control ports, which have the "device" symlink pointing one level down in sysfs tree. Try to find network interfaces for them as well, this is commonly used for modems exposing ACM + RNDIS or ACM + ECM interface combinations. Co-developed-by: Cezary Jackiewicz <cezary@eko.one.pl> Signed-off-by: Cezary Jackiewicz <cezary@eko.one.pl> Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
Diffstat (limited to 'package/network')
-rw-r--r--package/network/utils/comgt/files/ncm.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/package/network/utils/comgt/files/ncm.sh b/package/network/utils/comgt/files/ncm.sh
index c3a06165ef..a2c913ea1d 100644
--- a/package/network/utils/comgt/files/ncm.sh
+++ b/package/network/utils/comgt/files/ncm.sh
@@ -57,6 +57,10 @@ proto_ncm_setup() {
[ -z "$ifname" ] && {
devname="$(basename "$device")"
case "$devname" in
+ 'ttyACM'*)
+ devpath="$(readlink -f /sys/class/tty/$devname/device)"
+ ifpath="$devpath/../*/net"
+ ;;
'tty'*)
devpath="$(readlink -f /sys/class/tty/$devname/device)"
ifpath="$devpath/../../*/net"