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