Commit Graph

460 Commits

Author SHA1 Message Date
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