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

Go to the source code of this file.

Data Structures

struct  _EFI_HII_CONFIG_ROUTING_PROTOCOL
 

Macros

#define EFI_HII_CONFIG_ROUTING_PROTOCOL_GUID    { 0x587e72d7, 0xcc50, 0x4f79, { 0x82, 0x09, 0xca, 0x29, 0x1f, 0xc1, 0xa1, 0x0f } }
 

Typedefs

typedef struct _EFI_HII_CONFIG_ROUTING_PROTOCOL EFI_HII_CONFIG_ROUTING_PROTOCOL
 
typedef EFI_STATUS(EFIAPI * EFI_HII_EXTRACT_CONFIG) (IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, IN CONST EFI_STRING Request, OUT EFI_STRING *Progress, OUT EFI_STRING *Results)
 
typedef EFI_STATUS(EFIAPI * EFI_HII_EXPORT_CONFIG) (IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, OUT EFI_STRING *Results)
 
typedef EFI_STATUS(EFIAPI * EFI_HII_ROUTE_CONFIG) (IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, IN CONST EFI_STRING Configuration, OUT EFI_STRING *Progress)
 
typedef EFI_STATUS(EFIAPI * EFI_HII_BLOCK_TO_CONFIG) (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)
 
typedef EFI_STATUS(EFIAPI * EFI_HII_CONFIG_TO_BLOCK) (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)
 
typedef EFI_STATUS(EFIAPI * EFI_HII_GET_ALT_CFG) (IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, IN CONST EFI_STRING ConfigResp, 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

EFI_GUID gEfiHiiConfigRoutingProtocolGuid
 

Detailed Description

The file provides services to manage the movement of configuration data from drivers to configuration applications. It then serves as the single point to receive configuration information from configuration applications, routing the results to the appropriate drivers.

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

Revision Reference:
This Protocol was introduced in UEFI Specification 2.1.

Definition in file HiiConfigRouting.h.

Macro Definition Documentation

◆ EFI_HII_CONFIG_ROUTING_PROTOCOL_GUID

#define EFI_HII_CONFIG_ROUTING_PROTOCOL_GUID    { 0x587e72d7, 0xcc50, 0x4f79, { 0x82, 0x09, 0xca, 0x29, 0x1f, 0xc1, 0xa1, 0x0f } }

Definition at line 20 of file HiiConfigRouting.h.

Typedef Documentation

◆ EFI_HII_BLOCK_TO_CONFIG

typedef EFI_STATUS(EFIAPI * EFI_HII_BLOCK_TO_CONFIG) (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 function extracts the current configuration from a block of bytes. To do so, it requires that the ConfigRequest string consists of a list of <BlockName> formatted names. It uses the offset in the name to determine the index into the Block to start the extraction and the width of each name to determine the number of bytes to extract. These are mapped to a string using the equivalent of the C "%x" format (with optional leading spaces). The call fails if, for any (offset, width) pair in ConfigRequest, offset+value >= BlockSize.

Parameters
ThisPoints to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance.
ConfigRequestA null-terminated string in <ConfigRequest> format.
BlockAn array of bytes defining the block's configuration.
BlockSizeThe length in bytes of Block.
ConfigThe filled-in configuration string. String allocated by the function. Returned only if call is successful. The null-terminated string will be <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 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_PARAMETERSPassing 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_NOT_FOUNDThe target for the specified routing data was not found. Progress points to the 'G' in "GUID" of the errant routing data.
EFI_DEVICE_ERRORThe block is 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 266 of file HiiConfigRouting.h.

◆ EFI_HII_CONFIG_ROUTING_PROTOCOL

◆ EFI_HII_CONFIG_TO_BLOCK

typedef EFI_STATUS(EFIAPI * EFI_HII_CONFIG_TO_BLOCK) (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 function maps a configuration containing a series of <BlockConfig> formatted name value pairs in ConfigResp into a Block so it may be stored in a linear mapped storage such as a UEFI Variable. If present, the function skips GUID, NAME, and PATH in <ConfigResp>. It stops when it finds a non-<BlockConfig> name / value pair (after skipping the routing header) or when it reaches the end of the string. Example Assume an existing block containing: 00 01 02 03 04 05 And the ConfigResp string is: OFFSET=4&WIDTH=1&VALUE=7&OFFSET=0&WIDTH=2&VALUE=AA55 The results are 55 AA 02 07 04 05

Parameters
ThisPoints to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance.
ConfigRespA null-terminated 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 BlockLength 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_DEVICE_ERRORBlock not large enough. Progress undefined.
EFI_NOT_FOUNDTarget for the specified routing data was not found. Progress points to the "G" in "GUID" of the errant routing data.
EFI_BUFFER_TOO_SMALLBlock not large enough. Progress undefined. BlockSize is updated with the required buffer size.

Definition at line 341 of file HiiConfigRouting.h.

◆ EFI_HII_EXPORT_CONFIG

typedef EFI_STATUS(EFIAPI * EFI_HII_EXPORT_CONFIG) (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 string.

This function allows the caller to request the current configuration for all of the current HII database. The results include both the current and alternate configurations as described in ExtractConfig() above.

Parameters
ThisPoints 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_PARAMETERSFor example, passing in a NULL for the Results parameter would result in this type of error.

Definition at line 151 of file HiiConfigRouting.h.

◆ EFI_HII_EXTRACT_CONFIG

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

This function allows the caller to request the current configuration for one or more named elements from one or more drivers. The resulting string is in the standard HII configuration string format. If Successful, Results contains an equivalent string with "=" and the values associated with all names added in. The expected implementation is for each <ConfigRequest> substring in the Request to call the HII Configuration Routing Protocol ExtractProtocol function for the driver corresponding to the <ConfigHdr> at the start of the <ConfigRequest> substring. The request fails if no driver matches the <ConfigRequest> substring. Note: Alternative configuration strings may also be appended to the end of the current configuration string. If they are, they must appear after the current configuration. They must contain the same routing (GUID, NAME, PATH) as the current configuration string. They must have an additional description indicating the type of alternative configuration the string represents, "ALTCFG=<StringToken>". That <StringToken> (when converted from hexadecimal (encoded as text) to binary) is a reference to a string in the associated string pack. As an example, assume that the Request string is: GUID=...&NAME=00480050&PATH=...&Fred&George&Ron&Neville A result might be: GUID=...&NAME=00480050&PATH=...&Fred=16&George=16&Ron=12&Neville=11& GUID=...&NAME=00480050&PATH=...&ALTCFG=0037&Fred=12&Neville=7

Parameters
ThisPoints to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance.
RequestA null-terminated string in <MultiConfigRequest> format.
ProgressOn return, points to a character in the Request string. Points to the string's null terminator if the 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 string in <MultiConfigAltResp> format which has all values filled in for the names in the Request string.
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 Request parameter would result in this type of error. The Progress parameter is set to NULL.
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_PARAMETERIllegal syntax. Progress set to the 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 109 of file HiiConfigRouting.h.

◆ EFI_HII_GET_ALT_CFG

typedef EFI_STATUS(EFIAPI * EFI_HII_GET_ALT_CFG) (IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, IN CONST EFI_STRING ConfigResp, 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.
ConfigRespA null-terminated string in <ConfigAltResp> 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. The null-terminated string will be <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_FOUNDThe target for the specified routing data was not found.

Definition at line 384 of file HiiConfigRouting.h.

◆ EFI_HII_ROUTE_CONFIG

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

This function routes the results of processing forms to the appropriate targets. It scans for <ConfigHdr> within the string and passes the header and subsequent body to the driver whose location is described in the <ConfigHdr>. Many <ConfigHdr>s may appear as a single request. The expected implementation is to hand off the various <ConfigResp> substrings to the Configuration Access Protocol RouteConfig routine corresponding to the driver whose routing information is defined by the <ConfigHdr> in turn.

Parameters
ThisPoints to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance.
ConfigurationA null-terminated 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_PARAMETERSPassing in a NULL for the Results parameter would result in this type of error.
EFI_NOT_FOUNDThe target for the specified routing data was not found.

Definition at line 197 of file HiiConfigRouting.h.