Commit Graph
9416 Commits
Author SHA1 Message Date
Dan Williams d9d1907157 Merge request !1367 from 'mr/20250530-cinterion'
cinterion: add MV32/MV31 udev rules and AT workarounds

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1367
2025-07-30 13:00:03 -05:00
Florian Eckert 1a9602ab6a cinterion: ignore carrier revision
MV31 MBIM modem firmware revisions are not matched with carrier configs.
Different VoLTE profiles might be selected by the user causing
the carrier config revision to change.

Since fwupd uses this string for firmware updates, it gets confused and
thinks the user has an update available.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2025-07-30 12:41:22 -05:00
Florian Eckert 5d4b0d3516 cinterion: add hardware revision read via AT for MV31 and MV32
Reading the hardware revision via the mbim interface returns an incorrect
hardware revision string. The output is always set to
'h/w revision: Thales Snapdragon X55'

  Hardware |            manufacturer: Cinterion
...
           |            h/w revision: Thales Snapdragon X55

This is an incorrect value returned by the MBIM interface. The MV31 and MV32
does have a dedicated AT Command to get the correct hardware revision
via 'AT+SKUID'. If the hardware revision is read via the AT command, the
output looks as follows.

  Hardware |            manufacturer: Cinterion
...
           |            h/w revision: V065

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2025-07-30 12:41:22 -05:00
Florian Eckert a107de32a8 cinterion: add revision read via AT for the MV31 and MV32
Reading the revsion via the mbim interface returns an incorrect firmware
revsion string. This contains a '\n' character so that the revision looks
like this in 'mmcli'.

Hardware  |            manufacturer: Cinterion
          |            model: Cinterion PID 0x00F1 USB Mobile Broadband
          |            firmware revision: FDE.F0.3.0.1.1.DT.005
          |            062
          |            carrier config: DT

The correct string without '\n' is returned via the AT interface. To fix
the error, the 'mbim' revision interface is overwritten with an AT call
if a MV31 or a MV32 is detected. So we get the correct output via 'mmcli'.

Hardware  |            manufacturer: Cinterion
          |            model: Cinterion PID 0x00F1 USB Mobile Broadband
          |            firmware revision: FDE.F0.3.0.1.1.DT.005.062
          |            carrier config: DT

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2025-07-30 12:41:22 -05:00
Florian Eckert ebebce6111 cinterion: add MV31 to the rules file
Add the missing udev rules for the MV31 from 'Telit' which uses the
cinterion plugin.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2025-07-30 12:41:22 -05:00
Florian Eckert f4a1c0fcec cinterion: add MV32 to the rules file
Add the missing udev rules for the MV32 from 'Telit' which uses the
cinterion plugin.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2025-07-30 12:41:22 -05:00
Dan Williams 70ad037146 Merge request !1386 from 'feat/access-to-signal-threshold'
polkit,conf: give access to Signal.SetupThresholds() the same way as for Signal.Setup()

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1386
2025-07-30 12:18:11 -05:00
Andrey Skvortsov 07aca09af2 polkit,conf: give access to Signal.SetupThresholds() the same way as for Signal.Setup()
Otherwise only Setup() method for suboptimal polling is available to
non-privileged users.

Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
2025-07-30 12:15:53 -05:00
Dan Williams 41133db361 Merge request !1388 from 'fix/cell-info-docs'
libmm-glib,cell-info: fix documentation for some functions

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1388
2025-07-30 11:29:16 -05:00
Andrey Skvortsov f0a9aba63b libmm-glib,cell-info: fix documentation for some functions
Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
2025-07-30 11:25:07 -05:00
Dan Williams ddea6c02d5 Merge request !1387 from 'fix/typos'
cli,signal: fix typo in debug message for async operations

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1387
2025-07-30 11:23:43 -05:00
Andrey Skvortsov 7ff47d795c cli,signal: fix typo in debug message for async operations
Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
2025-07-30 17:28:45 +03:00
Dan Williams d69dd96174 Merge request !1378 from 'suspend-bearer-timeout'
base-manager: increase suspend timeout for each active bearer

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1378
2025-07-28 09:20:50 -05:00
Dan Williams 01208cc6c0 base-manager: increase suspend timeout for each active bearer
Some modems can take a very long time (~20s) to reply to bearer
disconnect requests especially in marginal signal situations where
the modem must resend messages to the network after internal
timeouts. Give the modem a chance to suspend successfully if
there are active bearers.

Related: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1311#note_2938638

Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-07-21 15:12:01 -05:00
Dan Williams 11489152d8 sleep-context: add ability to increase timeout
Track when the timeout was started, so that if it needs to be increased
we can calculate how long the new timeout should be. Then cancel the
original timeout and start a new one with.

Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-07-21 15:11:16 -05:00
Dan Williams f7897daeb5 broadband-modem,iface-modem: move bearer counting to interface and generalize
Allow counting more kinds of bearers than just multiplexed ones.

Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-07-21 15:11:16 -05:00
Dan Williams 6c75cbcf74 Merge request !1377 from 'dp/eutran-106-support'
add support for eutran band 106

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1377
2025-07-11 01:09:42 -05:00
Daniele Palmas 0e1ba4c530 modem-helpers-qmi: support EUTRAN bands 85 and 106
Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
2025-07-09 10:41:43 +02:00
Daniele Palmas 7fefddab05 libmm-glib,helpers: extend EUTRAN bands to 85 and 106
Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
2025-07-09 10:41:43 +02:00
Daniele Palmas b1d5006953 api,enums: add EUTRAN 106 band
Add EUTRAN 106 band with an offset of 1000 since the current numbering
scheme overlaps with MM_MODEM_BAND_CDMA_*.

Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
2025-07-09 10:41:35 +02:00
Daniele Palmas c070b9015e test,modem-helpers-qmi: add unit tests for bands
Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
2025-07-09 10:33:26 +02:00
Dan Williams 0ef7bf3fdb Merge request !1350 from 'local_br'
plugin,mtk: remove the relevant log prints of the device model.

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1350
2025-07-04 12:18:31 -05:00
Vanillan Wang 91adec212d plugin,mtk: remove the relevant log prints of the device model.
Rolling devices use mtk plugin, but there are some "FM350" log prints,
which is not appropriate.

Signed-off-by: Vanillan Wang <vanillanwang@163.com>
2025-07-04 12:15:29 -05:00
Dan Williams 1861ae1411 Merge request !1376 from 'main'
broadband-modem: exit with error if enable() is called in enabling state

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1376
2025-07-01 22:41:59 -05:00
Rukun Mao ca4334de94 broadband-modem: exit with error if enable() is called in enabling state
We should not assert. We can error out the latest enabling attempt and let
the previous enabling gracefully reach an end.

Issue log:
"2025-06-22T21:56:52.972448Z NOTICE ModemManager[1842]: <msg> [modem2] state changed (disabled -> enabling)
...
2025-06-22T21:57:53.146572Z ERR ModemManager[1842]: <err> [modem2] port cdc-wdm0 timed out 10 consecutive times, marking modem as invalid
...
2025-06-22T21:57:53.185751Z INFO shill[870]: INFO shill: [modem_info.cc(120)] RemoveModem: /org/freedesktop/ModemManager1/Modem/2
2025-06-22T21:57:53.187595Z INFO ModemManager[1842]: <inf> [modem2] processing user request to enable modem...
"

which led to a crash:
"
0x00007c474ceb979f (libc.so.6 -pthread_kill.c:44)               ??__pthread_kill_implementation
0x00007c474ce6d92c (libc.so.6 -raise.c:26)                      ??raise
0x00007c474ce584aa (libc.so.6 -abort.c:79)                      ??abort
0x00007c474d72b269 (libglib-2.0.so.0 -gtestutils.c:3450)        ??g_assertion_message
0x00007c474d72b2e3 (libglib-2.0.so.0 -gtestutils.c:3476)        ??g_assertion_message_expr
0x00005979074b4b6a (ModemManager -mm-broadband-modem.c)         enable
0x00005979074e3b9c (ModemManager -mm-iface-modem.c:2340)        handle_enable_auth_ready
0x00007c474d591997 (libgio-2.0.so.0 -gtask.c:1309)              g_task_return_now
0x00007c474d590555 (libgio-2.0.so.0 -gtask.c:1378)              g_task_return
0x00005979074a57bd (ModemManager -mm-base-modem.c:2011)         lock_after_authorize_ready
0x00007c474d591997 (libgio-2.0.so.0 -gtask.c:1309)              g_task_return_now
0x00007c474d590555 (libgio-2.0.so.0 -gtask.c:1378)              g_task_return
0x00005979074a3fa8 (ModemManager -mm-base-modem.c:1841)         base_modem_operation_run
...
"

Signed-off-by: Rukun Mao <rmao@google.com>
2025-06-26 20:24:16 +00:00
Dan Williams 2529159cee Merge request !1374 from 'cinterion-add-tdd-lte-bands-disabled-flag'
cinterion: add tdd_lte_bands_disabled flag

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1374

Closes #977
2025-06-25 08:17:22 -05:00
Kirill Buksha e8d781ae0b cinterion: allow missing LTE-TDD bands in SCFG response
Some modems (at least ELS62-E) doesn't support TDD LTE bands and their SCFG
responses doesn't contain LTE-TDD bands.

Signed-off-by: Kirill Buksha <kirbuk200@gmail.com>
2025-06-25 07:55:40 -05:00
Aleksander Morgado 9d11ff4ba9 Merge request !1375 from 'aleksander/fibocom-urcs'
iface-modem: ignore SIM events during a controlled SIM slot switch

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1375
2025-06-25 00:33:29 +02:00
Aleksander Morgado a24b60e52e fibocom: setup several +SIM URCs as hotplug event indications
Treat the following URCs as indications of possible SIM hot swap
events:
  +SIM: Inserted
  +SIM: Removed
  +SIM DROP

Any time any of these is received, a SIM hot swap event is reported,
and the logic can then determine what to do. These should lead to
doing nothing if they happen as part of a controlled SIM slot switch.

Signed-off-by: Aleksander Morgado <aleksandermj@google.com>
2025-06-18 22:10:54 +00:00
Aleksander Morgado 7d4784ed28 iface-modem: ignore SIM events during a controlled SIM slot switch
If there is an ongoing SIM slot switch, we must ignore all SIM hotswap
related events happening during the process. The flag that is set in
the Modem interface private info to track this is never reset back to
FALSE on a successful SIM slot switch, it will be set for as long as
the modem object exists.

After the successful SIM slot switch, a new modem reprobe will be
requested, which leads to the old modem object to be disposed (the one
that had the flag set) and a new modem object created.

The logic that already existed in the MBIM modem object is now
generalized in the Modem interface itself so that SIM events reported
via other protocols are also properly ignored.

Signed-off-by: Aleksander Morgado <aleksandermj@google.com>
2025-06-18 22:10:54 +00:00
Dan Williams 0b2d7d6388 Merge request !1362 from 'disable-unsolicited-3gpp-events'
Disable unsolicited 3gpp events

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1362
2025-06-16 08:45:50 -05:00
biemster c30052ffc9 iface-modem: disable unsolicited 3GPP events during quick suspend/resume
This introduces the "terse" mode during quick suspend/resume, right now
it is used by 3GPP interface to disable unsolicited events, but in
future it can be used by other interfaces as well.

This prevents device to wake-up from suspend for each unsolicited while
still allowing to wake up on calls or SMS messages.

Signed-off-by: biemster <biemster@gmail.com>
Signed-off-by: Bhushan Shah <bshah@kde.org>
2025-06-16 08:34:57 -05:00
Dan Williams 45d817c50f Merge request !1370 from 'base-manager-shutdown-cleanup'
base-manager: rename manager/device shutdown to manager/device cleanup

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1370
2025-06-16 08:34:33 -05:00
Dan Williams 7029cdba3e base-manager: rename manager/device shutdown to manager/device cleanup
In preparation for a "terse" mode, but also because "shutdown" was
kind of weird since we're not always shutting the modem down; sometimes
we're just putting it in low-power mode.

Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-06-16 08:30:30 -05:00
Dan Williams 04c5c1c31f Merge request !1373 from 'asan-ci'
Fix some leaks and run daemon asan check in CI

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1373
2025-06-14 16:16:16 -05:00
Guido Günther c21191b59a ci: Use dependencies
This allows the build job to start without waiting for
the dco check

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-06-14 16:10:05 -05:00
Guido Günther e97bd6d407 ci: Run daemon tests under ASAN
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-06-14 16:10:05 -05:00
Guido Günther aa9447c833 tests: Allow to run some tests under asan
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-06-14 16:10:05 -05:00
Guido Günther 04229ca146 modem-helpers: Don't leak in tests
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-06-14 16:10:05 -05:00
Guido Günther fc762626ab modem-helpers: Don't leak str when parsing cscb response
We currently overwrite the value without freeing it.

Fixes: d8135be6e ("modem-helpers: Add helpers to parse channel lists")

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-06-14 16:10:05 -05:00
Guido Günther 8553dc3623 modem-helpers: Don't leak strings when parsing DTMF response
`g_ptr_array_new()` creates an array without a free func,
this means we'd leak the strings when the reference count
drops to 0.

Fixes: 56fe8e7d3 ("modem-helpers: add utility function to split DTMF runs")

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-06-14 16:10:05 -05:00
Dan Williams 38417c6520 Merge request !1280 from 'intel-rpc-xmm7360'
intel: XMM7360: unlocking/enabling RPC timeout fix and location support

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1280
2025-06-14 16:09:43 -05:00
Maciej S. Szmigiero 0d29f6dfa5 intel: XMM7360: Allow re-trying the first RPC init command command once
It seems that the very first XMM7360 RPC init command often times out after
resuming the laptop from s2idle for unknown reasons.
This makes the modem unusable in such situation until the next sleep/resume
cycle.

Re-trying this RPC command allows the modem to initialize normally.

It's possible that this is a kernel iosm driver or modem firmware issue
but considering that the kernel driver seems orphaned by Intel and one
can't really expect much firmware support for this modem either let's do
the easiest thing and simply allow retrying (once) the very first RPC init
command if it fails or times out.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
2025-06-14 16:02:23 -05:00
Maciej S. Szmigiero 4c319181e2 shared-xmm: Properly stop GPS if it was running on modem init
With the recent addition of serial port scheduler it often happens that
NMEA traces are mistaken for command responses at init time if GPS was left
enabled in the modem.

For this reason, the proper NMEA packet parser needs to be enabled early
at modem init before the code ensures that GPS is stopped (if it is not
supposed to be running of course).

Since this modem disables GPS asynchronously with processing of the
+XLSRSTOP AT command the full GPS stop machinery has be used to reliably
achieve that GPS engine stop.

It's also important to flush the existing serial port data after attaching
the NMEA packet parser but before issuing that stop AT command, otherwise
command processor for the stop command can also be confused by the existing
queued data.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
2025-06-14 16:02:23 -05:00
Maciej S. Szmigiero adb6dc9b44 port-serial: add flush operation
Add a serial port flush operation which can be used to discard either
serial port data received but not read, or serial port written but not
transmitted, or both types of data.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
2025-06-14 16:02:23 -05:00
Maciej S. Szmigiero 0787d04a39 intel: XMM7360: Better NMEA packets parsing
XMM7360 modem NMEA trace packets are wrapped to look like AT command
responses (with "<CR><LF><CR><LF>OK<CR><LF>" at the end).
This wrapping causes problems if a genuine AT command was just sent and
ModemManager is expecting a similarly formatted response to it.

In such case the NMEA trace packet is taken as the response to the AT
command, which usually causes the command to fail due to response parsing
failure.

Fix this by implementing a custom NMEA trace packets parser for these
modems.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
2025-06-14 16:02:23 -05:00
Maciej S. Szmigiero 6c4b90de79 intel: XMM7360: Print raw serial port data when it is actually sent/dispatched
With serial port interlocking just queuing serial port data does not mean
it will be immediately sent - the other serial port could be still busy.

For debugging serial port issues it is often necessary to see the exact
moment the data was sent or received.

Implement debug_log method for MMPortSerialXmmrpcXmm7360 and log raw serial
port data there (just as MMPortSerialAt does) instead of doing this in the
command queuing function.
The debug_log method is called by MMPortSerial base when the data is about
to be actually sent to the serial port.

Additionally, log command response body where it is actually returned to
higher layers rather than in the unsolicited response handler.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
2025-06-14 16:02:23 -05:00
Maciej S. Szmigiero 912e857831 shared-xmm: keep GPS port open if GPS is enabled
We need to keep GPS port open if would not be kept open otherwise (like
it is the case with a locked/non-enabled modem).

Otherwise:
* While GPS can be enabled in that modem state the traces don't reach MM
API consumers since nothing is servicing the serial port.

* Once modem actually gets enabled the queued GPS output in the modem
serial port floods the main port and often confuses the init sequence.

We also have to make sure that we don't stop GPS during the init sequence
if it is supposed to be running, otherwise there will be the same
issue as commit d3a2aebf16 ("mbm: don't stop GPS interface on
reinitialization if it should be running") fixed for mbm.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
2025-06-14 16:02:23 -05:00
Maciej S. Szmigiero a83a9bf437 intel: XMM7360: Re-enable location interface
Seems to work just fine once the port interlocking is being done
and some other fixes are made in the next commit.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
2025-06-14 16:02:23 -05:00
Maciej S. Szmigiero 5059b812fc intel: XMM7360: RPC and AT port interlocking
We have to avoid sending RPC and AT commands at the same time (even thought
they are sent via different serial ports) since apparently this modems does
not like it.

It also looks like this modem does not like to receive a RPC command soon
after an AT one, since such RPC commands sometimes fail to generate any
response.

Prevent this problem by delaying a RPC command if there was an AT command
completed recently.

The sufficient time gap was determined experimentally, but 300 ms seems to
be enough.

RPC commands are relatively rare so this should not be a performance issue.
Otherwise we often never get any response to RPC calls if AT command
happens to be sent at the same time.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
2025-06-14 16:02:23 -05:00