]>
Commit | Line | Data |
---|---|---|
c1d93242 JY |
1 | /** @file\r |
2 | This library abstract how to access TPM2 hardware device.\r | |
3 | \r | |
4 | Copyright (c) 2013, Intel Corporation. All rights reserved. <BR>\r | |
5 | This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #ifndef _TPM2_DEVICE_LIB_H_\r | |
16 | #define _TPM2_DEVICE_LIB_H_\r | |
17 | \r | |
18 | #include <Uefi.h>\r | |
19 | \r | |
20 | /**\r | |
21 | This service enables the sending of commands to the TPM2.\r | |
22 | \r | |
23 | @param[in] InputParameterBlockSize Size of the TPM2 input parameter block.\r | |
24 | @param[in] InputParameterBlock Pointer to the TPM2 input parameter block.\r | |
25 | @param[in,out] OutputParameterBlockSize Size of the TPM2 output parameter block.\r | |
26 | @param[in] OutputParameterBlock Pointer to the TPM2 output parameter block.\r | |
27 | \r | |
28 | @retval EFI_SUCCESS The command byte stream was successfully sent to the device and a response was successfully received.\r | |
29 | @retval EFI_DEVICE_ERROR The command was not successfully sent to the device or a response was not successfully received from the device.\r | |
30 | @retval EFI_BUFFER_TOO_SMALL The output parameter block is too small. \r | |
31 | **/\r | |
32 | EFI_STATUS\r | |
33 | EFIAPI\r | |
34 | Tpm2SubmitCommand (\r | |
35 | IN UINT32 InputParameterBlockSize,\r | |
36 | IN UINT8 *InputParameterBlock,\r | |
37 | IN OUT UINT32 *OutputParameterBlockSize,\r | |
38 | IN UINT8 *OutputParameterBlock\r | |
39 | );\r | |
40 | \r | |
41 | /**\r | |
42 | This service requests use TPM2.\r | |
43 | \r | |
44 | @retval EFI_SUCCESS Get the control of TPM2 chip.\r | |
45 | @retval EFI_NOT_FOUND TPM2 not found.\r | |
46 | @retval EFI_DEVICE_ERROR Unexpected device behavior.\r | |
47 | **/\r | |
48 | EFI_STATUS\r | |
49 | EFIAPI\r | |
50 | Tpm2RequestUseTpm (\r | |
51 | VOID\r | |
52 | );\r | |
53 | \r | |
54 | /**\r | |
55 | This service enables the sending of commands to the TPM2.\r | |
56 | \r | |
57 | @param[in] InputParameterBlockSize Size of the TPM2 input parameter block.\r | |
58 | @param[in] InputParameterBlock Pointer to the TPM2 input parameter block.\r | |
59 | @param[in,out] OutputParameterBlockSize Size of the TPM2 output parameter block.\r | |
60 | @param[in] OutputParameterBlock Pointer to the TPM2 output parameter block.\r | |
61 | \r | |
62 | @retval EFI_SUCCESS The command byte stream was successfully sent to the device and a response was successfully received.\r | |
63 | @retval EFI_DEVICE_ERROR The command was not successfully sent to the device or a response was not successfully received from the device.\r | |
64 | @retval EFI_BUFFER_TOO_SMALL The output parameter block is too small. \r | |
65 | **/\r | |
66 | typedef\r | |
67 | EFI_STATUS\r | |
68 | (EFIAPI *TPM2_SUBMIT_COMMAND) (\r | |
69 | IN UINT32 InputParameterBlockSize,\r | |
70 | IN UINT8 *InputParameterBlock,\r | |
71 | IN OUT UINT32 *OutputParameterBlockSize,\r | |
72 | IN UINT8 *OutputParameterBlock\r | |
73 | );\r | |
74 | \r | |
75 | /**\r | |
76 | This service requests use TPM2.\r | |
77 | \r | |
78 | @retval EFI_SUCCESS Get the control of TPM2 chip.\r | |
79 | @retval EFI_NOT_FOUND TPM2 not found.\r | |
80 | @retval EFI_DEVICE_ERROR Unexpected device behavior.\r | |
81 | **/\r | |
82 | typedef\r | |
83 | EFI_STATUS\r | |
84 | (EFIAPI *TPM2_REQUEST_USE_TPM) (\r | |
85 | VOID\r | |
86 | );\r | |
87 | \r | |
88 | typedef struct {\r | |
89 | EFI_GUID ProviderGuid;\r | |
90 | TPM2_SUBMIT_COMMAND Tpm2SubmitCommand;\r | |
91 | TPM2_REQUEST_USE_TPM Tpm2RequestUseTpm;\r | |
92 | } TPM2_DEVICE_INTERFACE;\r | |
93 | \r | |
94 | /**\r | |
95 | This service register TPM2 device.\r | |
96 | \r | |
97 | @param Tpm2Device TPM2 device\r | |
98 | \r | |
99 | @retval EFI_SUCCESS This TPM2 device is registered successfully.\r | |
100 | @retval EFI_UNSUPPORTED System does not support register this TPM2 device.\r | |
101 | @retval EFI_ALREADY_STARTED System already register this TPM2 device.\r | |
102 | **/\r | |
103 | EFI_STATUS\r | |
104 | EFIAPI\r | |
105 | Tpm2RegisterTpm2DeviceLib (\r | |
106 | IN TPM2_DEVICE_INTERFACE *Tpm2Device\r | |
107 | );\r | |
108 | \r | |
109 | #endif\r |