Commit Graph

25 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
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
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
fc3f95079e colorhug: Move the vendor specific setup out of common code
The now-defunct ColorHug devices are the only ones to support the
abandoned FW/GU descriptor specification.
2021-06-18 14:03:54 +01:00
Richard Hughes
bf72d393fd Split up FuUsbDevice into ->open() and ->setup()
Before this change calling FuUsbDevice->open() opened the device, and
also unconditionally added various GUIDs and InstanceIDs which we
normally do in setup.
Then fu_device_setup() would call the FuSubclass->setup() vfunc which
would have no way of either opting out of the FuUsbDevice->setup()-like
behaviour, or controlling if the parent class ->setup is run before or
after the subclass setup.

Split up FuUsbDevice->open() into clear ->open() and ->setup() phases
and add the parent class calls where appropriate.

This means that ->setup() now behaves the same as all the other vfuncs.
2021-06-17 16:21:41 +01:00
Richard Hughes
8eb5825bdb trivial: Show the USB class code when debugging 2021-06-17 14:41:49 +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
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
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
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
Richard Hughes
1a3d3b338e Make GUsb optional for fuzzing 2021-01-14 14:23:12 +00: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
6a489a9eaf trivial: Add missing calls to g_return_val_if_fail() 2021-01-04 15:24:35 +00:00
Richard Hughes
34f7d9d8fb Allow binding and unbinding kernel drivers 2020-09-21 20:07:54 +01:00
Richard Hughes
b02872cbea trivial: Add two unrecoverable error codes to all USB devices 2020-03-28 12:46:03 +00:00
Richard Hughes
184baf6f4a trivial: Partially revert some of 464eacdc
The FuUsbDevice was using a locker of NULL to indicate unlocked, and just
calling `fu_device_locker_close()` does not unset the object.
2020-03-27 13:21:47 +00:00
Richard Hughes
464eacdc53 libfwupdplugin: Use fu_device_locker_close() 2020-03-26 15:23:10 -05:00
Richard Hughes
f50ff2c27e Decouple the version format from the version itself
If we say that the version format should be the same for the `version_lowest`
and the `version_bootloader` then it does not always make sense to set it at
the same time.

Moving the `version_format` to a standalone first-class property also means it
can be typically be set in the custom device `_init()` function, which means we
don't need to worry about *changing* ther version format as set by the USB and
UDev superclass helpers.
2020-02-25 14:00:09 +00:00
Richard Hughes
c49a2aea88 trivial: Make the &HUB_ instance 16 bits wide for SuperSpeed devices 2020-02-11 11:17:34 +00:00
Richard Hughes
07a41b992e Add an extra instance ID to disambiguate USB hubs
In some hardware there are two identical USB hubs with different firmware.
One is upstream, and one is downstream, making up to 7 user-available ports.

Use the 'removable' bitfield to target the proper firmware to the correct
device, on the logic that the setting will be different on upstream (removable)
and downstream (non-removable, as on the same PCB) hubs.
2020-02-10 14:58:38 -06:00
Richard Hughes
a0d81c726f trivial: Fix up a few introspection problems in FwupdPlugin 2019-11-27 12:45:35 +00:00
Mario Limonciello
6b0e66354b Convert libfwupdprivate to a shared library libfwupdplugin 2019-11-27 11:32:43 +00:00