From: Lech Perczak Date: Thu, 31 Mar 2022 19:16:34 +0000 (+0200) Subject: comgt: ncm: try to detect interface for ttyACM ports X-Git-Tag: v22.03.0-rc1~22 X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=83003b6c066049fc68be802dfb25449753cb4671;p=openwrt%2Fstaging%2Fpepe2k.git 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) --- 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"