From 9d509b743330c3e528e58573e352e0f93302f565 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Wed, 21 Feb 2024 16:41:32 +0100 Subject: [PATCH] modemmanager: start a 3gpp network regsistration 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 --- net/modemmanager/Makefile | 2 +- .../files/lib/netifd/proto/modemmanager.sh | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/net/modemmanager/Makefile b/net/modemmanager/Makefile index bdd55817af..97f8dce06a 100644 --- a/net/modemmanager/Makefile +++ b/net/modemmanager/Makefile @@ -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 diff --git a/net/modemmanager/files/lib/netifd/proto/modemmanager.sh b/net/modemmanager/files/lib/netifd/proto/modemmanager.sh index 9659726837..67545513d0 100644 --- a/net/modemmanager/files/lib/netifd/proto/modemmanager.sh +++ b/net/modemmanager/files/lib/netifd/proto/modemmanager.sh @@ -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