uefi: Allow devices to create more complete fake UEFI devices

Also, gets rid of two 'TODO' warnings with LGTM.
This commit is contained in:
Richard Hughes 2019-02-12 09:16:16 +00:00 committed by Mario Limonciello
parent 8cfbb25c31
commit 20f14c29cb
2 changed files with 21 additions and 2 deletions

View File

@ -619,8 +619,8 @@ fu_uefi_device_new_from_dev (FuDevice *dev)
self->fw_class = g_strdup (fu_device_get_guid_default (dev));
tmp = fu_device_get_metadata (dev, FU_DEVICE_METADATA_UEFI_DEVICE_KIND);
self->kind = fu_uefi_device_kind_from_string (tmp);
self->capsule_flags = 0; /* FIXME? */
self->fw_version = 0; /* FIXME? */
self->capsule_flags = fu_device_get_metadata_integer (dev, FU_DEVICE_METADATA_UEFI_CAPSULE_FLAGS);
self->fw_version = fu_device_get_metadata_integer (dev, FU_DEVICE_METADATA_UEFI_FW_VERSION);
g_assert (self->fw_class != NULL);
return self;
}

View File

@ -45,4 +45,23 @@ G_BEGIN_DECLS
*/
#define FU_DEVICE_METADATA_UEFI_DEVICE_KIND "UefiDeviceKind"
/**
* FU_DEVICE_METADATA_UEFI_FW_VERSION:
*
* The firmware version of the UEFI device specified as a 32 bit unsigned
* integer.
* Consumed by the uefi plugin when other devices register fake devices that
* need to be handled as a capsule update.
*/
#define FU_DEVICE_METADATA_UEFI_FW_VERSION "UefiFwVersion"
/**
* FU_DEVICE_METADATA_UEFI_CAPSULE_FLAGS:
*
* The capsule flags for the UEFI device, e.g. %EFI_CAPSULE_HEADER_FLAGS_PERSIST_ACROSS_RESET
* Consumed by the uefi plugin when other devices register fake devices that
* need to be handled as a capsule update.
*/
#define FU_DEVICE_METADATA_UEFI_CAPSULE_FLAGS "UefiCapsuleFlags"
G_END_DECLS