]> git.proxmox.com Git - mirror_edk2.git/blame - SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.h
Searching for files starts on an 8 byte aligned boundary after the end of the Extende...
[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
bc0c99b3 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
beda2356 9http://opensource.org/licenses/bsd-license.php\r
10\r
bc0c99b3 11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
beda2356 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
bc0c99b3 34#include <Library/PrintLib.h>\r
beda2356 35\r
36#include <Guid/MdeModuleHii.h>\r
37#include <Guid/AuthenticatedVariableFormat.h>\r
38\r
39#include "SecureBootConfigNvData.h"\r
40\r
41//\r
42// Tool generated IFR binary data and String package data\r
43//\r
44extern UINT8 SecureBootConfigBin[];\r
45extern UINT8 SecureBootConfigDxeStrings[];\r
46\r
47///\r
48/// HII specific Vendor Device Path definition.\r
49///\r
50typedef struct {\r
51 VENDOR_DEVICE_PATH VendorDevicePath;\r
52 EFI_DEVICE_PATH_PROTOCOL End;\r
53} HII_VENDOR_DEVICE_PATH;\r
54\r
55typedef struct {\r
56 UINTN Signature;\r
57\r
58 EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;\r
59 EFI_HII_HANDLE HiiHandle;\r
60 EFI_HANDLE DriverHandle;\r
61\r
62} SECUREBOOT_CONFIG_PRIVATE_DATA;\r
63\r
64extern SECUREBOOT_CONFIG_PRIVATE_DATA mSecureBootConfigPrivateDateTemplate;\r
65\r
66#define SECUREBOOT_CONFIG_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('S', 'E', 'C', 'B')\r
bc0c99b3 67#define SECUREBOOT_CONFIG_PRIVATE_FROM_THIS(a) CR (a, SECUREBOOT_CONFIG_PRIVATE_DATA, ConfigAccess, SECUREBOOT_CONFIG_PRIVATE_DATA_SIGNATURE)\r
68\r
beda2356 69\r
70/**\r
71 This function publish the SecureBoot configuration Form.\r
72\r
73 @param[in, out] PrivateData Points to SecureBoot configuration private data.\r
74\r
75 @retval EFI_SUCCESS HII Form is installed for this network device.\r
76 @retval EFI_OUT_OF_RESOURCES Not enough resource for HII Form installation.\r
77 @retval Others Other errors as indicated.\r
78\r
79**/\r
80EFI_STATUS\r
81InstallSecureBootConfigForm (\r
82 IN OUT SECUREBOOT_CONFIG_PRIVATE_DATA *PrivateData\r
83 );\r
84\r
85/**\r
86 This function removes SecureBoot configuration Form.\r
87\r
88 @param[in, out] PrivateData Points to SecureBoot configuration private data.\r
89\r
90**/\r
beda2356 91VOID\r
92UninstallSecureBootConfigForm (\r
93 IN OUT SECUREBOOT_CONFIG_PRIVATE_DATA *PrivateData\r
94 );\r
95\r
96/**\r
97 This function allows a caller to extract the current configuration for one\r
98 or more named elements from the target driver.\r
99\r
100 @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
101 @param[in] Request A null-terminated Unicode string in\r
102 <ConfigRequest> format.\r
103 @param[out] Progress On return, points to a character in the Request\r
104 string. Points to the string's null terminator if\r
105 request was successful. Points to the most recent\r
106 '&' before the first failing name/value pair (or\r
107 the beginning of the string if the failure is in\r
108 the first name/value pair) if the request was not\r
109 successful.\r
110 @param[out] Results A null-terminated Unicode string in\r
111 <ConfigAltResp> format which has all values filled\r
112 in for the names in the Request string. String to\r
113 be allocated by the called function.\r
114\r
115 @retval EFI_SUCCESS The Results is filled with the requested values.\r
116 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.\r
117 @retval EFI_INVALID_PARAMETER Request is illegal syntax, or unknown name.\r
118 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this\r
119 driver.\r
120\r
121**/\r
122EFI_STATUS\r
123EFIAPI\r
124SecureBootExtractConfig (\r
125 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
126 IN CONST EFI_STRING Request,\r
127 OUT EFI_STRING *Progress,\r
128 OUT EFI_STRING *Results\r
129 );\r
130\r
131/**\r
132 This function processes the results of changes in configuration.\r
133\r
134 @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
135 @param[in] Configuration A null-terminated Unicode string in <ConfigResp>\r
136 format.\r
137 @param[out] Progress A pointer to a string filled in with the offset of\r
138 the most recent '&' before the first failing\r
139 name/value pair (or the beginning of the string if\r
140 the failure is in the first name/value pair) or\r
141 the terminating NULL if all was successful.\r
142\r
143 @retval EFI_SUCCESS The Results is processed successfully.\r
144 @retval EFI_INVALID_PARAMETER Configuration is NULL.\r
145 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this\r
146 driver.\r
147\r
148**/\r
149EFI_STATUS\r
150EFIAPI\r
151SecureBootRouteConfig (\r
152 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
153 IN CONST EFI_STRING Configuration,\r
154 OUT EFI_STRING *Progress\r
155 );\r
156\r
157/**\r
158 This function processes the results of changes in configuration.\r
159\r
160 @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
161 @param[in] Action Specifies the type of action taken by the browser.\r
162 @param[in] QuestionId A unique value which is sent to the original\r
163 exporting driver so that it can identify the type\r
164 of data to expect.\r
165 @param[in] Type The type of value for the question.\r
166 @param[in] Value A pointer to the data being sent to the original\r
167 exporting driver.\r
168 @param[out] ActionRequest On return, points to the action requested by the\r
169 callback function.\r
170\r
171 @retval EFI_SUCCESS The callback successfully handled the action.\r
172 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the\r
173 variable and its data.\r
174 @retval EFI_DEVICE_ERROR The variable could not be saved.\r
175 @retval EFI_UNSUPPORTED The specified Action is not supported by the\r
176 callback.\r
177\r
178**/\r
179EFI_STATUS\r
180EFIAPI\r
181SecureBootCallback (\r
182 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
183 IN EFI_BROWSER_ACTION Action,\r
184 IN EFI_QUESTION_ID QuestionId,\r
185 IN UINT8 Type,\r
186 IN EFI_IFR_TYPE_VALUE *Value,\r
187 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest\r
188 );\r
189\r
190#endif\r