Commit Graph

94 Commits

Author SHA1 Message Date
Richard Hughes
516e7741e0 unifying: Fix a compile warning with the latest GLib 2018-01-02 20:37:41 +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
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
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
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
245543849f unifying: 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
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
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
37e124f3da unifying: Use the new update_detach() and update_attach() vfuncs 2017-11-14 10:49:43 +00:00
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