Skip to content

Commit

Permalink
comgt: ncm: try to detect interface for ttyACM ports
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Leo-PL authored and hauke committed Apr 16, 2022
1 parent b2940bb commit ed79578
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions package/network/utils/comgt/files/ncm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit ed79578

Please sign in to comment.