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