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