From 83003b6c066049fc68be802dfb25449753cb4671 Mon Sep 17 00:00:00 2001 From: Lech Perczak Date: Thu, 31 Mar 2022 21:16:34 +0200 Subject: [PATCH] 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 Signed-off-by: Cezary Jackiewicz Signed-off-by: Lech Perczak (cherry picked from commit ed7957810c0aee04943559be9b0ed23431ee0654) --- package/network/utils/comgt/files/ncm.sh | 4 ++++ 1 file changed, 4 insertions(+) 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" -- 2.30.2