summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-10-02 12:18:28 +0000
committerFelix Fietkau <nbd@openwrt.org>2014-10-02 12:18:28 +0000
commitcf595fe83453e90f604551257efc9112800babbf (patch)
treebb65233552c49ddd8af7a01de4bacbfbb18e208b
parent28301ea0b1deedc38353194ecee0e703f6ee6d96 (diff)
downloadmtk-20170518-cf595fe83453e90f604551257efc9112800babbf.zip
mtk-20170518-cf595fe83453e90f604551257efc9112800babbf.tar.gz
mtk-20170518-cf595fe83453e90f604551257efc9112800babbf.tar.bz2
uqmi: work out the ifname instead of relying on it being in uci
Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 42719
-rwxr-xr-xpackage/network/utils/uqmi/files/lib/netifd/proto/qmi.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
index 693fd6c..ce86dfc 100755
--- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
+++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
@@ -5,6 +5,8 @@
init_proto "$@"
proto_qmi_init_config() {
+ available=1
+ no_device=1
proto_config_add_string "device:device"
proto_config_add_string apn
proto_config_add_string auth
@@ -34,6 +36,16 @@ proto_qmi_setup() {
return 1
}
+ devname="$(basename "$device")"
+ devpath="$(readlink -f /sys/class/usbmisc/$devname/device/)"
+ ifname="$( ls "$devpath"/net )"
+ [ -n "$ifname" ] || {
+ logger -p daemon.err -t "qmi[$$]" "The interface could not be found."
+ proto_notify_error "$interface" NO_IFACE
+ proto_block_restart "$interface"
+ return 1
+ }
+
[ -n "$delay" ] && sleep "$delay"
while uqmi -s -d "$device" --get-pin-status | grep '"UIM uninitialized"' > /dev/null; do
@@ -93,7 +105,7 @@ proto_qmi_setup() {
fi
logger -p daemon.info -t "qmi[$$]" "Connected, starting DHCP"
- proto_init_update "*" 1
+ proto_init_update "$ifname" 1
proto_send_update "$interface"
json_init