Commit Graph

56 Commits

Author SHA1 Message Date
Daniele Palmas
654c5f5014 base-modem: add subsystem vendor ID property
Subsystem vendor ID can be used for identifying PCI modems,
so expose the property.
2022-05-24 09:22:06 +02:00
Aleksander Morgado
b497de325a iface-modem: common SIM event reporting logic
We no longer have separate mm_base_modem_process_sim_event() and
mm_broadband_modem_sim_hot_swap_detected() methods. The only
difference between both of them was that one of them would attempt to
cleanup the ports context associated to the SIM hot swap event logic
as soon as a swap was detected, in order to avoid queueing up multiple
such events.

The previous logic wasn't working well, though, as there could be
mixed AT+QMI or AT+MBIM devices that would also require that same
cleanup and so we didn't always know which one should have been
called.

Now we have a single mm_iface_modem_process_sim_event() method, which
will trigger the reprobe and disabling, but which will also perform
the cleanup of the SIM ports swap setup as specified by the
implementation.

So, if a plugin explicitly initializes the serial ports context for
SIM hot swap handling, it should also explicitly clean it up.

Also, the initialization of the serial ports context for SIM hot swap
handling is no longer done automatically for all modems, it will be
done only for those modems using it; i.e. the modems that explicitly
report support SIM hot swap handling using AT URCs.
2022-05-20 09:03:54 +00:00
Aleksander Morgado
c987757a2c broadband-modem-mbim-quectel: SIM hot swap supported by default in MBIM 2022-05-20 09:03:54 +00:00
Aleksander Morgado
61144e2103 iface-modem: remove MM_IFACE_MODEM_SIM_HOT_SWAP_CONFIGURED property
This property is used in the MMIfaceModem to flag whether the SIM hot
swap setup has been performed or not. The flag is now moved to the
iface-specific private context.

The property was also used in AT-based modems, so that implementations
supporting the SIM hot swap via AT URCs could flag the upper layers
whether the enabling of the feature was done correctly or not, and if
so, create and keep the AT ports context open. But this feature only
made sense in AT-based modems, i.e. an MBIM modem that detects SIM hot
swaps via MBIM indications exclusively should not require the AT ports
context open for anything. The check in the MMBroadbandModem object
has therefore been removed, and the logic will be updated so that it
only applies to AT-based modems.
2022-05-20 09:03:54 +00: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
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
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
8852cef817 quectel: fix non-initialized GError
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/442
2021-10-13 22:06:31 +02:00
Aleksander Morgado
3e037dc158 plugins: AT/QCDM/GPS port type hints only applicable to TTY ports
There are modems out there, that reuse the same vid:pid for multiple
USB layouts, so there may be port type hints that are not really
applicable in all layouts.

E.g. the EM7565 in MBIM layout uses interface #0 for the MBIM port,
while in QMI layout it uses interface #0 for the QCDM port (which is
what the port type hint included in MM states). With these rules, if
we don't bind the port type hint to TTY ports only, we would be
wrongly flagging the MBIM port as possible QCDM port:

    <debug> [plugin/sierra] probes required for port cdc-wdm0: 'mbim'
    <debug> [cdc-wdm0/probe] no AT/QMI/MBIM probing in possible QCDM port
    <debug> [cdc-wdm0/probe] port is not AT-capable
    <debug> [cdc-wdm0/probe] port is not QMI-capable
    <debug> [cdc-wdm0/probe] port is not MBIM-capable
    <debug> [cdc-wdm0/probe] port probing finished: no more probings needed

Avoid this, by making sure all port type hints are added exclusively
to TTY ports. It's not a perfect solution, but it's enough for the
known cases.
2021-07-13 10:56:11 +02:00
Ivan Mikhanchuk
83ac824705 quectel: add support for EM120/160 PCIe modules 2021-06-16 00:40:26 -07:00
Dylan Van Assche
c00eff43ac quectel: ignore QLWURC
QLWURCs are not ignored and causes calls to be rejected in some cases
2021-06-01 12:52:05 +02: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
Dylan Van Assche
1beea40270 quectel: set QGPSXTRA to enable assistance support
Quectel modems require to enable XTRA GNSS assistance first with QGPSXTRA=1, before it can be used.
2021-04-20 15:29:29 +00:00
Dylan Van Assche
192e067f97 quectel: ignore QGPSURC
QGPSURCs are not ignored and causes calls to be rejected in some cases
2021-03-21 10:01:52 +00:00
Aleksander Morgado
5d176a1e61 base-modem: explicitly say if NET or TTY data ports are supported
A modem that creates exclusively bearer objects that work with NET
ports (e.g. all QMI or MBIM modems) must not add any TTY port in the
list of data ports.

A modem that creates exclusively bearer objects that work with TTY
ports (e.g. the generic modem) must not add any NET port in the
list of data ports.

A modem that may use both TTY and NET ports should add all in the list
of data ports.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/324
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/329
2021-03-04 18:03:28 +01:00
Aleksander Morgado
950abbf8ee core: stop monitoring the 'usb' subsystem
Back in Linux < 3.6 days, the cdc-wdm ports exposed by the QMI driver
were flagged as owned by the 'usb' subsystem. That changed in 3.6 when
the subsystem was renamed to 'usbmisc':

  https://mail.gnome.org/archives/networkmanager-list/2012-June/msg00125.html

This patch removes all monitoring of the 'usb' subsystem completely,
which is anyway a valid subsystem but for which we shouldn't need any
special handling. Right now, with newer kernels, we were using that
monitoring exclusively to get notified of full USB device remove
events, which is really not required as we already process the port
removals one by one.

We simplify the logic everywhere that attempted to match either the
'usb' or 'usbmisc' subsystems, and we no longer require the explicit
checks for the port name being named 'cdc-wdm[0-9]*' in the code, as
that is already taken care of by the ID_MM_CANDIDATE udev tag rule.
2020-11-13 08:57:06 +00:00
Aleksander Morgado
e4308a529e quectel: setup parent SIM hot swap in addition to +QUSIM
So that e.g. in QMI-based devices we have both things, not just one.
2020-09-28 12:00:08 +02:00
Aleksander Morgado
0880bf3f9a Revert "shared-qmi: implement SIM/profile change detection"
This reverts commit e91f2ef315.

This was wrongly merged squashing multiple commits together. Reverting
to merge separate commits.
2020-09-28 11:57:55 +02:00
Teijo Kinnunen
e91f2ef315 shared-qmi: implement SIM/profile change detection
Implement eUICC change detection for QMI based modems using one of the
following mechanisms (in order of preference):

1. If the modem supports "get slot status" operation, we monitor
   physical slot status indications from the modem for the active
   slot to detect when ICCID changes.
2. Use "refresh register all" to subscribe refresh indications when
   the eUICC triggers REFRESH operation following the enablement of
   a new profile.
3. Use "refresh register" to subscribe refresh indications (file
   path of EF_ICCID is used) in a similar way. This is used with
   older modems that do not support "refresh register all".

If ICCID change is detected, the already existing SIM hot swap
mechanism in MM is triggered.
2020-09-28 09:29:09 +00:00
Aleksander Morgado
ab4160afa6 quectel: minor refactor in the sim hot swap setup logic 2020-09-11 10:16:53 +02:00
Teijo Kinnunen
e52ad1cc88 iface-modem: add an optional iccid parameter to check_for_sim_swap
If the new iccid is already available, reading the iccid from the
card can be skipped.
2020-09-07 15:18:52 +03:00
Aleksander Morgado
49b4e6a6ff quectel: prefer +CTZU=3 to +CTZU=1 if supported
Some quectel modems, like the EC25, require +CTZU=3 in order to have
CCLK? report localtime instead of UTC time.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/233
2020-09-04 08:32:30 +00:00
Aleksander Morgado
e65175234b quectel: new custom +CTZU=? parser
Some quectel devices, like the EC25 have a non-standard additional '3'
mode value:

  0: Disable automatic time zone update via NITZ
  1: Enable automatic time zone update via NITZ
  3: Enable automatic time zone update via NITZ and update LOCAL time to RTC
2020-09-04 08:32:30 +00:00
carlyin
5346d3c55c quectel: add port type hints for the Quectel 5G RM500 2020-08-16 12:24:37 +00:00
root
d9a64c74ff quectel: allow MBIM devices 2020-08-15 16:21:30 +00:00
Aleksander Morgado
23f8b580c3 quectel,shared: implement custom time support check
We require CTZU=3 during the time support check, instead of CTZU=1, so
that the Quectel modem reports localtime instead of UTC time in +CCLK.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/233
2020-06-30 13:12:25 +02:00
Aleksander Morgado
ffca45d9cc quectel,shared: add GPS trace handler 2020-06-29 08:53:00 +00:00
Aleksander Morgado
af8afcc6c9 quectel,shared: only flag GPS source as enabled if it was successful 2020-06-29 08:53:00 +00:00
Aleksander Morgado
60211b51b1 quectel,shared: use QGPS=? test to check capabilities 2020-06-29 08:53:00 +00:00
Aleksander Morgado
58dbb68fa0 quectel,qmi: add QGPS based fallback support 2020-06-29 08:53:00 +00:00
Aleksander Morgado
78d19c10ba quectel,shared: port GPS enabling to use AT sequence 2020-06-29 08:53:00 +00:00
Aleksander Morgado
bbca65d682 quectel,shared: skip QGPS? check after enabling/disabling failures
If any enabling/disabling command fails, we consider the operation
failed, regardless of the QGPS status. This is because e.g. enabling
involves more operations than just QGPS=1, and so we should treat a
failure in the command sequence as a failure in the whole operation.
2020-06-29 08:53:00 +00:00
Aleksander Morgado
538ed3f24e quectel,shared: don't report GPS capabilities if no GPS port found
The QGPS based implementation needs the existence of a port flagged as
GPS data; if there is no such port, we cannot provide GPS support.
2020-06-29 08:53:00 +00:00
Aleksander Morgado
77f6637750 quectel,shared: fix reporting supported location capabilities
The method that reports what location capabilities are supported must
report the capabilities provided by the parent interface plus the
additional capabilities supported by the shared implementation.

Also, simplify the logic a bit reducing the amount of implemented
methods.
2020-06-29 08:53:00 +00:00
Aleksander Morgado
0f9d69fd35 quectel,shared: private context at beginning of source file 2020-06-29 08:53:00 +00:00
Aleksander Morgado
234ba4544b quectel: coding style fixes in the QGPS logic 2020-06-29 08:53:00 +00:00
Aleksander Morgado
5a9d321346 quectel,shared: fix parent location disabling
The GTask must be passed as user_data.
2020-06-29 08:53:00 +00:00
ArenM
df393df147 quectel: implement GPS support with +QGPS
Quectel modems allow provide location information via AT commands.
Add this as a location source.
2020-06-29 08:53:00 +00:00
Brendan Peter
cb8d810583 quectel: add port type hints for EG95 2020-06-16 09:16:28 +02:00
Teijo Kinnunen
d98597e430 quectel: Check SIM swap after "+QUSIM: 1" URC
Quectel emits "+QUSIM: 1" after eUICC reinitialization. Detect it
and perform SIM swap check if one is encountered.

The motivation here is that M2M eUICC profile switch causes eUICC
reset and this is one way to detect and handle profile switches
properly on Quectel modems. The existing SIM hot swap mechanism is
used as it appears to be suitable for handling profile switches as
well as physical swapping of SIM cards.
2020-04-17 07:45:47 +00:00
Aleksander Morgado
8722215f7e plugins: use logging module name as plugin name 2020-04-08 17:53:42 +02:00
Aleksander Morgado
e623a54d27 quectel: port to use object logging 2020-04-08 16:35:09 +02:00
mozzwald
a309b089c9 quectel: add port type hints for EC25/EG25 #194 2020-03-25 12:35:41 -05:00
Sven Schwermer
da729943b1 quectel: Add port type hints for BG96
Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2019-10-30 11:22:19 +01:00
Sven Schwermer
9e63037c5a quectel: Fix port type hints for EG91
Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2019-10-30 11:15:23 +01:00