Commit Graph

82 Commits

Author SHA1 Message Date
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
Yehezkel Bernat
9157104100 thunderbolt: handle "native" mode
Kernel v4.15 added support for native enumeration of Thunderbolt
topology. The enumeration mode affects both the BIOS and TBT FW
operation so they must agree on it. Platforms may support both modes,
native and "legacy" (or "BIOS-assist").

This change makes sure the new image is compatible with the current
controller mode (otherwise the BIOS and TBT FW will not be alligned on
it at least until next boot) and also adds a new GUID generation logic
for a controller in "native" mode so LVFS could contain 2 images, one for
the "legacy" mode and one for "native".

Signed-off-by: Yehezkel Bernat <yehezkel.bernat@intel.com>
2018-01-08 16:28:23 +00:00
Richard Hughes
024cc230ed Add fu_device_set_progress_full()
This allows the plugin to use the raw byte values as a progress counter without
first converting to a percentage.
2017-12-08 09:36:57 +00: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
f3269994a6 thunderbolt: ignore useless thunderbolt device types
Kernel 4.15 adds support for Thunderbolt P2P devices via
CONFIG_THUNDERBOLT_NET.  When turned on and activated fwupd will
show an empty device representing the IP connection between machines.

These device types aren't useful in fwupd and should be filtered.

Suggested-by: Mika Westerberg <mika.westerberg@intel.com>
Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
2017-11-20 16:41:47 -06:00
Richard Hughes
b6f79556f1 Use a SHA1 hash for the internal DeviceID
It's actually less scary to see a SHA1 hash than it is to see a path like
/sys/devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1.2. It's also way easier to
copy and paste into the various fwupdmgr command that require a device ID and
also means we can match a partial prefix much like git allows.

If we also move to a model where plugins can be changed during different stages
of the update (e.g. during detach) then the device might change connection type
and then the sysfs path not only becomes difficult to paste, but incorrect.

Session software doesn't care about the format of the device ID (it is supposed
to be an implementation detail) and so there's no API or ABI break here. A few
plugins also needed to be ported, but nothing too worrying.
2017-11-16 07:18:36 +00: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
4f0c828ca6 Fix build with newer versions of libgudev
Newer versions include the g_autoptr() macros in the installed headers.
2017-09-01 14:53:14 +01:00
Yehezkel Bernat
a23551e352 thunderbolt: refer to the wiki on image validation failure
Signed-off-by: Yehezkel Bernat <yehezkel.bernat@intel.com>
2017-08-30 14:01:26 +01:00
Yehezkel Bernat
e6c00362ad thunderbolt: image validation implemented
Fixes: https://github.com/hughsie/fwupd/issues/189

Signed-off-by: Yehezkel Bernat <yehezkel.bernat@intel.com>
2017-08-30 12:37:34 +01: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
Richard Hughes
6bc5968da2 thunderbolt: Don't remove devices on change events
Based on a patch by Mario Limonciello, many thanks.
2017-08-25 09:50:54 +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
Christian Kellner
1f6873a5dd thunderbolt: add new devices without delay
We want thunderbolt to claim the device and not to race with the
udev plugin.
2017-08-24 13:55:00 +01:00
Christian Kellner
73ba7ee82c thunderbolt: plugin for new tbt kernel interface
Thunderbolt has a new kernel interface starting from version 4.13,
which simplifies updating the host controller and devices: the
kernel now exposes a sysfs interface for the non-volatile memory
as a device node. This can be used to write the new firmware blob.
Updates are then triggered also via a simple write to a sysfs
file (nvm_authenticate), which in turn is also used for error
reporting.
The plugin should be functionally, but a few items are missing:
 - image verification
 - safe mode handling
2017-08-21 17:05:44 +01:00
Richard Hughes
260e970297 Rename the thunderbolt plugin to tbtfwu 2017-07-30 17:39:25 +01:00
Richard Hughes
fd381cc96e Add the ability to restrict the firmware installation to specific vendor IDs
This allows us to fix https://github.com/hughsie/lvfs-website/issues/4
2017-06-12 20:22:25 +01:00
Richard Hughes
31c36cd2b6 trivial: Fix some -Wdiscarded-qualifiers warnings 2017-02-13 11:02:19 +00: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
d25200fc66 thunderbolt: Add special handling for safe mode on Dell systems (#84)
* thunderbolt: Add special handling for safe mode on Dell systems

Dell systems are known to have the Model ID the same as the SystemID
that can be recovered from libsmbios.  If the thunderbolt controller
is in safe mode, identify with this ID to allow the controller to be
flashed with a good FW.
2017-01-23 17:10:31 +00:00
Yehezkel Bernat
94e7f75ef3 Updates for thunderbolt plugin
* Minor changes in Thunderbolt README file
* Remove PCI-oriented GUID
* Handle Thunderbolt controller in safe-mode
* Get progress status updates for Thunderbolt
* Fix for Thunderbolt FW version display
* Style changes from pull request review
2017-01-21 15:44:26 +00:00
Richard Hughes
e3c8832dd0 trivial: Fix a critical warning when removing thunderbolt devices in safe mode 2017-01-11 21:51:21 +00:00
Richard Hughes
2520b7d1ed trivial: Add some debugging in the thunderbolt plugin 2017-01-11 17:24:20 +00:00
Richard Hughes
26adb3c819 trivial: Fix a crash when flashing a thunderbolt controller in safe mode 2017-01-11 17:21:10 +00:00
Mario Limonciello
0d92e865aa trivial: thunderbolt: don't allocate new plugin data on rescan 2017-01-10 19:55:12 -06:00
Richard Hughes
10ec93b187 Revert "thunderbolt: add some guards around empty arrays"
This reverts commit 5f1c991c40.
2017-01-09 21:34:43 +00:00
Mario Limonciello
5f1c991c40 thunderbolt: add some guards around empty arrays
Depending upon the call order and devices coming or going these
may or may not have anything actually contained which will cause
segfaults otherwise.
2017-01-09 11:11:19 -06:00
Richard Hughes
4ff3169556 thunderbolt: Detecting new devices and add an actual device to the daemon
Also, add an untested update implementation.

Based on a patch by Eric Rubin-smith <ericx.rubin-smith@intel.com>, many thanks.
2017-01-08 16:14:35 +00:00
Richard Hughes
a59777ad8d Add initial skeleton for Intel Thunderbolt support 2016-12-16 12:41:57 +00:00