Commit Graph

111 Commits

Author SHA1 Message Date
Richard Hughes
4105768a01 Remove the 'common' prefix when parsing version numbers 2022-06-14 14:36:52 -05:00
Richard Hughes
3e0a4dc1c3 Be smarter and include less header files per source file 2022-06-14 14:36:52 -05:00
Richard Hughes
067d7d8088 Split out the path helpers to a new source file 2022-06-14 14:36:52 -05:00
Richard Hughes
7f86ffab6f Split out the dump helpers to a new source file 2022-06-14 14:36:52 -05:00
Richard Hughes
3f77af3cd4 Split out the kernel helpers to a new source file 2022-06-14 14:36:52 -05:00
Richard Hughes
425fedcca1 trivial: Remove fu_byte_array_set_size_full() 2022-06-14 14:36:52 -05:00
Richard Hughes
4b1313b406 Split out the GByte helpers to a new source file 2022-06-14 14:36:52 -05:00
Richard Hughes
9d33c29e92 Split out the string helpers to a new source file 2022-06-14 14:36:52 -05:00
Richard Hughes
e6b487e762 Add FuProgress to ->startup() and ->coldplug()
This allows us to profile the daemon startup so we can find any plugins
taking an inordinate amount of time to start.
2022-06-04 20:21:50 +01:00
Richard Hughes
dc91d59f8e Remove the recently added fu_progress_add_step_full()
Just break API instead.
2022-06-03 13:47:11 -05:00
Richard Hughes
be271f8213 modem-manager: Fix a small leak and critical warning on failed update 2022-05-26 10:50:54 +01:00
Richard Hughes
061b377977 modem-manager: Fix one critical warning when updating 2022-05-26 10:50:54 +01:00
Richard Hughes
d3d7cfa816 Add plugin quirk keys earlier in the startup process
This allows creating the silo when starting the engine with custom
plugin keys such as WacomI2cFlashBaseAddr.

If we move the plugin initialization earlier then we don't get the
HwID matches, so we really do have to split this into a 4-stage startup,
e.g. ->load(), ->init(), ->startup() and ->coldplug().
2022-05-09 11:13:52 +01:00
Richard Hughes
45b1a0bbe3 modem-manager: Remove unused variable 2022-04-23 10:28:16 +01:00
Richard Hughes
035490d39e modem-manager: Remove the cache item and use a shadow device instead
Fixes https://github.com/fwupd/fwupd/issues/4394
2022-04-12 09:59:19 +01:00
Richard Hughes
7f6605cf8d Revert "modem-manager: uninhibit modem after upgrade"
This reverts commit e3b62e643b which
fixes a crash when updating devices.
2022-03-28 20:19:09 +01:00
Richard Hughes
17854099d0 modem-manager: Add signed-payload metadata for some Quectel devices 2022-03-28 08:47:02 +01:00
Richard Hughes
ed247d32b2 modem-manager: Use the correct icon name
The list is specified in https://lvfs.readthedocs.io/en/latest/metainfo.html
2022-03-24 13:05:23 +00:00
Richard Hughes
e8e94b5c63 modem-manager: Quirk a vendor name to be less shouty 2022-03-24 11:12:13 +00:00
Ivan Mikhanchuk
e3907a116e modem-manager: add Quectel EM05 firwmare update support
EM05 switches to the EDL mode over MBIM port, then uses
Sahara to load a firehose binary. The firmware is loaded to
the modem using Firehose protocol.
2022-03-22 14:26:49 +00:00
Ivan Mikhanchuk
6fa82b10bc modem-manager: add Sahara IO functions to Firehose 2022-03-22 14:26:49 +00:00
Ivan Mikhanchuk
27a68de8ee modem-manager: add Sahara protocol 2022-03-22 14:26:49 +00:00
Ivan Mikhanchuk
716a47db8c modem-manager: move firehose related functions to one 2022-03-22 14:26:49 +00:00
Ivan Mikhanchuk
ee71e5ffa9 modem-manager: fix fu_chunk padding in firehose 2022-03-22 14:26:49 +00:00
Ivan Mikhanchuk
387b797c6f modem-manager: add get_mbim_device method for MbimQdu 2022-03-22 14:26:49 +00:00
Richard Hughes
2085a2a1c3 modem-manager: Detect presence of modem-power driver
Quectel EG25-G modem in the Pine64 PinePhone and PinePhone Pro can be
booted with the eg25-manager (user space) or modem-power (kernel space).

We only support the eg25-manager for upgrading these modems.

Based on a patch by Dylan Van Assche <me@dylanvanassche.be>, thanks.
2022-03-02 13:36:19 +00:00
Mario Limonciello
661990ed98 Convert build system to use meson tristate features
tristate features will automatically disable if dependencies marked
as required are missing.

Packagers can manually override using `auto_features`.

Link: https://mesonbuild.com/Build-options.html#features
2022-02-28 08:34:48 -06:00
Richard Hughes
ccc897e574 modem-manager: Copy the AT retry behaviour in ModemManager
Fixes https://github.com/fwupd/fwupd/issues/4319
2022-02-23 07:14:24 +00:00
Richard Hughes
675c5f41a6 modem-manager: Assign the FuUsbDevice to the FuMmDevice
This allows protocol code like Sahara to use GUsb.
2022-02-16 16:07:23 +00:00
Richard Hughes
4b48b2ea27 trivial: Fix a warning in the latest clang release 2022-01-31 14:36:38 +00:00
Dylan Van Assche
b5077745a7 modem-manager: use version format from metadata
Some modems use a plain string as version while others use a
standardized version format. If such a format is provided by
the metadata, set it.
2022-01-30 20:01:52 +00:00
Richard Hughes
0264c29bda modem-manager: Only try to get the branch if there exists an AT port
Fixes https://github.com/fwupd/fwupd/issues/4190
2022-01-19 20:06:25 +00:00
Richard Hughes
4329ddbd76 modem-manager: Fix a segfault on startup for some MBIM-QDU devices
Works around https://github.com/fwupd/fwupd/issues/4190 although we
still need to find the root cause.
2022-01-19 13:46:05 +00:00
Dylan Van Assche
e3b62e643b modem-manager: uninhibit modem after upgrade
When fastboot is used, the modem is rediscovered through udev
after upgrading. However, the modem-manager plugin did not mark
the modem as unhibited with ModemManager. This resulted into
ModemManager not exposing the modem without restarting ModemManager or
rebooting the device.

Mark the modem as uninhibited and do not take ownership over the
plugin data as this caused segfaults.
2022-01-13 20:30:09 +00:00
Richard Hughes
e17a107ce1 trivial: Cast the g_signal_connect() object to allow static analysis
This is useful when using https://gitlab.freedesktop.org/tartan/tartan
2022-01-03 22:46:23 +00:00
Richard Hughes
2e99055d1e trivial: Add some more annotations for language bindings 2022-01-03 22:46:23 +00:00
Dylan Van Assche
9d7e4309a3 modem-manager: add firmware branch AT command for Quectel EG25-G
Alternative firmwares implement AT+GETFWBRANCH to get the current firmware branch
2021-12-29 14:33:02 +00:00
Dylan Van Assche
f0016cf11e modem-manager: add firmware branch support
Some modems such as the Quectel EG25-G have alternative firmwares available.
Read the firmware branch if supported by the firmware and set it,
if not, fall back to the default branch.
2021-12-29 14:33:02 +00:00
Dylan Van Assche
e0f7087bfb modem-manager: log when modem is added
Modem removals are logged, but nothing is logged when a modem is added.
2021-12-26 11:10:13 -06:00
Dylan Van Assche
f6833f96c3 modem-manager: add context for fu_mm_device_udev_new
After upgrading a modem, the FuContext was missing when the modem comes back
2021-12-20 10:02:36 +00:00
Dylan Van Assche
df3b139a0e modem-manager: require AC power
Updating modems is less risky when AC power is present.
2021-12-15 22:07:23 +00:00
Dylan Van Assche
90baeaabbc modem-manager: add Quectel EG25-G no response quirk 2021-12-14 22:46:04 +00:00
Dylan Van Assche
a489191c38 modem-manager: add support for AT fastboot detach commands without response
Normally each AT command is ended with either OK or ERROR,
but that's not the case for the Quectel EG25-G's AT command to enter fastboot.
As soon as AT+QFASTBOOT is sent, the modem switches to fastboot mode without replying OK.
2021-12-14 22:46:04 +00:00
Dylan Van Assche
3eead7aa60 modem-manager: add quirk for Quectel EG25-G
Allow fwupd to detect the switch between modem-manager and fastboot plugins
 as it appears under a different vendor and device ID.
2021-12-14 22:46:04 +00:00
Richard Hughes
e21fb7630a modem-manager: Set the context when the device is constructed 2021-12-13 15:21:43 -06:00
Richard Hughes
8fc8539146 trivial: Remove some unused variables 2021-12-10 16:00:07 +00:00
Richard Hughes
e87fc05ab9 Speed up the daemon startup by ~2% by doing dlsym much less
We were calling g_module_symbol() 2703 times, which is actually more
expensive than you'd think.

It also means the plugins are actually what we tell people they are:
A set of vfuncs that get run. The reality before that they were dlsym'd
functions that get called at pretty random times.
2021-11-09 12:02:07 +00:00
Jarvis Jiang
8d6dbd9009 modem-manager: Add the logic of inhibiting modemmanager device in mbim-qdu
It may make sense to have the modem not doing anything during the upgrade,
so the inhibition would make total sense.

Signed-off-by: Jarvis Jiang <jarvis.w.jiang@gmail.com>
2021-10-25 09:23:44 +01:00
Richard Hughes
1ff96eb4b3 Restore the ABI for fu_device_detach() and provide new symbols
Quite a few plugins are using a FuDeviceLocker to detach then attach in
the error path, and finding them isn't easy as we explicitly cast to a
FuDeviceLockerFunc.

For sanity, just provide both symbols so we can do the right thing in
both cases. It seems like a sensible thing to allow.

Fixes https://github.com/fwupd/fwupd/issues/3771
2021-09-17 16:35:21 +01:00
Richard Hughes
40cd18fa97 Allow using a per-device global percentage completion
It's actually quite hard to build a front-end for fwupd at the moment
as you're never sure when the progress bar is going to zip back to 0%
and start all over again. Some plugins go 0..100% for write, others
go 0..100% for erase, then again for write, then *again* for verify.

By creating a helper object we can easily split up the progress of the
specific task, e.g. write_firmware().

We can encode at the plugin level "the erase takes 50% of the time, the
write takes 40% and the read takes 10%". This means we can have a
progressbar which goes up just once at a consistent speed.
2021-09-13 14:28:15 +01:00