]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/HiiConfigKeyword.h
MdePkg/DebugLib.h: Add new APIs for DebugLib
[mirror_edk2.git] / MdePkg / Include / Protocol / HiiConfigKeyword.h
CommitLineData
5ca4bb9f 1/** @file\r
9095d37b
LG
2 The file provides the mechanism to set and get the values\r
3 associated with a keyword exposed through a x-UEFI- prefixed\r
5ca4bb9f 4 configuration language namespace.\r
9095d37b
LG
5\r
6Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
7This program and the accompanying materials are licensed and made available under\r
8the terms and conditions of the BSD License that accompanies this distribution.\r
5ca4bb9f 9The full text of the license may be found at\r
9095d37b
LG
10http://opensource.org/licenses/bsd-license.php.\r
11\r
12THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
13WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
5ca4bb9f 14\r
497a5fb1
SZ
15 @par Revision Reference:\r
16 This Protocol was introduced in UEFI Specification 2.5.\r
17\r
18\r
5ca4bb9f
ED
19**/\r
20\r
21#ifndef __EFI_CONFIG_KEYWORD_HANDLER_H__\r
22#define __EFI_CONFIG_KEYWORD_HANDLER_H__\r
23\r
24#define EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL_GUID \\r
25{ \\r
26 0x0a8badd5, 0x03b8, 0x4d19, {0xb1, 0x28, 0x7b, 0x8f, 0x0e, 0xda, 0xa5, 0x96 } \\r
27}\r
28\r
29//***********************************************************\r
30// Progress Errors\r
31//***********************************************************\r
32#define KEYWORD_HANDLER_NO_ERROR 0x00000000\r
33#define KEYWORD_HANDLER_NAMESPACE_ID_NOT_FOUND 0x00000001\r
34#define KEYWORD_HANDLER_MALFORMED_STRING 0x00000002\r
35#define KEYWORD_HANDLER_KEYWORD_NOT_FOUND 0x00000004\r
36#define KEYWORD_HANDLER_INCOMPATIBLE_VALUE_DETECTED 0x00000008\r
37#define KEYWORD_HANDLER_ACCESS_NOT_PERMITTED 0x00000010\r
38#define KEYWORD_HANDLER_UNDEFINED_PROCESSING_ERROR 0x80000000\r
39\r
40typedef struct _EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL;\r
41\r
42/**\r
43\r
44 This function accepts a <MultiKeywordResp> formatted string, finds the associated\r
45 keyword owners, creates a <MultiConfigResp> string from it and forwards it to the\r
46 EFI_HII_ROUTING_PROTOCOL.RouteConfig function.\r
9095d37b
LG
47\r
48 If there is an issue in resolving the contents of the KeywordString, then the\r
49 function returns an error and also sets the Progress and ProgressErr with the\r
5ca4bb9f 50 appropriate information about where the issue occurred and additional data about\r
9095d37b
LG
51 the nature of the issue.\r
52\r
5ca4bb9f
ED
53 In the case when KeywordString containing multiple keywords, when an EFI_NOT_FOUND\r
54 error is generated during processing the second or later keyword element, the system\r
9095d37b 55 storage associated with earlier keywords is not modified. All elements of the\r
5ca4bb9f
ED
56 KeywordString must successfully pass all tests for format and access prior to making\r
57 any modifications to storage.\r
9095d37b 58\r
5ca4bb9f
ED
59 In the case when EFI_DEVICE_ERROR is returned from the processing of a KeywordString\r
60 containing multiple keywords, the state of storage associated with earlier keywords\r
61 is undefined.\r
62\r
63\r
64 @param This Pointer to the EFI_KEYWORD_HANDLER _PROTOCOL instance.\r
65\r
9095d37b 66 @param KeywordString A null-terminated string in <MultiKeywordResp> format.\r
5ca4bb9f 67\r
9095d37b
LG
68 @param Progress On return, points to a character in the KeywordString.\r
69 Points to the string's NULL terminator if the request\r
70 was successful. Points to the most recent '&' before\r
38baa5b6
DB
71 the first failing name / value pair (or the beginning\r
72 of the string if the failure is in the first name / value\r
73 pair) if the request was not successful.\r
5ca4bb9f
ED
74\r
75 @param ProgressErr If during the processing of the KeywordString there was\r
9095d37b
LG
76 a failure, this parameter gives additional information\r
77 about the possible source of the problem. The various\r
5ca4bb9f
ED
78 errors are defined in "Related Definitions" below.\r
79\r
80\r
81 @retval EFI_SUCCESS The specified action was completed successfully.\r
82\r
83 @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:\r
84 1. KeywordString is NULL.\r
9095d37b 85 2. Parsing of the KeywordString resulted in an\r
5ca4bb9f
ED
86 error. See Progress and ProgressErr for more data.\r
87\r
9095d37b 88 @retval EFI_NOT_FOUND An element of the KeywordString was not found.\r
5ca4bb9f
ED
89 See ProgressErr for more data.\r
90\r
9095d37b 91 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r
5ca4bb9f 92 See ProgressErr for more data.\r
9095d37b
LG
93\r
94 @retval EFI_ACCESS_DENIED The action violated system policy. See ProgressErr\r
5ca4bb9f
ED
95 for more data.\r
96\r
97 @retval EFI_DEVICE_ERROR An unexpected system error occurred. See ProgressErr\r
98 for more data.\r
99\r
100**/\r
9095d37b 101typedef\r
5ca4bb9f
ED
102EFI_STATUS\r
103(EFIAPI *EFI_CONFIG_KEYWORD_HANDLER_SET_DATA) (\r
104 IN EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL *This,\r
105 IN CONST EFI_STRING KeywordString,\r
106 OUT EFI_STRING *Progress,\r
107 OUT UINT32 *ProgressErr\r
108 );\r
109\r
110\r
111/**\r
112\r
9095d37b 113 This function accepts a <MultiKeywordRequest> formatted string, finds the underlying\r
5ca4bb9f
ED
114 keyword owners, creates a <MultiConfigRequest> string from it and forwards it to the\r
115 EFI_HII_ROUTING_PROTOCOL.ExtractConfig function.\r
9095d37b 116\r
5ca4bb9f
ED
117 If there is an issue in resolving the contents of the KeywordString, then the function\r
118 returns an EFI_INVALID_PARAMETER and also set the Progress and ProgressErr with the\r
119 appropriate information about where the issue occurred and additional data about the\r
120 nature of the issue.\r
9095d37b 121\r
5ca4bb9f
ED
122 In the case when KeywordString is NULL, or contains multiple keywords, or when\r
123 EFI_NOT_FOUND is generated while processing the keyword elements, the Results string\r
9095d37b 124 contains values returned for all keywords processed prior to the keyword generating the\r
5ca4bb9f
ED
125 error but no values for the keyword with error or any following keywords.\r
126\r
9095d37b 127\r
5ca4bb9f 128 @param This Pointer to the EFI_KEYWORD_HANDLER _PROTOCOL instance.\r
9095d37b 129\r
5ca4bb9f
ED
130 @param NameSpaceId A null-terminated string containing the platform configuration\r
131 language to search through in the system. If a NULL is passed\r
132 in, then it is assumed that any platform configuration language\r
133 with the prefix of "x-UEFI-" are searched.\r
9095d37b 134\r
5ca4bb9f 135 @param KeywordString A null-terminated string in <MultiKeywordRequest> format. If a\r
9095d37b
LG
136 NULL is passed in the KeywordString field, all of the known\r
137 keywords in the system for the NameSpaceId specified are\r
5ca4bb9f 138 returned in the Results field.\r
9095d37b 139\r
5ca4bb9f 140 @param Progress On return, points to a character in the KeywordString. Points\r
9095d37b 141 to the string's NULL terminator if the request was successful.\r
38baa5b6
DB
142 Points to the most recent '&' before the first failing name / value\r
143 pair (or the beginning of the string if the failure is in the first\r
144 name / value pair) if the request was not successful.\r
9095d37b 145\r
5ca4bb9f 146 @param ProgressErr If during the processing of the KeywordString there was a\r
9095d37b 147 failure, this parameter gives additional information about the\r
5ca4bb9f
ED
148 possible source of the problem. See the definitions in SetData()\r
149 for valid value definitions.\r
9095d37b 150\r
5ca4bb9f 151 @param Results A null-terminated string in <MultiKeywordResp> format is returned\r
9095d37b 152 which has all the values filled in for the keywords in the\r
5ca4bb9f 153 KeywordString. This is a callee-allocated field, and must be freed\r
9095d37b 154 by the caller after being used.\r
5ca4bb9f
ED
155\r
156 @retval EFI_SUCCESS The specified action was completed successfully.\r
9095d37b 157\r
5ca4bb9f 158 @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:\r
a750b4ae 159 1.Progress, ProgressErr, or Results is NULL.\r
5ca4bb9f
ED
160 2.Parsing of the KeywordString resulted in an error. See\r
161 Progress and ProgressErr for more data.\r
9095d37b 162\r
5ca4bb9f
ED
163\r
164 @retval EFI_NOT_FOUND An element of the KeywordString was not found. See\r
165 ProgressErr for more data.\r
166\r
167 @retval EFI_NOT_FOUND The NamespaceId specified was not found. See ProgressErr\r
168 for more data.\r
169\r
170 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated. See\r
171 ProgressErr for more data.\r
9095d37b 172\r
5ca4bb9f
ED
173 @retval EFI_ACCESS_DENIED The action violated system policy. See ProgressErr for\r
174 more data.\r
175\r
176 @retval EFI_DEVICE_ERROR An unexpected system error occurred. See ProgressErr\r
177 for more data.\r
178\r
179**/\r
9095d37b 180typedef\r
5ca4bb9f
ED
181EFI_STATUS\r
182(EFIAPI *EFI_CONFIG_KEYWORD_HANDLER_GET_DATA) (\r
183 IN EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL *This,\r
184 IN CONST EFI_STRING NameSpaceId, OPTIONAL\r
185 IN CONST EFI_STRING KeywordString, OPTIONAL\r
9095d37b 186 OUT EFI_STRING *Progress,\r
5ca4bb9f
ED
187 OUT UINT32 *ProgressErr,\r
188 OUT EFI_STRING *Results\r
189 );\r
190\r
191///\r
9095d37b
LG
192/// The EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL provides the mechanism\r
193/// to set and get the values associated with a keyword exposed\r
5ca4bb9f
ED
194/// through a x-UEFI- prefixed configuration language namespace\r
195///\r
196\r
197struct _EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL {\r
198 EFI_CONFIG_KEYWORD_HANDLER_SET_DATA SetData;\r
199 EFI_CONFIG_KEYWORD_HANDLER_GET_DATA GetData;\r
200};\r
201\r
202extern EFI_GUID gEfiConfigKeywordHandlerProtocolGuid;\r
203\r
204#endif\r
205\r