]> git.proxmox.com Git - mirror_edk2.git/blame - SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.h
BaseTools: fix the bug for Mixed Pcd display in the report
[mirror_edk2.git] / SecurityPkg / Tcg / Tcg2Config / Tcg2ConfigImpl.h
CommitLineData
1abfa4ce
JY
1/** @file\r
2 The header file of HII Config Access protocol implementation of TCG2\r
3 configuration module.\r
4\r
5Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
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 __TCG2_CONFIG_IMPL_H__\r
17#define __TCG2_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/Tcg2Protocol.h>\r
24#include <Protocol/VariableLock.h>\r
25\r
26#include <Library/BaseLib.h>\r
27#include <Library/BaseMemoryLib.h>\r
28#include <Library/DebugLib.h>\r
29#include <Library/MemoryAllocationLib.h>\r
30#include <Library/UefiBootServicesTableLib.h>\r
31#include <Library/UefiRuntimeServicesTableLib.h>\r
32#include <Library/UefiHiiServicesLib.h>\r
33#include <Library/UefiLib.h>\r
34#include <Library/HiiLib.h>\r
35#include <Library/DevicePathLib.h>\r
36#include <Library/PcdLib.h>\r
37#include <Library/PrintLib.h>\r
38#include <Library/Tcg2PhysicalPresenceLib.h>\r
39\r
40#include <Guid/MdeModuleHii.h>\r
41\r
42#include "Tcg2ConfigNvData.h"\r
43\r
44//\r
45// Tool generated IFR binary data and String package data\r
46//\r
47extern UINT8 Tcg2ConfigBin[];\r
48extern UINT8 Tcg2ConfigDxeStrings[];\r
49\r
50///\r
51/// HII specific Vendor Device Path definition.\r
52///\r
53typedef struct {\r
54 VENDOR_DEVICE_PATH VendorDevicePath;\r
55 EFI_DEVICE_PATH_PROTOCOL End;\r
56} HII_VENDOR_DEVICE_PATH;\r
57\r
58typedef struct {\r
59 UINTN Signature;\r
60\r
61 EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;\r
62 EFI_HII_HANDLE HiiHandle;\r
63 EFI_HANDLE DriverHandle; \r
64\r
65 UINT8 TpmDeviceDetected;\r
66 EFI_TCG2_PROTOCOL *Tcg2Protocol;\r
67 EFI_TCG2_BOOT_SERVICE_CAPABILITY ProtocolCapability;\r
68 UINT32 PCRBanksDesired;\r
69} TCG2_CONFIG_PRIVATE_DATA;\r
70\r
71extern TCG2_CONFIG_PRIVATE_DATA mTcg2ConfigPrivateDateTemplate;\r
72extern TCG2_CONFIG_PRIVATE_DATA *mTcg2ConfigPrivateDate;\r
73#define TCG2_CONFIG_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('T', 'r', 'E', 'D')\r
74#define TCG2_CONFIG_PRIVATE_DATA_FROM_THIS(a) CR (a, TCG2_CONFIG_PRIVATE_DATA, ConfigAccess, TCG2_CONFIG_PRIVATE_DATA_SIGNATURE)\r
75\r
76\r
77/**\r
78 This function publish the TCG2 configuration Form for TPM device.\r
79\r
80 @param[in, out] PrivateData Points to TCG2 configuration private data.\r
81\r
82 @retval EFI_SUCCESS HII Form is installed for this network device.\r
83 @retval EFI_OUT_OF_RESOURCES Not enough resource for HII Form installation.\r
84 @retval Others Other errors as indicated.\r
85\r
86**/\r
87EFI_STATUS\r
88InstallTcg2ConfigForm (\r
89 IN OUT TCG2_CONFIG_PRIVATE_DATA *PrivateData\r
90 );\r
91\r
92/**\r
93 This function removes TCG2 configuration Form.\r
94\r
95 @param[in, out] PrivateData Points to TCG2 configuration private data.\r
96\r
97**/\r
98VOID\r
99UninstallTcg2ConfigForm (\r
100 IN OUT TCG2_CONFIG_PRIVATE_DATA *PrivateData\r
101 );\r
102\r
103/**\r
104 This function allows a caller to extract the current configuration for one\r
105 or more named elements from the target driver.\r
106\r
107 @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
108 @param[in] Request A null-terminated Unicode string in\r
109 <ConfigRequest> format.\r
110 @param[out] Progress On return, points to a character in the Request\r
111 string. Points to the string's null terminator if\r
112 request was successful. Points to the most recent\r
113 '&' before the first failing name/value pair (or\r
114 the beginning of the string if the failure is in\r
115 the first name/value pair) if the request was not\r
116 successful.\r
117 @param[out] Results A null-terminated Unicode string in\r
118 <ConfigAltResp> format which has all values filled\r
119 in for the names in the Request string. String to\r
120 be allocated by the called function.\r
121\r
122 @retval EFI_SUCCESS The Results is filled with the requested values.\r
123 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.\r
124 @retval EFI_INVALID_PARAMETER Request is illegal syntax, or unknown name.\r
125 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this\r
126 driver.\r
127\r
128**/\r
129EFI_STATUS\r
130EFIAPI\r
131Tcg2ExtractConfig (\r
132 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
133 IN CONST EFI_STRING Request,\r
134 OUT EFI_STRING *Progress,\r
135 OUT EFI_STRING *Results\r
136 );\r
137\r
138/**\r
139 This function processes the results of changes in configuration.\r
140\r
141 @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
142 @param[in] Configuration A null-terminated Unicode string in <ConfigResp>\r
143 format.\r
144 @param[out] Progress A pointer to a string filled in with the offset of\r
145 the most recent '&' before the first failing\r
146 name/value pair (or the beginning of the string if\r
147 the failure is in the first name/value pair) or\r
148 the terminating NULL if all was successful.\r
149\r
150 @retval EFI_SUCCESS The Results is processed successfully.\r
151 @retval EFI_INVALID_PARAMETER Configuration is NULL.\r
152 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this\r
153 driver.\r
154\r
155**/\r
156EFI_STATUS\r
157EFIAPI\r
158Tcg2RouteConfig (\r
159 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
160 IN CONST EFI_STRING Configuration,\r
161 OUT EFI_STRING *Progress\r
162 );\r
163\r
164/**\r
165 This function processes the results of changes in configuration.\r
166\r
167 @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
168 @param[in] Action Specifies the type of action taken by the browser.\r
169 @param[in] QuestionId A unique value which is sent to the original\r
170 exporting driver so that it can identify the type\r
171 of data to expect.\r
172 @param[in] Type The type of value for the question.\r
173 @param[in] Value A pointer to the data being sent to the original\r
174 exporting driver.\r
175 @param[out] ActionRequest On return, points to the action requested by the\r
176 callback function.\r
177\r
178 @retval EFI_SUCCESS The callback successfully handled the action.\r
179 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the\r
180 variable and its data.\r
181 @retval EFI_DEVICE_ERROR The variable could not be saved.\r
182 @retval EFI_UNSUPPORTED The specified Action is not supported by the\r
183 callback.\r
184\r
185**/\r
186EFI_STATUS\r
187EFIAPI\r
188Tcg2Callback (\r
189 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
190 IN EFI_BROWSER_ACTION Action,\r
191 IN EFI_QUESTION_ID QuestionId,\r
192 IN UINT8 Type,\r
193 IN EFI_IFR_TYPE_VALUE *Value,\r
194 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest\r
195 );\r
196\r
197#endif\r