Commit Graph

1843 Commits

Author SHA1 Message Date
Richard Hughes
1fccae68ad superio: Move the register read/write into the FuSuperioDevice object
This will allow us to use them from subclassed objects.
2019-03-23 12:04:18 +00:00
Richard Hughes
140ce926ae superio: Check the IOBAD0 is usable during setup 2019-03-23 12:04:18 +00:00
Richard Hughes
4c9d00c1d5 superio: Use fu_device_set_firmware_size() 2019-03-23 12:04:18 +00:00
Richard Hughes
bb73e6594d superio: Move some constants out to the common header 2019-03-23 12:04:18 +00:00
Richard Hughes
f83639fb77 superio: Use GObject properties in FuSuperioDevice 2019-03-23 12:04:18 +00:00
Richard Hughes
b12d0bfec5 superio: Convert FuSuperioDevice to be derivable
We'll need this for future refactoring.
2019-03-23 12:04:18 +00:00
Richard Hughes
2da42d3cd4 trivial: Add fu_device_set_firmware_size()
This allows us to set the value where the blob has to be a specific size.
2019-03-21 10:31:35 +00:00
Richard Hughes
2aad104473 trivial: Add fu_common_bytes_compare() 2019-03-21 10:28:20 +00:00
Richard Hughes
36999464c7 trivial: Move a useful function out of libdfu 2019-03-19 21:17:48 +00:00
Richard Hughes
b7537782cb trivial: Fix the debug print when dumping SuperIO registers
Found using Coverity.
2019-03-18 16:35:01 +00:00
Richard Hughes
37b6c70aa0 superio: Add list of SPI commands for future usage 2019-03-18 15:59:33 +00:00
Richard Hughes
5c18617e8f uefi: Actually upload the UPDATE_INFO entry for the UX capsule 2019-03-15 14:22:01 +00:00
Richard Hughes
079b7b6f9d superio: Get the chip size from the EC rather than hardcoding
I'm not sure why we can't just use SIO_LDNxx_IDX_CHIPID1, but lets do the same
as the vendor tool in case there is a good reason that I don't know about.
2019-03-15 13:47:57 +00:00
Richard Hughes
72e7a82c88 uefi: Check the error code of QueryCapsuleCapabilities() correctly
We can't print max or reset as they are undefined in the event of failure.
2019-03-15 09:27:55 +00:00
Peter Jones
fda89fd15e Update the UEFI UX Capsule Header checksum when needed.
Signed-off-by: Peter Jones <pjones@redhat.com>
2019-03-14 14:06:06 -05:00
Richard Hughes
35b6e13d96 uefi: Copy the shimx64.efi binary for known broken firmware
Some system firmware helpfully 'deduplicate' the boot loader entries based on
the filepath, without taking into account either the label or optional data.

This means we have to use a custom copy of shim for firmware updates.
2019-03-14 17:00:53 +00:00
Richard Hughes
0ca78aa2e1 modem-manager: Fix a trivial build warning
Fixes https://github.com/hughsie/fwupd/issues/1082
2019-03-08 18:34:36 +00:00
Richard Hughes
a0f9d2e110 superio: Fix a trivial build warning
Fixes https://github.com/hughsie/fwupd/issues/1081
2019-03-08 18:33:06 +00:00
Mario Limonciello
640faed956 trivial: synapticsmst: remove unneeded fixme
The opening flow for enumerate is as expected right now.
2019-03-05 09:39:29 +00:00
Mario Limonciello
f4c43592fc trivial: uefi: correct an order of operations looking for UX capsule
This was caught by LGTM.

This pointer might have type struct <unnamed> (size 28), but the
pointer arithmetic here is done with type UX_CAPSULE_HEADER * (size 16).
2019-03-05 09:39:29 +00:00
Mario Limonciello
65415e6c8d trivial: uefi: Remove an unnecessary warning caught by LGTM
This clause is indeed impossible to hit due to earlier checks
for the size of `is`.
2019-03-05 09:39:29 +00:00
Mario Limonciello
3143bad0f5 fu-tool: Save device state to @LOCALSTATEDIR@/lib/fwupd/state.json on actions
This feature is turned on with the new fwupdtool option `--enable-json-state`

The intended use case is for ChromeOS to be able to save information about
devices on the system when `fwupdtool update` was run to display in the UX at
a later time.
2019-02-28 10:32:45 -06: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
Richard Hughes
8a3ab68fcb ata: Support delayed activation
This will allow us to switch to the new firmware version during shutdown when
the filesystems have been remounted readonly.

Activating manually means we don't have to get the user to shutdown and then
do a fresh power-on, rather than the more usual restart.
2019-02-27 09:04:54 +00:00
Mario Limonciello
75784c5644 dell-dock: Use activation when calling fwupdtool activate
This will finish passive flow without unplugging the cable.
This feature requires EC27 or later.
2019-02-27 09:04:54 +00:00
Mario Limonciello
96a0dd5606 Add a support for delayed activation
This is intended for devices that it is not safe to immediately activate
the firmware.  It may be called at a more convenient time instead.

Both fwupdmgr and fwupdtool support the feature.

- if called at runtime with fwupdmgr it uses the daemon
- during shutdown fwupdtool uses the pending.db to perform this feature.
2019-02-27 09:04:54 +00:00
Richard Hughes
f45c651dd1 uefi: Fix the self tests when running on Fedora SilverBlue 2019-02-26 19:13:35 +00:00
Richard Hughes
b768e4d924 Do not fail to start the daemon if tpm2_pcrlist hangs
In some situations SELinux prevents fwupd from executing tpm2_pcrlist, but the
failure mode is that the process just hangs and never completes. This causes
systemd to time out the fwupd daemon startup and then errors to be shown in
GNOME Software.

To prevent this happening, add an optional timeout argument to
fu_common_spawn_sync() and cancel the subprocess if it takes longer than this
to complete.

See https://bugzilla.redhat.com/show_bug.cgi?id=1665701 for details.
2019-02-26 14:27:13 +00:00
Mario Limonciello
e59bee1f45 trivial: dell-dock: make passive dependency include Hub2 1.42
An extra race condition bug exists due to the MCU firmware on Hub2.
Require to already be on 1.42 or later to use passive flow.
2019-02-18 08:03:49 -06:00
Mrmaxmeier
49448a99d4 uefi: fix segfault in fwup_set_update_statuses
If the near-zero memory region is populated, this caused UEFI
updates to get stuck trying to deref random pointers.
2019-02-15 21:26:56 +00:00
Richard Hughes
19a9fc4e6d superio: Implement detach() and attach()
This gets us closer to actually being able to flash the hardware.
2019-02-14 09:12:26 -06:00
Richard Hughes
5acfc64a78 superio: Correct the names of some constants and improve debugging support 2019-02-14 09:12:26 -06:00
Mario Limonciello
8226f84233 trivial: libfwupd: correct a segfault when building a GUID
The order of events when casting causes an access to unintended memory.

```
0x00007ffff7bc19df in fwupd_guid_to_string (guid=0x8000000090d0, flags=FWUPD_GUID_FLAG_MIXED_ENDIAN) at ../libfwupd/fwupd-common.c:550
550		memcpy (&gnat, guid, sizeof(gnat));
(gdb) bt
 #0  0x00007ffff7bc19df in fwupd_guid_to_string (guid=0x8000000090d0, flags=FWUPD_GUID_FLAG_MIXED_ENDIAN) at ../libfwupd/fwupd-common.c:550
 #1  0x00007fffdbddd195 in fu_nvme_device_get_guid_safe (buf=0x7fffffffce70 "\\\034\\\034FI83Q060610103M66   BC501 NVMe SK hynix 128GB", ' ' <repeats 15 times>, "80001C0T\004", <incomplete sequence \344\254>, addr_start=3110) at ../plugins/nvme/fu-nvme-device.c:83
 #2  0x00007fffdbddd60c in fu_nvme_device_parse_cns_maybe_dell (self=0x5555558cc8a0, buf=0x7fffffffce70 "\\\034\\\034FI83Q060610103M66   BC501 NVMe SK hynix 128GB", ' ' <repeats 15 times>, "80001C0T\004", <incomplete sequence \344\254>) at ../plugins/nvme/fu-nvme-device.c:201
 #3  0x00007fffdbddda64 in fu_nvme_device_parse_cns (self=0x5555558cc8a0, buf=0x7fffffffce70 "\\\034\\\034FI83Q060610103M66   BC501 NVMe SK hynix 128GB", ' ' <repeats 15 times>, "80001C0T\004", <incomplete sequence \344\254>, sz=4096, error=0x7fffffffe008) at ../plugins/nvme/fu-nvme-device.c:295
 #4  0x00007fffdbddde68 in fu_nvme_device_setup (device=0x5555558cc8a0, error=0x7fffffffe008) at ../plugins/nvme/fu-nvme-device.c:376
 #5  0x0000555555587850 in fu_device_setup (self=0x5555558cc8a0, error=0x7fffffffe008) at ../src/fu-device.c:2076
 #6  0x0000555555587412 in fu_device_open (self=0x5555558cc8a0, error=0x7fffffffe008) at ../src/fu-device.c:1920
 #7  0x000055555558aa88 in fu_device_locker_new_full (device=0x5555558cc8a0, open_func=0x5555555872cb <fu_device_open>, close_func=0x555555587424 <fu_device_close>, error=0x7fffffffe008)
    at ../src/fu-device-locker.c:154
 #8  0x000055555558a925 in fu_device_locker_new (device=0x5555558cc8a0, error=0x7fffffffe008) at ../src/fu-device-locker.c:104
 #9  0x00007fffdbddc4cd in fu_plugin_udev_device_added (plugin=0x5555558a6420, device=0x5555558c6300, error=0x7fffffffe008) at ../plugins/nvme/fu-plugin-nvme.c:24
 #10 0x0000555555592cbf in fu_plugin_runner_udev_device_added (self=0x5555558a6420, device=0x5555558c6300, error=0x7fffffffe070) at ../src/fu-plugin.c:1281
 #11 0x000055555557f0a8 in fu_engine_udev_device_add (self=0x5555557f9840, udev_device=0x5555558e5900) at ../src/fu-engine.c:3491
 #12 0x000055555557f480 in fu_engine_enumerate_udev (self=0x5555557f9840) at ../src/fu-engine.c:3555
 #13 0x0000555555580fc6 in fu_engine_load (self=0x5555557f9840, error=0x7fffffffe2c8) at ../src/fu-engine.c:4117
 #14 0x0000555555566567 in fu_util_start_engine (priv=0x5555557eeb20, error=0x7fffffffe2c8) at ../src/fu-tool.c:138
 #15 0x00005555555674e2 in fu_util_get_devices (priv=0x5555557eeb20, values=0x7fffffffe5d8, error=0x7fffffffe2c8) at ../src/fu-tool.c:490
 #16 0x0000555555566aff in fu_util_run (priv=0x5555557eeb20, command=0x7fffffffe81a "get-devices", values=0x7fffffffe5d8, error=0x7fffffffe2c8) at ../src/fu-tool.c:242
 #17 0x000055555556a514 in main (argc=2, argv=0x7fffffffe5c8) at ../src/fu-tool.c:1445

```
2019-02-13 16:40:07 +00:00
Mario Limonciello
9a83af0262 dell-dock: Filter the last supported payloads of certain board 4 SKUs
EC23 is the last version that will be supported on board 4 SKUs with
base PD firmware versions 18+.

* If on EC23 already, don't mark the device as updatable anymore.

* Flashing EC24 or later when currently on EC 22 or less will potentially
  cause bricked docks that can't enumerate, so prevent this scenario
  during update path.
2019-02-13 06:44:25 +00:00
Richard Hughes
bc7475f1a1 wacom-usb: Use the correct buffer format for the touch module
The specifications are wrong...
2019-02-12 10:16:42 -06:00
Richard Hughes
392e5aa817 wacom-usb: Set the install duration for each device type 2019-02-12 10:16:42 -06:00
Richard Hughes
1ec05cb11f wacom-usb: Return with an error if there were too many retries 2019-02-12 10:16:42 -06:00
Richard Hughes
2c292fba4f wacom-usb: Make updating less verbose 2019-02-12 10:16:42 -06:00
Richard Hughes
20f14c29cb uefi: Allow devices to create more complete fake UEFI devices
Also, gets rid of two 'TODO' warnings with LGTM.
2019-02-12 06:28:51 -06: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
Richard Hughes
10b2fef1bd trivial: Fix a 'Comparison is always true' LGTM warning
Not a bug, but somewhat muddled logic I guess.
2019-02-12 06:28:51 -06:00
Richard Hughes
c909ab3f3c unifying: Fix regression when recovering from failed flash
The unifying version numbers are of the form 'RQR24.00_B0000' which means we
have to force the plugin to 'plain' version format to avoid stripping out the
non-semver chars.

Fixes https://github.com/hughsie/fwupd/issues/1018
2019-02-12 10:00:02 +00:00
Richard Hughes
bfd946e463 Use '#pragma once' to avoid a lot of boilerplate 2019-02-09 08:42:30 -06:00
Mario Limonciello
eb8b38f158 trivial: storage: Update minimum Dell component ID length to 6
Dell storage team confirmed that nothing shorter than 6 will ever
be used and so this heuristic can be stronger.
2019-02-08 16:06:14 +00:00
Mario Limonciello
2e9a4242c5 trivial: dell-dock: bump passive requirement to EC25+
Turns out we can't have nice things that work properly just yet.
2019-02-08 06:31:21 +00:00
Richard Hughes
b3aa793539 thunderbolt: Convert the instance IDs as we never open the device 2019-02-07 18:56:15 +00:00
Richard Hughes
90112823df udev: Manally call fu_device_setup() to convert the instance IDs
The udev plugin is somewhat special as it uses a non-subclassed FuDevice that
never gets 'opened'.

This means that we never automatically call fu_device_setup() and thus the
instance IDs are not converted into GUIDs before the device is added.
2019-02-07 11:26:50 -06:00
Richard Hughes
5df0e7de30 trivial: Fix the spelling of 'module' in wac-usb 2019-02-06 14:48:48 +00:00
Richard Hughes
2b005b2869 wacom-usb: Record the block number when failing 2019-02-06 14:48:48 +00:00
Richard Hughes
90d3075a5d wacom-usb: The touch address is big endian
The example in the specifications should have told us that...
2019-02-06 14:48:48 +00:00
Richard Hughes
6fe54f23e0 wacom-usb: Accept a non-binary IHEX file for the touch update 2019-02-06 14:48:48 +00:00
Richard Hughes
409ccd6142 trivial: Use fu_common_dump_raw() in wacom-usb 2019-02-06 14:48:48 +00:00
Richard Hughes
c91ec869be wacom-usb: Only poll when the device status is 'busy' 2019-02-06 14:48:48 +00:00
Richard Hughes
7c6009038e wacom-usb: Only reboot the device when all composite devices have been updated 2019-02-06 14:48:48 +00:00
Richard Hughes
4530c44f2d wacom-usb: Fix flashing failure with latest Intuos Pro tablet
The checksum is now stored as the very last flash descriptor, so we need to pad
the SREC data to include the 'missing' data range. As we're doing that, we
should optimize like the Wacom updater does and skip writing descriptors that
are unused.
2019-02-06 14:48:48 +00:00
Richard Hughes
040ac626b5 dfu: Fill holes when reading SREC files
It is perfectly valid to have non-continuous ranges, so fill in any holes like
we do for Intel HEX files.
2019-02-06 14:48:48 +00:00
Richard Hughes
6b78d64987 Add fwupd_guid_from_string() to drop dep on uuid
This also allows us to write mixed-endian structures and adds tests. As part of
this commit we've also changed the API of something that's not yet been in any
tarball release, so no pitchforks please.
2019-02-06 14:48:04 +00:00
Richard Hughes
0b0fab8fed wacom-raw: Check the InstanceID rather than GUID
Since the _NO_AUTO_INSTANCE_IDS change we need to actually check the ID, rather
than the GUID.
2019-02-06 08:02:16 +00:00
Richard Hughes
1bc432316a Defer the InstanceID->GUID hashing until after setup
This allows hardware from OEMs to *not* match generic firmware supplied by the
device manufacturer. The idea being, that the OEM will supply firmware that
will actually work on the device.

Based on a patch from Mario Limonciello, many thanks.
2019-02-06 08:02:16 +00:00
Mario Limonciello
2472e45ac6 ata: Check for USB enclosures as well
I noticed that a SATA drive connected to an USB2.x to ATA bridge was
recognized as internal otherwise.
2019-02-05 20:29:26 +00:00
Richard Hughes
b8c30b8732 Do not use efivar just to print a mixed endian GUID 2019-02-04 15:19:57 +00:00
Richard Hughes
65c81921b6 Add fu_device_add_instance_id() and prefer explicit conversion 2019-02-04 15:19:57 +00:00
Richard Hughes
592baedfff Export some of the GUID functionality 2019-02-04 15:19:57 +00:00
Richard Hughes
5297678d3c Allow a plugin to set _ANOTHER_WRITE_REQUIRED to run more than one plugin
For this to work with different plugins the device IDs must match.
2019-02-04 14:54:54 +00:00
Richard Hughes
c6c312f267 trivial: Move fu_plugin_runner_schedule_update() into the engine 2019-02-04 14:54:54 +00:00
Mario Limonciello
8efc5a3633 nvme: Add an extra check for Dell plugins to avoid false positives
Component IDs should always be ASCII characters.
None have been reported yet, but this should still help to prevent them.
2019-02-04 10:39:20 +00:00
Mario Limonciello
b503aa8650 ata: Add support for detecting Dell GUIDs
Similar to NVME, ATA drives distributed by Dell have special values
that should be used to designate fwupd GUIDs and only run correct
firmware.

When detecting Dell GUIDs remove the standard fwupd GUIDs.  "Generic"
firmware targeted to those GUIDs will fail to install.
2019-02-04 10:39:20 +00:00
Mario Limonciello
b05a918431 trivial: Move GUID testing into fu-common-guid
This allows other plugins to use this part of the routine.
2019-02-04 10:39:20 +00:00
Richard Hughes
96e6783982 trivial: Fix potential compile failures for high -j values 2019-02-01 16:52:16 +00:00
Richard Hughes
1e07ec95b6 uefi: Disable -Wno-address-of-packed-member
Unaligned reads don't really matter on all the architectures the EFI binary is
being built for.
2019-02-01 16:38:14 +00:00
Richard Hughes
c6b94791ec uefi: Don't unconditionally enable Werror for the EFI binary 2019-02-01 16:38:14 +00:00
Richard Hughes
0a26551bf3 ata: Default to the non-activation 0xE subcommand
During download and activation we have to reset the drive to apply the new
firmware. If the kernel gets an unexpected ATA reset then it might panic.
Default to activating the command on the next drive power-up to be safe.

Many thanks to the Dell storage team for the advice.
2019-02-01 06:13:38 -06:00
Aleksander Morgado
0f0da353c2 fastboot: Use a much longer timeout as the removal delay
A device that has gone through a fastboot update may need more than
the previous default of 10s to come back up. Just use a much longer
value to make sure it's detected properly.

Signed-off-by: Richard Hughes <richard@hughsie.com>
2019-02-01 10:26:43 +00:00
Mario Limonciello
303c4f0f90 trivial: upower: correct a logic error from ed021ab
When unable to read battery value this should return FALSE to indicate
AC power.
2019-01-31 14:56:08 -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
ead0deaa25 trivial: dell-dock: enable passive flow on all EC23+
The feature did land in EC23 and testing looks positive.
2019-01-31 10:53:54 -06:00
Richard Hughes
206b70120d dfu: Simplify the SREC parser to avoid a crash with an invalid file
Splitting the file into lines does increase memory usage, but allows us to use
a much simpler parser design. This is just like we fixed IHEX a few weeks ago.
2019-01-31 16:05:34 +00:00
Richard Hughes
ccc79c9fbc trivial: Split out strnsplit for future use 2019-01-31 16:05:34 +00:00
Richard Hughes
c1fad937d8 wacom-raw: Use the correct error codes when the panel is not supported
Otherwise, we get a nasty red console warning when plugging in a *USB* panel.
2019-01-31 11:55:48 +00:00
Richard Hughes
a3b13046c2 wacom-usb: Add some more information to the README 2019-01-31 11:55:12 +00:00
Mario Limonciello
769f990cf6 trivial: dell: filter another dock SKU from this plugin
Prevents showing errors in the logs
2019-01-30 11:00:45 -06:00
Mario Limonciello
423dde520c dell: Check that the flash interface command is available
This prevents the kernel showing errors when running on systems
without this command.

Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=202259
2019-01-30 11:00:45 -06:00
Richard Hughes
52b9800744 wacom-usb: Fix the plugin name to allow devices to be updated 2019-01-30 13:09:54 +00:00
Richard Hughes
b9b6834f54 trivial: Add FuFastbootDeviceReadFlags to fu_fastboot_device_cmd() 2019-01-30 12:14:17 +00:00
Aleksander Morgado
046c84b5b3 fastboot: flash the partition after downloading the file 2019-01-30 12:14:17 +00:00
Richard Hughes
44ce5aeae4 uefi: Add a quirk to use the legacy bootmgr description
Some hardware from Lenovo deduplicates UEFI Boot entries, and uses the old
string 'Linux-Firmware-Updater' to avoid removing the firmware update entry.
Although this is forbidden in the UEFI specification we shouldn't break
firmware updates from old firmware versions.

Provide a quirk for this, and automatically whitelist anything with the LENOVO
SMBIOS Manufacturer.
2019-01-30 12:13:39 +00:00
Richard Hughes
dd0264d0ef ata: Mark all devices as needing a reboot
Although not strictly required, I would feel a lot more warm and fuzzy knowing
the drives are running the new firmware ASAP.
2019-01-30 06:10:36 -06:00
Richard Hughes
0bf8ee810b ata: Add a new plugin to upgrade firmware on ATA/ATAPI hardware
Some of the ATA12 fixup code is by Mark Lord, taken from the hdparm project.

Fixes: https://github.com/hughsie/fwupd/issues/946
2019-01-29 22:28:09 +00:00
Richard Hughes
4fef28d0ac trivial: Add the missing protocol IDs to the plugin READMEs 2019-01-29 22:28:09 +00:00
Richard Hughes
f6838c738a trivial: Add fu_udev_device_get_slot_depth()
We'll need this for another plugin soon.
2019-01-29 22:28:09 +00:00
Mario Limonciello
5502cd5689 dell-dock: Add support for a passive flow
This behavior will prevent the dock from performing most resets until
it has been unplugged from a host system.

This significantly speeds up the perceived update duaration and prevents
data loss during update.

It's not confirmed whether EC23 or later EC will enable it.
* So only enable by a custom flag until this is confirmed.
* Custom flag will be dropped when included into stable EC release.

This functionality also relies upon the CAB file providing a message warning
user that the dock might not be usable after unplugging for up to 1 minute.
2019-01-29 15:51:12 -06:00
Richard Hughes
0a212fd1d6 uefi: Add a trivial debugging statement to debug a UX capsule failure 2019-01-25 11:04:35 +00:00
Richard Hughes
9ba9d8a98b uefi: Use fwup_new0() to allocate the updates table array
Although malloc probably works due to the page size, it's not the thing to use.
2019-01-25 11:04:30 +00:00
Szczepan Zalega
f80bb89238 nitrokey: Correct Nitrokey Storage invalid firmware version read
Currently used structures were based on early libnitrokey definitions
(which were broken for some time). Corrected their sizes and elements,
and added tests.

Fixes #960

Signed-off-by: Richard Hughes <richard@hughsie.com>
2019-01-25 09:53:05 +00:00
Mario Limonciello
654b583031 trivial: dell-dock: Correct a left shift error in BIT_CLEAR macro 2019-01-24 10:35:53 -06:00
Mario Limonciello
d6e453b0ba dell-dock: Add support for flashing Thunderbolt over I2C
This uses an API in the Realtek USB 3.1G2 controller to perform
the flash procedure.
2019-01-24 16:23:00 +00:00
Richard Hughes
367f4590d6 wacom-raw: Add a plugin to update Wacom embedded EMR and AES panels 2019-01-24 10:18:40 +00:00
Richard Hughes
42c514764a dfu: Ignore the SUB ASCII value
This is probably written by a non-free post-processing tool and can be ignored.
2019-01-22 14:43:13 +00:00
Richard Hughes
720b5deb00 dfu: Fix the parser to support extended segment addresses
Split the data into lines, which is less efficient but also much easier to
understand and debug.
2019-01-22 14:43:13 +00:00
Richard Hughes
f6a6fe8ec5 dfu: Support ihex files with leading comments
Also look for the EOF in the file.
2019-01-22 14:43:13 +00:00
Mario Limonciello
b13f784462 trivial: dell: When plugging in a dock supported by dell-dock don't show an error
Some aspects of the method for querying dock firmware do work in 'dell' plugin
but that is not useful for fwupd because it's incomplete.

Due to this the following error shows up in fwupd journal if run on a Dell system
when the new Dell dock is plugged in:
failed to add USB device 0bda:8153: failed to add device using on dell: invalid dock component request Query 3 0 2 4 0

Detect this scenario, and prevent showing errors in logs.
2019-01-22 09:11:50 +00:00
Mario Limonciello
68fb11f453 uefi: Correct a boot order creation bug (Fixes: #956)
Unfortunately the previous fix (6131f5d) introduced this bug.

The code previously was actually looking for the non-zero case
which was correct, but non-obvious since `efi_guid_cmp` works like
`g_strcmp0` where a match returns zero.

So rather than revert 6131f5d make this completly explicit.
2019-01-22 07:28:32 +00:00
Richard Hughes
088c258894 trivial: Make one uefi function static 2019-01-20 22:29:44 +00:00
Richard Hughes
c7327385f4 uefi: Remove all variable length arrays 2019-01-20 22:29:44 +00:00
Richard Hughes
31c10b7293 uefi: Fix a logic bug in fwup_search_file()
If n_handles==0 then we'd return with EFI_SUCCESS, rather than failure.
2019-01-20 22:29:44 +00:00
Richard Hughes
59407ca42d uefi: Use _cleanup_free in one more place 2019-01-20 22:29:44 +00:00
Richard Hughes
00b87884c4 uefi: Do not pass required attrs to fwup_delete_variable()
This lets us refactor some code and remove some complexity.
2019-01-20 22:29:44 +00:00
Richard Hughes
aa6498866c uefi: Delete the old Linux-Firmware-Updater boot entry 2019-01-20 22:29:44 +00:00
Richard Hughes
525433e4de uefi: Use the GNU-EFI BOOL type 2019-01-20 22:29:44 +00:00
Richard Hughes
818071d178 uefi: Refactor and simplify the EFI loader 2019-01-19 18:36:46 +00:00
Richard Hughes
f425d29a28 Show a console warning if loading an out-of-tree plugin
Fixes https://github.com/hughsie/fwupd/issues/950
2019-01-19 07:26:20 +00:00
Richard Hughes
4e30d25668 UEFI: Do the UX checksum calculation in fwupd
This makes the EFI binary much simpler.
2019-01-18 19:27:21 +00:00
Richard Hughes
09bf3b5246 trivial: Don't manually zero-fill efi_ux_capsule_header_t 2019-01-18 19:27:21 +00:00
Richard Hughes
4bdb513937 trivial: Make the capsule_image_size calculation more obvious 2019-01-18 19:27:21 +00:00
Richard Hughes
e554c1b501 trivial: Clarify our position on proprietary plugins 2019-01-18 12:21:46 -06:00
Richard Hughes
5dc757f6c1 wacom-usb: Add two more Intuos tablets
These do not need the runtime-version quirk like the others.
2019-01-18 16:11:53 +00:00
Richard Hughes
4a68fd60dc nvme: Add the needs-shutdown quirk to Phison NVMe drives
Affected drives should have a prominent statement in the update description,
possibly even the first line so it shows up by default in the updates panel.
2019-01-17 16:35:34 +00:00
Richard Hughes
b91efa6c38 trivial: Cast to FuDevice from FuUdevDevice 2019-01-17 16:35:34 +00:00
Richard Hughes
72c18fd4e4 Use GCC __cleanup__ features in the EFI loader
This simplifies memory management.
2019-01-16 12:06:09 -06:00
Richard Hughes
fc90f3954e nvme: Add flag to support manually aligning the firmware to the FWUG value
This is required for drives from Phison.
2019-01-16 13:14:50 +00:00
Richard Hughes
d5f0da15ab nvme: Support FGUID to get the SKU GUID 2019-01-16 13:14:50 +00:00
Richard Hughes
a9d81cfb10 nvme: Support FWUG to get the write block size 2019-01-16 13:14:50 +00:00
Richard Hughes
1eaf71c91b nvme: Add trivial comment to clarify address bitshifting 2019-01-16 13:14:50 +00:00
Richard Hughes
b6e9dacc9a uefi: Do not check the BGRT status before uploading a UX capsule
Microsoft description about the Status is:

    The Status field of the BGRT describes whether the image is currently
    displayed on the screen. This is not applicable to the firmware update
    display capsule.

Many thanks to Steven Chang for identifying this issue.

Fixes: https://github.com/hughsie/fwupd/issues/935
2019-01-16 13:08:48 +00:00
Richard Hughes
e58fa31887 dfu: Fix flashing various Jabra devices
Do not unset the quirks when closing the device, the _NO_DFU_RUNTIME quirk is
needed when re-opening the device during detach.

Fixes https://github.com/hughsie/fwupd/issues/927
2019-01-16 11:22:05 +00:00
Mario Limonciello
ed021ab448 upower: Add support for checking battery percentage
On any devices that normally would require checking for AC also
check that at least one battery on the system has at least 30% to
perform an update.

Fixes: #925
2019-01-15 10:43:18 -06:00
Mario Limonciello
78efa4d2a6 trivial: thunderbolt: If unable to find inactive nvmem, don't mark updatable
This situation may happen in the future in systems where the TBT NVM is embedded
in a different location and only upgradable through system firmware.
2019-01-15 10:33:52 -06:00
Richard Hughes
fa8b7aab0a nvme: Check the return code of the admin passthru ioctl
This meant we reported firmware update success when the image format or offset
was incorrect.
2019-01-15 16:26:30 +00:00
Mario Limonciello
18f3ab4e4d trivial: dell-dock: Prohibit downgrades on board 4 or later below EC19
Some SKUs of board 4 and later have silicon that will not work with anything
but EC19 or later.  So once flashed up to EC19 prohibit downgrades below that
to keep from bricking devices.
2019-01-15 08:52:12 +00:00
Mario Limonciello
84e948a5b0 trivial: dell-dock: correct an assertion related to setting EC version
This is probably fall out from a previous code re-shuffling.
The EC version is already set elsewhere, and in many cases `self->ec_version`
is `NULL` at this time.
2019-01-10 13:44:48 -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
993fc1636c dell-dock: Workaround a manufacturing bug for board level 4
Board 4 was manufactured with package version 89.16.01.00 and this
will prevent properly upgrading between releases.  Reset this version
to 00.00.00.00 if detected on this board.
2019-01-08 12:36:36 -06:00
Mario Limonciello
b4e3698cfb dell-dock: Wait longer for re-enumeration on TBT SKU
Emperically this seems to take 7-10 seconds longer on this SKU.
2019-01-08 12:36:36 -06:00
Richard Hughes
831eb7ef7e superio: Support IT89xx devices
We can switch to LDN 0x11 and read the IO base address for the PM1 legacy port
rather than hardcoding data and command ports.
2019-01-08 12:53:57 +00:00
Richard Hughes
305f1f2ab1 trivial: Add some debugging data to wacom-usb 2019-01-02 09:50:39 +00:00
Richard Hughes
0e17e6d030 Fix building with -Wl,-z,defs
This allows us to find undefined references at compile time, not runtime.
2018-12-25 16:10:54 -06:00
Richard Hughes
363127e518 ebitdo: Fix the reported version number if the daemon locale is not C.UTF-8
Always use a dot as the delimiter of a semver rather than treating it as a
floating point number.

Related to https://github.com/hughsie/lvfs-website/issues/216
2018-12-25 16:09:45 -06:00
Miklós Márton
7f59a6f844 Add Dell TB18DC to the known devices list 2018-12-25 16:08:10 -06:00
Richard Hughes
420ccd46fa Allow replacing the last byte in the image when using 'dfu-tool replace-data'
Fixes https://github.com/hughsie/fwupd/issues/903
2018-12-18 08:35:24 +00:00
Richard Hughes
8d02612893 trivial: Fix an error code if a search string is unfound 2018-12-18 08:34:27 +00:00
Richard Hughes
9d6dc95f41 trivial: Fix a memory leak if dfu-tool returns with an error 2018-12-18 08:34:06 +00:00
Richard Hughes
b56015ed3f uefi: Add the PCR0 value as the device checksum for system firmware
We can't actually access the UEFI ROM from userspace, but the PCR0 is a hash
built from the ROM itself. We could use this value to ensure the firmware has
been written correctly, and that the PCR0 matches the expected value specified
in the metadata.
2018-12-14 19:23:04 +00:00
Richard Hughes
9729584ee4 Allow plugins to define support for a 'well-known' protocol
Future metadata from the LVFS will set the protocol the firmware is expected to
use. As vendors love to re-use common terms like DFU for incompatible protocols,
namespace them with the controlling company ID with an approximate reverse DNS
namespace.

This also allows more than one plugin to define support for the same protocol,
for instance rts54hid+rts54hub and synapticsmst+dell-dock.
2018-12-14 18:15:01 +00:00
Mario Limonciello
8612318158 uefi: When adding headers set the header size to 4k
This solves issues with implementations that require 4k alignment
of pages in BIOS which is seen on certain architectures.

The UEFI spec prescribes that the "minimum" size is the size of
the EFI header but that this may be increased up to larger sizes
due to extended header entries.
2018-12-11 12:51:57 -06:00
Mario Limonciello
2ac3aca2a7 uefi: Append the header on capsules without headers from Linux
This allows using better heuristics and potentially phasing this out
in the future.
2018-12-11 12:51:57 -06:00
Mario Limonciello
6131f5df8f trivial: uefi: correct a logic error in setting variable
efi_guid_cmp uses memcmp and hence should return 0 when a match
is found.
2018-12-11 12:51:57 -06:00
Mario Limonciello
c9d775c321 trivial: dell-dock: Correct variable for turning off HDCP 2.2 2018-12-07 14:17:41 -06:00
Richard Hughes
8dc599a23e flashrom: Ensure the quirks database is set on the new object 2018-12-07 16:30:55 +00:00
Richard Hughes
a0da340b60 uefi: Do not add devices with invalid GUIDs
Note: We deliberately don't add the device without 'UPDATABLE' as there's
nothing the user can actually do to repair this themselves.
2018-12-07 09:05:30 -06:00
Richard Hughes
bccaaf5194 Add shared functionality for reading and writing with O_NONBLOCK
Two plugins have very similar code already, and we're about to get another.
2018-12-06 14:07:02 +00:00
Richard Hughes
e59cb9af01 trivial: Add fu_common_dump_raw() 2018-12-05 15:09:56 +00:00
Richard Hughes
8949f3d066 wacom-usb: Remove the DTH generation hardware as it will not work with fwupd
Fixes https://github.com/hughsie/fwupd/issues/882
2018-12-05 11:41:59 +00: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
d73fbe08ce thunderbolt: Remove a superfluous boundary condition when verifying update
`g_ascii_strtoull` returns 0 and sets `errno` to `-EINVAL` only when
the base is invalid.  It's hardcoded to `16` so this is impossible.
Reading `-EINVAL` from `errno` is incorrect in these circumstances.

Fixes: https://github.com/hughsie/fwupd/issues/879
2018-12-03 14:28:48 -06:00
Richard Hughes
b4fd12a4c6 Add a plugin to update hardware that supports fastboot 2018-12-03 15:50:38 +00:00
Richard Hughes
1c4e06925c trivial: Speed up daemon startup
Require a quirk match for Unifying hardware to avoid probing a lot of USB
devices at startup.
2018-12-03 15:23:27 +00:00
Richard Hughes
0585172c17 trivial: Document the expected plugin firmware formats 2018-12-03 08:48:13 -06:00
Richard Hughes
b27a2520cc dfu: Require a specific USB class and subclass for DFU mode
This makes startup quicker as we no longer have to probe every USB device, and
is now possible with the new GUIDs we added. Devices not using the
specification-provided values can (and already are) worked around with quirks.
2018-12-03 13:57:52 +00:00
Richard Hughes
6dc8680e15 amt: Fix a crash if AMT returns an empty response
Mixing integer return values and GError is never a good idea.

Fixes https://bugzilla.redhat.com/attachment.cgi?id=1510083
2018-11-30 15:22:17 +00:00
Richard Hughes
57908bebc1 wacomhid: Rename to wacom-usb
We're adding another Wacom plugin soon, this one also using hidraw -- but the
new protocol uses a different 'raw' protocol and does not use USB.
2018-11-29 13:26:29 +00:00
Mario Limonciello
817a15a1bf trivial: dell-dock: Set EC version to daemon before EC reset
If the process fails (or was skipped due to 'skip-restart') this will
prevent the daemon from trying again until the dock has been power
cycled.
2018-11-27 11:05:26 +00:00
Mario Limonciello
1210332e05 trivial: dell-dock: fail when EC indicates flashing an invalid/unsigned image
Otherwise this would cause fwupd to sit in an endless loop when providing a bad
image.

This additional enum is only available in EC16, but since it doesn't break existing
API on older EC images, don't bump minimum requirement to EC16 yet.
2018-11-27 11:05:26 +00:00
Richard Hughes
328b00eec3 Remove DaemonVersionFormat=quad
This metadata key is now unnecessary, as firmwares are expected to set the
version format in the metadata.

If the metadata is missing, the LVFS allows a per-vendor default for non-semver
release versions which is now unconditionally set in metadata.
2018-11-21 19:06:51 +00:00
Richard Hughes
75b965d01d Shut down the daemon after 2h of inactivity
Plugins are allowed to 'opt-out' of this behaviour using _RULE_INHIBITS_IDLE.
This should be used where waking up the hardware to coldplug is expensive,
either from a power consumption point of view, or if other artifacts are going
to be seem -- for instance if the screen flickers when probing display devices.

This functionality is also inhibited when the actual upgrade is happening,
for obvious reasons.

Admins can turn off this auto-sleep behaviour by editing the daemon.conf file.

Fixes https://github.com/hughsie/fwupd/issues/417
2018-11-21 18:54:44 +00:00
Richard Hughes
9cf352db2f trivial: Add InstallDuration values for 8bitdo devices 2018-11-15 15:43:43 +00:00
Richard Hughes
0443a4170a trivial: Add InstallDuration values for Unifying devices 2018-11-15 15:43:43 +00:00
Richard Hughes
5ed4d968ac trivial: Add InstallDuration values for ColorHug devices 2018-11-15 15:43:43 +00:00
Richard Hughes
86b79fb039 Speed up fwupd startup by loading less thunderbolt firmware
We load the Thunderbolt controller firmware to see if the controller is in
native mode, as this changes the GUID. If the controller is asleep the firmware
is not cached by the kernel and it can take more than 4 seconds to read out
504kB of firmware.

We only need the first two 64-byte chunks, so only read what is required.
This speeds up fwupd starting substantially, and also means we don't have to
allocate a giant chunk of heap memory just to inspect one byte.

Fixes: https://github.com/hughsie/fwupd/issues/848
2018-11-14 16:21:52 +00:00
Richard Hughes
840184929b trivial: Fix some function prefixes for Thunderbolt 2018-11-14 16:21:52 +00:00
Richard Hughes
ac458d3436 Guess the version format when it is not provided
The most important change here is that versions without dots (not a 'semver')
are treated as 'PLAIN' rather than 'UNKNOWN'.
2018-11-14 11:52:46 +00:00
Mario Limonciello
c7fe0a7453 trivial: Add quirk documentation
Fixes https://github.com/hughsie/lvfs-website/issues/192
2018-11-13 09:53:19 +00:00
Richard Hughes
ba2f0ae1d4 trivial: Document the GUID generation scheme
Fixes https://github.com/hughsie/fwupd/issues/837
2018-11-08 20:39:46 +00:00
Nicolas Saenz Julienne
9e21daaef4 ebitdo: remove SF30/SN30 pro device ids
The ids clash with the Xbox controller ids. This makes the Xbox controller unusable since fwupd unloads the device just after connecting it and fails to update it not being a 8bitdo device.

As seen here: https://github.com/paroj/xpad/issues/114
2018-11-07 10:52:54 +00: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
5e36c9e792 synapticsmst: Adjust EVB board handling
1. Since board ID in synapticsmst.quirk is different based upon how
the board ID is read, don't whitelist it in `write_firmware`

2. Allow using `--force` with `fwupdmgr` or `fwupdtool` to override
board ID check.

3. Allow using custom flag `ignore-board-id` to ignore board IDs.
This will be the default for EVB boards and can be used in the event
of a factory mistake as well.

4. Move the EVB board IDs into their own synapticsmst_evb.quirk.
This file will not be installed by default (So EVB boards are only
functional when manually installed).
2018-11-05 09:31:55 -06:00
RyanChang
da4049499e synapticsmst: Remove the content checking of firmware
Keep the length checking and remove content checking because don't want to reveal detail format.
2018-11-05 09:31:55 -06:00
RyanChang
732d641bdc synapticsmst: Access Board ID through memory instead
In firmware images HDCP 2.2 will be enabled by default,so access to flash region will fail.
2018-11-05 09:31:55 -06:00
Mario Limonciello
53b49458b6 dell-dock: Prefer to flash VMM5331 via I2C instead of DP aux
Although this is (currently) slower to flash with, bad behavior
and corner case scenarios such as these don't occur:

* Flickering during enumeration
* Monitor plugged in during enumeration but not during flash
* Heavy DP traffic slowing down update significantly
* Sandboxes without access to `/dev/drm_dp_auxY` unable to flash
* Exercising existing graphics driver bugs leading to system freezes.

Additionally this removes a lot of code in dell_dock that was put
in place specifically to be able to support waking up the MST hub
to try to use DP aux for flashing.

Now DP aux will only be used to flash when fwupd is compiled
without `dell_dock`.
2018-11-01 06:29:10 -05: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
Richard Hughes
0cc1ff5cd7 amt: Set the full device version including the BuildNum 2018-10-18 14:49:25 -05:00
Richard Hughes
74fe343213 Add version format quirks for several Lenovo machines 2018-10-18 19:31:04 +01:00
Richard Hughes
ce712426f8 uefi: Set the quirks on created devices
Ensure the quirk object is set, and then add the GUIDs first so that the
version format can be set from a quirk file.

Additionally, only overwrite the fallback name if the name has not already been
set manually from a quirk.
2018-10-18 19:31:04 +01:00
Mario Limonciello
ce4a1a8ba6 dell_dock: Use correct offset for finding version of MST (Fixes: #804)
The offset that was previously used was dependent upon compiler behavior.
This address is fixed and won't change between versions.
2018-10-18 06:06:07 +01: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
860e99357b dell-dock: If marketing name is invalid don't fail initialization
These are certainly bugs with one of the components, but if the situation
happens in the field the plugin needs to finish initialization to allow
upgrading to a fixed component.

We'll just fall back to the name in the quirk (Dell dock) in this case.
2018-10-14 17:23:38 -05: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
6abc2b9e0e trivial: Remove some pretty intense debugging that crept in 2018-10-12 09:36:12 +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
Richard Hughes
a3d5712b9f Allow setting the version format from a quirk entry 2018-10-11 07:54:01 +01:00
Richard Hughes
05cbb7245c Don't use AppStream-glib for version helpers
Refactor the imported version format code now we now longer need to stick to
the API mistakes of libappstream-glib.
2018-10-11 07:54:01 +01:00
Richard Hughes
d3d2c2c39f Don't use AppStream-glib for the GUID helpers
Long term we want to wean ourselves away from libappstream-glib.
2018-10-11 07:54:01 +01:00
Mario Limonciello
2dd731b2f0 Update all sub-devices for a composite update
This allows a frontend to call update on an individual device ID which will
cause a CAB file to be downloaded, but then also re-use the same CAB file to
try to process devices with a relationship as part of a transaction.
2018-10-10 11:24:27 -05:00
Mario Limonciello
dc48bec157 uefi: Move the TPM unlocking functionality from the Dell to UEFI plugin
This allows devices that have been registered to be correctly unlocked.
2018-10-10 14:30:49 +01:00
Mario Limonciello
4ba77a4fb9 Run the Dell plugin initialization after the UEFI plugin
This corrects the data->esp_path not being initialized due to UEFI
plugin's coldplug routine not having run yet.
2018-10-10 14:30:49 +01:00
Mario Limonciello
56a4d82203 trivial: Add ESP path into fu_uefi_device_to_string() 2018-10-10 14:30:49 +01:00
Richard Hughes
affc4ffde4 thunderbolt-power: Fix possible linker problem
The linker does not know which public symbol to call if a plugin calls it's own
symbol. Without this change one plugin could call into another plugin with the
wrong GsPluginData set -- which will probably explode in a ball of flames.
2018-10-10 14:29:20 +01:00
Mario Limonciello
55ab100334 trivial: nvme: Allow quirking the NVME write block size 2018-10-02 14:30:02 -05:00
Mario Limonciello
bae478f555 trivial: synapticsmst: clarify some error flows
As seen in the previous commit if ESM update failed some error prefixes
are not useful, clarify them.
2018-09-28 08:39:44 -05:00
Mario Limonciello
7cb2c1092c synapticsmst: Adjust panamera ESM update routine for some reported issues
Reported failure:
"failed to flash firmware: ESM update failed: ESM update failed:
 failed to write data: failed to write"

1) Add a sleep after erasing (matches other SPI write calls)
2) Erase & sleep between retries
2018-09-28 08:39:44 -05:00
Mario Limonciello
680d9dc228 trivial: synapticsmst: downgrade remote control retry statement to debug
This happens often enough and it does recover each time.
2018-09-28 08:39:44 -05:00
Mario Limonciello
845896c954 thunderbolt: Use replugging from the daemon (Closes: #730) 2018-09-26 07:56:12 -05:00
Marek Cernocky
c759834a05 Marked some CL options for translation 2018-09-24 16:18:48 +01:00
Mario Limonciello
6ed307c5fb trivial: uefi: Only set EFI variables on real systems
Avoids copying from a NULL pointer.
Caught via clang static analysis
2018-09-21 07:35:08 +01:00
Mario Limonciello
981ee65554 trivial: wacom: correct some errors caught by static analysis 2018-09-21 07:35:08 +01:00
Mario Limonciello
e58ad0bd77 trivial: dell: Assert true in self tests 2018-09-21 07:35:08 +01:00
Mario Limonciello
6f0a3b4d27 trivial: amt: correct a situation that might overwrite error 2018-09-21 07:35:08 +01:00
Mario Limonciello
2d9107d4dc trivial: amt: correct a potential lack of error 2018-09-21 07:35:08 +01:00
Richard Hughes
19ba35c844 nvme: Initialize the buffer before reading the contents
Fixes a complaint from valgrind.
2018-09-19 18:17:38 +01:00
Mario Limonciello
e6c324229a trivial: thunderbolt: don't reuse GError error_local in update function
It should only be used for the one (optionally) non-critical failure
in valiation failing.
2018-09-18 15:49:59 -05:00
Richard Hughes
e671c05771 trivial: Do not use AsProfile
The profiling data is of limited use, and better data can be obtained using
kcachegrind and massif. Additionally, the profile samples were the cause of the
small RSS growth over time, when in reality the data would only be shown when
the verbose switch is used at daemon startup.
2018-09-18 06:23:25 -05:00
Mario Limonciello
befe196777 trivial: nvme: Remove quirk for Hynix SSD
I've seen a firmware image that the version was "80001C0T" for this
disk and as such this is not a "quad" version number.
2018-09-18 10:40:48 +01:00
Richard Hughes
35a0a456e2 rts54hid: Add support for Realtek USB devices using vendor HID commands 2018-09-14 12:40:20 +01:00
Richard Hughes
161eee23ca rts54hub: Add support for Realtek USB devices using vendor HUB commands 2018-09-12 14:18:55 +01:00
Richard Hughes
ccd3b2a61f uefi: Check the amount of free space on the ESP
Fixes https://github.com/hughsie/fwupd/issues/670
2018-09-12 13:56:02 +01:00
Mario Limonciello
20447a00ae dell: Stop showing errors when no dock plugged in
Since it matches the Realtek dongle, shouldn't show this error:

failed to add USB device 0bda:8153: no dock detected

All the time when that dongle is plugged in
2018-09-11 18:59:05 +01:00
Richard Hughes
b08e7bc7aa trivial: Set a log domain for each file
This allows us to do something like:

G_MESSAGES_DEBUG=FuEngine ./src/fwupd
2018-09-11 18:59:05 +01:00
Richard Hughes
57bf9d9eed superio: Set the physical and logical IDs 2018-09-11 16:02:03 +01:00
Richard Hughes
543e47a5a9 trivial: Use a fixed GUID for superio
It seems the 'Notebook' vendor is padded with spaces in the DMI data, and so
the GUID changes now we're following the same stripping scheme of Windows 10.
2018-09-11 15:21:31 +01:00
Richard Hughes
1e6047e821 unifying: Remove some logically dead code
Found using Coverity, many thanks.
2018-09-10 16:56:44 +01:00
Richard Hughes
c41a89b50c unifying: Add a delay for the Texas chipset
It seems this chip needs a few ms to initialize before you can query the meminfo.
2018-09-10 16:28:49 +01:00
Richard Hughes
7772dcfc91 trivial: Ensure the daemon sends IDLE when firmware is updated 2018-09-10 16:12:12 +01:00
Richard Hughes
7c1eb83a2d unifying: Don't be too verbose when a unifying peripheral is unreachable 2018-09-10 12:20:42 +01:00
Richard Hughes
c249d109d4 trivial: Reduce some debugging verbosity 2018-09-10 12:19:02 +01:00
Richard Hughes
ebae396d0a udev: Do not add devices after a small delay
Now devices can have multiple GUIDs and do not share platform IDs there is
really no point waiting to add the device.

This allows us to remove a whole lot of code for this now-unused functionality.
2018-09-09 16:24:30 +01:00
Richard Hughes
a76f12dbfa trivial: Use fu_udev_device_set_physical_id() in udev plugin 2018-09-09 16:24:30 +01:00
Richard Hughes
1513585d21 trivial: Move the poll setup into common code
This is used by two device types in the unifying plugin, and soon to be one
other new plugin.
2018-09-09 13:43:18 +01:00
Mario Limonciello
4e0bb5d5c9 trivial: uefi: fix a signed vs unsigned issue
This started popping up in Arch CI:
../fwupd/plugins/uefi/fu-uefi-vars.c: In function ‘fu_uefi_vars_get_data’:
../fwupd/plugins/uefi/fu-uefi-vars.c:233:9: error: pointer targets in assignment from ‘gchar *’ {aka ‘char *’} to ‘guint8 *’ {aka ‘unsigned char *’} differ in signedness [-Werror=pointer-sign]
   *data = g_steal_pointer (&data_tmp);
         ^
2018-09-07 23:32:03 -05:00
Richard Hughes
9d3f791727 unifying: Use the new daemon-provided functionality
Until now, the unifying plugin was a 'special snowflake' and did things in very
different ways to the other plugins. Refactor each object to derive from either
FuUsbDevice or FuUdevDevice, and then remove LuDevice and the LuContext layers.
2018-09-07 16:22:38 +01:00
Richard Hughes
c125ec02ed Clarify what the platform ID actually is by renaming it
It wasn't hugely clear what the platform ID was actually meant to represent. In
some cases it was being used like a physical ID, in others it was a logical ID,
and in others it was both. In some cases it was even used as a sysfs path.

Clear up all the confusion by splitting the platform ID into two parts, an
optional *physical* ID to represent the electrical connection, and an optional
*logical* ID to disambiguate composite devices with the same physical ID.

Also create an explicit sysfs_path getter for FuUdevDevice to make this clear.

This allows WAIT_FOR_REPLUG to always work, rather than depending on the order
that the GUIDs were added, and that the kernel would always return the same
sysfs path (which it doesn't have to do, especially for hidraw devices).
2018-09-06 16:22:46 +01:00
Mario Limonciello
b900fe6b4e trivial: move all Dell dock related quirks into dell.quirk
These quirks aren't really needed if compiled without the Dell plugin
since they just set the parentage.
2018-09-05 08:10:52 -05:00
Mario Limonciello
5b9bf049a3 thunderbolt: Allow failing validation checks if device flag set
As an example use case earlier development versions of a Thunderbolt module
may contain DROM corresponding to one model ID and transition to another
model ID. Even if lying about the GUIDs supported by the device via a
quirk the Thunderbolt validation will fail because the device isn't
intended for that system.

This should only be used during development.
2018-09-05 08:03:28 -05:00
Richard Hughes
85f53a418c uefi: Add the Windows 10 device ID for compatibility 2018-09-05 05:59:43 -05:00
Richard Hughes
e39801f00d trivial: Fix some NULL/FALSE confusion 2018-09-04 20:37:17 +01:00
Richard Hughes
4cfe6b7002 nvme: Convert known version formats to semvers 2018-09-04 20:37:17 +01:00
Mario Limonciello
00fbfd7084 nvme: Drop need of --force flag to update
It's been test to flash succesfully on at least one device now.
2018-09-04 18:02:09 +01:00
Richard Hughes
cfc1768bf0 nvme: Always require a reboot after applying firmware
Although we can apply the firmware at runtime, the new firmware isn't going to
be running until the PCIe device has been re-enumerated.
2018-09-04 18:02:09 +01:00
Richard Hughes
2aa3360d46 trivial: Include appstream-glib.h in the main plugin header 2018-09-04 08:22:39 -05:00
Richard Hughes
4adf3bb52c trivial: Remove duplicate header includes 2018-09-04 08:22:39 -05:00
Richard Hughes
ff704414f6 Use superclassed versions of FuDevice when calling udev_added() and usb_added()
The daemon creates a baseclass of either FuUsbDevice or FuUdevDevice when the
devices are added or coldplugged to match the quirk database and to find out
what plugin to run.

This is proxied to plugins, but they are given the GUsbDevice or GUdevDevice and
the FuDevice is just thrown away. Most plugins either use a FuUsbDevice or
superclassed version like FuNvmeDevice and so we re-create the FuDevice, re-probe
the hardware, re-query the quirk database and then return this to the daemon.

In some cases, plugins actually probe the hardware three times (!) by creating
a FuUsbDevice to get the quirks, so that the plugin knows what kind of
superclass to create, which then itself probes the hardware again.

Passing the temporary FuDevice to the plugins means that the simplest ones can
just fu_plugin_device_add() the passed in object, or create a superclass and
incorporate the actual GUsbDevice and all the GUIDs.

This breaks internal plugin API but speeds up startup substantially and deletes
a lot of code.
2018-09-04 08:22:39 -05:00
Mario Limonciello
6cfd3f21f5 synapticsmst: Use fu_plugin_device_removed signal
If another plugin causes a Synaptics MST device to be removed, it
also needs to be removed from the cache to prevent problems when
the device is re-probed.
2018-09-04 10:00:52 +01:00
Mario Limonciello
0235b70463 trivial: synapticsmst: Correct the GUID for the WD15
The WD15 has a slightly different chip than the TB16/TB18 and this was
not transcribed properly.
2018-09-04 10:00:52 +01:00
Mario Limonciello
cc722dbb2c dell: Adjust for changes in daemon around USB removal
1) Switch to daemon provided vfuncs for USB
2) Set quirks so that the plugin only runs when Realtek NIC shows up
3) Rely on the daemon to process all removals by parent tree
2018-09-04 10:00:52 +01:00
Richard Hughes
1263446b23 trivial: Add a 'setup' vfunc that is used after open()
The setup() is the counterpart to probe(), the difference being the former needs
the device open and the latter does not.

This allows objects that derive from FuDevice, and use FuDeviceLocker to use
open() and close() without worrying about the performance implications of
probing the hardware, i.e. open() now simply opens a file or device.
2018-09-03 19:56:26 -05:00
Mario Limonciello
9ef5f741bc plugins: Set platform IDs for non-USB/non-UDEV plugins 2018-09-02 14:45:39 -05:00
Richard Hughes
3a8d532855 Allow the device list to take care of waiting for the device replug
This means that individual plugins do not have to manage thier own GUsbDevice
lifecycle and no longer have to call g_usb_context_wait_for_replug().
2018-08-31 16:41:40 +01:00
Richard Hughes
b1e49e8bdf unifying: Specify the runtime counterpart GUID
This shouldn't have an effect now, but is required when the device list starts
handling the replug, and it seems logically correct.
2018-08-31 09:58:40 +01:00
Richard Hughes
f27f8781cd unifying: Specify the plugin when in unifying mode
A small optimization, which avoids us querying all the USB plugins to find a
match each time.
2018-08-31 09:58:40 +01:00
Richard Hughes
838d91e4ed Add support for counterpart GUIDs
These are GUIDs that are related to the main device, but should not be used for
quirk matching. For instance, we might want to list the GUIDs for a bootloader
mode, but we don't want to import all the quirks for the bootloader when in the
runtime mode.
2018-08-30 16:55:41 +01:00
Richard Hughes
22367e7948 trivial: Refactor out functionality from a mega-method 2018-08-30 16:53:19 +01:00
Richard Hughes
97a3c9651b dfu: Set the quirk keys using the new vfunc 2018-08-29 14:27:57 +01:00
Richard Hughes
83d79e2e12 trivial: Move the DfuDevice class init to the bottom of the file 2018-08-29 14:27:57 +01:00
Mario Limonciello
812ac02bac synapticsmst: Allow using a custom flag 'skip-restart'
This flag is intended for devices that the restart procedure will
be performed as part of a transactional update by an external
controller.

None of the currently supported devices need this flag.
2018-08-29 07:55:27 +01:00
Mario Limonciello
102074eeea synapticsmst: Move GUID generation into quirks
This should allow trivially adding support for new
Tesla/Leaf/Panamera devices by a quirk.
2018-08-28 15:30:21 -05:00
Mario Limonciello
7555738827 synapticsmst: Set parentage for Dell WD15/TB16/TB18 docks through quirks 2018-08-28 18:30:00 +01:00
Mario Limonciello
926da40a88 thunderbolt: Move setting parentage of TB16 into quirks 2018-08-28 18:30:00 +01:00
Richard Hughes
39a5228331 trivial: Optimize adding DFU devices we know about
Explicitly mark known-supported devices in the quirk file so that we don't have
to call fu_plugin_usb_device_added() on all USB plugins.
2018-08-28 18:30:00 +01:00
Richard Hughes
a417d6c82a trivial: Allow setting the firmware min and max sizes from quirk files 2018-08-28 18:30:00 +01:00
Richard Hughes
a62618303f trivial: Set the quirks instance on the unifying context object
This allows us to match quirks on added GUIDs.
2018-08-28 18:30:00 +01:00
Richard Hughes
6dec401a67 Store the DeviceInstanceId as a GUID in the quirk database
This allows us to match non-DeviceID GUIDs, and also GUIDs we don't know how to
generate.

To make this fully useful, search for device quirks when GUIDs are added.
2018-08-28 18:30:00 +01:00
Mario Limonciello
c07ce5b488 thunderbolt-power: Use bolt force power API if available
This is new support for bolt supported by
https://gitlab.freedesktop.org/bolt/bolt/merge_requests/101
2018-08-28 09:47:56 -05:00
Richard Hughes
201d0cce54 trivial: Further simplify the fake DFU runtime logic 2018-08-28 15:33:43 +01:00
Richard Hughes
245b595f45 flashrom: Do not use no-longer-exported symbols
This was compiling and passing CI as the un-implemented legacy functionality
was still exported in the header.

Remove the prototypes for the missing symbols and fix up the plugin.
2018-08-28 15:26:34 +01:00
Richard Hughes
a0d7977968 dfu: Check the device state before assuming a fake runtime
If the device is not in APP_IDLE this doesn't make any sense.
2018-08-28 12:16:30 +01:00
Richard Hughes
04e321274a dfu: Never add a fake DFU runtime when targets already exist 2018-08-28 12:16:26 +01:00
Richard Hughes
73bf2337c1 trivial: Add fu_common_strtoull() as a shared function 2018-08-28 09:41:10 +01:00
Richard Hughes
c16554252b flashrom: Add a plugin for updating using the flashrom command line tool 2018-08-28 09:25:36 +01:00
Richard Hughes
e274f6654b superio: Add support for the W740SU
From Thomas Krug, many thanks.
2018-08-27 09:32:49 +01:00
Richard Hughes
6bf9879189 trivial: Use the BaseboardProduct DMI match for superio
This will match more EC hardware that uses a customized BIOS.
2018-08-27 09:32:05 +01:00
Richard Hughes
cdb01590e0 nvme: Add a new plugin to update NVMe hardware 2018-08-26 19:42:28 +01:00
Richard Hughes
dd5b43f63b udev: Use the new FuUdevDevice abstraction 2018-08-26 19:42:28 +01:00
Richard Hughes
95227a919d trivial: Move gudev to the core plugin deps 2018-08-26 19:38:58 +01:00
Richard Hughes
07ed2f00fa trivial: Use the new subclassed device methods
This just reduces our API surface a little, no behaviour change.
2018-08-24 21:48:59 +01:00
Richard Hughes
16e85aa8cf superio: Add a new plugin to enumerate EC firmware 2018-08-24 20:37:27 +01:00
Richard Hughes
6d794e2de6 trivial: Fix linking when using Ubuntu 18.04
Apparently the linker complains when dlopen'ing a plugin that's linked against
the libfwupdprivate library the daemon is using. This only seems to happen when
using distro packages...
2018-08-23 17:29:31 +01:00
Richard Hughes
29129ed4f4 uefi: Allow upgrades using a self-signed fwupd.efi binary
This doesn't require shim, so for this uncommon case add a configure option.

Fixes https://github.com/hughsie/fwupd/issues/669
2018-08-23 14:30:04 +01:00
Richard Hughes
9d72954cc1 trivial: Fix linking problems with the recent FuChunk move 2018-08-23 09:11:15 +01:00
Mario Limonciello
df60f69814 uefi: Add special handling for /efi (Closes #680)
This is a similar problem to #627 (which was fixed by 9bdbbc5ca).
Add special handling to allow writing to /efi/EFI
2018-08-22 16:43:20 -05:00
Thomas Hindoe Paaboel Andersen
a09f2212ec wacomhid: fix allow trunc flag check
The size check would always short circuit as
FU_WAC_DEVICE_FEATURE_FLAG_ALLOW_TRUNC == 0
is never true. The error message was thus never
written even if a difference was found.

With this patch we check if ALLOW_TRUNC is set in flags
instead, and only write the error if it is not.
2018-08-22 19:53:28 +01:00
Thomas Hindoe Paaboel Andersen
24c6eb758f unifying: remove duplicate && line 2018-08-22 19:53:28 +01:00
Richard Hughes
f22bd6e424 trivial: Move out the byte-array chunking to libfwupdprivate
Five plugins (soon to be 7) are linking to the DFU plugin just for this simple
segment-aware chunking functionality. Move this into common code to make
building simpler.
2018-08-22 15:14:12 +01:00
Richard Hughes
54879c6b9a altos: Use the new FuDevice:probe vfunc 2018-08-22 13:32:29 +01:00
Mario Limonciello
e3f581297f upower: Allow forcing installation even if no AC power is applied 2018-08-21 13:49:38 -05:00
Mario Limonciello
e3b1a3f558 Plumb through support to set FwupdInstallFlags for update_prepare/update_cleanup
This will be used by other future commits.
2018-08-21 13:49:38 -05:00
Richard Hughes
0971192575 trivial: Remove duplicate dependency() for json-glib 2018-08-21 09:43:08 +01:00
Mario Limonciello
25b49b6a6f uefi: Add 'autofs' to supported filesystems (Closes: #660)
systemd-automount will unmount the ESP when not in use for some
people.  This causes automatic ESP detection to fail.

In this case the ESP will need to be added to the conf file and
then this commit will let it keep working.
2018-08-20 07:44:17 -05:00
Mario Limonciello
f19222414c trivial: synapticsmst: Let device finalize close remaining fd 2018-08-13 11:11:27 -05:00
Mario Limonciello
9818692336 synapticsmst: Use FuDeviceLocker for all instances of remote control
This will make sure that remote control requests are always paired with
a close.
2018-08-13 11:11:27 -05:00
Mario Limonciello
8bba1ed2ef synapticsmst: Plumb error handling everywhere return codes are used
This makes the code more consistent, easier to debug and to reuse
in other plugins.
2018-08-13 11:11:27 -05:00
Mario Limonciello
32ac99c6dd trivial: synapticsmst: remove unnecessary includes 2018-08-13 11:11:27 -05:00
Richard Hughes
4721112601 uefi: Don't assert when run as non-root 2018-08-13 11:29:37 +01:00
Richard Hughes
b720df7471 unifying: Do not hold hidraw devices open forever
Just close the file descriptor if open when the device is removed.

Fixes https://github.com/hughsie/fwupd/issues/429
2018-08-13 09:53:22 +01:00
Richard Hughes
f3fc646148 unifying: Allow flashing devices in recovery mode
In version comparison, RQR24.xx_Bxxxx > RQR24.05_B0029 which is not what we
wanted at all.

See https://github.com/hughsie/fwupd/issues/655 for more details.
2018-08-13 08:57:57 +01:00
Mario Limonciello
2c1ed27c6c unifying: Hide raw communication behind the plugin verbose option 2018-08-12 11:00:49 +01:00
Mika Westerberg
511517ad88 thunderbolt: Use fu_plugin_thunderbolt_parse_version () everywhere
Currently we only parse the nvm_version attribute according fwupd
expectations when the device is initially added. Elsewhere we just use
the raw version as is which might be problematic as the version format
can change in the middle (for example "33.02" vs. "33.2"). Fix this so
that fu_plugin_thunderbolt_udev_get_version () always returns parsed
version string.

Update self tests accordingly to have "parsed" version to which we
compare against.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2018-08-12 10:58:16 +01:00
Mika Westerberg
0fd763cad4 thunderbolt: Use both locations for multi controller entry validation
Since the multi controller entry is part of the DROM and its place is
not fixed, it is possible (however unlikely) that the locations between
controller and the image are different. One scenario is that the new
image has typo in device or vendor name string fixed which could cause
the offset to be different.

To handle this case properly we need to read multi controller locations
of both controller and image separately, read their values and then
compare them against each other.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2018-08-12 10:58:16 +01:00
Mika Westerberg
314a8c76e5 thunderbolt: Add comment explaining return value of read_drom_entry_location ()
During review it was pointed out that the return value of
read_drom_entry_location () should be documented because it also returns
TRUE when an entry was not found from the DROM. Caller needs to look for
the location->offset in that case. Add a comment explaining this.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2018-08-12 10:58:16 +01:00
Mika Westerberg
28ac67f98f thunderbolt: Add flash size validation for Alpine Ridge
Alpine Ridge and Alpine Ridge LP also include flash size field so follow
Titan Ridge and validate those as well.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2018-08-12 10:58:16 +01:00
Mika Westerberg
1105683700 Revert "thunderbolt: Add more Titan Ridge IDs"
This reverts commit ed7acc7819.

As pointed out by @YehezkelShB during review the Titan Ridge IDs 0x15E8
and 0x15EB are for the NHI (the host controller). Windows SDK tool uses
them to keep track of different controllers but in Linux we don't need
them and can use the already existing bridge IDs.

There is no harm to have them listed but to avoid possible confusion in
future remove them.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2018-08-12 10:58:16 +01:00
Mario Limonciello
d4e443e8e2 synapticsmst: Fix alignment issues (Closes: #207) 2018-08-11 08:34:38 +01:00
Richard Hughes
4303ee976a unifying: Set a display name on the bootloader device 2018-08-10 14:50:43 +01:00
Mario Limonciello
7343ed4f33 synapticsmst: Run the plugin on non-dell systems
It generally won't be interesting on most systems, but if a supported
Dell USB device is connected to a non-dell system it can be updated
then.
2018-08-09 15:04:25 -05:00
Richard Hughes
14a8e40966 synapticsmst: Fix const warnings on Centos7 2018-08-09 16:59:04 +01:00
Richard Hughes
68f12ddb44 trivial: Do not define _GNU_SOURCE
It prevents coverity from running with gcc7.
2018-08-09 16:59:04 +01:00
Mario Limonciello
9bdbbc5ca8 uefi: Handle /boot properly (Closes: #627)
/boot is a special cased directory when using ProtectSystem=full

Due to this, it's marked read only even if it's listed in ReadWritePaths.

Allow folks to use this for their ESP, but they need to create /boot/EFI
in advance of starting fwupd.
2018-08-09 09:28:50 -05:00
Richard Hughes
55c424a7be synapticsmst: Add some missing failure handling code
If synapticsmst_common_rc_set_command() fails, return an error.

Found using Coverity.
2018-08-09 15:27:36 +01:00
Richard Hughes
e5e441908f uefi: Fix reporting errors when getting info about efivars
Found using Coverity.
2018-08-09 15:27:36 +01:00
Richard Hughes
c5a392ac8f synapticsmst: Remove some dead code
0x40000/64 has no remainder, and both numbers are defined constants.

Found using Coverity.
2018-08-09 15:27:36 +01:00
Richard Hughes
84960d9ba2 uefi: Fix up some trivial NULL/FALSE confusion 2018-08-09 14:21:23 +01:00
Richard Hughes
d2808801a6 trivial: Ensure all source files include config.h 2018-08-09 14:21:23 +01:00
Andrei Emeltchenko
3d73b1fad5 thunderbolt: Add validation for Titan Ridge devices
Titan Ridge devices may contain multiple controllers so we need to make
sure the supplied NVM image multi controller number matches the
controller in question. This is pretty much same than we had for Alpine
Ridge (X of N) but the difference is that this multi controller
information is found in DROM instead and the location is not fixed.

For this reason we implement a generic DROM entry parser and use it to
dynamically fill in correct location of multi controller entry based on
the controller active firmware.

In addition to that we add a check for the NVM flash size just like we
do for Titan Ridge host.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2018-08-09 14:18:55 +01:00
Mika Westerberg
bacb769c90 thunderbolt: Add native mode check for Titan Ridge host
Titan Ridge has same set of bits than Alpine Ridge telling whether the
Thunderbolt controller is in native or legacy mode. Add validation for
that.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2018-08-09 14:18:55 +01:00
Andrei Emeltchenko
e2f2b39514 thunderbolt: Add flash memory size validation check for Titan Ridge host
We need to make sure the Thunderbolt controller and the NVM image agree
with the expected flash memory size.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2018-08-09 14:18:55 +01:00
Andrei Emeltchenko
ed7acc7819 thunderbolt: Add more Titan Ridge IDs
Add 0x15E8 and 0x15EB Titan Ridge IDs that were previously missed.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2018-08-09 14:18:55 +01:00
Mika Westerberg
be616e4fe1 thunderbolt: Add validation for PD (power delivery) pointer
Thunderbolt devices typically have a discrete PD (power delivery)
controller and firmware for that controller is part of the NVM image. To
make sure the supplied NVM image provides the necessary PD firmware we
implement a check that compares existence of both PD pointers and fails
the validation if they differ.

Since the PD pointer is part of ARC_PARAMS section we need to populate
that section offset also for hosts (following DROM section).

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2018-08-09 14:18:55 +01:00
Mika Westerberg
dd7e7d97e8 thunderbolt: Increase retry timeout from 20 to 200 ms
At least with Titan Ridge devices 50 * 20 ms is way too short time
reading nvm_version so most of the time the daemon fails to figure out
the version of the just connected device. To make it work better with
Titan Ridge devices increase the timeout to 50 * 200 ms.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2018-08-09 14:18:55 +01:00
Mika Westerberg
b9ac0aa179 thunderbolt: Handle -EAGAIN from nvm_version elsewhere as well
There are other places in the plugin where we read nvm_version and it
can return -EAGAIN as well. To make sure it works consistenly accross
the plugin factor reading nvm_version to a helper function and use instead.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2018-08-09 14:18:55 +01:00
Richard Hughes
02c90d8a03 Remove the unused Emacs indenting headers from all source files
Fixes https://github.com/hughsie/fwupd/issues/636
2018-08-09 12:48:04 +01:00
Mario Limonciello
4ab6116ea0 uefi: Fix encoding the GUID into the capsule EFI variable
Before:

$ /usr/lib/fwupd/fwupdate --info
Information for the update status entry 0:
  Information Version: 7
  Firmware GUID: {00000000-0000-0000-0000-000000000000}
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  Capsule Flags: 0x00131072x
  Hardware Instance: 0
  Update Status: attempt-update
  Capsule File Path: /EFI/ubuntu/fw/fwupd-7ceaf7a8-0611-4480-9e30-64d8de420c7c.cap

After:

$ /usr/lib/fwupd/fwupdate --info
Information for the update status entry 0:
  Information Version: 7
  Firmware GUID: {7ceaf7a8-0611-4480-9e30-64d8de420c7c}
  Capsule Flags: 0x00131072x
  Hardware Instance: 0
  Update Status: attempt-update
  Capsule File Path: /EFI/ubuntu/fw/fwupd-7ceaf7a8-0611-4480-9e30-64d8de420c7c.cap
2018-08-09 08:14:04 +01:00
Mario Limonciello
fd99902ba8 uefi: Test for read only efivarfs (Closes: #625) 2018-08-09 08:11:40 +01:00
Richard Hughes
03aead9fe7 uefi: Check the filesystem type when checking the ESP 2018-08-08 20:35:04 +01:00
Richard Hughes
99b0b1be04 uefi: Check the user-supplied ESP path
Additionally, if the user specified something invalid, do not autodetect the
ESP but return with a journal error. It seems wrong to ignore what the user
explicitly set and perhaps do something dangerous.

Alternative to https://github.com/hughsie/fwupd/pull/599
2018-08-08 20:35:04 +01:00
Richard Hughes
34ea74fb2c uefi: Don't override _FORTIFY_SOURCE when building the EFI binary
Fixes https://github.com/hughsie/fwupd/issues/631
2018-08-08 20:16:53 +01:00
Mario Limonciello
faa9aaae0b trivial: synapticsmst: whitespace fixes 2018-08-06 00:34:42 -05:00
Mario Limonciello
dc5566a8db synapticsmst: Add support Synaptics Panamera chip
Panamera is a newer MST chip with a different flash layout and
multiple MCU running and accessing SPI/EEPROM simultaneously.

The firmware update process has to be run separately for each
SPI/EEPROM region.

Signed-off-by: Ryan Chang <ryan.chang@synaptics.com>
Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
2018-08-06 00:34:42 -05:00
Mario Limonciello
9a77f1c7ad synapticsmst: Rework Tesla/Leaf write process
- Split up `synapticsmst_device_write_firmware` to smaller more manageable
  chunks
- Use `FuDeviceLocker` to ensure that device is in a known state after
  update is complete (both in success or failure scenarios)
- Retry the write process up to 10 times in case of DPCD update failures
- Wait for flash clear to settle before writing to EEPROM/SPI
2018-08-06 00:34:42 -05:00
Mario Limonciello
0677d92b03 synapticsmst: If failing to enable remote control, disable and retry
Any previously failed runs or outside tools may adjust the remote
control register leaving the MST controller in a poor state.

If remote control enablement fails, try to disable and then re-enable
before aborting.
2018-08-06 00:34:42 -05:00
Mario Limonciello
2b4013562d synapticsmst: Add a reboot at end of flash cycle
This makes sure the MST hub jumps to the new active firmware after
completion.
2018-08-06 00:34:42 -05:00
Mario Limonciello
801cca6dc3 synapticsmst: remove support for setting dock type from another plugin
As seen by recent testing this is not working every time.
Since e6cda81f we're now building GUIDs that represent all the possibilities
for shared parts so it's not important to set dock type.
2018-08-06 00:34:42 -05:00
Mario Limonciello
d173901e79 synapticsmst: set parent devices for known docks without metadata 2018-08-06 00:34:42 -05:00
Gary Lin
b54f4706cb redfish: Add an option for CA verification
Since the Redfish service may use a self-signed certificate without
specifying the hostname, we could have the problem to verify such
certificate. A new option, CACheck, is introduced so that the user can
decide whether to ignore the CA verification or not.

Signed-off-by: Gary Lin <glin@suse.com>
2018-08-06 06:19:56 +01:00
Gary Lin
986c0ebe77 redfish: Check validity of the json objects
We might get a NULL json object.

Signed-off-by: Gary Lin <glin@suse.com>
2018-08-06 06:19:56 +01:00
Gary Lin
7f79aa9ea7 redfish: Upload the firmware blob through HttpPushUri
Create a multipart request to upload the firmware blob

Signed-off-by: Gary Lin <glin@suse.com>
2018-08-06 06:19:56 +01:00
Gary Lin
e5154d3ac3 redfish: Assume the device is updatable by default
The "Updateable" field may not be available.

Signed-off-by: Gary Lin <glin@suse.com>
2018-08-06 06:19:56 +01:00
Gary Lin
2e0e179298 redfish: Read options from redfish.conf
This commit adds redfish.conf to configure the IP and username/password
in case those are not available in SMBIOS and the EFI variables.

Since we can configure the IP in the conf file, the environment
variable, FWUPD_REDFISH_URI, is removed.

Signed-off-by: Gary Lin <glin@suse.com>
2018-08-06 06:19:56 +01:00
Gary Lin
27986ebf3e redfish: Generate IDs for redfish devices
Generate IDs for redfish devices and skip the devices without a
proper GUID.

Signed-off-by: Gary Lin <glin@suse.com>
2018-08-06 06:19:56 +01:00
Gary Lin
213bdf0637 redfish: Fetch the inventory collection
All inventory members are in the inventory collection.

Signed-off-by: Gary Lin <glin@suse.com>
2018-08-06 06:19:56 +01:00
Gary Lin
ce8aa4f84a redfish: Always use Basic Auth
Although SoupAuthManager can create a proper SoupAuth from the
WWW-Authenticate header, some redfish implementations didn't provide
such header, and we would get a 401 response in the end.

In DSP0266, it mentions that "HTTP BASIC authentication as defined by
RFC7235 shall be supported", so it shall be safe to use Basic Auth
by default.

Signed-off-by: Gary Lin <glin@suse.com>
2018-08-06 06:19:56 +01:00
Gary Lin
95ee874b2e redfish: Remove the json object of Links
UpdateService is in the root json object, so we don't need the Links
json object.

Signed-off-by: Gary Lin <glin@suse.com>
2018-08-06 06:19:56 +01:00
Gary Lin
701b46bbb2 redfish: Adjust the first redfish path
Change the redfish path from "/redfish/v1" to "/redfish/v1/" so that we
don't have to handle 308 redirect.

Signed-off-by: Gary Lin <glin@suse.com>
2018-08-06 06:19:56 +01:00
Gary Lin
3456238f0a redfish: Detect the HPE DeviceClass
DeviceClass in Oem/Hpe indicates the type of device in the HPE machine.
In case SoftwareId is absent, we can use DeviceClass instead.

Signed-off-by: Gary Lin <glin@suse.com>
2018-08-06 06:19:56 +01:00
Gary Lin
ad594286b2 redfish: Check "Updateable" and "SoftwareId" before using them
Although "Updateable" is defined in SoftwareInventory schema since
redfish v1.0.0, some machines(*) didn't support the field.

"SoftwareId" is defined in SoftwareInventory schema since v1.1.0, so
it probably isn't supported by every redfish machines.

(*) Try "/redfish/v1/UpdateService/FirmwareInventory/1/" with HPE DL380
    Gen 10 in https://ilorestfulapiexplorer.ext.hpe.com/

Signed-off-by: Gary Lin <glin@suse.com>
2018-08-06 06:19:56 +01:00
Mario Limonciello
7154f63397 trivial: Adjust syntax of varying copyright holders to unify across project 2018-08-05 08:22:23 -05:00
Mario Limonciello
ef6f1d7698 thunderbolt-power: Reset the timer on every TBT add uevent
This should help issues where the TBT controller takes a longer
time to run at cold boot startup.

Refer to https://bugzilla.kernel.org/show_bug.cgi?id=199631 for
more information.
2018-08-04 06:30:52 +01:00
Mario Limonciello
c4afb99620 trivial: thunderbolt: Don't re-use GErrors
In instances that we keep processing (such as warnings) these should
be dedicated error variables.
2018-08-01 06:36:07 +01:00
Mario Limonciello
25d51d1429 thunderbolt: Handle -EAGAIN from the kernel better when reading NVM (Closes #608)
Sometimes during initialization trying to read nvm_version will fail
with -EAGAIN.  In these instances keep trying to read.
2018-08-01 06:36:07 +01:00
Gary Lin
af71145c67 redfish: Fetch the inventory member correctly
In the Members array of FirmwareInventory or SoftwareInventory, each
element of the array only contains the URI to the member. For example:

  "Members":
  [
    {
      "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/1/"
    },
    {
      "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/2/"
    },
    {
      "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/3/"
    }
  ]

We have to get the real member object through the given URI.
2018-07-23 09:19:18 +01:00
Mario Limonciello
e6cda81f8d synapticsmst: Drop the dependency on Dell plugin to populate devices
If the dock information is available then show that in the device name
and restrict the GUIDs created.

If it's not available, then just create GUIDs for all known docks
2018-07-19 11:09:05 -05:00
Mario Limonciello
9fea78eb04 thunderbolt: show ErrorMessage when in safe mode 2018-07-18 16:32:26 -05:00
Mario Limonciello
0e00ed9b13 dell: Show error messages when capsule updates are disabled 2018-07-18 16:32:26 -05:00
Mario Limonciello
d1775bc026 uefi: Populate UpdateError with reasons that the plugin won't run
Previously if missing secure boot binaries, or invalid ESP was created the
plugin would just not load.

Now instead populate UpdateError and remove the updateble flag, but still show
the device in fwupdmgr and fwupdtool.
2018-07-17 14:30:27 +01:00
Mario Limonciello
6c41292bdb trivial: dell: drop blacklist of old systems
The minimum version of libsmbios is now 2.4, so don't include any
code blacklisting running on known failing systems.
2018-07-13 13:04:42 -05:00
Richard Hughes
70c9ab0288 Do not use /usr/bin/env in the shebang line
According to Fedora policy env must not be used as it could be overridden by
values in the PATH.

For details, https://fedoraproject.org/wiki/Packaging:Guidelines#Shebang_lines
2018-07-12 07:08:53 -05:00
Mario Limonciello
e6e2bf9d97 trivial: Allow EFI application path to come from a different root 2018-07-10 14:10:16 -05:00
Mario Limonciello
fd65ddda8a uefi: Rename all intermediary files and UEFI variables to prefix fwupd
fwupdate prefix is used by fwupdate and this will prevent clashes in case
its used instead.
2018-07-10 10:45:39 -05:00
Mario Limonciello
14fad85164 UEFI: Rename UEFI boot entry
1) Drop the path at the end of the title (\fwupdx64.efi)
2) Linux-Firmware-Updater to Linux Firmware Updater

The behavior that required the hacky name has been fixed since shim 10
which is in all the relevant distros now.
3322257e61
2018-07-10 10:45:39 -05:00
Mario Limonciello
44305bbde4 Rename EFI application from fwup<arch>.efi to fwupd<arch>.efi
This will prevent potentially clashing with fwupdate's EFI application
and allow them to remain co-installable.
2018-07-10 10:45:39 -05:00
Gary Lin
aeaf444835 redfish: Amend the retrieval of version
In the redfish emulator, "/redfish/v1" returns "ServiceVersion".
However, in the HPE API explorer(*), it returns "RedfishVersion".
This commit checks both member and print the one that is available.

(*) https://ilorestfulapiexplorer.ext.hpe.com/
2018-07-06 08:48:58 +01:00
Richard Hughes
ba103483fa redfish: Add a plugin that uses the Redfish API
Redfish is an open industry standard specification and schema that helps enable
simple and secure management of modern scalable platform hardware.

This has only ever been tested using an emulator and not on real hardware.
2018-06-29 20:17:45 +01:00
Mario Limonciello
097b5ac996 trivial: colorhug: fix a typo 2018-06-29 11:20:17 -05:00
Richard Hughes
a4c1530a69 thunderbolt: Fix the self tests when using -Db_sanitize=address 2018-06-28 20:55:37 +01:00
Richard Hughes
d6df0040c3 dfu: Fix a potential buffer overflow when applying a patch 2018-06-28 20:55:37 +01:00
Richard Hughes
572b7dbbd6 wacomhid: Fix the name of the self test executable 2018-06-28 19:26:22 +01:00
Richard Hughes
6bc7861c78 thunderbolt: Fix two memory leaks in the self test wrapper 2018-06-28 19:21:49 +01:00
Richard Hughes
f83adbab56 dell: Fix a tiny memory leak in the self test wrapper 2018-06-28 19:08:39 +01:00
Richard Hughes
d3f2878f19 synapticsmst: Fix several small memory leaks during enumeration 2018-06-28 18:16:24 +01:00
Richard Hughes
7ecf0164de uefi: Show the stored capsule filename in fwupdate 2018-06-28 15:51:11 +01:00
Richard Hughes
57df956d7b uefi: Add a libexec tool to mimic the original fwupdate CLI interface 2018-06-28 15:51:11 +01:00
Richard Hughes
04f8f267c5 trivial: Move the guessing of the ESP to common code 2018-06-28 15:51:11 +01:00
Richard Hughes
1ccf35a9e4 dell: Register devices with the uefi plugin rather than using libfwup directly
The device registration allows us to create a 'virtual' device that can accept
capsule updates that is not found in the ESRT.
2018-06-28 15:51:11 +01:00
Richard Hughes
dd23871698 uefi: Do not link against libfwup 2018-06-28 15:51:11 +01:00
Richard Hughes
a80f79cb4d uefi: Upload the firmware capsule without using libfwup 2018-06-28 15:51:11 +01:00
Richard Hughes
11d62030a3 uefi: Upload the historical result without using libfwup 2018-06-28 15:51:11 +01:00
Richard Hughes
b157d6eff9 uefi: Unlock the ESRT without using libfwup
This will be handled by a Dell-specific plugin instead.
2018-06-28 15:51:11 +01:00
Richard Hughes
cff980cfda uefi: Do not get the custom ESP location from libfwup 2018-06-28 15:51:11 +01:00
Richard Hughes
fb0e94857f uefi: Upload the UX bitmap without using libfwup 2018-06-28 15:51:11 +01:00
Richard Hughes
f3f4ca0320 uefi: Clear the device status without using libfwup 2018-06-28 15:51:11 +01:00
Richard Hughes
5585b00892 uefi: Access /sys/firmware/efi/efivars directly rather than using efivars
This allows us to redirect the functions for our self tests.
2018-06-28 15:51:11 +01:00
Mario Limonciello
cfc22a8b90 uefi: Detect the EFI system partition location at runtime
Check across a list of common EFI system partition locations for a mounted
location before starting fwupd.

This also will cause the plugin to not initialize if the EFI system partition
is not mounted.
2018-06-28 15:51:11 +01:00
Richard Hughes
ca5b4a7c97 uefi: Do not use libfwupdate to get the list of resources 2018-06-28 15:51:11 +01:00
Richard Hughes
ae47a347e0 uefi: Do not enable the plugin if efivars are not available
If the user is using some super-old kernel or broken system we want to return
early with an error rather than try to catch each way this can fail at runtime.
2018-06-28 15:51:11 +01:00
Richard Hughes
af5ec20004 uefi: Get the framebuffer without calling into libfwupdate 2018-06-28 15:51:11 +01:00
Richard Hughes
d7cdf9fb67 uefi: Use FuUefiBgrt from the plugin code 2018-06-28 15:51:11 +01:00
Richard Hughes
b1e0ab98d1 uefi: Import the fwupd.efi sources from the fwupdate project 2018-06-28 15:51:11 +01:00
Richard Hughes
62ba9a6f2f uefi: Check the flashes left before installing firmware 2018-06-28 15:51:11 +01:00
Richard Hughes
83390f6556 uefi: Add functionality to parse the EFI framebuffer size 2018-06-28 15:51:11 +01:00
Richard Hughes
f758e7b73a uefi: Add functionality to parse the BGRT table supported 2018-06-28 15:51:11 +01:00
Richard Hughes
a593447695 uefi: Add functionality to get a bitmap size 2018-06-28 15:51:11 +01:00
Richard Hughes
6b8235660b trivial: Move getting the secure boot status to the common file 2018-06-28 15:51:11 +01:00
Richard Hughes
2b1fcfd662 trivial: Use FuUefiDeviceStatus in preference to the defines from fwupdate 2018-06-28 15:51:11 +01:00
Richard Hughes
25509c01ce trivial: Use FuUefiDeviceKind in preference to the defines from fwupdate 2018-06-28 15:51:11 +01:00
Richard Hughes
0766857407 uefi: Read the ESRT entries from a directory in sysfs 2018-06-28 15:51:11 +01:00
Richard Hughes
bd80edd6be uefi: Add a device superclass to model each ESRT entry 2018-06-28 15:51:11 +01:00
Richard Hughes
1a1d135b13 trivial: Add UTF8 to UCS2 helpers from the fwupdate project 2018-06-28 15:51:11 +01:00
Richard Hughes
87fb9ff447 Change the quirk file structure to be more efficient
This pivots the data storage so that the group is used as the preconditon
and the key name is used as the parameter to change. This allows a more natural
data flow, where a new device needs one new group and a few few keys, rather
than multiple groups, each with one key.

This also allows us to remove the key globbing when matching the version format
which is often a source of confusion.

Whilst changing all the quirk files, change the key prefixes to be more familiar
to Windows users (e.g. Hwid -> Smbios, and FuUsbDevice -> DeviceInstanceId)
who have to use the same IDs in Windows Update.

This also allows us to pre-match the desired plugin, rather than calling the
probe() function on each plugin.
2018-06-28 13:32:30 +01:00
Richard Hughes
51345edf24 trivial: Rename the wacom quirk file
It's not Intuos specific at all.
2018-06-28 12:21:36 +01:00
Richard Hughes
63b173046d trivial: Rename the 'plugin-hints' functionality to 'custom-flags'
They will be used as actual flags in the future.
2018-06-28 12:07:13 +01:00
Richard Hughes
04d6965a14 ebitdo: Do not use bootloader commands after a successful flash and reboot
We need to remove the flag if the quirk is not present.

Fixes the cosmetic-but-scary-looking 'failed to send to device on ep 0x01: USB
error on device 2dc8:9001 : Input/output error'.

Fixes the other half of https://github.com/hughsie/fwupd/issues/565
2018-06-26 14:12:02 +01:00
Richard Hughes
d99190f626 wacomhid: Use the parent device name for sub-modules 2018-06-25 17:12:44 +01:00
Mario Limonciello
2d9bcf463f trivial: uefi: update the comment for _efi_get_variable_exists
The commit was merged in 0b3d29d2d8
which landed in efivar 35.
2018-06-24 06:53:24 +01:00
Richard Hughes
e48351e260 Set the alternate device ID, not the object itself
If the daemon either de-duplicates or replaces the object passed emitted from
device-added then the object set as the alternate may not be the same instance
as the daemon version. This causes weird things to happen.

To make this less fragile, specify the *ID* of the object that should be the
alternate device, which allows the daemon to do clever things, and then assign
the object from the ID as the last step.

Although fixing no bug, this makes implementing future functionality easier.
2018-06-22 13:28:27 +01:00
Richard Hughes
1107fa4c9a dell: Do not rely of the order the devices are added in the self tests
Get the TPM v2.0 and v1.2 devices explictly rather than assuming the non-alt
device is always added first. This has the side effect of making the tests
easier to read and means we can check the dock components more carefully.
2018-06-22 13:28:27 +01:00
Richard Hughes
8a6fdf8e18 dell: Don't crash when the alternate device has not been set
I don't think this is possible, but it's the right thing to do...
2018-06-22 13:28:27 +01:00
Richard Hughes
80b2c237c2 dell: Don't show '(null)' as the product name in the self tests 2018-06-22 13:28:27 +01:00
Richard Hughes
aa1ed47f06 wacomhid: Set the device status when erasing and writing firmware 2018-06-15 13:42:52 +01:00
Richard Hughes
0a7e590e22 wacomhid: Support more tablets
These are untested, but use the same HID protocol for flashing.
2018-06-11 09:04:39 +01:00
Richard Hughes
da08b5a048 colorhug: Remove the bootloader flag when re-booting in runtime mode
This needs to be fixed properly, and will be addressed in a future PR.
2018-06-07 12:10:22 +01:00
Mario Limonciello
dfb87c51c9 trivial: synapticsmst: drop efivar dep 2018-06-04 20:00:07 -05:00
Richard Hughes
872ec1b68f Add an experimental plugin to update some new Wacom tablets 2018-06-04 11:29:29 +01:00
Richard Hughes
0b522aef96 colorhug: Do not require libcolorhug to build
Requiring colord to be built before fwupd makes it hard to build packages.

The HID-based flashing protocol is stable and documented, so there's no need
to use an external library for this now.
2018-06-02 21:43:20 +01:00
Richard Hughes
7a874176ff trivial: Add a FuDevice flag to show the device is in bootloader mode
This is useful to present to the user using the command line, and means each
FuDevice-deriving object does not have to handle this.
2018-05-31 18:50:19 +01:00
Richard Hughes
4be17d1364 Add support for relocating various runtime paths
This allows a snap package to be easily built.

With much help from Mario Limonciello <mario.limonciello@dell.com>, many thanks.
2018-05-31 16:25:22 +01:00
Mario Limonciello
2fd28a374d trivial: uefi: Don't return NULL matching devices
Fixes: 988e73c414
2018-05-30 19:57:13 +01:00
Richard Hughes
c7c53ff03d trivial: Don't build the thunderbolt plugins based on udev presence
GUdev has to exist as a runtime dep, and this check for udev.pc will do nothing
helpful.
2018-05-30 14:12:12 +01:00
Richard Hughes
d8fdcd63b8 trivial: Move the HID defines to a shared location 2018-05-29 20:15:47 +01:00
Richard Hughes
fe221dc13d trivial: Fix up some NULL/FALSE confusion 2018-05-29 09:33:44 +01:00
Richard Hughes
caf379dc00 trivial: Convert FuAltosDevice to use G_DECLARE_FINAL_TYPE 2018-05-29 09:29:15 +01:00
Richard Hughes
9d5aa59ea6 trivial: Convert FuColorHugDevice to use G_DECLARE_FINAL_TYPE 2018-05-29 09:29:03 +01:00
Richard Hughes
4152990537 trivial: Convert FuEbitdoDevice to use G_DECLARE_FINAL_TYPE 2018-05-29 09:20:21 +01:00
Richard Hughes
699e9aa134 trivial: Convert FuRom to use G_DECLARE_FINAL_TYPE 2018-05-29 09:15:55 +01:00
Mario Limonciello
51308e648a Adjust all licensing to LGPL 2.1+ (Closes: #526) 2018-05-29 09:03:13 +01:00
Richard Hughes
15aa91bbd1 dfu: Add dfu_element_get_contents_chunk() 2018-05-25 12:10:28 +01:00
Richard Hughes
c5454860d4 dfu: Add dfu_utils_bytes_pad() trivial helper 2018-05-25 12:10:24 +01:00
Richard Hughes
7013c8c963 dfu: Make the SREC parser abort on a duplicate S0 header 2018-05-25 11:40:33 +01:00
Richard Hughes
38d064a7f3 dfu: Fix the SREC parser to correctly parse 32 bit address values 2018-05-25 11:40:12 +01:00
Richard Hughes
849d841ca9 dfu: Add a helper function for loading a DfuImage from a SREC file
Also, add the ability to start from a known device offset.
2018-05-23 21:06:24 +01:00
Richard Hughes
ba4ec1a25f trivial: Add helper function for chunking a GBytes 2018-05-23 20:47:33 +01:00
Richard Hughes
b04a8778e9 trivial: Add helper function for parsing a uint4 buffer 2018-05-23 20:47:26 +01:00
Richard Hughes
988e73c414 uefi: Search all available GUIDs when matching hardware
Using just the default GUID is fragile and might break if the GUIDs get added
in the 'wrong' order or if the GUID list is sorted.

Fixes https://github.com/hughsie/fwupd/issues/518
2018-05-19 23:07:40 +01:00
Mario Limonciello
dff281311c uefi: Set the alternate GUID for parenting later
Several places in the UEFI plugin operate on the default GUID rather
than iterating a list of GUIDs.  This is normally fine since UEFI
GUIDs are tied to the ESRT and normally one FuDevice shouldn't
have multiple GUIDs.

The alternate GUID was added to set parents accordingly but this
caused no CAB files to be able to install.

Fixes: cc664d7d (amt: Put the AMT device as a child under the system UEFI firmware)
2018-05-18 13:55:42 -05:00
Richard Hughes
e183ce2803 trivial: Remove the Unifying noinst tool 2018-05-18 10:26:51 +01:00
Richard Hughes
8658cd1ed2 trivial: Remove the AltOS noinst tool 2018-05-18 10:25:49 +01:00
Richard Hughes
83528ccded trivial: Remove the 8Bitdo noinst tool 2018-05-18 10:25:28 +01:00
Richard Hughes
17cd8bf9c3 trivial: Remove the CSR noinst tool 2018-05-18 10:25:04 +01:00
Richard Hughes
cf22df177f trivial: Remove the synapticsmst noinst tool 2018-05-18 10:24:38 +01:00
Richard Hughes
3e3ac27216 trivial: Add attach() and detach() vfuncs to FuDevice 2018-05-18 10:08:10 +01:00
Richard Hughes
0b8c1e7e92 ebitdo: Move the bootloader fallback instructions 2018-05-14 17:09:23 +01:00
Richard Hughes
c48d0cfa0c trivial: Add a read_firmware() vfunc to FuDevice 2018-05-14 17:07:20 +01:00
Richard Hughes
0a0483b2ce trivial: Add a write_firmware() vfunc to FuDevice 2018-05-14 17:07:20 +01:00
Mario Limonciello
86b3bcf8c9 ebitdo: Stop matching Nintendo Switch Pro VID/PID
Unfortuantely similar to ead5bf392 this is causing problems with
real Nintendo Switch controllers.
2018-05-07 09:22:12 -05:00
Mario Limonciello
1a60231658 trivial: synapticsmst: Recognize boardid 0x103
This board_id will be used in a new device in the future.
The enum and description will be updated later when more details
are ready.
2018-05-03 14:07:42 -05:00
Richard Hughes
185f4a4791 dfu: Allow parsing SREC files without the optional S5 record 2018-05-03 19:58:31 +01:00
Mario Limonciello
e9046e7207 synapticsmst: Set TB16/WD15 appropriately in topology 2018-05-03 08:07:04 +01:00
Mario Limonciello
542b97d19f dell: Set parents for Dell WD15/TB16 docks 2018-05-03 08:07:04 +01:00
Mario Limonciello
4a981d599c dell: Set TPM alternate mode device under regular mode 2018-05-03 08:07:04 +01:00
Richard Hughes
2c86dc0e9a unifying: Set known parent for unifying peripherals 2018-05-03 08:07:04 +01:00
Richard Hughes
cc664d7d36 amt: Put the AMT device as a child under the system UEFI firmware 2018-05-03 08:07:04 +01:00
Mario Limonciello
6e0663ae6c thunderbolt: Set known parent for Thunderbolt devices in Dell TB16 2018-05-03 08:07:04 +01:00
Richard Hughes
db211de617 dfu: Fix a potential DoS by limiting filling holes to 1MiB 2018-05-01 11:35:53 +01:00
Richard Hughes
d7a04f6e86 trivial: Add the generated SREC examples for easy fuzzing 2018-05-01 09:53:10 +01:00
Richard Hughes
7c6b94118c Add support for parsing Motorola S-record files 2018-05-01 09:16:19 +01:00
Richard Hughes
dd10a8f595 trivial: Fix a tiny memory leak when using 'dfu-tool dump' 2018-04-30 11:22:47 +01:00
Mario Limonciello
01b4f05072 uefi: Match the bootdir argument to fill in uefi.conf by default
This will make it more obvious which path it's defaulting to
2018-04-26 15:56:38 +01:00
Mario Limonciello
f669efcc74 amt: Fix a compilation error on Fedora
../plugins/amt/fu-plugin-amt.c: In function ‘mei_context_new’:
../plugins/amt/fu-plugin-amt.c:77:2: error: implicit declaration of function ‘memcpy’ [-Werror=implicit-function-declaration]
  memcpy (&ctx->guid, guid, sizeof(*guid));
  ^~~~~~
../plugins/amt/fu-plugin-amt.c:77:2: error: incompatible implicit declaration of built-in function ‘memcpy’ [-Werror]
../plugins/amt/fu-plugin-amt.c:77:2: note: include ‘<string.h>’ or provide a declaration of ‘memcpy’
../plugins/amt/fu-plugin-amt.c:78:2: error: implicit declaration of function ‘memset’ [-Werror=implicit-function-declaration]
  memset (&data, 0, sizeof(data));
  ^~~~~~
../plugins/amt/fu-plugin-amt.c:78:2: error: incompatible implicit declaration of built-in function ‘memset’ [-Werror]
../plugins/amt/fu-plugin-amt.c:78:2: note: include ‘<string.h>’ or provide a declaration of ‘memset’
../plugins/amt/fu-plugin-amt.c: In function ‘mei_recv_msg’:
../plugins/amt/fu-plugin-amt.c:117:9: error: implicit declaration of function ‘strerror’; did you mean ‘g_strerror’? [-Werror=implicit-function-declaration]
     rc, strerror(errno));
         ^~~~~~~~
         g_strerror
../plugins/amt/fu-plugin-amt.c:117:9: error: nested extern declaration of ‘strerror’ [-Werror=nested-externs]
../plugins/amt/fu-plugin-amt.c:116:39: error: format ‘%s’ expects argument of type ‘char *’, but argument 6 has type ‘int’ [-Werror=format=]
         "read failed with status %zd %s",
                                      ~^
                                      %d
     rc, strerror(errno));
         ~~~~~~~~~~~~~~~
../plugins/amt/fu-plugin-amt.c: In function ‘mei_send_msg’:
../plugins/amt/fu-plugin-amt.c:142:40: error: format ‘%s’ expects argument of type ‘char *’, but argument 6 has type ‘int’ [-Werror=format=]
         "write failed with status %zd %s",
                                       ~^
                                       %d
         written, strerror(errno));
                  ~~~~~~~~~~~~~~~
../plugins/amt/fu-plugin-amt.c: In function ‘amt_verify_code_versions’:
../plugins/amt/fu-plugin-amt.c:288:14: error: implicit declaration of function ‘strlen’ [-Werror=implicit-function-declaration]
       len != strlen(code_ver->versions[i].version.string))
              ^~~~~~
../plugins/amt/fu-plugin-amt.c:288:14: error: incompatible implicit declaration of built-in function ‘strlen’ [-Werror]
../plugins/amt/fu-plugin-amt.c:288:14: note: include ‘<string.h>’ or provide a declaration of ‘strlen’
../plugins/amt/fu-plugin-amt.c: In function ‘fu_plugin_amt_create_device’:
../plugins/amt/fu-plugin-amt.c:430:2: error: incompatible implicit declaration of built-in function ‘memcpy’ [-Werror]
  memcpy (&ver, response->data, sizeof(struct amt_code_versions));
  ^~~~~~
../plugins/amt/fu-plugin-amt.c:430:2: note: include ‘<string.h>’ or provide a declaration of ‘memcpy’
cc1: all warnings being treated as errors
2018-04-23 10:29:48 -05:00
Mario Limonciello
df860bbf4f Revert "trivial: Compile upower and test plugins with -O0 (Closes: #472)"
This reverts commit 6b0eb07886.

Per debian bug 896012 this is intentional behavior and a problem with
linitin.  An additional commit will be added to ignore this lintian
error.
2018-04-23 10:29:48 -05:00
Richard Hughes
34e0dab1f1 Add fu_plugin_add_compile_version()
This allows plugins to set and explicit build-time version. It also uses the
same AppStream component-ID scheme rather than the home-grown 'FooVersion' key.

Also, use the new runtime and compile-time versions in the report metadata.
Due to the key change we'll also need to update some LVFS rules.
2018-04-20 20:45:08 +01:00
Richard Hughes
b01b4869bb trivial: Use fu_plugin_add_runtime_version() in the Dell plugin 2018-04-20 20:45:08 +01:00
Richard Hughes
0eb123b986 Allow requiring specific versions of libraries for firmware updates
In some cases firmware can only be installed with an up to date GUsb (e.g. with
some STM-DFU hardware) or with a new version of fwupdate (e.g. any UEFI
UpdateCapsule without a capsule header).

We should be able to match against other software versions like we can the
fwupd version, e.g.

    <requires>
      <id compare="ge" version="0.9.2">org.freedesktop.fwupd</id>
      <id compare="ge" version="11">com.redhat.fwupdate</id>
    </requires>

Also, rather than checking each requirement we know about on the component,
check each requirement on the component about things we know. This ensures we
don't allow firmware to be installs that requires for instance fwupdate 22 when
the runtime version is only being added in fwupdate 12 and up.

This means the following is now an error that will fail to allow the firmware
to be installed:

    <requires>
      <firmware>doesnotexist</firmware>
      <some_future_tag>also_unknown</some_future_tag>
    </requires>

Also add a lot of self tests to test the various new failure modes.

Fixes https://github.com/hughsie/fwupd/issues/463
2018-04-20 16:19:05 +01:00
Mario Limonciello
16d72a23ba Update the fwupdate minimum version to 10.
Similar logic as previous commit with versions in Ubuntu and Fedora.
2018-04-20 09:05:17 -05:00
Mario Limonciello
ce2a8231ea Bump appstream-glib minimum version to 0.7.4
Ubuntu's LTS and Fedora's newest releases have it.  All CI targets
have it.
2018-04-20 09:05:17 -05:00
Richard Hughes
e598fc3447 trivial: Show the VID and PID when failing to add a USB device
Fixes https://github.com/hughsie/fwupd/issues/476
2018-04-19 20:15:09 +01:00
Mario Limonciello
6b0eb07886 trivial: Compile upower and test plugins with -O0 (Closes: #472)
This is a workaround for what looks like a compiler bug introduced
in Debian and Ubuntu gcc-7.

After the compiler bug is sorted in Debian testing it should be
reverted.
2018-04-18 20:11:43 +01:00
Mario Limonciello
ed1ac2a74b Enable CentOS 7 for CI
There are a lot of hacks here;
 * Pulling newer libappstream-glib from Fedora
 * Pulling a systemd backport
 * Manually installing pillow and pygobject
 * PKCS7 is turned off (gnutls is too old)
2018-04-18 10:25:22 -05:00
Mario Limonciello
a98df55d82 Disable -Wunused-function on clang builds (Closes #467)
GLib creates two static inline functions for paramaters that may
not be used that set off warnings in clang but not gcc.

Ignore these on clang builds everywhere that
G_DEFINE_AUTOPTR_CLEANUP_FUNC is used.
2018-04-17 10:10:43 +01:00
Mario Limonciello
7877769cad trivial: uefi: Remove an unused variable
Caught by clang:

../plugins/uefi/fu-plugin-uefi.c:311:32:  warning: unused variable 'iter' [-Wunused-variable]
	g_autoptr(fwup_resource_iter) iter = NULL;
2018-04-17 10:10:43 +01:00
Sjoerd Simons
8d38e0eae2 synapticsmst: Fix self test
A test run should really fail if it cannot find the test data, rather
then reporting success (thus masking that it never ran). Fix the test to
find it data (probably broken with the port to meson) and make it fail
if it cannot find its data.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
2018-04-12 20:31:30 -05:00
Sjoerd Simons
2bc6d0a38a synapticsmst: Improve error reporting
Rather then always assuming open() fails because of permission denied,
generate the GError code from the errno and add the related strerror to
the message. And ofcourse output the error message in debugging rather
then just ignoring it.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
2018-04-12 20:31:30 -05:00
Mario Limonciello
bf998580b8 thunderbolt-power: don't recoldplug (#457)
If recoldplug is called in the middle of a Thunderbolt firmware update it will
cause the Thunderbolt controller to be in the wrong state and make it appear
that the controller update failed.
2018-04-11 15:44:25 +01:00
Sjoerd Simons
9b0d1d4ca4 synapticsmst: Only enumerate Dell Docks if the type is known
The type of Dell dock gets used in the device GUID, so make that
mandatory for device enumeration to succeed. Only relying on the
synapticsmst plugin to be cold plugged after the dell plugin isn't
enough to ensure this.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
2018-04-10 15:57:59 -05:00
Sjoerd Simons
6761896b33 synapticsmst: Disable remote control on failure
When hitting a failure during enumerating make sure remote control mode
is disabled again.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
2018-04-10 15:57:59 -05:00
Sjoerd Simons
9f10cbacaf Set Dell dock metadata
On Dell dock devices set the FU_DEVICE_METADATA_DELL_DOCK_TYPE metadata
field which gets used by the synapticsmst plugin for recognizing dell
dock types.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
2018-04-10 15:57:59 -05:00
Mario Limonciello
1f10dc2ba7 thunderbolt-power: Prevent a theoretical critical warning on shutdown 2018-04-10 13:50:39 -05:00
Mario Limonciello
0bd8c74cc0 thunderbolt-power: If a timer is still running from coldplug, stop it (#457)
A race condition is hypothesized in the following scenario:

1. User starts up the system and fwupd doesn't start automatically.
2. User manually calls fwupdmgr install blah.cab (or fwupdmgr update really) which uses dbus activation to start fwupd systemd unit.
3. This runs coldplug on thunderbolt plugin, no devices found. Thunderbolt power runs coldplug routine.
  a. This sets forcepower with a timeout to turn off after 20 seconds.
  b. Coldplug exits.
4. update routine starts
  a. Thunderbolt plugin starts flash routine.
  b. Thunderbolt power plugin turns off force power in middle of flash routine.
  c. Issue described happens.
2018-04-10 13:50:39 -05:00
Richard Hughes
612a9c1684 trivial: Use the SSL www-less homepage URL everywhere
Fixes https://github.com/hughsie/fwupd/issues/440
2018-03-14 18:15:17 +00:00
Mario Limonciello
937299d72b uefi: Check that EFI system partition is mounted (Fixes: #436)
If the ESP isn't mounted it's possible that the update may look
succesful on the Linux side, but certain to fail later.
2018-03-14 09:54:04 +00:00
Richard Hughes
d3cc2255e9 Delete any old fwupdate capsules and efivars when launching fwupd
Fixes https://github.com/hughsie/fwupd/issues/431
2018-03-09 13:44:45 +00:00
Richard Hughes
3b6397e08a trivial: Check for the ESRT supported status in setup() 2018-03-09 13:44:45 +00:00
Richard Hughes
54dcd29b3c trivial: Use the new fwup_get_esp_mountpoint() call to log the defined ESP 2018-03-09 13:44:45 +00:00
Richard Hughes
d421da0597 trivial: Set the fwupdate esp mountpoint in setup() 2018-03-09 13:44:45 +00:00
Richard Hughes
afd05b88bd trivial: Load the custom ESP mountpoint from _setup() 2018-03-09 13:44:45 +00:00
Yehezkel Bernat
1ccd5d0bbd thunderbolt: correct handling of unknown devices
For unknown device only vendor and model IDs should be checked

Signed-off-by: Yehezkel Bernat <yehezkel.bernat@intel.com>
2018-03-09 13:08:56 +00:00
Andrei Emeltchenko
1e1789c7e6 plugins: thunderbolt: Add support for newest chips
Add support for the latest TR Thunderbolt controllers.
2018-03-09 18:53:45 +08:00
Richard Hughes
00a5f2cb30 trivial: Code style fixup 2018-03-02 14:52:42 +00:00
Richard Hughes
ab4c2d13a6 Remove support for RaspberryPi
This was never used, and the foundation want to stick to the existing 'just
download a new file' distribution method.
2018-03-01 18:45:47 +00:00
Mario Limonciello
2d8f2455c9 trivial: amt: Adjust to use [] instead of () in device name
This makes it more friendly to bash completion
2018-03-01 09:27:29 -06:00
Mario Limonciello
963dc4245c
uefi: Allow overriding ESP mount point via conf file (Fixes: #421) (#422)
* uefi: Allow overriding ESP mount point via conf file (Fixes: #421)
2018-02-27 14:26:58 -06:00
Ogier Bouvier
620d973fc2 unifying: fix signature writing and parsing for texas bootloader
Signed-off-by: Ogier Bouvier <obouvier@logitech.com>
2018-02-26 11:25:51 +00:00
Richard Hughes
efc5abe74e unifying: Fix a tiny memory leak on daemon unload 2018-02-23 13:08:58 +00:00
Mario Limonciello
02c469052f uefi: Report if UX capsule was supported in the report metadata 2018-02-19 15:06:29 -06:00
Richard Hughes
7b19f7db5b Use a longer timeout when powering back the Thunderbolt device
It seems 2s is not long enough on some hardware. We also get a much better
error message if the device fails to come back online.
2018-02-19 19:02:36 +00:00
Richard Hughes
fbf17e9c85 Allow devices to use the runtime version when in bootloader mode
Some devices like the Nitrokey use a generic DFU bootloader that reports a
version number unrelated to the version number of the runtime. Add a flag so
that we can set the correct version when switching plugins during detach and
attach.
2018-02-16 18:23:07 +00:00
Mario Limonciello
a076c81a07 uefi: Log the efivar library version too into the report 2018-02-13 19:19:11 +00:00
Mario Limonciello
b27639ae9f uefi: Save SecureBoot status into debug log and LVFS report 2018-02-13 09:18:30 -06:00
Richard Hughes
50aea367b7 thunderbolt: Enforce the thunderbolt version is xx.yy
Fixes: https://github.com/hughsie/fwupd/issues/387
2018-02-12 12:48:13 -06:00
Mario Limonciello
2c43d3e6e6 use help2man for dfu-tool too 2018-02-09 17:26:18 +00:00
Mario Limonciello
a31895b316 thunderbolt: Report safe mode and native in success/fail 2018-02-09 14:43:56 +00:00
Richard Hughes
65e44cac96 Always return useful information when calling GetResults()
Previous to having the history database we could only notify about firmware that
as installed using the uefi plugin, as that had a few system-wide API calls to
say 'this update failed' or 'this was the error'.

Now we have the local history database not only can we report more details about
the UEFI update (e.g. the old version number) but we can also offer the same
functionality for all other plugins.

Although this does rework how the data for GetResults() is populated, it does
make the FuEngine object quite a lot less confused.

It also fixes a warning in the fwupd plugin for gnome-software, which was
expecting the FwupdRelease to be populated for the FwupdDevice.
2018-02-07 10:20:19 +00:00
Mario Limonciello
1fc8553bb8 synapticsmst: Correct the callback for progress
4a036018 broke the callback progress by putting the wrong device type in.

23:34:11:0715 GLib-GObject invalid cast from 'SynapticsMSTDevice' to 'FuDevice'
23:34:11:0715 Fu  fu_device_set_progress: assertion 'FU_IS_DEVICE (device)' failed
2018-02-07 03:42:58 +00:00
Mario Limonciello
0ce0558ad7 synapticsmst: Fix crasher with MST flashing (#385)
b6f79556 caused the device ID strings to change, which synaptics
MST plugin was relying upon.

Update to use metadata instead to communicate this information.
2018-02-07 03:42:58 +00:00
Mario Limonciello
65a61c7b6f uefi: Record the fwupdate library version in metadata
When creating a regex for https://github.com/hughsie/lvfs-website/issues/43
it would be useful to have this
2018-02-06 19:29:28 +00:00
Mario Limonciello
e37cd0d8ce dell: Report Libsmbios version in metadata 2018-02-06 19:29:28 +00:00
Mario Limonciello
ead5bf3929 plugins/ebitdo: Stop matching DS4 controller VID/PID
This causes problems with the real DS4 controller.
Furthermore in MacOS mode fwupd doesn't actually work properly
anyhow (Closes #381)
2018-02-05 20:30:18 +00:00
Richard Hughes
d296a578ee trivial: Actually run the test plugin when doing the FuHistory tests
This does mean fixing up the version numbers. The idea is that we have a
virtual device that goes from 1.2.2->1.2.3 for an update, and 1.2.3->1.2.2 for
a downgrade.
2018-02-01 22:20:38 +00:00
Richard Hughes
15348f4e79 dfu: Fix detach with newer releases of libusb
In newer releases libusb has started returning LIBUSB_TRANSFER_ERROR (rather
than the arguably more correct LIBUSB_TRANSFER_STALL...) when the device is
removed before the control transfer has completed.
2018-02-01 10:08:59 +00:00
Mario Limonciello
9f932edaca trivial: dell: blacklist another system when used with older libsmbios
The reporter confirmed that changes in libmsbios 2.4.0 fix the problem
however.
Bug: https://bugs.launchpad.net/ubuntu/+source/libsmbios/+bug/1744782
2018-01-31 13:59:42 -06:00
Mario Limonciello
3780bb5c0d dell: Add a test for libsmbios version
This will be useful in the future for debugging crashes with known
problematic versions of libsmbios.

Also use this information to turn off the blacklist from previously
bad known combinations of libsmbios + certain systems
2018-01-27 22:48:36 -06:00
Richard Hughes
2de8f13b2c Allow each plugin to opt-in to the recoldplug action
Recoldplug is really not required for the USB based plugins, and we should
restrict this action to plugins that have inter-dependencies on each other.
2018-01-17 20:19:58 +00:00
Mario Limonciello
a50f985edc uefi: Add a device name for locked devices (#364)
These are devices that UEFI capsule support is turned off in BIOS
setup.  Unlocking them can turn UEFI capsule support
2018-01-15 19:32:18 +00:00
Mario Limonciello
a66ad15855 Fix UX capsule reference to the one in efivar
The work for this landed in what will turn into efivar 33.

Later down the road when efivar 33 is in most the major distros
this can be removed and a requirement set for efivar 33.
2018-01-12 09:08:18 +00:00
Richard Hughes
80b79bb9aa trivial: Allow plugins to add metadata to the uploaded reports 2018-01-11 21:28:22 +00:00
Richard Hughes
bc3a4e1f57 Store firmware update success and failure to a local database
Rename FuPending to FuHistory to better represent what the object is now doing.
Also, while we're here, switch to using SQLite prepared statements to avoid a
possible invalid read on i386 hardware.
2018-01-11 09:59:34 +00:00
Richard Hughes
b73e70b205 trivial: Use the shared fu_test_compare_lines() in the dfu plugin 2018-01-11 09:59:34 +00:00
Yehezkel Bernat
9157104100 thunderbolt: handle "native" mode
Kernel v4.15 added support for native enumeration of Thunderbolt
topology. The enumeration mode affects both the BIOS and TBT FW
operation so they must agree on it. Platforms may support both modes,
native and "legacy" (or "BIOS-assist").

This change makes sure the new image is compatible with the current
controller mode (otherwise the BIOS and TBT FW will not be alligned on
it at least until next boot) and also adds a new GUID generation logic
for a controller in "native" mode so LVFS could contain 2 images, one for
the "legacy" mode and one for "native".

Signed-off-by: Yehezkel Bernat <yehezkel.bernat@intel.com>
2018-01-08 16:28:23 +00:00
Mario Limonciello
3955e6e97d 8bitdo: Add initial SF30/SN30 Pro support (#350)
The SF30/SN30 pro support 4 different modes:
* Switch mode (START + Y)
This looks like a nintendo switch pro controller
* Xinput mode (START + X)
This looks like an XBOX 360 controller
* Dinput mode (START + B)
This looks like a more generic gamepad
* macOS mode (START + A)
This looks like a Sony DS4 controller

3 modes have had a difficult time enumerating in fwupd.
Switch mode:
* failed to add USB device: unexpected device response
Xinput mode:
* failed to add USB device: USB error on device 045e:028e : Pipe error [-9]
macOS mode:
* failed to add USB device: failed to send to device on ep 0x01: USB error on device 054c:05c4 : Input/output error [-1]

The only mode I've gotten a nearly full update flow working is Dinput
so far. After updating the controller comes back in switch mode.
2018-01-08 10:45:55 -05:00
Richard Hughes
516e7741e0 unifying: Fix a compile warning with the latest GLib 2018-01-02 20:37:41 +00:00
Richard Hughes
8a91f4ac1d trivial: Fix a flase-positive-ish harmless warning from Coverity 2017-12-22 14:24:28 +00:00
Richard Hughes
78ee1d0aaa trivial: Fix a with fu-csr-tool bug spotted by Coverity 2017-12-22 14:24:28 +00:00
Elton (Eddie) Hartman
ae538b829a Update README.md
Small typo
2017-12-22 09:04:09 +00:00
Richard Hughes
fe842231d2 unifying: Don't duplicate a device flag from FuDevice 2017-12-14 18:12:13 +00:00
Richard Hughes
d8a175ee90 unifying: Use the daemon replug timeouts 2017-12-14 18:09:04 +00:00
Mario Limonciello
736be7440f dell: block owned TPM updates (#339)
Also make it clearer what the logic is checking.
2017-12-13 12:13:33 -06:00
Richard Hughes
87067cc17d trivial: Add another AIAIAI product to the supported list 2017-12-11 16:53:43 +00:00
Richard Hughes
963cb45793 ebitdo: Use quirks rather than hardcoding a list of VIDs and PIDs
This means we can trivially support new devices in the future without compiling
any new code. This makes it easier to add support for new hardware for LTS
distros like RHEL.
2017-12-11 16:49:28 +00:00
Richard Hughes
d9e6cca414 csr: Add a new plugin to add support for CSR "Driverless DFU"
CSR is short for Cambridge Silicon Radio, which is a the OEM that makes most
of the bluetooth audio chips in vendor hardware. The hardware vendor can enable
or disable features on the CSR microcontroller depending on licensing options.

The hardware vendor can also use a custom USB descriptor, or just set a custom
PID. In the latter case we need to set the vendor and model to reality using
quirks.

This commit allows the user to update the firmware in the AIAIAI H05 wireless
headphones.
2017-12-11 10:47:18 +00:00
Richard Hughes
5060246526 trivial: Move the USB quirks from FuPlugin to FuUsbDevice
Also rename some general USB quirks that are not specific to any one plugin.
2017-12-11 10:47:18 +00:00
Richard Hughes
a29711c4a1 Move the FuQuirks reference down from DfuDevice to FuDevice 2017-12-11 10:47:18 +00:00
Richard Hughes
66268d0b31 unifying: Fix the string output format to match FuDevice 2017-12-10 14:50:58 +00:00
Richard Hughes
ae252cd83c trivial: Add some common functionality from reading and writing to a buffer 2017-12-08 20:07:09 +00:00
Richard Hughes
168b9faa80 Make LuDevice derive from FuDevice
This removes a lot of duplicated code.
2017-12-08 09:36:57 +00:00
Richard Hughes
024cc230ed Add fu_device_set_progress_full()
This allows the plugin to use the raw byte values as a progress counter without
first converting to a percentage.
2017-12-08 09:36:57 +00:00
Richard Hughes
99f33c7414 Move some common code down into LuDeviceBootloader
This is common API shared by the nordic and texas bootloaders.
2017-12-05 16:11:50 +00:00
Richard Hughes
7be4f138f3 trivial: Remove an unused Unifying vfunc 2017-12-05 14:36:48 +00:00
Richard Hughes
e755d6bb05 Add a more general quirk for adding GUIDs to devices
This replaces fwupd-dfu-alternate-vidpid which was only useful in the DFU plugin
and somewhat poorly defined.
2017-12-04 17:00:22 +00:00
Richard Hughes
524343ac63 trivial: Remove DfuMode
We can get all this information just from looking at the device state.
2017-12-04 17:00:22 +00:00
Richard Hughes
23135eb1c9 trivial: Remove the now-unused fu_plugin_set_status() 2017-12-04 17:00:22 +00:00
Richard Hughes
a2fff1f44e dfu: Remove DfuContext
Use the power of FuUsbDevice in DfuDevice to remove a lot of complicated code.
2017-12-04 17:00:22 +00:00
Richard Hughes
831bea1024 trivial: Manually call the initial DFU refresh to simplify the DfuDevice code 2017-12-04 17:00:22 +00:00
Richard Hughes
92ced1cfbf trivial: Move the detach and attach to the DFU client tool
This isn't used by the daemon and makes the DfuDevice client simpler.
2017-12-04 17:00:22 +00:00
Richard Hughes
01d152e2ef trivial: Make DfuDevice derive from GUsbDevice 2017-12-04 17:00:22 +00:00
Richard Hughes
1a16cc5e41 trivial: Remove the use of GCancellable in the dfu plugin
We're not using this, and we can simplify the code considerably now that the
library is not installed for external users.
2017-12-04 17:00:22 +00:00
Mario Limonciello
eb737f15f5 fix CI builds with -Werror
Switching to build in -werror in 4016c839a8
was not working properly.  Adjust the CI builds to use --werror instead.

Also while doing this, enable -werror in clang builds.
2017-11-30 16:42:26 -06:00
Richard Hughes
4a833f2dd2 trivial: Create the right kind of device in the steelseries plugin 2017-11-30 21:26:39 +00:00
Richard Hughes
4a036018f7 Set the progress and state on the FuDevice, not the FuPlugin
This makes more sense; we're updating the device, not the plugin itself.

This also means we don't need to funnel everything through callbacks like
GFileProgressCallback and we can also update the state without adding an
explicit callback to each derived device type.
2017-11-30 20:51:52 +00:00
Richard Hughes
e3bc2bcf88 steelseries: Use the new ->probe vfunc
Also, fix a silly typo found using Coverity.
2017-11-30 16:50:54 +00:00
Richard Hughes
bde01d5240 nitrokey: Use the new ->probe vfunc 2017-11-30 14:16:34 +00:00
Richard Hughes
9c1cc979ff ebitdo: Use the new ->probe vfunc 2017-11-30 14:16:34 +00:00
Richard Hughes
af5743101f colorhug: Use the new ->probe vfunc 2017-11-30 14:16:34 +00:00
Philip Withnall
8e2ca90509 udev: Fix a double-free bug
That GUdev function returns a const gchar*, not an allocated pointer, so
don’t try to autofree it. This would have caused a crash (I only
observed it as a compiler warning with
-Wincompatible-pointer-types-discards-qualifiers).

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-11-30 13:44:41 +00:00
Philip Withnall
a68a050f39 plugins: Remove various unused variables
Fix some compiler warnings to reduce the build noise.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-11-30 13:44:41 +00:00
Richard Hughes
2e9df07dc5 trivial: Remove the DFU-specific hardware tests
We have end-to-end installed tests using the daemon now.
2017-11-29 16:00:25 +00:00
Richard Hughes
245543849f unifying: Move the coldplug to the correct startup phase 2017-11-27 18:07:53 +00:00
Richard Hughes
061278b9ca amt: Move the coldplug to the correct startup phase 2017-11-27 18:07:53 +00:00
Richard Hughes
d0cff7caec Remove autoconf-isms from the meson configure options
See https://wiki.gnome.org/Initiatives/GnomeGoals/MesonPorting
2017-11-27 18:07:53 +00:00
Richard Hughes
3c1f326580 trivial: Remove dead code 2017-11-27 18:07:53 +00:00
Richard Hughes
43179f2887 steelseries: Release the interface if getting the version failed 2017-11-27 18:07:53 +00:00
Richard Hughes
8b15bd1223 usb: Get the descriptor GUID and version in FuUsbDevice 2017-11-27 18:07:53 +00:00
Richard Hughes
fda44315e6 Remove the USB fallback plugin
Nobody complained when this was turned off, and it isn't really useful.
2017-11-27 18:07:53 +00:00
Richard Hughes
46e993d03e trivial: Fix a warning from clang 2017-11-27 18:07:53 +00:00
Richard Hughes
ca0bc0adf7 udev: Don't delimit the platform ID now it is hashed anyway 2017-11-27 18:07:53 +00:00
Richard Hughes
82c63d3d65 udev: Don't register for USB events to later ignore them 2017-11-27 18:07:53 +00:00
Richard Hughes
3e1da8f9b8 Do not hardcode the device name when not required
If we're getting it from a USB descriptor we don't also need to hardcode it.
2017-11-27 18:07:53 +00:00
Richard Hughes
104f651132 Add a fu_plugin_usb_device_added() dedicated vfunc
This saves all the USB plugins from connecting to the context and managing the
device lifecycle and allows devices that uses FuUsbDevice to be removed
automatically.

This makes supported plugins *much* smaller indeed.
2017-11-24 16:13:44 +00:00
Richard Hughes
52736c19e1 nitrokey: Allow transitioning from runtime to DFU mode
This allows the Nitrokey (and indeed, any device that has to use two plugins)
to be updated using fwupd and gnome-software.
2017-11-24 14:42:27 +00:00
Richard Hughes
51bc3e3d47 Add devices in DFU mode
By filtering out the devices not in runtime we have two problems:

* We can't use fwupdmgr to 'fix' any devices that failed to flash and are
  stuck in bootloader mode

* We can't transition from a runtime-less FuDevice to a DFU-capable FuDevice.

This allows the Nitrokey to be updated using fwupd.
2017-11-24 14:42:27 +00:00
Richard Hughes
d7f1bf55de ebitdo: Use the new delayed removal functionality to remove complexity
The engine keeps track of the runtime GUID, so we don't have to anymore.
2017-11-24 14:42:27 +00:00
Richard Hughes
29a524fdfb Add FuUsbDevice helper object
This allows us to move a lot of duplicated functionality out of each plugin.
2017-11-24 14:04:51 +00:00
Richard Hughes
0415811740 ebitdo: Use fu_plugin_update_reload() to get the new version number 2017-11-24 13:44:33 +00:00
Richard Hughes
ec6456e785 colorhug: Make a much better plugin
The ColorHug plugin was the very first plugin for fwupd, and it's not been
ported to use all the various helpers used in other USB plugins. It shows.

This gets rid of a lot of complexity and makes the plugin more reliable.
2017-11-24 10:48:29 +00:00
Richard Hughes
4713f23f7f dfu: Fix attaching AVR32 devices like the XMEGA
Also, add a self test that uses the XMEGA A3BU XPLAINED board, see
https://github.com/hughsie/fwupd-test-firmware/tree/master/AVR/XMEGA-A3BU-XPLAINED-1.23
for more details about how to build the bootloader and firmware.
2017-11-23 18:48:03 +00:00
Richard Hughes
44e8f5a906 colorhug: Fix detaching devices since switching to SHA1 device-IDs 2017-11-23 11:02:30 +00:00
Richard Hughes
af652da167 dfu: Ignore an EP STALL when detaching
Some devices just detach without completing the transaction.
2017-11-23 10:46:26 +00:00
Richard Hughes
68327f3abd trivial: Add some missing debug information when detaching 2017-11-23 10:45:54 +00:00
Richard Hughes
aa6a56205f dfu: Assume DFU version is 1.1 if unspecified 2017-11-21 15:55:29 +00:00
Mario Limonciello
f3269994a6 thunderbolt: ignore useless thunderbolt device types
Kernel 4.15 adds support for Thunderbolt P2P devices via
CONFIG_THUNDERBOLT_NET.  When turned on and activated fwupd will
show an empty device representing the IP connection between machines.

These device types aren't useful in fwupd and should be filtered.

Suggested-by: Mika Westerberg <mika.westerberg@intel.com>
Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
2017-11-20 16:41:47 -06:00
Richard Hughes
3bc2f3bbb6 trivial: Parse the IHEX record types 02 and 03
Although we don't quite do the right thing, we only need to typically work out
the start offset of the firmware. This fixes 'dfu-tool dump foo.hex' for files
produced for the ATMEL ATXMEGA architechure.
2017-11-18 11:06:38 +00:00
Jan Tojnar
cc9f934787 build: Refactor directory selection
Previously, the various install paths were obtained using get_option
as needed.

This patch unifies the directory selection inside the top-level meson
file as requested in https://github.com/hughsie/colord/pull/62.
2017-11-17 17:11:51 +00:00
Richard Hughes
352ba1b833 dfu: Add support for the original AVR DFU protocol
This allows us to flash hardware like the Retrode and other devices using chips
like the AT90USB1287.

The test files can be re-generated using the sample code found here:
https://github.com/hughsie/fwupd-test-firmware and are designed
to be used on the AT90USBKEY2 development board.
2017-11-16 15:30:30 +00:00
Richard Hughes
c83ebad885 dfu: Ensure the progress callbacks are connected for all devices
This ensures the device always reports the correct status always (but just once)
to the client.
2017-11-16 15:30:30 +00:00
Richard Hughes
ee46fb6d09 dfu: Allow wildcarded VIDs and PIDs when loading from a .cab file
The logic is that this will have been matched using the GUID before it gets to
the writing stage.
2017-11-16 15:30:30 +00:00
Richard Hughes
fd4697188a dfu: Invalidate the DFU mode, state and status when replugging 2017-11-16 15:30:30 +00:00
Richard Hughes
5826838987 trivial: Fix the comments in the DFU quirk file to be more helpful 2017-11-16 15:30:30 +00:00
Richard Hughes
b6f79556f1 Use a SHA1 hash for the internal DeviceID
It's actually less scary to see a SHA1 hash than it is to see a path like
/sys/devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1.2. It's also way easier to
copy and paste into the various fwupdmgr command that require a device ID and
also means we can match a partial prefix much like git allows.

If we also move to a model where plugins can be changed during different stages
of the update (e.g. during detach) then the device might change connection type
and then the sysfs path not only becomes difficult to paste, but incorrect.

Session software doesn't care about the format of the device ID (it is supposed
to be an implementation detail) and so there's no API or ABI break here. A few
plugins also needed to be ported, but nothing too worrying.
2017-11-16 07:18:36 +00:00
Mario Limonciello
2e52dc2242 dell: disable plugin if libsmbios fails 2017-11-14 13:20:59 -06:00
Mario Limonciello
20e856ccbe dell: activate libsmbios_c debugging output with --plugin-verbose=dell 2017-11-14 12:00:49 -06:00
Richard Hughes
c17f0f368e ebitdo: Fix a possible buffer overflow when debugging 2017-11-14 16:08:14 +00:00
Richard Hughes
49fafec020 Set environment variables to allow easy per-plugin debugging
This allows end-users testing a specific plugin to start fwupd with an extra
command line parameter, e.g. `--plugin-verbose=unifying` to output a lot of
debugging information to the console for that specific plugin.

This replaces a lot of ad-hoc environment variables with different naming
conventions.
2017-11-14 14:22:02 +00:00
Richard Hughes
2adee9082b dfu: Use the new update_detach() and update_attach() vfuncs 2017-11-14 10:49:43 +00:00
Richard Hughes
09ff4c905d colorhug: Use the new update_detach() and update_attach() vfuncs 2017-11-14 10:49:43 +00:00
Richard Hughes
37e124f3da unifying: Use the new update_detach() and update_attach() vfuncs 2017-11-14 10:49:43 +00:00
Richard Hughes
d81249465d trivial: Fix the case of some debugging statements 2017-11-14 10:19:02 +00:00
Richard Hughes
3979ba5039 nitrokey: Fix a buffer overrun spotted by Coverity
This only happens when debugging, so it was not spotted by valgrind.
2017-11-13 21:59:57 +00:00
Richard Hughes
9b0d228ed9 Add a nitrokey plugin
This gets the firmware version from the Nitrokey storage device but does not
enable the firmware upgrade mechanism.
2017-11-13 16:25:46 +00:00
Richard Hughes
31830aaea3 dfu: Ensure the mode is set correctly for fake runtimes 2017-11-13 16:01:57 +00:00
Richard Hughes
959e3d8a76 dfu: Add quirk for AT32UC3B1256 as used in the RubberDucky 2017-11-13 14:25:02 +00:00
Richard Hughes
ff3efe77b4 trivial: Fix the DFU self tests when the ColorHug+ is connected 2017-11-13 14:07:50 +00:00
Richard Hughes
9e59fa4d16 ebitdo: Rename FuDeviceEbitdo to FuEbitdoDevice
This is what most programmers expect and makes it clear what it derives.
2017-11-13 14:03:02 +00:00
Richard Hughes
a142bb15b6 altos: Rename FuDeviceAltos to FuAltosDevice
This is what most programmers expect and makes it clear what it derives.
2017-11-13 13:58:37 +00:00
Richard Hughes
ba6391e98d colorhug: Do not save the firmware blob in the device state
It's only needed for fu_plugin_update() so there's no point at all.
2017-11-11 21:58:17 +00:00
Richard Hughes
28abc4f60d colorhug: Do not use two prefixes for trivial log messages
G_LOG_DOMAIN is set to something ColorHug-specific already.
2017-11-11 21:58:17 +00:00
Richard Hughes
85dbcbf534 dfu: Add trivial helpers to get the current vid/pid/release 2017-11-11 21:06:18 +00:00
Richard Hughes
f1d6f6cfc3 trivial: Unconstify an allocated variable to avoid a GCC warning 2017-11-10 14:31:22 +00:00
Richard Hughes
37906f6aae trivial: Fix NULL/FALSE confusion in the dfu plugin 2017-11-09 14:32:25 +00:00
Richard Hughes
69fcb73a74 dfu: Fix a trivial unused variable spotted by clang 2017-11-09 12:16:12 +00:00
Richard Hughes
a14d771476 dell: Fix a trivial warning spotted by clang 2017-11-09 12:15:55 +00:00
Richard Hughes
ff372acb1d ebitdo: Wait for the device to come back after performing update
This means we can verify the firmware version that was flashed, and makes the
code perform in the same way as the DFU and ColorHug plugins.
2017-11-08 11:02:38 +00:00
Richard Hughes
da8f476aa2 ebitdo: Fix a error prefix string 2017-11-08 11:02:38 +00:00
Richard Hughes
876e5e0c35 ebitdo: Fix a double-unref when updating the device
This can cause the daemon to emit a critical warning...
2017-11-08 11:02:38 +00:00
Mario Limonciello
7f3bfc9d99 dell: catch invalid dock component requests
Test if g_strrstr returns NULL, as this means the string was
modified and other requests predicated on this will fail miserably.
2017-11-07 09:46:36 -06:00
Mario Limonciello
3164784d9e dell: fix crashes when enumerating with dock connected but UEFI capsule off
Crashes will happen when UEFI capsule is turned off due to fwupdate
trying to do a SMI request that invalidates the buffer used by fwupd.

This is due to both fwupdate and fwupd using libsmbios in the same process.
Fixes: https://bugs.launchpad.net/ubuntu/+source/fwupd/+bug/1726367
2017-11-07 09:46:36 -06:00
Richard Hughes
d25e2d543a trivial: Add some self tests that use the Atmel Xplained boards in DFU mode
This does mean the tests have to be run as root to work, but they are just
skipped if run as a user.
2017-11-07 12:40:25 +00:00
Richard Hughes
21852821c5 dfu: Add ChipID quirks for various XMEGA parts
This also adds an *almost* throw-away python script to import the chip-ids from
the default conf file from the avrdude project. I've imported it here in case we
have to start caring about different page sizes or application offsets.
2017-11-07 12:40:25 +00:00
Richard Hughes
8517464eac dfu: Use a 24-byte chip ID for XMEGA parts so we match signature values with dfu-programmer 2017-11-07 12:40:25 +00:00
Richard Hughes
d44a5ee56d dfu: Add support for XMEGA chips
Notably, bootloaders for this class of device export an incorrect DFU interface.

Additionally, allow setting the buffer size for the UPLOAD to a larger size
than the defined device transfer size, which allows us to return the full
packet from the larger XMEGA devices.
2017-11-07 12:40:25 +00:00
Richard Hughes
ac9fa21eda dfu: Use a GError chain to properly report parsing failures 2017-11-07 12:40:25 +00:00
Richard Hughes
bdb6d7027a dfu: Allow setting a specific DFU version for hardware
Ignoring the warning is not good enough when we're setting policy based on the
specific version. Use the new quirk functionality to do this easily, which
also allows us to remove one more thing in the quirk mega-bitfield.
2017-11-07 12:40:25 +00:00
Richard Hughes
387017c331 trivial: Don't show (null) in the UI when the DFU status is unknown 2017-11-07 12:40:25 +00:00
Richard Hughes
a1c09e1b16 dfu: Fix a potential divide by zero issue
If page_sz == 0, which is supported, then we try to take the modulus of it
which is undefined behaviour and can cause a division by zero crash.

Found using Coverity.
2017-11-07 09:41:07 +00:00
Richard Hughes
8a0ec158bd dfu: Return failure when getting device status fails 2017-11-06 20:10:26 +00:00
Richard Hughes
79d08a327b trivial: Use a #define value for signature reads 2017-11-06 12:56:38 +00:00
Richard Hughes
674ed347d2 dfu: Use FuQuirk to map the chip ID to the AVR32 UM0424 alt-name 2017-11-02 19:08:51 +00:00
Richard Hughes
adeefcd4e0 dfu: Use FuQuirk to encode the Jabra magic packet contents
This allows us to remove the Jabra-specific quirk entry in the device bitfield,
and more importantly allows us to support some more Jabra devices in the future
without code changes.
2017-11-02 19:08:51 +00:00
Richard Hughes
6a32b92ef8 dfu: Move some code to allow re-use 2017-11-02 19:08:51 +00:00
Richard Hughes
74a80ccc50 dell: Use the new quirk infrastructure for version numbers 2017-11-02 19:08:51 +00:00
Richard Hughes
24c452297d dfu: Use the FuQuirk infrastructure to move the quirks out of the code
This is slightly more verbose than desired as we also have to include the quirk
information when running the dfu-tool, which does not have an already set-up
FuQuirks object as it has no plugin.
2017-11-02 19:08:51 +00:00
Richard Hughes
78c1e6c009 dfu: Correctly output Intel HEX files with > 16bit offset addresses
Also, fix the checksum to actually produce valid files...
2017-10-31 18:30:05 +00:00
Richard Hughes
6e72343851 dfu: Allow specifying the output file type for 'dfu-tool read'
Guess the file type if it is not explicitly specified.
2017-10-31 18:30:05 +00:00
Richard Hughes
c4e9b08f41 dfu: Remove the CanDownload and CanUpload attribute when required
When the AVR device is not recognised as a supported part we can't read or
write the firmware from the chip.
2017-10-31 18:30:05 +00:00
Richard Hughes
3e1e8227be dfu: Add support for one type of AVR32 device
Currently the only supported model is the AT32UC3A3256S, more to come...
2017-10-31 18:30:05 +00:00
Richard Hughes
d49f64f700 dfu: Split out the STM functionality to a new file 2017-10-31 18:30:05 +00:00
Richard Hughes
fc27df7ceb dfu: Add the ability to dump the raw DFU packets 2017-10-31 18:30:05 +00:00
Richard Hughes
c314b89316 dfu: Add DfuChunked
This allows us to segment a buffer taking into account page borders and maximum
transfer sizes.
2017-10-31 18:30:05 +00:00
Richard Hughes
9acf8cd16f dfu: Set up the DfuTarget when opening the DfuDevice
In the future we'll use this to set vendor-specific quirks.
2017-10-31 18:30:05 +00:00
Richard Hughes
1b577710c5 dfu: Ignore the not-supported error code when opening the DfuDevice
This allows us to fail optional things and still show useful output in:

$ dfu-tool list
2017-10-31 18:30:05 +00:00
Richard Hughes
97520bd583 dfu: Add support for a chip ID
This allows us to show the user something they can include in a bug report.
2017-10-31 18:30:05 +00:00
Richard Hughes
f3e27065e6 dfu: Support devices with truncated DFU interface data
We can assume they support DFU 1.1. Fixes flashing the Jabra Speak 410.
2017-10-30 13:37:11 +00:00
Richard Hughes
54c7c0cc9f dfu: Only detach the HID interface when updating Jabra devices 2017-10-30 13:37:11 +00:00
Richard Hughes
ac32f71a00 trivial: Remove the GObjectClass padding for private objects 2017-10-28 15:18:35 +01:00
Richard Hughes
66513c3b9d dfu: Don't show a debug message when the download timeout is zero 2017-10-26 20:49:10 +01:00
Richard Hughes
181f516114 dfu: Guess the transfer size if it is not specified 2017-10-26 20:49:10 +01:00
Richard Hughes
55d5fb1ab0 dfu: Remove redundant dfu_device_has_dfuse_support() 2017-10-26 20:49:10 +01:00
Richard Hughes
3dd875f975 dfu: Add some utility functions to dfu-common.h 2017-10-26 20:49:10 +01:00
Richard Hughes
3218de03b9 dfu: Add dfu_target_get_sector_default()
This allows us to get the first sector defined for the target.
2017-10-26 20:49:10 +01:00
Richard Hughes
1b1f9d7b6a dfu: Support the IHEX record type 0x05 2017-10-26 08:48:20 +01:00
Kelly Anderson
c015642803 fix mispelled redesign 2017-10-19 22:35:17 -05:00
Mario Limonciello
fecfe3b8db thunderbolt: move test for mock environment (Closes #280)
umockdev 0.9.4 changed how to test for running in mock and this
causes the assumptions on mock testing at init to fail.

Move the test for this to after the environment has been set up.
2017-10-19 08:40:08 -05:00
Mario Limonciello
bd0f3f8920 rename fu-dell-common to fu-dell-smi
Since it's not being used by other plugins, make it represent
what it really does now.
2017-10-18 08:27:54 -05:00
Mario Limonciello
7af941fee4 synaptics: drop hard dependency on dell plugin and libsmbios
Rather than have a hard dependency use metadata and internal DMI
to communicate the relevant details
2017-10-18 08:27:38 -05:00
Mario Limonciello
ed538c2b84 drop fu_dell_get_cable_type, unused 2017-10-18 08:22:43 -05:00
Richard Hughes
37ca220f9b dfu: Set the vendor ID to the runtime USB VID 2017-10-14 10:22:23 +01:00
Richard Hughes
61222fcb60 dfu: Add the various device quirks for the Jabra Speak devices
With much help from Niels Skou Olsen <nolsen@jabra.com>, many thanks.
2017-10-13 17:24:35 +01:00
Richard Hughes
3d2baa7476 dfu: Add DFU_DEVICE_QUIRK_ATTACH_EXTRA_RESET
Some devices need yet another reset to get them back into runtime mode.
2017-10-13 17:20:20 +01:00
Richard Hughes
7a42f5eab9 dfu: Add DFU_DEVICE_QUIRK_IGNORE_UPLOAD
Some DFU implementations (e.g. CSR) do not properly support verification of
firmware using the upload mechanism.
2017-10-13 17:20:20 +01:00
Richard Hughes
c995a0218e dfu: Use the correct wDetachTimeOut when writing firmware
Although it makes things faster to ignore the timeout, it violates the DFU
specification which could break some devices.

Lets err on the side of caution for now, even if this means slowing down an
uncommon operation.

This reverts commit 144473c1f4.
2017-10-13 17:20:20 +01:00
Richard Hughes
ce7baf4e2e dfu: Don't infer that NO_DFU_RUNTIME always requires user action 2017-10-13 17:20:20 +01:00
Richard Hughes
9fac3a2895 dfu: Unbind the kernel module when claiming the device DFU interface 2017-10-13 17:20:20 +01:00
Richard Hughes
5bb91535ce Format the BCD USB revision numbers correctly
Add lots of code because it's not cool to hard depend on appstream-glib master.
2017-10-13 10:03:06 +01:00
Richard Hughes
8232d250a2 dfu: Do not try to verify the element write if upload is unsupported 2017-10-13 09:14:10 +01:00
Richard Hughes
64179e42af dfu: Print the device attributes when using 'dfu-tool list' 2017-10-13 09:13:42 +01:00
Richard Hughes
60aa497e6b 8bitdo: Verify legacy VIDs are actually 8Bitdo controllers
8Bitdo devices with firmware <= 4.0.0 used a few different USB VIDs, some of
which being shared with other projects. For the older firmware, compare the
vendor against a whitelist to ensure we only try to update 8Bitdo game pads.

Fixes https://github.com/hughsie/fwupd/issues/275
2017-10-12 14:15:41 +01:00
Richard Hughes
144473c1f4 dfu: Do not use wDetachTimeOut when in DNLOAD_IDLE
This speeds up the DFU plugin to the same speed as using dfu-util.
2017-10-12 12:47:36 +01:00
Richard Hughes
4b9126ee7d dfu: Allow flashing when the target does not specify an alt-name 2017-10-12 12:47:10 +01:00
Richard Hughes
1690ef2a83 trivial: Set the appropriate status when waiting for tbt hardware 2017-10-12 12:43:47 +01:00
Richard Hughes
f50eca4f55 trivial: Add FWUPD_STATUS_DEVICE_BUSY
This is when we're waiting for the device, but we don't know why.
2017-10-12 12:43:25 +01:00
Richard Hughes
b9f4907645 dfu: Add a low-level 'reset' command to dfu-tool 2017-10-12 09:13:27 +01:00
Richard Hughes
6359f7f9c6 dfu: Log the transfer size chosen for the device 2017-10-12 09:13:27 +01:00
Richard Hughes
153374e014 dfu: Use 0x0101 as an alias for 0x0110
If read the specification correctly it's supposed to be 0x0110 i.e. 1.10,
rather than 1.01 -- just work around it as it seems a common enough mistake.
2017-10-12 09:13:27 +01:00
Richard Hughes
a1c7716cdc dfu: Fix uploading large firmware files
Fixes split into more than 0xff chunks were being truncated as uint8_t was the
wrong index type.
2017-10-12 09:13:27 +01:00
Richard Hughes
8e054956b2 dfu: Include the reset timeout as wValue to fix some hardware 2017-10-12 09:13:27 +01:00
Richard Hughes
4212f40e9d trivial: Fix failure to build on i386 2017-10-09 12:17:02 +01:00
Richard Hughes
cd0d72abbe trivial: Move the man pages to the source locations
This should make it easier to keep them in sync.
2017-10-09 09:59:52 +01:00
Richard Hughes
9d30c5a4ee trivial: Fix a Werror=sign-compare on Fedora 28 2017-10-07 11:11:25 +01:00
Mario Limonciello
26767845f1 trivial: dell: add missing icon for TPM devices 2017-09-28 10:25:30 -04:00
Richard Hughes
eb53042c20 trivial: Use FuProgressbar in dfu-tool 2017-09-28 09:23:52 +01:00
Richard Hughes
b73ff8a346 trivial: Use FwupdStatus in the dfu plugin 2017-09-28 09:23:52 +01:00
Richard Hughes
9e79223ecf trivial: C99ify more for-loops 2017-09-28 09:23:52 +01:00
Richard Hughes
5cc168fa79 uefi: Do not use system-specific infomation for PCI devices
We should not use system quirks for version formatting or use the SMBIOS name
as a prefix for non-integral devices.
2017-09-26 19:50:37 +01:00
Richard Hughes
2fac59f64a trivial: Refactor the UEFI resource coldplug into a new helper
No functional changes.
2017-09-26 19:50:37 +01:00
Richard Hughes
9b4a66c8f8 uefi: Support uploading the firmware splash image 2017-09-26 19:50:37 +01:00
Richard Hughes
d8790e19a9 trivial: Factor out the call to fwup_set_up_update_with_buf() for future use 2017-09-26 19:50:37 +01:00
Mario Limonciello
5a8e8ee88d dell: only set coldplug delay when we know we need it
It's not very common to have a system with a Synaptics MST hub or
a dock plugged in.  Avoid slowing down fwupd enumeration in the
common scenario.
2017-09-26 08:56:07 -04:00
Mario Limonciello
e401edd107 dell: only run SMI to toggle host MST GPIO on systems with host MST
As type-C docks become more common MST controllers in the host are
going to become rarer.  This should be a manageable whitelist
and prevent running the SMI on the majority of systems.
2017-09-26 08:56:07 -04:00
Mario Limonciello
5a3ff3a446 trivial: dell create a function for looking up system ID
Enough places look for it that code duplication should go away.
2017-09-26 08:56:07 -04:00
Mario Limonciello
48cae2cb5e dell: add functionality to blacklist HW with problems
This is certainly a problem lower in the stack, but at least provide
a method to block these systems from bringing down fwupd until it's
fixed.
2017-09-26 08:56:07 -04:00
Mario Limonciello
e0e6a0b885 dell: only run on intended chassis
For example if trying to run on a server, they might support some
dell SMI but are architected differently.
2017-09-26 08:56:07 -04:00
Mario Limonciello
48a164657e thunderbolt-power: always run after thunderbolt plugin
It's important to make sure that coldplug finished on thunderbolt
as this is what thunderbolt-power uses to make intelligent decisions
2017-09-22 05:51:20 +08:00
Richard Hughes
08a37992f9 Allow plugins to depend on each other
The only things that plugins can declare is that they should be run before,
after or never with regard to another plugin.
2017-09-21 17:09:06 +01:00
Mario Limonciello
39c4436c3d trivial: dell: move fu_dell_supported into plugin
Eventually fu-dell-common will not be used by synaptics, and it's
already not using this function.
2017-09-21 06:23:24 +08:00
Mario Limonciello
1edb50ed2f trivial: dell: remove needless includes 2017-09-20 09:11:02 -05:00
Mario Limonciello
9a30ef284d dell: prefer to use hwids to get DMI keys and DE table
libsmbios is still used as a fallback in some cases, mostly
because it's not clear whether or not ProductSKU is available
in all instances.
2017-09-20 09:11:02 -05:00
Richard Hughes
34e25a0cc5 trivial: Remove EnableTestSuite from daemon.conf
The same thing can be done using BlacklistPlugins=test
2017-09-19 20:06:44 +01:00
Richard Hughes
1df45c1401 unifying: Use fu_plugin_check_supported()
Some (HIDPPv1?) devices don't like being probed, and in some cases actually
stop working altogether.

Fixes bugs like #127 and #258
2017-09-19 16:11:27 +01:00
Richard Hughes
86a500462a Revert "unifying: Use a device whitelist to avoid breaking devices"
This reverts commit f194d68570.
2017-09-19 16:00:45 +01:00
Mario Limonciello
9ff5670b3d drop fu-dell-tool
It's been superceded by the thunderbolt power plugin
2017-09-18 17:13:12 -05:00
Richard Hughes
f194d68570 unifying: Use a device whitelist to avoid breaking devices
Some (HIDPPv1?) devices don't like being probed, and in some cases actually
stop working altogether. As we only really support the K780, just whitelist
that and another test device.

Fixes bugs like #127 and #258
2017-09-18 17:36:48 +01:00
Richard Hughes
daa341720f trivial: Show the interface size for an invalid DFU device 2017-09-18 11:06:29 +01:00
Richard Hughes
9decf17d82 dell: Fix a trivial whitespace issue 2017-09-16 18:52:44 +01:00
Richard Hughes
c8d028207f uefi: Do not set the release version
Instead, put the failing version number in the error message where it belongs.
2017-09-13 14:05:50 +01:00
Richard Hughes
0de86eca3d udev: Do not match USB devices, even with a GUID set
Prevents a warning about PRODUCT not existing when the usb plugin is disabled.
2017-09-13 14:05:46 +01:00
Mario Limonciello
8f17e1ccf4 Use the intel-wmi-thunderbolt kernel module to force power
When available on a system this module will allow force powering a TBT device with nothing plugged in.
2017-09-13 03:12:50 +08:00
Mario Limonciello
9d84b22d7b dell: drop thunderbolt force power code
This is replaced by the WMI force power interface.
2017-09-13 03:12:50 +08:00
Richard Hughes
f966e3f2a4 unifying: Add hardcoded summaries for peripheral kinds 2017-09-12 16:40:40 +01:00
Richard Hughes
5e3c19092f trivial: Do not print (null) for the new Unifying feature index 2017-09-12 16:36:19 +01:00
Richard Hughes
499d9f39a5 Fix a GObject registration problem on Debian
Do not link the static library with libfwupdprivate, instead do it in the
target executable.

Fixes https://github.com/hughsie/fwupd/issues/244
2017-09-12 09:34:51 +01:00
Richard Hughes
c1c2fec6f5 Add optional icons to each device
This allows us to show the devices in a GUI with a nice icon. Some of the icon
mappings are not perfect and I'll be asking the GNOME designers for some
additions to the icon specification.

Custom vendor icons can also be specified, and /usr/share/fwupd/icons would be
a good place to put them. If vendor icons are used they should show a physical
device with the branding, rather than just the vendor logo.
2017-09-11 17:27:35 +01:00
Richard Hughes
9bfcfd88cf Ensure more devices set the device summary
This helps users identify what the device actually does.
2017-09-11 15:10:50 +01:00
Richard Hughes
58546b3b00 trivial: Set a vendor ID for the ColorHug devices
This ensures that only firmware uploaded with this vendor ID can be flashed to
the hardware. This stops vendors on the LVFS from accidentally updating devices
from other vendors on the LVFS.
2017-09-11 10:31:56 +01:00
Richard Hughes
5720fc9d90 trivial: Add more vendor information to devices 2017-09-11 10:11:34 +01:00
Richard Hughes
e4be834ac1 unifying: Disable if the kernel has no CONFIG_HIDRAW support
Fixes: https://github.com/hughsie/fwupd/issues/235
2017-09-08 13:47:52 +01:00
Richard Hughes
b3c13461e9 trivial: Use the error domain from libfwupd
This means we don't need to convert the error code in the dfu plugin.
2017-09-08 13:33:34 +01:00
Richard Hughes
ef39e2e52f trivial: Remove all the DFU API versioning information 2017-09-08 10:32:22 +01:00
Mario Limonciello
705fd1600b trivial: remove unused variable in unifying (Fixes: #229) 2017-09-07 21:54:44 +01:00
Richard Hughes
a81ee67356 dfu: Use FuDeviceLocker 2017-09-07 19:00:51 +01:00
Richard Hughes
68e6065f0d unifying: Use FuDeviceLocker 2017-09-07 19:00:51 +01:00
Richard Hughes
7ca38ce446 colorhug: Use FuDeviceLocker 2017-09-07 19:00:51 +01:00
Richard Hughes
4edeeda345 ebitdo: Use FuDeviceLocker 2017-09-07 19:00:51 +01:00
Richard Hughes
e3e7a7b7d1 altos: Use FuDeviceLocker 2017-09-07 19:00:51 +01:00
Richard Hughes
5b4d7dce0a steelseries: Use FuDeviceLocker 2017-09-07 19:00:51 +01:00
Richard Hughes
92faae9a41 usb: Use FuDeviceLocker 2017-09-07 19:00:51 +01:00
Richard Hughes
0f224225f7 dfu: Remove DEVO support
The hardware does not support the DFU specification enough for a metadata table
to be embedded, so there's no way to reliably detect the 'devo' cipher, thus
making the support useless.
2017-09-07 18:39:23 +01:00
Richard Hughes
fd931a962f dfu: Remove the now-unused symtab support 2017-09-07 18:39:23 +01:00
Richard Hughes
68480a2069 trivial: Move the libdfu sources to the dfu plugin 2017-09-07 18:39:23 +01:00
Richard Hughes
53237d26a1 Remove the ELF support from libdfu and move the code to the altos plugin
This was a mistake originally for two reasons:

 * The only device to use ELF as a deliverable is the altos devices
 * ELF has nothing to do with the DFU specification

This moves the code to where it belongs.
2017-09-07 18:39:23 +01:00
Richard Hughes
7ac92109eb trivial: Remove useless config.h defines
The HAVE_UEFI_UNLOCK and HAVE_UEFI_GUID defines are always present for the
libfwup version we require.
2017-09-06 23:07:50 +01:00
Richard Hughes
54237e276d trivial: Use upstreamed libfwup functions added in 0.5 2017-09-06 23:07:50 +01:00
Richard Hughes
5075fa9c5b trivial: Remove some defines added in 0.3
For reference, we depend on at least 0.5...
2017-09-06 23:07:50 +01:00
Richard Hughes
1b090802f3 usb: Disable the fallback USB plugin
It's not super useful. If this has no bad effects for a couple of releases we
can either remove it completely or move the functionality to the test plugin.
2017-09-05 18:08:29 +01:00
Richard Hughes
4f0c828ca6 Fix build with newer versions of libgudev
Newer versions include the g_autoptr() macros in the installed headers.
2017-09-01 14:53:14 +01:00
Mario Limonciello
bb9d3b14dd Revert "dell: prefer to detect supported systems from OEM strings"
This reverts commit 257c14ebd1.

Although this is the preferable way to detect Dell systems this was
leading to executing SMI on some systems with problems.
libsmbios has some memory issues that need to be fixed first.
2017-08-31 16:48:45 -05:00
Yehezkel Bernat
ced27e8cbc thunderbolt: add description to all FwLocation objects
Completing what discussed in https://github.com/hughsie/fwupd/pull/214

Signed-off-by: Yehezkel Bernat <yehezkel.bernat@intel.com>
2017-08-31 13:11:52 -05:00
Mario Limonciello
a65ce8392b trivial: use fu_device_has_flag instead of fwupd_device_has_flag 2017-08-31 13:11:27 -05:00
Mario Limonciello
d63e7317db trivial: dell: turn device back on for thunderbolt plugin, not tbtfwu plugin 2017-08-31 13:00:32 -05:00
Mario Limonciello
c2ed0cb2bc trivial: update remaining use of ALLOW_ONLINE to UPDATABLE 2017-08-31 12:59:26 -05:00
Richard Hughes
d55d4f6de1 thunderbolt: All C source files need to include config.h 2017-08-31 14:40:25 +01:00
Christian Kellner
2be0c71b2c thunderbolt: validation: don't print empty strings
Before: "Given location is outside of the given FW ((null))"
2017-08-31 13:46:24 +01:00
Christian Kellner
44879b0252 thunderbolt: test image validation
Add a test case to test the new image validation code.
2017-08-31 13:46:24 +01:00
Richard Hughes
b5754f30cb thunderbolt: Fix a Coverity false-positive in the self tests 2017-08-30 15:06:06 +01:00
Richard Hughes
e655008a73 trivial: Fix starting conditions in the self tests
Found using Coverity.
2017-08-30 15:06:06 +01:00
Yehezkel Bernat
a23551e352 thunderbolt: refer to the wiki on image validation failure
Signed-off-by: Yehezkel Bernat <yehezkel.bernat@intel.com>
2017-08-30 14:01:26 +01:00
Yehezkel Bernat
e6c00362ad thunderbolt: image validation implemented
Fixes: https://github.com/hughsie/fwupd/issues/189

Signed-off-by: Yehezkel Bernat <yehezkel.bernat@intel.com>
2017-08-30 12:37:34 +01:00
Richard Hughes
b95b75a211 trivial: Remove unused function in the dell plugin
Fixes: https://github.com/hughsie/fwupd/issues/209
2017-08-30 10:54:29 +01:00
Yehezkel Bernat
e43f7fb655 trivial: cleanup for many compilation warnings from clang
Signed-off-by: Yehezkel Bernat <yehezkel.bernat@intel.com>
2017-08-30 10:43:15 +01:00
Mario Limonciello
f1cc61d2f0 trivial: dell: TPM switching blacklist->whitelist
It's been decided that TPM mode switching won't be supported
on any other new platforms.  Instead of blacklisting the outliers
whitelist the (smaller) list of platforms that do support the
feature.
2017-08-29 16:37:14 -05:00
Mario Limonciello
f30a1cbaa1 synapticsmst: use hwid to match supported systems
This is to help break the dependence on the Dell plugin during
initalization.

NOTE: there are corner cases that this plugin will no longer
detect Dell systems now, but these are expected to be rare.
2017-08-29 16:37:14 -05:00
Mario Limonciello
257c14ebd1 dell: prefer to detect supported systems from OEM strings
This requires dmidecode 3.1 or later.
SMBIOS tables are not a reliable enough method on all systems.
2017-08-29 16:37:14 -05:00
Mario Limonciello
1790115c93 trivial: dell: don't advertise ---force in an error message 2017-08-29 15:23:00 -05:00
Yehezkel Bernat
f8e5622726 trivial: fix compilation warning
Signed-off-by: Yehezkel Bernat <yehezkel.bernat@intel.com>
2017-08-29 14:48:45 -05:00
Mario Limonciello
7291c5b3ba trivial: fix TBT controller safe mode handling on Dell
- Set initial (invalid) GUID for TBT controller
- Don't set updatable unless GUID has been refreshed
- Correct the string used for GUID in Dell plugin
2017-08-28 13:24:59 -05:00
Richard Hughes
e0f28539ab trivial: Pedantic error literal conversion 2017-08-26 18:09:21 +01:00
Richard Hughes
91628ff8b6 dell: Use fu_device_has_flag() in the self tests 2017-08-26 18:09:21 +01:00
Richard Hughes
a785a1c2f6 Remove the confusing ALLOW_OFFLINE and ALLOW_ONLINE flags
Over the months the original meaning of ALLOW_OFFLINE and ALLOW_ONLINE have be
lost, and there is now a confusing mixture of uses in the source tree. With this
commit we make it clear the UPDATABLE flag is used to specify when the device is
updatable (e.g. from the desktop live session, or from the systemd offline
updates mode, or both) and the NEEDS_REBOOT flag lets us know when the update
is actually going to be done.

For instance, a UEFI UpdateCapsule can be *scheduled* from either the desktop
or from the update mode (but the latter would be a bit weird), but does require
a reboot. Some devices might only be updatable outside the live session, for
instance a hard drive update or a GPU update -- there's just too much going on
with a live session and we want to tightly control what's running during the
firmware flash.

This also means we don't have to "retry" the update when scheduling an update
that really can be scheduled whenever, but just requires a reboot to apply.
2017-08-26 18:09:21 +01:00
Christian Kellner
1283003f2f thunderbolt: only build tests if glib >= 2.52
This change should restore building fwupd with the new thunderbolt
plugin on older systems.
2017-08-25 16:12:55 +02:00
Richard Hughes
e1a3bdec08 thunderbolt: Add a README file
Fixes: https://github.com/hughsie/fwupd/issues/185
2017-08-25 13:02:47 +01:00
Christian Kellner
e598f75a00 thunderbolt: test we handle change events properly
There was a bug in the plugin that would cause devices to be removed
on change uevents. This test checks for that.
2017-08-25 13:07:53 +02:00
Richard Hughes
6bc5968da2 thunderbolt: Don't remove devices on change events
Based on a patch by Mario Limonciello, many thanks.
2017-08-25 09:50:54 +01:00
Mario Limonciello
3bc251b3a8 thunderbolt: when in safe mode on a Dell system look up VID/DID from SMBIOS
Signed-off-by: Richard Hughes <richard@hughsie.com>
2017-08-25 09:46:41 +01:00
Mario Limonciello
35a0e864b8 Introduce concept of CanForcePower to turn on TBT controllers
Supported Dell devices will use this to turn on ThunderBolt controllers
during coldplug.
2017-08-25 09:35:46 +01:00
Mario Limonciello
bae4b9948d trivial: minor typo that was missed on cherry-pick 2017-08-24 13:48:28 -05:00
Mario Limonciello
a4e764c3e2 Introduce a plugin interaction ABI 2017-08-24 13:41:27 -05:00
Richard Hughes
e1fd34d5f1 Allow plugins to set metadata on devices created by other plugins
This could be used, for instance, to set a property on ThunderBolt controllers
inside Dell computers saying that they support forcing the power level during
coldplug. It could also be used to set the dock type for the synapticsmst hub.

Adding this level of complexity allows us to avoid the creep of HAVE_DELL and
HAVE_LENOVO into seemingly unrelated plugins, and also allows us to have
multiple vendor plugins providing the same end result with two different
vendor-specific mechanisms.
2017-08-24 16:15:11 +01:00
Christian Kellner
1f6873a5dd thunderbolt: add new devices without delay
We want thunderbolt to claim the device and not to race with the
udev plugin.
2017-08-24 13:55:00 +01:00
Mario Limonciello
31f12579ff Add back options for HAVE_SYNAPTICS and HAVE_THUNDERBOLT
These were casualties in the move to meson that caused dell coldplug
prepare to fail.
2017-08-23 13:26:42 -05:00
Richard Hughes
6cbc7a6623 thunderbolt: Increase the runtime timeout for the self tests 2017-08-23 18:34:01 +01:00
Richard Hughes
c788134f75 trivial: Ensure that all the C source files include 'config.h' 2017-08-23 18:26:29 +01:00
Philip Withnall
efcc7a0545 thunderbolt: Drop unnecessary fwup dependency
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-08-22 10:15:02 +01:00
Christian Kellner
81dd85f6d1 tbtfwu: remove legacy thunderbolt plugin
Replaced by the "thunderbolt" plugin.
2017-08-21 12:12:55 -05:00
Christian Kellner
73ba7ee82c thunderbolt: plugin for new tbt kernel interface
Thunderbolt has a new kernel interface starting from version 4.13,
which simplifies updating the host controller and devices: the
kernel now exposes a sysfs interface for the non-volatile memory
as a device node. This can be used to write the new firmware blob.
Updates are then triggered also via a simple write to a sysfs
file (nvm_authenticate), which in turn is also used for error
reporting.
The plugin should be functionally, but a few items are missing:
 - image verification
 - safe mode handling
2017-08-21 17:05:44 +01:00
Max Ehrlich
e9e23fd342 Remove extra ) from line 227 2017-08-17 16:37:23 -05:00
Philip Withnall
3d626cec07 plugins/amt: Move UUID_LE initialisation into function scope
This should hopefully fix the error:

../../checkout/fwupd/plugins/amt/fu-plugin-amt.c:238:1: error: initializer element is not constant
 uuid_le MEI_IAMTHIF = UUID_LE(0x12f80028, 0xb4b7, 0x4b2d,  \
 ^

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-08-16 12:53:28 +01:00
Philip Withnall
1f68512f18 Revert "plugins/amt: Fix compilation on Jessie machine; UUID_LE is not const"
This reverts commit 1a5c7f6fe5.

The warning is obviously complaining that the value cannot be evaluated
at compile time, rather than that it’s being assigned to a const storage
location.
2017-08-16 12:53:28 +01:00
Philip Withnall
1a5c7f6fe5 plugins/amt: Fix compilation on Jessie machine; UUID_LE is not const
Unfortunately it seems that the definition of UUID_LE is not const (or
not evaluatable as const by the compiler) on a Debian Jessie machine,
which causes compilation to fail with:

../../checkout/fwupd/plugins/amt/fu-plugin-amt.c:238:1: error: initializer element is not constant
 const uuid_le MEI_IAMTHIF = UUID_LE(0x12f80028, 0xb4b7, 0x4b2d,  \
 ^

Fix that by dropping the const. Sadness.

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
2017-08-16 07:24:25 +01:00
Philip Withnall
7ca5a04105 plugins/unifying: Fix minor const-correctness issue
Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
2017-08-16 07:24:25 +01:00
Richard Hughes
94675b458b unifying: Use the new bootloader PIDs for pico receivers
Fixes: https://github.com/hughsie/fwupd/issues/169
2017-08-14 11:14:14 +01:00
Richard Hughes
a8909ec45b trivial: Remove the FuDevice plugin symlinks 2017-08-14 10:29:55 +01:00
Richard Hughes
94f939aa4d trivial: Move the archive decompression to common code 2017-08-09 10:23:23 +01:00
Richard Hughes
d7704d4cc2 Allow plugins to get DMI data from the hardware in a safe way
The returned strings are converted to ASCII and have leading and trailing
spaces removed.
2017-08-09 10:19:13 +01:00
Richard Hughes
e7472a22cc Use a static library to avoid symlinking files for the tests 2017-08-09 10:19:13 +01:00
Chris Lee
f519834bb9 Make flashing ebitdo devices actually work
When my SNES30 controller was in bootloader mode, it wouldn't update,
and when it was in controller mode, it tried and failed. Now, it prints
out the instructions on how to reset the device if it's in controller
mode, and if it's in bootloader mode, it successfully installs the
firmware update from the .DAT file.
2017-08-02 06:43:09 +01:00
Richard Hughes
260e970297 Rename the thunderbolt plugin to tbtfwu 2017-07-30 17:39:25 +01:00
Richard Hughes
70d13a5a58 unifying: Make sure the percentage completion goes from 0% to 100%
Pre-filter the pending LuDeviceBootloaderRequest's after they are parsed so
that we know exactly how many packets need to be sent to the hardware.

As shown in https://github.com/hughsie/fwupd/issues/155, people get worried
if the progress bar finishes before 100% as they'll wonder if all the writing
completed successfully.
2017-07-24 12:02:14 +01:00
Richard Hughes
b31791a11f trivial: Allow setting the unifying bootloader address for self tests 2017-07-24 11:54:31 +01:00
Richard Hughes
da928d1da7 unifying: Fix trivial error handler warning 2017-07-24 11:46:54 +01:00
Richard Hughes
f592b06722 dell: Fix the last of the memory leaks in the self tests
Fixes: https://github.com/hughsie/fwupd/issues/158
2017-07-24 10:55:03 +01:00
Richard Hughes
4bfcae2921 trivial: Fix a tiny leak in the Dell plugin 2017-07-24 10:51:29 +01:00
Mario Limonciello
5f6a574fd7 fix some more memory leaks in dell plugin (#158) 2017-07-21 13:17:47 -05:00
Richard Hughes
3cca1c65c2 trivial: Remove or downgrade some superfluous warnings
Fixes bugs like https://github.com/hughsie/fwupd/issues/159
2017-07-21 13:38:27 +01:00
Richard Hughes
061ad8c5e8 trivial: Make fu_dell_detect_dock() slightly more NULL-deref safe 2017-07-19 09:14:56 +01:00
Mario Limonciello
11ca8122c3 Revert "trivial: fix some more memory leaks in dell plugin (#158)"
This reverts commit 49aba8cd87.

That was prematurely committed, my apologies.
2017-07-18 16:00:03 -05:00
Mario Limonciello
32899e5ff7 dell: use plugin hash table instead 2017-07-18 15:53:38 -05:00
Mario Limonciello
49aba8cd87 trivial: fix some more memory leaks in dell plugin (#158) 2017-07-18 15:53:38 -05:00
Mario Limonciello
d817c53697 Correct a memory leak in Dell plugin (Fixes #158) 2017-07-18 10:35:21 -05:00
Mario Limonciello
c29b398ad0 trivial: fix various spelling errors 2017-07-17 13:07:05 -05:00
Mario Limonciello
e68b118044 uefi: test for kernel support during coldplug
The kernel offers two interfaces for manipulation of EFI variables.
Make sure that at least one of these is available.

If another interface is added (and supported by efivar) then this
list will need to be appended as well.

This was raised as a potential problem in #100.
2017-07-10 14:11:22 -05:00
Mario Limonciello
c7e5322454 dell, uefi: Display all errors recorded by efi_error tracing, not just the first one 2017-07-10 14:11:10 -05:00
Richard Hughes
c633edc773 unifying: Don't log a warning when an unknown report is parsed
Fixes: https://github.com/hughsie/fwupd/issues/151
2017-07-07 13:42:45 +01:00
Mario Limonciello
8cb067d528 trivial: uefi: whitespace 2017-07-06 12:39:33 -05:00
Mario Limonciello
f043f1f94b uefi: record boot variables to system log during updates (#152)
This doesn't strictly resolve the encountered issue, but
it will aide in debugging these types of issues in the future.
2017-07-06 12:37:10 -05:00
Richard Hughes
79acb58c7e uefi: Fix crash when the product name is NULL
...bad things happen when you try to free a const char...
2017-07-06 18:27:01 +01:00
Mario Limonciello
c1a4bd469d uefi,dell: make error messages from installing capsules useful
Before:
$ fwupdmgr install XPS_test.cab
Retrying as an offline update...
Scheduling…            UEFI firmware update failed: -1

After:
$ fwupdmgr install XPS_test.cab
Retrying as an offline update...
Scheduling…            UEFI firmware update failed: libfwup.c:733 get_paths(): could not find shim or fwup on ESP: No such file or directory
2017-07-06 11:38:33 -05:00
Mario Limonciello
be3a994922 Display UEFI firmware type
This will be more important as devices include more than
one entry in the ESRT.
2017-07-05 17:16:18 -05:00
Richard Hughes
822e134e94 unifying: Split up the HID++2.0 and HID++1.0 functionality 2017-07-04 13:19:09 +01:00
Richard Hughes
2a247e85e3 unifying: Allow flashing in bootloader modes 2017-07-03 20:17:50 +01:00
Richard Hughes
07bdf87b86 trivial: Add defines for the 'very-long' register read/write 2017-07-03 20:17:43 +01:00
Richard Hughes
b1af7496b1 unifying: Show the hardware version when the hardware provides this 2017-06-28 14:19:11 +01:00
Richard Hughes
55e6d9a74f unifying: Only add the feature Root on HID++2.0 devices 2017-06-28 14:18:56 +01:00
Richard Hughes
42b6439892 unifying: Switch to a floating point HID++ version 2017-06-28 14:17:30 +01:00
Richard Hughes
2c1bd0236c unifying: Only call HID++2.0 features on version 2+ devices
Also, ignore HID++1.0 replies from HID++2.0 devices and use the correct
function ID for getDfuStatus to avoid an error.
2017-06-28 12:10:02 +01:00
Richard Hughes
e97c5eb013 unifying: Manually set the HID++ version for runtime devices 2017-06-28 12:09:51 +01:00
Richard Hughes
653119fef8 unifying: Use a longer timeout for some operations 2017-06-28 12:09:51 +01:00
Richard Hughes
22dc937184 unifying: Use __attribute__((packed)) for structs sent to the hardware 2017-06-28 12:09:51 +01:00
Richard Hughes
f21cda4fed unifying: Clear the feature map when a device is reprobed 2017-06-28 12:09:51 +01:00
Richard Hughes
695d01ed93 unifying: Keep the devices open, closing in finalize 2017-06-28 12:09:51 +01:00
Richard Hughes
c3b5b24287 unifying: Fix a confusing debug message 2017-06-28 12:05:32 +01:00
Richard Hughes
ae15bc2649 unifying: Filter by SwId when making HID++2.0 requests
Using the default value of '0' is what the kernel is using (related, libratbag
is using 0x08) and makes hotplug unreliable.
2017-06-28 12:05:32 +01:00
Richard Hughes
668f91419d unifying: Allow large HID++ version numbers
Apparently, '4.3' is a perfectly valid version number.
2017-06-28 12:05:32 +01:00
Richard Hughes
f1399580b5 unifying: Do not allow closing a non-open device 2017-06-28 12:05:32 +01:00
Richard Hughes
38451999ff unifying: Actually enforce the device_id checks 2017-06-28 12:05:32 +01:00
Richard Hughes
8884676c5d unifying: Ping before trying to get the feature indexes
This reduces log spew for disconnected-but-paired devices.
2017-06-28 12:05:32 +01:00
Richard Hughes
45e3a03d15 trivial: Make a debug message less alarming 2017-06-28 12:05:32 +01:00
Richard Hughes
72975f0077 unifying: Only mark the device as active once the probe has completed 2017-06-24 07:40:38 +01:00
Richard Hughes
765c679498 unifying: Only detach the device if required 2017-06-24 07:24:15 +01:00
Richard Hughes
ed34991bd8 Do not unlock devices when doing VerifyUpdate
We used to do this dance to avoid reading the Option ROM on hardware by default
(some faulty hardware would crash...) but now we're doing the verify update in
the daemon there's no need to split this into two steps.

Fixes: https://github.com/hughsie/fwupd/issues/149
2017-06-22 10:37:10 +01:00
Richard Hughes
3045d1ca3f unifying: Do not poll when we're waiting for device replug
If we happen to poll when the device is in the *process* of closing then the
open() fails in a weird way. If we're flashing it's probably a good idea to not
be too clever anyway...
2017-06-22 09:38:10 +01:00
Richard Hughes
7048044156 trivial: Fix up an error message in the unifying code 2017-06-22 09:38:10 +01:00
Richard Hughes
a42dae927c unifying: Wait for device to re-appear in runtime after attaching
This ensures we can flash multiple versions of firmware without an artificial
delay. Also raise the timeout to cope with chains of slow hubs.
2017-06-22 09:37:48 +01:00
Richard Hughes
97fd762b47 unifying: Never allow the USB plugin to claim devices 2017-06-22 09:36:32 +01:00
Richard Hughes
0be13c038a unifying: Allow a response from CMD_REBOOT
It's a race afterall, so some hardware is faster than others...
2017-06-22 09:36:32 +01:00
Mario Limonciello
f3f4390155 Only use the test runner plugin when CI is set in the env (#148)
This prevents an installed system from showing FakeDevices but
still allows exercising every commit with Travis CI
2017-06-20 13:56:13 -05:00
Richard Hughes
166d42cada amt: Fix up a small memory leak and remove some goto's 2017-06-19 20:19:32 +01:00
Richard Hughes
9b59676a24 Add a plugin to get the version of the AMT ME interface 2017-06-19 14:01:47 +01:00
Richard Hughes
b53ad36012 trivial: Fix up a number of FALSE/NULL return issues 2017-06-19 13:50:42 +01:00
Richard Hughes
4a2e915e9a unifying: Use the UFY DeviceID prefix as the PID is not 'USB PIDs' at all.
Resolves: https://github.com/hughsie/fwupd/issues/144
2017-06-16 16:45:42 +01:00
Richard Hughes
bbde1df44f Fix downgrades when version_lowest is set
Also, add some tests to test this with the dummy device.
2017-06-16 12:40:15 +01:00
Richard Hughes
b7bf715435 Add an installed test for device update
This also moves the tests into one file as gnome-desktop-testing-runner
intentionally randomizes the order and runs them in parallel where allowed.
Since tests like get-updates have to be run after the metadata injection simply
put these into one test that calls a simple script.
2017-06-15 20:19:03 +01:00
Richard Hughes
ae7e0d21b2 Add an installed test for verification 2017-06-15 16:23:52 +01:00
Richard Hughes
fd381cc96e Add the ability to restrict the firmware installation to specific vendor IDs
This allows us to fix https://github.com/hughsie/lvfs-website/issues/4
2017-06-12 20:22:25 +01:00
Richard Hughes
e76ed8eb0d trivial: Generate more than just SHA1 OptionROM checksums 2017-06-07 08:02:41 +01:00
Richard Hughes
68cc00c7e9 Allow multiple checksums on devices and releases
Although we supported other hashes than SHA1 (which is now moderately unsafe)
we had to switch the metadata provider and daemon on some kind of flag day to
using SHA256. Since that's somewhat impractical, just allow multiple checksums
to be set on objects and just try to match whatever is given in preference
order.

This also means we can easily transition to other hash types in the future.

The removed API was never present in a tarball release, so not an API break.
2017-06-06 20:06:53 +01:00
Richard Hughes
0fe22ff010 ebitdo: Ensure the version is set on the device in non-bootloader mode 2017-06-05 09:03:44 +01:00
Richard Hughes
a9adbf5d22 ebitdo: 8bitdo has started using a new VID 2017-06-05 08:46:50 +01:00
Richard Hughes
35579c3183 unifying: Do not expect a reply when issuing a REBOOT command
Although the device does send a response, in some cases the Linux USB stack
processes the disconnect before the reply is processed.

Resolves: https://github.com/hughsie/fwupd/issues/122
2017-05-31 16:44:21 +01:00
Richard Hughes
5bba7caa4d unifying: Remove the indirection to lu_device_send_request()
It's only called by one static user, and it is much simpler this way.
2017-05-31 16:40:54 +01:00
Richard Hughes
2ff985e04b unifying: Allow calling lu_device_close() multiple times without an error 2017-05-31 16:36:00 +01:00
Richard Hughes
e1e9fa99b4 unifying: Don't read a register we don't use
It seems other firmware versions are affected too.
2017-05-30 19:46:42 +01:00
Mario Limonciello
df1f570069 Fix a logic error with testing for a dell system.
Some Lenovo systems were inadvertently matching.
2017-05-25 21:33:54 -05:00
Richard Hughes
e2ecefa3c3 unifying: Relax the requirement that a SHORT request should return a SHORT reply
For some HID++2.0 devices a SHORT request is allowed to be padded into a LONG
response.
2017-05-23 13:54:10 +01:00
Richard Hughes
2b5f6b9a74 unifying: Correctly open RQR12 devices with original factory firmware
It seems reading from the register is fixed in later firmware versions.
2017-05-23 13:14:28 +01:00
Richard Hughes
fd45583728 unifying: Ensure HID devices are closed if the subclassed open() or probe() failed
Fixes the critical warnings in https://github.com/hughsie/fwupd/issues/117
2017-05-23 12:27:23 +01:00
Richard Hughes
26a52be318 unifying: Fix the spelling of 'Receiver' 2017-05-23 09:30:20 +01:00
Richard Hughes
ccda0d2be7 uefi: Add a translatable string for future use
This is added now so the translator teams get a chance to translate it before
it is used in anger.
2017-05-22 12:01:26 +01:00
Richard Hughes
0293f720bc unifying: Ensure device is closed if fu_device_ebitdo_open() did not complete
It's not expected users have to call lu_device_close() if opening failed.
2017-05-08 12:44:53 +01:00
Richard Hughes
741f3310ab ebitdo: Ensure device is closed if fu_device_ebitdo_open() did not complete
It's not expected users have to call fu_device_ebitdo_close() if opening failed.
2017-05-08 12:44:26 +01:00
Richard Hughes
b0c65749fc steelseries: Ensure device is closed if it returns an invalid packet 2017-05-08 12:43:17 +01:00
Richard Hughes
2bdc588112 unifying: Ignore spaces in the version prefix 2017-05-03 10:24:59 +01:00
Richard Hughes
7a7591a99a unifying: Add support for DFU features
This adds support for flashing peripherals with the 0x00d0 DFU feature.
2017-05-02 21:30:50 +01:00
JulianLiu
1d577d6572 enable-dell requires libfwup-dev (#113)
* enable-dell requires libfwup-dev

Add dependency in enable-dell and shared_module('fu_plugin_uefi')
2017-05-02 19:38:15 +01:00
Mario Limonciello
5c1df14d05 fix test suite localstate directory to be a temporary directory 2017-04-20 13:53:19 -05:00
Richard Hughes
fe3f0eda75 trivial: Fix build when using older version of meson
Newer meson versions ignore unknown found requests, not so much for older ones.
2017-04-19 08:38:41 +01:00
Richard Hughes
4f0f4c77ce trivial: Fix underlinking in the altos plugin 2017-04-16 09:10:30 +01:00
Richard Hughes
1fdb335025 Remove the automake build system 2017-04-13 18:42:08 +01:00
Richard Hughes
f6ee41edf2 trivial: Make libtbtfwu optional when compiling with thunderbolt support 2017-04-13 17:44:08 +01:00
Richard Hughes
9f0c47b36a Fix the raspberrypi self test code under meson
Also, refactor the common test code to a new source file.
2017-04-13 10:09:33 +01:00
Richard Hughes
87e82a716d trivial: Add the optional valgrind functionality back 2017-04-12 18:21:08 +01:00
Richard Hughes
67b8cb62bc trivial: Fix the last -Wpointer-sign warning 2017-04-12 17:56:54 +01:00
Richard Hughes
ea8ebcfc7b unifying: Refactor the plugin now we have some more information about the hardware
Many thanks to Logitech.
2017-04-12 17:54:50 +01:00
Richard Hughes
38a08807f5 trivial: Fix linking in the synapticsmst plugin 2017-04-12 17:54:46 +01:00
Richard Hughes
463f80566c trivial: Fix linking in the thunderbolt plugin 2017-04-12 17:54:46 +01:00
Richard Hughes
57746cb839 Add the Meson build system as an alternate to autotools
Automake and autoconf are impossible to fully understand and Meson now provides
everything we need for a much smaller, faster, and more understandable build.

See http://mesonbuild.com/ for more information.
2017-04-12 16:35:18 +01:00
Richard Hughes
d3f4b5a428 trivial: Define the build dir outside the source file 2017-04-12 14:26:14 +01:00
Richard Hughes
f985a8f7b7 trivial: Fix the log domains in two plugins 2017-04-12 14:20:07 +01:00
Mario Limonciello
99489a8638 trivial: set synaptics error message in more scenarios 2017-03-20 13:34:26 -05:00
Richard Hughes
7db8ed498b trivial: Unbreak make check 2017-02-24 10:55:46 +00:00
Richard Hughes
c3c28bacae trivial: Always initialize a g_autoptr as the compiler is not yet smart enough 2017-02-24 07:54:51 +00:00
Mario Limonciello
6cabd969e9 trivial: correct a small memory leak in SynapticsMST plugin 2017-02-23 13:16:04 -06:00
Mario Limonciello
e70e5513ca dell: don't initialize libsmbios on unsupported systems
As found in https://github.com/dell/libsmbios/pull/13
there are some errors with libsmbios error paths.

These need to be fixed in libsmbios, but at least avoid
running this code on those systems (and crashing fwupd).
2017-02-20 14:54:12 -06:00
Mario Limonciello
aad9729347 trivial: fix build issues with older efivar
This is in the same vane as 4da67515, it allows linking with
an older efivar.
2017-02-15 09:29:59 -06:00
Richard Hughes
d82a6024e7 Fix a crash when enumerating devices on a Dell WLD15 2017-02-13 11:03:03 +00:00
Richard Hughes
31c36cd2b6 trivial: Fix some -Wdiscarded-qualifiers warnings 2017-02-13 11:02:19 +00:00
Richard Hughes
2613dcc3b8 trivial: Fix another -Wpointer-sign compile warning 2017-02-13 10:50:07 +00:00
Richard Hughes
6d5f2dc25e trivial: Fix compile warnings when building packages 2017-02-13 10:50:07 +00:00
Richard Hughes
4da6751502 trivial: Fix build issue
Patch from Gert Hulselmans, many thanks.

Fixes: https://github.com/hughsie/fwupd/issues/88
2017-02-13 10:50:07 +00:00
Kai Krakow
1c7ea9ee2d Fix compiler warnings
My compiler doesn't understand -Wno-discard-qualifiers so drop it and
fix the warnings instead. I think it is better to explicitly fix them
anyways instead of just to ignore the discarded const qualifier in
general.

I think the option should be avoided in hand-written code. The warning
is there for a reason: To protect you from possibly overwriting data you
expect to not be modified when passing pointers around.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41215
2017-02-13 10:02:25 +00:00
Richard Hughes
3e214856fb trivial: Fix a resource leak spotted by coverity 2017-02-08 11:03:48 +00:00
Mario Limonciello
8971645f78 trivial: synapticsmst: don't bother to scan cascade nodes in test suite
This significantly speeds up the test suite.

They can't really be easily represented anyways in the test suite
since the devnode would have to change so much between steps.
2017-02-03 13:21:29 -06:00
Richard Hughes
48d23f7bb0 Fix a refcounting issue in the udev plugin
Objects are returned from the cache with transfer:none.

Hopefully fixes https://github.com/hughsie/fwupd/issues/86
2017-02-03 14:17:07 +00:00
Richard Hughes
c4cbcafe5e synapticsmst: Fix up some trivial whitespace issues 2017-02-03 10:11:41 +00:00
Mario Limonciello
0a65ffb239 synapticsmst: add a test suite 2017-02-02 21:43:42 -06:00
Mario Limonciello
f5144d0720 trivial: synaptics: increase flash mode delay to 3s
This allows devices with multiple hubs to settle between device
flashes better.  It doesn't have much other functional impact.
2017-02-01 17:16:27 -06:00
Mario Limonciello
e41e4a7a26 trivial: synaptics: encode chip ID into dock string
Although the same payload is used for all 3 MST hubs in TB16 or WD15
it's possible this may change one day.  Create separate GUID's for
all 3 different combinations by encoding the chip ID into the GUID
string.
2017-02-01 16:43:57 -06:00
Mario Limonciello
43f2286e10 trivial: synaptics: update the device name to be more sensible 2017-02-01 16:43:50 -06:00
Mario Limonciello
8d97bcf0ed trivial: synaptics: keep system ID in hexadecimal 2017-02-01 14:04:44 -06:00
Mario Limonciello
66d383cfed trivial: synaptics: check for removed cascaded devices during scan 2017-02-01 13:53:34 -06:00
Mario Limonciello
9e868a2cf8 trivial: synaptics: make debug messages more useful 2017-02-01 13:33:43 -06:00
Mario Limonciello
8d51d273e7 trivial: synapticsmst: consistently use lower case for dock ID's 2017-02-01 13:25:54 -06:00
Mario Limonciello
ccee8cd86f trivial: synaptics: remove cascaded devices if the direct device falls off 2017-01-31 11:02:54 -06:00
Mario Limonciello
7319259a84 Add a new function fu_dell_supported to fu-dell-common
This is used by Dell, Synaptics and Thunderbolt plugins
to identify if the system is a Dell system and if so
activate special code paths.
2017-01-30 20:58:28 -06:00
Mario Limonciello
8e74df7528 synapticsmst: build GUID using dock type
Although WD15 and TB16 share a same payload today, this may not
be the case some day in the future.  Use the fu-dell-common method
to determine the dock in use to build the GUID.
2017-01-30 20:37:48 -06:00
Mario Limonciello
bae3a02348 trivial: dell: move some dock lookup code into -common
This allows other plugins to compile in -common to be able look
up some dock related items.
2017-01-30 20:17:48 -06:00