2015-05-13 10:33:20 +02:00
|
|
|
/** @file
|
2018-06-27 15:11:33 +02:00
|
|
|
The file provides the mechanism to set and get the values
|
|
|
|
associated with a keyword exposed through a x-UEFI- prefixed
|
2015-05-13 10:33:20 +02:00
|
|
|
configuration language namespace.
|
2018-06-27 15:11:33 +02:00
|
|
|
|
|
|
|
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
|
|
|
|
This program and the accompanying materials are licensed and made available under
|
|
|
|
the terms and conditions of the BSD License that accompanies this distribution.
|
2015-05-13 10:33:20 +02:00
|
|
|
The full text of the license may be found at
|
2018-06-27 15:11:33 +02:00
|
|
|
http://opensource.org/licenses/bsd-license.php.
|
|
|
|
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
2015-05-13 10:33:20 +02:00
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef __EFI_CONFIG_KEYWORD_HANDLER_H__
|
|
|
|
#define __EFI_CONFIG_KEYWORD_HANDLER_H__
|
|
|
|
|
|
|
|
#define EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL_GUID \
|
|
|
|
{ \
|
|
|
|
0x0a8badd5, 0x03b8, 0x4d19, {0xb1, 0x28, 0x7b, 0x8f, 0x0e, 0xda, 0xa5, 0x96 } \
|
|
|
|
}
|
|
|
|
|
|
|
|
//***********************************************************
|
|
|
|
// Progress Errors
|
|
|
|
//***********************************************************
|
|
|
|
#define KEYWORD_HANDLER_NO_ERROR 0x00000000
|
|
|
|
#define KEYWORD_HANDLER_NAMESPACE_ID_NOT_FOUND 0x00000001
|
|
|
|
#define KEYWORD_HANDLER_MALFORMED_STRING 0x00000002
|
|
|
|
#define KEYWORD_HANDLER_KEYWORD_NOT_FOUND 0x00000004
|
|
|
|
#define KEYWORD_HANDLER_INCOMPATIBLE_VALUE_DETECTED 0x00000008
|
|
|
|
#define KEYWORD_HANDLER_ACCESS_NOT_PERMITTED 0x00000010
|
|
|
|
#define KEYWORD_HANDLER_UNDEFINED_PROCESSING_ERROR 0x80000000
|
|
|
|
|
|
|
|
typedef struct _EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL;
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
This function accepts a <MultiKeywordResp> formatted string, finds the associated
|
|
|
|
keyword owners, creates a <MultiConfigResp> string from it and forwards it to the
|
|
|
|
EFI_HII_ROUTING_PROTOCOL.RouteConfig function.
|
2018-06-27 15:11:33 +02:00
|
|
|
|
|
|
|
If there is an issue in resolving the contents of the KeywordString, then the
|
|
|
|
function returns an error and also sets the Progress and ProgressErr with the
|
2015-05-13 10:33:20 +02:00
|
|
|
appropriate information about where the issue occurred and additional data about
|
2018-06-27 15:11:33 +02:00
|
|
|
the nature of the issue.
|
|
|
|
|
2015-05-13 10:33:20 +02:00
|
|
|
In the case when KeywordString containing multiple keywords, when an EFI_NOT_FOUND
|
|
|
|
error is generated during processing the second or later keyword element, the system
|
2018-06-27 15:11:33 +02:00
|
|
|
storage associated with earlier keywords is not modified. All elements of the
|
2015-05-13 10:33:20 +02:00
|
|
|
KeywordString must successfully pass all tests for format and access prior to making
|
|
|
|
any modifications to storage.
|
2018-06-27 15:11:33 +02:00
|
|
|
|
2015-05-13 10:33:20 +02:00
|
|
|
In the case when EFI_DEVICE_ERROR is returned from the processing of a KeywordString
|
|
|
|
containing multiple keywords, the state of storage associated with earlier keywords
|
|
|
|
is undefined.
|
|
|
|
|
|
|
|
|
|
|
|
@param This Pointer to the EFI_KEYWORD_HANDLER _PROTOCOL instance.
|
|
|
|
|
2018-06-27 15:11:33 +02:00
|
|
|
@param KeywordString A null-terminated string in <MultiKeywordResp> format.
|
2015-05-13 10:33:20 +02:00
|
|
|
|
2018-06-27 15:11:33 +02:00
|
|
|
@param Progress On return, points to a character in the KeywordString.
|
|
|
|
Points to the string's NULL terminator if the request
|
|
|
|
was successful. Points to the most recent '&' before
|
2016-02-15 07:39:11 +01:00
|
|
|
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.
|
2015-05-13 10:33:20 +02:00
|
|
|
|
|
|
|
@param ProgressErr If during the processing of the KeywordString there was
|
2018-06-27 15:11:33 +02:00
|
|
|
a failure, this parameter gives additional information
|
|
|
|
about the possible source of the problem. The various
|
2015-05-13 10:33:20 +02:00
|
|
|
errors are defined in "Related Definitions" below.
|
|
|
|
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The specified action was completed successfully.
|
|
|
|
|
|
|
|
@retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
|
|
|
|
1. KeywordString is NULL.
|
2018-06-27 15:11:33 +02:00
|
|
|
2. Parsing of the KeywordString resulted in an
|
2015-05-13 10:33:20 +02:00
|
|
|
error. See Progress and ProgressErr for more data.
|
|
|
|
|
2018-06-27 15:11:33 +02:00
|
|
|
@retval EFI_NOT_FOUND An element of the KeywordString was not found.
|
2015-05-13 10:33:20 +02:00
|
|
|
See ProgressErr for more data.
|
|
|
|
|
2018-06-27 15:11:33 +02:00
|
|
|
@retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
|
2015-05-13 10:33:20 +02:00
|
|
|
See ProgressErr for more data.
|
2018-06-27 15:11:33 +02:00
|
|
|
|
|
|
|
@retval EFI_ACCESS_DENIED The action violated system policy. See ProgressErr
|
2015-05-13 10:33:20 +02:00
|
|
|
for more data.
|
|
|
|
|
|
|
|
@retval EFI_DEVICE_ERROR An unexpected system error occurred. See ProgressErr
|
|
|
|
for more data.
|
|
|
|
|
|
|
|
**/
|
2018-06-27 15:11:33 +02:00
|
|
|
typedef
|
2015-05-13 10:33:20 +02:00
|
|
|
EFI_STATUS
|
|
|
|
(EFIAPI *EFI_CONFIG_KEYWORD_HANDLER_SET_DATA) (
|
|
|
|
IN EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL *This,
|
|
|
|
IN CONST EFI_STRING KeywordString,
|
|
|
|
OUT EFI_STRING *Progress,
|
|
|
|
OUT UINT32 *ProgressErr
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
2018-06-27 15:11:33 +02:00
|
|
|
This function accepts a <MultiKeywordRequest> formatted string, finds the underlying
|
2015-05-13 10:33:20 +02:00
|
|
|
keyword owners, creates a <MultiConfigRequest> string from it and forwards it to the
|
|
|
|
EFI_HII_ROUTING_PROTOCOL.ExtractConfig function.
|
2018-06-27 15:11:33 +02:00
|
|
|
|
2015-05-13 10:33:20 +02:00
|
|
|
If there is an issue in resolving the contents of the KeywordString, then the function
|
|
|
|
returns an EFI_INVALID_PARAMETER and also set the Progress and ProgressErr with the
|
|
|
|
appropriate information about where the issue occurred and additional data about the
|
|
|
|
nature of the issue.
|
2018-06-27 15:11:33 +02:00
|
|
|
|
2015-05-13 10:33:20 +02:00
|
|
|
In the case when KeywordString is NULL, or contains multiple keywords, or when
|
|
|
|
EFI_NOT_FOUND is generated while processing the keyword elements, the Results string
|
2018-06-27 15:11:33 +02:00
|
|
|
contains values returned for all keywords processed prior to the keyword generating the
|
2015-05-13 10:33:20 +02:00
|
|
|
error but no values for the keyword with error or any following keywords.
|
|
|
|
|
2018-06-27 15:11:33 +02:00
|
|
|
|
2015-05-13 10:33:20 +02:00
|
|
|
@param This Pointer to the EFI_KEYWORD_HANDLER _PROTOCOL instance.
|
2018-06-27 15:11:33 +02:00
|
|
|
|
2015-05-13 10:33:20 +02:00
|
|
|
@param NameSpaceId A null-terminated string containing the platform configuration
|
|
|
|
language to search through in the system. If a NULL is passed
|
|
|
|
in, then it is assumed that any platform configuration language
|
|
|
|
with the prefix of "x-UEFI-" are searched.
|
2018-06-27 15:11:33 +02:00
|
|
|
|
2015-05-13 10:33:20 +02:00
|
|
|
@param KeywordString A null-terminated string in <MultiKeywordRequest> format. If a
|
2018-06-27 15:11:33 +02:00
|
|
|
NULL is passed in the KeywordString field, all of the known
|
|
|
|
keywords in the system for the NameSpaceId specified are
|
2015-05-13 10:33:20 +02:00
|
|
|
returned in the Results field.
|
2018-06-27 15:11:33 +02:00
|
|
|
|
2015-05-13 10:33:20 +02:00
|
|
|
@param Progress On return, points to a character in the KeywordString. Points
|
2018-06-27 15:11:33 +02:00
|
|
|
to the string's NULL terminator if the request was successful.
|
2016-02-15 07:39:11 +01:00
|
|
|
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.
|
2018-06-27 15:11:33 +02:00
|
|
|
|
2015-05-13 10:33:20 +02:00
|
|
|
@param ProgressErr If during the processing of the KeywordString there was a
|
2018-06-27 15:11:33 +02:00
|
|
|
failure, this parameter gives additional information about the
|
2015-05-13 10:33:20 +02:00
|
|
|
possible source of the problem. See the definitions in SetData()
|
|
|
|
for valid value definitions.
|
2018-06-27 15:11:33 +02:00
|
|
|
|
2015-05-13 10:33:20 +02:00
|
|
|
@param Results A null-terminated string in <MultiKeywordResp> format is returned
|
2018-06-27 15:11:33 +02:00
|
|
|
which has all the values filled in for the keywords in the
|
2015-05-13 10:33:20 +02:00
|
|
|
KeywordString. This is a callee-allocated field, and must be freed
|
2018-06-27 15:11:33 +02:00
|
|
|
by the caller after being used.
|
2015-05-13 10:33:20 +02:00
|
|
|
|
|
|
|
@retval EFI_SUCCESS The specified action was completed successfully.
|
2018-06-27 15:11:33 +02:00
|
|
|
|
2015-05-13 10:33:20 +02:00
|
|
|
@retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
|
2016-10-19 09:01:27 +02:00
|
|
|
1.Progress, ProgressErr, or Results is NULL.
|
2015-05-13 10:33:20 +02:00
|
|
|
2.Parsing of the KeywordString resulted in an error. See
|
|
|
|
Progress and ProgressErr for more data.
|
2018-06-27 15:11:33 +02:00
|
|
|
|
2015-05-13 10:33:20 +02:00
|
|
|
|
|
|
|
@retval EFI_NOT_FOUND An element of the KeywordString was not found. See
|
|
|
|
ProgressErr for more data.
|
|
|
|
|
|
|
|
@retval EFI_NOT_FOUND The NamespaceId specified was not found. See ProgressErr
|
|
|
|
for more data.
|
|
|
|
|
|
|
|
@retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated. See
|
|
|
|
ProgressErr for more data.
|
2018-06-27 15:11:33 +02:00
|
|
|
|
2015-05-13 10:33:20 +02:00
|
|
|
@retval EFI_ACCESS_DENIED The action violated system policy. See ProgressErr for
|
|
|
|
more data.
|
|
|
|
|
|
|
|
@retval EFI_DEVICE_ERROR An unexpected system error occurred. See ProgressErr
|
|
|
|
for more data.
|
|
|
|
|
|
|
|
**/
|
2018-06-27 15:11:33 +02:00
|
|
|
typedef
|
2015-05-13 10:33:20 +02:00
|
|
|
EFI_STATUS
|
|
|
|
(EFIAPI *EFI_CONFIG_KEYWORD_HANDLER_GET_DATA) (
|
|
|
|
IN EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL *This,
|
|
|
|
IN CONST EFI_STRING NameSpaceId, OPTIONAL
|
|
|
|
IN CONST EFI_STRING KeywordString, OPTIONAL
|
2018-06-27 15:11:33 +02:00
|
|
|
OUT EFI_STRING *Progress,
|
2015-05-13 10:33:20 +02:00
|
|
|
OUT UINT32 *ProgressErr,
|
|
|
|
OUT EFI_STRING *Results
|
|
|
|
);
|
|
|
|
|
|
|
|
///
|
2018-06-27 15:11:33 +02:00
|
|
|
/// The EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL provides the mechanism
|
|
|
|
/// to set and get the values associated with a keyword exposed
|
2015-05-13 10:33:20 +02:00
|
|
|
/// through a x-UEFI- prefixed configuration language namespace
|
|
|
|
///
|
|
|
|
|
|
|
|
struct _EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL {
|
|
|
|
EFI_CONFIG_KEYWORD_HANDLER_SET_DATA SetData;
|
|
|
|
EFI_CONFIG_KEYWORD_HANDLER_GET_DATA GetData;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern EFI_GUID gEfiConfigKeywordHandlerProtocolGuid;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|