summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
diff options
context:
space:
mode:
authorJiewen Yao <jiewen.yao@intel.com>2016-12-23 15:42:27 +0800
committerJiewen Yao <jiewen.yao@intel.com>2016-12-26 12:23:32 +0800
commit8f6db16134b60721af3eed53ef5705dca452d128 (patch)
treefba290f175cd0553b294acfb7a62ee192bd6a57a /MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
parent0a64f49fde09928b6061543b08e6da195e2abfbd (diff)
downloadedk2-8f6db16134b60721af3eed53ef5705dca452d128.zip
edk2-8f6db16134b60721af3eed53ef5705dca452d128.tar.gz
edk2-8f6db16134b60721af3eed53ef5705dca452d128.tar.bz2
MdeModulePkg/CapsuleLib: Add CapsuleTarget support.
UEFI spec requires CapsuleTarget to be a device path associated with FMP producer. Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Chao Zhang <chao.b.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
Diffstat (limited to 'MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c')
-rw-r--r--MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
index af08886..2bb6ac8 100644
--- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
+++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
@@ -100,6 +100,7 @@ RecordCapsuleStatusVariable (
@param[in] CapsuleStatus The capsule process stauts
@param[in] PayloadIndex FMP payload index
@param[in] ImageHeader FMP image header
+ @param[in] FmpDevicePath DevicePath associated with the FMP producer
@retval EFI_SUCCESS The capsule status variable is recorded.
@retval EFI_OUT_OF_RESOURCES No resource to record the capsule status variable.
@@ -109,7 +110,8 @@ RecordFmpCapsuleStatusVariable (
IN EFI_CAPSULE_HEADER *CapsuleHeader,
IN EFI_STATUS CapsuleStatus,
IN UINTN PayloadIndex,
- IN EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER *ImageHeader
+ IN EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER *ImageHeader,
+ IN EFI_DEVICE_PATH_PROTOCOL *FmpDevicePath OPTIONAL
);
/**
@@ -818,6 +820,7 @@ ProcessFmpCapsuleImage (
UINTN Index2;
MEMMAP_DEVICE_PATH MemMapNode;
EFI_DEVICE_PATH_PROTOCOL *DriverDevicePath;
+ EFI_DEVICE_PATH_PROTOCOL *FmpDevicePath;
ESRT_MANAGEMENT_PROTOCOL *EsrtProtocol;
EFI_SYSTEM_RESOURCE_ENTRY EsrtEntry;
VOID *VendorCode;
@@ -941,6 +944,13 @@ ProcessFmpCapsuleImage (
continue;
}
+ FmpDevicePath = NULL;
+ gBS->HandleProtocol(
+ HandleBuffer[Index1],
+ &gEfiDevicePathProtocolGuid,
+ (VOID **)&FmpDevicePath
+ );
+
ImageInfoSize = 0;
Status = Fmp->GetImageInfo (
Fmp,
@@ -1060,7 +1070,8 @@ ProcessFmpCapsuleImage (
CapsuleHeader, // CapsuleGuid
Status, // CapsuleStatus
Index - FmpCapsuleHeader->EmbeddedDriverCount, // PayloadIndex
- ImageHeader // ImageHeader
+ ImageHeader, // ImageHeader
+ FmpDevicePath // FmpDevicePath
);
if (StatusRet != EFI_SUCCESS) {
StatusRet = Status;