+++ /dev/null
-/*++\r
-\r
-Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-\r
-Module Name:\r
- \r
- HiiConfigRouting.h\r
-\r
-Abstract:\r
-\r
- EFI_HII_CONFIG_ROUTING_PROTOCOL as defined in UEFI 2.1 spec.\r
-\r
---*/\r
-\r
-#ifndef __EFI_HII_CONFIG_ROUTING_H__\r
-#define __EFI_HII_CONFIG_ROUTING_H__\r
-\r
-#include "EfiHii.h"\r
-\r
-#define EFI_HII_CONFIG_ROUTING_PROTOCOL_GUID \\r
- { \\r
- 0x587e72d7, 0xcc50, 0x4f79, {0x82, 0x09, 0xca, 0x29, 0x1f, 0xc1, 0xa1, 0x0f} \\r
- }\r
-\r
-//\r
-// Forward reference for pure ANSI compatability\r
-//\r
-EFI_FORWARD_DECLARATION (EFI_HII_CONFIG_ROUTING_PROTOCOL);\r
-\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_HII_EXTRACT_CONFIG) (\r
- IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r
- IN CONST EFI_STRING Request,\r
- OUT EFI_STRING *Progress,\r
- OUT EFI_STRING *Results\r
- )\r
-/*++\r
-\r
- Routine Description:\r
- This function allows a caller to extract the current configuration \r
- for one or more named elements from one or more drivers.\r
- \r
- Arguments: \r
- This - A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance.\r
- Request - A null-terminated Unicode string in <MultiConfigRequest> format.\r
- Progress - On return, points to a character in the Request string. Points to the string's null \r
- terminator if request was successful. Points to the most recent '&' before the first \r
- failing name / value pair (or the beginning of the string if the failure is in the first\r
- name / value pair) if the request was not successful.\r
- Results - Null-terminated Unicode string in <MultiConfigAltResp> format which has all \r
- values filled in for the names in the Request string. String to be allocated by the called\r
- function. \r
- \r
- Returns: \r
- EFI_SUCCESS - The Results string is filled with the values\r
- corresponding to all requested names. \r
- EFI_OUT_OF_RESOURCES - Not enough memory to store the parts of the results\r
- that must be stored awaiting possible future \r
- protocols. \r
- EFI_NOT_FOUND - Routing data doesn't match any known driver. \r
- Progress set to the 'G' in "GUID" of the routing \r
- header that doesn't match. Note: There is no \r
- requirement that all routing data be validated before\r
- any configuration extraction. \r
- EFI_INVALID_PARAMETER - For example, passing in a NULL for the Request \r
- parameter would result in this type of error. The\r
- Progress parameter is set to NULL. \r
- \r
- EFI_INVALID_PARAMETER - Illegal syntax. Progress set to most recent & before\r
- the error or the beginning of the string. \r
- \r
- EFI_INVALID_PARAMETER - Unknown name. Progress points to the & before\r
- the name in question. \r
- \r
---*/ \r
-;\r
- \r
-typedef\r
-EFI_STATUS \r
-(EFIAPI *EFI_HII_EXPORT_CONFIG) (\r
- IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r
- OUT EFI_STRING *Results\r
- )\r
-/*++\r
-\r
- Routine Description:\r
- This function allows the caller to request the current configuration for the \r
- entirety of the current HII database and returns the data in a null-terminated Unicode string. \r
- \r
- Arguments: \r
- This - A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance. \r
- Results - Null-terminated Unicode string in <MultiConfigAltResp> format which has all \r
- values filled in for the names in the Request string. String to be allocated by the called\r
- function. De-allocation is up to the caller. \r
- \r
- Returns: \r
- EFI_SUCCESS - The Results string is filled with the values\r
- corresponding to all requested names. \r
- EFI_OUT_OF_RESOURCES - Not enough memory to store the parts of the results\r
- that must be stored awaiting possible future \r
- protocols. \r
- EFI_INVALID_PARAMETER - For example, passing in a NULL for the Results\r
- parameter would result in this type of error. \r
- \r
---*/ \r
-; \r
-\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_HII_ROUTE_CONFIG) (\r
- IN EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r
- IN CONST EFI_STRING Configuration,\r
- OUT EFI_STRING *Progress\r
- )\r
-/*++\r
-\r
- Routine Description:\r
- This function processes the results of processing forms and routes it to the \r
- appropriate handlers or storage.\r
- \r
- Arguments: \r
- This - A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance. \r
- Configuration - A null-terminated Unicode string in <MulltiConfigResp> format.\r
- Progress - A pointer to a string filled in with the offset of the most recent "&" before the first\r
- failing name / value pair (or the beginning of the string if the failure is in the first \r
- name / value pair) or the terminating NULL if all was successful. \r
- \r
- Returns: \r
- EFI_SUCCESS - The results have been distributed or are awaiting\r
- distribution. \r
- EFI_OUT_OF_RESOURCES - Not enough memory to store the parts of the results\r
- that must be stored awaiting possible future \r
- protocols. \r
- EFI_INVALID_PARAMETER - Passing in a NULL for the Configuration\r
- parameter would result in this type of error. \r
- EFI_NOT_FOUND - Target for the specified routing data was not found. \r
- \r
---*/ \r
-; \r
- \r
-\r
-typedef\r
-EFI_STATUS \r
-(EFIAPI *EFI_HII_BLOCK_TO_CONFIG) (\r
- IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r
- IN CONST EFI_STRING ConfigRequest,\r
- IN CONST UINT8 *Block,\r
- IN CONST UINTN BlockSize,\r
- OUT EFI_STRING *Config,\r
- OUT EFI_STRING *Progress\r
- )\r
-/*++\r
-\r
- Routine Description:\r
- This helper function is to be called by drivers to map configuration data stored\r
- in byte array ("block") formats such as UEFI Variables into current configuration strings.\r
- \r
- Arguments: \r
- This - A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance. \r
- ConfigRequest - A null-terminated Unicode string in <ConfigRequest> format.\r
- Block - Array of bytes defining the block's configuration.\r
- BlockSize - Length in bytes of Block.\r
- Config - Filled-in configuration string. String allocated by the function. \r
- Returned only if call is successful. \r
- Progress - A pointer to a string filled in with the offset of the most recent "&" before the first\r
- failing name / value pair (or the beginning of the string if the failure is in the first \r
- name / value pair) or the terminating NULL if all was successful. \r
- \r
- Returns: \r
- EFI_SUCCESS - The request succeeded. Progress points to the null\r
- terminator at the end of the ConfigRequest \r
- string. \r
- EFI_OUT_OF_RESOURCES - Not enough memory to allocate Config. \r
- Progress points to the first character of\r
- ConfigRequest. \r
- EFI_INVALID_PARAMETER - Passing in a NULL for the ConfigRequest or \r
- Block parameter would result in this type of \r
- error. Progress points to the first character of\r
- ConfigRequest. \r
- EFI_NOT_FOUND - Target for the specified routing data was not found.\r
- Progress points to the "G" in "GUID" of the \r
- errant routing data. \r
- EFI_DEVICE_ERROR - Block not large enough. Progress undefined.\r
- EFI_INVALID_PARAMETER - Encountered non <BlockName> formatted string. \r
- Block is left updated and Progress points at the "&"\r
- preceding the first non-<BlockName>. \r
- \r
---*/ \r
-;\r
-\r
-typedef\r
-EFI_STATUS \r
-(EFIAPI *EFI_HII_CONFIG_TO_BLOCK) (\r
- IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r
- IN CONST EFI_STRING ConfigResp,\r
- IN OUT UINT8 *Block,\r
- IN OUT UINTN *BlockSize,\r
- OUT EFI_STRING *Progress\r
- )\r
-/*++\r
-\r
- Routine Description:\r
- This helper function is to be called by drivers to map configuration strings \r
- to configurations stored in byte array ("block") formats such as UEFI Variables.\r
- \r
- Arguments: \r
- This - A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance. \r
- ConfigResp - A null-terminated Unicode string in <ConfigResp> format.\r
- Block - A possibly null array of bytes representing the current block. \r
- Only bytes referenced in the ConfigResp string in the block are modified. \r
- If this parameter is null or if the *BlockSize parameter is (on input) \r
- shorter than required by the Configuration string, only the BlockSize \r
- parameter is updated and an appropriate status (see below) is returned. \r
- \r
- BlockSize - The length of the Block in units of UINT8. On input, this is the size of the Block.\r
- On output, if successful, contains the index of the last modified byte in the Block.\r
- \r
- Progress - On return, points to an element of the ConfigResp string filled in with the offset of \r
- the most recent "&" before the first failing name / value pair (or the beginning of the \r
- string if the failure is in the first name / value pair) or the terminating NULL if all was\r
- successful. \r
- Returns: \r
- EFI_SUCCESS - The request succeeded. Progress points to the null\r
- terminator at the end of the ConfigResp\r
- string. \r
- EFI_OUT_OF_RESOURCES - Not enough memory to allocate Config. \r
- Progress points to the first character of\r
- ConfigResp. \r
- EFI_INVALID_PARAMETER - Passing in a NULL for the ConfigResp or \r
- Block parameter would result in this type of error.\r
- Progress points to the first character of \r
- ConfigResp. \r
- EFI_NOT_FOUND - Target for the specified routing data was not found.\r
- Progress points to the "G" in "GUID" of the \r
- errant routing data. \r
- EFI_INVALID_PARAMETER - Encountered non <BlockName> formatted name / \r
- value pair. Block is left updated and \r
- Progress points at the "&" preceding the first\r
- non-<BlockName>. \r
- \r
---*/ \r
-;\r
-\r
-typedef\r
-EFI_STATUS \r
-(EFIAPI * EFI_HII_GET_ALT_CFG) (\r
- IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, \r
- IN CONST EFI_STRING Configuration, \r
- IN CONST EFI_GUID *Guid, \r
- IN CONST EFI_STRING Name, \r
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, \r
- IN CONST UINT16 *AltCfgId,\r
- OUT EFI_STRING *AltCfgResp \r
- )\r
-/*++\r
-\r
- Routine Description:\r
- This helper function is to be called by drivers to extract portions of \r
- a larger configuration string.\r
- \r
- Arguments: \r
- This - A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance. \r
- Configuration - A null-terminated Unicode string in <MultiConfigAltResp> format.\r
- Guid - A pointer to the GUID value to search for in the \r
- routing portion of the ConfigResp string when retrieving \r
- the requested data. If Guid is NULL, then all GUID \r
- values will be searched for.\r
- Name - A pointer to the NAME value to search for in the \r
- routing portion of the ConfigResp string when retrieving \r
- the requested data. If Name is NULL, then all Name \r
- values will be searched for. \r
- DevicePath - A pointer to the PATH value to search for in the \r
- routing portion of the ConfigResp string when retrieving \r
- the requested data. If DevicePath is NULL, then all \r
- DevicePath values will be searched for. \r
- AltCfgId - A pointer to the ALTCFG value to search for in the \r
- routing portion of the ConfigResp string when retrieving \r
- the requested data. If this parameter is NULL, \r
- then the current setting will be retrieved.\r
- AltCfgResp - A pointer to a buffer which will be allocated by the \r
- function which contains the retrieved string as requested. \r
- This buffer is only allocated if the call was successful. \r
- \r
- Returns: \r
- EFI_SUCCESS - The request succeeded. The requested data was extracted \r
- and placed in the newly allocated AltCfgResp buffer.\r
- EFI_OUT_OF_RESOURCES - Not enough memory to allocate AltCfgResp. \r
- EFI_INVALID_PARAMETER - Any parameter is invalid.\r
- EFI_NOT_FOUND - Target for the specified routing data was not found.\r
- \r
---*/ \r
-;\r
-\r
-\r
-struct _EFI_HII_CONFIG_ROUTING_PROTOCOL {\r
- EFI_HII_EXTRACT_CONFIG ExtractConfig;\r
- EFI_HII_EXPORT_CONFIG ExportConfig;\r
- EFI_HII_ROUTE_CONFIG RouteConfig;\r
- EFI_HII_BLOCK_TO_CONFIG BlockToConfig;\r
- EFI_HII_CONFIG_TO_BLOCK ConfigToBlock;\r
- EFI_HII_GET_ALT_CFG GetAltConfig;\r
-};\r
-\r
-extern EFI_GUID gEfiHiiConfigRoutingProtocolGuid;\r
-\r
-#endif\r