/** @file\r
Implement TPM1.2 NV Self Test related commands.\r
\r
-Copyright (c) 2016, Intel Corporation. All rights reserved. <BR>\r
+Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved. <BR>\r
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
#include <PiPei.h>\r
#include <Library/Tpm12CommandLib.h>\r
#include <Library/BaseLib.h>\r
+#include <Library/DebugLib.h>\r
#include <Library/Tpm12DeviceLib.h>\r
\r
/**\r
VOID\r
)\r
{\r
+ EFI_STATUS Status;\r
TPM_RQU_COMMAND_HDR Command;\r
TPM_RSP_COMMAND_HDR Response;\r
UINT32 Length;\r
Command.paramSize = SwapBytes32 (sizeof (Command));\r
Command.ordinal = SwapBytes32 (TPM_ORD_ContinueSelfTest);\r
Length = sizeof (Response);\r
- return Tpm12SubmitCommand (sizeof (Command), (UINT8 *)&Command, &Length, (UINT8 *)&Response);\r
+ Status = Tpm12SubmitCommand (sizeof (Command), (UINT8 *)&Command, &Length, (UINT8 *)&Response);\r
+ if (EFI_ERROR (Status)) {\r
+ return Status;\r
+ }\r
+\r
+ if (SwapBytes32 (Response.returnCode) != TPM_SUCCESS) {\r
+ DEBUG ((DEBUG_ERROR, "Tpm12ContinueSelfTest: Response Code error! 0x%08x\r\n", SwapBytes32 (Response.returnCode)));\r
+ return EFI_DEVICE_ERROR;\r
+ }\r
+\r
+ return Status;\r
}\r