TianoCore EDK2 master
|
#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_DATA * | GetBlockElement (IN EFI_STRING ConfigRequest, OUT EFI_STRING *Progress) |
IFR_BLOCK_DATA * | GetNameElement (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 |
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.
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.
MultiString | String 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. |
AppendString | NULL-terminated Unicode string. |
EFI_INVALID_PARAMETER | Any incoming parameter is invalid. |
EFI_SUCCESS | AppendString is append to the end of MultiString |
Definition at line 409 of file ConfigRouting.c.
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.
RequestBlockArray | The block array is to be checked. |
VarOffset | Offset of var to the structure |
VarWidth | Width of var. |
IsNameValueType | Whether this varstore is name/value varstore or not. |
HiiHandle | Hii handle for this hii package. |
TRUE | This Var is in the block range. |
FALSE | This Var is not in the block range. |
Definition at line 1529 of file ConfigRouting.c.
Calculate the number of Unicode characters of the incoming Configuration string, not including NULL terminator.
This is a internal function.
String | String in <MultiConfigRequest> or <MultiConfigResp> format. |
Definition at line 25 of file ConfigRouting.c.
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.
AltCfgResp | Pointer to a null-terminated Unicode string in <ConfigAltResp> format. |
DefaultAltCfgResp | Pointer 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. |
AltConfigHdr | Pointer to a Unicode string in <AltConfigHdr> format. |
EFI_OUT_OF_RESOURCES | Insufficient resources to store necessary structures. |
EFI_SUCCESS | The function finishes successfully. |
Definition at line 893 of file ConfigRouting.c.
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.
DefaultAltCfgResp | Pointer 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. |
ConfigAltResp | Pointer to a null-terminated Unicode string in <ConfigAltResp> format. |
AltConfigHdr | Pointer to a Unicode string in <AltConfigHdr> format. |
ConfigAltRespChanged | Whether the ConfigAltResp has been changed. |
EFI_OUT_OF_RESOURCES | Insufficient resources to store necessary structures. |
EFI_SUCCESS | The function finishes successfully. |
Definition at line 609 of file ConfigRouting.c.
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.
DefaultAltCfgResp | Pointer 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. |
ConfigAltResp | Pointer to a null-terminated Unicode string in <ConfigAltResp> format. |
AltConfigHdr | Pointer to a Unicode string in <AltConfigHdr> format. |
ConfigAltRespChanged | Whether the ConfigAltResp has been changed. |
EFI_OUT_OF_RESOURCES | Insufficient resources to store necessary structures. |
EFI_SUCCESS | The function finishes successfully. |
Definition at line 756 of file ConfigRouting.c.
CHAR16 * ConfigRequestValidate | ( | CHAR16 * | ConfigRequest | ) |
Validate the config request string.
ConfigRequest | A null-terminated Unicode string in <ConfigRequest> format. |
CHAR16 | * THE first element not correct. |
NULL | Success parse the name/value pair |
Definition at line 4726 of file ConfigRouting.c.
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.
String | Pointer to a Null-terminated Unicode string. |
BlockName | Pointer to a Null-terminated Unicode string to search for. |
Buffer | Pointer to the value correspond to the BlockName. |
Found | The Block whether has been found. |
BufferLen | The length of the buffer. |
EFI_OUT_OF_RESOURCES | Insufficient resources to store necessary structures. |
EFI_SUCCESS | The function finishes successfully. |
Definition at line 551 of file ConfigRouting.c.
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.
HiiHandle | Hii Handle for this hii package. |
ConfigHdr | The config header for this varstore. |
VarStorageData | The varstore info. |
DefaultIdArray | The Default id array. |
DefaultAltCfgResp | The DefaultAltCfgResp info may be return. |
TRUE | Need to continue |
Others | NO need to continue or error occur. |
Definition at line 3952 of file ConfigRouting.c.
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.
ConfigHdr | The config header for this varstore. |
VarStorageData | The varstore info. |
Status | Return Status. |
ConfigRequest | The ConfigRequest info may be return. |
TRUE | Need to continue |
Others | NO need to continue or error occur. |
Definition at line 3521 of file ConfigRouting.c.
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.
VarStorageData | The varstore info. |
DevicePath | Device path for this varstore. |
ConfigHdr | The config header for this varstore. |
EFI_SUCCESS | Generate the header success. |
EFI_OUT_OF_RESOURCES | Allocate buffer fail. |
Definition at line 3655 of file ConfigRouting.c.
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.
String | A constant string which is the prefix of the to be generated string, e.g. GUID= |
BufferLen | The length of the Buffer in bytes. |
Buffer | Points to a buffer which will be converted to be the content of the generated string. |
Flag | If 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. |
SubStr | Points to the output string. It's caller's responsibility to free this buffer. |
Definition at line 222 of file ConfigRouting.c.
IFR_BLOCK_DATA * GetBlockElement | ( | IN EFI_STRING | ConfigRequest, |
OUT EFI_STRING * | Progress | ||
) |
parse the configrequest string, get the elements.
ConfigRequest | The input configrequest string. |
Progress | Return the progress data. |
Block | data pointer. |
Definition at line 3231 of file ConfigRouting.c.
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.
This | A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance. |
EfiVarStoreInfo | The efi varstore info which is save in the EFI varstore data structure. |
Request | Pointer to a null-terminated Unicode string in <ConfigRequest> format. |
RequestResp | Pointer to a null-terminated Unicode string in <ConfigResp> format. |
AccessProgress | 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. |
EFI_SUCCESS | The Results string is set to the full request string. And AltCfgResp contains all default value string. |
EFI_OUT_OF_RESOURCES | Not enough memory for the return string. |
EFI_INVALID_PARAMETER | Request points to NULL. |
Definition at line 4493 of file ConfigRouting.c.
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.
String | UEFI configuration string |
DevicePathData | Binary of a UEFI device path. |
EFI_NOT_FOUND | The device path is not invalid. |
EFI_INVALID_PARAMETER | Any incoming parameter is invalid. |
EFI_OUT_OF_RESOURCES | Lake of resources to store necessary structures. |
EFI_SUCCESS | The device path is retrieved and translated to binary format. |
Definition at line 66 of file ConfigRouting.c.
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.
ConfigRequest | The input config request string. |
TRUE | The input include config request elements. |
FALSE | The input string not includes. |
Definition at line 1797 of file ConfigRouting.c.
EFI_STATUS GetFormPackageData | ( | IN HII_DATABASE_RECORD * | DataBaseRecord, |
IN OUT UINT8 ** | HiiFormPackage, | ||
OUT UINTN * | PackageSize | ||
) |
Get form package data from data base.
DataBaseRecord | The DataBaseRecord instance contains the found Hii handle and package. |
HiiFormPackage | The buffer saves the package data. |
PackageSize | The buffer size of the package data. |
Definition at line 1583 of file ConfigRouting.c.
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.
DataBaseRecord | The DataBaseRecord instance contains the found Hii handle and package. |
DevicePath | Device Path which Hii Config Access Protocol is registered. |
Request | Pointer 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. |
AltCfgResp | Pointer 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. |
PointerProgress | Optional 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. |
EFI_SUCCESS | The Results string is set to the full request string. And AltCfgResp contains all default value string. |
EFI_OUT_OF_RESOURCES | Not enough memory for the return string. |
EFI_NOT_FOUND | The varstore (Guid and Name) in Request string can't be found in Form package. |
EFI_NOT_FOUND | HiiPackage can't be got on the input HiiHandle. |
EFI_INVALID_PARAMETER | Request points to NULL. |
Definition at line 4186 of file ConfigRouting.c.
IFR_BLOCK_DATA * GetNameElement | ( | IN EFI_STRING | ConfigRequest, |
OUT EFI_STRING * | Progress | ||
) |
parse the configrequest string, get the elements.
ConfigRequest | The input config request string. |
Progress | Return the progress data. |
return | data block array. |
Definition at line 3409 of file ConfigRouting.c.
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().
[in] | HiiHandle | A handle that was previously registered in the HII Database. |
NULL | HiiHandle is not registered in the HII database |
NULL | There are not enough resources available to retrieve the supported languages. |
NULL | The list of supported languages could not be retrieved. |
Other | A pointer to the Null-terminated ASCII string of supported languages. |
Definition at line 1315 of file ConfigRouting.c.
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.
StringPtr | String in <BlockConfig> format and points to the first character of <Number>. |
Number | The output value. Caller takes the responsibility to free memory. |
Len | Length of the <Number>, in characters. |
EFI_OUT_OF_RESOURCES | Insufficient resources to store necessary structures. |
EFI_SUCCESS | Value of <Number> is outputted in Number successfully. |
Definition at line 469 of file ConfigRouting.c.
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.
DataBaseRecord | The DataBaseRecord instance contains the found Hii handle and package. |
ConfigHdr | Request string ConfigHdr. If it is NULL, the first found varstore will be as ConfigHdr. |
IsEfiVarstore | Whether the request storage type is efi varstore type. |
EfiVarStore | The efi varstore info which will return. |
Definition at line 1654 of file ConfigRouting.c.
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.
This | A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance. |
ConfigRequest | A null-terminated Unicode string in <ConfigRequest> format. |
Block | Array of bytes defining the block's configuration. |
BlockSize | Length in bytes of Block. |
Config | Filled-in configuration string. String allocated by the function. Returned only if call is successful. It is <ConfigResp> string format. |
Progress | A 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. |
EFI_SUCCESS | The request succeeded. Progress points to the null terminator at the end of the ConfigRequest string. |
EFI_OUT_OF_RESOURCES | Not enough memory to allocate Config. Progress points to the first character of ConfigRequest. |
EFI_INVALID_PARAMETER | Passing 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_ERROR | Block not large enough. Progress undefined. |
EFI_INVALID_PARAMETER | Encountered 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.
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.
This | A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance. |
Results | Null-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. |
EFI_SUCCESS | The Results string is filled with the values corresponding to all requested names. |
EFI_OUT_OF_RESOURCES | Not enough memory to store the parts of the results that must be stored awaiting possible future protocols. |
EFI_INVALID_PARAMETER | For example, passing in a NULL for the Results parameter would result in this type of error. |
Definition at line 5226 of file ConfigRouting.c.
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.
This | A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance. |
Request | A null-terminated Unicode string in <MultiConfigRequest> format. |
Progress | 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. |
Results | Null-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. |
EFI_SUCCESS | The Results string is filled with the values corresponding to all requested names. |
EFI_OUT_OF_RESOURCES | Not enough memory to store the parts of the results that must be stored awaiting possible future protocols. |
EFI_NOT_FOUND | Routing 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_PARAMETER | For 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_PARAMETER | Illegal syntax. Progress set to most recent & before the error or the beginning of the string. |
EFI_INVALID_PARAMETER | The 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.
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.
This | A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance. |
Configuration | A null-terminated Unicode string in <MulltiConfigResp> format. |
Progress | A 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. |
EFI_SUCCESS | The results have been distributed or are awaiting distribution. |
EFI_OUT_OF_RESOURCES | Not enough memory to store the parts of the results that must be stored awaiting possible future protocols. |
EFI_INVALID_PARAMETER | Passing in a NULL for the Configuration parameter would result in this type of error. |
EFI_NOT_FOUND | Target for the specified routing data was not found. |
Definition at line 5433 of file ConfigRouting.c.
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.
This | A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance. |
ConfigResp | A null-terminated Unicode string in <ConfigResp> format. |
Block | A 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. |
BlockSize | The 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. |
Progress | On 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. |
EFI_SUCCESS | The request succeeded. Progress points to the null terminator at the end of the ConfigResp string. |
EFI_OUT_OF_RESOURCES | Not enough memory to allocate Config. Progress points to the first character of ConfigResp. |
EFI_INVALID_PARAMETER | Passing 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_PARAMETER | Encountered non <BlockName> formatted name / value pair. Block is left updated and Progress points at the '&' preceding the first non-<BlockName>. |
EFI_BUFFER_TOO_SMALL | Block not large enough. Progress undefined. BlockSize is updated with the required buffer size. |
EFI_NOT_FOUND | Target 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.
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.
This | A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance. |
Configuration | A null-terminated Unicode string in <MultiConfigAltResp> format. |
Guid | A 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. |
Name | A 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. |
DevicePath | A 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. |
AltCfgId | A 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. |
AltCfgResp | A 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. |
EFI_SUCCESS | The request succeeded. The requested data was extracted and placed in the newly allocated AltCfgResp buffer. |
EFI_OUT_OF_RESOURCES | Not enough memory to allocate AltCfgResp. |
EFI_INVALID_PARAMETER | Any parameter is invalid. |
EFI_NOT_FOUND | Target for the specified routing data was not found. |
Definition at line 6229 of file ConfigRouting.c.
VOID EFIAPI HiiToLower | ( | IN EFI_STRING | ConfigString | ) |
Converts the unicode character of the string from uppercase to lowercase. This is a internal function.
ConfigString | String to be converted |
Definition at line 174 of file ConfigRouting.c.
VOID InsertBlockData | ( | IN LIST_ENTRY * | BlockLink, |
IN IFR_BLOCK_DATA ** | BlockData | ||
) |
This function inserts new BlockData into the block link
BlockLink | The list entry points to block array. |
BlockData | The point to BlockData is added. |
Definition at line 1240 of file ConfigRouting.c.
VOID InsertDefaultValue | ( | IN IFR_BLOCK_DATA * | BlockData, |
IN IFR_DEFAULT_DATA * | DefaultValueData | ||
) |
This function inserts new DefaultValueData into the BlockData DefaultValue array.
BlockData | The BlockData is updated to add new default value. |
DefaultValueData | The DefaultValue is added. |
Definition at line 1192 of file ConfigRouting.c.
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.
[in] | HiiHandle | A handle that was previously registered in the HII Database. |
[in] | StringId | The identifier of the string to retrieved from the string package associated with HiiHandle. |
NULL | The string specified by StringId is not present in the string package. |
Other | The string was returned. |
Definition at line 1389 of file ConfigRouting.c.
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.
RequestBlockArray | The array includes all the request info or NULL. |
HiiHandle | The hii handle for this form package. |
VarStorageData | The varstore data structure. |
IfrOpHdr | Ifr opcode header for this opcode. |
VarWidth | The buffer width for this opcode. |
ReturnData | The data block added for this opcode. |
IsBitVar | Whether the the opcode refers to bit storage. |
EFI_SUCCESS | This opcode is required. |
EFI_NOT_FOUND | This opcode is not required. |
Others | Contain some error. |
Definition at line 2038 of file ConfigRouting.c.
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.
DataBaseRecord | The DataBaseRecord instance contains the found Hii handle and package. |
ConfigHdr | Request string ConfigHdr. If it is NULL, the first found varstore will be as ConfigHdr. |
TRUE | This hii package is the request one. |
FALSE | This hii package is not the request one. |
Definition at line 1895 of file ConfigRouting.c.
Check whether the this varstore is the request varstore.
VarstoreGuid | Varstore guid. |
Name | Varstore name. |
ConfigHdr | Current configRequest info. |
TRUE | This varstore is the request one. |
FALSE | This varstore is not the request one. |
Definition at line 1825 of file ConfigRouting.c.
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.
FirstBlock | Point to the block date whose default value need to be merged. |
SecondBlock | Point to the block date whose default value need to be merged. |
Definition at line 3834 of file ConfigRouting.c.
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.
AltCfgResp | Pointer to a null-terminated Unicode string in <ConfigAltResp> format. The default value string will be merged into it. |
DefaultAltCfgResp | Pointer 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. |
EFI_SUCCESS | The merged string returns. |
EFI_INVALID_PARAMETER | *AltCfgResp is to NULL. |
Definition at line 1050 of file ConfigRouting.c.
CHAR16 * NameValueValidate | ( | CHAR16 * | ConfigElements | ) |
Validate the config request elements.
ConfigElements | A null-terminated Unicode string in <ConfigRequest> format, without configHdr field. |
CHAR16 | * THE first Name/value pair not correct. |
NULL | Success parse the name/value pair |
Definition at line 4691 of file ConfigRouting.c.
CHAR16 * OffsetWidthValidate | ( | CHAR16 * | ConfigElements | ) |
Validate the config request elements.
ConfigElements | A null-terminated Unicode string in <ConfigRequest> format, without configHdr field. |
CHAR16 | * THE first Name/value pair not correct. |
NULL | Success parse the name/value pair |
Definition at line 4646 of file ConfigRouting.c.
EFI_STATUS OutputConfigBody | ( | IN EFI_STRING | String, |
OUT EFI_STRING * | ConfigBody | ||
) |
Retrieve the <ConfigBody> from String then output it.
This is a internal function.
String | A sub string of a configuration string in <MultiConfigAltResp> format. |
ConfigBody | Points to the output string. It's caller's responsibility to free this buffer. |
EFI_INVALID_PARAMETER | There is no form package in current hii database. |
EFI_OUT_OF_RESOURCES | Not enough memory to finish this operation. |
EFI_SUCCESS | All existing storage is exported. |
Definition at line 343 of file ConfigRouting.c.
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.
HiiHandle | Hii Handle for this hii package. |
Package | Pointer to the form package data. |
PackageLength | Length of the package. |
ConfigHdr | Request string ConfigHdr. If it is NULL, the first found varstore will be as ConfigHdr. |
RequestBlockArray | The block array is retrieved from the request string. |
VarStorageData | VarStorage structure contains the got block and default value. |
DefaultIdArray | Point to the got default id and default name array. |
EFI_SUCCESS | The block array and the default value array are got. |
EFI_INVALID_PARAMETER | The varstore definition in the different form packages are conflicted. |
EFI_OUT_OF_RESOURCES | No enough memory. |
Definition at line 2159 of file ConfigRouting.c.
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.
This | A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance. |
EfiVarStoreInfo | The efi varstore info which is save in the EFI varstore data structure. |
RequestResp | Pointer to a null-terminated Unicode string in <ConfigResp> format. |
Result | Pointer to a null-terminated Unicode string in <ConfigResp> format. |
EFI_SUCCESS | The Results string is set to the full request string. And AltCfgResp contains all default value string. |
EFI_OUT_OF_RESOURCES | Not enough memory for the return string. |
EFI_INVALID_PARAMETER | Request points to NULL. |
Definition at line 4570 of file ConfigRouting.c.
VOID UpdateBlockDataArray | ( | IN LIST_ENTRY * | BlockLink | ) |
Update the default value in the block data which used as Bit VarStore
BlockLink | The Link of the block data. |
Definition at line 3897 of file ConfigRouting.c.
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.
BlockLink | The Link of the block data. |
Definition at line 3754 of file ConfigRouting.c.
|
extern |