]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/ComponentName.c
IntelFrameworkModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / IntelFrameworkModulePkg / Csm / BiosThunk / VideoDxe / ComponentName.c
CommitLineData
bcecde14 1/** @file\r
2\r
0c9f676d 3Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
bcecde14 4\r
c0a00b14 5SPDX-License-Identifier: BSD-2-Clause-Patent\r
bcecde14 6\r
7**/\r
8\r
9#include "BiosVideo.h"\r
10\r
11//\r
12// EFI Component Name Functions\r
13//\r
14/**\r
15 Retrieves a Unicode string that is the user readable name of the driver.\r
16\r
17 This function retrieves the user readable name of a driver in the form of a\r
18 Unicode string. If the driver specified by This has a user readable name in\r
19 the language specified by Language, then a pointer to the driver name is\r
20 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
21 by This does not support the language specified by Language,\r
22 then EFI_UNSUPPORTED is returned.\r
23\r
24 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
25 EFI_COMPONENT_NAME_PROTOCOL instance.\r
26\r
27 @param Language[in] A pointer to a Null-terminated ASCII string\r
28 array indicating the language. This is the\r
29 language of the driver name that the caller is\r
30 requesting, and it must match one of the\r
31 languages specified in SupportedLanguages. The\r
32 number of languages supported by a driver is up\r
33 to the driver writer. Language is specified\r
34 in RFC 4646 or ISO 639-2 language code format.\r
35\r
36 @param DriverName[out] A pointer to the Unicode string to return.\r
37 This Unicode string is the name of the\r
38 driver specified by This in the language\r
39 specified by Language.\r
40\r
41 @retval EFI_SUCCESS The Unicode string for the Driver specified by\r
42 This and the language specified by Language was\r
43 returned in DriverName.\r
44\r
45 @retval EFI_INVALID_PARAMETER Language is NULL.\r
46\r
47 @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
48\r
49 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
50 the language specified by Language.\r
51\r
52**/\r
53EFI_STATUS\r
54EFIAPI\r
55BiosVideoComponentNameGetDriverName (\r
56 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
57 IN CHAR8 *Language,\r
58 OUT CHAR16 **DriverName\r
59 );\r
60\r
61\r
62/**\r
63 Retrieves a Unicode string that is the user readable name of the controller\r
64 that is being managed by a driver.\r
65\r
66 This function retrieves the user readable name of the controller specified by\r
67 ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
68 driver specified by This has a user readable name in the language specified by\r
69 Language, then a pointer to the controller name is returned in ControllerName,\r
70 and EFI_SUCCESS is returned. If the driver specified by This is not currently\r
71 managing the controller specified by ControllerHandle and ChildHandle,\r
72 then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r
73 support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
74\r
75 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
76 EFI_COMPONENT_NAME_PROTOCOL instance.\r
77\r
78 @param ControllerHandle[in] The handle of a controller that the driver\r
79 specified by This is managing. This handle\r
80 specifies the controller whose name is to be\r
81 returned.\r
82\r
83 @param ChildHandle[in] The handle of the child controller to retrieve\r
84 the name of. This is an optional parameter that\r
85 may be NULL. It will be NULL for device\r
86 drivers. It will also be NULL for a bus drivers\r
87 that wish to retrieve the name of the bus\r
88 controller. It will not be NULL for a bus\r
89 driver that wishes to retrieve the name of a\r
90 child controller.\r
91\r
92 @param Language[in] A pointer to a Null-terminated ASCII string\r
93 array indicating the language. This is the\r
94 language of the driver name that the caller is\r
95 requesting, and it must match one of the\r
96 languages specified in SupportedLanguages. The\r
97 number of languages supported by a driver is up\r
98 to the driver writer. Language is specified in\r
99 RFC 4646 or ISO 639-2 language code format.\r
100\r
101 @param ControllerName[out] A pointer to the Unicode string to return.\r
102 This Unicode string is the name of the\r
103 controller specified by ControllerHandle and\r
104 ChildHandle in the language specified by\r
105 Language from the point of view of the driver\r
106 specified by This.\r
107\r
108 @retval EFI_SUCCESS The Unicode string for the user readable name in\r
109 the language specified by Language for the\r
110 driver specified by This was returned in\r
111 DriverName.\r
112\r
0c9f676d 113 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r
bcecde14 114\r
115 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
116 EFI_HANDLE.\r
117\r
118 @retval EFI_INVALID_PARAMETER Language is NULL.\r
119\r
120 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
121\r
122 @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
123 managing the controller specified by\r
124 ControllerHandle and ChildHandle.\r
125\r
126 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
127 the language specified by Language.\r
128\r
129**/\r
130EFI_STATUS\r
131EFIAPI\r
132BiosVideoComponentNameGetControllerName (\r
133 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
134 IN EFI_HANDLE ControllerHandle,\r
135 IN EFI_HANDLE ChildHandle OPTIONAL,\r
136 IN CHAR8 *Language,\r
137 OUT CHAR16 **ControllerName\r
138 );\r
139\r
140\r
141//\r
142// EFI Component Name Protocol\r
143//\r
144GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gBiosVideoComponentName = {\r
145 BiosVideoComponentNameGetDriverName,\r
146 BiosVideoComponentNameGetControllerName,\r
147 "eng"\r
148};\r
149\r
150//\r
151// EFI Component Name 2 Protocol\r
152//\r
153GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gBiosVideoComponentName2 = {\r
154 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) BiosVideoComponentNameGetDriverName,\r
155 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) BiosVideoComponentNameGetControllerName,\r
156 "en"\r
157};\r
158\r
159\r
160GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mBiosVideoDriverNameTable[] = {\r
161 {\r
162 "eng;en",\r
163 L"BIOS[INT10] Video Driver"\r
164 },\r
165 {\r
166 NULL,\r
167 NULL\r
168 }\r
169};\r
170\r
171/**\r
172 Retrieves a Unicode string that is the user readable name of the driver.\r
173\r
174 This function retrieves the user readable name of a driver in the form of a\r
175 Unicode string. If the driver specified by This has a user readable name in\r
176 the language specified by Language, then a pointer to the driver name is\r
177 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
178 by This does not support the language specified by Language,\r
179 then EFI_UNSUPPORTED is returned.\r
180\r
181 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
182 EFI_COMPONENT_NAME_PROTOCOL instance.\r
183\r
184 @param Language[in] A pointer to a Null-terminated ASCII string\r
185 array indicating the language. This is the\r
186 language of the driver name that the caller is\r
187 requesting, and it must match one of the\r
188 languages specified in SupportedLanguages. The\r
189 number of languages supported by a driver is up\r
190 to the driver writer. Language is specified\r
191 in RFC 4646 or ISO 639-2 language code format.\r
192\r
193 @param DriverName[out] A pointer to the Unicode string to return.\r
194 This Unicode string is the name of the\r
195 driver specified by This in the language\r
196 specified by Language.\r
197\r
198 @retval EFI_SUCCESS The Unicode string for the Driver specified by\r
199 This and the language specified by Language was\r
200 returned in DriverName.\r
201\r
202 @retval EFI_INVALID_PARAMETER Language is NULL.\r
203\r
204 @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
205\r
206 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
207 the language specified by Language.\r
208\r
209**/\r
210EFI_STATUS\r
211EFIAPI\r
212BiosVideoComponentNameGetDriverName (\r
213 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
214 IN CHAR8 *Language,\r
215 OUT CHAR16 **DriverName\r
216 )\r
217{\r
218 return LookupUnicodeString2 (\r
219 Language,\r
220 This->SupportedLanguages,\r
221 mBiosVideoDriverNameTable,\r
222 DriverName,\r
223 (BOOLEAN)(This == &gBiosVideoComponentName)\r
224 );\r
225}\r
226\r
227/**\r
228 Retrieves a Unicode string that is the user readable name of the controller\r
229 that is being managed by a driver.\r
230\r
231 This function retrieves the user readable name of the controller specified by\r
232 ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
233 driver specified by This has a user readable name in the language specified by\r
234 Language, then a pointer to the controller name is returned in ControllerName,\r
235 and EFI_SUCCESS is returned. If the driver specified by This is not currently\r
236 managing the controller specified by ControllerHandle and ChildHandle,\r
237 then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r
238 support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
239\r
240 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
241 EFI_COMPONENT_NAME_PROTOCOL instance.\r
242\r
243 @param ControllerHandle[in] The handle of a controller that the driver\r
244 specified by This is managing. This handle\r
245 specifies the controller whose name is to be\r
246 returned.\r
247\r
248 @param ChildHandle[in] The handle of the child controller to retrieve\r
249 the name of. This is an optional parameter that\r
250 may be NULL. It will be NULL for device\r
251 drivers. It will also be NULL for a bus drivers\r
252 that wish to retrieve the name of the bus\r
253 controller. It will not be NULL for a bus\r
254 driver that wishes to retrieve the name of a\r
255 child controller.\r
256\r
257 @param Language[in] A pointer to a Null-terminated ASCII string\r
258 array indicating the language. This is the\r
259 language of the driver name that the caller is\r
260 requesting, and it must match one of the\r
261 languages specified in SupportedLanguages. The\r
262 number of languages supported by a driver is up\r
263 to the driver writer. Language is specified in\r
264 RFC 4646 or ISO 639-2 language code format.\r
265\r
266 @param ControllerName[out] A pointer to the Unicode string to return.\r
267 This Unicode string is the name of the\r
268 controller specified by ControllerHandle and\r
269 ChildHandle in the language specified by\r
270 Language from the point of view of the driver\r
271 specified by This.\r
272\r
273 @retval EFI_SUCCESS The Unicode string for the user readable name in\r
274 the language specified by Language for the\r
275 driver specified by This was returned in\r
276 DriverName.\r
277\r
0c9f676d 278 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r
bcecde14 279\r
280 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
281 EFI_HANDLE.\r
282\r
283 @retval EFI_INVALID_PARAMETER Language is NULL.\r
284\r
285 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
286\r
287 @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
288 managing the controller specified by\r
289 ControllerHandle and ChildHandle.\r
290\r
291 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
292 the language specified by Language.\r
293\r
294**/\r
295EFI_STATUS\r
296EFIAPI\r
297BiosVideoComponentNameGetControllerName (\r
298 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
299 IN EFI_HANDLE ControllerHandle,\r
300 IN EFI_HANDLE ChildHandle OPTIONAL,\r
301 IN CHAR8 *Language,\r
302 OUT CHAR16 **ControllerName\r
303 )\r
304{\r
305 return EFI_UNSUPPORTED;\r
306}\r