2 Ihis library is TPM2 DTPM device lib.
3 Choosing this library means platform uses and only uses DTPM device as TPM2 engine.
5 Copyright (c) 2013, Intel Corporation. All rights reserved. <BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #include <Library/BaseLib.h>
17 #include <Library/BaseMemoryLib.h>
18 #include <Library/DebugLib.h>
19 #include <Library/Tpm2DeviceLib.h>
22 This service enables the sending of commands to the TPM2.
24 @param[in] InputParameterBlockSize Size of the TPM2 input parameter block.
25 @param[in] InputParameterBlock Pointer to the TPM2 input parameter block.
26 @param[in,out] OutputParameterBlockSize Size of the TPM2 output parameter block.
27 @param[in] OutputParameterBlock Pointer to the TPM2 output parameter block.
29 @retval EFI_SUCCESS The command byte stream was successfully sent to the device and a response was successfully received.
30 @retval EFI_DEVICE_ERROR The command was not successfully sent to the device or a response was not successfully received from the device.
31 @retval EFI_BUFFER_TOO_SMALL The output parameter block is too small.
36 IN UINT32 InputParameterBlockSize
,
37 IN UINT8
*InputParameterBlock
,
38 IN OUT UINT32
*OutputParameterBlockSize
,
39 IN UINT8
*OutputParameterBlock
43 This service requests use TPM2.
45 @retval EFI_SUCCESS Get the control of TPM2 chip.
46 @retval EFI_NOT_FOUND TPM2 not found.
47 @retval EFI_DEVICE_ERROR Unexpected device behavior.
56 This service enables the sending of commands to the TPM2.
58 @param[in] InputParameterBlockSize Size of the TPM2 input parameter block.
59 @param[in] InputParameterBlock Pointer to the TPM2 input parameter block.
60 @param[in,out] OutputParameterBlockSize Size of the TPM2 output parameter block.
61 @param[in] OutputParameterBlock Pointer to the TPM2 output parameter block.
63 @retval EFI_SUCCESS The command byte stream was successfully sent to the device and a response was successfully received.
64 @retval EFI_DEVICE_ERROR The command was not successfully sent to the device or a response was not successfully received from the device.
65 @retval EFI_BUFFER_TOO_SMALL The output parameter block is too small.
70 IN UINT32 InputParameterBlockSize
,
71 IN UINT8
*InputParameterBlock
,
72 IN OUT UINT32
*OutputParameterBlockSize
,
73 IN UINT8
*OutputParameterBlock
76 return DTpm2SubmitCommand (
77 InputParameterBlockSize
,
79 OutputParameterBlockSize
,
85 This service requests use TPM2.
87 @retval EFI_SUCCESS Get the control of TPM2 chip.
88 @retval EFI_NOT_FOUND TPM2 not found.
89 @retval EFI_DEVICE_ERROR Unexpected device behavior.
97 return DTpm2RequestUseTpm ();
101 This service register TPM2 device.
103 @param Tpm2Device TPM2 device
105 @retval EFI_SUCCESS This TPM2 device is registered successfully.
106 @retval EFI_UNSUPPORTED System does not support register this TPM2 device.
107 @retval EFI_ALREADY_STARTED System already register this TPM2 device.
111 Tpm2RegisterTpm2DeviceLib (
112 IN TPM2_DEVICE_INTERFACE
*Tpm2Device
115 return EFI_UNSUPPORTED
;