Signed-off-by: John Crispin <blogic@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42719
3c298f89-4303-0410-b956-
a3cf2f4a3e73
init_proto "$@"
proto_qmi_init_config() {
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
proto_config_add_string "device:device"
proto_config_add_string apn
proto_config_add_string auth
+ 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
[ -n "$delay" ] && sleep "$delay"
while uqmi -s -d "$device" --get-pin-status | grep '"UIM uninitialized"' > /dev/null; do
fi
logger -p daemon.info -t "qmi[$$]" "Connected, starting DHCP"
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
proto_send_update "$interface"
json_init