]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Console/ConSplitterDxe/ComponentName.c
Add compiler hint of "GLOBAL_REMOVE_IF_UNREFERENCED" to prevent static unicode string...
[mirror_edk2.git] / MdeModulePkg / Universal / Console / ConSplitterDxe / ComponentName.c
CommitLineData
95276127 1/*++\r
2\r
3Copyright (c) 2006, Intel Corporation \r
4All rights reserved. This program and the accompanying materials \r
5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 ComponentName.c\r
15\r
16Abstract:\r
17\r
18--*/\r
19\r
95276127 20#include "ConSplitter.h"\r
21\r
22//\r
23// EFI Component Name Protocol\r
24//\r
1307dcd7 25GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gConSplitterConInComponentName = {\r
95276127 26 ConSplitterComponentNameGetDriverName,\r
27 ConSplitterConInComponentNameGetControllerName,\r
28 "eng"\r
1307dcd7 29};\r
5bca971e 30\r
31//\r
32// EFI Component Name 2 Protocol\r
33//\r
1307dcd7 34GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gConSplitterConInComponentName2 = {\r
5bca971e 35 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) ConSplitterComponentNameGetDriverName,\r
36 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) ConSplitterConInComponentNameGetControllerName,\r
37 "en"\r
1307dcd7 38};\r
95276127 39\r
5bca971e 40\r
41//\r
42// EFI Component Name Protocol\r
43//\r
1307dcd7 44GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gConSplitterSimplePointerComponentName = {\r
95276127 45 ConSplitterComponentNameGetDriverName,\r
46 ConSplitterSimplePointerComponentNameGetControllerName,\r
47 "eng"\r
1307dcd7 48};\r
5bca971e 49\r
50//\r
51// EFI Component Name 2 Protocol\r
52//\r
1307dcd7 53GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gConSplitterSimplePointerComponentName2 = {\r
5bca971e 54 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) ConSplitterComponentNameGetDriverName,\r
55 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) ConSplitterSimplePointerComponentNameGetControllerName,\r
56 "en"\r
1307dcd7 57};\r
95276127 58\r
5bca971e 59\r
60//\r
61// EFI Component Name Protocol\r
62//\r
1307dcd7 63GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gConSplitterConOutComponentName = {\r
95276127 64 ConSplitterComponentNameGetDriverName,\r
65 ConSplitterConOutComponentNameGetControllerName,\r
66 "eng"\r
1307dcd7 67};\r
5bca971e 68\r
69//\r
70// EFI Component Name 2 Protocol\r
71//\r
1307dcd7 72GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gConSplitterConOutComponentName2 = {\r
5bca971e 73 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) ConSplitterComponentNameGetDriverName,\r
74 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) ConSplitterConOutComponentNameGetControllerName,\r
75 "en"\r
1307dcd7 76};\r
95276127 77\r
5bca971e 78\r
79//\r
80// EFI Component Name Protocol\r
81//\r
1307dcd7 82GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gConSplitterStdErrComponentName = {\r
95276127 83 ConSplitterComponentNameGetDriverName,\r
84 ConSplitterStdErrComponentNameGetControllerName,\r
85 "eng"\r
1307dcd7 86};\r
5bca971e 87\r
88//\r
89// EFI Component Name 2 Protocol\r
90//\r
1307dcd7 91GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gConSplitterStdErrComponentName2 = {\r
5bca971e 92 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) ConSplitterComponentNameGetDriverName,\r
93 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) ConSplitterStdErrComponentNameGetControllerName,\r
94 "en"\r
1307dcd7 95};\r
5bca971e 96\r
95276127 97\r
d1aeb0bd 98GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mConSplitterDriverNameTable[] = {\r
95276127 99 {\r
5bca971e 100 "eng;en",\r
95276127 101 (CHAR16 *) L"Console Splitter Driver"\r
102 },\r
103 {\r
104 NULL,\r
105 NULL\r
106 }\r
107};\r
108\r
d1aeb0bd 109GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mConSplitterConInControllerNameTable[] = {\r
95276127 110 {\r
5bca971e 111 "eng;en",\r
95276127 112 (CHAR16 *) L"Primary Console Input Device"\r
113 },\r
114 {\r
115 NULL,\r
116 NULL\r
117 }\r
118};\r
119\r
d1aeb0bd 120GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mConSplitterSimplePointerControllerNameTable[] = {\r
95276127 121 {\r
5bca971e 122 "eng;en",\r
95276127 123 (CHAR16 *) L"Primary Simple Pointer Device"\r
124 },\r
125 {\r
126 NULL,\r
127 NULL\r
128 }\r
129};\r
130\r
d1aeb0bd 131GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mConSplitterConOutControllerNameTable[] = {\r
95276127 132 {\r
5bca971e 133 "eng;en",\r
95276127 134 (CHAR16 *) L"Primary Console Output Device"\r
135 },\r
136 {\r
137 NULL,\r
138 NULL\r
139 }\r
140};\r
141\r
d1aeb0bd 142GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mConSplitterStdErrControllerNameTable[] = {\r
95276127 143 {\r
5bca971e 144 "eng;en",\r
95276127 145 (CHAR16 *) L"Primary Standard Error Device"\r
146 },\r
147 {\r
148 NULL,\r
149 NULL\r
150 }\r
151};\r
152\r
5bca971e 153/**\r
154 Retrieves a Unicode string that is the user readable name of the driver.\r
155\r
156 This function retrieves the user readable name of a driver in the form of a\r
157 Unicode string. If the driver specified by This has a user readable name in\r
158 the language specified by Language, then a pointer to the driver name is\r
159 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
160 by This does not support the language specified by Language,\r
161 then EFI_UNSUPPORTED is returned.\r
162\r
163 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
164 EFI_COMPONENT_NAME_PROTOCOL instance.\r
165\r
166 @param Language[in] A pointer to a Null-terminated ASCII string\r
167 array indicating the language. This is the\r
168 language of the driver name that the caller is\r
169 requesting, and it must match one of the\r
170 languages specified in SupportedLanguages. The\r
171 number of languages supported by a driver is up\r
172 to the driver writer. Language is specified\r
173 in RFC 3066 or ISO 639-2 language code format.\r
174\r
175 @param DriverName[out] A pointer to the Unicode string to return.\r
176 This Unicode string is the name of the\r
177 driver specified by This in the language\r
178 specified by Language.\r
179\r
180 @retval EFI_SUCCESS The Unicode string for the Driver specified by\r
181 This and the language specified by Language was\r
182 returned in DriverName.\r
183\r
184 @retval EFI_INVALID_PARAMETER Language is NULL.\r
185\r
186 @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
187\r
188 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
189 the language specified by Language.\r
190\r
191**/\r
95276127 192EFI_STATUS\r
193EFIAPI\r
194ConSplitterComponentNameGetDriverName (\r
195 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
196 IN CHAR8 *Language,\r
197 OUT CHAR16 **DriverName\r
198 )\r
95276127 199{\r
5bca971e 200 return LookupUnicodeString2 (\r
95276127 201 Language,\r
5bca971e 202 This->SupportedLanguages,\r
95276127 203 mConSplitterDriverNameTable,\r
5bca971e 204 DriverName,\r
205 (BOOLEAN)(This == &gConSplitterConInComponentName)\r
95276127 206 );\r
207}\r
208\r
5bca971e 209/**\r
210 Retrieves a Unicode string that is the user readable name of the controller\r
211 that is being managed by a driver.\r
212\r
213 This function retrieves the user readable name of the controller specified by\r
214 ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
215 driver specified by This has a user readable name in the language specified by\r
216 Language, then a pointer to the controller name is returned in ControllerName,\r
217 and EFI_SUCCESS is returned. If the driver specified by This is not currently\r
218 managing the controller specified by ControllerHandle and ChildHandle,\r
219 then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r
220 support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
221\r
222 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
223 EFI_COMPONENT_NAME_PROTOCOL instance.\r
224\r
225 @param ControllerHandle[in] The handle of a controller that the driver\r
226 specified by This is managing. This handle\r
227 specifies the controller whose name is to be\r
228 returned.\r
229\r
230 @param ChildHandle[in] The handle of the child controller to retrieve\r
231 the name of. This is an optional parameter that\r
232 may be NULL. It will be NULL for device\r
233 drivers. It will also be NULL for a bus drivers\r
234 that wish to retrieve the name of the bus\r
235 controller. It will not be NULL for a bus\r
236 driver that wishes to retrieve the name of a\r
237 child controller.\r
238\r
239 @param Language[in] A pointer to a Null-terminated ASCII string\r
240 array indicating the language. This is the\r
241 language of the driver name that the caller is\r
242 requesting, and it must match one of the\r
243 languages specified in SupportedLanguages. The\r
244 number of languages supported by a driver is up\r
245 to the driver writer. Language is specified in\r
246 RFC 3066 or ISO 639-2 language code format.\r
247\r
248 @param ControllerName[out] A pointer to the Unicode string to return.\r
249 This Unicode string is the name of the\r
250 controller specified by ControllerHandle and\r
251 ChildHandle in the language specified by\r
252 Language from the point of view of the driver\r
253 specified by This.\r
254\r
255 @retval EFI_SUCCESS The Unicode string for the user readable name in\r
256 the language specified by Language for the\r
257 driver specified by This was returned in\r
258 DriverName.\r
259\r
260 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
261\r
262 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
263 EFI_HANDLE.\r
264\r
265 @retval EFI_INVALID_PARAMETER Language is NULL.\r
266\r
267 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
268\r
269 @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
270 managing the controller specified by\r
271 ControllerHandle and ChildHandle.\r
272\r
273 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
274 the language specified by Language.\r
275\r
276**/\r
95276127 277EFI_STATUS\r
278EFIAPI\r
279ConSplitterConInComponentNameGetControllerName (\r
280 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
281 IN EFI_HANDLE ControllerHandle,\r
282 IN EFI_HANDLE ChildHandle OPTIONAL,\r
283 IN CHAR8 *Language,\r
284 OUT CHAR16 **ControllerName\r
285 )\r
95276127 286{\r
287 EFI_STATUS Status;\r
288 EFI_SIMPLE_TEXT_INPUT_PROTOCOL *TextIn;\r
289 //\r
290 // here ChildHandle is not an Optional parameter.\r
291 //\r
292 if (ChildHandle == NULL) {\r
293 return EFI_UNSUPPORTED;\r
294 }\r
295\r
296 Status = gBS->OpenProtocol (\r
297 ControllerHandle,\r
298 &gEfiSimpleTextInProtocolGuid,\r
299 (VOID **) &TextIn,\r
300 NULL,\r
301 ControllerHandle,\r
302 EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
303 );\r
304 if (EFI_ERROR (Status)) {\r
305 return EFI_UNSUPPORTED;\r
306 }\r
307\r
5bca971e 308 return LookupUnicodeString2 (\r
95276127 309 Language,\r
5bca971e 310 This->SupportedLanguages,\r
95276127 311 mConSplitterConInControllerNameTable,\r
5bca971e 312 ControllerName,\r
313 (BOOLEAN)(This == &gConSplitterConInComponentName)\r
95276127 314 );\r
315}\r
316\r
5bca971e 317/**\r
318 Retrieves a Unicode string that is the user readable name of the controller\r
319 that is being managed by a driver.\r
320\r
321 This function retrieves the user readable name of the controller specified by\r
322 ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
323 driver specified by This has a user readable name in the language specified by\r
324 Language, then a pointer to the controller name is returned in ControllerName,\r
325 and EFI_SUCCESS is returned. If the driver specified by This is not currently\r
326 managing the controller specified by ControllerHandle and ChildHandle,\r
327 then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r
328 support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
329\r
330 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
331 EFI_COMPONENT_NAME_PROTOCOL instance.\r
332\r
333 @param ControllerHandle[in] The handle of a controller that the driver\r
334 specified by This is managing. This handle\r
335 specifies the controller whose name is to be\r
336 returned.\r
337\r
338 @param ChildHandle[in] The handle of the child controller to retrieve\r
339 the name of. This is an optional parameter that\r
340 may be NULL. It will be NULL for device\r
341 drivers. It will also be NULL for a bus drivers\r
342 that wish to retrieve the name of the bus\r
343 controller. It will not be NULL for a bus\r
344 driver that wishes to retrieve the name of a\r
345 child controller.\r
346\r
347 @param Language[in] A pointer to a Null-terminated ASCII string\r
348 array indicating the language. This is the\r
349 language of the driver name that the caller is\r
350 requesting, and it must match one of the\r
351 languages specified in SupportedLanguages. The\r
352 number of languages supported by a driver is up\r
353 to the driver writer. Language is specified in\r
354 RFC 3066 or ISO 639-2 language code format.\r
355\r
356 @param ControllerName[out] A pointer to the Unicode string to return.\r
357 This Unicode string is the name of the\r
358 controller specified by ControllerHandle and\r
359 ChildHandle in the language specified by\r
360 Language from the point of view of the driver\r
361 specified by This.\r
362\r
363 @retval EFI_SUCCESS The Unicode string for the user readable name in\r
364 the language specified by Language for the\r
365 driver specified by This was returned in\r
366 DriverName.\r
367\r
368 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
369\r
370 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
371 EFI_HANDLE.\r
372\r
373 @retval EFI_INVALID_PARAMETER Language is NULL.\r
374\r
375 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
376\r
377 @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
378 managing the controller specified by\r
379 ControllerHandle and ChildHandle.\r
380\r
381 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
382 the language specified by Language.\r
383\r
384**/\r
95276127 385EFI_STATUS\r
386EFIAPI\r
387ConSplitterSimplePointerComponentNameGetControllerName (\r
388 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
389 IN EFI_HANDLE ControllerHandle,\r
390 IN EFI_HANDLE ChildHandle OPTIONAL,\r
391 IN CHAR8 *Language,\r
392 OUT CHAR16 **ControllerName\r
393 )\r
95276127 394{\r
395 EFI_STATUS Status;\r
396 EFI_SIMPLE_POINTER_PROTOCOL *SimplePointer;\r
397 //\r
398 // here ChildHandle is not an Optional parameter.\r
399 //\r
400 if (ChildHandle == NULL) {\r
401 return EFI_UNSUPPORTED;\r
402 }\r
403\r
404 Status = gBS->OpenProtocol (\r
405 ControllerHandle,\r
406 &gEfiSimplePointerProtocolGuid,\r
407 (VOID **) &SimplePointer,\r
408 NULL,\r
409 ControllerHandle,\r
410 EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
411 );\r
412 if (EFI_ERROR (Status)) {\r
413 return EFI_UNSUPPORTED;\r
414 }\r
415\r
5bca971e 416 return LookupUnicodeString2 (\r
417 Language,\r
418 This->SupportedLanguages,\r
419 mConSplitterSimplePointerControllerNameTable,\r
420 ControllerName,\r
421 (BOOLEAN)(This == &gConSplitterSimplePointerComponentName)\r
422 );\r
95276127 423}\r
424\r
5bca971e 425/**\r
426 Retrieves a Unicode string that is the user readable name of the controller\r
427 that is being managed by a driver.\r
428\r
429 This function retrieves the user readable name of the controller specified by\r
430 ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
431 driver specified by This has a user readable name in the language specified by\r
432 Language, then a pointer to the controller name is returned in ControllerName,\r
433 and EFI_SUCCESS is returned. If the driver specified by This is not currently\r
434 managing the controller specified by ControllerHandle and ChildHandle,\r
435 then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r
436 support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
437\r
438 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
439 EFI_COMPONENT_NAME_PROTOCOL instance.\r
440\r
441 @param ControllerHandle[in] The handle of a controller that the driver\r
442 specified by This is managing. This handle\r
443 specifies the controller whose name is to be\r
444 returned.\r
445\r
446 @param ChildHandle[in] The handle of the child controller to retrieve\r
447 the name of. This is an optional parameter that\r
448 may be NULL. It will be NULL for device\r
449 drivers. It will also be NULL for a bus drivers\r
450 that wish to retrieve the name of the bus\r
451 controller. It will not be NULL for a bus\r
452 driver that wishes to retrieve the name of a\r
453 child controller.\r
454\r
455 @param Language[in] A pointer to a Null-terminated ASCII string\r
456 array indicating the language. This is the\r
457 language of the driver name that the caller is\r
458 requesting, and it must match one of the\r
459 languages specified in SupportedLanguages. The\r
460 number of languages supported by a driver is up\r
461 to the driver writer. Language is specified in\r
462 RFC 3066 or ISO 639-2 language code format.\r
463\r
464 @param ControllerName[out] A pointer to the Unicode string to return.\r
465 This Unicode string is the name of the\r
466 controller specified by ControllerHandle and\r
467 ChildHandle in the language specified by\r
468 Language from the point of view of the driver\r
469 specified by This.\r
470\r
471 @retval EFI_SUCCESS The Unicode string for the user readable name in\r
472 the language specified by Language for the\r
473 driver specified by This was returned in\r
474 DriverName.\r
475\r
476 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
477\r
478 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
479 EFI_HANDLE.\r
480\r
481 @retval EFI_INVALID_PARAMETER Language is NULL.\r
482\r
483 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
484\r
485 @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
486 managing the controller specified by\r
487 ControllerHandle and ChildHandle.\r
488\r
489 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
490 the language specified by Language.\r
491\r
492**/\r
95276127 493EFI_STATUS\r
494EFIAPI\r
495ConSplitterConOutComponentNameGetControllerName (\r
496 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
497 IN EFI_HANDLE ControllerHandle,\r
498 IN EFI_HANDLE ChildHandle OPTIONAL,\r
499 IN CHAR8 *Language,\r
500 OUT CHAR16 **ControllerName\r
501 )\r
95276127 502{\r
503 EFI_STATUS Status;\r
504 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOut;\r
505 //\r
506 // here ChildHandle is not an Optional parameter.\r
507 //\r
508 if (ChildHandle == NULL) {\r
509 return EFI_UNSUPPORTED;\r
510 }\r
511\r
512 Status = gBS->OpenProtocol (\r
513 ControllerHandle,\r
514 &gEfiSimpleTextOutProtocolGuid,\r
515 (VOID **) &TextOut,\r
516 NULL,\r
517 ControllerHandle,\r
518 EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
519 );\r
520 if (EFI_ERROR (Status)) {\r
521 return EFI_UNSUPPORTED;\r
522 }\r
523\r
5bca971e 524 return LookupUnicodeString2 (\r
525 Language,\r
526 This->SupportedLanguages,\r
527 mConSplitterConOutControllerNameTable,\r
528 ControllerName,\r
529 (BOOLEAN)(This == &gConSplitterConOutComponentName)\r
530 );\r
95276127 531}\r
532\r
5bca971e 533/**\r
534 Retrieves a Unicode string that is the user readable name of the controller\r
535 that is being managed by a driver.\r
536\r
537 This function retrieves the user readable name of the controller specified by\r
538 ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
539 driver specified by This has a user readable name in the language specified by\r
540 Language, then a pointer to the controller name is returned in ControllerName,\r
541 and EFI_SUCCESS is returned. If the driver specified by This is not currently\r
542 managing the controller specified by ControllerHandle and ChildHandle,\r
543 then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r
544 support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
545\r
546 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
547 EFI_COMPONENT_NAME_PROTOCOL instance.\r
548\r
549 @param ControllerHandle[in] The handle of a controller that the driver\r
550 specified by This is managing. This handle\r
551 specifies the controller whose name is to be\r
552 returned.\r
553\r
554 @param ChildHandle[in] The handle of the child controller to retrieve\r
555 the name of. This is an optional parameter that\r
556 may be NULL. It will be NULL for device\r
557 drivers. It will also be NULL for a bus drivers\r
558 that wish to retrieve the name of the bus\r
559 controller. It will not be NULL for a bus\r
560 driver that wishes to retrieve the name of a\r
561 child controller.\r
562\r
563 @param Language[in] A pointer to a Null-terminated ASCII string\r
564 array indicating the language. This is the\r
565 language of the driver name that the caller is\r
566 requesting, and it must match one of the\r
567 languages specified in SupportedLanguages. The\r
568 number of languages supported by a driver is up\r
569 to the driver writer. Language is specified in\r
570 RFC 3066 or ISO 639-2 language code format.\r
571\r
572 @param ControllerName[out] A pointer to the Unicode string to return.\r
573 This Unicode string is the name of the\r
574 controller specified by ControllerHandle and\r
575 ChildHandle in the language specified by\r
576 Language from the point of view of the driver\r
577 specified by This.\r
578\r
579 @retval EFI_SUCCESS The Unicode string for the user readable name in\r
580 the language specified by Language for the\r
581 driver specified by This was returned in\r
582 DriverName.\r
583\r
584 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
585\r
586 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
587 EFI_HANDLE.\r
588\r
589 @retval EFI_INVALID_PARAMETER Language is NULL.\r
590\r
591 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
592\r
593 @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
594 managing the controller specified by\r
595 ControllerHandle and ChildHandle.\r
596\r
597 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
598 the language specified by Language.\r
599\r
600**/\r
95276127 601EFI_STATUS\r
602EFIAPI\r
603ConSplitterStdErrComponentNameGetControllerName (\r
604 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
605 IN EFI_HANDLE ControllerHandle,\r
606 IN EFI_HANDLE ChildHandle OPTIONAL,\r
607 IN CHAR8 *Language,\r
608 OUT CHAR16 **ControllerName\r
609 )\r
95276127 610{\r
611 EFI_STATUS Status;\r
612 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *ErrOut;\r
613 //\r
614 // here ChildHandle is not an Optional parameter.\r
615 //\r
616 if (ChildHandle == NULL) {\r
617 return EFI_UNSUPPORTED;\r
618 }\r
619\r
620 Status = gBS->OpenProtocol (\r
621 ControllerHandle,\r
622 &gEfiSimpleTextOutProtocolGuid,\r
623 (VOID **) &ErrOut,\r
624 NULL,\r
625 ControllerHandle,\r
626 EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
627 );\r
628 if (EFI_ERROR (Status)) {\r
629 return EFI_UNSUPPORTED;\r
630 }\r
631\r
5bca971e 632 return LookupUnicodeString2 (\r
633 Language,\r
634 This->SupportedLanguages,\r
635 mConSplitterStdErrControllerNameTable,\r
636 ControllerName,\r
637 (BOOLEAN)(This == &gConSplitterStdErrComponentName)\r
638 );\r
95276127 639}\r