Commit Graph

46 Commits

Author SHA1 Message Date
Richard Hughes
584db3a066 Indicate devices that need data retained typically only useful for ->probe()
This includes snapshot data like GUdevDevice that is only very rarely useful
after `FuDevice->probe()` has been completed. Add a warning so that we can
identify affected plugins and provide some grace period.

This should reduce the idle RSS by ~200kB when we flip the swithc in the future.
2023-02-23 10:47:08 +00:00
Mario Limonciello
5444131703 trivial: logitech-hidpp: move the check for CONFIG_HIDRAW into probe
The kernel should have loaded hidraw support by the time that we probe
a device.  This fixes logitech devices not showing up after startup
if they weren't plugged in initially.

Fixes: #5525
2023-02-13 11:30:28 -06:00
Richard Hughes
2336f6a345 trivial: Fix warning: do not use 'else' after 'return' 2023-02-13 12:34:46 +00:00
Richard Hughes
99df74f0c2 Add API to wait for a device
This allows us to ignore all the delays when the device is emulated, with the
idea being to do dozens of device emulations in the CI tests.

Also, do not call fu_progress_sleep() when the device is emulated.
2023-02-01 09:42:08 +00:00
Richard Hughes
d8c464889a logitech-hidpp: Fix possible unsafe memcpy()
PVS: A call of the 'memcpy' function will lead to underflow of the buffer.
2022-09-09 19:23:29 +01:00
Richard Hughes
f0980cbdda logitech-hidpp: Lower a debug level when updating the Bolt radio 2022-07-21 21:27:24 +01:00
Richard Hughes
011efbb3f3 logitech-hidpp: Fix one more guessed FuProgress step 2022-07-11 11:59:31 +01:00
Richard Hughes
07d5bf12e4 logitech-hidpp: Fix flashing the K750 keyboard
Add the legacy instance IDs to make old firmware work.
2022-07-05 08:52:54 +01:00
Richard Hughes
faa7871b08 Remove duplicate ->probe() calls to speed up startup by 150ms
Now incorporate is fixed to copy across the properties we need in the
superclass, we don't need to do the subclass ->probe().

Note, we still need to do the subclassed ->probe() when using
FU_UDEV_DEVICE_FLAG_VENDOR_FROM_PARENT or when looking at properties
on the parent device.

This also removes the spurious 'already set GType to FuVliUsbhubDevice,
ignoring FuVliUsbhubDevice' messages when running the daemon.
2022-06-14 21:01:57 +01:00
Richard Hughes
ed1b13da28 Split out the memory helpers to a new source file 2022-06-14 14:36:52 -05:00
Richard Hughes
9d33c29e92 Split out the string helpers to a new source file 2022-06-14 14:36:52 -05:00
Richard Hughes
dc91d59f8e Remove the recently added fu_progress_add_step_full()
Just break API instead.
2022-06-03 13:47:11 -05:00
Richard Hughes
2d5186622c Add FuProgress to ->prepare and ->cleanup
Some plugins were creating local versions (which were not attached to
the daemon progress in any way) as a workaround as they needed to do
actions that took a long time to complete.
2022-04-15 16:50:06 +01:00
Richard Hughes
acbba72b3b logitech-hidpp: Inherit the icon for the child device from the parent 2022-03-24 14:35:22 +00:00
Richard Hughes
b4e88bae49 trivial: Move the UNREACHABLE inhibit to common code 2022-03-15 11:29:00 +00:00
Richard Hughes
c4ca026294 Allow devices to build instance IDs more easily
Provide a device instance builder that allows plugins to easily
create multiple instance IDs based on parent attributes.

Also fix a lot of the instance ID orders, so that we add more generic
IDs first, and more specific IDs after.
2022-03-03 09:13:29 +00:00
Richard Hughes
758d5d8c6f Add a flag to indicate the device is signed or unsigned
Devices without either flag are unknown.
2022-02-22 19:12:06 +00:00
Richard Hughes
2f8e7dc05c logitech-hidpp: Always hardcode the vendor for FuLogitechHidPpDevice 2022-01-06 19:23:58 +00:00
Richard Hughes
d0162352a6 logitech-hidpp: Fix a small memory leak at startup 2021-10-27 15:57:53 +01:00
Richard Hughes
543ae52e23 Document some of the environment variables used by fwupd
Fixes https://github.com/fwupd/fwupd/issues/3760
2021-09-21 10:25:12 +01:00
Ricardo Cañuelo
e47de909c0 logitech-hidpp: adhere more closely to the specs
The restart message is supposed to be HIDPP_REPORT_ID_LONG according to
the specs, but it works just as well if we use
HIDPP_REPORT_ID_SHORT. We better stick to the specs, though.
2021-09-20 10:21:44 +02:00
Ricardo Cañuelo
ab5c38b679 trivial: logitech-hidpp: fix request message setting 2021-09-20 10:21:44 +02:00
Ricardo Cañuelo
c198055a54 logitech-hidpp: remove unnecessary 'bolt-peripheral' private flag 2021-09-20 10:21:44 +02:00
Ricardo Cañuelo
26a1ddf49d logitech-hidpp: fix logical id for radio devices 2021-09-15 10:19:37 +02:00
Ricardo Cañuelo
5675e16274 logitech-hidpp: fix logical ids for BLE and paired devices 2021-09-15 10:19:37 +02:00
Richard Hughes
40cd18fa97 Allow using a per-device global percentage completion
It's actually quite hard to build a front-end for fwupd at the moment
as you're never sure when the progress bar is going to zip back to 0%
and start all over again. Some plugins go 0..100% for write, others
go 0..100% for erase, then again for write, then *again* for verify.

By creating a helper object we can easily split up the progress of the
specific task, e.g. write_firmware().

We can encode at the plugin level "the erase takes 50% of the time, the
write takes 40% and the read takes 10%". This means we can have a
progressbar which goes up just once at a consistent speed.
2021-09-13 14:28:15 +01:00
Ricardo Cañuelo
15a39b94ee logitech-hidpp: Add support for updating Bolt peripheral firmware
Also simplify the Instance IDs added by the Bolt hardware.
2021-09-13 11:28:55 +01:00
Richard Hughes
91536c5638 logitech-hidpp: Add the Model ID instance ID before getting firmware versions
This will allow us to create a device-radio child in the future.
2021-09-01 15:42:24 +01:00
Richard Hughes
12f01c8622 logitech-hidpp: Use UNREACHABLE rather than modifying UPDATABLE 2021-09-01 15:42:24 +01:00
Ricardo Cañuelo
512973fa50 logitech-hidpp: Add support for updating Bolt receiver radio firmware 2021-09-01 15:07:09 +01:00
Ricardo Cañuelo
35af30321a logitech-hidpp: Add support for updating Bolt receivers 2021-09-01 15:07:09 +01:00
Richard Hughes
9d2168e985 logitech-hidpp: Fix a regression in updating Unifying peripherals
This regressed in a3ecccc31c
2021-08-31 19:27:59 +01:00
Ricardo Cañuelo
7b31e92e85 logitech-hidpp: Retry 5 times to setup after the device restarted 2021-08-31 17:15:15 +01:00
Ricardo Cañuelo
482148a185 logitech-hidpp: Allow the HIDPP write to fail on attach
On some devices the device restarts before it can send the reply.
2021-08-31 17:15:15 +01:00
Ricardo Cañuelo
a3ecccc31c logitech-hidpp: Allow children to attach using the parent device for future code 2021-08-31 17:15:15 +01:00
Ricardo Cañuelo
b4b7af6c9f logitech-hidpp: Fetch the device model ID to add a more precise InstanceID 2021-08-31 17:15:15 +01:00
Ricardo Cañuelo
8ac10329c9 logitech-hidpp: Store the HIDPP++ PID for future usage 2021-08-31 17:15:15 +01:00
Ricardo Cañuelo
0974dc759b logitech-hidpp: Use an interactive request to restart some Logitech DFU devices 2021-08-31 17:15:15 +01:00
Ricardo Cañuelo
f63afade6f logitech-hidpp: Add some trivial defines for polling intervals 2021-08-31 17:15:15 +01:00
Ricardo Cañuelo
f4926e2d8e logitech-hidpp: Add support for devices supporting the Unified Battery feature 2021-08-31 17:15:15 +01:00
Ricardo Cañuelo
ef95d362dd logitech-hidpp: Fix reading HID++1.0 battery mileage 2021-08-31 17:15:15 +01:00
Ricardo Cañuelo
4534f2d7fc logitech-hidpp: Reduce some debug noise on update 2021-08-31 17:15:15 +01:00
Ricardo Cañuelo
74e126390a logitech-hidpp: Fix a critical error on flash failure 2021-08-31 17:15:15 +01:00
Mario Limonciello
55de39c077 trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
Ricardo Cañuelo
be8634d2cb logitech-hidpp: fix bug in type casting 2021-06-14 12:35:34 +01:00
Ricardo Cañuelo
30c5e0e918 logitech-hidpp: make peripheral class derivable and subclass it 2021-06-11 13:53:02 +02:00