Skip to content
Snippets Groups Projects
Commit 6c82f8a4 authored by Florian Eckert's avatar Florian Eckert Committed by John Crispin
Browse files

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: default avatarFlorian Eckert <Eckert.Florian@googlemail.com>
parent 363c3e68
No related branches found
No related tags found
No related merge requests found
...@@ -21,16 +21,17 @@ proto_qmi_init_config() { ...@@ -21,16 +21,17 @@ proto_qmi_init_config() {
proto_config_add_int profile proto_config_add_int profile
proto_config_add_boolean dhcpv6 proto_config_add_boolean dhcpv6
proto_config_add_boolean autoconnect proto_config_add_boolean autoconnect
proto_config_add_int plmn
proto_config_add_defaults proto_config_add_defaults
} }
proto_qmi_setup() { proto_qmi_setup() {
local interface="$1" 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 cid_4 pdh_4 cid_6 pdh_6
local ip_6 ip_prefix_length gateway_6 dns1_6 dns2_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" [ "$metric" = "" ] && metric="0"
...@@ -76,6 +77,25 @@ proto_qmi_setup() { ...@@ -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" --set-data-format 802.3
uqmi -s -d "$device" --wda-set-data-format 802.3 uqmi -s -d "$device" --wda-set-data-format 802.3
uqmi -s -d "$device" --sync uqmi -s -d "$device" --sync
......
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