Commit Graph

36 Commits

Author SHA1 Message Date
Richard Hughes
6bbc4c787b jabra: Move the Jabra-specific detach out into its own plugin
This also lets us remove the call to dfu_device_wait_for_replug() which was
causing a deadlock due to unsafe main context usage. Splitting the code allows
us to use the device list to watch for replug, without adding even more Jabra-
specific plugin code to the DFU plugin.

Looking at this with a 40,000ft view, the Jabra runtime really doesn't have
much in common with DFU and the reason it was originally all lumped together
was that the daemon couldn't "change" plugins between detach and update.

It's unfortunate that we have to include a sleep() in the DFU code after the
DFU probe, but this is specified by Jabra themselves. Attempting to open the
device without waiting reboots the hub back into runtime firmware mode, so we
can't even retry the failing setup action.
2019-10-30 15:09:49 +00:00
Richard Hughes
4fec0302d2 dfu: Remove private headers that do not need to exist
These are a throwback to when we exported the DFU headers.
2019-10-14 15:24:08 -05:00
Richard Hughes
85c34215c7 dfu: Don't wrap provided VID-PID functions 2019-10-10 13:53:27 +01:00
Richard Hughes
23c89edeaa dfu: Use the standard FuDevice custom flags functionality 2019-10-10 13:53:27 +01:00
Richard Hughes
8583184489 dfu: Use klass_device->write_firmware() directly 2019-10-10 13:53:27 +01:00
Richard Hughes
13ffa3e13f dfu: Use the generic fu_plugin_usb_device_added() function 2019-10-10 13:53:27 +01:00
Richard Hughes
b6fbf80f95 dfu: Use daemon flags to ignore devices rather than a special flag 2019-10-10 13:53:27 +01:00
Richard Hughes
79e033907b dfu: Set the device state directly to avoid proxying signals 2019-10-10 13:53:27 +01:00
Richard Hughes
f9fb2a6366 dfu: Use the built-in detach() and attach() vfuncs 2019-10-10 13:53:27 +01:00
Richard Hughes
8653e70480 trivial: Remove G_BEGIN_DECLS from all private headers 2019-10-09 20:02:16 +01:00
Richard Hughes
bfd946e463 Use '#pragma once' to avoid a lot of boilerplate 2019-02-09 08:42:30 -06: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
51308e648a Adjust all licensing to LGPL 2.1+ (Closes: #526) 2018-05-29 09:03:13 +01:00
Richard Hughes
a29711c4a1 Move the FuQuirks reference down from DfuDevice to FuDevice 2017-12-11 10:47:18 +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
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
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
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
85dbcbf534 dfu: Add trivial helpers to get the current vid/pid/release 2017-11-11 21:06:18 +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
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
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
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
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
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
ac32f71a00 trivial: Remove the GObjectClass padding for private objects 2017-10-28 15:18:35 +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
ce7baf4e2e dfu: Don't infer that NO_DFU_RUNTIME always requires user action 2017-10-13 17:20:20 +01:00
Richard Hughes
b73ff8a346 trivial: Use FwupdStatus in the dfu plugin 2017-09-28 09:23:52 +01:00
Richard Hughes
a81ee67356 dfu: Use FuDeviceLocker 2017-09-07 19:00:51 +01:00
Richard Hughes
68480a2069 trivial: Move the libdfu sources to the dfu plugin 2017-09-07 18:39:23 +01:00