Commit Graph
8865 Commits
Author SHA1 Message Date
Maciej S. Szmigiero d3a2aebf16 mbm: don't stop GPS interface on reinitialization if it should be running
Since commit 63dd4ad2 it is possible that the GPS interface is in use at
the time of modem reinitialization so it should not be stopped in such
case.

Otherwise "mmcli --location-status" will still say that GPS is enabled but
no GPS traces are going to be coming.
2024-04-09 15:00:52 +00:00
Aleksander Morgado 19da7559c0 base-manager: start device support check on first port addition
This avoids the "port in device added after device probing has already
finished" warning, and also the creation of modem objects for single
port devices.
2024-04-09 10:25:59 +02:00
Aleksander Morgado 9302fbbccb port-mbim: fix progress state when MBIM device open fails 2024-04-09 07:30:19 +00:00
Aleksander Morgado 3870f774bf base-modem: remove unused has_at_port() method 2024-04-09 07:28:57 +00:00
Aleksander Morgado 661be56920 broadband-bearer: minor coding style fix 2024-04-09 07:28:19 +00:00
Florian Eckert 07526df59b mm-broadband-modem-qmi: always trigger an operator description update
Currently, the operator description update is only triggered once in the
entire update process. But this can lead to a operator description
updated at the wrong time. And is therefore possibly wrong.

The deprecated API call 'qmi_client_nas_get_serving_system' always triggers
an update of the operator description in there subfunction of the callback.

This is missing for the API call 'qmi_client_nas_get_system_info'. To solve
this, an update is now also triggered in the subfunction callback if there
is new system info available.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2024-04-07 01:43:34 +00:00
Florian Eckert b1aaa4c6b9 mm-broadband-modem-qmi: always reload current operator description
When using a modem with the qmi plugin, the operator description is only
set once for the current modem object. This is the operator description
of the mobile network to which the modem has first established a connection.

The operator description will no longer be updated even though on a
reconnection with a different mobile network.

Normally this is not a problem, as the SIM card usually dials into the
home network and stays there. But if an IoT SIM card is used, then this
is a problem because the operator description is no longer updated.

To fix this, the 'current_operator_description' is always loaded on
'modem_3gpp_load_operator_name' regardless of whether an operator
description has ever been set.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2024-04-07 01:43:34 +00:00
Aleksander Morgado 17ab07c05a broadband-modem-option: fix task completion on parent URC setup error 2024-04-04 09:29:45 +00:00
Aleksander Morgado b5ca95e153 broadband-modem-mtk-legacy: fix task completion on parent URC setup error 2024-04-04 09:29:45 +00:00
Aleksander Morgado f1c270a648 broadband-modem-huawei: fix task completion on parent URC setup error 2024-04-04 09:29:45 +00:00
Maciej S. Szmigiero c56e1f4739 iface-modem-location: fix zeroing capabilities on reinitialization
The modem location interface loads modem location capabilities only during
the very first initialization of this interface.

On each later reinitialization it skips loading these capabilities from
modem, however it still goes through the whole interface initialization
state machine.

This state machine uses its own "ctx->capabilities" field for temporary
capabilities storage, which is set to MM_MODEM_LOCATION_SOURCE_NONE at the
start of the initialization process.

However, if we aren't actually loading modem location capabilities because
we're only reinitializing the interface we still need to set this
"ctx->capabilities" field to the existing (previously loaded) modem
location capabilities.

Otherwise the next interface initialization step (validation) will
permanently disable the whole location interface.
2024-04-01 18:40:15 +02:00
Aleksander Morgado 852bf39c4f mtk: add missing initialization of shared fibocom utils
Fixes 4b0b9dde02
2024-04-01 13:57:08 +00:00
Dan Williams 57518950ea README.md: add a short "Getting Started" section for how-to-build
Help out people that may never have used Meson or built ModemManager
before.

Signed-off-by: Dan Williams <dcbw@redhat.com>
2024-04-01 10:14:43 +00:00
Aleksander Morgado 609ff75033 Revert ".gitlab-ci.yml: use meson instead of ninja where possible"
This reverts commit ad6772df34.

The 'compile' command in meson was included in v0.53.0. Let's keep on
recommending the use of ninja to build everywhere.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/844
2024-04-01 10:10:01 +00:00
Aleksander Morgado 3c4fa90c92 shared-quectel: don't assume that parent object supports location
The generic MBIM modem implementation does not have location
capabilities support, so the relevant function pointers in the
interface are NULL.

Fixes: 306566ad7e
2024-04-01 09:07:10 +00:00
Aleksander Morgado f08803e858 broadband-modem: coding style fixes in the 3GPP URC enabling/disabling logic 2024-03-27 12:09:32 +00:00
Aleksander Morgado 4ed45af376 broadband-modem: track primary/secondary ports while enabling/disabling 3GPP URCs
We should not blindly assume that peek_port_primary() always returns a
valid port, because the device may have been ejected while the AT
sequence is running.

Instead, keep a valid port object reference in the operation context,
and use it in all the AT command requests. The requests will fail if
the device has been ejected, but the port object reference will be
valid and the daemon won't crash.
2024-03-27 12:09:32 +00:00
Steve Leung 4ef5ab6db7 huawei: fix udevadm verify warning 2024-03-26 08:46:52 -06:00
Aleksander Morgado 6388b583c7 qmi: GetCellInfo: don't fetch unhandled GError 2024-03-26 10:19:47 +00:00
Oliver Kästner 9ad1ad0d31 qmi: implement GetCellInfo for GSM 2024-03-24 00:56:58 +01:00
Oliver Kästner 71f62ceaea qmi: GetCellInfo: don't fetch unhandled GError 2024-03-23 23:32:55 +01:00
Aleksander Morgado b909922e26 build: unstable release version bump to 1.23.5 2024-03-22 13:45:56 +00:00
Yegor Yefremov af992c2f1a .editorconfig: fix insert_final_newline behaviour
Enable insert_final_newline to comply with the current style.
2024-03-18 12:17:57 +01:00
Samuel Valery ba9901e2be mm-bearer-qmi: Disconnect extended IP config handler
There exists code paths in which the IPv4 and IPv6 WDS extended IP
config indication signal handlers are not disconnected. This results in
a ModemManager crash when an indication signal handler callback is
invoked for a bearer that no longer exists. ModemManager crashes because
the callback function (extended_ip_config_indication_received) tries to
write a log and use the ID of a non-existent bearer.

This patch ensures the extended IP config signal handlers are
disconnected when the bearer connection is reset.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/794
2024-03-14 08:01:14 +10:00
Aleksander Morgado 002179ca7f base-bearer: log user requests 2024-03-13 13:02:23 +00:00
Aleksander Morgado 28e3642767 base-call: log user requests 2024-03-13 13:02:23 +00:00
Aleksander Morgado 8a8591f4dc base-sim: log user requests 2024-03-13 13:02:23 +00:00
Aleksander Morgado f7d22f407d iface-modem-voice: log user requests 2024-03-13 13:02:23 +00:00
Aleksander Morgado a47cec9ba6 iface-modem-time: log user requests 2024-03-13 13:02:23 +00:00
Aleksander Morgado 72f8b6082c iface-modem-signal: log user requests 2024-03-13 13:02:23 +00:00
Aleksander Morgado b51c581d55 iface-modem-location: log user requests 2024-03-13 13:02:23 +00:00
Aleksander Morgado c45a89065b iface-modem-firmware: log user requests 2024-03-13 12:29:28 +00:00
Aleksander Morgado 422f00768d iface-modem-3gpp-ussd: log user requests 2024-03-13 12:27:00 +00:00
bolan wang 532472f686 plugins,fibocom: Add the udev rules for FM135 modules
This patch add fibocom FM135 to 77-mm-fibocom-port-types.rules file. The vid and pid of the module is "2cb7 0115".
2024-03-13 10:56:16 +00:00
Z-张旭 93548c29cc mm-port-probe: ignore the fastboot port of the wwan device during port detection 2024-03-13 04:19:49 +00:00
Aleksander Morgado 306566ad7e quectel: implement shared quectel logic in MBIM modem 2024-03-13 03:57:57 +00:00
Aleksander Morgado 87fb47b9ab quectel: minor code reordering 2024-03-13 03:57:57 +00:00
Aleksander Morgado 8c208f7bcf xmm: ignore +XBIPI URCs 2024-03-13 03:52:35 +00:00
Aleksander Morgado 4b0b9dde02 fibocom: setup common shared setup ports in all modems
Make sure all Fibocom modem implementations use the shared port setup
logic that adds the SIM READY URC ignore rule.
2024-03-13 03:52:35 +00:00
Aleksander Morgado 8512ff4442 fibocom: setup shared fibocom management on AT-only modem
The generic MMBroadbandModemFibocom object uses the shared Fibocom
settings to load the update settings. This logic does not use the
Private info right now, but there is no reason why it wouldn't do it
in the future. Also, for consistency, it makes sense to ensure the
shared interface setup is the same in all implementations, we should
not have only some allowing to initialize the Private info.
2024-03-13 03:52:35 +00:00
Kamesh Relangi 2dac0a9e4f build: fix dependencies in huawei plugin helpers
Compilation errors due to generated files is observed when
compiling in multi threaded environment, as the generated files
getting generated after they have been referred.

Fix: Added dependency in meson so that it will ensure that the
header is generated.

Ref fail log:
../mobile-broadband/ModemManager/src/plugins/huawei/mm-modem-helpers-huawei.c:29:10:
fatal error: mm-huawei-enums-types.h: No such file or directory
   29 | #include "mm-huawei-enums-types.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

Signed-off-by: Kamesh Relangi <quic_krelangi@quicinc.com>
2024-03-12 12:06:42 +00:00
Aleksander Morgado 818bcd40d7 iface-modem-firmware: fix assert if ports have been removed
The logic to build the generic device ids may run by the time we have
already removed the ports in the modem. If so, just cleanly error out
and avoid the assertion.

   0x00007df14bb03a3f (libc.so.6 - pthread_kill.c: 44)     __pthread_kill_implementation
   0x00007df14bab8c6c (libc.so.6 - raise.c: 26)    raise
   0x00007df14baa4462 (libc.so.6 - abort.c: 79)    abort
   0x00007df14c2c8686 (libglib-2.0.so.0 - gtestutils.c: 3450)      g_assertion_message
   0x00007df14c2c86fa (libglib-2.0.so.0 - gtestutils.c: 3476)      g_assertion_message_expr
   0x000059ff23c90c90 (ModemManager - mm-iface-modem-firmware.c: 353)      mm_iface_firmware_build_generic_device_ids
   0x000059ff23ceef7d (ModemManager - mm-shared-fibocom.c: 495)    fibocom_at_port_get_firmware_version_ready
   0x00007df14c158e57 (libgio-2.0.so.0 - gtask.c: 1309)    g_task_return_now
   0x00007df14c158e8a (libgio-2.0.so.0 - gtask.c: 1323)    complete_in_idle_cb
   0x00007df14c2a47a4 (libglib-2.0.so.0 - gmain.c: 3460)   g_main_dispatch
   0x00007df14c2a47a4 (libglib-2.0.so.0 - gmain.c: 4200)   g_main_context_dispatch
   0x00007df14c2a4ac3 (libglib-2.0.so.0 - gmain.c: 4276)   g_main_context_iterate
   0x00007df14c2a4d41 (libglib-2.0.so.0 - gmain.c: 4479)   g_main_loop_run
   0x000059ff23c43741 (ModemManager - main.c: 221) main
   0x00007df14baa46c5 (libc.so.6 - libc_start_call_main.h: 58)     __libc_start_call_main
   0x00007df14baa4781 (libc.so.6 - libc-start.c: 389)      __libc_start_main_impl
   0x000059ff23c430b0 (ModemManager + 0x000b00b0)  _start
   0x00007ffc53d5bd27
2024-03-12 11:54:53 +00:00
Aleksander Morgado bd255849dc base-manager: reprobe device on late port additions
There is no guarantee from the kernel that the ports of a given device
will all be notified via uevents on a timely manner. We assume it, but
we cannot be completely sure.

There are two main scenarios that we have been seen when the ports of a
device are not notified close enough to each other:

 * A modem object is created, but not with the desired control protocol.
   E.g. a QMI or MBIM modem would end up controlled via AT commands if
   the cdc-wdm port was added too late.

 * A modem object is not created at all, and the device object was
   removed completely. E.g. when the net port addition in a QMI or MBIM
   modem happens too late.

In order to avoid those cases, we will now fully reprobe all the ports
of the device from scratch whenever a new valid port addition happens
after the initial probing of the device has already been completed. If a
modem object is available at that time, we will remove it right away.
2024-03-12 10:15:59 +00:00
Aleksander Morgado 07f1f58642 modem-helpers: rework AT string quote operation and add unit tests
Rework the AT string quote operation to build the output with the
GString helper, instead of manually calculating how many bytes we'll
need in the output. It just makes it clearer.
2024-03-12 10:15:59 +00:00
Aleksander Morgado 311d6f389e broadband-modem: fix crash when ports gone while setting up messaging URCs
We cannot assume that the ports may be peeked after the AT sequence
has finished, because they may have been already removed. We can store
a full port reference instead, to ensure the validity of the objects
at that time.

  ==19351== Process terminating with default action of signal 5 (SIGTRAP)
  ==19351==    at 0x4A1DB24: g_logv (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6800.1)
  ==19351==    by 0x4A1DDB2: g_log (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6800.1)
  ==19351==    by 0x28B54E: mm_port_get_device (mm-port.c:62)
  ==19351==    by 0x1B1247: modem_messaging_enable_unsolicited_events_secondary_ready (mm-broadband-modem.c:7373)
  ==19351==    by 0x4BA37D8: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.6800.1)
  ==19351==    by 0x4BA381C: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.6800.1)
  ==19351==    by 0x4A157EE: g_main_context_dispatch (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6800.1)
  ==19351==    by 0x4A68D27: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6800.1)
  ==19351==    by 0x4A14E52: g_main_loop_run (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6800.1)
  ==19351==    by 0x176B91: main (main.c:236)
2024-03-12 10:15:59 +00:00
Aleksander Morgado aec461132c base-modem-at: switch command error handling to g_autoptr 2024-03-12 10:15:59 +00:00
Aleksander Morgado f90778df43 port-probe: switch command error handling to g_autoptr 2024-03-12 10:15:59 +00:00
Aleksander Morgado 7c2aed6d52 device: remove unused get_port_probe_list() method 2024-03-12 10:15:59 +00:00
Aleksander Morgado b99757a1f4 fibocom: don't be strict on required drivers
Requiring an explicit set of drivers should only be done when we have
different plugins supporting different types of devices of the same
manufacturer based on the drivers in use (e.g. as in the Sierra case).

When the plugin includes a list of required drivers, the plugin filter
will only assume the plugin can be used if at least one of the
available ports is exposed with one of the drivers in the list.

Because of this, if we start probing some ports before all the
expected ports are reported, we may end up not selecting a given
plugin just because the driver match should have been done in a
not-yet-notified port.

E.g. on system boot:
 * ttyACM0 is notified.
 * min probing time elapses so ttyACM0 probing starts
 * Fibocom plugin is not selected for ttyACM0 as no matched
   driver ("cdc_acm") is given in the the list of drivers of the
   plugin.
 * cdc-wdm0 and wwan0 drivers are notified.
 * MM creates generic MBIM modem with the Fibocom plugin, but without
   XMM features support, because the ttyACM0 port probing was not done
   by the Fibocom plugin.

And if we reset the modem after that:
 * ttyACM0 is notified.
 * cdc-wdm0 and wwan0 drivers are notified.
 * min probing time elapses so probing starts for all ports
 * Fibocom plugin is selected for all port probings as "cdc_mbim" is
   listed in the list of drivers of the plugin.
 * MM creates XMM-capable MBIM modem with the Fibocom plugin.
2024-03-11 12:36:15 +00:00
Lukas Voegl f8295bd641 cinterion: keep dual-sim order
mm_parse_uint_list() sorts available SIMs and possibly changes the order of the active / non-active SIM.
A custom parser is added, which keeps the order of all SIMs.

Signed-off-by: Lukas Voegl <lvoegl@tdt.de>
2024-03-04 09:11:36 +00:00