TianoCore EDK2 master
Loading...
Searching...
No Matches
ConfigRouting.c File Reference
#include "HiiDatabase.h"

Go to the source code of this file.

Functions

UINTN CalculateConfigStringLen (IN EFI_STRING String)
 
EFI_STATUS GetDevicePath (IN EFI_STRING String, OUT UINT8 **DevicePathData)
 
VOID EFIAPI HiiToLower (IN EFI_STRING ConfigString)
 
VOID GenerateSubStr (IN CONST EFI_STRING String, IN UINTN BufferLen, IN VOID *Buffer, IN UINT8 Flag, OUT EFI_STRING *SubStr)
 
EFI_STATUS OutputConfigBody (IN EFI_STRING String, OUT EFI_STRING *ConfigBody)
 
EFI_STATUS AppendToMultiString (IN OUT EFI_STRING *MultiString, IN EFI_STRING AppendString)
 
EFI_STATUS GetValueOfNumber (IN EFI_STRING StringPtr, OUT UINT8 **Number, OUT UINTN *Len)
 
EFI_STATUS FindSameBlockElement (IN EFI_STRING String, IN EFI_STRING BlockName, IN UINT8 *Buffer, OUT BOOLEAN *Found, IN UINTN BufferLen)
 
EFI_STATUS CompareBlockElementDefault (IN EFI_STRING DefaultAltCfgResp, IN OUT EFI_STRING *ConfigAltResp, IN EFI_STRING AltConfigHdr, IN OUT BOOLEAN *ConfigAltRespChanged)
 
EFI_STATUS CompareNameElementDefault (IN EFI_STRING DefaultAltCfgResp, IN OUT EFI_STRING *ConfigAltResp, IN EFI_STRING AltConfigHdr, IN OUT BOOLEAN *ConfigAltRespChanged)
 
EFI_STATUS CompareAndMergeDefaultString (IN OUT EFI_STRING *AltCfgResp, IN EFI_STRING DefaultAltCfgResp, IN EFI_STRING AltConfigHdr)
 
EFI_STATUS EFIAPI MergeDefaultString (IN OUT EFI_STRING *AltCfgResp, IN EFI_STRING DefaultAltCfgResp)
 
VOID InsertDefaultValue (IN IFR_BLOCK_DATA *BlockData, IN IFR_DEFAULT_DATA *DefaultValueData)
 
VOID InsertBlockData (IN LIST_ENTRY *BlockLink, IN IFR_BLOCK_DATA **BlockData)
 
CHAR8 * GetSupportedLanguages (IN EFI_HII_HANDLE HiiHandle)
 
EFI_STRING InternalGetString (IN EFI_HII_HANDLE HiiHandle, IN EFI_STRING_ID StringId)
 
BOOLEAN BlockArrayCheck (IN IFR_BLOCK_DATA *RequestBlockArray, IN UINT16 VarOffset, IN UINT16 VarWidth, IN BOOLEAN IsNameValueType, IN EFI_HII_HANDLE HiiHandle)
 
EFI_STATUS GetFormPackageData (IN HII_DATABASE_RECORD *DataBaseRecord, IN OUT UINT8 **HiiFormPackage, OUT UINTN *PackageSize)
 
EFI_STATUS GetVarStoreType (IN HII_DATABASE_RECORD *DataBaseRecord, IN EFI_STRING ConfigHdr, OUT BOOLEAN *IsEfiVarstore, OUT EFI_IFR_VARSTORE_EFI **EfiVarStore)
 
BOOLEAN GetElementsFromRequest (IN EFI_STRING ConfigRequest)
 
BOOLEAN IsThisVarstore (IN EFI_GUID *VarstoreGuid, IN CHAR16 *Name, IN CHAR16 *ConfigHdr)
 
BOOLEAN IsThisPackageList (IN HII_DATABASE_RECORD *DataBaseRecord, IN EFI_STRING ConfigHdr)
 
EFI_STATUS IsThisOpcodeRequired (IN IFR_BLOCK_DATA *RequestBlockArray, IN EFI_HII_HANDLE HiiHandle, IN OUT IFR_VARSTORAGE_DATA *VarStorageData, IN EFI_IFR_OP_HEADER *IfrOpHdr, IN UINT16 VarWidth, OUT IFR_BLOCK_DATA **ReturnData, IN BOOLEAN IsBitVar)
 
EFI_STATUS EFIAPI ParseIfrData (IN EFI_HII_HANDLE HiiHandle, IN UINT8 *Package, IN UINT32 PackageLength, IN EFI_STRING ConfigHdr, IN IFR_BLOCK_DATA *RequestBlockArray, IN OUT IFR_VARSTORAGE_DATA *VarStorageData, OUT IFR_DEFAULT_DATA *DefaultIdArray)
 
IFR_BLOCK_DATAGetBlockElement (IN EFI_STRING ConfigRequest, OUT EFI_STRING *Progress)
 
IFR_BLOCK_DATAGetNameElement (IN EFI_STRING ConfigRequest, OUT EFI_STRING *Progress)
 
BOOLEAN GenerateConfigRequest (IN CHAR16 *ConfigHdr, IN IFR_VARSTORAGE_DATA *VarStorageData, OUT EFI_STATUS *Status, IN OUT EFI_STRING *ConfigRequest)
 
EFI_STATUS GenerateHdr (IN IFR_VARSTORAGE_DATA *VarStorageData, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, OUT EFI_STRING *ConfigHdr)
 
VOID UpdateDefaultValue (IN LIST_ENTRY *BlockLink)
 
VOID MergeBlockDefaultValue (IN OUT IFR_BLOCK_DATA *FirstBlock, IN OUT IFR_BLOCK_DATA *SecondBlock)
 
VOID UpdateBlockDataArray (IN LIST_ENTRY *BlockLink)
 
EFI_STATUS GenerateAltConfigResp (IN EFI_HII_HANDLE HiiHandle, IN CHAR16 *ConfigHdr, IN IFR_VARSTORAGE_DATA *VarStorageData, IN IFR_DEFAULT_DATA *DefaultIdArray, IN OUT EFI_STRING *DefaultAltCfgResp)
 
EFI_STATUS EFIAPI GetFullStringFromHiiFormPackages (IN HII_DATABASE_RECORD *DataBaseRecord, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN OUT EFI_STRING *Request, IN OUT EFI_STRING *AltCfgResp, OUT EFI_STRING *PointerProgress OPTIONAL)
 
EFI_STATUS GetConfigRespFromEfiVarStore (IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, IN EFI_IFR_VARSTORE_EFI *EfiVarStoreInfo, IN EFI_STRING Request, OUT EFI_STRING *RequestResp, OUT EFI_STRING *AccessProgress)
 
EFI_STATUS RouteConfigRespForEfiVarStore (IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, IN EFI_IFR_VARSTORE_EFI *EfiVarStoreInfo, IN EFI_STRING RequestResp, OUT EFI_STRING *Result)
 
CHAR16 * OffsetWidthValidate (CHAR16 *ConfigElements)
 
CHAR16 * NameValueValidate (CHAR16 *ConfigElements)
 
CHAR16 * ConfigRequestValidate (CHAR16 *ConfigRequest)
 
EFI_STATUS EFIAPI HiiConfigRoutingExtractConfig (IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, IN CONST EFI_STRING Request, OUT EFI_STRING *Progress, OUT EFI_STRING *Results)
 
EFI_STATUS EFIAPI HiiConfigRoutingExportConfig (IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, OUT EFI_STRING *Results)
 
EFI_STATUS EFIAPI HiiConfigRoutingRouteConfig (IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, IN CONST EFI_STRING Configuration, OUT EFI_STRING *Progress)
 
EFI_STATUS EFIAPI HiiBlockToConfig (IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, IN CONST EFI_STRING ConfigRequest, IN CONST UINT8 *Block, IN CONST UINTN BlockSize, OUT EFI_STRING *Config, OUT EFI_STRING *Progress)
 
EFI_STATUS EFIAPI HiiConfigToBlock (IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, IN CONST EFI_STRING ConfigResp, IN OUT UINT8 *Block, IN OUT UINTN *BlockSize, OUT EFI_STRING *Progress)
 
EFI_STATUS EFIAPI HiiGetAltCfg (IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, IN CONST EFI_STRING Configuration, IN CONST EFI_GUID *Guid, IN CONST EFI_STRING Name, IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN CONST UINT16 *AltCfgId, OUT EFI_STRING *AltCfgResp)
 

Variables

HII_DATABASE_PRIVATE_DATA mPrivate
 

Detailed Description

Implementation of interfaces function for EFI_HII_CONFIG_ROUTING_PROTOCOL.

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

Definition in file ConfigRouting.c.

Function Documentation

◆ AppendToMultiString()

EFI_STATUS AppendToMultiString ( IN OUT EFI_STRING *  MultiString,
IN EFI_STRING  AppendString 
)

Append a string to a multi-string format.

This is a internal function.

Parameters
MultiStringString in <MultiConfigRequest>, <MultiConfigAltResp>, or <MultiConfigResp>. On input, the buffer length of this string is MAX_STRING_LENGTH. On output, the buffer length might be updated.
AppendStringNULL-terminated Unicode string.
Return values
EFI_INVALID_PARAMETERAny incoming parameter is invalid.
EFI_SUCCESSAppendString is append to the end of MultiString

Definition at line 409 of file ConfigRouting.c.

◆ BlockArrayCheck()

BOOLEAN BlockArrayCheck ( IN IFR_BLOCK_DATA RequestBlockArray,
IN UINT16  VarOffset,
IN UINT16  VarWidth,
IN BOOLEAN  IsNameValueType,
IN EFI_HII_HANDLE  HiiHandle 
)

This function checks VarOffset and VarWidth is in the block range.

Parameters
RequestBlockArrayThe block array is to be checked.
VarOffsetOffset of var to the structure
VarWidthWidth of var.
IsNameValueTypeWhether this varstore is name/value varstore or not.
HiiHandleHii handle for this hii package.
Return values
TRUEThis Var is in the block range.
FALSEThis Var is not in the block range.

Definition at line 1529 of file ConfigRouting.c.

◆ CalculateConfigStringLen()

UINTN CalculateConfigStringLen ( IN EFI_STRING  String)

Calculate the number of Unicode characters of the incoming Configuration string, not including NULL terminator.

This is a internal function.

Parameters
StringString in <MultiConfigRequest> or <MultiConfigResp> format.
Returns
The number of Unicode characters.

Definition at line 25 of file ConfigRouting.c.

◆ CompareAndMergeDefaultString()

EFI_STATUS CompareAndMergeDefaultString ( IN OUT EFI_STRING *  AltCfgResp,
IN EFI_STRING  DefaultAltCfgResp,
IN EFI_STRING  AltConfigHdr 
)

Compare the <AltResp> in AltCfgResp and DefaultAltCfgResp, if the <AltResp> in DefaultAltCfgResp but not in AltCfgResp,add it to the AltCfgResp.

Parameters
AltCfgRespPointer to a null-terminated Unicode string in <ConfigAltResp> format.
DefaultAltCfgRespPointer to a null-terminated Unicode string in <MultiConfigAltResp> format. The default value string may contain more than one ConfigAltResp string for the different varstore buffer.
AltConfigHdrPointer to a Unicode string in <AltConfigHdr> format.
Return values
EFI_OUT_OF_RESOURCESInsufficient resources to store necessary structures.
EFI_SUCCESSThe function finishes successfully.

Definition at line 893 of file ConfigRouting.c.

◆ CompareBlockElementDefault()

EFI_STATUS CompareBlockElementDefault ( IN EFI_STRING  DefaultAltCfgResp,
IN OUT EFI_STRING *  ConfigAltResp,
IN EFI_STRING  AltConfigHdr,
IN OUT BOOLEAN *  ConfigAltRespChanged 
)

Compare the <AltResp> in ConfigAltResp and DefaultAltCfgResp, if the <AltResp> in DefaultAltCfgResp but not in ConfigAltResp,add it to the ConfigAltResp.

Parameters
DefaultAltCfgRespPointer to a null-terminated Unicode string in <MultiConfigAltResp> format. The default value string may contain more than one ConfigAltResp string for the different varstore buffer.
ConfigAltRespPointer to a null-terminated Unicode string in <ConfigAltResp> format.
AltConfigHdrPointer to a Unicode string in <AltConfigHdr> format.
ConfigAltRespChangedWhether the ConfigAltResp has been changed.
Return values
EFI_OUT_OF_RESOURCESInsufficient resources to store necessary structures.
EFI_SUCCESSThe function finishes successfully.

Definition at line 609 of file ConfigRouting.c.

◆ CompareNameElementDefault()

EFI_STATUS CompareNameElementDefault ( IN EFI_STRING  DefaultAltCfgResp,
IN OUT EFI_STRING *  ConfigAltResp,
IN EFI_STRING  AltConfigHdr,
IN OUT BOOLEAN *  ConfigAltRespChanged 
)

Compare the <AltResp> in ConfigAltResp and DefaultAltCfgResp, if the <AltResp> in DefaultAltCfgResp but not in ConfigAltResp,add it to the ConfigAltResp.

Parameters
DefaultAltCfgRespPointer to a null-terminated Unicode string in <MultiConfigAltResp> format. The default value string may contain more than one ConfigAltResp string for the different varstore buffer.
ConfigAltRespPointer to a null-terminated Unicode string in <ConfigAltResp> format.
AltConfigHdrPointer to a Unicode string in <AltConfigHdr> format.
ConfigAltRespChangedWhether the ConfigAltResp has been changed.
Return values
EFI_OUT_OF_RESOURCESInsufficient resources to store necessary structures.
EFI_SUCCESSThe function finishes successfully.

Definition at line 756 of file ConfigRouting.c.

◆ ConfigRequestValidate()

CHAR16 * ConfigRequestValidate ( CHAR16 *  ConfigRequest)

Validate the config request string.

Parameters
ConfigRequestA null-terminated Unicode string in <ConfigRequest> format.
Return values
CHAR16* THE first element not correct.
NULLSuccess parse the name/value pair

Definition at line 4726 of file ConfigRouting.c.

◆ FindSameBlockElement()

EFI_STATUS FindSameBlockElement ( IN EFI_STRING  String,
IN EFI_STRING  BlockName,
IN UINT8 *  Buffer,
OUT BOOLEAN *  Found,
IN UINTN  BufferLen 
)

To find the BlockName in the string with same value.

Parameters
StringPointer to a Null-terminated Unicode string.
BlockNamePointer to a Null-terminated Unicode string to search for.
BufferPointer to the value correspond to the BlockName.
FoundThe Block whether has been found.
BufferLenThe length of the buffer.
Return values
EFI_OUT_OF_RESOURCESInsufficient resources to store necessary structures.
EFI_SUCCESSThe function finishes successfully.

Definition at line 551 of file ConfigRouting.c.

◆ GenerateAltConfigResp()

EFI_STATUS GenerateAltConfigResp ( IN EFI_HII_HANDLE  HiiHandle,
IN CHAR16 *  ConfigHdr,
IN IFR_VARSTORAGE_DATA VarStorageData,
IN IFR_DEFAULT_DATA DefaultIdArray,
IN OUT EFI_STRING *  DefaultAltCfgResp 
)

Generate ConfigAltResp string base on the varstore info.

Parameters
HiiHandleHii Handle for this hii package.
ConfigHdrThe config header for this varstore.
VarStorageDataThe varstore info.
DefaultIdArrayThe Default id array.
DefaultAltCfgRespThe DefaultAltCfgResp info may be return.
Return values
TRUENeed to continue
OthersNO need to continue or error occur.

Definition at line 3952 of file ConfigRouting.c.

◆ GenerateConfigRequest()

BOOLEAN GenerateConfigRequest ( IN CHAR16 *  ConfigHdr,
IN IFR_VARSTORAGE_DATA VarStorageData,
OUT EFI_STATUS Status,
IN OUT EFI_STRING *  ConfigRequest 
)

Generate ConfigRequest string base on the varstore info.

Parameters
ConfigHdrThe config header for this varstore.
VarStorageDataThe varstore info.
StatusReturn Status.
ConfigRequestThe ConfigRequest info may be return.
Return values
TRUENeed to continue
OthersNO need to continue or error occur.

Definition at line 3521 of file ConfigRouting.c.

◆ GenerateHdr()

EFI_STATUS GenerateHdr ( IN IFR_VARSTORAGE_DATA VarStorageData,
IN EFI_DEVICE_PATH_PROTOCOL DevicePath,
OUT EFI_STRING *  ConfigHdr 
)

Generate ConfigRequest Header base on the varstore info.

Parameters
VarStorageDataThe varstore info.
DevicePathDevice path for this varstore.
ConfigHdrThe config header for this varstore.
Return values
EFI_SUCCESSGenerate the header success.
EFI_OUT_OF_RESOURCESAllocate buffer fail.

Definition at line 3655 of file ConfigRouting.c.

◆ GenerateSubStr()

VOID GenerateSubStr ( IN CONST EFI_STRING  String,
IN UINTN  BufferLen,
IN VOID *  Buffer,
IN UINT8  Flag,
OUT EFI_STRING *  SubStr 
)

Generate a sub string then output it.

This is a internal function.

Parameters
StringA constant string which is the prefix of the to be generated string, e.g. GUID=
BufferLenThe length of the Buffer in bytes.
BufferPoints to a buffer which will be converted to be the content of the generated string.
FlagIf 1, the buffer contains data for the value of GUID or PATH stored in UINT8 *; if 2, the buffer contains unicode string for the value of NAME; if 3, the buffer contains other data.
SubStrPoints to the output string. It's caller's responsibility to free this buffer.

Definition at line 222 of file ConfigRouting.c.

◆ GetBlockElement()

IFR_BLOCK_DATA * GetBlockElement ( IN EFI_STRING  ConfigRequest,
OUT EFI_STRING *  Progress 
)

parse the configrequest string, get the elements.

Parameters
ConfigRequestThe input configrequest string.
ProgressReturn the progress data.
Return values
Blockdata pointer.

Definition at line 3231 of file ConfigRouting.c.

◆ GetConfigRespFromEfiVarStore()

EFI_STATUS GetConfigRespFromEfiVarStore ( IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL This,
IN EFI_IFR_VARSTORE_EFI EfiVarStoreInfo,
IN EFI_STRING  Request,
OUT EFI_STRING *  RequestResp,
OUT EFI_STRING *  AccessProgress 
)

This function gets the full request resp string by parsing IFR data in HII form packages.

Parameters
ThisA pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance.
EfiVarStoreInfoThe efi varstore info which is save in the EFI varstore data structure.
RequestPointer to a null-terminated Unicode string in <ConfigRequest> format.
RequestRespPointer to a null-terminated Unicode string in <ConfigResp> format.
AccessProgressOn 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.
Return values
EFI_SUCCESSThe Results string is set to the full request string. And AltCfgResp contains all default value string.
EFI_OUT_OF_RESOURCESNot enough memory for the return string.
EFI_INVALID_PARAMETERRequest points to NULL.

Definition at line 4493 of file ConfigRouting.c.

◆ GetDevicePath()

EFI_STATUS GetDevicePath ( IN EFI_STRING  String,
OUT UINT8 **  DevicePathData 
)

Convert the hex UNICODE %02x encoding of a UEFI device path to binary from <PathHdr> of <ConfigHdr>.

This is a internal function.

Parameters
StringUEFI configuration string
DevicePathDataBinary of a UEFI device path.
Return values
EFI_NOT_FOUNDThe device path is not invalid.
EFI_INVALID_PARAMETERAny incoming parameter is invalid.
EFI_OUT_OF_RESOURCESLake of resources to store necessary structures.
EFI_SUCCESSThe device path is retrieved and translated to binary format.

Definition at line 66 of file ConfigRouting.c.

◆ GetElementsFromRequest()

BOOLEAN GetElementsFromRequest ( IN EFI_STRING  ConfigRequest)

Check whether the ConfigRequest string has the request elements. For EFI_HII_VARSTORE_BUFFER type, the request has "&OFFSET=****&WIDTH=****..." format. For EFI_HII_VARSTORE_NAME_VALUE type, the request has "&NAME1**&NAME2..." format.

Parameters
ConfigRequestThe input config request string.
Return values
TRUEThe input include config request elements.
FALSEThe input string not includes.

Definition at line 1797 of file ConfigRouting.c.

◆ GetFormPackageData()

EFI_STATUS GetFormPackageData ( IN HII_DATABASE_RECORD DataBaseRecord,
IN OUT UINT8 **  HiiFormPackage,
OUT UINTN PackageSize 
)

Get form package data from data base.

Parameters
DataBaseRecordThe DataBaseRecord instance contains the found Hii handle and package.
HiiFormPackageThe buffer saves the package data.
PackageSizeThe buffer size of the package data.

Definition at line 1583 of file ConfigRouting.c.

◆ GetFullStringFromHiiFormPackages()

EFI_STATUS EFIAPI GetFullStringFromHiiFormPackages ( IN HII_DATABASE_RECORD DataBaseRecord,
IN EFI_DEVICE_PATH_PROTOCOL DevicePath,
IN OUT EFI_STRING *  Request,
IN OUT EFI_STRING *  AltCfgResp,
OUT EFI_STRING *PointerProgress  OPTIONAL 
)

This function gets the full request string and full default value string by parsing IFR data in HII form packages.

When Request points to NULL string, the request string and default value string for each varstore in form package will return.

Parameters
DataBaseRecordThe DataBaseRecord instance contains the found Hii handle and package.
DevicePathDevice Path which Hii Config Access Protocol is registered.
RequestPointer to a null-terminated Unicode string in <ConfigRequest> format. When it doesn't contain any RequestElement, it will be updated to return the full RequestElement retrieved from IFR data. If it points to NULL, the request string for the first varstore in form package will be merged into a <MultiConfigRequest> format string and return.
AltCfgRespPointer to a null-terminated Unicode string in <ConfigAltResp> format. When the pointer is to NULL, the full default value string retrieved from IFR data will return. When the pinter is to a string, the full default value string retrieved from IFR data will be merged into the input string and return. When Request points to NULL, the default value string for each varstore in form package will be merged into a <MultiConfigAltResp> format string and return.
PointerProgressOptional parameter, it can be NULL. When it is not NULL, if Request is NULL, it returns NULL. On 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.
Return values
EFI_SUCCESSThe Results string is set to the full request string. And AltCfgResp contains all default value string.
EFI_OUT_OF_RESOURCESNot enough memory for the return string.
EFI_NOT_FOUNDThe varstore (Guid and Name) in Request string can't be found in Form package.
EFI_NOT_FOUNDHiiPackage can't be got on the input HiiHandle.
EFI_INVALID_PARAMETERRequest points to NULL.

Definition at line 4186 of file ConfigRouting.c.

◆ GetNameElement()

IFR_BLOCK_DATA * GetNameElement ( IN EFI_STRING  ConfigRequest,
OUT EFI_STRING *  Progress 
)

parse the configrequest string, get the elements.

Parameters
ConfigRequestThe input config request string.
ProgressReturn the progress data.
Return values
returndata block array.

Definition at line 3409 of file ConfigRouting.c.

◆ GetSupportedLanguages()

CHAR8 * GetSupportedLanguages ( IN EFI_HII_HANDLE  HiiHandle)

Retrieves a pointer to the a Null-terminated ASCII string containing the list of languages that an HII handle in the HII Database supports. The returned string is allocated using AllocatePool(). The caller is responsible for freeing the returned string using FreePool(). The format of the returned string follows the language format assumed the HII Database.

If HiiHandle is NULL, then ASSERT().

Parameters
[in]HiiHandleA handle that was previously registered in the HII Database.
Return values
NULLHiiHandle is not registered in the HII database
NULLThere are not enough resources available to retrieve the supported languages.
NULLThe list of supported languages could not be retrieved.
OtherA pointer to the Null-terminated ASCII string of supported languages.

Definition at line 1315 of file ConfigRouting.c.

◆ GetValueOfNumber()

EFI_STATUS GetValueOfNumber ( IN EFI_STRING  StringPtr,
OUT UINT8 **  Number,
OUT UINTN Len 
)

Get the value of <Number> in <BlockConfig> format, i.e. the value of OFFSET or WIDTH or VALUE. <BlockConfig> ::= 'OFFSET='<Number>&'WIDTH='<Number>&'VALUE'=<Number>

This is a internal function.

Parameters
StringPtrString in <BlockConfig> format and points to the first character of <Number>.
NumberThe output value. Caller takes the responsibility to free memory.
LenLength of the <Number>, in characters.
Return values
EFI_OUT_OF_RESOURCESInsufficient resources to store necessary structures.
EFI_SUCCESSValue of <Number> is outputted in Number successfully.

Definition at line 469 of file ConfigRouting.c.

◆ GetVarStoreType()

EFI_STATUS GetVarStoreType ( IN HII_DATABASE_RECORD DataBaseRecord,
IN EFI_STRING  ConfigHdr,
OUT BOOLEAN *  IsEfiVarstore,
OUT EFI_IFR_VARSTORE_EFI **  EfiVarStore 
)

This function parses Form Package to get the efi varstore info according to the request ConfigHdr.

Parameters
DataBaseRecordThe DataBaseRecord instance contains the found Hii handle and package.
ConfigHdrRequest string ConfigHdr. If it is NULL, the first found varstore will be as ConfigHdr.
IsEfiVarstoreWhether the request storage type is efi varstore type.
EfiVarStoreThe efi varstore info which will return.

Definition at line 1654 of file ConfigRouting.c.

◆ HiiBlockToConfig()

EFI_STATUS EFIAPI HiiBlockToConfig ( IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL This,
IN CONST EFI_STRING  ConfigRequest,
IN CONST UINT8 *  Block,
IN CONST UINTN  BlockSize,
OUT EFI_STRING *  Config,
OUT EFI_STRING *  Progress 
)

This helper function is to be called by drivers to map configuration data stored in byte array ("block") formats such as UEFI Variables into current configuration strings.

Parameters
ThisA pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance.
ConfigRequestA null-terminated Unicode string in <ConfigRequest> format.
BlockArray of bytes defining the block's configuration.
BlockSizeLength in bytes of Block.
ConfigFilled-in configuration string. String allocated by the function. Returned only if call is successful. It is <ConfigResp> string 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 request succeeded. Progress points to the null terminator at the end of the ConfigRequest string.
EFI_OUT_OF_RESOURCESNot enough memory to allocate Config. Progress points to the first character of ConfigRequest.
EFI_INVALID_PARAMETERPassing in a NULL for the ConfigRequest or Block parameter would result in this type of error. Progress points to the first character of ConfigRequest.
EFI_DEVICE_ERRORBlock not large enough. Progress undefined.
EFI_INVALID_PARAMETEREncountered non <BlockName> formatted string. Block is left updated and Progress points at the "&" preceding the first non-<BlockName>.

Definition at line 5664 of file ConfigRouting.c.

◆ HiiConfigRoutingExportConfig()

EFI_STATUS EFIAPI HiiConfigRoutingExportConfig ( IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL This,
OUT EFI_STRING *  Results 
)

This function allows the caller to request the current configuration for the entirety of the current HII database and returns the data in a null-terminated Unicode string.

Parameters
ThisA pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance.
ResultsNull-terminated Unicode string in <MultiConfigAltResp> format which has all values filled in for the entirety of the current HII database. String to be allocated by the called function. De-allocation is up to the caller.
Return values
EFI_SUCCESSThe Results string is filled with the values corresponding to all requested names.
EFI_OUT_OF_RESOURCESNot enough memory to store the parts of the results that must be stored awaiting possible future protocols.
EFI_INVALID_PARAMETERFor example, passing in a NULL for the Results parameter would result in this type of error.

Definition at line 5226 of file ConfigRouting.c.

◆ HiiConfigRoutingExtractConfig()

EFI_STATUS EFIAPI HiiConfigRoutingExtractConfig ( IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL This,
IN CONST EFI_STRING  Request,
OUT EFI_STRING *  Progress,
OUT EFI_STRING *  Results 
)

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

Parameters
ThisA pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance.
RequestA null-terminated Unicode string in <MultiConfigRequest> 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.
ResultsNull-terminated Unicode string in <MultiConfigAltResp> 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 string is filled with the values corresponding to all requested names.
EFI_OUT_OF_RESOURCESNot enough memory to store the parts of the results that must be stored awaiting possible future protocols.
EFI_NOT_FOUNDRouting data doesn't match any known driver. Progress set to the "G" in "GUID" of the routing header that doesn't match. Note: There is no requirement that all routing data be validated before any configuration extraction.
EFI_INVALID_PARAMETERFor example, passing in a NULL for the Request parameter would result in this type of error. The Progress parameter is set to NULL.
EFI_INVALID_PARAMETERIllegal syntax. Progress set to most recent & before the error or the beginning of the string.
EFI_INVALID_PARAMETERThe ExtractConfig function of the underlying HII Configuration Access Protocol returned EFI_INVALID_PARAMETER. Progress set to most recent & before the error or the beginning of the string.

Definition at line 4830 of file ConfigRouting.c.

◆ HiiConfigRoutingRouteConfig()

EFI_STATUS EFIAPI HiiConfigRoutingRouteConfig ( IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL This,
IN CONST EFI_STRING  Configuration,
OUT EFI_STRING *  Progress 
)

This function processes the results of processing forms and routes it to the appropriate handlers or storage.

Parameters
ThisA pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance.
ConfigurationA null-terminated Unicode string in <MulltiConfigResp> 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 have been distributed or are awaiting distribution.
EFI_OUT_OF_RESOURCESNot enough memory to store the parts of the results that must be stored awaiting possible future protocols.
EFI_INVALID_PARAMETERPassing in a NULL for the Configuration parameter would result in this type of error.
EFI_NOT_FOUNDTarget for the specified routing data was not found.

Definition at line 5433 of file ConfigRouting.c.

◆ HiiConfigToBlock()

EFI_STATUS EFIAPI HiiConfigToBlock ( IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL This,
IN CONST EFI_STRING  ConfigResp,
IN OUT UINT8 *  Block,
IN OUT UINTN BlockSize,
OUT EFI_STRING *  Progress 
)

This helper function is to be called by drivers to map configuration strings to configurations stored in byte array ("block") formats such as UEFI Variables.

Parameters
ThisA pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance.
ConfigRespA null-terminated Unicode string in <ConfigResp> format.
BlockA possibly null array of bytes representing the current block. Only bytes referenced in the ConfigResp string in the block are modified. If this parameter is null or if the *BlockSize parameter is (on input) shorter than required by the Configuration string, only the BlockSize parameter is updated and an appropriate status (see below) is returned.
BlockSizeThe length of the Block in units of UINT8. On input, this is the size of the Block. On output, if successful, contains the largest index of the modified byte in the Block, or the required buffer size if the Block is not large enough.
ProgressOn return, points to an element of the ConfigResp 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 request succeeded. Progress points to the null terminator at the end of the ConfigResp string.
EFI_OUT_OF_RESOURCESNot enough memory to allocate Config. Progress points to the first character of ConfigResp.
EFI_INVALID_PARAMETERPassing in a NULL for the ConfigResp or Block parameter would result in this type of error. Progress points to the first character of ConfigResp.
EFI_INVALID_PARAMETEREncountered non <BlockName> formatted name / value pair. Block is left updated and Progress points at the '&' preceding the first non-<BlockName>.
EFI_BUFFER_TOO_SMALLBlock not large enough. Progress undefined. BlockSize is updated with the required buffer size.
EFI_NOT_FOUNDTarget for the specified routing data was not found. Progress points to the "G" in "GUID" of the errant routing data.

Definition at line 5986 of file ConfigRouting.c.

◆ HiiGetAltCfg()

EFI_STATUS EFIAPI HiiGetAltCfg ( IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL This,
IN CONST EFI_STRING  Configuration,
IN CONST EFI_GUID Guid,
IN CONST EFI_STRING  Name,
IN CONST EFI_DEVICE_PATH_PROTOCOL DevicePath,
IN CONST UINT16 *  AltCfgId,
OUT EFI_STRING *  AltCfgResp 
)

This helper function is to be called by drivers to extract portions of a larger configuration string.

Parameters
ThisA pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance.
ConfigurationA null-terminated Unicode string in <MultiConfigAltResp> format.
GuidA pointer to the GUID value to search for in the routing portion of the ConfigResp string when retrieving the requested data. If Guid is NULL, then all GUID values will be searched for.
NameA pointer to the NAME value to search for in the routing portion of the ConfigResp string when retrieving the requested data. If Name is NULL, then all Name values will be searched for.
DevicePathA pointer to the PATH value to search for in the routing portion of the ConfigResp string when retrieving the requested data. If DevicePath is NULL, then all DevicePath values will be searched for.
AltCfgIdA pointer to the ALTCFG value to search for in the routing portion of the ConfigResp string when retrieving the requested data. If this parameter is NULL, then the current setting will be retrieved.
AltCfgRespA pointer to a buffer which will be allocated by the function which contains the retrieved string as requested. This buffer is only allocated if the call was successful. It is <ConfigResp> format.
Return values
EFI_SUCCESSThe request succeeded. The requested data was extracted and placed in the newly allocated AltCfgResp buffer.
EFI_OUT_OF_RESOURCESNot enough memory to allocate AltCfgResp.
EFI_INVALID_PARAMETERAny parameter is invalid.
EFI_NOT_FOUNDTarget for the specified routing data was not found.

Definition at line 6229 of file ConfigRouting.c.

◆ HiiToLower()

VOID EFIAPI HiiToLower ( IN EFI_STRING  ConfigString)

Converts the unicode character of the string from uppercase to lowercase. This is a internal function.

Parameters
ConfigStringString to be converted

Definition at line 174 of file ConfigRouting.c.

◆ InsertBlockData()

VOID InsertBlockData ( IN LIST_ENTRY BlockLink,
IN IFR_BLOCK_DATA **  BlockData 
)

This function inserts new BlockData into the block link

Parameters
BlockLinkThe list entry points to block array.
BlockDataThe point to BlockData is added.

Definition at line 1240 of file ConfigRouting.c.

◆ InsertDefaultValue()

VOID InsertDefaultValue ( IN IFR_BLOCK_DATA BlockData,
IN IFR_DEFAULT_DATA DefaultValueData 
)

This function inserts new DefaultValueData into the BlockData DefaultValue array.

Parameters
BlockDataThe BlockData is updated to add new default value.
DefaultValueDataThe DefaultValue is added.

Definition at line 1192 of file ConfigRouting.c.

◆ InternalGetString()

EFI_STRING InternalGetString ( IN EFI_HII_HANDLE  HiiHandle,
IN EFI_STRING_ID  StringId 
)

Retrieves a string from a string package.

If HiiHandle is NULL, then ASSERT(). If StringId is 0, then ASSET.

Parameters
[in]HiiHandleA handle that was previously registered in the HII Database.
[in]StringIdThe identifier of the string to retrieved from the string package associated with HiiHandle.
Return values
NULLThe string specified by StringId is not present in the string package.
OtherThe string was returned.

Definition at line 1389 of file ConfigRouting.c.

◆ IsThisOpcodeRequired()

EFI_STATUS IsThisOpcodeRequired ( IN IFR_BLOCK_DATA RequestBlockArray,
IN EFI_HII_HANDLE  HiiHandle,
IN OUT IFR_VARSTORAGE_DATA VarStorageData,
IN EFI_IFR_OP_HEADER IfrOpHdr,
IN UINT16  VarWidth,
OUT IFR_BLOCK_DATA **  ReturnData,
IN BOOLEAN  IsBitVar 
)

Check whether the this op code is required.

Parameters
RequestBlockArrayThe array includes all the request info or NULL.
HiiHandleThe hii handle for this form package.
VarStorageDataThe varstore data structure.
IfrOpHdrIfr opcode header for this opcode.
VarWidthThe buffer width for this opcode.
ReturnDataThe data block added for this opcode.
IsBitVarWhether the the opcode refers to bit storage.
Return values
EFI_SUCCESSThis opcode is required.
EFI_NOT_FOUNDThis opcode is not required.
OthersContain some error.

Definition at line 2038 of file ConfigRouting.c.

◆ IsThisPackageList()

BOOLEAN IsThisPackageList ( IN HII_DATABASE_RECORD DataBaseRecord,
IN EFI_STRING  ConfigHdr 
)

This function parses Form Package to get the efi varstore info according to the request ConfigHdr.

Parameters
DataBaseRecordThe DataBaseRecord instance contains the found Hii handle and package.
ConfigHdrRequest string ConfigHdr. If it is NULL, the first found varstore will be as ConfigHdr.
Return values
TRUEThis hii package is the request one.
FALSEThis hii package is not the request one.

Definition at line 1895 of file ConfigRouting.c.

◆ IsThisVarstore()

BOOLEAN IsThisVarstore ( IN EFI_GUID VarstoreGuid,
IN CHAR16 *  Name,
IN CHAR16 *  ConfigHdr 
)

Check whether the this varstore is the request varstore.

Parameters
VarstoreGuidVarstore guid.
NameVarstore name.
ConfigHdrCurrent configRequest info.
Return values
TRUEThis varstore is the request one.
FALSEThis varstore is not the request one.

Definition at line 1825 of file ConfigRouting.c.

◆ MergeBlockDefaultValue()

VOID MergeBlockDefaultValue ( IN OUT IFR_BLOCK_DATA FirstBlock,
IN OUT IFR_BLOCK_DATA SecondBlock 
)

Merge the default value in two block datas which have overlap region.

For bit fields, their related block data may have overlap region, such as:

typedef struct { UINT16 Bit1 : 6; // Question1 refer Bit1, Block1: offset = 0; width = 1;(byte level) default = 1 UINT16 Bit2 : 5; // Question2 refer Bit2, Block2: offset = 0; width = 2;(byte level) default = 5 (default value record for the bit field) ...... }ExampleData;

After function UpdateDefaultValue: Block1: offset = 0; width = 1;(byte level) default = 1 Block2: offset = 0; width = 2;(byte level) default = 320 (5 * (2 << 6)) (default value record for block)

After function MergeBlockDefaultValue: Block1: offset = 0; width = 1;(byte level) default = 65 Block2: offset = 0; width = 2;(byte level) default = 321 (Block1 and Block2 has overlap region, merge the overlap value to Block1 and Blcok2)

Block1 and Block2 have overlap byte region, but currntly the default value of Block1 only contains value of Bit1 (low 6 bits),the default value of Block2 only contains the value of Bit2 (middle 5 bits).

This fuction merge the default value of these two blocks, and make the default value of block1 also contain the value of lower 2 bits of the Bit2. And make the default value of Block2 also contain the default value of Bit1.

We can get the total value of the whole block that just cover these two blocks(in this case is: block: offset =0; width =2;) then the value of block2 is same as block, the value of block1 is the first byte value of block.

Parameters
FirstBlockPoint to the block date whose default value need to be merged.
SecondBlockPoint to the block date whose default value need to be merged.

Definition at line 3834 of file ConfigRouting.c.

◆ MergeDefaultString()

EFI_STATUS EFIAPI MergeDefaultString ( IN OUT EFI_STRING *  AltCfgResp,
IN EFI_STRING  DefaultAltCfgResp 
)

This function merges DefaultAltCfgResp string into AltCfgResp string for the missing AltCfgId in AltCfgResq.

Parameters
AltCfgRespPointer to a null-terminated Unicode string in <ConfigAltResp> format. The default value string will be merged into it.
DefaultAltCfgRespPointer to a null-terminated Unicode string in <MultiConfigAltResp> format. The default value string may contain more than one ConfigAltResp string for the different varstore buffer.
Return values
EFI_SUCCESSThe merged string returns.
EFI_INVALID_PARAMETER*AltCfgResp is to NULL.

Definition at line 1050 of file ConfigRouting.c.

◆ NameValueValidate()

CHAR16 * NameValueValidate ( CHAR16 *  ConfigElements)

Validate the config request elements.

Parameters
ConfigElementsA null-terminated Unicode string in <ConfigRequest> format, without configHdr field.
Return values
CHAR16* THE first Name/value pair not correct.
NULLSuccess parse the name/value pair

Definition at line 4691 of file ConfigRouting.c.

◆ OffsetWidthValidate()

CHAR16 * OffsetWidthValidate ( CHAR16 *  ConfigElements)

Validate the config request elements.

Parameters
ConfigElementsA null-terminated Unicode string in <ConfigRequest> format, without configHdr field.
Return values
CHAR16* THE first Name/value pair not correct.
NULLSuccess parse the name/value pair

Definition at line 4646 of file ConfigRouting.c.

◆ OutputConfigBody()

EFI_STATUS OutputConfigBody ( IN EFI_STRING  String,
OUT EFI_STRING *  ConfigBody 
)

Retrieve the <ConfigBody> from String then output it.

This is a internal function.

Parameters
StringA sub string of a configuration string in <MultiConfigAltResp> format.
ConfigBodyPoints to the output string. It's caller's responsibility to free this buffer.
Return values
EFI_INVALID_PARAMETERThere is no form package in current hii database.
EFI_OUT_OF_RESOURCESNot enough memory to finish this operation.
EFI_SUCCESSAll existing storage is exported.

Definition at line 343 of file ConfigRouting.c.

◆ ParseIfrData()

EFI_STATUS EFIAPI ParseIfrData ( IN EFI_HII_HANDLE  HiiHandle,
IN UINT8 *  Package,
IN UINT32  PackageLength,
IN EFI_STRING  ConfigHdr,
IN IFR_BLOCK_DATA RequestBlockArray,
IN OUT IFR_VARSTORAGE_DATA VarStorageData,
OUT IFR_DEFAULT_DATA DefaultIdArray 
)

This function parses Form Package to get the block array and the default value array according to the request ConfigHdr.

Parameters
HiiHandleHii Handle for this hii package.
PackagePointer to the form package data.
PackageLengthLength of the package.
ConfigHdrRequest string ConfigHdr. If it is NULL, the first found varstore will be as ConfigHdr.
RequestBlockArrayThe block array is retrieved from the request string.
VarStorageDataVarStorage structure contains the got block and default value.
DefaultIdArrayPoint to the got default id and default name array.
Return values
EFI_SUCCESSThe block array and the default value array are got.
EFI_INVALID_PARAMETERThe varstore definition in the different form packages are conflicted.
EFI_OUT_OF_RESOURCESNo enough memory.

Definition at line 2159 of file ConfigRouting.c.

◆ RouteConfigRespForEfiVarStore()

EFI_STATUS RouteConfigRespForEfiVarStore ( IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL This,
IN EFI_IFR_VARSTORE_EFI EfiVarStoreInfo,
IN EFI_STRING  RequestResp,
OUT EFI_STRING *  Result 
)

This function route the full request resp string for efi varstore.

Parameters
ThisA pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance.
EfiVarStoreInfoThe efi varstore info which is save in the EFI varstore data structure.
RequestRespPointer to a null-terminated Unicode string in <ConfigResp> format.
ResultPointer to a null-terminated Unicode string in <ConfigResp> format.
Return values
EFI_SUCCESSThe Results string is set to the full request string. And AltCfgResp contains all default value string.
EFI_OUT_OF_RESOURCESNot enough memory for the return string.
EFI_INVALID_PARAMETERRequest points to NULL.

Definition at line 4570 of file ConfigRouting.c.

◆ UpdateBlockDataArray()

VOID UpdateBlockDataArray ( IN LIST_ENTRY BlockLink)

Update the default value in the block data which used as Bit VarStore

Parameters
BlockLinkThe Link of the block data.

Definition at line 3897 of file ConfigRouting.c.

◆ UpdateDefaultValue()

VOID UpdateDefaultValue ( IN LIST_ENTRY BlockLink)

Update the default value in the block data which is used as bit var store.

For example: A question value saved in a bit fied: bitoffset = 1; bitwidth = 2;default value = 1. And corresponding block data info: offset==0; width==1;currently the default value is saved as 1.Actually the default value 1 need to be set to bit field 1, so the default value of this block data shuold be:2.

typedef struct { UINT8 Bit1 : 1; // UINT8 Bit2 : 2; // Question saved in Bit2,so originalBlock info: offset = 0; width = 1;(byte level) defaul = 1. (default value record for the bit field) ...... }ExampleData;

After function UpdateDefaultValue,the Block info is: offset = 0; width = 1;(byte level) default = 2. (default value record for the Block)

UpdateDefaultValue function update default value of bit var block based on the bit field info in the block.

Parameters
BlockLinkThe Link of the block data.

Definition at line 3754 of file ConfigRouting.c.

Variable Documentation

◆ mPrivate

HII_DATABASE_PRIVATE_DATA mPrivate
extern

Definition at line 14 of file EsrtDxe.c.