]> git.proxmox.com Git - mirror_edk2.git/blame - SecurityPkg/Tcg/TcgConfigDxe/TcgConfigImpl.h
SecurityPkg: TcgConfigDxe: Move TPM state string update to CallBack function
[mirror_edk2.git] / SecurityPkg / Tcg / TcgConfigDxe / TcgConfigImpl.h
CommitLineData
0c18794e 1/** @file\r
2 The header file of HII Config Access protocol implementation of TCG\r
3 configuration module.\r
4\r
c132457e 5Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>\r
0c18794e 6This program and the accompanying materials \r
7are licensed and made available under the terms and conditions of the BSD License \r
8which accompanies this distribution. The full text of the license may be found at \r
9http://opensource.org/licenses/bsd-license.php\r
10\r
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15\r
16#ifndef __TCG_CONFIG_IMPL_H__\r
17#define __TCG_CONFIG_IMPL_H__\r
18\r
19#include <Uefi.h>\r
20\r
21#include <Protocol/HiiConfigAccess.h>\r
22#include <Protocol/HiiConfigRouting.h>\r
23#include <Protocol/TcgService.h>\r
24\r
25#include <Library/BaseLib.h>\r
26#include <Library/BaseMemoryLib.h>\r
27#include <Library/DebugLib.h>\r
28#include <Library/MemoryAllocationLib.h>\r
29#include <Library/UefiBootServicesTableLib.h>\r
30#include <Library/UefiRuntimeServicesTableLib.h>\r
31#include <Library/UefiHiiServicesLib.h>\r
32#include <Library/UefiLib.h>\r
33#include <Library/HiiLib.h>\r
34#include <Library/DevicePathLib.h>\r
35#include <Library/PcdLib.h>\r
36#include <Library/PrintLib.h>\r
c132457e 37#include <Library/Tpm12DeviceLib.h>\r
0c18794e 38\r
39#include <Guid/MdeModuleHii.h>\r
40\r
41#include "TcgConfigNvData.h"\r
42\r
43//\r
44// Tool generated IFR binary data and String package data\r
45//\r
46extern UINT8 TcgConfigBin[];\r
47extern UINT8 TcgConfigDxeStrings[];\r
48\r
49///\r
50/// HII specific Vendor Device Path definition.\r
51///\r
52typedef struct {\r
53 VENDOR_DEVICE_PATH VendorDevicePath;\r
54 EFI_DEVICE_PATH_PROTOCOL End;\r
55} HII_VENDOR_DEVICE_PATH;\r
56\r
57typedef struct {\r
58 UINTN Signature;\r
59\r
60 EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;\r
61 EFI_HII_HANDLE HiiHandle;\r
62 EFI_HANDLE DriverHandle; \r
63\r
1826b5e6 64 TCG_CONFIGURATION *Configuration;\r
0c18794e 65 EFI_TCG_PROTOCOL *TcgProtocol;\r
0c18794e 66} TCG_CONFIG_PRIVATE_DATA;\r
67\r
68extern TCG_CONFIG_PRIVATE_DATA mTcgConfigPrivateDateTemplate;\r
69\r
70#define TCG_CONFIG_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('T', 'C', 'G', 'D')\r
71#define TCG_CONFIG_PRIVATE_DATA_FROM_THIS(a) CR (a, TCG_CONFIG_PRIVATE_DATA, ConfigAccess, TCG_CONFIG_PRIVATE_DATA_SIGNATURE)\r
72\r
73\r
74/**\r
75 This function publish the TCG configuration Form for TPM device.\r
76\r
77 @param[in, out] PrivateData Points to TCG configuration private data.\r
78\r
79 @retval EFI_SUCCESS HII Form is installed for this network device.\r
80 @retval EFI_OUT_OF_RESOURCES Not enough resource for HII Form installation.\r
81 @retval Others Other errors as indicated.\r
82\r
83**/\r
84EFI_STATUS\r
85InstallTcgConfigForm (\r
86 IN OUT TCG_CONFIG_PRIVATE_DATA *PrivateData\r
87 );\r
88\r
89/**\r
90 This function removes TCG configuration Form.\r
91\r
92 @param[in, out] PrivateData Points to TCG configuration private data.\r
93\r
94**/\r
95VOID\r
96UninstallTcgConfigForm (\r
97 IN OUT TCG_CONFIG_PRIVATE_DATA *PrivateData\r
98 );\r
99\r
100/**\r
101 This function allows a caller to extract the current configuration for one\r
102 or more named elements from the target driver.\r
103\r
104 @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
105 @param[in] Request A null-terminated Unicode string in\r
106 <ConfigRequest> format.\r
107 @param[out] Progress On return, points to a character in the Request\r
108 string. Points to the string's null terminator if\r
109 request was successful. Points to the most recent\r
110 '&' before the first failing name/value pair (or\r
111 the beginning of the string if the failure is in\r
112 the first name/value pair) if the request was not\r
113 successful.\r
114 @param[out] Results A null-terminated Unicode string in\r
115 <ConfigAltResp> format which has all values filled\r
116 in for the names in the Request string. String to\r
117 be allocated by the called function.\r
118\r
119 @retval EFI_SUCCESS The Results is filled with the requested values.\r
120 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.\r
121 @retval EFI_INVALID_PARAMETER Request is illegal syntax, or unknown name.\r
122 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this\r
123 driver.\r
124\r
125**/\r
126EFI_STATUS\r
127EFIAPI\r
128TcgExtractConfig (\r
129 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
130 IN CONST EFI_STRING Request,\r
131 OUT EFI_STRING *Progress,\r
132 OUT EFI_STRING *Results\r
133 );\r
134\r
135/**\r
136 This function processes the results of changes in configuration.\r
137\r
138 @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
139 @param[in] Configuration A null-terminated Unicode string in <ConfigResp>\r
140 format.\r
141 @param[out] Progress A pointer to a string filled in with the offset of\r
142 the most recent '&' before the first failing\r
143 name/value pair (or the beginning of the string if\r
144 the failure is in the first name/value pair) or\r
145 the terminating NULL if all was successful.\r
146\r
147 @retval EFI_SUCCESS The Results is processed successfully.\r
148 @retval EFI_INVALID_PARAMETER Configuration is NULL.\r
149 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this\r
150 driver.\r
151\r
152**/\r
153EFI_STATUS\r
154EFIAPI\r
155TcgRouteConfig (\r
156 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
157 IN CONST EFI_STRING Configuration,\r
158 OUT EFI_STRING *Progress\r
159 );\r
160\r
161/**\r
162 This function processes the results of changes in configuration.\r
163\r
164 @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
165 @param[in] Action Specifies the type of action taken by the browser.\r
166 @param[in] QuestionId A unique value which is sent to the original\r
167 exporting driver so that it can identify the type\r
168 of data to expect.\r
169 @param[in] Type The type of value for the question.\r
170 @param[in] Value A pointer to the data being sent to the original\r
171 exporting driver.\r
172 @param[out] ActionRequest On return, points to the action requested by the\r
173 callback function.\r
174\r
175 @retval EFI_SUCCESS The callback successfully handled the action.\r
176 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the\r
177 variable and its data.\r
178 @retval EFI_DEVICE_ERROR The variable could not be saved.\r
179 @retval EFI_UNSUPPORTED The specified Action is not supported by the\r
180 callback.\r
181\r
182**/\r
183EFI_STATUS\r
184EFIAPI\r
185TcgCallback (\r
186 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
187 IN EFI_BROWSER_ACTION Action,\r
188 IN EFI_QUESTION_ID QuestionId,\r
189 IN UINT8 Type,\r
190 IN EFI_IFR_TYPE_VALUE *Value,\r
191 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest\r
192 );\r
193\r
194#endif\r