Commit Graph

72 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
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
Richard Hughes
a2682eeed9 Add a device flag to ignore the serial number
On some devices the serial number is junk, or not set. On some Wacom
hardware reading the serial LangID puts the device into Android mode...
2021-06-18 14:03:54 +01:00
Richard Hughes
a02c1073f2 trivial: Fix up some of the developer docs
And add some missing content as requried.
2021-06-11 09:39:03 +01:00
Mario Limonciello
1e17457b16 Allow building the documentation with gi-docgen and gtk-doc
Until gi-docgen is declared stable support either of them.
This effectively means that hand builds and CI builds will use
gi-docgen, but distro builds use gtk-doc-tools.
2021-06-09 22:21:53 +01:00
Richard Hughes
99f40fa7a7 Add a FuI2cDevice to abstract I²C devices 2021-05-18 14:29:28 +01:00
Richard Hughes
20ef071b3c trivial: Style fixes to lots of gtk-doc 2021-05-10 14:35:10 +01:00
Richard Hughes
89d45a0d91 trivial: Standardize on introspection for @error and @cancellable
Also standarize on `Returns:` for the result.
2021-04-28 16:19:50 +01:00
Richard Hughes
5523ac46e3 trivial: Fix introspection markup for a new symbol 2021-04-20 15:09:58 +01:00
Richard Hughes
d42bd85059 trivial: Do not use the deprecated allow-none introspection argument
It's been deprecated since 2014... oops.

https://blogs.gnome.org/desrt/2014/05/27/allow-none-is-dead-long-live-nullable/
2021-04-19 14:46:42 +01:00
Peter Marheine
da9a07ba8f FuUdevDevice: add get_siblings_with_subsystem function
This function returns a list of sibling devices that have a chosen subsystem,
allowing callers to perform a limited walk of the device tree to locate related
devices.
2021-04-15 06:53:06 +01:00
Norbert Kamiński
76e19930a8 fwupd port for BSD distros
Signed-off-by: Norbert Kamiński <norbert.kaminski@3mdeb.com>
2021-03-19 17:05:09 +00:00
Richard Hughes
2d84386034 Remove unused, unsafe and deprecated functions from libfwupdplugin
Keeping *internal* API and ABI compatibility makes working with an already
complex codebase more mentally demanding than it needs to be.

Remember: plugins should be in-tree and upstream! If your out of tree plugin
stops working then it should be upstream.

The public-facing libfwupd will remain API and ABI stable for obvious reasons.
2021-03-09 15:47:56 +00:00
Richard Hughes
bf3732f994 pixart: Use the bluetooth UUID to set the logical ID
This means you can have more than one device attached to the same controller.
2021-03-03 15:36:42 +00:00
Richard Hughes
0b6c67a3e3 trivial: Set the GError when calling ioctl() on an un-opened device
I've not yet worked out the real bug, but it was unexpected to crash the daemon
when open failed, rather than for a critical misuse of the API.
2021-02-25 16:21:56 +00:00
Richard Hughes
253e6e4f17 Add a backend ID to the device
This is typically a Linux sysfs path or USB platform ID and is used in a
different way to the physical ID. The physical ID is only set for some devices
after setup() and depends on the subsystem list, and this would not be defined
for devices that do not match a plugin.

This also fixes an regression where the FuDeviceList fails to match the new
FuUdevDevice device in fu_device_list_get_by_guids_removed() and instead
silently gets 'fixed up' only if FWUPD_DEVICE_FLAG_NO_GUID_MATCHING is not set.

This also allows us to move the various backends device caches to FuBackend as
we now have a suitable ID that is for just the backend to use.
2021-02-24 16:49:42 +00:00
Richard Hughes
2e1245728f Call the superclass directly from subclassed devices
This allows a device subclass to call the parent method after doing an initial
action, or even deliberately not call the *generic* parent method at all.

It also simplifies the plugins; you no longer have to remember what the plugin
is deriving from and accidentally clobber the wrong superclass method.
2021-02-18 16:18:34 +00:00
Ricardo Cañuelo
a92026476b Fix ioctl error checking
fu_udev_device_ioctl() interprets the return value of ioctl() as the
error cause and generates a misleading error message (permission
denied).
Fix it to use errno for error checking and reporting.
2021-02-15 16:39:00 +01:00
Richard Hughes
5c9b1fcc81 Only include the start year in the copyright header
The end year is legally and functionally redundant, and more importantly causes
cherry-pick conflicts when trying to maintain old branches. Use git for history.
2021-01-07 14:48:16 +00:00
Richard Hughes
eddaed0c11 Allow specifying more than one VendorID for a device
Asking the user for the UID mapping isn't working very well, as it requires lots
of manual handholding. It also doesn't work very well when the device vendor
does not actually have a PCI ID or if the vendor has split into two entities.

Just use the OUI address as an additional VendorID and match any of the device
IDs against any of the metadata-supplied values.
2021-01-04 22:30:20 +00:00
Richard Hughes
64e9f6bd92 trivial: Fix up some NULL/FALSE confusion 2021-01-04 16:32:50 +00:00
Richard Hughes
6a489a9eaf trivial: Add missing calls to g_return_val_if_fail() 2021-01-04 15:24:35 +00:00
Richard Hughes
e5074cdbbb trivial: Fix compiling without GUdev 2020-12-14 11:34:43 +00:00
Richard Hughes
0ec634e7db trivial: Codespell fixes 2020-12-07 20:55:18 +00:00
Richard Hughes
ab63e94107 Fall back to the misc device for serio devices 2020-12-03 10:58:38 +00:00
Richard Hughes
9d78383622 Actually implement rescan in FuUdevDevice
This allows the plugin to force a reload of the device using a new GUdevDevice
object. This is required as the values are cached in the immutable object.
2020-12-03 09:07:24 +00:00
Richard Hughes
d51f2ec939 trivial: Use DEVPATH for platform UDev devices 2020-12-01 14:15:33 +00:00
Richard Hughes
70aca476d7 Add the serio->firmare_id for UDev devices
If set, it is a device-specified InstanceID specifying the firmware stream.
2020-12-01 14:15:33 +00:00
Richard Hughes
7a63a4c41c Export the driver name from FuUdevDevice
We have to supply it when using fu_device_bind_driver(), so we need to get the
old value for ->attach() to avoid guessing what driver was previously loaded.
2020-12-01 14:15:33 +00:00
Richard Hughes
419c04c504 trivial: Show the subsystem when calling FuUdevDevice->to_string() 2020-12-01 14:15:33 +00:00
Érico Rolim
0651aeef24 Fix header names.
- <sys/poll.h> should be <poll.h>
- <sys/errno.h> should be <errno.h>
2020-10-10 12:33:56 +01:00
Richard Hughes
496fb826f1 trivial: Add fu_udev_device_get_number() 2020-09-26 12:20:41 +01:00
Richard Hughes
f02571b3f3 Use the 'real' hardware class for virtual classes like net 2020-09-25 13:25:52 +01:00
Richard Hughes
de9be2d34c trivial: Correctly set subsystem when using _VENDOR_FROM_PARENT 2020-09-25 13:25:52 +01:00
Richard Hughes
6b5926ca59 trivial: Fix two warnings in the win32 build 2020-09-24 09:19:15 +01:00
Richard Hughes
34f7d9d8fb Allow binding and unbinding kernel drivers 2020-09-21 20:07:54 +01:00
Richard Hughes
b9ef4399c9 Remove unused udev rules
We used these before we had the quirk files, and now with all the VLI devices
supported in the quirk files these entries do nothing at all.
2020-09-20 19:11:44 +01:00
Richard Hughes
0038b4a780 Allow plugins to match using the SUBSYS IDs
This is the same format specified by Microsoft in "Identifiers for PCI Devices"
https://docs.microsoft.com/en-us/windows-hardware/drivers/install/identifiers-for-pci-devices
2020-09-17 15:25:26 +01:00
Richard Hughes
ad32b0c17e elaptp: Allow recovery when the HID firmware fails to load 2020-09-14 16:19:45 +01:00
Richard Hughes
a06a480904 trivial: Allow using fu_udev_device_pread_full() at offset zero
Do not enforce the port is nonzero when reading and writing to a device.
2020-09-14 16:19:45 +01:00
Mario Limonciello
6d0c4897e1 fu-udev-device: call rescan on the device for change events
This allows calling the correct method, and instead doesn't have
all the plugins try to process the event when they're missing
vfuncs
2020-09-11 13:15:51 -05:00
Richard Hughes
9a07407401 Use the FuUdevDevice ->to_string() output
Print the sysfs path for devices deriving from FuUdevDevice, which also allows
us to use FU_UDEV_DEVICE_DEBUG without monkey-patching the plugins that also
define a device_class->to_string() vfunc.
2020-09-03 16:50:41 +01:00
Richard Hughes
ecb4d1416d trivial: Only use FU_UDEV_DEVICE_FLAG_VENDOR_FROM_PARENT as a fallback
If the device node actually provides a vendor string, always use that before
falling back. The flag was initially designed to fall back in the event the NVMe
device does not declare a valid sysfs vendor ID.
2020-09-03 16:50:41 +01:00
Richard Hughes
82f9a85201 Fall back from ID_VENDOR_FROM_DATABASE to ID_VENDOR for NVMe devices 2020-09-03 16:50:41 +01:00
Richard Hughes
241bdbb0f5 trivial: Fix some dead code as-seen by Coverity 2020-09-01 14:12:27 +01:00
Richard Hughes
b81140de75 libfwupdplugin: Fix some NULL/FALSE confusion 2020-08-17 14:47:17 +01:00
Richard Hughes
8edaa89076 libfwupdplugin: Allow opening i2c devices with O_NONBLOCK 2020-07-28 14:19:24 +01:00