]> git.proxmox.com Git - mirror_edk2.git/commitdiff
FmpDEvicePkg/FmpDeviceLibNull: Implement new APIs
authorEric Jin <eric.jin@intel.com>
Sun, 11 Aug 2019 03:04:32 +0000 (11:04 +0800)
committerLiming Gao <liming.gao@intel.com>
Wed, 14 Aug 2019 04:29:38 +0000 (12:29 +0800)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1525

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Eric Jin <eric.jin@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLib.c

index c9fcb84b2082e05baf9fc1e34657f93fe1b02748..fd219cb70bc5c9e00a29c206444b0307920c71c7 100644 (file)
@@ -3,7 +3,7 @@
   image stored in a firmware device.\r
 \r
   Copyright (c) 2016, Microsoft Corporation. All rights reserved.<BR>\r
-  Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.<BR>\r
 \r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
@@ -40,6 +40,68 @@ RegisterFmpInstaller (
   return EFI_UNSUPPORTED;\r
 }\r
 \r
+/**\r
+  Provide a function to uninstall the Firmware Management Protocol instance from a\r
+  device handle when the device is managed by a driver that follows the UEFI\r
+  Driver Model.  If the device is not managed by a driver that follows the UEFI\r
+  Driver Model, then EFI_UNSUPPORTED is returned.\r
+\r
+  @param[in] FmpUninstaller  Function that installs the Firmware Management\r
+                             Protocol.\r
+\r
+  @retval EFI_SUCCESS      The device is managed by a driver that follows the\r
+                           UEFI Driver Model.  FmpUinstaller must be called on\r
+                           each Driver Binding Stop().\r
+  @retval EFI_UNSUPPORTED  The device is not managed by a driver that follows\r
+                           the UEFI Driver Model.\r
+  @retval other            The Firmware Management Protocol for this firmware\r
+                           device is not installed.  The firmware device is\r
+                           still locked using FmpDeviceLock().\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+RegisterFmpUninstaller (\r
+  IN FMP_DEVICE_LIB_REGISTER_FMP_UNINSTALLER  Function\r
+  )\r
+{\r
+  return EFI_UNSUPPORTED;\r
+}\r
+\r
+/**\r
+  Set the device context for the FmpDeviceLib services when the device is\r
+  managed by a driver that follows the UEFI Driver Model.  If the device is not\r
+  managed by a driver that follows the UEFI Driver Model, then EFI_UNSUPPORTED\r
+  is returned.  Once a device context is set, the FmpDeviceLib services\r
+  operate on the currently set device context.\r
+\r
+  @param[in]      Handle   Device handle for the FmpDeviceLib services.\r
+                           If Handle is NULL, then Context is freed.\r
+  @param[in, out] Context  Device context for the FmpDeviceLib services.\r
+                           If Context is NULL, then a new context is allocated\r
+                           for Handle and the current device context is set and\r
+                           returned in Context.  If Context is not NULL, then\r
+                           the current device context is set.\r
+\r
+  @retval EFI_SUCCESS      The device is managed by a driver that follows the\r
+                           UEFI Driver Model.\r
+  @retval EFI_UNSUPPORTED  The device is not managed by a driver that follows\r
+                           the UEFI Driver Model.\r
+  @retval other            The Firmware Management Protocol for this firmware\r
+                           device is not installed.  The firmware device is\r
+                           still locked using FmpDeviceLock().\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+FmpDeviceSetContext (\r
+  IN EFI_HANDLE  Handle,\r
+  IN OUT VOID    **Context\r
+  )\r
+{\r
+  return EFI_UNSUPPORTED;\r
+}\r
+\r
 /**\r
   Returns the size, in bytes, of the firmware image currently stored in the\r
   firmware device.  This function is used to by the GetImage() and\r
@@ -244,6 +306,35 @@ FmpDeviceGetVersion (
   return EFI_UNSUPPORTED;\r
 }\r
 \r
+/**\r
+  Returns the value used to fill in the HardwareInstance field of the\r
+  EFI_FIRMWARE_IMAGE_DESCRIPTOR structure that is returned by the GetImageInfo()\r
+  service of the Firmware Management Protocol.  If EFI_SUCCESS is returned, then\r
+  the firmware device supports a method to report the HardwareInstance value.\r
+  If the value can not be reported for the firmware device, then EFI_UNSUPPORTED\r
+  must be returned.  EFI_DEVICE_ERROR is returned if an error occurs attempting\r
+  to retrieve the HardwareInstance value for the firmware device.\r
+\r
+  @param[out] HardwareInstance  The hardware instance value for the firmware\r
+                                device.\r
+\r
+  @retval EFI_SUCCESS       The hardware instance for the current firmware\r
+                            devide is returned in HardwareInstance.\r
+  @retval EFI_UNSUPPORTED   The firmware device does not support a method to\r
+                            report the hardware instance value.\r
+  @retval EFI_DEVICE_ERROR  An error occurred attempting to retrieve the hardware\r
+                            instance value.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+FmpDeviceGetHardwareInstance (\r
+  OUT UINT64  *HardwareInstance\r
+  )\r
+{\r
+  return EFI_UNSUPPORTED;\r
+}\r
+\r
 /**\r
   Returns a copy of the firmware image currently stored in the firmware device.\r
 \r