]> git.proxmox.com Git - mirror_edk2.git/blame - SecurityPkg/Tcg/TrEEConfig/TrEEConfigImpl.h
Fix execution status & DEBUG message level mismatch. EFI_D_ERROR is used only...
[mirror_edk2.git] / SecurityPkg / Tcg / TrEEConfig / TrEEConfigImpl.h
CommitLineData
c1d93242
JY
1/** @file\r
2 The header file of HII Config Access protocol implementation of TREE\r
3 configuration module.\r
4\r
5Copyright (c) 2013, 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 __TREE_CONFIG_IMPL_H__\r
17#define __TREE_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/TrEEProtocol.h>\r
5437d457 24#include <Protocol/VariableLock.h>\r
c1d93242
JY
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\r
39#include <Guid/MdeModuleHii.h>\r
40\r
41#include "TrEEConfigNvData.h"\r
42\r
43//\r
44// Tool generated IFR binary data and String package data\r
45//\r
46extern UINT8 TrEEConfigBin[];\r
47extern UINT8 TrEEConfigDxeStrings[];\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
5437d457 64 UINT8 TpmDeviceDetected;\r
c1d93242
JY
65} TREE_CONFIG_PRIVATE_DATA;\r
66\r
67extern TREE_CONFIG_PRIVATE_DATA mTrEEConfigPrivateDateTemplate;\r
68\r
69#define TREE_CONFIG_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('T', 'r', 'E', 'D')\r
70#define TREE_CONFIG_PRIVATE_DATA_FROM_THIS(a) CR (a, TREE_CONFIG_PRIVATE_DATA, ConfigAccess, TREE_CONFIG_PRIVATE_DATA_SIGNATURE)\r
71\r
72\r
73/**\r
74 This function publish the TREE configuration Form for TPM device.\r
75\r
76 @param[in, out] PrivateData Points to TREE configuration private data.\r
77\r
78 @retval EFI_SUCCESS HII Form is installed for this network device.\r
79 @retval EFI_OUT_OF_RESOURCES Not enough resource for HII Form installation.\r
80 @retval Others Other errors as indicated.\r
81\r
82**/\r
83EFI_STATUS\r
84InstallTrEEConfigForm (\r
85 IN OUT TREE_CONFIG_PRIVATE_DATA *PrivateData\r
86 );\r
87\r
88/**\r
89 This function removes TREE configuration Form.\r
90\r
91 @param[in, out] PrivateData Points to TREE configuration private data.\r
92\r
93**/\r
94VOID\r
95UninstallTrEEConfigForm (\r
96 IN OUT TREE_CONFIG_PRIVATE_DATA *PrivateData\r
97 );\r
98\r
99/**\r
100 This function allows a caller to extract the current configuration for one\r
101 or more named elements from the target driver.\r
102\r
103 @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
104 @param[in] Request A null-terminated Unicode string in\r
105 <ConfigRequest> format.\r
106 @param[out] Progress On return, points to a character in the Request\r
107 string. Points to the string's null terminator if\r
108 request was successful. Points to the most recent\r
109 '&' before the first failing name/value pair (or\r
110 the beginning of the string if the failure is in\r
111 the first name/value pair) if the request was not\r
112 successful.\r
113 @param[out] Results A null-terminated Unicode string in\r
114 <ConfigAltResp> format which has all values filled\r
115 in for the names in the Request string. String to\r
116 be allocated by the called function.\r
117\r
118 @retval EFI_SUCCESS The Results is filled with the requested values.\r
119 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.\r
120 @retval EFI_INVALID_PARAMETER Request is illegal syntax, or unknown name.\r
121 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this\r
122 driver.\r
123\r
124**/\r
125EFI_STATUS\r
126EFIAPI\r
127TrEEExtractConfig (\r
128 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
129 IN CONST EFI_STRING Request,\r
130 OUT EFI_STRING *Progress,\r
131 OUT EFI_STRING *Results\r
132 );\r
133\r
134/**\r
135 This function processes the results of changes in configuration.\r
136\r
137 @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
138 @param[in] Configuration A null-terminated Unicode string in <ConfigResp>\r
139 format.\r
140 @param[out] Progress A pointer to a string filled in with the offset of\r
141 the most recent '&' before the first failing\r
142 name/value pair (or the beginning of the string if\r
143 the failure is in the first name/value pair) or\r
144 the terminating NULL if all was successful.\r
145\r
146 @retval EFI_SUCCESS The Results is processed successfully.\r
147 @retval EFI_INVALID_PARAMETER Configuration is NULL.\r
148 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this\r
149 driver.\r
150\r
151**/\r
152EFI_STATUS\r
153EFIAPI\r
154TrEERouteConfig (\r
155 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
156 IN CONST EFI_STRING Configuration,\r
157 OUT EFI_STRING *Progress\r
158 );\r
159\r
160/**\r
161 This function processes the results of changes in configuration.\r
162\r
163 @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
164 @param[in] Action Specifies the type of action taken by the browser.\r
165 @param[in] QuestionId A unique value which is sent to the original\r
166 exporting driver so that it can identify the type\r
167 of data to expect.\r
168 @param[in] Type The type of value for the question.\r
169 @param[in] Value A pointer to the data being sent to the original\r
170 exporting driver.\r
171 @param[out] ActionRequest On return, points to the action requested by the\r
172 callback function.\r
173\r
174 @retval EFI_SUCCESS The callback successfully handled the action.\r
175 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the\r
176 variable and its data.\r
177 @retval EFI_DEVICE_ERROR The variable could not be saved.\r
178 @retval EFI_UNSUPPORTED The specified Action is not supported by the\r
179 callback.\r
180\r
181**/\r
182EFI_STATUS\r
183EFIAPI\r
184TrEECallback (\r
185 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
186 IN EFI_BROWSER_ACTION Action,\r
187 IN EFI_QUESTION_ID QuestionId,\r
188 IN UINT8 Type,\r
189 IN EFI_IFR_TYPE_VALUE *Value,\r
190 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest\r
191 );\r
192\r
193#endif\r