Commit Graph

127 Commits

Author SHA1 Message Date
Josh Soref
67deecde31
Lots of spelling fixes
Fixes:

* activate
* active
* additional
* and
* approaches
* attestation
* bootloader
* calculate
* capability
* children
* close
* compatible
* continuous
* convenience
* critical
* data
* delivery
* disabled
* disambiguate
* documented
* elapse
* emergency
* erasable
* expectations
* filesystem
* from
* haptic
* ignorable
* images
* infinity
* information
* information
* inhibited
* insufficient
* interrupt
* into
* limited
* management
* manifest
* maximum
* memory
* metadata
* mismatch
* model
* nonexistent
* not
* objects
* offset
* omissions
* ota
* past
* perform
* peripherals
* predictable
* product
* quarterly
* quirk
* quirks
* recognize
* release
* requests
* revocation
* sanitized
* sector
* status
* the
* the update
* timeout
* transfer
* transfers
* typically
* unspecified
* upgrade
* which
* will
* wireless
2022-12-29 13:57:31 +00:00
Sanjay Sheth
8e32b6a353 New plugin for Logitech Whiteboard camera 2022-11-17 16:42:04 +00:00
Richard Hughes
c79e14d63d Flip around the FuDeviceInstanceFlags logic
Opt-ing 'in' to each both behaviours requires less mental gymnastics compared
to having one flag inverted.
2022-11-04 13:44:23 +00:00
Richard Hughes
26e1b7c49b Never hang in g_udev_device_get_parent() if there is never a busnum
Spotted by Coverity.
2022-11-03 23:51:00 -05:00
Richard Hughes
064da70916 trivial: Fix docs warning for fu_udev_device_find_usb_device() 2022-11-01 16:23:17 +00:00
Richard Hughes
ae99b57b2a trivial: Fix over-constification in fu_udev_device_get_siblings_with_subsystem() 2022-11-01 16:19:27 +00:00
Richard Hughes
ee03652200 trivial: Allow specifying NULL for fu_udev_device_get_parent_with_subsystem() 2022-11-01 16:19:27 +00:00
Richard Hughes
ac48c865a0 Add a helper to get a GUsbDevice from a FuUdevDevice 2022-10-26 23:27:50 +01:00
Richard Hughes
2dea742004 Match the MEI UUID in quirk files
This allows us to be more specific when matching devices, and also means we get
more attributes 'for free' from the FuUdevDevice->probe().

This would allow us to have multiple device GTypes handling multiple MEI
interfaces in the same plugin., for instance, PTHI and MKHI.

The slight fly in the ointment is that the kernel does not set the 'dev' for
the mei_me devices, but it's always going to be just /dev/mei0, so hardcode it.
2022-10-12 13:17:42 +01:00
Mario Limonciello
aebf33c4f6 trivial: libfwupdplugin: fix an error return string 2022-09-07 08:24:10 -05:00
Richard Hughes
fa2df1eed6 Use ID_VENDOR_ID and ID_MODEL_ID fallbacks
Some udev subsystems run probers to populate the values, rather than
just the kernel providing the sysfs files. Support reading these too.
2022-08-24 15:54:58 +01:00
Mario Limonciello
82e2d613aa Add GUIDs using MODALIAS as well
This will allow targeting the same thing that kernel drivers use to load the hardware
2022-08-22 06:03:19 -05:00
Richard Hughes
221238b4c0 trivial: Allow each device to specify a different acquiesce delay
Different device classes may need different values, and these may need
modifying by quirks. Also use 50ms to flush out any pending events.
2022-07-21 15:27:04 +01:00
Richard Hughes
4f9b455880 Add UDev devices to the _REQUIRES_ACQUIESCE opt-in 2022-07-21 15:27:04 +01:00
Richard Hughes
71c0641394 trivial: Fix a -Wunused-function warning on Windows 2022-07-10 11:15:16 +01:00
Richard Hughes
6f5ebc5492 Handle ENOTTY with the correct error code for ioctl calls
Fixes half of https://github.com/fwupd/fwupd/discussions/4810
2022-07-08 16:25:38 +01:00
Richard Hughes
165b450e80 trivial: Fix a tiny memory leak caused by VENDOR_FROM_PARENT 2022-07-01 14:57:41 +01:00
Richard Hughes
d7479423a0 trivial: Add SUBSYS instance data if *either* of the vendor or model are set 2022-06-30 19:06:38 +01:00
Richard Hughes
ced79fce4a Create the better device GType in the backend
It is weird to do this when constructing the object, and it allows us
to match PossiblePlugin quirk matches on potentially better instance
IDs added by the superclass.
2022-06-30 19:06:38 +01:00
Richard Hughes
6ac6372b2a trivial: Make the FuUdevDevice->to_string() more complete 2022-06-30 14:17:53 +01:00
Richard Hughes
c7b3cd5b8a Fix a hidraw regression
Ensure that udev_parent is actually set before checking it for NULL.
2022-06-30 14:17:53 +01:00
Richard Hughes
5b17189bc1 Fix FuUdevPlugin to use 0x0 for unset
We were using 0x0 and 0xFFFF in different places, and only checking the
former in most cases. Just restrict the range to 0xFFFE and use 0x0 as
*invalid or not set* as before.
2022-06-30 14:17:53 +01:00
Richard Hughes
3d654e9b68 Enforce that the UDEV VEN:DEV is a uint16_t
This was incompletely fixed in bf256a7ca7
and changing the type means that the compiler finds any places where
we compare it with a uint32_t.
2022-06-30 14:17:53 +01:00
Richard Hughes
5cdb517056 Get the UDev vendor ID from the grandparent when required 2022-06-26 17:27:05 -05:00
Richard Hughes
a70d005ea3 trivial: Use a better error message disambiguate an error message 2022-06-23 21:56:06 +01:00
Daniil Lunev
38fb424246 Fix setting version for udev devices
Change-Id: I907bb3958b624ff5f887cbc192f54448354d9d5c
2022-06-17 07:03:58 +01:00
Richard Hughes
700ea6cf0d Do not add 'unset' UDev vendor or model information 2022-06-15 13:09:11 +01:00
Richard Hughes
bf256a7ca7 Read the UDev vendor and model as a uint16_t 2022-06-15 13:09:11 +01:00
Richard Hughes
4655e028a6 Copy more properties when doing FuUdevDevice->incorporate
We're supposed to be copying any private data derived during ->probe()
so we can create a superclass with the same attributes.
2022-06-14 21:01:57 +01:00
Richard Hughes
fc2da47b69 Remove fu_strtoull_full() 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
b3f69c1c47 scsi: Use the SCSI target to correctly set the physical ID
We don't want to include the SCSI LUN in the physical ID, as this is a
logical concept not relating to the hardware device.

Use the UDev devtype to find the 'correct' parent.
2022-06-11 11:06:01 +01:00
Richard Hughes
165ce50614 Revert "Speed up daemon startup by 650ms"
This reverts commit a7642a7b7e.

I forgot that we need the TYPE, DRIVER and most importantly subsystem
for PossiblePlugin quirk matches. We need something more subtle.
2022-06-08 07:56:45 +01:00
Richard Hughes
d6fd08e3a5 Remove some deprecated API 2022-06-03 13:47:11 -05:00
Richard Hughes
0cbcac93cd Rename fu_udev_device_ioctl_full() as we broke ABI 2022-06-03 13:47:11 -05:00
Richard Hughes
029d2895bd Rename fu_udev_device_pread_full() as we broke ABI 2022-06-03 13:47:11 -05:00
Richard Hughes
a7642a7b7e Speed up daemon startup by 650ms
Reading properties from drm_dp_aux1 and drm_dp_aux2 took 700ms, and
we're never going to match any GUIDs as the vendor and model IDs are
both unset.
2022-06-01 15:50:13 +01:00
Richard Hughes
5031ea2c6b trivial: Fix introspection warning when building docs 2022-05-06 08:38:01 +01:00
Richard Hughes
2fcdf352df Retry the device ioctl for EAGAIN 2022-04-29 15:01:32 +01:00
Richard Hughes
c1ff3e67af trivial: Fix a small memory leak when getting the udev parent 2022-03-25 21:12:53 +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
e3583793ed trivial: Fix two potential critical warnings when finding devices 2022-02-24 17:07:32 +00:00
Richard Hughes
bd02edcc43 trivial: Add missing API wrapper for future functionality 2022-02-21 18:57:20 +00:00
Richard Hughes
308e03a6f4 Sanitize the instance ID parts more carefully
The only users of `SERIO\FWID` and `I2C\NAME` are already 'safe' and
the device GUIDs should all be unchanged.

There are no current users of the `MTD\NAME` instance IDs, and these
are the ones that may be more unpredictable and in need of sanity.
2022-02-18 08:23:39 +00:00
Richard Hughes
c71ca76235 Add a plugin to set GPIOs for the duration of an update 2022-02-16 14:01:07 +00:00
Richard Hughes
2e99055d1e trivial: Add some more annotations for language bindings 2022-01-03 22:46:23 +00:00
Richard Hughes
736a56ccee Use the UDev devtype for quirk matching 2021-12-30 16:35:04 +00:00
Richard Hughes
60d266cbc6 Add support for UF2 devices
A UF2 device exposes a VFAT block device (sometimes called a Mass
Storage Device) which has a virtual file called `INFO_UF2.TXT` where
metadata can be read. It may also have a the current firmware exported
as a file called `CURRENT.UF2` which is in a 512 byte-block UF2 format.

Writing any file to the MSD will cause the firmware to be written.
Sometimes the device will restart and the volume will be unmounted
and then mounted again. In some cases the volume may not “come back”
until the user manually puts the device back in programming mode.

Match the block devices using the VID*PID, UUID or label, and then
create a UF2 device which can be used to flash firmware.

Note: We only read metadata from allow-listed IDs to avoid causing
regressions on non-UF2 volumes. To get the UUID and label you can
use commands like:

    udisksctl info -b /dev/sda1
2021-12-21 10:06:18 +00:00
Richard Hughes
36d7077f65 Add a new plugin to handle MTD devices 2021-11-05 20:01:51 +00:00
Richard Hughes
ed419416d5 Allow setting the FuUdevDevice bind-id at runtime 2021-11-05 15:00:10 +00:00