aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Eckert <Eckert.Florian@googlemail.com>2016-12-20 13:07:31 +0100
committerJohn Crispin <john@phrozen.org>2016-12-22 15:03:58 +0100
commit6c82f8a4833144ad54a204e002867330f5d3b071 (patch)
tree3f3388f5bc4158e51f45a42192369b004cc03e6f
parent363c3e68acec79f25deae49d2a8ecc45ec752d78 (diff)
downloadupstream-6c82f8a4833144ad54a204e002867330f5d3b071.tar.gz
upstream-6c82f8a4833144ad54a204e002867330f5d3b071.tar.bz2
upstream-6c82f8a4833144ad54a204e002867330f5d3b071.zip
uqmi: add plmn set functionality for netifd proto handler
uqmi has the possibility to allow the modem to start a regsitration process only to this specified plmn Signed-off-by: Florian Eckert <Eckert.Florian@googlemail.com>
-rwxr-xr-xpackage/network/utils/uqmi/files/lib/netifd/proto/qmi.sh24
1 files changed, 22 insertions, 2 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 1f260ae3c2..35de6c5ad5 100755
--- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
+++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
@@ -21,16 +21,17 @@ proto_qmi_init_config() {
proto_config_add_int profile
proto_config_add_boolean dhcpv6
proto_config_add_boolean autoconnect
+ proto_config_add_int plmn
proto_config_add_defaults
}
proto_qmi_setup() {
local interface="$1"
- local device apn auth username password pincode delay modes pdptype profile dhcpv6 autoconnect $PROTO_DEFAULT_OPTIONS
+ local device apn auth username password pincode delay modes pdptype profile dhcpv6 autoconnect plmn $PROTO_DEFAULT_OPTIONS
local cid_4 pdh_4 cid_6 pdh_6
local ip_6 ip_prefix_length gateway_6 dns1_6 dns2_6
- json_get_vars device apn auth username password pincode delay modes pdptype profile dhcpv6 autoconnect $PROTO_DEFAULT_OPTIONS
+ json_get_vars device apn auth username password pincode delay modes pdptype profile dhcpv6 autoconnect plmn $PROTO_DEFAULT_OPTIONS
[ "$metric" = "" ] && metric="0"
@@ -76,6 +77,25 @@ proto_qmi_setup() {
}
}
+ [ -n "$plmn" ] && {
+ local mcc mnc
+ if [ "$plmn" = 0 ]; then
+ mcc=0
+ mnc=0
+ echo "Setting PLMN to auto"
+ else
+ mcc=${plmn:0:3}
+ mnc=${plmn:3}
+ echo "Setting PLMN to $plmn"
+ fi
+ uqmi -s -d "$device" --set-plmn --mcc "$mcc" --mnc "$mnc" || {
+ echo "Unable to set PLMN"
+ proto_notify_error "$interface" PLMN_FAILED
+ proto_block_restart "$interface"
+ return 1
+ }
+ }
+
uqmi -s -d "$device" --set-data-format 802.3
uqmi -s -d "$device" --wda-set-data-format 802.3
uqmi -s -d "$device" --sync