TianoCore EDK2 master
Loading...
Searching...
No Matches
Tpm12CommandLib.h File Reference

Go to the source code of this file.

Data Structures

struct  TPM12_PCR_SELECTION
 
struct  TPM12_PCR_INFO_SHORT
 
struct  TPM12_NV_DATA_PUBLIC
 

Functions

EFI_STATUS EFIAPI Tpm12Startup (IN TPM_STARTUP_TYPE TpmSt)
 
EFI_STATUS EFIAPI Tpm12SaveState (VOID)
 
EFI_STATUS EFIAPI Tpm12ForceClear (VOID)
 
EFI_STATUS EFIAPI Tpm12NvDefineSpace (IN TPM12_NV_DATA_PUBLIC *PubInfo, IN TPM_ENCAUTH *EncAuth)
 
EFI_STATUS EFIAPI Tpm12NvReadValue (IN TPM_NV_INDEX NvIndex, IN UINT32 Offset, IN OUT UINT32 *DataSize, OUT UINT8 *Data)
 
EFI_STATUS EFIAPI Tpm12NvWriteValue (IN TPM_NV_INDEX NvIndex, IN UINT32 Offset, IN UINT32 DataSize, IN UINT8 *Data)
 
EFI_STATUS EFIAPI Tpm12Extend (IN TPM_DIGEST *DigestToExtend, IN TPM_PCRINDEX PcrIndex, OUT TPM_DIGEST *NewPcrValue)
 
EFI_STATUS EFIAPI Tpm12PhysicalPresence (IN TPM_PHYSICAL_PRESENCE PhysicalPresence)
 
EFI_STATUS EFIAPI Tpm12ContinueSelfTest (VOID)
 
EFI_STATUS EFIAPI Tpm12GetCapabilityFlagPermanent (OUT TPM_PERMANENT_FLAGS *TpmPermanentFlags)
 
EFI_STATUS EFIAPI Tpm12GetCapabilityFlagVolatile (OUT TPM_STCLEAR_FLAGS *VolatileFlags)
 

Detailed Description

This library is used by other modules to send TPM12 command.

Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Tpm12CommandLib.h.

Function Documentation

◆ Tpm12ContinueSelfTest()

EFI_STATUS EFIAPI Tpm12ContinueSelfTest ( VOID  )

Send TPM_ContinueSelfTest command to TPM.

Return values
EFI_SUCCESSOperation completed successfully.
EFI_TIMEOUTThe register can't run into the expected status in time.
EFI_BUFFER_TOO_SMALLResponse data buffer is too small.
EFI_DEVICE_ERRORUnexpected device behavior.

Definition at line 27 of file Tpm12SelfTest.c.

◆ Tpm12Extend()

EFI_STATUS EFIAPI Tpm12Extend ( IN TPM_DIGEST DigestToExtend,
IN TPM_PCRINDEX  PcrIndex,
OUT TPM_DIGEST NewPcrValue 
)

Extend a TPM PCR.

Parameters
[in]DigestToExtendThe 160 bit value representing the event to be recorded.
[in]PcrIndexThe PCR to be updated.
[out]NewPcrValueNew PCR value after extend.
Return values
EFI_SUCCESSOperation completed successfully.
EFI_TIMEOUTThe register can't run into the expected status in time.
EFI_BUFFER_TOO_SMALLResponse data buffer is too small.
EFI_DEVICE_ERRORUnexpected device behavior.

Definition at line 46 of file Tpm12Pcr.c.

◆ Tpm12ForceClear()

EFI_STATUS EFIAPI Tpm12ForceClear ( VOID  )

Send ForceClear command to TPM1.2.

Return values
EFI_SUCCESSOperation completed successfully.
EFI_DEVICE_ERRORUnexpected device behavior.

Definition at line 22 of file Tpm12Ownership.c.

◆ Tpm12GetCapabilityFlagPermanent()

EFI_STATUS EFIAPI Tpm12GetCapabilityFlagPermanent ( OUT TPM_PERMANENT_FLAGS TpmPermanentFlags)

Get TPM capability permanent flags.

Parameters
[out]TpmPermanentFlagsPointer to the buffer for returned flag structure.
Return values
EFI_SUCCESSOperation completed successfully.
EFI_TIMEOUTThe register can't run into the expected status in time.
EFI_BUFFER_TOO_SMALLResponse data buffer is too small.
EFI_DEVICE_ERRORUnexpected device behavior.

Definition at line 52 of file Tpm12GetCapability.c.

◆ Tpm12GetCapabilityFlagVolatile()

EFI_STATUS EFIAPI Tpm12GetCapabilityFlagVolatile ( OUT TPM_STCLEAR_FLAGS VolatileFlags)

Get TPM capability volatile flags.

Parameters
[out]VolatileFlagsPointer to the buffer for returned flag structure.
Return values
EFI_SUCCESSOperation completed successfully.
EFI_DEVICE_ERRORThe command was unsuccessful.

Definition at line 98 of file Tpm12GetCapability.c.

◆ Tpm12NvDefineSpace()

EFI_STATUS EFIAPI Tpm12NvDefineSpace ( IN TPM12_NV_DATA_PUBLIC PubInfo,
IN TPM_ENCAUTH EncAuth 
)

Send NV DefineSpace command to TPM1.2.

Parameters
PubInfoThe public parameters of the NV area.
EncAuthThe encrypted AuthData, only valid if the attributes require subsequent authorization.
Return values
EFI_SUCCESSOperation completed successfully.
EFI_DEVICE_ERRORUnexpected device behavior.

Definition at line 64 of file Tpm12NvStorage.c.

◆ Tpm12NvReadValue()

EFI_STATUS EFIAPI Tpm12NvReadValue ( IN TPM_NV_INDEX  NvIndex,
IN UINT32  Offset,
IN OUT UINT32 *  DataSize,
OUT UINT8 *  Data 
)

Send NV ReadValue command to TPM1.2.

Parameters
NvIndexThe index of the area to set.
OffsetThe offset into the area.
DataSizeThe size of the data area.
DataThe data to set the area to.
Return values
EFI_SUCCESSOperation completed successfully.
EFI_DEVICE_ERRORUnexpected device behavior.

Definition at line 129 of file Tpm12NvStorage.c.

◆ Tpm12NvWriteValue()

EFI_STATUS EFIAPI Tpm12NvWriteValue ( IN TPM_NV_INDEX  NvIndex,
IN UINT32  Offset,
IN UINT32  DataSize,
IN UINT8 *  Data 
)

Send NV WriteValue command to TPM1.2.

Parameters
NvIndexThe index of the area to set.
OffsetThe offset into the NV Area.
DataSizeThe size of the data parameter.
DataThe data to set the area to.
Return values
EFI_SUCCESSOperation completed successfully.
EFI_DEVICE_ERRORUnexpected device behavior.

Definition at line 191 of file Tpm12NvStorage.c.

◆ Tpm12PhysicalPresence()

EFI_STATUS EFIAPI Tpm12PhysicalPresence ( IN TPM_PHYSICAL_PRESENCE  PhysicalPresence)

Send TSC_PhysicalPresence command to TPM.

Parameters
[in]PhysicalPresenceThe state to set the TPMs Physical Presence flags.
Return values
EFI_SUCCESSOperation completed successfully.
EFI_TIMEOUTThe register can't run into the expected status in time.
EFI_BUFFER_TOO_SMALLResponse data buffer is too small.
EFI_DEVICE_ERRORUnexpected device behavior.

Definition at line 37 of file Tpm12PhysicalPresence.c.

◆ Tpm12SaveState()

EFI_STATUS EFIAPI Tpm12SaveState ( VOID  )

Send SaveState command to TPM1.2.

Return values
EFI_SUCCESSOperation completed successfully.
EFI_DEVICE_ERRORUnexpected device behavior.

Definition at line 78 of file Tpm12Startup.c.

◆ Tpm12Startup()

EFI_STATUS EFIAPI Tpm12Startup ( IN TPM_STARTUP_TYPE  TpmSt)

Send Startup command to TPM1.2.

Parameters
TpmStStartup Type.
Return values
EFI_SUCCESSOperation completed successfully.
EFI_DEVICE_ERRORUnexpected device behavior.

Definition at line 35 of file Tpm12Startup.c.