]> git.proxmox.com Git - mirror_edk2.git/blame - SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.h
Remove a unnecessary Macro in SecureBootConfigImpl.h.
[mirror_edk2.git] / SecurityPkg / VariableAuthenticated / SecureBootConfigDxe / SecureBootConfigImpl.h
CommitLineData
beda2356 1/** @file\r
2 The header file of HII Config Access protocol implementation of SecureBoot\r
3 configuration module.\r
4\r
5Copyright (c) 2011, 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 __SECUREBOOT_CONFIG_IMPL_H__\r
17#define __SECUREBOOT_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\r
24#include <Library/BaseLib.h>\r
25#include <Library/BaseMemoryLib.h>\r
26#include <Library/DebugLib.h>\r
27#include <Library/MemoryAllocationLib.h>\r
28#include <Library/UefiBootServicesTableLib.h>\r
29#include <Library/UefiRuntimeServicesTableLib.h>\r
30#include <Library/UefiHiiServicesLib.h>\r
31#include <Library/UefiLib.h>\r
32#include <Library/HiiLib.h>\r
33#include <Library/DevicePathLib.h>\r
34\r
35#include <Guid/MdeModuleHii.h>\r
36#include <Guid/AuthenticatedVariableFormat.h>\r
37\r
38#include "SecureBootConfigNvData.h"\r
39\r
40//\r
41// Tool generated IFR binary data and String package data\r
42//\r
43extern UINT8 SecureBootConfigBin[];\r
44extern UINT8 SecureBootConfigDxeStrings[];\r
45\r
46///\r
47/// HII specific Vendor Device Path definition.\r
48///\r
49typedef struct {\r
50 VENDOR_DEVICE_PATH VendorDevicePath;\r
51 EFI_DEVICE_PATH_PROTOCOL End;\r
52} HII_VENDOR_DEVICE_PATH;\r
53\r
54typedef struct {\r
55 UINTN Signature;\r
56\r
57 EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;\r
58 EFI_HII_HANDLE HiiHandle;\r
59 EFI_HANDLE DriverHandle;\r
60\r
61} SECUREBOOT_CONFIG_PRIVATE_DATA;\r
62\r
63extern SECUREBOOT_CONFIG_PRIVATE_DATA mSecureBootConfigPrivateDateTemplate;\r
64\r
65#define SECUREBOOT_CONFIG_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('S', 'E', 'C', 'B')\r
beda2356 66\r
67/**\r
68 This function publish the SecureBoot configuration Form.\r
69\r
70 @param[in, out] PrivateData Points to SecureBoot 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
78InstallSecureBootConfigForm (\r
79 IN OUT SECUREBOOT_CONFIG_PRIVATE_DATA *PrivateData\r
80 );\r
81\r
82/**\r
83 This function removes SecureBoot configuration Form.\r
84\r
85 @param[in, out] PrivateData Points to SecureBoot configuration private data.\r
86\r
87**/\r
88\r
89VOID\r
90UninstallSecureBootConfigForm (\r
91 IN OUT SECUREBOOT_CONFIG_PRIVATE_DATA *PrivateData\r
92 );\r
93\r
94/**\r
95 This function allows a caller to extract the current configuration for one\r
96 or more named elements from the target driver.\r
97\r
98 @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
99 @param[in] Request A null-terminated Unicode string in\r
100 <ConfigRequest> format.\r
101 @param[out] Progress On return, points to a character in the Request\r
102 string. Points to the string's null terminator if\r
103 request was successful. Points to the most recent\r
104 '&' before the first failing name/value pair (or\r
105 the beginning of the string if the failure is in\r
106 the first name/value pair) if the request was not\r
107 successful.\r
108 @param[out] Results A null-terminated Unicode string in\r
109 <ConfigAltResp> format which has all values filled\r
110 in for the names in the Request string. String to\r
111 be allocated by the called function.\r
112\r
113 @retval EFI_SUCCESS The Results is filled with the requested values.\r
114 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.\r
115 @retval EFI_INVALID_PARAMETER Request is illegal syntax, or unknown name.\r
116 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this\r
117 driver.\r
118\r
119**/\r
120EFI_STATUS\r
121EFIAPI\r
122SecureBootExtractConfig (\r
123 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
124 IN CONST EFI_STRING Request,\r
125 OUT EFI_STRING *Progress,\r
126 OUT EFI_STRING *Results\r
127 );\r
128\r
129/**\r
130 This function processes the results of changes in configuration.\r
131\r
132 @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
133 @param[in] Configuration A null-terminated Unicode string in <ConfigResp>\r
134 format.\r
135 @param[out] Progress A pointer to a string filled in with the offset of\r
136 the most recent '&' before the first failing\r
137 name/value pair (or the beginning of the string if\r
138 the failure is in the first name/value pair) or\r
139 the terminating NULL if all was successful.\r
140\r
141 @retval EFI_SUCCESS The Results is processed successfully.\r
142 @retval EFI_INVALID_PARAMETER Configuration is NULL.\r
143 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this\r
144 driver.\r
145\r
146**/\r
147EFI_STATUS\r
148EFIAPI\r
149SecureBootRouteConfig (\r
150 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
151 IN CONST EFI_STRING Configuration,\r
152 OUT EFI_STRING *Progress\r
153 );\r
154\r
155/**\r
156 This function processes the results of changes in configuration.\r
157\r
158 @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
159 @param[in] Action Specifies the type of action taken by the browser.\r
160 @param[in] QuestionId A unique value which is sent to the original\r
161 exporting driver so that it can identify the type\r
162 of data to expect.\r
163 @param[in] Type The type of value for the question.\r
164 @param[in] Value A pointer to the data being sent to the original\r
165 exporting driver.\r
166 @param[out] ActionRequest On return, points to the action requested by the\r
167 callback function.\r
168\r
169 @retval EFI_SUCCESS The callback successfully handled the action.\r
170 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the\r
171 variable and its data.\r
172 @retval EFI_DEVICE_ERROR The variable could not be saved.\r
173 @retval EFI_UNSUPPORTED The specified Action is not supported by the\r
174 callback.\r
175\r
176**/\r
177EFI_STATUS\r
178EFIAPI\r
179SecureBootCallback (\r
180 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
181 IN EFI_BROWSER_ACTION Action,\r
182 IN EFI_QUESTION_ID QuestionId,\r
183 IN UINT8 Type,\r
184 IN EFI_IFR_TYPE_VALUE *Value,\r
185 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest\r
186 );\r
187\r
188#endif\r