2 The header file of HII Config Access protocol implementation of SecureBoot
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
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.
16 #ifndef __SECUREBOOT_CONFIG_IMPL_H__
17 #define __SECUREBOOT_CONFIG_IMPL_H__
21 #include <Protocol/HiiConfigAccess.h>
22 #include <Protocol/HiiConfigRouting.h>
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 #include <Library/PrintLib.h>
36 #include <Guid/MdeModuleHii.h>
37 #include <Guid/AuthenticatedVariableFormat.h>
39 #include "SecureBootConfigNvData.h"
42 // Tool generated IFR binary data and String package data
44 extern UINT8 SecureBootConfigBin
[];
45 extern UINT8 SecureBootConfigDxeStrings
[];
48 /// HII specific Vendor Device Path definition.
51 VENDOR_DEVICE_PATH VendorDevicePath
;
52 EFI_DEVICE_PATH_PROTOCOL End
;
53 } HII_VENDOR_DEVICE_PATH
;
58 EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess
;
59 EFI_HII_HANDLE HiiHandle
;
60 EFI_HANDLE DriverHandle
;
62 } SECUREBOOT_CONFIG_PRIVATE_DATA
;
64 extern SECUREBOOT_CONFIG_PRIVATE_DATA mSecureBootConfigPrivateDateTemplate
;
66 #define SECUREBOOT_CONFIG_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('S', 'E', 'C', 'B')
67 #define SECUREBOOT_CONFIG_PRIVATE_FROM_THIS(a) CR (a, SECUREBOOT_CONFIG_PRIVATE_DATA, ConfigAccess, SECUREBOOT_CONFIG_PRIVATE_DATA_SIGNATURE)
71 This function publish the SecureBoot configuration Form.
73 @param[in, out] PrivateData Points to SecureBoot configuration private data.
75 @retval EFI_SUCCESS HII Form is installed for this network device.
76 @retval EFI_OUT_OF_RESOURCES Not enough resource for HII Form installation.
77 @retval Others Other errors as indicated.
81 InstallSecureBootConfigForm (
82 IN OUT SECUREBOOT_CONFIG_PRIVATE_DATA
*PrivateData
86 This function removes SecureBoot configuration Form.
88 @param[in, out] PrivateData Points to SecureBoot configuration private data.
92 UninstallSecureBootConfigForm (
93 IN OUT SECUREBOOT_CONFIG_PRIVATE_DATA
*PrivateData
97 This function allows a caller to extract the current configuration for one
98 or more named elements from the target driver.
100 @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
101 @param[in] Request A null-terminated Unicode string in
102 <ConfigRequest> format.
103 @param[out] Progress On return, points to a character in the Request
104 string. Points to the string's null terminator if
105 request was successful. Points to the most recent
106 '&' before the first failing name/value pair (or
107 the beginning of the string if the failure is in
108 the first name/value pair) if the request was not
110 @param[out] Results A null-terminated Unicode string in
111 <ConfigAltResp> format which has all values filled
112 in for the names in the Request string. String to
113 be allocated by the called function.
115 @retval EFI_SUCCESS The Results is filled with the requested values.
116 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.
117 @retval EFI_INVALID_PARAMETER Request is illegal syntax, or unknown name.
118 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this
124 SecureBootExtractConfig (
125 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL
*This
,
126 IN CONST EFI_STRING Request
,
127 OUT EFI_STRING
*Progress
,
128 OUT EFI_STRING
*Results
132 This function processes the results of changes in configuration.
134 @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
135 @param[in] Configuration A null-terminated Unicode string in <ConfigResp>
137 @param[out] Progress A pointer to a string filled in with the offset of
138 the most recent '&' before the first failing
139 name/value pair (or the beginning of the string if
140 the failure is in the first name/value pair) or
141 the terminating NULL if all was successful.
143 @retval EFI_SUCCESS The Results is processed successfully.
144 @retval EFI_INVALID_PARAMETER Configuration is NULL.
145 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this
151 SecureBootRouteConfig (
152 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL
*This
,
153 IN CONST EFI_STRING Configuration
,
154 OUT EFI_STRING
*Progress
158 This function processes the results of changes in configuration.
160 @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
161 @param[in] Action Specifies the type of action taken by the browser.
162 @param[in] QuestionId A unique value which is sent to the original
163 exporting driver so that it can identify the type
165 @param[in] Type The type of value for the question.
166 @param[in] Value A pointer to the data being sent to the original
168 @param[out] ActionRequest On return, points to the action requested by the
171 @retval EFI_SUCCESS The callback successfully handled the action.
172 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the
173 variable and its data.
174 @retval EFI_DEVICE_ERROR The variable could not be saved.
175 @retval EFI_UNSUPPORTED The specified Action is not supported by the
182 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL
*This
,
183 IN EFI_BROWSER_ACTION Action
,
184 IN EFI_QUESTION_ID QuestionId
,
186 IN EFI_IFR_TYPE_VALUE
*Value
,
187 OUT EFI_BROWSER_ACTION_REQUEST
*ActionRequest