I'm re-submitting the patch with the comments from Jo-Phillip
With some modems the ttyUSBx device/s are not automatically created
after the mode switch (for example with my k3765).
This patch adds a new id for the target device after the mode switch.
Signed-off-by: Roberto Riggio<roberto.rig...@create-net.org>
--
Index: utils/usb-modeswitch/files/modeswitch.hotplug
===================================================================
--- utils/usb-modeswitch/files/modeswitch.hotplug (revision 23568)
+++ utils/usb-modeswitch/files/modeswitch.hotplug (working copy)
@@ -2,6 +2,7 @@
local uVid uPid uMa uPr uSe
local sVe sMo sRe
+local tVid tPid
local modeswitch="/usr/bin/usb_modeswitch"
@@ -121,6 +122,10 @@
[ -n "$configs" ] && {
log "$DEVICENAME: Selecting ${configs%% *} for mode switching"
$modeswitch -c "${configs%% *}"
+ tVid=$(sed -ne 's/TargetVendor[^=]*=\(.*\)/\1/p'
"${configs%% *}")
+ tPid=$(sed -ne 's/TargetProduct[^=]*=\(.*\)/\1/p'
"${configs%% *}")
+ log "$DEVICENAME: Adding $tVid $tPid device id to option
driver"
+ echo "$tVid $tPid" >
/sys/bus/usb-serial/drivers/option1/new_id
}
}
fi
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel