2 Public Header file of HII library used by Opal UEFI Driver.
3 Defines required callbacks of Opal HII library.
5 Copyright (c) 2016 - 2019, 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 } \
29 #define OPAL_REQUEST_VARIABLE_NAME L"OpalRequest"
35 OPAL_REQUEST OpalRequest
;
36 //EFI_DEVICE_PATH_PROTOCOL OpalDevicePath;
37 } OPAL_REQUEST_VARIABLE
;
40 UINT16 Id
: HII_KEY_ID_BITS
;
41 UINT16 Index
: HII_KEY_INDEX_BITS
;
42 UINT16 Flag
: HII_KEY_FLAG_BITS
;
51 VENDOR_DEVICE_PATH VendorDevicePath
;
52 EFI_DEVICE_PATH_PROTOCOL End
;
53 } HII_VENDOR_DEVICE_PATH
;
57 extern const EFI_GUID gHiiSetupVariableGuid
;
60 This function processes the results of changes in configuration.
62 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
63 @param Configuration A null-terminated Unicode string in <ConfigResp>
65 @param Progress A pointer to a string filled in with the offset of
66 the most recent '&' before the first failing
67 name/value pair (or the beginning of the string if
68 the failure is in the first name/value pair) or
69 the terminating NULL if all was successful.
71 @retval EFI_SUCCESS The Results is processed successfully.
72 @retval EFI_INVALID_PARAMETER Configuration is NULL.
73 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this
80 CONST EFI_HII_CONFIG_ACCESS_PROTOCOL
*This
,
81 CONST EFI_STRING Configuration
,
86 This function allows a caller to extract the current configuration for one
87 or more named elements from the target driver.
89 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
90 @param Request A null-terminated Unicode string in
91 <ConfigRequest> format.
92 @param Progress On return, points to a character in the Request
93 string. Points to the string's null terminator if
94 request was successful. Points to the most recent
95 '&' before the first failing name/value pair (or
96 the beginning of the string if the failure is in
97 the first name/value pair) if the request was not
99 @param Results A null-terminated Unicode string in
100 <ConfigAltResp> format which has all values filled
101 in for the names in the Request string. String to
102 be allocated by the called function.
104 @retval EFI_SUCCESS The Results is filled with the requested values.
105 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.
106 @retval EFI_INVALID_PARAMETER Request is illegal syntax, or unknown name.
107 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this
114 CONST EFI_HII_CONFIG_ACCESS_PROTOCOL
*This
,
115 CONST EFI_STRING Request
,
116 EFI_STRING
*Progress
,
121 This function processes the results of changes in configuration.
123 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
124 @param Action Specifies the type of action taken by the browser.
125 @param QuestionId A unique value which is sent to the original
126 exporting driver so that it can identify the type
128 @param Type The type of value for the question.
129 @param Value A pointer to the data being sent to the original
131 @param ActionRequest On return, points to the action requested by the
134 @retval EFI_SUCCESS The callback successfully handled the action.
135 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the
136 variable and its data.
137 @retval EFI_DEVICE_ERROR The variable could not be saved.
138 @retval EFI_UNSUPPORTED The specified Action is not supported by the
145 CONST EFI_HII_CONFIG_ACCESS_PROTOCOL
* This
,
146 EFI_BROWSER_ACTION Action
,
147 EFI_QUESTION_ID QuestionId
,
149 EFI_IFR_TYPE_VALUE
* Value
,
150 EFI_BROWSER_ACTION_REQUEST
* ActionRequest
155 Pass the current system state to the bios via the hii_G_Configuration.
159 OpalHiiSetBrowserData (
165 Populate the hii_g_Configuraton with the browser Data.
169 OpalHiiGetBrowserData (
174 Draws the disk info form.
176 @retval EFI_SUCCESS Draw the disk info success.
180 HiiPopulateDiskInfoForm(
185 Update the global Disk index info.
187 @param Index The input disk index info.
189 @retval EFI_SUCCESS Update the disk index info success.
198 Use the input password to do the specified action.
200 @param Str The input password saved in.
202 @retval EFI_SUCCESS Do the required action success.
203 @retval Others Other error occur.
212 Update block sid info.
214 @param PpRequest Input the Pp Request.
216 @retval EFI_SUCCESS Do the required action success.
217 @retval Others Other error occur.
221 HiiSetBlockSidAction (
226 Reverts the Opal disk to factory default.
228 @param PsidStringId The string id for the PSID info.
230 @retval EFI_SUCCESS Do the required action success.
235 EFI_STRING_ID PsidStringId
239 Get disk name string id.
241 @param DiskIndex The input disk index info.
243 @retval The disk name string id.
252 Update the device info.
254 @param OpalDisk The Opal device.
256 @retval EFI_SUCESS Initialize the device success.
257 @retval EFI_DEVICE_ERROR Get info from device failed.
258 @retval EFI_INVALID_PARAMETER Not get Msid info before get ownership info.
262 OpalDiskUpdateStatus (
267 Get the driver image handle.
269 @retval the driver image handle.
273 HiiGetDriverImageHandleCB(
278 Install the HII form and string packages.
280 @retval EFI_SUCCESS Install all the resources success.
281 @retval EFI_OUT_OF_RESOURCES Out of resource error.
289 Returns the opaque pointer to a physical disk context.
291 @param DiskIndex Input the disk index.
293 @retval The device pointer.
302 Returns the disk name.
304 @param DiskIndex Input the disk index.
306 @retval Returns the disk name.
315 Set a string Value in a form.
317 @param DestStringId The stringid which need to update.
318 @param SrcAsciiStr The string nned to update.
320 @retval EFI_SUCCESS Do the required action success.
321 @retval Others Other error occur.
326 EFI_STRING_ID DestStringId
,
331 Install the HII related resources.
333 @retval EFI_SUCCESS Install all the resources success.
334 @retval other Error occur when install the resources.
342 Uninstall the HII capability.
344 @retval EFI_SUCCESS Uninstall all the resources success.
345 @retval others Other errors occur when unistall the hii resource.
353 Initialize the Opal disk base on the hardware info get from device.
355 @param Dev The Opal device.
357 @retval EFI_SUCESS Initialize the device success.
358 @retval EFI_DEVICE_ERROR Get info from device failed.
363 IN OPAL_DRIVER_DEVICE
*Dev