Commit Graph

22 Commits

Author SHA1 Message Date
Richard Hughes
a1ef52e5f9 dell-dock: Port to using fu_device_get_proxy()
This also cleans up the memory handling to prevent a ref-cycle loop that
prevented the dock devices from being finalized if the dock was removed.
2020-04-15 20:34:31 +01: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
Francois Berder
bb5385de76 plugins: Fix potential use of NULL pointer in fu_dell_dock_mst_write_register
Signed-off-by: Francois Berder <18538310+francois-berder@users.noreply.github.com>
2019-11-29 06:33:09 -06:00
Richard Hughes
56ac823af9 Set the protocol per-device not per-plugin
Some plugins have devices with more than one protocol. Logically the protocol
belongs to the device, not the plugin, and in the future we could use this to
further check firmware that's about to be deployed.

This is also not exported into libfwupd (yet?) as it's remains a debug-feature
only -- protocols are not actually required for devices to be added.
2019-11-25 18:01:54 +00: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
7afd7cba0d Use FuFirmware as a container for firmware images
In many plugins we've wanted to use ->prepare_firmware() to parse the firmware
ahead of ->detach() and ->write_firmware() but this has the limitation that it
can only return a single blob of data.

For many devices, multiple binary blobs are required from one parsed image,
for instance providing signatures, config and data blobs that have to be pushed
to the device in different way.

This also means we parse the firmware *before* we ask the user to detach.

Break the internal FuDevice API to support these firmware types as they become
more popular.

This also allows us to move the Intel HEX and SREC parsing out of the dfu plugin
as they are used by a few plugins now, and resolving symbols between plugins
isn't exactly awesome.
2019-08-08 13:10:57 +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
Richard Hughes
5079f26f0e Never guess the version format from the version string
This leads to madness, as some formats are supersets of the detected types,
e.g. 'intel-me' is detected as 'quad' and 'bcd' is detected as 'pair'.

Where the version format is defined in a specification or hardcoded in the
source use a hardcoded enum value, otherwise use a quirk override.

Additionally, warn if the version does not match the defined version format
2019-04-30 09:25:41 +01:00
Richard Hughes
dce91204c9 Fix some typos spotted using codespell 2019-04-08 12:47:53 +01:00
Richard Hughes
8cfbb25c31 trivial: Fix a few 'Sign check of bitwise op' LGTM warnings
Not really a bug, as @crc and @data are both unsigned.
2019-02-12 06:28:51 -06:00
Mario Limonciello
1d26689b2f trivial: dell-dock: mirror update status from passive flow
If fwupd is restarted multiple times before dock is unplugged, don't
let any devices update if we can avoid it.
2019-01-31 10:53:54 -06:00
Mario Limonciello
8963d6b4b2 dell-dock: Set minimum board to board 4
This allows dropping all the quirks related to older boards.
2019-01-08 12:36:36 -06:00
Mario Limonciello
c9d775c321 trivial: dell-dock: Correct variable for turning off HDCP 2.2 2018-12-07 14:17:41 -06:00
Mario Limonciello
8ec36ae826 trivial: dell-dock: reverse MST update order for I2C
This mirrors the update process over DP aux to run the ESM update
first.

The thought process is as follows:
The "version" displayed doesn't show ESM version, only standard
bank version.
So if the update fails for the ESM then because the update of the
standard happening first it would never be flashed.
2018-12-04 06:16:29 -06:00
Mario Limonciello
777fabf033 dell-dock: Drop delayed MST callback routine
Since dell_dock is the priority plugin for MST flashing the VMM5331
no need to do delayed callbacks anymore.

When the dell_dock plugin bumps to EC 15 being the minimum requirement
more code can also be dropped.
2018-11-05 13:44:12 -06:00
Mario Limonciello
60c4a59dab trivial: dell-dock: Lower MST communication speed to 400 KHz
It was identified that at least one other device on this shared
I2C bus can't operate at the speed.  This means that it may
inadvertently respond to commands intended for another device.
2018-10-22 14:02:44 -05:00
Mario Limonciello
2ef4e09e88 dell-dock: Add missing unlock call for MST via dell_dock plugin
When automatic relock was put in place this caused a problem that
some situations the device won't be in the right state when
calling update.
2018-10-18 06:06:07 +01:00
Richard Hughes
481aa2a923 Port from libappstream-glib to libxmlb
The libxmlb library is much faster to query, and does not require the daemon
to parse the XML metadata at startup. It's a zero-copy mmap design that is more
modern and less clunky.

RSS has reduced from 3Mb (peak 3.61Mb) to 1Mb (peak 1.07Mb) and the startup
time has gone from 280ms to 250ms.
2018-10-17 14:41:13 +01:00
Mario Limonciello
4bd12b376a dell-dock: Correct a situation that error wasn't propagating
This code was from an earlier instance that had special fallbacks
and error_local wasn't removed.
2018-10-14 06:33:04 +01:00
Richard Hughes
c012c81540 dell-dock: Use different debug strings for each device type 2018-10-12 10:34:09 +01:00
Richard Hughes
5e84da6bfe dell-dock: Don't use the VLA feature in the new dock
This is a massive co-incidence.
2018-10-12 08:08:33 +01:00
Mario Limonciello
558055c9b7 Add a plugin for an upcoming Dell USB-C dock
This plugin requires infrastructure introduced in fwupd 1.1.3
and can not be backported to earlier versions of fwupd.

It works together with the Synaptics and Thunderbolt plugins to
coordinate the proper flashing procedure for devices in this dock.
2018-10-12 07:58:29 +01:00