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