Commit Graph

112 Commits

Author SHA1 Message Date
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
3e0a4dc1c3 Be smarter and include less header files per source file 2022-06-14 14:36:52 -05:00
Richard Hughes
7f86ffab6f Split out the dump helpers to a new source file 2022-06-14 14:36:52 -05: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
e6b487e762 Add FuProgress to ->startup() and ->coldplug()
This allows us to profile the daemon startup so we can find any plugins
taking an inordinate amount of time to start.
2022-06-04 20:21:50 +01: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
5ef0ae182d Add a 'name' attribute to each FuProgress step
This allows us to print better warning strings, and in the future
would allow us to profile each operation in a meaningful way.

Also, add context to some of the progress steps as required.
2022-06-01 15:05:43 +01:00
Richard Hughes
baed98edff logitech-hidpp: Don't use 'dongle' to describe hardware 2022-05-23 14:56:45 +01:00
Richard Hughes
f16560b705 Add device icon usb-receiver 2022-05-23 14:56:45 +01:00
Richard Hughes
d3d7cfa816 Add plugin quirk keys earlier in the startup process
This allows creating the silo when starting the engine with custom
plugin keys such as WacomI2cFlashBaseAddr.

If we move the plugin initialization earlier then we don't get the
HwID matches, so we really do have to split this into a 4-stage startup,
e.g. ->load(), ->init(), ->startup() and ->coldplug().
2022-05-09 11:13:52 +01: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
dd183e9b59 logitech-hidpp: Add support for M550, M650 and K650 2022-03-10 12:57:45 +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
Mario Limonciello
661990ed98 Convert build system to use meson tristate features
tristate features will automatically disable if dependencies marked
as required are missing.

Packagers can manually override using `auto_features`.

Link: https://mesonbuild.com/Build-options.html#features
2022-02-28 08:34:48 -06: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
8df102b7c0 Add fu_usb_device_add_interface() for plugins to use
It's a common action for plugins to call FuUsbDevice->open() then claim
interfaces, and then release them just before FuUsbDevice->close().

It's also something a lot of plugins get wrong, so provide common code
to handle it correctly in one place.
2022-01-04 22:05:37 +00:00
Richard Hughes
d7aeac4663 logitech-hidpp: Use endian-safe version functions 2021-12-10 15:59:57 +00:00
Richard Hughes
e87fc05ab9 Speed up the daemon startup by ~2% by doing dlsym much less
We were calling g_module_symbol() 2703 times, which is actually more
expensive than you'd think.

It also means the plugins are actually what we tell people they are:
A set of vfuncs that get run. The reality before that they were dlsym'd
functions that get called at pretty random times.
2021-11-09 12:02:07 +00:00
Richard Hughes
37a5787229 logitech-hidpp: Set the vendor name in more places 2021-11-08 15:56:17 +00:00
Richard Hughes
8917a11208 logitech-hidpp: Fix a tiny memory leak for an error path 2021-11-02 13:47:56 +00:00
Richard Hughes
d0162352a6 logitech-hidpp: Fix a small memory leak at startup 2021-10-27 15:57:53 +01:00
Richard Hughes
3acbe9bed3 trivial: Fix a -Waddress-of-packed-member warning 2021-10-12 09:42:59 -05: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
b050d9870f logitech-hidpp: fix quirk entry for future device 2021-09-20 10:21:44 +02: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
297653f728 logitech-hidpp: remove user action message from Bolt receiver update 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
Richard Hughes
1ff96eb4b3 Restore the ABI for fu_device_detach() and provide new symbols
Quite a few plugins are using a FuDeviceLocker to detach then attach in
the error path, and finding them isn't easy as we explicitly cast to a
FuDeviceLockerFunc.

For sanity, just provide both symbols so we can do the right thing in
both cases. It seems like a sensible thing to allow.

Fixes https://github.com/fwupd/fwupd/issues/3771
2021-09-17 16:35:21 +01:00
Richard Hughes
e50d911a59 logitech-hidpp: Use accurate FuProgress steps 2021-09-17 14:45:39 +01: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
0792ac0477 logitech-hidpp: Don't assume all USB devices with VEN_046D are Unifying
Logitech only provided one peripheral update for unifying hardware as a
PoC and now we are supporting other receivers this does not make a lot
of sense. All the new Bolt peripherals will need quirks anyway.
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
Richard Hughes
2629944aa0 logitech-hidpp: Just use FuLogitechHidPpDevice rather than a stub 2021-08-31 17:15:15 +01:00