[openwrt/openwrt] comgt: ncm: try to detect interface for ttyACM ports
LEDE Commits
lede-commits at lists.infradead.org
Sun Apr 17 16:06:48 PDT 2022
hauke pushed a commit to openwrt/openwrt.git, branch openwrt-22.03:
https://git.openwrt.org/83003b6c066049fc68be802dfb25449753cb4671
commit 83003b6c066049fc68be802dfb25449753cb4671
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>
(cherry picked from commit ed7957810c0aee04943559be9b0ed23431ee0654)
---
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