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-Url: http://git.lede-project.org./?a=commitdiff_plain;h=ed7957810c0aee04943559be9b0ed23431ee0654;p=openwrt%2Fstaging%2Frmilecki.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 --- diff --git a/package/network/utils/comgt/files/ncm.sh b/package/network/utils/comgt/files/ncm.sh index c3a06165efc..a2c913ea1d6 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"