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