]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/TcgService.h
Fix doxygen issue:
[mirror_edk2.git] / MdePkg / Include / Protocol / TcgService.h
CommitLineData
ac644614 1/** @file\r
267669ba 2 TCG Service Protocol as defined in TCG_EFI_Protocol_1_20_Final\r
ac644614 3 See http://trustedcomputinggroup.org for the latest specification\r
4\r
5 Copyright (c) 2007, Intel Corporation\r
6 All rights reserved. This program and the accompanying materials\r
7 are licensed and made available under the terms and conditions of the BSD License\r
8 which accompanies this distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php\r
10\r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
8069d49e 14**/\r
267669ba
LG
15\r
16#ifndef _TCG_SERVICE_PROTOCOL_H_\r
17#define _TCG_SERVICE_PROTOCOL_H_\r
18\r
19#include <Uefi/UefiTcgPlatform.h>\r
20\r
21#define EFI_TCG_PROTOCOL_GUID \\r
22 {0xf541796d, 0xa62e, 0x4954, { 0xa7, 0x75, 0x95, 0x84, 0xf6, 0x1b, 0x9c, 0xdd } } \r
23\r
24typedef struct _EFI_TCG_PROTOCOL EFI_TCG_PROTOCOL;\r
25\r
26//\r
27// Set structure alignment to 1-byte\r
28//\r
29#pragma pack (push, 1)\r
30\r
31typedef struct {\r
32 UINT8 Major;\r
33 UINT8 Minor;\r
34 UINT8 RevMajor;\r
35 UINT8 RevMinor;\r
36} TCG_VERSION;\r
37\r
38typedef struct _TCG_EFI_BOOT_SERVICE_CAPABILITY {\r
39 UINT8 Size; // Size of this structure\r
40 TCG_VERSION StructureVersion; \r
41 TCG_VERSION ProtocolSpecVersion;\r
42 UINT8 HashAlgorithmBitmap; // Hash algorithms \r
43 // this protocol is capable of : 01=SHA-1\r
44 BOOLEAN TPMPresentFlag; // 00h = TPM not present\r
45 BOOLEAN TPMDeactivatedFlag; // 01h = TPM currently deactivated\r
46} TCG_EFI_BOOT_SERVICE_CAPABILITY;\r
47\r
48typedef UINT32 TCG_ALGORITHM_ID;\r
49\r
50//\r
51// Restore original structure alignment\r
52//\r
53#pragma pack (pop)\r
54\r
8069d49e
LG
55/**\r
56 This service provides EFI protocol capability information, state information \r
57 about the TPM, and Event Log state information.\r
58\r
59 @param This Indicates the calling context\r
60 @param ProtocolCapability The callee allocates memory for a TCG_BOOT_SERVICE_CAPABILITY \r
61 structure and fills in the fields with the EFI protocol \r
62 capability information and the current TPM state information.\r
63 @param TCGFeatureFlags This is a pointer to the feature flags. No feature \r
64 flags are currently defined so this parameter \r
65 MUST be set to 0. However, in the future, \r
66 feature flags may be defined that, for example, \r
67 enable hash algorithm agility.\r
68 @param EventLogLocation This is a pointer to the address of the event log in memory.\r
69 @param EventLogLastEntry If the Event Log contains more than one entry, \r
70 this is a pointer to the address of the start of \r
71 the last entry in the event log in memory. \r
72\r
73 @retval EFI_SUCCESS Operation completed successfully.\r
74 @retval EFI_DEVICE_ERROR The command was unsuccessful.\r
75 @retval EFI_INVALID_PARAMETER One or more of the parameters are incorrect.\r
76 @retval EFI_BUFFER_TOO_SMALL The receive buffer is too small.\r
77 @retval EFI_NOT_FOUND The component was not running\r
78\r
79**/\r
267669ba
LG
80typedef\r
81EFI_STATUS\r
8b13229b 82(EFIAPI *EFI_TCG_STATUS_CHECK)(\r
267669ba
LG
83 IN EFI_TCG_PROTOCOL *This,\r
84 OUT TCG_EFI_BOOT_SERVICE_CAPABILITY\r
85 *ProtocolCapability,\r
86 OUT UINT32 *TCGFeatureFlags,\r
87 OUT EFI_PHYSICAL_ADDRESS *EventLogLocation,\r
88 OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry\r
89 );\r
90\r
8069d49e
LG
91/**\r
92 This service abstracts the capability to do a hash operation on a data buffer.\r
93 \r
94 @param This Indicates the calling context\r
95 @param HashData Pointer to the data buffer to be hashed\r
96 @param HashDataLen Length of the data buffer to be hashed\r
97 @param AlgorithmId Identification of the Algorithm to use for the hashing operation\r
98 @param HashedDataLen Resultant length of the hashed data\r
99 @param HashedDataResult Resultant buffer of the hashed data \r
100 \r
101 @retval EFI_SUCCESS Operation completed successfully.\r
102 @retval EFI_DEVICE_ERROR The command was unsuccessful.\r
103 @retval EFI_INVALID_PARAMETER One or more of the parameters are incorrect.\r
104 @retval EFI_BUFFER_TOO_SMALL The receive buffer is too small.\r
105 @retval EFI_NOT_FOUND The component was not running\r
106\r
107**/\r
267669ba
LG
108typedef\r
109EFI_STATUS\r
8b13229b 110(EFIAPI *EFI_TCG_HASH_ALL)(\r
267669ba
LG
111 IN EFI_TCG_PROTOCOL *This,\r
112 IN UINT8 *HashData,\r
113 IN UINT64 HashDataLen,\r
114 IN TCG_ALGORITHM_ID AlgorithmId,\r
115 IN OUT UINT64 *HashedDataLen,\r
116 IN OUT UINT8 **HashedDataResult\r
117 );\r
118\r
8069d49e
LG
119/**\r
120 This service abstracts the capability to add an entry to the Event Log.\r
121\r
122 @param This Indicates the calling context\r
123 @param TCGLogData Pointer to the start of the data buffer containing \r
124 the TCG_PCR_EVENT data structure. All fields in \r
125 this structure are properly filled by the caller.\r
126 @param EventNumber The event number of the event just logged\r
127 @param Flags Indicate additional flags. Only one flag has been \r
128 defined at this time, which is 0x01 and means the \r
129 extend operation should not be performed. All \r
130 other bits are reserved. \r
131 \r
132 @retval EFI_SUCCESS Operation completed successfully.\r
133 @retval EFI_DEVICE_ERROR The command was unsuccessful.\r
134 @retval EFI_INVALID_PARAMETER One or more of the parameters are incorrect.\r
135 @retval EFI_BUFFER_TOO_SMALL The receive buffer is too small.\r
136 @retval EFI_NOT_FOUND The component was not running\r
137**/\r
267669ba
LG
138typedef\r
139EFI_STATUS\r
8b13229b 140(EFIAPI *EFI_TCG_LOG_EVENT)(\r
267669ba
LG
141 IN EFI_TCG_PROTOCOL *This,\r
142 IN TCG_PCR_EVENT *TCGLogData,\r
143 IN OUT UINT32 *EventNumber,\r
144 IN UINT32 Flags\r
145 );\r
146\r
8069d49e
LG
147/**\r
148 This service is a proxy for commands to the TPM.\r
149\r
150 @param This Indicates the calling context\r
151 @param TpmInputParameterBlockSize Size of the TPM input parameter block\r
152 @param TpmInputParameterBlock Pointer to the TPM input parameter block\r
153 @param TpmOutputParameterBlockSize Size of the TPM output parameter block\r
154 @param TpmOutputParameterBlock Pointer to the TPM output parameter block\r
155\r
156 @retval EFI_SUCCESS Operation completed successfully.\r
157 @retval EFI_DEVICE_ERROR The command was unsuccessful.\r
158 @retval EFI_INVALID_PARAMETER One or more of the parameters are incorrect.\r
159 @retval EFI_BUFFER_TOO_SMALL The receive buffer is too small.\r
160 @retval EFI_NOT_FOUND The component was not running\r
161**/\r
267669ba
LG
162typedef\r
163EFI_STATUS\r
8b13229b 164(EFIAPI *EFI_TCG_PASS_THROUGH_TO_TPM)(\r
267669ba
LG
165 IN EFI_TCG_PROTOCOL *This,\r
166 IN UINT32 TpmInputParamterBlockSize,\r
167 IN UINT8 *TpmInputParamterBlock,\r
168 IN UINT32 TpmOutputParameterBlockSize,\r
169 IN UINT8 *TpmOutputParameterBlock\r
170 );\r
171\r
8069d49e
LG
172/**\r
173 This service abstracts the capability to do a hash operation on a data buffer, extend a specific TPM PCR with the hash result, and add an entry to the Event Log\r
174\r
175 @param This Indicates the calling context\r
176 @param HashData Physical address of the start of the data buffer \r
177 to be hashed, extended, and logged.\r
178 @param HashDataLen The length, in bytes, of the buffer referenced by HashData\r
179 @param AlgorithmId Identification of the Algorithm to use for the hashing operation\r
180 @param TCGLogData The physical address of the start of the data \r
181 buffer containing the TCG_PCR_EVENT data structure.\r
182 @param EventNumber The event number of the event just logged.\r
183 @param EventLogLastEntry Physical address of the first byte of the entry \r
184 just placed in the Event Log. If the Event Log was \r
185 empty when this function was called then this physical \r
186 address will be the same as the physical address of \r
187 the start of the Event Log.\r
188\r
189 @retval EFI_SUCCESS Operation completed successfully.\r
190 @retval EFI_DEVICE_ERROR The command was unsuccessful.\r
191 @retval EFI_INVALID_PARAMETER One or more of the parameters are incorrect.\r
192 @retval EFI_BUFFER_TOO_SMALL The receive buffer is too small.\r
193 @retval EFI_NOT_FOUND The component was not running\r
194**/\r
267669ba
LG
195typedef\r
196EFI_STATUS\r
8b13229b 197(EFIAPI *EFI_TCG_HASH_LOG_EXTEND_EVENT)(\r
267669ba 198 IN EFI_TCG_PROTOCOL *This,\r
5397fc66 199 IN EFI_PHYSICAL_ADDRESS HashData,\r
267669ba
LG
200 IN UINT64 HashDataLen,\r
201 IN TCG_ALGORITHM_ID AlgorithmId,\r
202 IN OUT TCG_PCR_EVENT *TCGLogData,\r
203 IN OUT UINT32 *EventNumber,\r
204 OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry\r
205 );\r
206\r
8069d49e
LG
207/**\r
208 The EFI_TCG Protocol abstracts TCG activity.\r
209\r
210 @param StatusCheck This service provides information on the TPM.\r
211 @param HashAll This service abstracts the capability to do a hash \r
212 operation on a data buffer.\r
213 @param LogEvent This service abstracts the capability to add \r
214 an entry to the Event Log.\r
215 @param PassThroughToTPM This service provides a pass-through capability \r
ac644614 216 from the caller to the system's TPM.\r
8069d49e
LG
217 @param HashLogExtendEvent This service abstracts the capability to do a hash \r
218 operation on a data buffer, extend a specific TPM PCR \r
219 with the hash result, and add an entry to the Event Log. \r
220\r
221**/\r
267669ba
LG
222typedef struct _EFI_TCG_PROTOCOL {\r
223 EFI_TCG_STATUS_CHECK StatusCheck;\r
224 EFI_TCG_HASH_ALL HashAll;\r
225 EFI_TCG_LOG_EVENT LogEvent;\r
226 EFI_TCG_PASS_THROUGH_TO_TPM PassThroughToTpm;\r
227 EFI_TCG_HASH_LOG_EXTEND_EVENT HashLogExtendEvent;\r
228} EFI_TCG_PROTOCOL;\r
229\r
230extern EFI_GUID gEfiTcgProtocolGuid;\r
231\r
232#endif\r