X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=SecurityPkg%2FTcg%2FTcgConfigDxe%2FTcgConfigImpl.c;h=f884226d97ceca9fa036b0b47ba18464e3612335;hp=c172583441d6e7e5b6144863b76f44fa2d0a5741;hb=fab1046560e520486f255093cbb4fe36a347f93a;hpb=a0c56a8219ec268d8ac4e051035f1636545cc478 diff --git a/SecurityPkg/Tcg/TcgConfigDxe/TcgConfigImpl.c b/SecurityPkg/Tcg/TcgConfigDxe/TcgConfigImpl.c index c172583441..f884226d97 100644 --- a/SecurityPkg/Tcg/TcgConfigDxe/TcgConfigImpl.c +++ b/SecurityPkg/Tcg/TcgConfigDxe/TcgConfigImpl.c @@ -79,13 +79,13 @@ GetTpmState ( // if ((TpmEnable != NULL) || (TpmActivate != NULL)) { TpmSendSize = sizeof (TPM_RQU_COMMAND_HDR) + sizeof (UINT32) * 3; - *(UINT16*)&CmdBuf[0] = H2NS (TPM_TAG_RQU_COMMAND); - *(UINT32*)&CmdBuf[2] = H2NL (TpmSendSize); - *(UINT32*)&CmdBuf[6] = H2NL (TPM_ORD_GetCapability); + *(UINT16*)&CmdBuf[0] = SwapBytes16 (TPM_TAG_RQU_COMMAND); + *(UINT32*)&CmdBuf[2] = SwapBytes32 (TpmSendSize); + *(UINT32*)&CmdBuf[6] = SwapBytes32 (TPM_ORD_GetCapability); - *(UINT32*)&CmdBuf[10] = H2NL (TPM_CAP_FLAG); - *(UINT32*)&CmdBuf[14] = H2NL (sizeof (TPM_CAP_FLAG_PERMANENT)); - *(UINT32*)&CmdBuf[18] = H2NL (TPM_CAP_FLAG_PERMANENT); + *(UINT32*)&CmdBuf[10] = SwapBytes32 (TPM_CAP_FLAG); + *(UINT32*)&CmdBuf[14] = SwapBytes32 (sizeof (TPM_CAP_FLAG_PERMANENT)); + *(UINT32*)&CmdBuf[18] = SwapBytes32 (TPM_CAP_FLAG_PERMANENT); Status = TcgProtocol->PassThroughToTpm ( TcgProtocol, @@ -95,7 +95,7 @@ GetTpmState ( CmdBuf ); TpmRsp = (TPM_RSP_COMMAND_HDR *) &CmdBuf[0]; - if (EFI_ERROR (Status) || (TpmRsp->tag != H2NS (TPM_TAG_RSP_COMMAND)) || (TpmRsp->returnCode != 0)) { + if (EFI_ERROR (Status) || (TpmRsp->tag != SwapBytes16 (TPM_TAG_RSP_COMMAND)) || (TpmRsp->returnCode != 0)) { return EFI_DEVICE_ERROR; } @@ -182,7 +182,7 @@ TcgExtractConfig ( ZeroMem (&Configuration, sizeof (TCG_CONFIGURATION)); Configuration.MorState = PcdGetBool (PcdMorEnable); - Configuration.TpmOperation = ENABLE; + Configuration.TpmOperation = PHYSICAL_PRESENCE_ENABLE; Configuration.HideTpm = (BOOLEAN) (PcdGetBool (PcdHideTpmSupport) && PcdGetBool (PcdHideTpm)); // // Read the original value of HideTpm from PrivateData which won't be changed by Setup in this boot. @@ -404,7 +404,7 @@ TcgCallback ( return EFI_INVALID_PARAMETER; } - if ((Action != EFI_BROWSER_ACTION_CHANGING) || (QuestionId != KEY_TPM_ACTION)) { + if ((Action != EFI_BROWSER_ACTION_CHANGED) || (QuestionId != KEY_TPM_ACTION)) { return EFI_UNSUPPORTED; }