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
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.
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>
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.
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.
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)
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.
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>
Replace all ninja invocations but for the uninstall target with
meson.
meson build command can be omitted when executing test and install
targets that depend on compile target.
Old firmware versions of the FM350 had some internal IP packet filters
installed, which prevented proper IPv6 connectivity in certain cases.
This workaround ensures that the IP packet filters get removed
whenever a data connection is up. Because we don't know when exactly
the filters get installed, we do this removal periodically along with
the bearer stats query.
Old versions of the FM350 firmware were able to support multiplex with
multiple PDNs more or less consistently, except on very specific cases
like Verizon.
The newest firmware versions support multiplex on any carrier, so we
can enable back the feature depending on the firmware version number.
Modems may have certain features only available in new firmware
versions. We should try to load the firmware revision as soon as
possible, even before creating the bearer list, as that informs
already about multiplexing support in the device.
Async SLAAC implementation in the FM350 is only available since
29.23.06, so only wait for the IP configuration indications reporting
the SLAAC result in newer versions.
When IPv6 is requested during a connection attempt, two things may
happen: either the modem itself runs SLAAC, or otherwise the host is
the one that should run SLAAC.
Until now we have assumed that the first IP configuration query that
is run upon finishing a connection attempt always gives us a "final
result", so if the modem did run SLAAC by itself, we would have
expected to see a global IPv6 reported in that first query. And if
there was no global IPv6 reported, then we would have assumed that the
host was the one tasked with running SLAAC.
There is a third option that we now consider, which is the case where
the first IP configuration query does not report a global IPv6, but
the modem is really running SLAAC, and the global IPv6 address will be
reported via a IP configuration indication as soon as SLAAC finishes.
This third option cannot be assumed by default, because it introduces
the possibility of MM waiting for the indication with the SLAAC
results and that indication never arriving in the 10s timeout used as
default. If a modem is supposed to use this third option, the feature
must be explicitly flagged by the modem plugin.
The modem object doesn't process the IP configuration updates reported
by the modem, but the MBIM bearer object may do so if waiting for
async SLAAC updates.
If the user requested to set the modem in low power mode while
enabled, the user is also expecting the device to be implicitly
disabled.
If for any reason setting the modem to low power mode fails (e.g. it
could be not supported by the device), we should still try to run the
modem disabling sequence, as that is the expectation.
If an IoT SIM card is used, the service name is always used as the operator
description. This is not what is expected. Therefore the priority is
changed with this commit, so that the long name is tried to be set first,
then the short name and finally the service name.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
With the current implementation it was not possible to find out which
operator description is now exactly used. By adding a log message, it is
now clear which operator description is now set.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>