]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Protocol/TcgService/TcgService.h
Add in the 1st version of ECP.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Protocol / TcgService / TcgService.h
1 /*++
2
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 TcgService.h
15
16 Abstract:
17
18 TCG Service Protocol as defined in TCG_EFI_Protocol_1_20_Final
19
20 See http://trustedcomputinggroup.org for the latest specification
21
22 --*/
23
24 #ifndef _TCG_SERVICE_PROTOCOL_H_
25 #define _TCG_SERVICE_PROTOCOL_H_
26
27 #include <EfiTpm.h>
28
29 #define EFI_TCG_PROTOCOL_GUID \
30 {0xf541796d, 0xa62e, 0x4954, 0xa7, 0x75, 0x95, 0x84, 0xf6, 0x1b, 0x9c, 0xdd}
31
32 #define TSS_EVENT_DATA_MAX_SIZE 256
33
34 EFI_FORWARD_DECLARATION (EFI_TCG_PROTOCOL);
35
36 //
37 // Set structure alignment to 1-byte
38 //
39 #pragma pack (push, 1)
40
41 typedef struct {
42 UINT8 Major;
43 UINT8 Minor;
44 UINT8 RevMajor;
45 UINT8 RevMinor;
46 } TCG_VERSION;
47
48 typedef struct _TCG_EFI_BOOT_SERVICE_CAPABILITY {
49 UINT8 Size; // Size of this structure
50 TCG_VERSION StructureVersion;
51 TCG_VERSION ProtocolSpecVersion;
52 UINT8 HashAlgorithmBitmap; // Hash algorithms
53 // this protocol is capable of : 01=SHA-1
54 BOOLEAN TPMPresentFlag; // 00h = TPM not present
55 BOOLEAN TPMDeactivatedFlag; // 01h = TPM currently deactivated
56 } TCG_EFI_BOOT_SERVICE_CAPABILITY;
57
58 typedef UINT32 TCG_ALGORITHM_ID;
59
60 //
61 // Restore original structure alignment
62 //
63 #pragma pack (pop)
64
65 typedef
66 EFI_STATUS
67 (EFIAPI *EFI_TCG_STATUS_CHECK) (
68 IN EFI_TCG_PROTOCOL *This,
69 OUT TCG_EFI_BOOT_SERVICE_CAPABILITY
70 *ProtocolCapability,
71 OUT UINT32 *TCGFeatureFlags,
72 OUT EFI_PHYSICAL_ADDRESS *EventLogLocation,
73 OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry
74 );
75
76 typedef
77 EFI_STATUS
78 (EFIAPI *EFI_TCG_HASH_ALL) (
79 IN EFI_TCG_PROTOCOL *This,
80 IN UINT8 *HashData,
81 IN UINT64 HashDataLen,
82 IN TCG_ALGORITHM_ID AlgorithmId,
83 IN OUT UINT64 *HashedDataLen,
84 IN OUT UINT8 **HashedDataResult
85 );
86
87 typedef
88 EFI_STATUS
89 (EFIAPI *EFI_TCG_LOG_EVENT) (
90 IN EFI_TCG_PROTOCOL *This,
91 IN TCG_PCR_EVENT *TCGLogData,
92 IN OUT UINT32 *EventNumber,
93 IN UINT32 Flags
94 );
95
96 typedef
97 EFI_STATUS
98 (EFIAPI *EFI_TCG_PASS_THROUGH_TO_TPM) (
99 IN EFI_TCG_PROTOCOL *This,
100 IN UINT32 TpmInputParamterBlockSize,
101 IN UINT8 *TpmInputParamterBlock,
102 IN UINT32 TpmOutputParameterBlockSize,
103 IN UINT8 *TpmOutputParameterBlock
104 );
105
106 typedef
107 EFI_STATUS
108 (EFIAPI *EFI_TCG_HASH_LOG_EXTEND_EVENT) (
109 IN EFI_TCG_PROTOCOL *This,
110 IN UINT8 *HashData,
111 IN UINT64 HashDataLen,
112 IN TCG_ALGORITHM_ID AlgorithmId,
113 IN OUT TCG_PCR_EVENT *TCGLogData,
114 IN OUT UINT32 *EventNumber,
115 OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry
116 );
117
118 typedef struct _EFI_TCG_PROTOCOL {
119 EFI_TCG_STATUS_CHECK StatusCheck;
120 EFI_TCG_HASH_ALL HashAll;
121 EFI_TCG_LOG_EVENT LogEvent;
122 EFI_TCG_PASS_THROUGH_TO_TPM PassThroughToTpm;
123 EFI_TCG_HASH_LOG_EXTEND_EVENT HashLogExtendEvent;
124 } EFI_TCG_PROTOCOL;
125
126 extern EFI_GUID gEfiTcgProtocolGuid;
127
128 #endif