Commit Graph

80 Commits

Author SHA1 Message Date
Richard Hughes
9e79223ecf trivial: C99ify more for-loops 2017-09-28 09:23:52 +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
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
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
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
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
Mario Limonciello
705fd1600b trivial: remove unused variable in unifying (Fixes: #229) 2017-09-07 21:54:44 +01:00
Richard Hughes
68e6065f0d unifying: Use FuDeviceLocker 2017-09-07 19:00:51 +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
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
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
Richard Hughes
c788134f75 trivial: Ensure that all the C source files include 'config.h' 2017-08-23 18:26:29 +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
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
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
Mario Limonciello
c29b398ad0 trivial: fix various spelling errors 2017-07-17 13:07:05 -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
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
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