diff options
author | Eric Dong <eric.dong@intel.com> | 2016-05-04 10:29:26 +0800 |
---|---|---|
committer | Star Zeng <star.zeng@intel.com> | 2016-05-04 10:57:05 +0800 |
commit | f14307489f7a50415239211d76a4a4190db22deb (patch) | |
tree | 93af88f2a09cca27b8c189bf8c56a07bf54c6746 | |
parent | 12087ff6d63e50fb6c588caf33c9b2c4b31c2dbd (diff) | |
download | edk2-f14307489f7a50415239211d76a4a4190db22deb.zip edk2-f14307489f7a50415239211d76a4a4190db22deb.tar.gz edk2-f14307489f7a50415239211d76a4a4190db22deb.tar.bz2 |
SecurityPkg OpalPasswordDxe: Install menu without device dependency.
Change design to always install opal menu.
Current implementation only install menu when device connect.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
-rw-r--r-- | SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalDriver.c | 17 | ||||
-rw-r--r-- | SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c | 46 | ||||
-rw-r--r-- | SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalPasswordDxe.inf | 2 |
3 files changed, 6 insertions, 59 deletions
diff --git a/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalDriver.c b/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalDriver.c index e06ce4a..4a4fa6a 100644 --- a/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalDriver.c +++ b/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalDriver.c @@ -24,10 +24,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. OPAL_DRIVER mOpalDriver;
-// flag to track hii installation
-BOOLEAN gHiiInstalled = FALSE;
-
-
#define MAX_PASSWORD_SIZE 32
#define MAX_PASSWORD_TRY_COUNT 5
@@ -732,6 +728,11 @@ EfiDriverEntryPoint( &ReadyToBootEvent
);
+ //
+ // Install Hii packages.
+ //
+ HiiInstall();
+
return Status;
}
@@ -966,14 +967,6 @@ OpalEfiDriverBindingStart( AddDeviceToTail(Dev);
//
- // Install Hii if it hasn't already been installed
- //
- if (!gHiiInstalled) {
- HiiInstall();
- gHiiInstalled = TRUE;
- }
-
- //
// check if device is locked and prompt for password
//
OpalDriverRequestPassword (Dev);
diff --git a/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c b/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c index 75ff9fc..0a4453a 100644 --- a/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c +++ b/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c @@ -108,43 +108,6 @@ HiiSetCurrentConfiguration( }
/**
- Check that all required protocols for HII are available.
-
- @retval EFI_SUCCESS All required protocols are installed.
- @retval EFI_NOT_FOUND One or more protocol are not installed.
-**/
-EFI_STATUS
-HiiCheckForRequiredProtocols (
- VOID
- )
-{
- VOID* TempProtocol;
- EFI_STATUS Status;
-
- Status = gBS->LocateProtocol(&gEfiHiiStringProtocolGuid, NULL, (VOID**)&TempProtocol );
- if (EFI_ERROR (Status)) {
- return EFI_NOT_FOUND;
- }
-
- Status = gBS->LocateProtocol(&gEfiHiiDatabaseProtocolGuid, NULL, (VOID**)&TempProtocol );
- if (EFI_ERROR (Status)) {
- return EFI_NOT_FOUND;
- }
-
- Status = gBS->LocateProtocol(&gEfiHiiConfigRoutingProtocolGuid, NULL, (VOID**)&TempProtocol );
- if (EFI_ERROR (Status)) {
- return EFI_NOT_FOUND;
- }
-
- Status = gBS->LocateProtocol(&gEfiFormBrowser2ProtocolGuid, NULL, (VOID**)&TempProtocol );
- if (EFI_ERROR (Status)) {
- return EFI_NOT_FOUND;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
Install the HII related resources.
@retval EFI_SUCCESS Install all the resources success.
@@ -159,15 +122,6 @@ HiiInstall( EFI_HANDLE DriverHandle;
//
- // Check that all required protocols are available for HII.
- // If not, fail the install
- //
- Status = HiiCheckForRequiredProtocols();
- if (EFI_ERROR(Status)) {
- return Status;
- }
-
- //
// Clear the global configuration.
//
ZeroMem(&gHiiConfiguration, sizeof(gHiiConfiguration));
diff --git a/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalPasswordDxe.inf b/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalPasswordDxe.inf index bae8885..703c1b6 100644 --- a/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalPasswordDxe.inf +++ b/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalPasswordDxe.inf @@ -78,4 +78,4 @@ gOpalExtraInfoVariableGuid ## PRODUCES ## GUID
[Depex]
- gEfiSmmCommunicationProtocolGuid
+ gEfiSmmCommunicationProtocolGuid AND gEfiHiiStringProtocolGuid AND gEfiHiiDatabaseProtocolGuid
|