Commit Graph

16 Commits

Author SHA1 Message Date
Richard Hughes
a5a978b3f6 Rename some confusing API
More than one person has asked about 'why call fu_plugin_update() for a
reinstall or downgrade' and I didn't have a very good answer.

The plugin API is not officially stable, and we should fix things to be
less confusing. Use the same verbs as the FuDevice vfuncs instead.
2021-08-06 19:49:53 +01:00
Jarvis Jiang
6b79e9201d modem-manager: Add MBIM QDU support for firmware downloading in the MM plugin
Add the mbim-qdu support for firmware downloading, it will be used for T99W175 module of Foxconn.

Signed-off-by: Jarvis Jiang <jarvis.w.jiang@gmail.com>
2021-06-28 10:11:15 +01:00
Richard Hughes
bda57e8c9d modem-manager: Do not convert instance IDs to GUIDs manually
This already happens during setup, there shouldn't be a need to depend
on the private header to accomplish this.
2021-06-15 09:14:39 -05:00
Mario Limonciello
73cdf067ed trivial: fixup includes for a variety of plugins 2021-06-14 10:12:45 +01:00
Aleksander Morgado
3417128704 modem-manager: add generic support for PCI based modems
No longer rely on the modems being USB based, we can also support PCI
based devices with the same protocols.
2021-05-01 15:43:38 +01:00
Mario Limonciello
75835b4a0b Use FWUPD_COMPILATION define to indicate an in tree build
When this is done, include:
* Including the hash
* Including anything that is not ABI stable in plugins yet

Suggested-by: Simon McVittie <smcv@debian.org>
2021-01-22 14:01:25 -06:00
Aleksander Morgado
da2d6f9c5a modem-manager: udev monitoring only if device switches layout
The built-in udev monitoring in the ModemManager plugin is only
required for those upgrade methods where the device switches into a
fully different port/interface layout. So far, we only expect this to
happen when the Fastboot update method is requested by the module.
2020-11-29 07:08:05 +00:00
Aleksander Morgado
b0418d7786 modem-manager: plug udev client leak
The GUdevClient is created when the ModemManager sysfs path is
inhibited; we need to make sure we destroy the object once
uninhibited, or we'll otherwise create a new one if we're running
an additional upgrade operation afterwards.
2020-11-29 07:08:05 +00:00
Richard Hughes
9a68084dbc Always check for PLAIN when doing vercmp() operations
In 1de7cc we checked the version format when checking for update, but there are
many other places that are doing verfmt-insensitive comparisons. For instance,
the predicates in <requires> all fail if the device version format is plain.
his breaks updating some NVMe drives where the `ne` requirements are not
semantic versions.

To avoid trying to catch all the bugs in different places, and in case we have
a future verfmt that should be treated another way, refactor this out in to a
common function and deprecate the old function.
2020-02-20 15:49:27 +00:00
Mario Limonciello
6abe21efbd trivial: stop including fu-hash.h as part of fu-plugin-vfuncs.h
Explicitly include it in all "in-tree" plugins.

If headers are exported out of tree we will likely explicitly not
export this header.
2019-11-25 09:29:46 +00:00
Richard Hughes
9cb3c84712 modem-manager: Fix a tiny memory leak when starting the daemon 2019-10-05 13:03:02 +01:00
Richard Hughes
4b30380e78 Provide a default implementation of common FuDevice actions
This reduces the amount of boilerplate in each plugin.

    32 files changed, 156 insertions(+), 584 deletions(-)
2019-10-04 14:57:32 +01:00
Richard Hughes
dfa9e11bb2 Allow handling FORCE for devices that subclass FuDevice
Pass FwupdInstallFlags down to the vfunc to allow us to check the flags when
parsing the firmware and updating the device.
2019-05-05 15:29:00 -05:00
Aleksander Morgado
ffb8fd5edc modem-manager: implement qmi pdc active config selection as attach()
When we install the MCFG carrier config files with QMI PDC, we were
not explicitly selecting one, and that would end up reporting the
"DF" (default) config is in use. Instead, we should explicitly select
the carrier configuration that we were using before the firmware
upgrade operation.

For example, if the device originally was running with the Vodafone
specific carrier configuration (e.g. T77W968.F1.0.0.3.7.VF.009) and we
trigger the upgrade to the next available firmware associated to
the Vodafone carrier (e.g. T77W968.F1.0.0.3.8.VF.009), we would want
the device to boot with the Vodafone carrier config selected, instead
of booting without any config selected (T77W968.F1.0.0.3.8.DF.009).

This also fixes several upgrade problems detected by fwupd, because it
may end up complaining that the target firmware that was selected to
be installed (e.g. VF variant) is not the one actually reported by the
device after the upgrade (e.g. DF variant).

The selection of which is the config to activate is based on mapping
the mcfg file name with the firmware version reported by the module
before the upgrade. E.g. if the VF variant is reported by the module
(T77W968.F1.0.0.3.7.VF.009), fwupd will look for a MCFG file named
with the "mcfg.VF." prefix.
2019-04-09 07:54:46 -04:00
Aleksander Morgado
fc8093626c modem-manager: implement support for qmi-pdc
If a device reports that qmi-pdc is supported (e.g. DW5821e that
supports both fastboot and qmi-pdc), we'll end up first running the
fastboot installation before doing the qmi-pdc installation procedure.

These changes also make sure that the MM device inhibition is kept for
as long as the whole process is ongoing. Only after the last method is
run, the inhibition will be removed.

In order to handle devices being exposed in the system while the MM
inhibition is in place, e.g. to be able to run qmi-pdc after fastboot,
a simple udev based watcher is included, which will take care of
creating the FuMmDevice that is not associated to any modem currently
exposed by MM, but that shares all the details of the original device.

This new logic assumes that the devices don't change their USB layout
during a firmware upgrade, which is not a very good assumption, but it
works for the case at hand. If this is not the case, we may need to
end up doing some custom AT port probing instead of relying on the
original one reported by MM being still valid (note that we don't rely
on the device name, as that may change if some other device is plugged
in the system while we're doing the update, we rely on the USB
interface number).
2019-02-27 16:09:13 +00:00
Richard Hughes
ffa3b84706 Add a plugin to support ModemManager hardware 2019-02-27 16:09:13 +00:00