Commit Graph

123 Commits

Author SHA1 Message Date
Richard Hughes
b01b4869bb trivial: Use fu_plugin_add_runtime_version() in the Dell plugin 2018-04-20 20:45:08 +01:00
Mario Limonciello
a98df55d82 Disable -Wunused-function on clang builds (Closes #467)
GLib creates two static inline functions for paramaters that may
not be used that set off warnings in clang but not gcc.

Ignore these on clang builds everywhere that
G_DEFINE_AUTOPTR_CLEANUP_FUNC is used.
2018-04-17 10:10:43 +01:00
Sjoerd Simons
9f10cbacaf Set Dell dock metadata
On Dell dock devices set the FU_DEVICE_METADATA_DELL_DOCK_TYPE metadata
field which gets used by the synapticsmst plugin for recognizing dell
dock types.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
2018-04-10 15:57:59 -05:00
Mario Limonciello
e37cd0d8ce dell: Report Libsmbios version in metadata 2018-02-06 19:29:28 +00:00
Mario Limonciello
9f932edaca trivial: dell: blacklist another system when used with older libsmbios
The reporter confirmed that changes in libmsbios 2.4.0 fix the problem
however.
Bug: https://bugs.launchpad.net/ubuntu/+source/libsmbios/+bug/1744782
2018-01-31 13:59:42 -06:00
Mario Limonciello
3780bb5c0d dell: Add a test for libsmbios version
This will be useful in the future for debugging crashes with known
problematic versions of libsmbios.

Also use this information to turn off the blacklist from previously
bad known combinations of libsmbios + certain systems
2018-01-27 22:48:36 -06:00
Richard Hughes
2de8f13b2c Allow each plugin to opt-in to the recoldplug action
Recoldplug is really not required for the USB based plugins, and we should
restrict this action to plugins that have inter-dependencies on each other.
2018-01-17 20:19:58 +00:00
Mario Limonciello
736be7440f dell: block owned TPM updates (#339)
Also make it clearer what the logic is checking.
2017-12-13 12:13:33 -06:00
Richard Hughes
4a036018f7 Set the progress and state on the FuDevice, not the FuPlugin
This makes more sense; we're updating the device, not the plugin itself.

This also means we don't need to funnel everything through callbacks like
GFileProgressCallback and we can also update the state without adding an
explicit callback to each derived device type.
2017-11-30 20:51:52 +00:00
Mario Limonciello
2e52dc2242 dell: disable plugin if libsmbios fails 2017-11-14 13:20:59 -06:00
Mario Limonciello
20e856ccbe dell: activate libsmbios_c debugging output with --plugin-verbose=dell 2017-11-14 12:00:49 -06:00
Richard Hughes
a14d771476 dell: Fix a trivial warning spotted by clang 2017-11-09 12:15:55 +00:00
Mario Limonciello
7f3bfc9d99 dell: catch invalid dock component requests
Test if g_strrstr returns NULL, as this means the string was
modified and other requests predicated on this will fail miserably.
2017-11-07 09:46:36 -06:00
Mario Limonciello
3164784d9e dell: fix crashes when enumerating with dock connected but UEFI capsule off
Crashes will happen when UEFI capsule is turned off due to fwupdate
trying to do a SMI request that invalidates the buffer used by fwupd.

This is due to both fwupdate and fwupd using libsmbios in the same process.
Fixes: https://bugs.launchpad.net/ubuntu/+source/fwupd/+bug/1726367
2017-11-07 09:46:36 -06:00
Richard Hughes
74a80ccc50 dell: Use the new quirk infrastructure for version numbers 2017-11-02 19:08:51 +00:00
Mario Limonciello
7af941fee4 synaptics: drop hard dependency on dell plugin and libsmbios
Rather than have a hard dependency use metadata and internal DMI
to communicate the relevant details
2017-10-18 08:27:38 -05:00
Richard Hughes
4212f40e9d trivial: Fix failure to build on i386 2017-10-09 12:17:02 +01:00
Mario Limonciello
26767845f1 trivial: dell: add missing icon for TPM devices 2017-09-28 10:25:30 -04:00
Mario Limonciello
5a8e8ee88d dell: only set coldplug delay when we know we need it
It's not very common to have a system with a Synaptics MST hub or
a dock plugged in.  Avoid slowing down fwupd enumeration in the
common scenario.
2017-09-26 08:56:07 -04:00
Mario Limonciello
e401edd107 dell: only run SMI to toggle host MST GPIO on systems with host MST
As type-C docks become more common MST controllers in the host are
going to become rarer.  This should be a manageable whitelist
and prevent running the SMI on the majority of systems.
2017-09-26 08:56:07 -04:00
Mario Limonciello
5a3ff3a446 trivial: dell create a function for looking up system ID
Enough places look for it that code duplication should go away.
2017-09-26 08:56:07 -04:00
Mario Limonciello
48cae2cb5e dell: add functionality to blacklist HW with problems
This is certainly a problem lower in the stack, but at least provide
a method to block these systems from bringing down fwupd until it's
fixed.
2017-09-26 08:56:07 -04:00
Mario Limonciello
e0e6a0b885 dell: only run on intended chassis
For example if trying to run on a server, they might support some
dell SMI but are architected differently.
2017-09-26 08:56:07 -04:00
Mario Limonciello
39c4436c3d trivial: dell: move fu_dell_supported into plugin
Eventually fu-dell-common will not be used by synaptics, and it's
already not using this function.
2017-09-21 06:23:24 +08:00
Mario Limonciello
1edb50ed2f trivial: dell: remove needless includes 2017-09-20 09:11:02 -05:00
Mario Limonciello
9a30ef284d dell: prefer to use hwids to get DMI keys and DE table
libsmbios is still used as a fallback in some cases, mostly
because it's not clear whether or not ProductSKU is available
in all instances.
2017-09-20 09:11:02 -05:00
Richard Hughes
9decf17d82 dell: Fix a trivial whitespace issue 2017-09-16 18:52:44 +01:00
Mario Limonciello
9d84b22d7b dell: drop thunderbolt force power code
This is replaced by the WMI force power interface.
2017-09-13 03:12:50 +08:00
Richard Hughes
c1c2fec6f5 Add optional icons to each device
This allows us to show the devices in a GUI with a nice icon. Some of the icon
mappings are not perfect and I'll be asking the GNOME designers for some
additions to the icon specification.

Custom vendor icons can also be specified, and /usr/share/fwupd/icons would be
a good place to put them. If vendor icons are used they should show a physical
device with the branding, rather than just the vendor logo.
2017-09-11 17:27:35 +01:00
Richard Hughes
9bfcfd88cf Ensure more devices set the device summary
This helps users identify what the device actually does.
2017-09-11 15:10:50 +01:00
Richard Hughes
5720fc9d90 trivial: Add more vendor information to devices 2017-09-11 10:11:34 +01:00
Richard Hughes
7ac92109eb trivial: Remove useless config.h defines
The HAVE_UEFI_UNLOCK and HAVE_UEFI_GUID defines are always present for the
libfwup version we require.
2017-09-06 23:07:50 +01:00
Mario Limonciello
bb9d3b14dd Revert "dell: prefer to detect supported systems from OEM strings"
This reverts commit 257c14ebd1.

Although this is the preferable way to detect Dell systems this was
leading to executing SMI on some systems with problems.
libsmbios has some memory issues that need to be fixed first.
2017-08-31 16:48:45 -05:00
Richard Hughes
b95b75a211 trivial: Remove unused function in the dell plugin
Fixes: https://github.com/hughsie/fwupd/issues/209
2017-08-30 10:54:29 +01:00
Mario Limonciello
f1cc61d2f0 trivial: dell: TPM switching blacklist->whitelist
It's been decided that TPM mode switching won't be supported
on any other new platforms.  Instead of blacklisting the outliers
whitelist the (smaller) list of platforms that do support the
feature.
2017-08-29 16:37:14 -05:00
Mario Limonciello
257c14ebd1 dell: prefer to detect supported systems from OEM strings
This requires dmidecode 3.1 or later.
SMBIOS tables are not a reliable enough method on all systems.
2017-08-29 16:37:14 -05:00
Mario Limonciello
1790115c93 trivial: dell: don't advertise ---force in an error message 2017-08-29 15:23:00 -05:00
Yehezkel Bernat
f8e5622726 trivial: fix compilation warning
Signed-off-by: Yehezkel Bernat <yehezkel.bernat@intel.com>
2017-08-29 14:48:45 -05:00
Mario Limonciello
7291c5b3ba trivial: fix TBT controller safe mode handling on Dell
- Set initial (invalid) GUID for TBT controller
- Don't set updatable unless GUID has been refreshed
- Correct the string used for GUID in Dell plugin
2017-08-28 13:24:59 -05:00
Richard Hughes
a785a1c2f6 Remove the confusing ALLOW_OFFLINE and ALLOW_ONLINE flags
Over the months the original meaning of ALLOW_OFFLINE and ALLOW_ONLINE have be
lost, and there is now a confusing mixture of uses in the source tree. With this
commit we make it clear the UPDATABLE flag is used to specify when the device is
updatable (e.g. from the desktop live session, or from the systemd offline
updates mode, or both) and the NEEDS_REBOOT flag lets us know when the update
is actually going to be done.

For instance, a UEFI UpdateCapsule can be *scheduled* from either the desktop
or from the update mode (but the latter would be a bit weird), but does require
a reboot. Some devices might only be updatable outside the live session, for
instance a hard drive update or a GPU update -- there's just too much going on
with a live session and we want to tightly control what's running during the
firmware flash.

This also means we don't have to "retry" the update when scheduling an update
that really can be scheduled whenever, but just requires a reboot to apply.
2017-08-26 18:09:21 +01:00
Mario Limonciello
3bc251b3a8 thunderbolt: when in safe mode on a Dell system look up VID/DID from SMBIOS
Signed-off-by: Richard Hughes <richard@hughsie.com>
2017-08-25 09:46:41 +01:00
Mario Limonciello
35a0e864b8 Introduce concept of CanForcePower to turn on TBT controllers
Supported Dell devices will use this to turn on ThunderBolt controllers
during coldplug.
2017-08-25 09:35:46 +01:00
Richard Hughes
4bfcae2921 trivial: Fix a tiny leak in the Dell plugin 2017-07-24 10:51:29 +01:00
Mario Limonciello
5f6a574fd7 fix some more memory leaks in dell plugin (#158) 2017-07-21 13:17:47 -05:00
Mario Limonciello
11ca8122c3 Revert "trivial: fix some more memory leaks in dell plugin (#158)"
This reverts commit 49aba8cd87.

That was prematurely committed, my apologies.
2017-07-18 16:00:03 -05:00
Mario Limonciello
32899e5ff7 dell: use plugin hash table instead 2017-07-18 15:53:38 -05:00
Mario Limonciello
49aba8cd87 trivial: fix some more memory leaks in dell plugin (#158) 2017-07-18 15:53:38 -05:00
Mario Limonciello
d817c53697 Correct a memory leak in Dell plugin (Fixes #158) 2017-07-18 10:35:21 -05:00
Mario Limonciello
c7e5322454 dell, uefi: Display all errors recorded by efi_error tracing, not just the first one 2017-07-10 14:11:10 -05:00
Mario Limonciello
c1a4bd469d uefi,dell: make error messages from installing capsules useful
Before:
$ fwupdmgr install XPS_test.cab
Retrying as an offline update...
Scheduling…            UEFI firmware update failed: -1

After:
$ fwupdmgr install XPS_test.cab
Retrying as an offline update...
Scheduling…            UEFI firmware update failed: libfwup.c:733 get_paths(): could not find shim or fwup on ESP: No such file or directory
2017-07-06 11:38:33 -05:00
Mario Limonciello
e70e5513ca dell: don't initialize libsmbios on unsupported systems
As found in https://github.com/dell/libsmbios/pull/13
there are some errors with libsmbios error paths.

These need to be fixed in libsmbios, but at least avoid
running this code on those systems (and crashing fwupd).
2017-02-20 14:54:12 -06:00
Mario Limonciello
7319259a84 Add a new function fu_dell_supported to fu-dell-common
This is used by Dell, Synaptics and Thunderbolt plugins
to identify if the system is a Dell system and if so
activate special code paths.
2017-01-30 20:58:28 -06:00
Mario Limonciello
bae3a02348 trivial: dell: move some dock lookup code into -common
This allows other plugins to compile in -common to be able look
up some dock related items.
2017-01-30 20:17:48 -06:00
Mario Limonciello
0800097d25 trivial: dell: rework dell plugin to track a single smi object
Tracking a single smi object in the plugindata is more similar
to how other plugins operate and also allows moving FuPluginData
out of fu-dell-common, making fu-dell-tool less hacky and letting
other plugins use fu-dell-common as needed.
2017-01-30 15:48:54 -06:00
Mario Limonciello
493b63f6cc trivial: shuffle fu-dell-flash into fu-dell-common
This will make sharing common functions from the dell plugin with
others easier
2017-01-23 11:27:03 -06:00
Mario Limonciello
72f905d846 trivial: dell: fix test suite
Commit cd87fca broke running the test suite on machines without
UEFI capsule support.
2017-01-19 14:16:23 -06:00
Mario Limonciello
cd87fcae5a trivial: dell: don't disable plugin if UEFI capsule isn't supported
It now supports enabling things for other plugins too, so rather
mark any devices created by Dell as only readable, not flashable
when UEFI capsule is off.
2017-01-17 11:49:33 -06:00
Mario Limonciello
908b17e1fb trivial: dell: Don't output error domain twice 2017-01-17 11:38:34 -06:00
Mario Limonciello
f48a93546e trivial: dell: only enable coldplug delay when needed
The coldplug delay that Dell uses is only needed for the thunderbolt
and synaptics MST plugins.
2017-01-17 11:35:20 -06:00
Mario Limonciello
038d386a82 dell: introduce a standalone (noinst) tool to force mode flashes 2017-01-11 15:35:55 -06:00
Mario Limonciello
9df75f7206 trivial: dell: move coldplug delay setting to startup() 2017-01-10 17:13:08 -06:00
Mario Limonciello
592ab30b3c trivial: dell: update_prepare/update_cleanup on only certain plugins 2017-01-10 15:39:25 -06:00
Richard Hughes
b082903c5f Add fu_plugin_set_coldplug_delay() to allow hardware to initialize if required 2017-01-10 09:27:08 +00:00
Richard Hughes
efa55b83a7 dell: Fix possible linker problem
The linker does not know which public symbol to call if a plugin calls it's own
symbol. Without this change one plugin could call into another plugin with the
wrong GsPluginData set.
2017-01-09 21:32:44 +00:00
Mario Limonciello
2bcc151619 dell: Adjust the coldplug preparation and cleanup sequence
Unfortunately no indication is made that a GPIO change is
done so some time needs to be left to make sure this happened.
2017-01-09 13:31:35 -06:00
Richard Hughes
1d511fafa6 trivial: Fix a uninitialized value in the dell plugin
Spotted using clang.
2017-01-07 22:14:28 +00:00
Richard Hughes
46487c944a Add the ability to run a prepare->exec->cleanup on coldplug
The idea here is that plugins can 'wake up' hardware in prepare, and put it
back into powersaving mode when doing cleanup.
2017-01-07 21:26:36 +00:00
Richard Hughes
57d8bf6590 trivial: Fix a compile warning in the dell plugin 2017-01-07 21:15:46 +00:00
Mario Limonciello
5723c2f643 dell: Add coldplug methods to let other plugins turn on TBT/GPIO
Remove the dummy devices created for NVM and MST, these will
be created by other plugins.  Other plugins will however
be using the Dell methods to enable these devices.
2017-01-06 15:25:57 -06:00
Mario Limonciello
ddeb0297bf trivial: dell: remove unnecessary usb_ctx after moving to plugins 2017-01-06 12:03:21 -06:00
Mario Limonciello
3b09e323c8 trivial: whitespace fixes in dell plugin 2016-12-15 10:30:41 -06:00
Mario Limonciello
9bb952ac7e dell: add a new method for forcing a controller to flash mode
This method will be used in conjunction with other new plugins
in the future that will perform online flashes.
2016-12-15 10:30:37 -06:00
Richard Hughes
cff38bcb3a Convert the providers to plugins to simplify code and for future features
This is a large commit that removes all the providers and turns them into
plugins. I think having both providers _and_ plugins was super confusing.

Plugins are loaded at runtime so you could in theory develop a new plugin
without putting it in the fwupd source tree, although there are no installed
headers or PC files as I'm not sure it's a good idea at this stage.

This commit moves all the per-provider docs, tests, notes, debug dumps and test
data to plugin-specific directories -- these also allows the plugin author to
"own" more of the source tree so we don't enforce fu- prefixes and the style
guide everywhere.

This allows us to run the same action on all the plugins in the future, so we
could have a prepare(FuPlugin, FuDevice) and cleanup(FuPlugin, FuDevice) run
on *all* plugins, so doing an update using one plugin would allow us to work
around hardware quirks in other plugins.

If I've broken your out-of-tree provider it's trivial to port to the new API
with sed and a fixed up build file. If you need help please let me know.
2016-12-12 12:31:23 +00:00