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