From f14307489f7a50415239211d76a4a4190db22deb Mon Sep 17 00:00:00 2001 From: Eric Dong Date: Wed, 4 May 2016 10:29:26 +0800 Subject: 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 Reviewed-by: Feng Tian --- SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalDriver.c | 17 +++----- SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c | 46 ---------------------- .../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 -- cgit v1.1