Commit Graph
100 Commits
Author SHA1 Message Date
Aleksander Morgado b3f315ad2d core,log: new 'MSG' log level between 'INFO' and 'WARN'
We're bumping the current "INFO" level messages to the new "MSG"
level, also making the new level the default.

The old "INFO" level will be used to setup an intermediate level of
logging which is not as verbose as "DEBUG" but still provides some
capabilities to analyze the behavior of a modem.
2022-11-04 13:12:56 +00:00
Aleksander Morgado 011f9b366b foxconn: carrier mapping conf file shouldn't be executable 2022-09-15 09:30:33 +02:00
Aleksander Morgado 726442b576 fibocom: source files shouldn't be executable 2022-09-15 09:30:02 +02:00
Aleksander Morgado 4a62ea3e84 broadband-modem-mbim: SIM slots ptr array should have GDestroyNotify
The SIM slots ptr array should have a proper GDestroyNotify, so that
whenever the array is unref-ed as part of the modem disposal logic,
the SIM objects (and the modem object references they keep) are also
unref-ed.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/571
2022-08-04 17:58:55 +02:00
Aleksander Morgado 3893396e20 broadband-modem: SIM swap check should consider errors loading as no SIM
A failure loading IMSI or ICCID (unless for the UNSUPPORTED case)
could be an indication that there is no SIM.

Ideally, the logic checking if a SIM swap happened should have checked
first if there is a SIM card in the slot, and only if there is one go
on to try to load IMSI or ICCID.
2022-08-04 13:08:55 +00:00
Aleksander Morgado a32538fa32 helpers-mbim: report correct network availability from mbim bitmask
MbimProviderState is a bitset, so don't try to match exact values in a
switch statement when converting to MMModem3gppNetworkAvailability.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/524
2022-07-25 20:43:07 +00:00
Aleksander Morgado 041f53af8b base-sms: don't clear parts on send/store error
The part generation logic is independent to whether the SMS send or
store operation failed, so just avoid doing the parts cleanup. E.g.
if we created the parts for store() but storing failed, the same parts
could still be used for send() successfully.
2022-07-24 13:14:26 +00:00
Aleksander Morgado 4aaea37022 base-sms: fix segfault when storing already sent messages
The internal list of parts in the base SMS object is created either
when the message is sent or when the message is stored.

The daemon should not expect the list of SMS parts to be empty upon a
store() operation requested via DBus, as the list of parts may have
already been created during send().

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/598
2022-07-24 13:14:26 +00:00
Aleksander Morgado 115692dd91 api,tags: fix typo in ID_MM_PORT_TYPE_AT_GPS_CONTROL doc 2022-07-16 22:22:11 +02:00
Aleksander Morgado 36d3a2c4f5 docs: add missing reference to ID_MM_PORT_TYPE_AT_GPS_CONTROL 2022-07-16 22:21:22 +02:00
Aleksander Morgado f5151fb02e po: update after source file rename 2022-07-16 22:13:04 +02:00
Aleksander Morgado 1f2bea9184 port-mbim: monitor consecutive timeouts 2022-06-30 11:15:04 +02:00
Aleksander Morgado 7a3cbfec64 port-qmi: monitor consecutive timeouts 2022-06-30 11:15:04 +02:00
Aleksander Morgado b91823012a base-modem: setup timeout monitoring in all control ports
If any of the control ports ends up timing out 10 consecutive times,
the modem will be flagged as invalid and it will be reprobed from
scratch.

This allows us to detect modems that end up irresponsive in QMI or
MBIM while they're still exposed in e.g. the USB bus.
2022-06-30 11:15:04 +02:00
Aleksander Morgado 8387629a8c port: make 'timed-out' a signal for all port types, not just serial 2022-06-30 01:08:15 +02:00
Aleksander Morgado db33a43b45 build,meson: require libqmi 1.31.7, in sync with autotools
The required libqmi version was updated in configure.ac to 1.31.7 in
commit ac06052b97, but we forgot to do
the same in the meson setup.
2022-06-24 12:25:51 +02:00
Aleksander Morgado 9fa1b32e34 cli: don't print signal quality unless modem is enabled
We don't have a clear way to report "unknown" signal quality, so for
now just skip printing it altogether in the mmcli human output if the
modem is not yet enabled.
2022-05-25 11:15:29 +02:00
Aleksander Morgado 63d02f9da2 iface-modem: allow state updates without bearer list
E.g. if we reach the failed state before the bearer list is created.
2022-05-25 11:15:27 +02:00
Aleksander Morgado 9c773fcad4 iface-modem: report failed modems with unknown capabilities
Instead of not creating a modem object, create it in failed state with
the "unknown capabilities" failed state reason.
2022-05-25 11:15:06 +02:00
Aleksander Morgado e90a7410b4 iface-modem: minor coding style fix 2022-05-25 11:15:05 +02:00
Aleksander Morgado 234f185c3a iface-modem: fail initialization if eSIM without profiles
A modem using an eSIM without profiles should not be allowed to get
enabled, it should be really treated as a modem without a physical
SIM.
2022-05-25 11:14:45 +02:00
Aleksander Morgado 0123030136 iface-modem: skip setting up carrier config on esim without profiles 2022-05-25 11:14:40 +02:00
Aleksander Morgado fe91a3044d iface-modem: load current modes and current bands even without SIM
These are current settings in the modem, they don't really depend on
whether there is a SIM or not.
2022-05-25 11:14:39 +02:00
Aleksander Morgado 061f9a275a iface-modem: move helper method out of the initialization logic 2022-05-25 11:14:38 +02:00
Aleksander Morgado a535b2fddc base-sim: skip loading SIM identifier in eSIM without profiles 2022-05-25 11:14:37 +02:00
Aleksander Morgado 38f631e00e broadband-modem: rework checking for SIM swap
Avoid calling the MMBaseSim class method directly, and use the helper
mm_base_sim_load_sim_identifier() instead.

Also, rework a bit the logic to have a single completion method once
we know the current ICCID.
2022-05-25 11:14:35 +02:00
Aleksander Morgado 638841281e base-sim: disallow SIM user operations in eSIM without profiles 2022-05-25 11:14:34 +02:00
Aleksander Morgado 38a69011bd base-sim: skip loading SIM properties based on SIM type
If the reported eSIM doesn't have profiles, there is no point in
trying to load properties like ICCID, IMSI or operator name/id.

If the reported SIM is a physical SIM, there is no point in trying
to load properties like EID or eSIM status.
2022-05-25 11:14:03 +02:00
Aleksander Morgado 073404313e broadband-modem-mbim: improve logging of found SIM slots 2022-05-25 10:59:17 +02:00
Aleksander Morgado f593421d8d iface-modem: minor coding style fix 2022-05-25 10:59:17 +02:00
Aleksander Morgado 1b30d10ad1 base-sim: don't reload properties that may have been already initialized
If we created the SIM objects during the SIM slots processing, we
should not attempt to reload the settings that were already set during
the re-initialization, as that may end up clearing the initial
properties.
2022-05-25 10:59:17 +02:00
Aleksander Morgado ac3f9be3d3 base-sim: remove bogus comments in initialization
All properties loaded during initialization are meant to be loaded
only once, no point in saying that for each property.
2022-05-25 10:59:17 +02:00
Aleksander Morgado eee6e46d4e broadband-modem-mbim: assume no lock is required in eSIM without profiles 2022-05-25 10:59:17 +02:00
Aleksander Morgado 1ad5526972 bearer-mbim: plug user cancellable to all MBIM operations 2022-05-24 08:44:22 +00:00
Aleksander Morgado 0cfe498354 bearer-mbim: if connection attempt fails, trigger an explicit disconnection
E.g. if the error reported by the MbimDevice is a timeout error, it
means the connection attempt is still ongoing in the device, we need
to ask it to stop.
2022-05-24 08:44:22 +00:00
Aleksander Morgado 8679396d99 bearer-mbim: use common helper to build disconnection message 2022-05-24 08:44:22 +00:00
Aleksander Morgado 4140758fdf base-modem: if ABORTED during initialization, modem not exported
Commit b497de325 introduced a change by which some common errors (e.g.
SIM missing) would be reported as MM_CORE_ERROR_ABORTED.

This had the undesired effect of making the MMBaseModem object not
flag as valid the modem, because the returned error wasn't
MM_CORE_ERROR_WRONG_STATE.

We now change this logic so that only ABORTED makes the modem object
not flagged as valid, and we'll do that only if the Modem interface
isn't exposed in DBus.

Fixes b497de325
2022-05-20 15:36:43 +02:00
Aleksander Morgado 82b574a6e7 broadband-modem-mbim: ignore SIM swap events during a slot switch action
When we explicitly request to perform a SIM slot switch operation, we
should ignore the 'slot info status' and 'subscriber ready status'
indications that report an active SIM slot change, or otherwise they'll
end up interfering with the correct reporting of the slot switch
operation.

We could have attempted to complete the slot switch operation early
using the indications, but that solution would have forced us to
assume that theinfo in the indications is the one we had requested,
which is not easy because the 'slot info status' indication is
reported once for each slot, so a single SIM slot switch operation
triggers multiple 'slot info status' indications, as well as
additional 'subscriber ready status' indications reporting the same.

Fixes suggested by Pavan Holla <pholla@chromium.org> and tested by
Jinjian Song <Jinjian.Song@fibocom.com>.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/550
2022-05-20 09:03:54 +00:00
Aleksander Morgado b497de325a iface-modem: common SIM event reporting logic
We no longer have separate mm_base_modem_process_sim_event() and
mm_broadband_modem_sim_hot_swap_detected() methods. The only
difference between both of them was that one of them would attempt to
cleanup the ports context associated to the SIM hot swap event logic
as soon as a swap was detected, in order to avoid queueing up multiple
such events.

The previous logic wasn't working well, though, as there could be
mixed AT+QMI or AT+MBIM devices that would also require that same
cleanup and so we didn't always know which one should have been
called.

Now we have a single mm_iface_modem_process_sim_event() method, which
will trigger the reprobe and disabling, but which will also perform
the cleanup of the SIM ports swap setup as specified by the
implementation.

So, if a plugin explicitly initializes the serial ports context for
SIM hot swap handling, it should also explicitly clean it up.

Also, the initialization of the serial ports context for SIM hot swap
handling is no longer done automatically for all modems, it will be
done only for those modems using it; i.e. the modems that explicitly
report support SIM hot swap handling using AT URCs.
2022-05-20 09:03:54 +00:00
Aleksander Morgado c987757a2c broadband-modem-mbim-quectel: SIM hot swap supported by default in MBIM 2022-05-20 09:03:54 +00:00
Aleksander Morgado 61144e2103 iface-modem: remove MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED property
This property is used in the MMIfaceModem to flag whether the SIM hot
swap setup has been performed or not. The flag is now moved to the
iface-specific private context.

The property was also used in AT-based modems, so that implementations
supporting the SIM hot swap via AT URCs could flag the upper layers
whether the enabling of the feature was done correctly or not, and if
so, create and keep the AT ports context open. But this feature only
made sense in AT-based modems, i.e. an MBIM modem that detects SIM hot
swaps via MBIM indications exclusively should not require the AT ports
context open for anything. The check in the MMBroadbandModem object
has therefore been removed, and the logic will be updated so that it
only applies to AT-based modems.
2022-05-20 09:03:54 +00:00
Aleksander Morgado 86eabf4316 iface-modem: initialization restart support moved to iface-specific private context 2022-05-20 09:03:54 +00:00
Aleksander Morgado 0080ed612d iface-modem: rework signal check logic to use the iface-specific private context
The signal and access tech loading operation was using a context that
contained both overall state and state specific to the current
attempt.

The overall modem state is now moved to the iface-specific private
context, and the state specific to the operation is kept in a GTask
that is bound to the ongoing loading operation.
2022-05-20 09:03:54 +00:00
Aleksander Morgado 95da87046c iface-modem: move recent signal quality handling to iface-specific private context 2022-05-20 09:03:54 +00:00
Aleksander Morgado 9fde6f9162 iface-modem: move state update context to iface-specific private context
Avoid keeping separate per-operation contexts, it doesn't make
sense. Just have one single Private context for the whole interface
where we can add support for all operations performed by the
interface.
2022-05-20 09:03:54 +00:00
Aleksander Morgado c059f16871 broadband-modem-mbim: don't disable subscriber info if used by SIM hotswap
The SIM hot swap operation relies on multiple different types of
indications, but the most important one is the subscriber info
indication. We should make sure that indication is kept enabled for as
long as the SIM hot swap detection should be active.

We also skip using the MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED
property, which should be removed or made MMBroadbandModem-specific,
as it is only really used in the AT-based SIM hot swap detection
logic.
2022-05-20 09:03:54 +00:00
Aleksander Morgado fd0a5d42a9 broadband-modem-mbim: reset enable flags if enabling them failed
This is not extremely important, because we don't really flag as
disabled those indications that failed to be enabled (as usually we
attempt to enable them in a group, not one by one), but in this case
this will allow us to keep a clean state after a failed SIM hot swap
setup.
2022-05-20 09:03:54 +00:00
Aleksander Morgado c659492022 xmm: wait for +XLSRSTOP URC before starting next session
It is important to gracefully stop the session before starting the
next session, making sure the engine is completely stopped. This can
be ensured by waiting for the +XLSRSTOP URC just after having received
the +XLSRSTOP command response.

We'll do an explicit wait for that URC with a 10s timeout, in order to
avoid waiting forever if the URC is never received. It will be assumed
that the engine is off if the 10s timeout happens, in the same way as
we were doing until now.

During the wait time for the URC, the operation task ownership is
shared among the response processor, the URC handler and the timeout
source. Once any of them decides to complete the task, the others will
automatically avoid attempting to complete the same task.

Based on a patch originally developed by:
Som_SP <somashekhar.puttagangaiah@intel.com>
2022-05-19 11:45:37 +00:00
Aleksander Morgado 7de4d6673b broadband-modem-mbim: plug memleak when MBIMEx v2 not supported
==11025== 40 bytes in 1 blocks are definitely lost in loss record 3,313 of 5,483
  ==11025==    at 0x483E7C5: malloc (vg_replace_malloc.c:380)
  ==11025==    by 0x4A32CA9: g_malloc (in /usr/lib/libglib-2.0.so.0.7000.2)
  ==11025==    by 0x4A4A082: g_slice_alloc (in /usr/lib/libglib-2.0.so.0.7000.2)
  ==11025==    by 0x49F8574: g_array_sized_new (in /usr/lib/libglib-2.0.so.0.7000.2)
  ==11025==    by 0x24DEB1: load_supported_modes_mbim (mm-broadband-modem-mbim.c:958)
  ==11025==    by 0x24E2D5: modem_load_supported_modes (mm-broadband-modem-mbim.c:1042)
  ==11025==    by 0x1D4DC5: interface_initialization_step (mm-iface-modem.c:5718)
  ==11025==    by 0x1D26D6: load_device_identifier_ready (mm-iface-modem.c:4903)
  ==11025==    by 0x4BACB83: ??? (in /usr/lib/libgio-2.0.so.0.7000.2)
  ==11025==    by 0x4BACBB8: ??? (in /usr/lib/libgio-2.0.so.0.7000.2)
  ==11025==    by 0x4A2A434: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.7000.2)
  ==11025==    by 0x4A7E7B8: ??? (in /usr/lib/libglib-2.0.so.0.7000.2)
2022-05-19 13:30:32 +02:00
Aleksander Morgado 5fbe7c0c82 broadband-modem-mbim: fix additional double GError free
We're returning the GError as GTask result, we should not explicitly
free it ourselves.

Same as the previous fix, should solve the crash sometimes seen in
https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/550
2022-05-13 11:54:06 +02:00
Aleksander Morgado b4d0fc4adf broadband-modem-mbim: fix double GError free
We're returning the GError as GTask result, we should not explicitly
free it ourselves.

Fixes the crash sometimes seen in
https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/550

  ==15994== Invalid free() / delete / delete[] / realloc()
  ==15994==    at 0x484B27F: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
  ==15994==    by 0x4F9A8A0: g_error_free (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7102.0)
  ==15994==    by 0x2251CC: ??? (in /usr/sbin/ModemManager)
  ==15994==    by 0x4DD2B48: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.7102.0)
  ==15994==    by 0x4DD2D4A: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.7102.0)
  ==15994==    by 0x4CA9049: ??? (in /usr/lib/x86_64-linux-gnu/libmbim-glib.so.4.6.0)
  ==15994==    by 0x4CB0367: ??? (in /usr/lib/x86_64-linux-gnu/libmbim-glib.so.4.6.0)
  ==15994==    by 0x4FAF287: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7102.0)
  ==15994==    by 0x4FAEC03: g_main_context_dispatch (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7102.0)
  ==15994==    by 0x5003497: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7102.0)
  ==15994==    by 0x4FAE282: g_main_loop_run (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7102.0)
  ==15994==    by 0x16916F: main (in /usr/sbin/ModemManager)
  ==15994==  Address 0x80db490 is 0 bytes inside a block of size 16 free'd
  ==15994==    at 0x484B27F: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
  ==15994==    by 0x4F9A8A0: g_error_free (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7102.0)
  ==15994==    by 0x1984FA: ??? (in /usr/sbin/ModemManager)
  ==15994==    by 0x4DD2B48: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.7102.0)
  ==15994==    by 0x4DD2D4A: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.7102.0)
  ==15994==    by 0x2251A6: ??? (in /usr/sbin/ModemManager)
  ==15994==    by 0x4DD2B48: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.7102.0)
  ==15994==    by 0x4DD2D4A: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.7102.0)
  ==15994==    by 0x4CA9049: ??? (in /usr/lib/x86_64-linux-gnu/libmbim-glib.so.4.6.0)
  ==15994==    by 0x4CB0367: ??? (in /usr/lib/x86_64-linux-gnu/libmbim-glib.so.4.6.0)
  ==15994==    by 0x4FAF287: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7102.0)
  ==15994==    by 0x4FAEC03: g_main_context_dispatch (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7102.0)
  ==15994==  Block was alloc'd at
  ==15994==    at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
  ==15994==    by 0x4FB76F8: g_malloc (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7102.0)
  ==15994==    by 0x4FCF1A4: g_slice_alloc (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7102.0)
  ==15994==    by 0x4FCF80D: g_slice_alloc0 (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7102.0)
  ==15994==    by 0x4F9A3A6: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7102.0)
  ==15994==    by 0x4F9A5A3: g_error_copy (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7102.0)
  ==15994==    by 0x4CA903E: ??? (in /usr/lib/x86_64-linux-gnu/libmbim-glib.so.4.6.0)
  ==15994==    by 0x4CB0367: ??? (in /usr/lib/x86_64-linux-gnu/libmbim-glib.so.4.6.0)
  ==15994==    by 0x4FAF287: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7102.0)
  ==15994==    by 0x4FAEC03: g_main_context_dispatch (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7102.0)
  ==15994==    by 0x5003497: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7102.0)
  ==15994==    by 0x4FAE282: g_main_loop_run (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7102.0)
2022-05-13 10:50:39 +02:00
Aleksander Morgado e163ab504a broadband-modem-mbim: fix task completion when peeking device fails
We cannot call peek_device() when we have already created a GTask for
the async operation, because if the operation failed we would be
completing the async operation with a totally different GTask than the
one we had created ourselves, triggering memory leaks and leaving
modem references around that should not exist (as the GTask we create
holds a modem reference).

Issue found in the context of debugging this, may actually be fully
related:

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/550
2022-05-11 12:13:34 +00:00
Aleksander Morgado acd5f466d7 broadband-modem-mbim: minor coding style changes 2022-05-11 12:13:34 +00:00
Aleksander Morgado 5a050f8604 bearer-qmi: fix QmiWdRequestedSettings->QmiWdsRequestedSettings typo 2022-04-27 12:20:34 +02:00
Aleksander Morgado 9735437061 bearer-qmi: use the new QmiWdRequestedSettings enum type
And bump libqmi to 1.31.5, which is the version introducing the rename.
2022-04-27 11:53:13 +02:00
Aleksander Morgado 4207ee61b7 huawei: disable +CPOL based features in Huawei E226
Issue and bugfix suggestion by Alex Leopoldo Villacís Lasso.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/552
2022-04-15 15:23:53 +02:00
Aleksander Morgado 7960b365d5 data: add example connection dispatcher
Just a minimal example that prints the events in syslog
2022-04-05 08:14:53 +00:00
Aleksander Morgado 99232154b3 build: rename directory where fcc unlocks are kept 2022-04-05 08:14:53 +00:00
Aleksander Morgado 2dafb32d63 base-bearer: integrate connection status dispatcher scripts 2022-04-05 08:14:53 +00:00
Aleksander Morgado e8612671ef dispatcher-connection: new dispatcher for connection status scripts
The user or the packages can install custom dispatcher scripts that
will be run by the ModemManaer daemon itself upon bearer connection
status updates.

Scripts installed by users should go into the
/etc/ModemManager/connection.d directory.

Scripts installed by packages should go into the
/usr/lib/ModemManager/connection.d directory.

The name of the script will specify the order how it's run, so it's
suggested to name them with a numeric prefix, e.g. "99-something".
2022-04-05 08:14:53 +00:00
Aleksander Morgado e188a77ede dispatcher-fcc-unlock: inherit from the base dispatcher object 2022-04-05 08:14:53 +00:00
Aleksander Morgado 01c8edf68c dispatcher: new generic object to handle script dispatchers
Based on the FCC unlock specific one, but without any FCC unlock
specific constraint.
2022-04-05 08:14:53 +00:00
Aleksander Morgado 19f389949c port-serial: ensure the port object is valid after BUFFER_FULL handling
The BUFFER_FULL signal handler is effectively working in the same way
as the response buffer processor, in both cases we may have scheduled
the completion of the serial command, and that in turn may end up
fully disposing the port object. We must make sure the port object is
valid for as long as we need it in this function, so we take a
reference while processing the response buffer.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/535
2022-04-04 10:13:06 +02:00
Aleksander Morgado d5805002c1 core: remove "all rights reserved" from copyright lines
The rights each contributor has are the ones stated by the GPL/LGPL,
not more and not less.
2022-03-29 16:36:15 +02:00
Aleksander Morgado ea247f7e69 foxconn: consolidate checks for T99W175 and T99W265
These two devices require QDU and MCFG+APPS version string
comparison. We now have a single place where we check for this
requirements.
2022-03-28 08:06:10 +00:00
Aleksander Morgado cd2dd20b08 foxconn: consolidate logic deciding required update methods 2022-03-28 08:06:10 +00:00
Aleksander Morgado b16b49f9d5 foxconn: consolidate logic deciding requested firmware version type
We don't want to have in two different places the vid:pid match list
when selecting the type of firmware version we ask for.
2022-03-28 08:06:10 +00:00
Aleksander Morgado 4efb5f61cf foxconn: switch to use autoptr() in firmware info loading 2022-03-28 08:06:10 +00:00
Aleksander Morgado b81680a3fd foxconn: remove unneeded input bundle unref 2022-03-28 08:06:10 +00:00
Aleksander Morgado 8d0d90a6dd build: require libqmi 1.31.4 for FOX service support 2022-03-28 08:06:10 +00:00
Aleksander Morgado 1fdc3ac703 linktop: new port type hints
Flag ttyACM0 as data port and ttyACM1 as primary port, as per
https://bugzilla.gnome.org/show_bug.cgi?id=637140#c10

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/14
2022-03-26 15:51:11 +01:00
Aleksander Morgado 8ab31cf0e6 broadband-modem-mbim: consolidate initialized SIM creation method
The logic to create a new SIM object from the slot status info was
used in several places.
2022-03-22 21:53:08 +00:00
Aleksander Morgado 598d99b5bd test,modem-helpers: add test for the EM9191 COPS=? response
Including 5GNR network reporting (act=12)

https://forum.sierrawireless.com/t/5g-network-scan-with-the-em9191-operation-not-allowed/26374/9
2022-03-16 11:04:06 +00:00
Aleksander Morgado 2c8cfb4768 modem-helpers: improve and fix COPS=? numeric fields parsing
The numeric fields in the +COPS=? response were relying on a very weak
parsing logic, assuming that they were single-digit numeric values and
not using the common string to integer conversion utilities.

This commit improves the conversion from the 3GPP/ETSI defined network
availability and access technology values to the MM defined ones,
providing enum-based matches even if the numeric values are the same.

The commit also fixes the parsing of access technology values > 10,
required to report 5G related values.
2022-03-16 11:04:06 +00:00
Aleksander Morgado 5ba67aff82 modem-helpers: act given in COPS=? may have more than one digit
The new 5GNR related values are >= 10, so don't expect one single
digit (\d), expect one or more (\d+).
2022-03-16 11:04:06 +00:00
Aleksander Morgado c74a377f98 fibocom: new shared interface for common logic
The set_initial_eps_bearer_settings() operation is the same in XMM
capable and generic MBIM modem objects. Place it in a common shared
interface so that we don't duplicate code.
2022-03-09 22:05:32 +00:00
Aleksander Morgado f7656de128 broadband-bearer: remove unused cid_selection_3gpp() method
It was replaced by the profile management operations instead in the
1.18 release.
2022-03-08 21:16:06 +01:00
Aleksander Morgado 84e22e9b98 intel: custom setup for all available AT ports
Fully disable send delay as we're using AT ports via the new WWAN subsystem.
2022-03-07 09:51:43 +00:00
Aleksander Morgado 671164a64f xmm: setup single GPS control port exclusively
Use the same logic always to decide which is the best GPS control/data
port, and then perform the initial port setup (GNSS engine off) only
that single port.
2022-03-07 09:51:43 +00:00
Aleksander Morgado f3e885e067 xmm: prefer port flagged as AT_GPS_CONTROL to manage the GNSS engine
Use the new AT_GPS_CONTROL udev tag to decide which is the best port
to manage the GNSS engine.
2022-03-07 09:51:43 +00:00
Aleksander Morgado 343f27a5e7 api: allow tagging AT ports as GPS control
There are devices with multiple AT ports where only one of them is
supposed to be used for GNSS control (and data).
2022-03-07 09:51:43 +00:00
Aleksander Morgado deaf0646c4 intel: inherit GNSS location support from the shared XMM interface
We're not going to implement all XMM shared operations from the shared
utils, as the newer Intel modems support the new operations in the
Microsoft MBIM Extensions.

Just inherit the GNSS management capabilities.
2022-03-07 09:51:43 +00:00
Aleksander Morgado c3c4cdde7a intel: periodic signal checks disabled by default
As we can rely on async MBIM notifications.
2022-03-07 09:51:43 +00:00
Aleksander Morgado 5d6b9c56cc intel: SIM hot swap supported by default 2022-03-07 09:51:43 +00:00
Aleksander Morgado 2da9ee5bd1 intel: avoid attempting QMI over MBIM in non-Qualcomm device 2022-03-07 09:51:43 +00:00
Aleksander Morgado 4a895b2820 intel: disable data over TTY by default
Only data over NET is expected
2022-03-07 09:51:43 +00:00
Aleksander Morgado 17dca109dd broadband-modem-qmi: avoid the deprecated QmiMessageDmsGetStoredImageInfoInput type 2022-02-28 21:54:24 +01:00
Aleksander Morgado 18aa526f8c shared-qmi: use the new QmiSlotEidElement type
This type was introduced to avoid having GArrays of GArrays in libqmi.
2022-02-28 21:54:24 +01:00
Aleksander Morgado a21b7740d8 shared-qmi: avoid the deprecated QmiConfigTypeAndId type
This type was a JSON description bug in libqmi, it should have never
been a struct by itself. This was changed in libqmi by the 1.31.3
snapshot, so let's use the new methods instead of the deprecated ones.
2022-02-28 21:54:24 +01:00
Aleksander Morgado cfbbbdfbaa build: require libqmi 1.31.3
In order to use the new methods that avoid intermediate structs like
QmiConfigTypeAndId.
2022-02-28 21:54:24 +01:00
Aleksander Morgado 27f6679aa8 charsets: set error if UTF-8 validation fails
Otherwise, mm_modem_charset_bytearray_to_utf8() may return NULL
without error set, and that will trigger a crash in the caller.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/511
2022-02-17 09:59:24 +01:00
Aleksander Morgado 6aec0a6c80 sim-mbim: report error if decoding EID from APDU response fails
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/510
2022-02-16 21:48:19 +01:00
Aleksander Morgado 97c50e53af fibocom: detect ID_MM_FIBOCOM_INITIAL_EPS_OFF_ON on runtime
We won't create a full new different modem object based on whether the
ID_MM_FIBOCOM_INITIAL_EPS_OFF_ON tag is found or not. Instead, we
always will create the same object type, and detect whether the OFF/ON
cycle is required during runtime.
2022-02-16 13:04:45 +00:00
Aleksander Morgado 499cdf79dc fibocom: initial EPS settings update always available in parent
Assume that the method to change the initial EPS bearer settings is
always implemented in the parent, so that we can avoid the runtime
check.

This also fixes the codepath that would happen if the
iface_modem_3gpp_parent->set_initial_eps_bearer_settings == NULL
condition was valid, as that would end up with a GTask never completed.
2022-02-16 13:04:45 +00:00
Aleksander Morgado 45102fcd60 iface-modem-signal: polling and thresholds only in effect if modem enabled
If the modem is disabled:
 * Polling is completely halted.
 * Thresholds are disabled.
 * The user is allowed to call Setup() or SetupThresholds() to change
   the settings, even if the actual polling or thresholds setup isn't
   in effect.

When the modem is enabled:
 * Polling will be started if there is a existing polling rate.
 * Thresholds will be setup based on the existing threshold settings.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/504
2022-02-16 11:28:03 +00:00
Aleksander Morgado 5d953bbe8d ci: enable gtk-doc in meson build 2022-02-16 00:30:20 +01:00
Aleksander Morgado 9d4f3fff7e ci: enable tests in meson build 2022-02-16 00:29:17 +01:00
Aleksander Morgado d2bc98a1eb tools,tests: make test-wrapper.sh.in template executable
So that when the meson build does the template replacement, the
generated file is also executable and can be used as Exec line in the
test DBus service file.

Fixes the 'test-stub' unit test in meson.
2022-02-16 00:27:51 +01:00
Aleksander Morgado 78cbd44146 meson,tests: fix DBus service lookup in test-plugin-generic 2022-02-16 00:12:32 +01:00
Aleksander Morgado a7e579cd7b meson,data: generate test service file
The test service file is used in the test-plugin-generic unit tests,
which require the ModemManager daemon to be launched in a private test
DBus session.
2022-02-16 00:11:35 +01:00