aboutsummaryrefslogtreecommitdiffstats
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-17 21:31:02 +0200
commit83003b6c066049fc68be802dfb25449753cb4671 (patch)
tree499228524411a6cb12b93a3f455ccad92514cae7
parent839cb17e3a246deb492658a629980fb2c77e62bc (diff)
downloadupstream-83003b6c066049fc68be802dfb25449753cb4671.tar.gz
upstream-83003b6c066049fc68be802dfb25449753cb4671.tar.bz2
upstream-83003b6c066049fc68be802dfb25449753cb4671.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> (cherry picked from commit ed7957810c0aee04943559be9b0ed23431ee0654)
-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"