Commit Graph

8018 Commits

Author SHA1 Message Date
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
Aleksander Morgado
dc9e28f3a6 cli: new --test-session option to use the session bus 2022-02-16 00:10:49 +01:00
Pablo Barciela
7c713b53a4 libqcdm, errors: fix format specifier for integer 2022-02-15 10:33:55 +01:00
Pablo Barciela
513fbaff61 libqcdm, errors: Fix argument order 2022-02-15 09:42:08 +01:00
Aleksander Morgado
19ecd327dc build,meson: fix 'export_packages' in GIR setup
The 'export_packages' field in the generate_gir() command should
include the name of the pkg-config package being exported, not the
name of the library file.

Without this change, building GIR files depending on the one we
provide here would fail as the corresponding .pc file isn't found.
2022-02-14 15:16:07 +00:00
Pablo Barciela
a5cee46ba9 libqcdm,commands: 'const' instead 'static' in 'char' variable 2022-02-14 12:44:51 +01:00
Pablo Barciela
839af5553f mm-call-audio-format: avoid redundant condition 2022-02-14 10:40:28 +01:00
Dylan Van Assche
b70fd64417 quectel: add name to device IDs
fwupd expects device IDs which are unique for each device and its
variants. However, Quectel re-uses the same USB VID & PID among
different variants such as EG25, EC25, EC20, etc. Moreover, each
variant may have subvariants such as EG25GGB, EG25GGC, EG25AFF,
EG25AFX, etc.

Add the name of the modem to the device IDs to build more unique device
IDs such as USB\VID_2C7C&PID_0125&REV_0001&NAME_EC25GGB.
2022-02-09 11:07:49 +01:00
Dylan Van Assche
90397fa1bb iface-modem-firmware: expose device id builder
Expose the generic device id method as a public API for plugins.
Plugins can call this method first and then add their own device ids on
top in case the generic ones aren't specific enough like in the case of
Quectel modems.
2022-02-08 19:33:56 +01:00
Dylan Van Assche
bdf4d898f6 libmm-glib,firmware-update-settings: setter for method
Allow to set the firmware update method even after
initialization of the MMFirmwareUpdateSettings object.
2022-02-08 19:33:51 +01:00
Aleksander Morgado
967d748f04 sim-mbim: don't crash if SIM IMSI not provided
E.g. if we have an eSIM without profiles.
2022-02-01 10:35:56 +01:00
Aleksander Morgado
5cf15b3f6f broadband-modem-mbim: treat update in eSIM profiles list as a SIM hotplug event 2022-01-31 23:12:46 +01:00
Aleksander Morgado
8ae31be1be broadband-modem-mbim: minor alignment fix 2022-01-31 23:11:11 +01:00
Aleksander Morgado
9c08e54fb9 shared-qmi: filter out modes not currently available
Do not build the mask of "all" modes based only on the supported radio
interfaces, also filter out those modes that would not be available
based on the current capabilities enabled.
2022-01-31 22:48:57 +01:00
Aleksander Morgado
c7ff014e07 modem-helpers-qmi: multimode devices shouldn't always have 4G/5G only modes
In GSM/UMTS+CDMA/EVDO multimode devices, the 4G and 5G mode switching
operations are exclusively limited to the capability selection that
has LTE+5GNR exclusively.

We cannot allow switching to 4G-only, 5G-only or 4G+5G if the current
capabilities have GSM/UMTS or CDMA/EVDO.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/503
2022-01-31 22:48:57 +01:00
Aleksander Morgado
ccf0b7eba2 tests,modem-helpers-qmi: add tests for supported modes loading 2022-01-31 22:48:57 +01:00
Aleksander Morgado
b323a73137 modem-helpers-qmi: new helper to build array of supported modes 2022-01-31 22:48:57 +01:00
Aleksander Morgado
6efde10714 tests,modem-helpers-qmi: add additional tests for supported capabilities loading
Including tests for 5G-only and non-multimode 5G+4G and 5G+4G+3G devices.
2022-01-31 22:48:57 +01:00
Aleksander Morgado
ff51fe637d tests,modem-helpers-qmi: add tests for supported capabilities loading 2022-01-31 22:48:57 +01:00
Aleksander Morgado
d0c87c5877 modem-helpers-qmi: new helper to build array of supported capabilities 2022-01-31 22:48:57 +01:00
Aleksander Morgado
f370c096ec modem-helpers-qmi: refer explicitly to current capabilities in helper method
The helper method for which we have unit tests available refers
exclusively to the current capabilities loading, so rename it to
clarify that.
2022-01-31 22:48:57 +01:00
Aleksander Morgado
683270f403 build: version bump to flag existence of new API (sahara fw update) 2022-01-31 14:21:15 +01:00
Prakash Pabba
2322988855 test-modem-helpers-qmi: add unit test for generic 5g modem 2022-01-30 15:37:05 +00:00
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