]> git.proxmox.com Git - mirror_edk2.git/blame - SecurityPkg/Tcg/TcgDxe/TpmComm.h
SecurityPkg/TcgDxe: Replace TpmCommLib with Tpm12DeviceLib
[mirror_edk2.git] / SecurityPkg / Tcg / TcgDxe / TpmComm.h
CommitLineData
0c18794e 1/** @file \r
2 Definitions and function prototypes used by TPM DXE driver.\r
3\r
7cb1b15b 4Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.<BR>\r
0c18794e 5This program and the accompanying materials \r
6are licensed and made available under the terms and conditions of the BSD License \r
7which accompanies this distribution. The full text of the license may be found at \r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef _TPM_COMM_H_\r
16#define _TPM_COMM_H_\r
17\r
18/**\r
19 Add a new entry to the Event Log.\r
20\r
21 @param[in, out] EventLogPtr Pointer to the Event Log data. \r
22 @param[in, out] LogSize Size of the Event Log. \r
23 @param[in] MaxSize Maximum size of the Event Log.\r
24 @param[in] NewEventHdr Pointer to a TCG_PCR_EVENT_HDR data structure. \r
25 @param[in] NewEventData Pointer to the new event data. \r
26 \r
27 @retval EFI_SUCCESS The new event log entry was added.\r
28 @retval EFI_OUT_OF_RESOURCES No enough memory to log the new event.\r
29\r
30**/\r
31EFI_STATUS\r
32TpmCommLogEvent (\r
33 IN OUT UINT8 **EventLogPtr,\r
34 IN OUT UINTN *LogSize,\r
35 IN UINTN MaxSize,\r
36 IN TCG_PCR_EVENT_HDR *NewEventHdr,\r
37 IN UINT8 *NewEventData\r
38 );\r
39\r
40/**\r
41 Extend a TPM PCR.\r
42\r
0c18794e 43 @param[in] DigestToExtend The 160 bit value representing the event to be recorded. \r
44 @param[in] PcrIndex The PCR to be updated.\r
45 @param[out] NewPcrValue New PCR value after extend. \r
46 \r
47 @retval EFI_SUCCESS Operation completed successfully.\r
48 @retval EFI_DEVICE_ERROR The command was unsuccessful.\r
49\r
50**/\r
51EFI_STATUS\r
52TpmCommExtend (\r
0c18794e 53 IN TPM_DIGEST *DigestToExtend,\r
54 IN TPM_PCRINDEX PcrIndex,\r
55 OUT TPM_DIGEST *NewPcrValue\r
56 );\r
57\r
58/**\r
59 Get TPM capability flags.\r
60\r
0c18794e 61 @param[in] FlagSubcap Flag subcap. \r
62 @param[out] FlagBuffer Pointer to the buffer for returned flag structure.\r
63 @param[in] FlagSize Size of the buffer. \r
64 \r
65 @retval EFI_SUCCESS Operation completed successfully.\r
66 @retval EFI_DEVICE_ERROR The command was unsuccessful.\r
67\r
68**/\r
69EFI_STATUS\r
70TpmCommGetFlags (\r
0c18794e 71 IN UINT32 FlagSubcap,\r
72 OUT VOID *Buffer,\r
73 IN UINTN Size\r
74 );\r
75\r
76/**\r
77 Send formatted command to TPM for execution and return formatted data from response.\r
78\r
79 @param[in] TisReg TPM Handle. \r
80 @param[in] Fmt Format control string. \r
81 @param[in] ... The variable argument list.\r
7cb1b15b 82\r
0c18794e 83 @retval EFI_SUCCESS Operation completed successfully.\r
84 @retval EFI_TIMEOUT The register can't run into the expected status in time.\r
85\r
86**/\r
87EFI_STATUS\r
88EFIAPI\r
89TisPcExecute (\r
0c18794e 90 IN CONST CHAR8 *Fmt,\r
91 ...\r
92 );\r
93\r
7cb1b15b
MK
94/**\r
95 Single function calculates SHA1 digest value for all raw data. It\r
96 combines Sha1Init(), Sha1Update() and Sha1Final().\r
97\r
98 @param[in] Data Raw data to be digested.\r
99 @param[in] DataLen Size of the raw data.\r
100 @param[out] Digest Pointer to a buffer that stores the final digest.\r
101\r
102 @retval EFI_SUCCESS Always successfully calculate the final digest.\r
103**/\r
104EFI_STATUS\r
105EFIAPI\r
106TpmCommHashAll (\r
107 IN CONST UINT8 *Data,\r
108 IN UINTN DataLen,\r
109 OUT TPM_DIGEST *Digest\r
110 );\r
111\r
0c18794e 112#endif // _TPM_COMM_H_\r