]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/HiiConfigKeyword.h
MdePkg: Add UEFI2.5 Ramdisk device path definition
[mirror_edk2.git] / MdePkg / Include / Protocol / HiiConfigKeyword.h
CommitLineData
5ca4bb9f
ED
1/** @file\r
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
4 configuration language namespace.\r
5 \r
6Copyright (c) 2015, 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
9The full text of the license may be found at\r
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
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
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
46 appropriate information about where the issue occurred and additional data about\r
47 the nature of the issue. \r
48 \r
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
51 storage associated with earlier keywords is not modified. All elements of the \r
52 KeywordString must successfully pass all tests for format and access prior to making\r
53 any modifications to storage.\r
54 \r
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
62 @param KeywordString A null-terminated string in <MultiKeywordResp> format. \r
63\r
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
67 the first failing string element if the request was \r
68 not successful.\r
69\r
70 @param ProgressErr If during the processing of the KeywordString there was\r
71 a failure, this parameter gives additional information \r
72 about the possible source of the problem. The various \r
73 errors are defined in "Related Definitions" below.\r
74\r
75\r
76 @retval EFI_SUCCESS The specified action was completed successfully.\r
77\r
78 @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:\r
79 1. KeywordString is NULL.\r
80 2. Parsing of the KeywordString resulted in an \r
81 error. See Progress and ProgressErr for more data.\r
82\r
83 @retval EFI_NOT_FOUND An element of the KeywordString was not found. \r
84 See ProgressErr for more data.\r
85\r
86 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated. \r
87 See ProgressErr for more data.\r
88 \r
89 @retval EFI_ACCESS_DENIED The action violated system policy. See ProgressErr \r
90 for more data.\r
91\r
92 @retval EFI_DEVICE_ERROR An unexpected system error occurred. See ProgressErr\r
93 for more data.\r
94\r
95**/\r
96typedef \r
97EFI_STATUS\r
98(EFIAPI *EFI_CONFIG_KEYWORD_HANDLER_SET_DATA) (\r
99 IN EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL *This,\r
100 IN CONST EFI_STRING KeywordString,\r
101 OUT EFI_STRING *Progress,\r
102 OUT UINT32 *ProgressErr\r
103 );\r
104\r
105\r
106/**\r
107\r
108 This function accepts a <MultiKeywordRequest> formatted string, finds the underlying \r
109 keyword owners, creates a <MultiConfigRequest> string from it and forwards it to the\r
110 EFI_HII_ROUTING_PROTOCOL.ExtractConfig function.\r
111 \r
112 If there is an issue in resolving the contents of the KeywordString, then the function\r
113 returns an EFI_INVALID_PARAMETER and also set the Progress and ProgressErr with the\r
114 appropriate information about where the issue occurred and additional data about the\r
115 nature of the issue.\r
116 \r
117 In the case when KeywordString is NULL, or contains multiple keywords, or when\r
118 EFI_NOT_FOUND is generated while processing the keyword elements, the Results string\r
119 contains values returned for all keywords processed prior to the keyword generating the \r
120 error but no values for the keyword with error or any following keywords.\r
121\r
122 \r
123 @param This Pointer to the EFI_KEYWORD_HANDLER _PROTOCOL instance.\r
124 \r
125 @param NameSpaceId A null-terminated string containing the platform configuration\r
126 language to search through in the system. If a NULL is passed\r
127 in, then it is assumed that any platform configuration language\r
128 with the prefix of "x-UEFI-" are searched.\r
129 \r
130 @param KeywordString A null-terminated string in <MultiKeywordRequest> format. If a\r
131 NULL is passed in the KeywordString field, all of the known \r
132 keywords in the system for the NameSpaceId specified are \r
133 returned in the Results field.\r
134 \r
135 @param Progress On return, points to a character in the KeywordString. Points\r
136 to the string's NULL terminator if the request was successful. \r
137 Points to the most recent '&' before the first failing string\r
138 element if the request was not successful.\r
139 \r
140 @param ProgressErr If during the processing of the KeywordString there was a\r
141 failure, this parameter gives additional information about the \r
142 possible source of the problem. See the definitions in SetData()\r
143 for valid value definitions.\r
144 \r
145 @param Results A null-terminated string in <MultiKeywordResp> format is returned\r
146 which has all the values filled in for the keywords in the \r
147 KeywordString. This is a callee-allocated field, and must be freed\r
148 by the caller after being used. \r
149\r
150 @retval EFI_SUCCESS The specified action was completed successfully.\r
151 \r
152 @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:\r
153 1.Progress, ProgressErr, or Resuts is NULL.\r
154 2.Parsing of the KeywordString resulted in an error. See\r
155 Progress and ProgressErr for more data.\r
156 \r
157\r
158 @retval EFI_NOT_FOUND An element of the KeywordString was not found. See\r
159 ProgressErr for more data.\r
160\r
161 @retval EFI_NOT_FOUND The NamespaceId specified was not found. See ProgressErr\r
162 for more data.\r
163\r
164 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated. See\r
165 ProgressErr for more data.\r
166 \r
167 @retval EFI_ACCESS_DENIED The action violated system policy. See ProgressErr for\r
168 more data.\r
169\r
170 @retval EFI_DEVICE_ERROR An unexpected system error occurred. See ProgressErr\r
171 for more data.\r
172\r
173**/\r
174typedef \r
175EFI_STATUS\r
176(EFIAPI *EFI_CONFIG_KEYWORD_HANDLER_GET_DATA) (\r
177 IN EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL *This,\r
178 IN CONST EFI_STRING NameSpaceId, OPTIONAL\r
179 IN CONST EFI_STRING KeywordString, OPTIONAL\r
180 OUT EFI_STRING *Progress, \r
181 OUT UINT32 *ProgressErr,\r
182 OUT EFI_STRING *Results\r
183 );\r
184\r
185///\r
186/// The EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL provides the mechanism \r
187/// to set and get the values associated with a keyword exposed \r
188/// through a x-UEFI- prefixed configuration language namespace\r
189///\r
190\r
191struct _EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL {\r
192 EFI_CONFIG_KEYWORD_HANDLER_SET_DATA SetData;\r
193 EFI_CONFIG_KEYWORD_HANDLER_GET_DATA GetData;\r
194};\r
195\r
196extern EFI_GUID gEfiConfigKeywordHandlerProtocolGuid;\r
197\r
198#endif\r
199\r