]> git.proxmox.com Git - mirror_edk2.git/blob - Vlv2TbltDevicePkg/Include/Protocol/TpmMp.h
Vlv2TbltDevicePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / Vlv2TbltDevicePkg / Include / Protocol / TpmMp.h
1 /*++
2
3 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
4
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7
8
9
10 Module Name:
11
12 Tpm.h
13
14 Abstract:
15
16
17 --*/
18
19 #ifndef __EFI_TPM_MP_DRIVER_PROTOCOL_H__
20 #define __EFI_TPM_MP_DRIVER_PROTOCOL_H__
21
22
23 #define EFI_TPM_MP_DRIVER_PROTOCOL_GUID \
24 { 0xde161cfe, 0x1e60, 0x42a1, 0x8c, 0xc3, 0xee, 0x7e, 0xf0, 0x73, 0x52, 0x12 }
25
26
27 EFI_FORWARD_DECLARATION (EFI_TPM_MP_DRIVER_PROTOCOL);
28
29 #define TPM_DRIVER_STATUS 0
30 #define TPM_DEVICE_STATUS 1
31
32 #define TPM_DRIVER_OK 0
33 #define TPM_DRIVER_FAILED 1
34 #define TPM_DRIVER_NOT_OPENED 2
35 #define TPM_DEVICE_OK 0
36 #define TPM_DEVICE_UNRECOVERABLE 1
37 #define TPM_DEVICE_RECOVERABLE 2
38 #define TPM_DEVICE_NOT_FOUND 3
39
40 //
41 // Prototypes for the TPM MP Driver Protocol
42 //
43
44 /**
45 This service Open the TPM interface
46
47 @param[in] This A pointer to the EFI_TPM_MP_DRIVER_PROTOCOL.
48
49 @retval EFI_SUCCESS Operation completed successfully
50 @retval EFI_DEVICE_ERROR The command was unsuccessful
51 @retval EFI_NOT_FOUND The component was not running
52
53 **/
54 typedef
55 EFI_STATUS
56 (EFIAPI *EFI_TPM_MP_INIT) (
57 IN EFI_TPM_MP_DRIVER_PROTOCOL *This
58 );
59
60 /**
61 This service close the TPM interface and deactivate TPM
62
63 @param[in] This A pointer to the EFI_TPM_MP_DRIVER_PROTOCOL.
64
65 @retval EFI_SUCCESS Operation completed successfully
66 @retval EFI_DEVICE_ERROR The command was unsuccessful
67 @retval EFI_NOT_FOUND The component was not running
68
69 **/
70 typedef
71 EFI_STATUS
72 (EFIAPI *EFI_TPM_MP_CLOSE) (
73 IN EFI_TPM_MP_DRIVER_PROTOCOL *This
74 );
75
76 /**
77 This service get the current status infomation of TPM
78
79 @param[in] This A pointer to the EFI_TPM_MP_DRIVER_PROTOCOL.
80 @param[in] ReqStatusType Requested type of status information, driver or device.
81 @param[in] Status Pointer to the returned status.
82
83 @retval EFI_SUCCESS Operation completed successfully
84 @retval EFI_DEVICE_ERROR The command was unsuccessful
85 @retval EFI_INVALID_PARAMETER One or more of the parameters are incorrect
86 @retval EFI_BUFFER_TOO_SMALL The receive buffer is too small
87 @retval EFI_NOT_FOUND The component was not running
88
89 **/
90 typedef
91 EFI_STATUS
92 (EFIAPI *EFI_TPM_MP_GET_STATUS_INFO) (
93 IN EFI_TPM_MP_DRIVER_PROTOCOL *This,
94 IN UINT32 ReqStatusType,
95 OUT UINT32 *Status
96 );
97
98 /**
99 This service transmit data to the TPM and get response from TPM
100
101 @param[in] This A pointer to the EFI_TPM_MP_DRIVER_PROTOCOL.
102 @param[in] TransmitBuf Pointer to a buffer containing TPM transmit data.
103 @param[in] TransmitBufLen Sizeof TPM input buffer in bytes.
104 @param[in] ReceiveBuf Pointer to a buffer containing TPM receive data.
105 @param[in] ReceiveBufLen On input, size of TPM receive buffer in bytes.
106 On output, number of bytes written.
107
108 @retval EFI_SUCCESS Operation completed successfully
109 @retval EFI_DEVICE_ERROR The command was unsuccessful
110 @retval EFI_INVALID_PARAMETER One or more of the parameters are incorrect
111 @retval EFI_BUFFER_TOO_SMALL The receive buffer is too small
112 @retval EFI_NOT_FOUND The component was not running
113
114 **/
115 typedef
116 EFI_STATUS
117 (EFIAPI *EFI_TPM_MP_TRANSMIT) (
118 IN EFI_TPM_MP_DRIVER_PROTOCOL *This,
119 IN UINT8 *TransmitBuffer,
120 IN UINT32 TransmitBufferLen,
121 OUT UINT8 *ReceiveBuf,
122 IN OUT UINT32 *ReceiveBufLen
123 );
124
125
126
127 typedef struct _EFI_TPM_MP_DRIVER_PROTOCOL {
128 EFI_TPM_MP_INIT Init;
129 EFI_TPM_MP_CLOSE Close;
130 EFI_TPM_MP_GET_STATUS_INFO GetStatusInfo;
131 EFI_TPM_MP_TRANSMIT Transmit;
132 } EFI_TPM_MP_DRIVER_PROTOCOL;
133
134 extern EFI_GUID gEfiTpmMpDriverProtocolGuid;
135
136 #endif