2 This library is used by other modules to send TPM12 command.
4 Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved. <BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef _TPM12_COMMAND_LIB_H_
10 #define _TPM12_COMMAND_LIB_H_
12 #include <IndustryStandard/Tpm12.h>
15 Send Startup command to TPM1.2.
17 @param TpmSt Startup Type.
19 @retval EFI_SUCCESS Operation completed successfully.
20 @retval EFI_DEVICE_ERROR Unexpected device behavior.
25 IN TPM_STARTUP_TYPE TpmSt
29 Send SaveState command to TPM1.2.
31 @retval EFI_SUCCESS Operation completed successfully.
32 @retval EFI_DEVICE_ERROR Unexpected device behavior.
41 Send ForceClear command to TPM1.2.
43 @retval EFI_SUCCESS Operation completed successfully.
44 @retval EFI_DEVICE_ERROR Unexpected device behavior.
57 } TPM12_PCR_SELECTION
;
60 TPM12_PCR_SELECTION pcrSelection
;
61 TPM_LOCALITY_SELECTION localityAtRelease
;
62 TPM_COMPOSITE_HASH digestAtRelease
;
63 } TPM12_PCR_INFO_SHORT
;
66 TPM_STRUCTURE_TAG tag
;
68 TPM12_PCR_INFO_SHORT pcrInfoRead
;
69 TPM12_PCR_INFO_SHORT pcrInfoWrite
;
70 TPM_NV_ATTRIBUTES permission
;
72 BOOLEAN bWriteSTClear
;
75 } TPM12_NV_DATA_PUBLIC
;
80 Send NV DefineSpace command to TPM1.2.
82 @param PubInfo The public parameters of the NV area.
83 @param EncAuth The encrypted AuthData, only valid if the attributes require subsequent authorization.
85 @retval EFI_SUCCESS Operation completed successfully.
86 @retval EFI_DEVICE_ERROR Unexpected device behavior.
91 IN TPM12_NV_DATA_PUBLIC
*PubInfo
,
92 IN TPM_ENCAUTH
*EncAuth
96 Send NV ReadValue command to TPM1.2.
98 @param NvIndex The index of the area to set.
99 @param Offset The offset into the area.
100 @param DataSize The size of the data area.
101 @param Data The data to set the area to.
103 @retval EFI_SUCCESS Operation completed successfully.
104 @retval EFI_DEVICE_ERROR Unexpected device behavior.
109 IN TPM_NV_INDEX NvIndex
,
111 IN OUT UINT32
*DataSize
,
116 Send NV WriteValue command to TPM1.2.
118 @param NvIndex The index of the area to set.
119 @param Offset The offset into the NV Area.
120 @param DataSize The size of the data parameter.
121 @param Data The data to set the area to.
123 @retval EFI_SUCCESS Operation completed successfully.
124 @retval EFI_DEVICE_ERROR Unexpected device behavior.
129 IN TPM_NV_INDEX NvIndex
,
138 @param[in] DigestToExtend The 160 bit value representing the event to be recorded.
139 @param[in] PcrIndex The PCR to be updated.
140 @param[out] NewPcrValue New PCR value after extend.
142 @retval EFI_SUCCESS Operation completed successfully.
143 @retval EFI_TIMEOUT The register can't run into the expected status in time.
144 @retval EFI_BUFFER_TOO_SMALL Response data buffer is too small.
145 @retval EFI_DEVICE_ERROR Unexpected device behavior.
151 IN TPM_DIGEST
*DigestToExtend
,
152 IN TPM_PCRINDEX PcrIndex
,
153 OUT TPM_DIGEST
*NewPcrValue
157 Send TSC_PhysicalPresence command to TPM.
159 @param[in] PhysicalPresence The state to set the TPMs Physical Presence flags.
161 @retval EFI_SUCCESS Operation completed successfully.
162 @retval EFI_TIMEOUT The register can't run into the expected status in time.
163 @retval EFI_BUFFER_TOO_SMALL Response data buffer is too small.
164 @retval EFI_DEVICE_ERROR Unexpected device behavior.
169 Tpm12PhysicalPresence (
170 IN TPM_PHYSICAL_PRESENCE PhysicalPresence
174 Send TPM_ContinueSelfTest command to TPM.
176 @retval EFI_SUCCESS Operation completed successfully.
177 @retval EFI_TIMEOUT The register can't run into the expected status in time.
178 @retval EFI_BUFFER_TOO_SMALL Response data buffer is too small.
179 @retval EFI_DEVICE_ERROR Unexpected device behavior.
184 Tpm12ContinueSelfTest (
189 Get TPM capability permanent flags.
191 @param[out] TpmPermanentFlags Pointer to the buffer for returned flag structure.
193 @retval EFI_SUCCESS Operation completed successfully.
194 @retval EFI_TIMEOUT The register can't run into the expected status in time.
195 @retval EFI_BUFFER_TOO_SMALL Response data buffer is too small.
196 @retval EFI_DEVICE_ERROR Unexpected device behavior.
201 Tpm12GetCapabilityFlagPermanent (
202 OUT TPM_PERMANENT_FLAGS
*TpmPermanentFlags
206 Get TPM capability volatile flags.
208 @param[out] VolatileFlags Pointer to the buffer for returned flag structure.
210 @retval EFI_SUCCESS Operation completed successfully.
211 @retval EFI_DEVICE_ERROR The command was unsuccessful.
216 Tpm12GetCapabilityFlagVolatile (
217 OUT TPM_STCLEAR_FLAGS
*VolatileFlags