From a6b332f4e9d57eeefeffd011b1059a9746fbefa6 Mon Sep 17 00:00:00 2001 From: Christian Korber Date: Fri, 27 Jun 2025 08:48:55 +0200 Subject: [PATCH] modemmanager: change to configuration option disable_modem This commit sets default of `disable_modem` to 1 and disconnects modem. If set otherwise it keeps the modem connected. Signed-off-by: Christian Korber --- net/modemmanager/Makefile | 2 +- net/modemmanager/files/lib/netifd/proto/modemmanager.sh | 9 +++------ .../usr/lib/ModemManager/connection.d/10-report-down | 1 - 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/net/modemmanager/Makefile b/net/modemmanager/Makefile index 9cbd4bfca1..1ae1ef8ad9 100644 --- a/net/modemmanager/Makefile +++ b/net/modemmanager/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=modemmanager PKG_VERSION:=1.24.0 -PKG_RELEASE:=4 +PKG_RELEASE:=5 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 f0e0551e47..0444ba842d 100644 --- a/net/modemmanager/files/lib/netifd/proto/modemmanager.sh +++ b/net/modemmanager/files/lib/netifd/proto/modemmanager.sh @@ -877,14 +877,11 @@ proto_modemmanager_teardown() { mmcli --modem="${device}" --simple-disconnect || proto_notify_error "${interface}" DISCONNECT_FAILED - # reading variable from var state which was set in - # '/usr/lib/ModemManager/connection.d/10-report-down' - # because of a reconnect event. - # The modem therefore does not need to be disabled. - local disable="$(uci_get_state network "$interface" disable_modem "1")" + # Variable is set to '1' if modem should be disabled on ifdown, + # otherwise it stays connected. + local disable="$(uci_get network "$interface" disable_modem "1")" if [ "${disable}" -eq 0 ]; then echo "Skipping modem disable" - uci_revert_state network "${interface}" disable_modem else mmcli --modem="${device}" --disable fi diff --git a/net/modemmanager/files/usr/lib/ModemManager/connection.d/10-report-down b/net/modemmanager/files/usr/lib/ModemManager/connection.d/10-report-down index 9c0484d6ed..b8feb26779 100644 --- a/net/modemmanager/files/usr/lib/ModemManager/connection.d/10-report-down +++ b/net/modemmanager/files/usr/lib/ModemManager/connection.d/10-report-down @@ -32,7 +32,6 @@ IFUP=$(ifstatus "${CFG}" | jsonfilter -e "@.up") [ "${IFUP}" = "true" ] && { mm_log "info" "Reconnecting '${CFG}' on '${STATE}' event" - uci_toggle_state network "${CFG}" disable_modem "0" ubus call network.interface down "{ 'interface': '${CFG}'}" ubus call network.interface up "{ 'interface': '${CFG}'}" } -- 2.30.2