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 <ck@dev.tdt.de>
This commit is contained in:
Christian Korber
2025-06-27 08:48:55 +02:00
committed by Florian Eckert
parent 8f0b5561e1
commit a6b332f4e9
3 changed files with 4 additions and 8 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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}'}"
}