Commit Graph

2241 Commits

Author SHA1 Message Date
Aleksander Morgado
78cbd44146 meson,tests: fix DBus service lookup in test-plugin-generic 2022-02-16 00:12:32 +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
Ivan Mikhanchuk
789ff2d822 quectel: add Sahara udev tag to EM05 modems 2022-01-26 10:58:24 -08: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
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
853aa29be8 iface-modem-3gpp-profile-manager: support 'apn-type' as index field
The modem may report the 'apn-type' field is the one to be used as
index; if that's the case, allow setting and deleting profiles based
on the given 'apn-type' field.

This change also makes the internal profile management operations use
one index field or another, based on what the protocol implements.
2021-12-26 10:12:11 +01:00
Alexander Yashin
f95fb11b93 ublox: add support to SIM hot swap
Main thing that's required to get modem hot-swapping to work is the
UDCONF=50,1 command(see u-blox AT-command manual). But there are a lot
of u-blox modules which do not support this command. So in this patch,
it's supposed that this thing is configured beforehand(Like the UUSBCONF
functioning mode) for modules, where SIM hot-swaping feature is
possible. For the modems where it's not, the patch will not have any effects.

----

For ublox modems, CIEV: 12(X) messages allow to know if
SIM is (un)plugged. The values are encoded as:
    - 0: no SIM detected
    - 1: SIM detected

It's required from a modem to generate these events about the SIM
detection state.

To set up these `CIEV: 12,(X)` URC events the `+CMER=1,0,0,1,0` command
is used. That command is supported by almost all u-blox modems except
SARA-G300/SARA-G310/LEON-G1(For these models the hot-swap feature will
not work).

As this 12 that is used in CIEV may be completely different in other
modules, the test command parsing is quite important to get that index
number. So, this logic is also added in cind_simind_format_check_ready
function.

----

It seems that it's necessary to issue this `+CMER` set up there despite
that the `+CMER` configuration will take place later in the 3GPP
interface enabling sequence. Because without it simind indications
will not be enabled at all.
CMER configuration may be later overwritten by 3GPP interface enabling
sequence, but in the worst-case scenario only hot-swap feature will not
work.
2021-12-13 13:20:39 +03:00
Alexander Yashin
2de0e89589 plugins: ublox: bearer: SIM absence should not break disconnect
If we have a modem with an established connection, and then the
SIM is getting removed from that modem, this forces modem reprobing
sequence.

It looks like that:
```
 mm-base-modem:mm_base_modem_process_sim_event
 -> mm-base-modem:mm_base_modem_disable
 -> mm-base-modem:disable
 -> mm-broadband-modem:common_disable
 -> mm-broadband-modem:disabling_step,
 -> ctx->step=DISABLING_STEP_FIRST
 -> ctx->step=DISABLING_STEP_WAIT_FOR_FINAL_STATE
 -> ctx->step=DISABLING_STEP_DISCONNECT_BEARERS
```

At this stage, there is no actual connection existing already, but
bearer objects still exist and are still marked as connected.
So, if there were any active bearers - they will be disconnected.

In order to disconnect, ublox bearer sends +CGACT=0,%u, modem then
will return CME ERROR: 10(SIM not inserted):
```
[modem0/ttyACM0/at] --> 'AT+CGACT=0,1<CR>'
[modem0/ttyACM0/at] <-- '<CR><LF>+CME ERROR: 10<CR><LF>'
[modem0/ttyACM0/at] operation failure: 10 (SIM not inserted)
[modem0/bearer0] couldn't disconnect: SIM not inserted
```
this error will break disabling and reprobing. To fix that, it's
require to add 'SIM not inserted' state as a valid condition to
continue bearer disconnection.
2021-12-13 13:20:39 +03:00
Mingjie Zhang
2bad8f5a0d fibocom: update FM101 port type hints to final layout
The port type hints for the FM101 were updated to be in line with the final product layout,
where USB interface #2 is now used as an AT port (not ignored) and USB interface #4 is now
used as debug port. USB interface #6 is removed as it no longer exists.
2021-12-10 19:44:28 +08:00
Aleksander Morgado
e9f254ba3f udev: avoid [0-9]* as shell globbing patterns
The udev rules expect matches based on shell globbing pattern, not
based on regex. This means that "[0-9]*" doesn't mean "zero or more
digits", it actually means "one digit and zero or more other
characters".

So, avoid the regex like match, even if it worked for us, because it
didn't mean what we thought it meant, plus, it breaks our custom udev
rules processing logic, in which we convert the input patterns into
real regex expressions.

See https://bbs.archlinux.org/viewtopic.php?pid=1415916#p1415916

While at it, also make sure that the wildcard matching is done
exclusively for prefix and suffix matches, never in the middle of
a string, or our custom rules parser would not match correctly.
2021-12-01 22:12:06 +01:00
Aleksander Morgado
81302efa66 iface-modem: use external dispatcher to attempt FCC unlock
We remove the built-in FCC unlock procedures from the ModemManager, we
will no longer run them automatically, and instead rely on external
scripts/programs to do that.

Packages providing the external FCC unlock tools can install them in
${pkglibdir}/fcc-unlock.d.

Users manually enabling external FCC unlock tools can install them in
${pkgsysconfdir}/fcc-unlock.d.

The user-enabled path takes precedence over the package-enabled one.
2021-11-17 11:30:01 +01:00
ZhangMingjie
3a880fd832 plugins: add fibocom FM101 to fibocom port types rules file
This patch add fibocom FM101 to 77-mm-fibocom-port-types.rules file.
which contains two sets of vid and pid pairs, "2cb7:01a2" and "2cb7:01a4".
2021-11-10 20:19:47 +08:00
Iñigo Martínez
ec2e5403f1 build,meson: Make feature options boolean
Different options are set as `feature`, also every possible plugin,
but this may cause confusion.

All options set as `feature` but plugins have been made `boolean` to
avoid further confusions.

`help2man` is also installed in the CI image because is required to
build different libraries.
2021-11-08 09:28:55 +00:00
Aleksander Morgado
e8ebd3af7e core: replace 'master' with 'main' 2021-11-04 22:50:00 +01:00
Aleksander Morgado
9f679d4cac core: replace 'dummy' with 'placeholder' 2021-11-04 22:44:20 +01:00
Aleksander Morgado
3444b02932 core: replace 'whitelist' with 'allowlist' and 'blacklist' with 'blocklist'
We keep the 'WHITELIST-ONLY' filter type name still as an option in
--filter-policy=[POLICY], but deprecated and with the better
'ALLOWLIST-ONLY' replacement suggested from now on.
2021-11-04 22:40:28 +01:00
Freedom Liu
039ac40aab foxconn: delete the carrier mapping table of T99W175
For T99W175, Qualcomm realized mcfg switching mechanism
in FW side. It can work indepently without MM's help.
Therefore, delete mcfg switching mechanism in MM.
2021-10-28 08:40:18 +08:00
Daniele Palmas
2b196d897b telit: allow unlock retries loading for unknown error csim reply
When trying to lock the modem LE910S1 replies:

'AT+CSIM=1<CR>'
'<CR><LF>ERROR<CR><LF>'

but the modem actually supports CSIM unlock retries reporting.
2021-10-25 16:51:35 +02:00
Daniele Palmas
1058c1c69d telit: avoid sim hot swap procedure if #QSS is not supported 2021-10-25 16:51:23 +02:00
Daniele Palmas
3a02c3187b telit: add port type hints for LE910S1 0x7010, 0x7011 compositions 2021-10-25 16:50:27 +02:00
Frederic Martinsons
9d82d30978 cli, plugins: factorize usage of iso8601 datetime format
Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>

Includes updates by Aleksander Morgado to fix coding style issues.
2021-10-22 13:48:20 +02:00
Aleksander Morgado
c01f22804e modem-helpers: setup common RSSI to signal quality converter 2021-10-18 00:04:09 +02:00
Daniele Palmas
6c574ce3d6 telit: remove prefix mm_shared in static function names 2021-10-15 15:23:59 +02:00
Daniele Palmas
f8c1e84939 telit: prefer qmi for set_current_bands if available 2021-10-15 15:22:02 +02:00
Daniele Palmas
266043255f telit: prefer qmi for load_current_bands if available 2021-10-15 15:21:57 +02:00
Daniele Palmas
91e16ca282 telit: prefer qmi for load_supported_bands if available 2021-10-15 15:18:14 +02:00
Carlo Lobrano
3522a11578 telit: Detect 4G BND format from BND test reply
Telit modems that require hexadecimal number when specifying 4G bands
also reply to #BND=? command with a 4th parameter <LTE_band_ext>
(e.g. LM940, LM960, LN920, FN980).
On the other hand, modems that require decimal number when specifying 4G
bands only return 3 parameters to the same command.

It is then possible replace the detection of ext_4g_bands via UDEV tags
with an inspection of BND=? reply.
2021-10-15 11:39:33 +00:00
Amol Lad
650cdc5a32 telit: LN920 bands support 2021-10-15 11:39:33 +00:00
Freedom Liu
f5ab3c4678 foxconn: add T99W265 modules, support for QDU. 2021-10-15 14:05:27 +08:00
Aleksander Morgado
c06ca6df3f qcom-soc: require udev tag for ports
Since the 'wwan' subsystem addition to the qcom-soc plugin, the rules
to say a modem is handled by this plugin are too broad, and the plugin
attempts to support any kind of device exposed by the WWAN subsystem,
not just those from Qualcomm SoCs.

Update the plugin to require a new ID_MM_QCOM_SOC udev tag that is set
in the plugin udev rules, given that these rules already check for the
expected SoC drivers (bam-dmux, ipa, qcom-q6v5-mss).
2021-10-14 12:54:21 +00:00
Iñigo Martínez
86fcf2592f build,meson: Add an empty line to split includes and dependencies 2021-10-14 07:57:55 +00:00
Iñigo Martínez
bbc157688d build,meson: Improve plugins option set
Improved the way the plugins are set to allow a smaller summary.
2021-10-14 07:57:55 +00:00
Aleksander Morgado
8852cef817 quectel: fix non-initialized GError
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/442
2021-10-13 22:06:31 +02:00
Daniele Palmas
53f6c309bf telit: add port type hints for LN920 0x1060, 0x1061 compositions 2021-10-11 16:02:40 +00:00
Daniele Palmas
291f583a50 telit: fix typo in load_supported_modes_ready 2021-10-11 16:02:40 +00:00
Daniele Palmas
41482d823b telit: fix segmentation fault in initialize_alternate_3g_band
Fix the following segmentation fault:

ModemManager[128007]: mm_port_peek_kernel_device: assertion 'MM_IS_PORT (self)' failed

Thread 1 "ModemManager" received signal SIGSEGV, Segmentation fault.
0x00005555556c6e3e in mm_kernel_device_get_global_property
(self=0x0, property=0x7ffff5947480 "ID_MM_TELIT_BND_ALTERNATE")
at kerneldevice/mm-kernel-device.c:309

Reported by Carlo Lobrano <c.lobrano@gmail.com>
2021-10-11 16:02:40 +00:00
Daniele Palmas
9c47c54f06 telit: fix g_object_unref failed assertion
Fix the following g_object_unref failed assertion:

ModemManager[385967]: <debug> [1632924639.132023] [modem0/ttyUSB2/at] --> 'AT+CSIM=1<CR>'
ModemManager[385967]: <debug> [1632924639.144892] [modem0/ttyUSB2/at] <-- '<CR><LF>ERROR<CR><LF>'
ModemManager[385967]: <debug> [1632924639.145021] [modem0/ttyUSB2/at] operation failure: 100 (Unknown error)
(ModemManager:385967): GLib-GObject-CRITICAL **: 16:10:39.145: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
2021-09-29 16:13:45 +02:00
Aleksander Morgado
b75d1d50d7 Revert "build,meson: Improve plugins option set"
This reverts commit 09a5052a77.

This commit breaks the default disabling of the qcom-soc plugin.
2021-09-15 22:00:28 +02:00
Aleksander Morgado
101ed56711 meson,build: don't include daemon enum sources in plugins
We will end up exporting what we shouldn't:

  $ abidiff /tmp/autotools/lib/ModemManager/libmm-shared-icera.so /tmp/meson/lib/ModemManager/libmm-shared-icera.so
  Functions changes summary: 0 Removed, 0 Changed (3 filtered out), 8 Added functions
  Variables changes summary: 0 Removed, 0 Changed, 0 Added variable

  8 Added functions:

    [A] 'function const gchar* mm_bearer_connection_status_get_string(MMBearerConnectionStatus)'    {mm_bearer_connection_status_get_string}
    [A] 'function GType mm_bearer_connection_status_get_type()'    {mm_bearer_connection_status_get_type}
    [A] 'function const gchar* mm_bearer_status_get_string(MMBearerStatus)'    {mm_bearer_status_get_string}
    [A] 'function GType mm_bearer_status_get_type()'    {mm_bearer_status_get_type}
    [A] 'function gchar* mm_filter_rule_build_string_from_mask(MMFilterRule)'    {mm_filter_rule_build_string_from_mask}
    [A] 'function GType mm_filter_rule_get_type()'    {mm_filter_rule_get_type}
    [A] 'function gchar* mm_port_probe_flag_build_string_from_mask(MMPortProbeFlag)'    {mm_port_probe_flag_build_string_from_mask}
    [A] 'function GType mm_port_probe_flag_get_type()'    {mm_port_probe_flag_get_type}
2021-09-15 21:59:38 +02:00