modemmanager: move initial eps settings after modem enable
authorFlorian Eckert <fe@dev.tdt.de>
Wed, 16 Oct 2024 14:47:43 +0000 (16:47 +0200)
committerFlorian Eckert <Eckert.Florian@googlemail.com>
Fri, 15 Nov 2024 10:17:05 +0000 (11:17 +0100)
This settings are needed before any other mmcli command is executed.

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

index 669acb38e0b412c201ba5edf44011858fb21ab28..f20236411e9eb80f2a00e984497fea54647ce640 100644 (file)
@@ -583,6 +583,48 @@ proto_modemmanager_setup() {
                return 1
        }
 
+       # set initial eps bearer settings
+       [ -z "${init_epsbearer}" ] || {
+               case "$init_epsbearer" in
+                       "none")
+                               connectargs=""
+                               modemmanager_init_epsbearer "none" \
+                                       "$device" "${connectargs}" "$apn"
+                               ;;
+                       "default")
+                               cliauth=""
+                               for auth in $allowedauth; do
+                                       cliauth="${cliauth}${cliauth:+|}$auth"
+                               done
+                               connectargs=""
+                               append_param "apn=${apn}"
+                               append_param "${iptype:+ip-type=${iptype}}"
+                               append_param "${cliauth:+allowed-auth=${cliauth}}"
+                               append_param "${username:+user=${username}}"
+                               append_param "${password:+password=${password}}"
+                               modemmanager_init_epsbearer "default" \
+                                       "$device" "${connectargs}" "$apn"
+                               ;;
+                       "custom")
+                               cliauth=""
+                               for auth in $init_allowedauth; do
+                                       cliauth="${cliauth}${cliauth:+|}$auth"
+                               done
+                               connectargs=""
+                               append_param "apn=${init_apn}"
+                               append_param "${init_iptype:+ip-type=${init_iptype}}"
+                               append_param "${cliauth:+allowed-auth=${cliauth}}"
+                               append_param "${init_username:+user=${init_username}}"
+                               append_param "${init_password:+password=${init_password}}"
+                               modemmanager_init_epsbearer "custom" \
+                                       "$device" "${connectargs}" "$init_apn"
+                               ;;
+               esac
+               # check error for init_epsbearer function call
+               [ "$?" -ne "0" ] && return 1
+       }
+
+
        [ -z "${plmn}" ] || {
                echo "starting network registraion with plmn '${plmn}'..."
                mmcli --modem="${device}" \
@@ -629,47 +671,6 @@ proto_modemmanager_setup() {
                [ "$?" -ne "0" ] && return 1
        fi
 
-       # set initial eps bearer settings
-       [ -z "${init_epsbearer}" ] || {
-               case "$init_epsbearer" in
-                       "none")
-                               connectargs=""
-                               modemmanager_init_epsbearer "none" \
-                                       "$device" "${connectargs}" "$apn"
-                               ;;
-                       "default")
-                               cliauth=""
-                               for auth in $allowedauth; do
-                                       cliauth="${cliauth}${cliauth:+|}$auth"
-                               done
-                               connectargs=""
-                               append_param "apn=${apn}"
-                               append_param "${iptype:+ip-type=${iptype}}"
-                               append_param "${cliauth:+allowed-auth=${cliauth}}"
-                               append_param "${username:+user=${username}}"
-                               append_param "${password:+password=${password}}"
-                               modemmanager_init_epsbearer "default" \
-                                       "$device" "${connectargs}" "$apn"
-                               ;;
-                       "custom")
-                               cliauth=""
-                               for auth in $init_allowedauth; do
-                                       cliauth="${cliauth}${cliauth:+|}$auth"
-                               done
-                               connectargs=""
-                               append_param "apn=${init_apn}"
-                               append_param "${init_iptype:+ip-type=${init_iptype}}"
-                               append_param "${cliauth:+allowed-auth=${cliauth}}"
-                               append_param "${init_username:+user=${init_username}}"
-                               append_param "${init_password:+password=${init_password}}"
-                               modemmanager_init_epsbearer "custom" \
-                                       "$device" "${connectargs}" "$init_apn"
-                               ;;
-               esac
-               # check error for init_epsbearer function call
-               [ "$?" -ne "0" ] && return 1
-       }
-
        # setup connect args; APN mandatory (even if it may be empty)
        echo "starting connection with apn '${apn}'..."