TianoCore EDK2 master
Loading...
Searching...
No Matches
OpalHii.h File Reference

Go to the source code of this file.

Data Structures

struct  OPAL_REQUEST_VARIABLE
 
struct  KEY_BITS
 
union  HII_KEY
 
struct  HII_VENDOR_DEVICE_PATH
 

Macros

#define OPAL_PASSWORD_CONFIG_GUID
 
#define OPAL_REQUEST_VARIABLE_NAME   L"OpalRequest"
 

Functions

EFI_STATUS EFIAPI RouteConfig (CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, CONST EFI_STRING Configuration, EFI_STRING *Progress)
 
EFI_STATUS EFIAPI ExtractConfig (CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, CONST EFI_STRING Request, EFI_STRING *Progress, EFI_STRING *Results)
 
EFI_STATUS EFIAPI DriverCallback (CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, EFI_BROWSER_ACTION Action, EFI_QUESTION_ID QuestionId, UINT8 Type, EFI_IFR_TYPE_VALUE *Value, EFI_BROWSER_ACTION_REQUEST *ActionRequest)
 
VOID OpalHiiSetBrowserData (VOID)
 
VOID OpalHiiGetBrowserData (VOID)
 
EFI_STATUS HiiPopulateDiskInfoForm (VOID)
 
EFI_STATUS HiiSelectDisk (UINT8 Index)
 
EFI_STATUS HiiPasswordEntered (EFI_STRING_ID Str)
 
EFI_STATUS HiiSetBlockSidAction (UINT32 PpRequest)
 
EFI_STATUS HiiPsidRevert (EFI_STRING_ID PsidStringId)
 
EFI_STRING_ID GetDiskNameStringId (UINT8 DiskIndex)
 
EFI_STATUS OpalDiskUpdateStatus (OPAL_DISK *OpalDisk)
 
EFI_HANDLE HiiGetDriverImageHandleCB (VOID)
 
EFI_STATUS OpalHiiAddPackages (VOID)
 
OPAL_DISKHiiGetOpalDiskCB (UINT8 DiskIndex)
 
CHAR8 * HiiDiskGetNameCB (UINT8 DiskIndex)
 
EFI_STATUS HiiSetFormString (EFI_STRING_ID DestStringId, CHAR8 *SrcAsciiStr)
 
EFI_STATUS HiiInstall (VOID)
 
EFI_STATUS HiiUninstall (VOID)
 
EFI_STATUS OpalDiskInitialize (IN OPAL_DRIVER_DEVICE *Dev)
 
EFI_STATUS OpalDiskUpdateOwnerShip (OPAL_DISK *OpalDisk)
 

Variables

const EFI_GUID gHiiSetupVariableGuid
 

Detailed Description

Public Header file of HII library used by Opal UEFI Driver. Defines required callbacks of Opal HII library.

Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file OpalHii.h.

Macro Definition Documentation

◆ OPAL_PASSWORD_CONFIG_GUID

#define OPAL_PASSWORD_CONFIG_GUID
Value:
{ \
0x0d510a4f, 0xa81b, 0x473f, { 0x87, 0x07, 0xb7, 0xfd, 0xfb, 0xc0, 0x45, 0xba } \
}

Definition at line 18 of file OpalHii.h.

◆ OPAL_REQUEST_VARIABLE_NAME

#define OPAL_REQUEST_VARIABLE_NAME   L"OpalRequest"

Definition at line 23 of file OpalHii.h.

Function Documentation

◆ DriverCallback()

EFI_STATUS EFIAPI DriverCallback ( CONST EFI_HII_CONFIG_ACCESS_PROTOCOL This,
EFI_BROWSER_ACTION  Action,
EFI_QUESTION_ID  QuestionId,
UINT8  Type,
EFI_IFR_TYPE_VALUE Value,
EFI_BROWSER_ACTION_REQUEST *  ActionRequest 
)

This function processes the results of changes in configuration.

Parameters
ThisPoints to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
ActionSpecifies the type of action taken by the browser.
QuestionIdA unique value which is sent to the original exporting driver so that it can identify the type of data to expect.
TypeThe type of value for the question.
ValueA pointer to the data being sent to the original exporting driver.
ActionRequestOn return, points to the action requested by the callback function.
Return values
EFI_SUCCESSThe callback successfully handled the action.
EFI_OUT_OF_RESOURCESNot enough storage is available to hold the variable and its data.
EFI_DEVICE_ERRORThe variable could not be saved.
EFI_UNSUPPORTEDThe specified Action is not supported by the callback.

Definition at line 606 of file OpalHii.c.

◆ ExtractConfig()

EFI_STATUS EFIAPI ExtractConfig ( CONST EFI_HII_CONFIG_ACCESS_PROTOCOL This,
CONST EFI_STRING  Request,
EFI_STRING *  Progress,
EFI_STRING *  Results 
)

This function allows a caller to extract the current configuration for one or more named elements from the target driver.

Parameters
ThisPoints to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
RequestA null-terminated Unicode string in <ConfigRequest> format.
ProgressOn return, points to a character in the Request string. Points to the string's null terminator if request was successful. Points to the most recent '&' before the first failing name/value pair (or the beginning of the string if the failure is in the first name/value pair) if the request was not successful.
ResultsA null-terminated Unicode string in <ConfigAltResp> format which has all values filled in for the names in the Request string. String to be allocated by the called function.
Return values
EFI_SUCCESSThe Results is filled with the requested values.
EFI_OUT_OF_RESOURCESNot enough memory to store the results.
EFI_INVALID_PARAMETERRequest is illegal syntax, or unknown name.
EFI_NOT_FOUNDRouting data doesn't match any storage in this driver.

Definition at line 1073 of file OpalHii.c.

◆ GetDiskNameStringId()

EFI_STRING_ID GetDiskNameStringId ( UINT8  DiskIndex)

Get disk name string id.

Parameters
DiskIndexThe input disk index info.
Return values
Thedisk name string id.

Definition at line 511 of file OpalHii.c.

◆ HiiDiskGetNameCB()

CHAR8 * HiiDiskGetNameCB ( UINT8  DiskIndex)

Returns the disk name.

Parameters
DiskIndexInput the disk index.
Return values
Returnsthe disk name.

Definition at line 97 of file OpalHiiCallbacks.c.

◆ HiiGetDriverImageHandleCB()

EFI_HANDLE HiiGetDriverImageHandleCB ( VOID  )

Get the driver image handle.

Return values
thedriver image handle.

Definition at line 19 of file OpalHiiCallbacks.c.

◆ HiiGetOpalDiskCB()

OPAL_DISK * HiiGetOpalDiskCB ( UINT8  DiskIndex)

Returns the opaque pointer to a physical disk context.

Parameters
DiskIndexInput the disk index.
Return values
Thedevice pointer.

Definition at line 70 of file OpalHiiCallbacks.c.

◆ HiiInstall()

EFI_STATUS HiiInstall ( VOID  )

Install the HII related resources.

Return values
EFI_SUCCESSInstall all the resources success.
otherError occur when install the resources.

Definition at line 349 of file OpalHii.c.

◆ HiiPasswordEntered()

EFI_STATUS HiiPasswordEntered ( EFI_STRING_ID  Str)

Use the input password to do the specified action.

Parameters
StrThe input password saved in.
Return values
EFI_SUCCESSDo the required action success.
OthersOther error occur.

◆ HiiPopulateDiskInfoForm()

EFI_STATUS HiiPopulateDiskInfoForm ( VOID  )

Draws the disk info form.

Return values
EFI_SUCCESSDraw the disk info success.

Definition at line 894 of file OpalHii.c.

◆ HiiPsidRevert()

EFI_STATUS HiiPsidRevert ( EFI_STRING_ID  PsidStringId)

Reverts the Opal disk to factory default.

Parameters
PsidStringIdThe string id for the PSID info.
Return values
EFI_SUCCESSDo the required action success.

◆ HiiSelectDisk()

EFI_STATUS HiiSelectDisk ( UINT8  Index)

Update the global Disk index info.

Parameters
IndexThe input disk index info.
Return values
EFI_SUCCESSUpdate the disk index info success.

Definition at line 876 of file OpalHii.c.

◆ HiiSetBlockSidAction()

EFI_STATUS HiiSetBlockSidAction ( UINT32  PpRequest)

Update block sid info.

Parameters
PpRequestInput the Pp Request.
Return values
EFI_SUCCESSDo the required action success.
OthersOther error occur.

◆ HiiSetFormString()

EFI_STATUS HiiSetFormString ( EFI_STRING_ID  DestStringId,
CHAR8 *  SrcAsciiStr 
)

Set a string Value in a form.

Parameters
DestStringIdThe stringid which need to update.
SrcAsciiStrThe string nned to update.
Return values
EFI_SUCCESSDo the required action success.
OthersOther error occur.

Set a string Value in a form.

Parameters
DestStringIdThe stringid which need to update.
SrcAsciiStrThe string need to update.
Return values
EFI_SUCCESSDo the required action success.
OthersOther error occur.

Definition at line 1204 of file OpalHii.c.

◆ HiiUninstall()

EFI_STATUS HiiUninstall ( VOID  )

Uninstall the HII capability.

Return values
EFI_SUCCESSUninstall all the resources success.
othersOther errors occur when unistall the hii resource.

Definition at line 436 of file OpalHii.c.

◆ OpalDiskInitialize()

EFI_STATUS OpalDiskInitialize ( IN OPAL_DRIVER_DEVICE Dev)

Initialize the Opal disk base on the hardware info get from device.

Parameters
DevThe Opal device.
Return values
EFI_SUCCESSInitialize the device success.
EFI_DEVICE_ERRORGet info from device failed.

Definition at line 1256 of file OpalHii.c.

◆ OpalDiskUpdateOwnerShip()

EFI_STATUS OpalDiskUpdateOwnerShip ( OPAL_DISK OpalDisk)

Update the device ownership

Parameters
OpalDiskThe Opal device.
Return values
EFI_SUCCESSGet ownership success.
EFI_ACCESS_DENIEDHas send BlockSID command, can't change ownership.
EFI_INVALID_PARAMETERNot get Msid info before get ownership info.

Update the device ownship

Parameters
OpalDiskThe Opal device.
Return values
EFI_SUCCESSGet ownership success.
EFI_ACCESS_DENIEDHas send BlockSID command, can't change ownership.
EFI_INVALID_PARAMETERNot get Msid info before get ownership info.

Definition at line 1314 of file OpalHii.c.

◆ OpalDiskUpdateStatus()

EFI_STATUS OpalDiskUpdateStatus ( OPAL_DISK OpalDisk)

Update the device info.

Parameters
OpalDiskThe Opal device.
Return values
EFI_SUCCESSInitialize the device success.
EFI_DEVICE_ERRORGet info from device failed.
EFI_INVALID_PARAMETERNot get Msid info before get ownership info.

Update the device info.

Parameters
OpalDiskThe Opal device.
Return values
EFI_SUCCESSInitialize the device success.
EFI_DEVICE_ERRORGet info from device failed.
EFI_INVALID_PARAMETERNot get Msid info before get ownership info.
EFI_ACCESS_DENIEDHas send BlockSID command, can't change ownership.

Definition at line 1349 of file OpalHii.c.

◆ OpalHiiAddPackages()

EFI_STATUS OpalHiiAddPackages ( VOID  )

Install the HII form and string packages.

Return values
EFI_SUCCESSInstall all the resources success.
EFI_OUT_OF_RESOURCESOut of resource error.

Definition at line 399 of file OpalHii.c.

◆ OpalHiiGetBrowserData()

VOID OpalHiiGetBrowserData ( VOID  )

Populate the hii_g_Configuration with the browser Data.

Definition at line 1181 of file OpalHii.c.

◆ OpalHiiSetBrowserData()

VOID OpalHiiSetBrowserData ( VOID  )

Pass the current system state to the bios via the hii_G_Configuration.

Definition at line 1162 of file OpalHii.c.

◆ RouteConfig()

EFI_STATUS EFIAPI RouteConfig ( CONST EFI_HII_CONFIG_ACCESS_PROTOCOL This,
CONST EFI_STRING  Configuration,
EFI_STRING *  Progress 
)

This function processes the results of changes in configuration.

Parameters
ThisPoints to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
ConfigurationA null-terminated Unicode string in <ConfigResp> format.
ProgressA pointer to a string filled in with the offset of the most recent '&' before the first failing name/value pair (or the beginning of the string if the failure is in the first name/value pair) or the terminating NULL if all was successful.
Return values
EFI_SUCCESSThe Results is processed successfully.
EFI_INVALID_PARAMETERConfiguration is NULL.
EFI_NOT_FOUNDRouting data doesn't match any storage in this driver.

Definition at line 1025 of file OpalHii.c.

Variable Documentation

◆ gHiiSetupVariableGuid

const EFI_GUID gHiiSetupVariableGuid
extern

Definition at line 42 of file OpalHii.c.