Commit Graph
7993 Commits
Author SHA1 Message Date
Prakash Pabba 3a1390f1dd test-modem-helpers-qmi: Fix tests for UML290
Change due to update in current capabilities loading logic.
2022-01-30 15:37:05 +00:00
Prakash Pabba 38f067c4e4 mm-shared-qmi,mm-modem-helpers: Fix supported capabilities and modes for multimode device
We use capability switching logic exclusively for configuring GSM/UMTS+CDMA/EVDO devices
(regardless of whether it has LTE/5GNR or not) to add or remove the GSM/UMTS and CDMA/EVDO
capabilities.

Based on the same logic, we will allow 4 combinations for GSM/UMTS+CDMA/EVDO+LTE+5GNR device:
"GSM/UMTS+CDMA/EVDO+LTE+5GNR", "GSM/UMTS+LTE+5GNR", "CDMA/EVDO+LTE+5GNR" and "LTE+5GNR"

Similarly, we will allow 4 combinations for GSM/UMTS+CDMA/EVDO+LTE device:
"GSM/UMTS+CDMA/EVDO+LTE", "GSM/UMTS+LTE", "CDMA/EVDO+LTE" and "LTE"

And, we will allow 3 combinations for GSM/UMTS+CDMA/EVDO device:
"GSM/UMTS+CDMA/EVDO", "GSM/UMTS" and "CDMA/EVDO"

Also, supported combination modes should be based on current capabilities and not entirely
upon supported radio interfaces.

1) If current capability has "gsm-umts" or "cdma-evdo" or both, do not
   support 4G only, 5G only, or 4G+5G combination modes
2) If current capability neither has "gsm-umts" nor "cdma-evdo", only support
   combination modes involving 4G and 5G.
2022-01-30 15:37:05 +00:00
Prakash Pabba f05258e757 mm-modem-helpers-qmi: Fix current capabilities for multimode device
Keep LTE or 5GNR always in current capabilities if supported by device.

Since capability switching logic is exclusively used for configuring
GSM/UMTS+CDMA/EVDO devices, decide if to have GSM/UMTS or CDMA/EVDO or both
or none when loading current capabilities.
2022-01-30 15:37:05 +00:00
Michal Mazur 9843546a49 iface-modem: make update_unlock_retries method static 2022-01-30 13:48:48 +00:00
Michal Mazur 5d4957935b sim-mbim,broadband-modem-mbim: store number of remaining attempts
On MBIM modems the type of PIN cannot be specified in MBIM_CID_PIN query
command and the modem responds only remaining attempts for the currently
active lock.
If PIN1 is unlocked and user tries to disable (or enable) it, MM won't
get an update of remaining attempts in response to PIN Query. This value
is returned only after the Set command and MM need to store it in
all (pin/puk)_set_(enter/enable/change)_ready functions.

Previous solution was to call the mm_iface_modem_update_unlock_retries
directly from these functions but it caused the notification to be send
too early and invalid number was displayed to user sometimes.
Instead of this MM will store numbers of remaining attempts and send
them in a single notification from modem_load_unlock_retries.
2022-01-30 13:48:48 +00:00
Michal Mazur ee87a68532 Revert "mm-sim-mbim: Remove update of remaining attempts"
This reverts commit 46c5cd8b72.
2022-01-30 13:48:48 +00:00
Ivan Mikhanchuk 789ff2d822 quectel: add Sahara udev tag to EM05 modems 2022-01-26 10:58:24 -08:00
Ivan Mikhanchuk dfc2327842 api,enums: add Sahara firmware update method 2022-01-26 10:58:24 -08:00
Nagi Marupaka 73e3da3a10 mm-kernel-device-helpers: fix memory leak
Newly refactored string manipulation function is leaking memory as per
our tests. This submission fixes that memory leak.
2022-01-26 18:27:09 +00:00
Iñigo Martínez 0ab9fc343f build,meson: Fix gdbus code generation
Changes on meson 0.61 makes the build to fail due to empty
annotations in some gdbus code generation[0].

Taking advantage of `kwargs` support, it has been changed to avoid
the issue.

Fixes #499

[0] https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/499
2022-01-26 16:37:57 +01:00
Aleksander Morgado 86496bd326 plugin-manager: longer extra probing time when not using udev
When using udev, we rely on the kernel to timely report port additions
in the same device.

When not using udev, e.g. when using hotplug scripts in openwrt, we
use mmcli --report-kernel-event operations to report the port
additions, which may end up requiring much more time to process,
especially during bootup as we would be reporting a lot of port
addition events one after the other.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/493
2022-01-22 21:03:48 +01:00
Aleksander Morgado 11b7aa46cb broadband-modem-qmi: minor code reordering in profile manager setup/cleanup/enable/disable
The finish() method with the GTask result propagation must be in the
same context as the GTask creation itself, not elsewhere.

Code is reordered so that the async methods can be read from bottom to
top, with the finish() method that includes the GTask result
propagation at the very top.
2022-01-22 10:35:54 +01:00
Florence Chan 6b9709245d mm-broadband-modem-qmi: implement ProfileManager.Updated signal
This uses the PDC Refresh indication to notify clients that
there is a new list of profiles.
2022-01-22 10:31:59 +01:00
Daniele 9bc084c94a telit: add port hints for Telit LE910C1-EUX 2022-01-21 17:52:38 +01:00
Aleksander Morgado 6ec97a29ae foxconn: firmware info loading only if MBIM-QMUX enabled in libqmi
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/477
2022-01-20 13:46:23 +01:00
Aleksander Morgado bb256b0cec quectel: new ID_MM_QUECTEL_FIREHOSE udev tag
To identify which devices support the firehose update protocol.
2022-01-18 11:15:14 +01:00
Ivan Mikhanchuk 22e38199a9 quectel: combine firmware functions in mm-shared-quectel 2022-01-18 10:36:15 +01:00
Aleksander Morgado c9ffa2c9e5 quectel: fix reference cycle
The 'update_settings' object must be referenced before the task is completed.
2022-01-18 10:29:45 +01:00
Aleksander Morgado af0665c573 broadband-modem-mbim: implement support for GetCellInfo() 2022-01-18 09:00:10 +00:00
Aleksander Morgado 3c49e04377 iface-modem: implement support for 'GetCellInfo()' 2022-01-18 09:00:10 +00:00
Aleksander Morgado c4f59aebe0 mmcli,modem: new '--get-cell-info' action 2022-01-18 09:00:10 +00:00
Aleksander Morgado dbeeb98745 libmm-glib,modem: new methods to get list of cell infos 2022-01-18 09:00:10 +00:00
Aleksander Morgado ec7bcc88d3 libmm-glib,cell-info-nr5g: new 'MMCellInfoNr5g' object
Implementing support for 5GNR cell info.
2022-01-18 09:00:10 +00:00
Aleksander Morgado c1fc027f66 libmm-glib,cell-info-lte: new 'MMCellInfoLte' object
Implementing support for LTE cell info.
2022-01-18 09:00:10 +00:00
Aleksander Morgado e682b8a499 libmm-glib,cell-info-tdscdma: new 'MMCellInfoTdscdma' object
Implementing support for TDSCDMA cell info.
2022-01-18 09:00:10 +00:00
Aleksander Morgado b5a5d58650 libmm-glib,cell-info-umts: new 'MMCellInfoUmts' object
Implementing support for UMTS cell info.
2022-01-18 09:00:10 +00:00
Aleksander Morgado 7c7f97807b libmm-glib,cell-info-gsm: new 'MMCellInfoGsm' object
Implementing support for GSM cell info.
2022-01-18 09:00:10 +00:00
Aleksander Morgado 58de2a9904 libmm-glib,cell-info-cdma: new 'MMCellInfoCdma' object
Implementing support for CDMA cell info.
2022-01-18 09:00:10 +00:00
Aleksander Morgado bfb66970f2 libmm-glib,cell-info: new helpers to implement subclasses 2022-01-18 09:00:10 +00:00
Aleksander Morgado 3ca7201444 libmm-glib,cell-info: new 'MMCellInfo' object
Generic base object to implement support for the different types of
cell infos.

Provides support for the 'serving' boolean, which is common to all.
2022-01-18 09:00:10 +00:00
Aleksander Morgado 554faa855c api,modem: new 'GetCellInfo()' method
This new method allows querying the modem for information about the
current serving cell(s) as well as any other neighboring cell that may
be found.

The information for the cells is given in an array of dictionaries,
where each element of the dictionary is a new dictionary itself.

Each cell type has a different set of properties that may be given in
the dictionary, and some of those properties in each type are also
applicable under certain conditions (e.g. only applicable to the cell
if it's a 'serving' cell instead of 'neighboring').

The API documentation explains in detail what is expected in each
case.
2022-01-18 09:00:10 +00:00
Aleksander Morgado 322a601b29 broadband-modem-qmi: if UNSUPPORTED, ignore power update operation
We were returning success on this operation upon an UNSUPPORTED error,
and we should keep on doing the same after all the indication support
changes.
2022-01-14 10:36:39 +01:00
Aleksander Morgado 60f61e9740 broadband-modem-qmi: setup operation context for power up/down/off
We must keep a valid QmiClient reference for as long as the operation
runs, so that we can use it in all the request send operations we do,
and also so that we can remove the indication id upon completing the
operation.

The timeout id and indication id, which are also part of a single
power operation are also included in the operation context, because
they don't have any other meaning out of it.

The operation context is stored as task data.
2022-01-14 10:36:39 +01:00
Aleksander Morgado 1291754e60 broadband-modem-qmi: rework log and error messages 2022-01-14 10:36:39 +01:00
Aleksander Morgado 3216e7a21a broadband-modem-qmi: don't pass full reference to signal handlers
As in the case of the timeouts, we should not pass a full reference as
data to the signal handler as we don't know how many times we'll
receive the signal or if we'll ever receive it.

We already make sure that the signal handler is disconnected when the
operation ends, so we can be sure the self pointer is valid while the
signal handler is connected.
2022-01-14 10:36:39 +01:00
Aleksander Morgado 504d6f51a3 broadband-modem-qmi: reorder code and minor coding style fixes 2022-01-14 10:36:39 +01:00
Aleksander Morgado c3fcb66acf broadband-modem-qmi: don't pass full reference in timeouts
The timeout may not be called if we remove it earlier (e.g. if the
indication is received) and therefore we must not pass a full new
reference, otherwise it may get leaked.

There is no problem with the validity of the self pointer in timeout
callbacks because we're removing the timeout as part of the operation
teardown logic.
2022-01-11 11:33:38 +01:00
Aleksander Morgado fa1e581f13 broadband-modem-qmi: remove paranoid assert
We just created the GTask and we just updated the stored pointer,
checking for it being non-NULL at this point is a bit paranoid
2022-01-11 11:32:36 +01:00
Aleksander Morgado 447243f667 broadband-modem-qmi: avoid capitalizing all words in error message 2022-01-11 11:32:02 +01:00
Prakash Pabba 2d96df774a broadband-modem-qmi: Handle DMS operating mode indications
If Mode online is triggered just after Mode LPM and Mode LPM
processing is not complete in modem, modem will not process the next
request and the device will be stuck in an unwanted modem power
state. Thus, wait for a mode change indication from the modem before
declaring that a power on/off has been successful.
2022-01-11 11:30:19 +01:00
Sven Schwermer 300e1023ef fibocom: Double-check connection after dialing
Fibocom's documentation states that we must double-check the connection
is established when setting up an ECM connection. The possible replies -
according to the documentation - are:

  +GTRNDIS: <state>,<cid>,<ip>,<prim. dns>,<sec. dns>
  OK

or

  +GTRNDIS: 0

We just care about the state value which is 1 if everything worked.
2022-01-11 09:31:32 +00:00
Sven Schwermer 382a7c2425 fibocom: Use ECM bearer if +GTRNDIS is available
Some modems might have a net port but don't support +GTRNDIS which is
used by the ECM bearer. That case will be caught by this additional
check.
2022-01-11 09:31:32 +00:00
Sven Schwermer c174fd29dc fibocom: Add L610 support 2022-01-11 09:31:32 +00:00
Sven Schwermer 2830cb3273 fibocom: Add udev port rules for MA510-GL 2022-01-11 09:31:32 +00:00
Sven Schwermer c21bcb5526 fibocom: Add bearer for ECM-based connections 2022-01-11 09:31:32 +00:00
Sven Schwermer 6ad17fb22e fibocom: Subclass broadband modem
This is required in order to be able to use a custom bearer which in
turn is necessary for establishing ECM connections.
2022-01-11 09:31:32 +00:00
Dylan Van Assche 07d7f596d3 plugins/quectel/mm-shared-quectel: use QGMR to set version
Quectel modems report only their major firmware version through
AT+GMR, use AT+QGMR instead to report the full firmware version.
2022-01-11 08:42:53 +00:00
Dylan Van Assche 3f76b3b7d1 plugins/quectel/mm-broadband-modem-qmi-quectel: ignore carrier revision
Quectel EG25-G QMI modem firmware revisions are not matched with carrier configs.
Different VoLTE profiles might be selected by the user causing
the carrier config revision to change.

Since fwupd uses this string for firmware updates, it gets confused and
thinks the user has an update available.
2022-01-11 08:41:37 +00:00
Aleksander Morgado fb0dfb8751 iface-modem-3gpp: fix variant ref handling in scan output 2022-01-07 21:35:43 +01:00
Aleksander Morgado 4515b00020 libmm-glib,modem-3gpp: fix leak when processing scan results 2022-01-07 21:35:43 +01:00