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