Skip to content
Snippets Groups Projects
Commit cf595fe8 authored by Felix Fietkau's avatar Felix Fietkau
Browse files

uqmi: work out the ifname instead of relying on it being in uci


Signed-off-by: default avatarJohn Crispin <blogic@openwrt.org>

SVN-Revision: 42719
parent 28301ea0
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
init_proto "$@" init_proto "$@"
proto_qmi_init_config() { proto_qmi_init_config() {
available=1
no_device=1
proto_config_add_string "device:device" proto_config_add_string "device:device"
proto_config_add_string apn proto_config_add_string apn
proto_config_add_string auth proto_config_add_string auth
...@@ -34,6 +36,16 @@ proto_qmi_setup() { ...@@ -34,6 +36,16 @@ proto_qmi_setup() {
return 1 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" [ -n "$delay" ] && sleep "$delay"
while uqmi -s -d "$device" --get-pin-status | grep '"UIM uninitialized"' > /dev/null; do while uqmi -s -d "$device" --get-pin-status | grep '"UIM uninitialized"' > /dev/null; do
...@@ -93,7 +105,7 @@ proto_qmi_setup() { ...@@ -93,7 +105,7 @@ proto_qmi_setup() {
fi fi
logger -p daemon.info -t "qmi[$$]" "Connected, starting DHCP" logger -p daemon.info -t "qmi[$$]" "Connected, starting DHCP"
proto_init_update "*" 1 proto_init_update "$ifname" 1
proto_send_update "$interface" proto_send_update "$interface"
json_init json_init
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment