]> git.proxmox.com Git - mirror_edk2.git/blob - Vlv2DeviceRefCodePkg/Include/Protocol/PttPassThru.h
2009a46816393260fef559157546e96722dd4fce
[mirror_edk2.git] / Vlv2DeviceRefCodePkg / Include / Protocol / PttPassThru.h
1 /*++
2
3 Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
4
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 --*/
8
9 #ifndef _EFI_PTT_PASS_THRU_H
10 #define _EFI_PTT_PASS_THRU_H
11
12 #define PTT_PASS_THRU_PROTOCOL_GUID \
13 { \
14 0x73e2576, 0xf6c1, 0x4b91, 0x92, 0xa9, 0xd4, 0x67, 0x5d, 0xda, 0x34, 0xb1 \
15 }
16 // {073E2576-F6C1-4b91-92A9-D4675DDA34B1}
17 //static const GUID <<name>> =
18 //{ 0x73e2576, 0xf6c1, 0x4b91, { 0x92, 0xa9, 0xd4, 0x67, 0x5d, 0xda, 0x34, 0xb1 } };
19
20
21 //#define EFI_PTT_PROTOCOL_GUID HECI_PROTOCOL_GUID
22
23 typedef struct _PTT_PASS_THRU_PROTOCOL PTT_PASS_THRU_PROTOCOL;
24
25 /**
26 This service enables the sending of commands to the TPM2.
27
28 @param[in] InputParameterBlockSize Size of the TPM2 input parameter block.
29 @param[in] InputParameterBlock Pointer to the TPM2 input parameter block.
30 @param[in,out] OutputParameterBlockSize Size of the TPM2 output parameter block.
31 @param[in] OutputParameterBlock Pointer to the TPM2 output parameter block.
32
33 @retval EFI_SUCCESS The command byte stream was successfully sent to the device and a response was successfully received.
34 @retval EFI_DEVICE_ERROR The command was not successfully sent to the device or a response was not successfully received from the device.
35 @retval EFI_BUFFER_TOO_SMALL The output parameter block is too small.
36 **/
37 typedef
38 EFI_STATUS
39 (EFIAPI *TPM2_SUBMIT_COMMAND) (
40 IN PTT_PASS_THRU_PROTOCOL *This,
41 IN UINT32 InputParameterBlockSize,
42 IN UINT8 *InputParameterBlock,
43 IN OUT UINT32 *OutputParameterBlockSize,
44 IN UINT8 *OutputParameterBlock
45 );
46
47 /**
48 This service requests use TPM2.
49
50 @retval EFI_SUCCESS Get the control of TPM2 chip.
51 @retval EFI_NOT_FOUND TPM2 not found.
52 @retval EFI_DEVICE_ERROR Unexpected device behavior.
53 **/
54 typedef
55 EFI_STATUS
56 (EFIAPI *TPM2_REQUEST_USE_TPM) (
57 IN PTT_PASS_THRU_PROTOCOL *This
58 );
59
60 typedef struct {
61 EFI_GUID ProviderGuid;
62 TPM2_SUBMIT_COMMAND Tpm2SubmitCommand;
63 TPM2_REQUEST_USE_TPM Tpm2RequestUseTpm;
64 } PTT_TPM2_DEVICE_INTERFACE;
65
66
67 /**
68 This service register TPM2 device.
69
70 @param Tpm2Device TPM2 device
71
72 @retval EFI_SUCCESS This TPM2 device is registered successfully.
73 @retval EFI_UNSUPPORTED System does not support register this TPM2 device.
74 @retval EFI_ALREADY_STARTED System already register this TPM2 device.
75 **/
76 typedef
77 EFI_STATUS
78 (EFIAPI *TPM2_REGISTER_TPM2_DEVICE_LIB) (
79 IN PTT_PASS_THRU_PROTOCOL *This,
80 IN PTT_TPM2_DEVICE_INTERFACE *Tpm2Device
81 );
82
83 typedef struct _PTT_PASS_THRU_PROTOCOL {
84 TPM2_SUBMIT_COMMAND Tpm2SubmitCommand;
85 TPM2_REQUEST_USE_TPM Tpm2RequestUseTpm;
86 TPM2_REGISTER_TPM2_DEVICE_LIB Tpm2RegisterTpm2DeviceLib;
87 } PTT_PASS_THRU_PROTOCOL;
88
89 extern EFI_GUID gPttPassThruProtocolGuid;
90
91 #endif // _EFI_HECI_H