Commit Graph

12 Commits

Author SHA1 Message Date
Mario Limonciello
55de39c077 trivial: reformat the whole tree to match new format 2021-08-24 11:18:40 -05:00
Richard Hughes
19abf996c7 Allow the daemon to request interactive action from the end user
The "return error and hope the client resubmits the firmware again"
pattern is clunky. There are two plugins doing this now, and about to
be one more.

This adds FwupdRequest which provides a structured way of asking the
user to perform an action, e.g. to replug the device or to press a
special key or button.

This replaces much of the UpdateMessage and UpdateImage API although
it is still used internally. Clients capable of processing the new
DeviceRequest signal should add REQUESTS to their feature flags.

Also, this allows us go back to the old meaning of _NEEDS_BOOTLOADER,
which was "needs rebooting into a bootloader mode" rather than the
slightly weird "user needs to do something and resubmit request".
2021-07-14 17:03:50 +01:00
Richard Hughes
aaa77c6f51 Allow adding and removing custom flags on devices
The CustomFlags feature is a bit of a hack where we just join the flags
and store in the device metadata section as a string. This makes it
inefficient to check if just one flag exists as we have to split the
string to a temporary array each time.

Rather than adding to the hack by splitting, appending (if not exists)
then joining again, store the flags in the plugin privdata directly.

This allows us to support negating custom properties (e.g. ~hint) and
also allows quirks to append custom values without duplicating them on
each GUID match, e.g.

[USB\VID_17EF&PID_307F]
Plugin = customflag1
[USB\VID_17EF&PID_307F&HUB_0002]
Flags = customflag2

...would result in customflag1,customflag2 which is the same as you'd
get from an enumerated device flag doing the same thing.
2021-06-23 07:59:15 +01:00
Richard Hughes
fe7b0794b3 Use the parent physical ID to autoset the device parent
Of course, this only works if the parent and child both export a
FuDevice of the same physical kind, e.g. USB.
2021-06-19 16:57:35 +01:00
Richard Hughes
cf100293b5 Do not export useless device attributes to the client
That giant uint64_t isn't looking so big now, and we'll want to add even more
to it in the future. Split out some private flags that are never useful to the
client, although the #defines will have to remain until we break API again.
2021-01-06 14:36:23 +00:00
Richard Hughes
a2abc42760 libfwupdplugin: Use G_GNUC_WARN_UNUSED_RESULT for methods that should be checked 2021-01-04 15:24:35 +00:00
Richard Hughes
6d257cbe7f Fix probe warning for the Logitech Unifying device
The same plugin name was being added to the device from the quirk file more than
once, and so we enumerated the device *again* and tried to add a duplicate
device -- the device list correctly refusing to do so.

Check the plugin name does not already exist before adding it, and add a self
test to catch this for the future.
2020-10-27 15:43:17 +00:00
Richard Hughes
32173430d4 elantp: Only match the I2C adaptor on the correct laptop model
I2C doesn't have any specification for what is a probe and what is a more
destructive action. Sending tx_buf out on the i2c bus to a generic address
might not be safe in all cases.

To prevent this, use a HWID to check the machine DMI value during device
creation before ->probe() or ->setup() is called on the device.
2020-09-14 16:19:45 +01:00
Richard Hughes
b7fbb07dcb trivial: Convert the device order to an unsigned int
This allows us to set the parent of an existing parent without wrapping.
2020-09-14 10:13:33 -05:00
Richard Hughes
df408d2ab1 trivial: Allow plugins to use fu_device_set_priority() directly 2020-04-15 14:11:06 +01:00
Richard Hughes
69b761ce64 trivial: Export fu_device_add_instance_id_full() for plugins to use
Sometimes we only want to add the instance ID to get the quirk matches, and it
is confusing to see the "fake" IDs in the 'fwupdmgr get-devices' output.
2020-03-24 14:43:31 +00:00
Mario Limonciello
6b0e66354b Convert libfwupdprivate to a shared library libfwupdplugin 2019-11-27 11:32:43 +00:00