Commit Graph

2033 Commits

Author SHA1 Message Date
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
5bed9341b4 trivial: Fix self test failure with newer versions of GCab 2018-01-06 22:46:35 +00:00
Richard Hughes
639da4776b trivial: Allow calling all FuPlugin runners from the self tests 2018-01-06 22:44:24 +00:00
Bernhard M. Wiedemann
1fa6407c85 Use gzip -n
to prevent it from adding timestamps to .gz headers
to make package builds reproducible

See https://reproducible-builds.org/ for why this is good.
2018-01-05 07:39:21 +00:00
Mario Limonciello
110accb395 debian: if OS environment variable isn't set, try to guess it 2018-01-04 00:02:52 -06:00
Richard Hughes
c7bbbc246b Allow specifying the maximum archive size in the daemon config 2018-01-03 07:38:27 +00:00
Richard Hughes
4f50e6268a Do not try to parse huge compressed archive files
We don't want to allow DoS-ing the daemon by trying to decompress a huge sparse
cabinet archive.
2018-01-03 07:38:27 +00:00
Richard Hughes
516e7741e0 unifying: Fix a compile warning with the latest GLib 2018-01-02 20:37:41 +00:00
Richard Hughes
eec8a3c068 trivial: Fix a compile warning with the latest GLib 2018-01-02 20:37:31 +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
deea2da041 Use the new functionality in libgcab >= 1.0 to avoid writing temp files
Using old versions of gcab we could only do one thing: extract the files in the
cabinet archive to a new directory in /tmp, and then fwupd would have to read
them back in to memory to parse them. This was both inelegant and wasteful, and
probably not an awesome idea from a security or privacy point of view.

Using libgcab >= 1.0 we can decompress to a GBytes blob, and then verify the
firmware and metainfo file without anything being written to disk.

As this is a security sensitive operation, move the fwupd-specific helper code
out of libappstream-glib and also add a lot of internal self tests.

The gcab code will have to remain in libappstream-glib for a long time, but we
don't have to use it. Handling the cab file here also allows us to fix two
long-standing bugs:

 * MetaInfo or firmware files in a subdirectory are handled correctly

 * The archive can also be self-signed using PKCS7 instead of using GPG
2017-12-21 08:54:00 +00:00
Richard Hughes
8f89cf04fb Add more metadata to the user-agent string 2017-12-21 08:25:29 +00:00
Zander
e56b036e33 Remove www. from links to fwupd.org 2017-12-17 10:39:34 +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
Richard Hughes
650dadebe6 Choose the correct component from provides matches using requirements
In the case of multiple <component> sections with different AppStream IDs, but
with the same GUID <provides>, filter using the requirements rather than just
choosing the first one.

This allows the update of Logitech devices with secure bootloaders. Many thanks
to Ogier Bouvier for identifying the problem.
2017-12-14 15:50:19 +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
Igor Gnatenko
0ffc2448c0 ci: mesonintrospect -> meson introspect
Plan is to remove "old" name at some point (1.0?).
2017-12-13 11:08:45 -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
fbcebe096b Connect the progress and status callbacks on the new FuDevice on replug
This ensures we get progress events when replugging a device. Also, remove the
callbacks on the 'old' device to avoid causing multiple events on a 2nd-replug.
2017-12-11 16:48:56 +00:00
Richard Hughes
9934fb514c trivial: Apply the quirks again if the backing GUsbDevice changes 2017-12-11 16:48:42 +00:00
Richard Hughes
853ce90d79 trivial: Actually set the plugin hints from the device GType
This is a typo from the last commit
2017-12-11 12:10:49 +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
306c15b3a0 Add quirks based on the device GType
This allows us to have one per-plugin device quirk without having to call
fu_quirks_lookup_by_usb_device() in each plugin.
2017-12-11 10:47:18 +00:00
Richard Hughes
4cea617967 trivial: Add a quirk for setting the USB device version 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
7de50dbe92 trivial: Only reuse the added device if it has recently been removed 2017-12-11 09:44:36 +00:00
Richard Hughes
66268d0b31 unifying: Fix the string output format to match FuDevice 2017-12-10 14:50:58 +00:00
Richard Hughes
9b7bd190ed trivial: Don't show (null) in the debug logs 2017-12-10 14:50:54 +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
725c19fa88 Add a quirk for setting the USB device vendor 2017-12-08 19:36: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
fa34bcffa3 trivial: Add a to_string() vfunc for any objects subclassing FuDevice 2017-12-08 09:36:57 +00:00
Richard Hughes
55f8f236a9 trivial: Allow setting the platform-id from the object constructor 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