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
Richard Hughes
02222a58c8
trivial: Add FU_UDEV_DEVICE_FLAG_OPEN_SYNC for future code
2021-11-05 08:01:25 +00:00
Richard Hughes
0fb2ef3aae
trivial: Add fu_udev_device_seek() for future code
2021-11-05 08:01:25 +00:00
Richard Hughes
fe180cbf5d
trivial: Add fu_udev_device_get_sysfs_attr_uint64() for future code
2021-11-05 08:01:25 +00:00
Richard Hughes
bd43647554
Add fu_usb_device_new_with_context() helpers
...
This means the context is set at construction time, which is much less
fragile than setting the context manually.
2021-10-15 15:59:34 +01:00
Richard Hughes
852a6dbdc2
redfish: Handle EPERM when testing devices with a IPMI device
...
Fixes https://github.com/fwupd/fwupd/issues/3849
2021-10-12 19:12:57 -05:00
Mario Limonciello
55de39c077
trivial: reformat the whole tree to match new format
2021-08-24 11:18:40 -05:00
Richard Hughes
f42b44e427
Remove some deprecated API
2021-08-06 19:49:53 +01:00
Richard Hughes
6288886d35
trivial: Fix up an introspection tag added recently
2021-06-28 19:45:19 +01:00
Peter Marheine
6281467a6b
Add a fu_udev_device_get_children_with_subsystem function
...
This works like fu_udev_device_get_siblings_with_subsystem but returns child
devices of self rather than siblings.
2021-06-28 10:09:52 +01:00
Richard Hughes
9a2e10c639
trivial: Export the matching fu_udev_device_set_dev()
2021-06-24 14:22:08 +01:00