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