2 Public Header file of HII library used by Opal UEFI Driver.
3 Defines required callbacks of Opal HII library.
5 Copyright (c) 2016 - 2018, 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.
19 #include <Protocol/HiiConfigAccess.h>
21 #include "OpalDriver.h"
22 #include "OpalHiiFormValues.h"
24 #define OPAL_PASSWORD_CONFIG_GUID \
26 0x0d510a4f, 0xa81b, 0x473f, { 0x87, 0x07, 0xb7, 0xfd, 0xfb, 0xc0, 0x45, 0xba } \
32 UINT16 Id
: HII_KEY_ID_BITS
;
33 UINT16 Index
: HII_KEY_INDEX_BITS
;
34 UINT16 Flag
: HII_KEY_FLAG_BITS
;
43 VENDOR_DEVICE_PATH VendorDevicePath
;
44 EFI_DEVICE_PATH_PROTOCOL End
;
45 } HII_VENDOR_DEVICE_PATH
;
49 extern const EFI_GUID gHiiSetupVariableGuid
;
52 This function processes the results of changes in configuration.
54 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
55 @param Configuration A null-terminated Unicode string in <ConfigResp>
57 @param Progress A pointer to a string filled in with the offset of
58 the most recent '&' before the first failing
59 name/value pair (or the beginning of the string if
60 the failure is in the first name/value pair) or
61 the terminating NULL if all was successful.
63 @retval EFI_SUCCESS The Results is processed successfully.
64 @retval EFI_INVALID_PARAMETER Configuration is NULL.
65 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this
72 CONST EFI_HII_CONFIG_ACCESS_PROTOCOL
*This
,
73 CONST EFI_STRING Configuration
,
78 This function allows a caller to extract the current configuration for one
79 or more named elements from the target driver.
81 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
82 @param Request A null-terminated Unicode string in
83 <ConfigRequest> format.
84 @param Progress On return, points to a character in the Request
85 string. Points to the string's null terminator if
86 request was successful. Points to the most recent
87 '&' before the first failing name/value pair (or
88 the beginning of the string if the failure is in
89 the first name/value pair) if the request was not
91 @param Results A null-terminated Unicode string in
92 <ConfigAltResp> format which has all values filled
93 in for the names in the Request string. String to
94 be allocated by the called function.
96 @retval EFI_SUCCESS The Results is filled with the requested values.
97 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.
98 @retval EFI_INVALID_PARAMETER Request is illegal syntax, or unknown name.
99 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this
106 CONST EFI_HII_CONFIG_ACCESS_PROTOCOL
*This
,
107 CONST EFI_STRING Request
,
108 EFI_STRING
*Progress
,
113 This function processes the results of changes in configuration.
115 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
116 @param Action Specifies the type of action taken by the browser.
117 @param QuestionId A unique value which is sent to the original
118 exporting driver so that it can identify the type
120 @param Type The type of value for the question.
121 @param Value A pointer to the data being sent to the original
123 @param ActionRequest On return, points to the action requested by the
126 @retval EFI_SUCCESS The callback successfully handled the action.
127 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the
128 variable and its data.
129 @retval EFI_DEVICE_ERROR The variable could not be saved.
130 @retval EFI_UNSUPPORTED The specified Action is not supported by the
137 CONST EFI_HII_CONFIG_ACCESS_PROTOCOL
* This
,
138 EFI_BROWSER_ACTION Action
,
139 EFI_QUESTION_ID QuestionId
,
141 EFI_IFR_TYPE_VALUE
* Value
,
142 EFI_BROWSER_ACTION_REQUEST
* ActionRequest
147 Pass the current system state to the bios via the hii_G_Configuration.
151 OpalHiiSetBrowserData (
157 Populate the hii_g_Configuraton with the browser Data.
161 OpalHiiGetBrowserData (
166 Draws the disk info form.
168 @retval EFI_SUCCESS Draw the disk info success.
172 HiiPopulateDiskInfoForm(
177 Update the global Disk index info.
179 @param Index The input disk index info.
181 @retval EFI_SUCCESS Update the disk index info success.
190 Use the input password to do the specified action.
192 @param Str The input password saved in.
194 @retval EFI_SUCCESS Do the required action success.
195 @retval Others Other error occur.
204 Update block sid info.
206 @param PpRequest Input the Pp Request.
208 @retval EFI_SUCCESS Do the required action success.
209 @retval Others Other error occur.
213 HiiSetBlockSidAction (
218 Reverts the Opal disk to factory default.
220 @param PsidStringId The string id for the PSID info.
222 @retval EFI_SUCCESS Do the required action success.
227 EFI_STRING_ID PsidStringId
231 Get disk name string id.
233 @param DiskIndex The input disk index info.
235 @retval The disk name string id.
244 Update the device info.
246 @param OpalDisk The Opal device.
248 @retval EFI_SUCESS Initialize the device success.
249 @retval EFI_DEVICE_ERROR Get info from device failed.
250 @retval EFI_INVALID_PARAMETER Not get Msid info before get ownership info.
254 OpalDiskUpdateStatus (
259 Get the driver image handle.
261 @retval the driver image handle.
265 HiiGetDriverImageHandleCB(
270 Install the HII form and string packages.
272 @retval EFI_SUCCESS Install all the resources success.
273 @retval EFI_OUT_OF_RESOURCES Out of resource error.
281 Check whether enable feature or not.
283 @retval Return the disk number.
287 HiiGetNumConfigRequiredOpalDisksCB(
292 Returns the driver name.
294 @retval Returns the driver name.
303 Returns the opaque pointer to a physical disk context.
305 @param DiskIndex Input the disk index.
307 @retval The device pointer.
316 Returns the disk name.
318 @param DiskIndex Input the disk index.
320 @retval Returns the disk name.
329 Set a string Value in a form.
331 @param DestStringId The stringid which need to update.
332 @param SrcAsciiStr The string nned to update.
334 @retval EFI_SUCCESS Do the required action success.
335 @retval Others Other error occur.
340 EFI_STRING_ID DestStringId
,
345 Install the HII related resources.
347 @retval EFI_SUCCESS Install all the resources success.
348 @retval other Error occur when install the resources.
356 Uninstall the HII capability.
358 @retval EFI_SUCCESS Uninstall all the resources success.
359 @retval others Other errors occur when unistall the hii resource.
367 Initialize the Opal disk base on the hardware info get from device.
369 @param Dev The Opal device.
371 @retval EFI_SUCESS Initialize the device success.
372 @retval EFI_DEVICE_ERROR Get info from device failed.
377 IN OPAL_DRIVER_DEVICE
*Dev