[openwrt/openwrt] comgt: ncm: try to detect interface for ttyACM ports
LEDE Commits
lede-commits at lists.infradead.org
Sat Apr 16 05:25:04 PDT 2022
hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/ed7957810c0aee04943559be9b0ed23431ee0654
commit ed7957810c0aee04943559be9b0ed23431ee0654
Author: Lech Perczak <lech.perczak at gmail.com>
AuthorDate: Thu Mar 31 21:16:34 2022 +0200
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 <cezary at eko.one.pl>
Signed-off-by: Cezary Jackiewicz <cezary at eko.one.pl>
Signed-off-by: Lech Perczak <lech.perczak at gmail.com>
---
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"
More information about the lede-commits
mailing list