Browse Source

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 <[email protected]>
Signed-off-by: Cezary Jackiewicz <[email protected]>
Signed-off-by: Lech Perczak <[email protected]>
Lech Perczak 3 years ago
parent
commit
ed7957810c
1 changed files with 4 additions and 0 deletions
  1. 4 0
      package/network/utils/comgt/files/ncm.sh

+ 4 - 0
package/network/utils/comgt/files/ncm.sh

@@ -57,6 +57,10 @@ proto_ncm_setup() {
 	[ -z "$ifname" ] && {
 	[ -z "$ifname" ] && {
 		devname="$(basename "$device")"
 		devname="$(basename "$device")"
 		case "$devname" in
 		case "$devname" in
+		'ttyACM'*)
+			devpath="$(readlink -f /sys/class/tty/$devname/device)"
+			ifpath="$devpath/../*/net"
+			;;
 		'tty'*)
 		'tty'*)
 			devpath="$(readlink -f /sys/class/tty/$devname/device)"
 			devpath="$(readlink -f /sys/class/tty/$devname/device)"
 			ifpath="$devpath/../../*/net"
 			ifpath="$devpath/../../*/net"