modemmanager: start a 3gpp network regsistration
authorFlorian Eckert <fe@dev.tdt.de>
Wed, 21 Feb 2024 15:41:32 +0000 (16:41 +0100)
committerFlorian Eckert <fe@dev.tdt.de>
Tue, 5 Mar 2024 14:20:38 +0000 (15:20 +0100)
If a 'plmn' is set in the configuration, a registration attempt should be
established before the simple-connect command. If the plmn is set during
the simple-connect, a network change may occur during the connection setup.

To prevent this, the registration is started before the simple-connect with
a separate mmcli command. So that we can be sure that the modem is already
registered in the correct network before the simple-connect command.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
net/modemmanager/Makefile
net/modemmanager/files/lib/netifd/proto/modemmanager.sh

index bdd55817af7e7fcde17b8256198049476e688c1c..97f8dce06a60a74e28c1a1489b2774458cce4377 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=modemmanager
 PKG_SOURCE_VERSION:=1.22.0
-PKG_RELEASE:=10
+PKG_RELEASE:=11
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/ModemManager.git
index 96597268377bebb377fd0228c919a0117aa53875..67545513d0553105c89b13ea790db68de0f6cf10 100644 (file)
@@ -466,6 +466,17 @@ proto_modemmanager_setup() {
                return 1
        }
 
+       [ -z "${plmn}" ] || {
+               echo "starting network registraion with plmn '${plmn}'..."
+               mmcli --modem="${device}" \
+                       --timeout 120 \
+                       --3gpp-register-in-operator="${plmn}" || {
+                       proto_notify_error "${interface}" MM_3GPP_OPERATOR_REGISTRATION_FAILED
+                       proto_block_restart "${interface}"
+                       return 1
+               }
+       }
+
        if [ -z "${allowedmode}" ]; then
                modemmanager_set_allowed_mode "$device" "$interface" "any"
        else