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