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