Commit Graph

124 Commits

Author SHA1 Message Date
Richard Hughes
b7f5fc9a21 trivial: Add device priority to the to_string() output 2020-04-14 17:11:20 +01:00
Richard Hughes
b92f056bcc trivial: Add device order to the to_string() output 2020-04-14 17:11:20 +01:00
Richard Hughes
cf0a7678b8 Allow removing device flags from quirk files
This also means we do the right thing when plugins call fu_device_add_flag()
directly, instead of just from a quirk file.

For instance, now `Flags = ~updatable` is a valid and useful thing to have and
allows us to remove the `Flags = None` hack.
2020-04-13 23:18:19 +01:00
Richard Hughes
6affeb84fc Revert "Only set the parent ID when adopting children"
This reverts commit b4f14e8f0f.
2020-04-09 16:55:17 +01:00
Richard Hughes
de65a9140c trivial: Show what firmware we're installing onto the device 2020-04-07 18:43:31 +01:00
Richard Hughes
0bc65b5e97 Export the device state as part of the D-Bus interface 2020-04-07 15:04:01 +01:00
Richard Hughes
b4f14e8f0f Only set the parent ID when adopting children
We use the ParentGuid quirk key to logically 'tie-together' different discrete
devices into one logical device, for instance making the USB soundcard in a hub
the child of the USB controller on the same PCB.

Setting the discrete child is sometimes correct, for instance when rebooting
the hub, the audio device also goes away -- but it's also sometimes wrong.
If we set the child for a discrete device and the parent does *not* go away
then we get to a situation where the child reference may no longer be valid
if it comes back as a different object.
When we try to remove this no-longer-valid device with the removal timeout the
daemon segfaults. This is realy bad.

Continue to allow using fu_device_add_child() in plugins, where we know the
child lifecycle is is matched by the the parent. In the engine just set the
parent ID directly and let the client use this information to show the tree of
logical devices correctly. There's no benefit to setting up the children as
referenced objects anyway.
2020-04-01 10:38:50 +01:00
Richard Hughes
00e43fe50e trivial: Allow using NULL as func for fu_device_add_possible_plugin()
This should be used when a device recovery is not possible.
2020-03-28 12:46:03 +00:00
Richard Hughes
89a5ed01ef trivial: Add fu_device_retry_set_delay() to set a generic device delay 2020-03-28 12:46:03 +00:00
Richard Hughes
348719f759 Add fu_device_retry() helper functionality
Sometimes plugins need to retry various commands send to hardware, either due
to unreliable transfers (e.g. using USB bulk) or from slightly quirky hardware.

Between them they seem to get various things wrong; either the error messages
are repeated and thus difficult to parse, or they just get the memory handling
of `g_propagate_prefixed_error()` wrong.

Providing sane helpers we can reduce the amount of boilerplate. Additionally
we can support a 'reset' function that can try to automatically recover the
hardware for specific error domains and codes.
2020-03-27 15:47:08 +00:00
Richard Hughes
754d85e282 ccgx: Set the update message when running in backup firmware 2020-03-24 21:16:08 +00:00
Richard Hughes
4f0e344a0a Ensure that the DeviceID is set for child devices
If we do not ->open() the device (e.g. because it uses a parent device to proxy
writes) then the child never gets a DeviceID which causes all kinds of issues.
2020-03-10 17:09:13 +00:00
Richard Hughes
51b4a1666e Add fu_device_get_root() shared API
This gets the 'topmost parent' for a composite device, as devices such as hubs
may have more logical layers than just one.
2020-03-10 17:09:13 +00:00
Mario Limonciello
96117d19df trivial: 1.3.9->1.4.0
We decided to branch at 1.3.8 and backport fix only things for 1_3_X.
So bump all the new stuff to 1.4.0 (which will be next release)
2020-02-28 10:17:56 -06:00
Richard Hughes
f50ff2c27e Decouple the version format from the version itself
If we say that the version format should be the same for the `version_lowest`
and the `version_bootloader` then it does not always make sense to set it at
the same time.

Moving the `version_format` to a standalone first-class property also means it
can be typically be set in the custom device `_init()` function, which means we
don't need to worry about *changing* ther version format as set by the USB and
UDev superclass helpers.
2020-02-25 14:00:09 +00:00
Richard Hughes
7ba76b0b01 trivial: Correctly set up the weak ref when using a GObject 'parent' property
This fixes a critical warning when adding MSP devices.
2020-02-11 12:59:27 +00:00
Richard Hughes
4eb7cec24b trivial: Fix memory leak if fu_device_set_parent() is called multiple times 2020-02-11 12:58:37 +00:00
Richard Hughes
21eaeeff8d trivial: Fix up some typos found using codespell 2020-01-14 12:25:41 +00:00
Richard Hughes
af14073522 Allow applying all releases to get to a target version
Some hardware does not handle upgrading from version 1.2.2 to 1.2.4 and instead
needs to be upgraded from 1.2.2->1.2.3->1.2.4 so that on-device metadata can be
migrated correctly.

Add a new per-device flag `install-all-releases` which causes the daemon to not
skip directly to the newest release. This is designed to be set from a quirk
file.

This can obviously only be used for devices that can apply firmware "live" and
thus do not need a reboot or system shutdown to actually apply the firmware.
This also needs the cabinet archive to ship multiple versions of the firmware,
and for the metainfo.xml file to refer to multiple release objects.
2020-01-07 15:33:12 +00:00
Richard Hughes
7f765005e2 Add a runtime warning when adding a device without an vendor-id or protocol set
Also, allow setting the protocol in the quirk file if required.
2020-01-06 14:48:32 +00:00
Richard Hughes
4f023420c6 Export the device protocol to the client --verbose output
It turns out this is useful for debugging.
2019-12-01 06:31:05 -06:00
Richard Hughes
00f66f659d trivial: Do not include non-introspectable functions in the GIR
If we do need these for managed languages, we can of course create boxed types
when requried.
2019-11-27 12:45:35 +00:00
Richard Hughes
a0d81c726f trivial: Fix up a few introspection problems in FwupdPlugin 2019-11-27 12:45:35 +00:00
Mario Limonciello
6b0e66354b Convert libfwupdprivate to a shared library libfwupdplugin 2019-11-27 11:32:43 +00:00