/** @file\r
TIS (TPM Interface Specification) functions used by TPM1.2.\r
\r
-Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
which accompanies this distribution. The full text of the license may be found at \r
@retval EFI_TIMEOUT The register can't run into the expected status in time.\r
**/\r
EFI_STATUS\r
-EFIAPI\r
Tpm12TisPcWaitRegisterBits (\r
IN UINT8 *Register,\r
IN UINT8 BitSet,\r
@retval EFI_TIMEOUT BurstCount can't be got in time.\r
**/\r
EFI_STATUS\r
-EFIAPI\r
Tpm12TisPcReadBurstCount (\r
IN TIS_PC_REGISTERS_PTR TisReg,\r
OUT UINT16 *BurstCount\r
@retval EFI_TIMEOUT TPM chip can't be set to ready state in time.\r
**/\r
EFI_STATUS\r
-EFIAPI\r
Tpm12TisPcPrepareCommand (\r
IN TIS_PC_REGISTERS_PTR TisReg\r
)\r
@retval EFI_TIMEOUT Can't get the TPM control in time.\r
**/\r
EFI_STATUS\r
-EFIAPI\r
Tpm12TisPcRequestUseTpm (\r
IN TIS_PC_REGISTERS_PTR TisReg\r
)\r
@param[in, out] SizeOut Size of response data. \r
\r
@retval EFI_SUCCESS Operation completed successfully.\r
- @retval EFI_TIMEOUT The register can't run into the expected status in time.\r
@retval EFI_BUFFER_TOO_SMALL Response data buffer is too small.\r
@retval EFI_DEVICE_ERROR Unexpected device behavior.\r
@retval EFI_UNSUPPORTED Unsupported TPM version\r
Status = Tpm12TisPcPrepareCommand (TisReg);\r
if (EFI_ERROR (Status)){\r
DEBUG ((DEBUG_ERROR, "Tpm12 is not ready for command!\n"));\r
- return Status;\r
+ return EFI_DEVICE_ERROR;\r
}\r
//\r
// Send the command data to Tpm\r
while (Index < SizeIn) {\r
Status = Tpm12TisPcReadBurstCount (TisReg, &BurstCount);\r
if (EFI_ERROR (Status)) {\r
- Status = EFI_TIMEOUT;\r
+ Status = EFI_DEVICE_ERROR;\r
goto Exit;\r
}\r
for (; BurstCount > 0 && Index < SizeIn; BurstCount--) {\r
);\r
if (EFI_ERROR (Status)) {\r
DEBUG ((DEBUG_ERROR, "Wait for Tpm12 response data time out!!\n"));\r
- Status = EFI_TIMEOUT;\r
+ Status = EFI_DEVICE_ERROR;\r
goto Exit;\r
}\r
//\r
while (Index < sizeof (TPM_RSP_COMMAND_HDR)) {\r
Status = Tpm12TisPcReadBurstCount (TisReg, &BurstCount);\r
if (EFI_ERROR (Status)) {\r
- Status = EFI_TIMEOUT;\r
+ Status = EFI_DEVICE_ERROR;\r
goto Exit;\r
}\r
for (; BurstCount > 0; BurstCount--) {\r
}\r
Status = Tpm12TisPcReadBurstCount (TisReg, &BurstCount);\r
if (EFI_ERROR (Status)) {\r
- Status = EFI_TIMEOUT;\r
+ Status = EFI_DEVICE_ERROR;\r
goto Exit;\r
}\r
}\r