Commit Graph

7469 Commits

Author SHA1 Message Date
Aleksander Morgado
a9868638a7 iface-modem-time: ignore cancellation during sync()
There is no input cancellable in the method, so the GTask will never
get cancelled from the outside.
2021-05-26 13:14:52 +00:00
Aleksander Morgado
ac1ff45f44 broadband-modem: skip time interface sync if no time support 2021-05-26 13:14:52 +00:00
Dylan Van Assche
41db2e5e82 iface-modem-time: synchronize state when resuming
On resume, fetch the current network time as
the network time may be changed when suspended.
2021-05-26 13:14:52 +00:00
Aleksander Morgado
e58d525826 broadband-modem: skip synchronization after resume if not needed
The synchronization after resume should only be needed on enabled
modems, as otherwise there is really no chance that the state of the
modem may have changed during suspend.

E.g. if a modem is failed because it doesn't have a SIM card, or if
the SIM-PIN is locked, or if the modem has never been enabled, there
is no point in attempting to synchronize the runtime state of the
modem.
2021-05-26 13:14:52 +00:00
Aleksander Morgado
42bc953749 broadband-modem: ignore cancellation during sync()
There is no input cancellable in the method, so the GTask will never
get cancelled from the outside.
2021-05-26 13:14:52 +00:00
Aleksander Morgado
eaf14b8d79 base-modem: make sync() available only if suspend-resume enabled 2021-05-26 13:14:52 +00:00
Aleksander Morgado
eb5ae16ac4 base-modem: don't fail if sync() isn't implemented 2021-05-26 13:14:52 +00:00
Aleksander Morgado
728e6cd398 base-modem: fix modem_sync() operation handling
The mm_base_modem_sync() method is an asynchronous method that
receives a callback and user data, and therefore we MUST always
complete the async method calling that callback. Set that up with a
GTask as usual.

Also, the mm_base_modem_sync_finish() method should be implemented
along with mm_base_modem_sync(), not in the source file of the
caller of the async method. The finish() always depends on how the
async method was implemented, in our case using a GTask.
2021-05-26 13:14:52 +00:00
Aleksander Morgado
6397aacfdb base-manager: avoid using the mm_ prefix for static private methods 2021-05-26 13:14:52 +00:00
Aleksander Morgado
8f48ba21af base-manager: don't assume a MMDevice always holds a MMModem
There are cases, e.g. during modem object disposal, where this is not
true.
2021-05-26 13:14:52 +00:00
Aleksander Morgado
01223b2d4d base-manager: make sure g_autoptr() variables are initialized to NULL
Otherwise, we may have memory issues if the variable isn't initialized
and the method exits.
2021-05-26 13:14:52 +00:00
Dylan Van Assche
38740e9d11 base-manager: add quick suspend/resume base
Quick suspend/resume infrastructure for
synchronizing the interfaces when resuming.
2021-05-26 13:14:52 +00:00
Aleksander Morgado
940063419a base-manager: ensure all GUdevDevices have subsystem and name set
Under certain rare conditions (e.g. race between querying devices of a
given subsystem and the kernel tearing those devices down), the
subsystem reported for a GUdevDevice seems to be NULL.

So, ensure both subsystem and name are set on the GUdevDevice before we
process them.

The issue has been observed on GUdevDevices listed by
g_udev_client_query_by_subsystem(), not on the ones asynchronously
reported via uevents, but we add the validity check on both places for
consistency.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/343
2021-05-26 12:46:49 +00:00
Aleksander Morgado
10651ba93f quectel: the generic AT based modem supports SIM hot swap 2021-05-26 12:20:00 +00:00
Aleksander Morgado
e4f106f311 broadband-modem-qmi: assume all QMI based modems support SIM hot swap
As we have a generic SIM hot swap implementation in the QMI broadband
modem object.
2021-05-26 12:20:00 +00:00
Aleksander Morgado
58f28c2a45 ci: build with artifacts only in master and tags 2021-05-26 12:30:58 +02:00
Aleksander Morgado
342b0ba648 ci: don't trigger build on branches or pushes
We rely on merge requests to merge new changes, so let's free a bit
the number of pipelines we launch, and avoid doing it on every branch
update.
2021-05-26 12:27:04 +02:00
Aleksander Morgado
3da3623e11 broadband-modem: check if skeleton exists when creating device id
The logic that creates the device identifier uses some fields that are
exposed in DBus (e.g. model, manufacturer...).

We should not attempt to load any of that info if the DBus skeleton
for the Modem interface is no longer available, as e.g. the device may
have gone away already.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/374
2021-05-24 12:52:52 +00:00
Aleksander Morgado
1f10b3ff7f broadband-modem: trivial coding style fix 2021-05-24 12:52:52 +00:00
Dylan Van Assche
4d095ae05b mm-iface-modem: fix typo in step function 2021-05-23 10:00:11 +00:00
Michal Mazur
9695f23faf iface-modem-3gpp: skip initialization in LOCKED state 2021-05-22 23:56:22 +00:00
Michal Mazur
83e7600a67 broadband-modem: allow 3GPP initialization before fallback
To enable call to disable-facility-lock in LOCKED state,
3gpp interface needs to be initialized before going to fallback step.
2021-05-22 23:56:22 +00:00
Michal Mazur
d76c5c9bcd modem-qmi: detect personalization locks in LOCKED state 2021-05-22 23:56:22 +00:00
Michal Mazur
c6b5045105 base-sim: ignore personalization locks after SIM unlock 2021-05-22 23:56:22 +00:00
Aleksander Morgado
db5837d9b4 docs,libmm-glib: add missing reference for DisableFacilityLock() support 2021-05-23 01:22:07 +02:00
Aleksander Morgado
6c66152d1a docs,libmm-glib: add missing non-API methods to Private sections 2021-05-23 01:22:07 +02:00
Aleksander Morgado
6a56c5678c bearer-mbim: network error 0 is actually a valid error (unknown) 2021-05-23 01:22:07 +02:00
Aleksander Morgado
e233d033fc broadband-modem-mbim: detailed connection error on disconnection reports
When we receive an indication reporting a network-initiated
disconnection, convert the MBIM network error into a
MMMobileEquipmentError, and publish it in the new 'ConnectionError'
property.
2021-05-23 01:22:07 +02:00
Aleksander Morgado
59ffa01bb0 bearer-qmi: detailed connection error on disconnection reports
When we receive an indication reporting a network-initiated
disconnection, convert the QMI call end reason into a
MMMobileEquipmentError, and publish it in the new 'ConnectionError'
property.
2021-05-23 01:22:07 +02:00
Aleksander Morgado
32995c8392 base-bearer: never overwrite a connection error that is already set 2021-05-23 01:22:07 +02:00
Aleksander Morgado
ba53b6a64f base-bearer: limit the type of errors we can set as 'ConnectionError' 2021-05-23 01:22:07 +02:00
Aleksander Morgado
a837ef4d81 base-bearer: clear connection error on every new attempt 2021-05-23 01:22:07 +02:00
Aleksander Morgado
43db860c44 base-bearer: report connection error on network initiated disconnections
By default, fallback to "unknown" mobile equipment error when the
modem gets disconnected by the network and we don't have any way to
know a more detailed reason.
2021-05-23 01:22:07 +02:00
Aleksander Morgado
7e8885d569 base-bearer: report connection error on failed connection attempts
When a user-requested connection attempt fails, we not only return the
connection error to the user that requested it, we also publish the
specific connection error in DBus for others to check why the failure
happened.
2021-05-23 01:22:07 +02:00
Aleksander Morgado
de6b1324cb api,bearer: new 'ConnectionError' property
This new property will provide detailed information about the failed
connection attempt, or about the network initiated disconnection. The
property will be cleared only if a new connection attempt is
triggered, and so it can be used to investigate why a given attempt
failed without needing to be the one who triggered the attempt (e.g.
so that failures in NetworkManager-triggered connection attempts can
be investigated looking at the DBus API).

The property is built as a (ss) tuple, but the libmm-glib interface
provides methods to read this property as a GError.
2021-05-23 01:22:07 +02:00
Aleksander Morgado
ff45d292ee libmm-glib: setup common helper to register DBus errors 2021-05-22 22:58:37 +00:00
Aleksander Morgado
34a50edde1 api,errors: document all DBus error name prefixes
Since ModemManager 1.0 we were publishing symbols to identify all the
possible DBus error name prefixes, but these were never documented,
they were explicitly ignored in gtk-doc.

Let's provide proper documentation for them and make them first-class
API symbols.
2021-05-22 22:58:37 +00:00
Aleksander Morgado
6c56ea3b97 docs,api: add index for 1.14
Some of the newly deprecated enum values were introduced in 1.14.
2021-05-22 22:58:37 +00:00
Aleksander Morgado
b9c66e92ea bearer-qmi: rework connection failure error reporting
On a failed QMI modem connection, we won't return the generic
"CallFailed" error, we'll try to convert the 3GPP verbose call end
reason to a MMMobileEquipmentError.

And if we cannot find a mapping, or if the reported error is not a
3GPP verbose call end reason, we'll return a Unknown
MMMobileEquipmentError with a string message providing detailed error
information.
2021-05-22 22:58:37 +00:00
Aleksander Morgado
a878cfa003 modem-helpers-mbim: rework nw error code mapping
Instead of having a switch with a lot of cases, provide a one to one
mapping for the MbimNwError and MMMobileEquipmentError codes in an
array, and make use of the mm_mobile_equipment_error_for_code() helper
to build the actual GError.
2021-05-22 22:58:37 +00:00
Aleksander Morgado
8da8fd0248 api: update MMMobileEquipmentError enum values
Update the list of mobile equipment error codes according to v17.1.0
of 3GPP TS 27.007 (March 2021).

A lot of the enum values that were prefixed with the 'GPRS_' keyword
have now been flagged as deprecated, and a new enum name given to the
corresponding value.

The deprecated symbol names are kept in the compat support to avoid
breaking API/ABI.
2021-05-22 22:58:37 +00:00
Aleksander Morgado
d1bd0a2971 core: improve error helpers
First, simplify the logic that attempts to find the correct error code
associated to an error text string. This logic is very flaky, as it
relies on knowing what the modems report as text string for the
different error codes, and obviously that is not always the same.
Instead of supporting all error codes in this logic, we now limit them
to a small subset with common error codes and hopefully common error
strings.

Second, in order to quickly get the error description string for a
given error code, we rework the array of supported errors so that
the index of the array is the error code itself. For mobile equipment
errors the logic is straightforward, as they're always in the [0,255]
range, but for the message errors we create an array where the index
of the array is equal to the code plus 300 as they're always in the
[300,500] range. By doing this, we avoid having an array with 300 NULL
items before the actual values we want to support.
2021-05-22 22:58:37 +00:00
Aleksander Morgado
9fdbbc6929 foxconn: setup FCC unlock step
Use the new "DMS Foxconn Set FCC authentication" command to request
the modem unlock during a power up operation.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/373
2021-05-23 00:23:17 +02:00
Aleksander Morgado
76f2425617 broadband-modem-mbim: setup FCC unlock step
Use the new generic FCC unlock step instead of implementing it within
the power up setup logic.
2021-05-23 00:23:17 +02:00
Aleksander Morgado
b9596c8187 broadband-modem-qmi: setup FCC unlock step
Use the new generic FCC unlock step instead of implementing it within
the operating mode setup logic.

The operation is implemented in the MMSharedQmi interface as it will
also be used by the MBIM modem object.
2021-05-23 00:23:17 +02:00
Aleksander Morgado
6ca75c76db iface-modem: new optional FCC unlock step in the power state update
There are devices that come locked before they can be put online.
Until now we had a specific implementation for this in the generic QMI
modem, but we should have it in a more generic way for any kind of
modem.
2021-05-23 00:23:17 +02:00
Aleksander Morgado
ec8bf7f0e3 shared-qmi: trivial coding style update 2021-05-23 00:23:17 +02:00
Aleksander Morgado
6ffe84a122 api: QDU update method defined in MM 1.16.6 already
(cherry picked from commit 2cb38c568ff1fb26b23bad5e8a2851547448c30e)
2021-05-22 00:38:47 +02:00
Arnaud Ferraris
d5c16382c5 service: add QIPCRTR address family
With the recently added support for modems using QRTR, ModemManager
needs to have access to the corresponding address family so it can
interact with the modem.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2021-05-21 14:50:07 +02:00
Undef
a381622304 service: Fix Mobile Data on EG25
This allows mobile data to work on the EG25 (and probably other modems).
2021-05-20 11:07:37 +00:00