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
IN EFI_HANDLE Handle\r
);\r
\r
+/**\r
+ Callback function that uninstalls a Firmware Management Protocol instance from\r
+ a handle.\r
+\r
+ @param[in] Handle The device handle to uninstall a Firmware Management\r
+ Protocol instance.\r
+\r
+ @retval EFI_SUCCESS A Firmware Management Protocol instance was\r
+ uninstalled from Handle.\r
+ @retval EFI_INVALID_PARAMETER Handle is invalid\r
+ @retval other A Firmware Management Protocol instance could\r
+ not be uninstalled from Handle.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *FMP_DEVICE_LIB_REGISTER_FMP_UNINSTALLER)(\r
+ IN EFI_HANDLE Handle\r
+ );\r
+\r
/**\r
Provide a function to install the Firmware Management Protocol instance onto a\r
device handle when the device is managed by a driver that follows the UEFI\r
IN FMP_DEVICE_LIB_REGISTER_FMP_INSTALLER FmpInstaller\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 FmpUninstaller\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
/**\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
OUT UINT32 *Version\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
/**\r
Returns a copy of the firmware image currently stored in the firmware device.\r
\r