Commit Graph
8752 Commits
Author SHA1 Message Date
Raphaël Jakse 63dd4ad263 iface-location: allow enabling without SIM
When the modem is in a failed state because of a SIM-related error,
like a missing SIM, or if the modem is SIM-locked, allow the
Location interface to initialize and be enabled anyway.

This allows someone without a SIM to use the GPS, which does not
particularly require a phone subscription. It also allows
someone with a SIM to use the GPS even if the SIM is still
locked.

This patch was reworked, while keeping the original idea, by:
Aleksander Morgado <aleksander@aleksander.es>

Fixes #183
2023-12-11 12:37:42 +00:00
Aleksander Morgado 224c04065d Revert "base-manager: add support to put modem in low power mode during suspend"
This reverts commit 23033217de.

This was mixed up in the wrong branch.
2023-12-01 13:24:17 +00:00
Aleksander Morgado 23033217de base-manager: add support to put modem in low power mode during suspend
Based on an earlier approach from Jack Song and Nero Zhang, see
https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1050
2023-12-01 12:50:51 +00:00
Petr Krasnoshchekov 5056936b46 broadband-modem: set read sms timeout to 120s
A7600E-H prints read sms response very slow. Having a lot of SMS can lead to timeout expiration and errors during next requests
2023-12-01 12:50:51 +00:00
Petr Krasnoshchekov 59b82a2f97 simtech: add port type hints for A7600E-H, A7602E-H 2023-12-01 12:50:51 +00:00
Petr Krasnoshchekov d40d156081 simtech: ignore +CPIN: READY URC on startup
A7600E-H sends +CPIN: URC on startup.
The URC can be treated by ModemManager as a response to other command, what leads to errors during ModemManager initialization
2023-12-01 12:50:50 +00:00
Petr Krasnoshchekov a7ff7281af simtech: ignore PB DONE, SMS DONE, +NITZ: URCs 2023-12-01 12:49:45 +00:00
Petr Krasnoshchekov c871b1a514 simtech: implement reset for A7600E-H/A7602E-H 2023-12-01 12:49:45 +00:00
Petr Krasnoshchekov 7c4908184b base-sim: increase operator identifier loading timeout
SIMCOM A760xE-H modems can answer to AT+CRSM=176,28589,0,0,4 request in 10s or more, so use rather big timeout (20s)
2023-12-01 12:49:45 +00:00
Petr Krasnoshchekov 277d785735 modem-helpers: improve CGDCONT read response parsing
SIM A7600E-H sends only 3 parameters in CGDCONT read response (+CGDCONT: 1,"IP","nate.sktelecom.com").
The parsing regex requeres 4 parameters, so the response is not matched.
In addition fourth parameter is not used by parsing code.
2023-12-01 12:49:45 +00:00
Aleksander Morgado d6d9be125e broadband-modem-mbim: plug leak when facility pin query fails 2023-12-01 10:14:45 +00:00
Aleksander Morgado 5fb2856645 iface-modem: allow cancellability during unlock required checks
The process doing the unlock required checks may need a lot of retries
e.g. to decide whether a SIM card is available or not. If we do a
quick SIM eject, so the unlock required check starts looping, and then
insert the SIM again, we expect the loop to be cancelled right away,
so that the new modem object can be reprobed without any interference
from the old modem object.

We now take the modem-wide cancellable and bind it to the GTask in
mm_iface_modem_update_lock_info(), and we pass it down to every
sub-step of the async logic in the operation. We also plug the
cancellable to the delayed retries in the interface logic, to allow
aborting the checks right away
2023-12-01 10:14:45 +00:00
Michal Mazur dc4b1ec0f3 broadband-modem-mbim: fix detection of SIM hot swap
Previous patch for hotswap detection caused the modem to be reprobed
after unlocking or changing PIN for SIM card lock (commit 7b878765c6).
This change allows to differentiate between hotswap and PIN lock events.
2023-11-30 13:36:48 +00:00
Aleksander Morgado 3ccf847284 bearer-mbim: warn and workaround wrong link prefix length in static IPv6 config
Seems to happen with e.g. the Fibocom FM350:

  # mmcli -b 2
    ------------------------------------
    IPv6 configuration |         method: static
                       |        address: 2607:fb90:dd16:d38a:ac39:89f1:67a7:5a9d
                       |         prefix: 128
                       |        gateway: 2607:fb90:dd16:d38a:ac39:89f1:67a7:5a01
                       |            dns: fd00:976a::9, fd00:976a::10
                       |            mtu: 1436
2023-11-28 14:01:24 +00:00
Aleksander Morgado e35655b364 bearer-mbim: remove unused property name 2023-11-16 11:58:31 +00:00
Aleksander Morgado c6466b72ca broadband-modem-mbim: signal notification id is a gulong 2023-11-16 11:58:24 +00:00
Michal Mazur 19fd9c634b broadband-modem-mbim: skip modem reprobe when unlocking SIM card
Removed code was introduced as a part of carrier lock support but it
affects also unlocking SIM card locks which is incorrect.
(carrier lock support commit: e3a1206c57)
2023-11-08 13:27:12 +00:00
Thilo-Alexander Ginkel 738152176d fcc-unlock: add support for Lenovo-shipped FM350-GL FCC unlock 2023-11-07 14:37:24 +00:00
Aleksander Morgado 11a1720daf mtk: add FM350 specific MBIM implementation
Including logic to set low power mode during an EPS initial bearer
settings update.
2023-11-06 15:11:38 +00:00
Aleksander Morgado ddb2888d32 mtk: add MTK specific MBIM implementation
Basically to flag that we don't support QMI explicitly, so that it's
not even attempted.
2023-11-06 15:11:38 +00:00
Aleksander Morgado c814f3590a mtk: flag FM350 as not supporting multiplexing
There is no released firmware version with proper support for
multiplexing yet.
2023-11-06 15:11:38 +00:00
Aleksander Morgado 6457c644b5 mtk-legacy: rename label in udev rules 2023-11-06 13:02:22 +00:00
Aleksander Morgado 48e661579c build: remove multiline description from meson option 2023-10-31 14:12:12 +00:00
Aleksander Morgado c3597636ec build: fix single-plugin build for mtk 2023-10-31 14:11:20 +00:00
Aleksander Morgado 29f8154ef7 build: unstable release version bump to 1.23.1 2023-10-31 13:51:30 +00:00
Aleksander Morgado 48d9708e14 mtk: remove support for the udev rules tester
There are no udev rules in the new mtk plugin for now.
2023-10-30 10:06:37 +00:00
Aleksander Morgado a4a5c972e8 mtk-legacy: rename port type hints rules file
These rules apply to modems managed by the mtk-legacy plugin.
2023-10-30 10:05:17 +00:00
ming-pei.hsu eb776be926 mtk: add mtk plugin which support mbim interface
Add MTK plugin for mtk_t7xx platform which support MBIM interface.
2023-10-30 10:03:53 +00:00
Aleksander Morgado 226586d46b broadband-modem-mbim: fix crash with missing ICCID
Output fields like ICCID or IMSI are optional in MBIM Subscriber Ready
Status v3 operations. We should not assume they are set to a valid
value when the operation succeeds.

   2023-10-27T10:24:16.512461Z <inf> [modem0] started checking for basic SIM details...
   2023-10-27T10:24:16.516104Z <err> mm_3gpp_parse_iccid: assertion 'raw_iccid != NULL' failed
2023-10-27 12:45:42 +00:00
Madhav 2b0c7505fb mm-port-probe: Invoke the mm_port_qmi_open function with a GCancellable object
Ensure that the cdc-wdm port probing task is canceled if the
modem drops off the bus before the task completes.
This prevents the task from preventing other port probing tasks from starting.
2023-10-27 09:46:13 +00:00
Madhav ad462f68bd NEWS: Use inclusive terms
Remove non-inclusive terms.
2023-10-27 09:41:17 +00:00
Aleksander Morgado 10b8ee4cb9 modem-helpers-qmi: avoid "ip-version-mismatch" error if possible
Based on the WDS client being connected, we'll convert this error into
"IPv4 only allowed" or "IPv6 only allowed".
2023-10-27 11:34:26 +02:00
Aleksander Morgado d0f97a4c62 modem-helpers-qmi: translate QMI internal verbose call reason into MM errors
Just a few key translations for now.
2023-10-27 11:34:26 +02:00
Aleksander Morgado 1f9a04268f core: ensure all errors returned in DBus operations are normalized
We want to ensure that all errors reported via DBus operations are
normalized to MM-specific errors.

We don't want to return QMI or MBIM specific errors, as those are
protocol specific and we don't want DBus clients to need to rely on
knowing which is the protocol in use by the device.
2023-10-27 11:34:26 +02:00
Aleksander Morgado 9569b99f41 base-bearer: normalize connection error exposed in DBus
The connection error exposed in the DBus interface should be an error
defined in the ModemManager API, and therefore it should be normalized
before being exposed.

This was already being done by limiting the exposure to MM specific
errors, but now we also try to normalize QMI or MBIM errors into MM
specific ones.
2023-10-27 07:33:44 +00:00
Aleksander Morgado 2de0763ac8 api,errors: new MMCarrierLockError type
This new error type will be used to report errors in the carrier lock
operations performed through ModemManager.

They have a one to one mapping to the MBIM status specific errors.
2023-10-27 07:33:44 +00:00
Aleksander Morgado bfb0658909 modem-helpers-qmi: register QMI error translations
We register translations for QMI core and QMI protocol errors. These
translations are a best-effort, and they are not meant to be
exhaustive.

The original error description is included in the translated GError,
so that the details of the issue are not lost.
2023-10-26 12:35:50 +00:00
Aleksander Morgado b54de958ce modem-helpers-qmi: group error translation methods together 2023-10-26 12:35:50 +00:00
Aleksander Morgado a307380113 modem-helpers-qmi: minor method rename 2023-10-26 12:35:50 +00:00
Aleksander Morgado cbb825a236 modem-helpers-mbim: register MBIM error translations
We register translations for MBIM core, MBIM protocol and MBIM status
errors. These translations are a best-effort, and they are not meant
to be exhaustive.

The original error description is included in the translated GError,
so that the details of the issue are not lost.
2023-10-26 12:35:50 +00:00
Aleksander Morgado 08a954a88b modem-helpers-mbim: move error translation method
Moved to the end of the file, we'll add all new error translations
together.
2023-10-26 12:35:50 +00:00
Aleksander Morgado 5e088fb3bb modem-helpers-mbim: minor method rename 2023-10-26 12:35:50 +00:00
Aleksander Morgado 81d2655950 error-helpers: allow registering error mappings
E.g. from QMI/MBIM errors into MM errors.
2023-10-26 12:35:50 +00:00
Aleksander Morgado 59aae421a1 core,error-helpers: new method to normalize GErrors
The ModemManager API should not expose or return error types out of
the error domains it supports.

Default to a generic core error "Failed", while keeping the original
error description.
2023-10-26 12:35:50 +00:00
Aleksander Morgado e0bcf0a3c4 api,errors: add generic MM_CORE_ERROR_THROTTLED error
Will be used to report operations that are not run as they have been
attempted too many times already.

Modems will usually report this kind of error e.g. when attempting to
connect with the same invalid APN too many times. The modem at some
point decides that it won't attempt the APN connection with the
network any more, so it returns this error to the caller right away.
2023-10-26 12:35:43 +00:00
Aleksander Morgado 8115b651de api,errors: add generic MM_CORE_ERROR_PROTOCOL error
Will be used to report control protocol failures detected in the
communication with the device (e.g. malformed QMI or MBIM messages,
and so on).
2023-10-26 10:56:31 +00:00
Aleksander Morgado 575cdb7411 api,errors: add generic MM_CORE_ERROR_TIMEOUT error
Will be used to report operation timeout errors.
2023-10-26 10:56:30 +00:00
Aleksander Morgado f730238a92 core,error-helpers: fix formatting in ME error strings 2023-10-25 12:44:14 +00:00
Madhav 48ee4d3012 mm-port-probe: Invoke the mm_port_mbim_open function with a GCancellable object
After the modem recovers, the ports are up but not yet responsive. When MM tries to probe the ports, they do not respond.
As a result, the probing tasks are left ongoing, waiting for a response from the modem.

If the modem drops off the bus for any reason, the cdc-wdm port probing task is not immediately canceled.
This patch fixes this issue by passing a cancellable object to mm_port_mbim_open().

In other words, the patch ensures that the cdc-wdm port probing task is canceled if the
modem drops off the bus before the task completes. This prevents the task from preventing
other port probing tasks from starting.
2023-10-19 19:59:48 +00:00
Aleksander Morgado 74904b3cb1 quectel: coding style fixes 2023-10-18 21:29:06 +00:00