]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Console/ConSplitterDxe/ComponentName.c
add UsbMouseSimulateTouchPad driver to verify the correction of dispatching AbsoluteP...
[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
5bca971e 237/**\r
238 Retrieves a Unicode string that is the user readable name of the controller\r
239 that is being managed by a driver.\r
240\r
241 This function retrieves the user readable name of the controller specified by\r
242 ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
243 driver specified by This has a user readable name in the language specified by\r
244 Language, then a pointer to the controller name is returned in ControllerName,\r
245 and EFI_SUCCESS is returned. If the driver specified by This is not currently\r
246 managing the controller specified by ControllerHandle and ChildHandle,\r
247 then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r
248 support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
249\r
250 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
251 EFI_COMPONENT_NAME_PROTOCOL instance.\r
252\r
253 @param ControllerHandle[in] The handle of a controller that the driver\r
254 specified by This is managing. This handle\r
255 specifies the controller whose name is to be\r
256 returned.\r
257\r
258 @param ChildHandle[in] The handle of the child controller to retrieve\r
259 the name of. This is an optional parameter that\r
260 may be NULL. It will be NULL for device\r
261 drivers. It will also be NULL for a bus drivers\r
262 that wish to retrieve the name of the bus\r
263 controller. It will not be NULL for a bus\r
264 driver that wishes to retrieve the name of a\r
265 child controller.\r
266\r
267 @param Language[in] A pointer to a Null-terminated ASCII string\r
268 array indicating the language. This is the\r
269 language of the driver name that the caller is\r
270 requesting, and it must match one of the\r
271 languages specified in SupportedLanguages. The\r
272 number of languages supported by a driver is up\r
273 to the driver writer. Language is specified in\r
274 RFC 3066 or ISO 639-2 language code format.\r
275\r
276 @param ControllerName[out] A pointer to the Unicode string to return.\r
277 This Unicode string is the name of the\r
278 controller specified by ControllerHandle and\r
279 ChildHandle in the language specified by\r
280 Language from the point of view of the driver\r
281 specified by This.\r
282\r
283 @retval EFI_SUCCESS The Unicode string for the user readable name in\r
284 the language specified by Language for the\r
285 driver specified by This was returned in\r
286 DriverName.\r
287\r
288 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
289\r
290 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
291 EFI_HANDLE.\r
292\r
293 @retval EFI_INVALID_PARAMETER Language is NULL.\r
294\r
295 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
296\r
297 @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
298 managing the controller specified by\r
299 ControllerHandle and ChildHandle.\r
300\r
301 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
302 the language specified by Language.\r
303\r
304**/\r
95276127 305EFI_STATUS\r
306EFIAPI\r
307ConSplitterConInComponentNameGetControllerName (\r
308 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
309 IN EFI_HANDLE ControllerHandle,\r
310 IN EFI_HANDLE ChildHandle OPTIONAL,\r
311 IN CHAR8 *Language,\r
312 OUT CHAR16 **ControllerName\r
313 )\r
95276127 314{\r
315 EFI_STATUS Status;\r
316 EFI_SIMPLE_TEXT_INPUT_PROTOCOL *TextIn;\r
317 //\r
318 // here ChildHandle is not an Optional parameter.\r
319 //\r
320 if (ChildHandle == NULL) {\r
321 return EFI_UNSUPPORTED;\r
322 }\r
323\r
324 Status = gBS->OpenProtocol (\r
325 ControllerHandle,\r
326 &gEfiSimpleTextInProtocolGuid,\r
327 (VOID **) &TextIn,\r
328 NULL,\r
329 ControllerHandle,\r
330 EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
331 );\r
332 if (EFI_ERROR (Status)) {\r
333 return EFI_UNSUPPORTED;\r
334 }\r
335\r
5bca971e 336 return LookupUnicodeString2 (\r
95276127 337 Language,\r
5bca971e 338 This->SupportedLanguages,\r
95276127 339 mConSplitterConInControllerNameTable,\r
5bca971e 340 ControllerName,\r
341 (BOOLEAN)(This == &gConSplitterConInComponentName)\r
95276127 342 );\r
343}\r
344\r
5bca971e 345/**\r
346 Retrieves a Unicode string that is the user readable name of the controller\r
347 that is being managed by a driver.\r
348\r
349 This function retrieves the user readable name of the controller specified by\r
350 ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
351 driver specified by This has a user readable name in the language specified by\r
352 Language, then a pointer to the controller name is returned in ControllerName,\r
353 and EFI_SUCCESS is returned. If the driver specified by This is not currently\r
354 managing the controller specified by ControllerHandle and ChildHandle,\r
355 then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r
356 support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
357\r
358 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
359 EFI_COMPONENT_NAME_PROTOCOL instance.\r
360\r
361 @param ControllerHandle[in] The handle of a controller that the driver\r
362 specified by This is managing. This handle\r
363 specifies the controller whose name is to be\r
364 returned.\r
365\r
366 @param ChildHandle[in] The handle of the child controller to retrieve\r
367 the name of. This is an optional parameter that\r
368 may be NULL. It will be NULL for device\r
369 drivers. It will also be NULL for a bus drivers\r
370 that wish to retrieve the name of the bus\r
371 controller. It will not be NULL for a bus\r
372 driver that wishes to retrieve the name of a\r
373 child controller.\r
374\r
375 @param Language[in] A pointer to a Null-terminated ASCII string\r
376 array indicating the language. This is the\r
377 language of the driver name that the caller is\r
378 requesting, and it must match one of the\r
379 languages specified in SupportedLanguages. The\r
380 number of languages supported by a driver is up\r
381 to the driver writer. Language is specified in\r
382 RFC 3066 or ISO 639-2 language code format.\r
383\r
384 @param ControllerName[out] A pointer to the Unicode string to return.\r
385 This Unicode string is the name of the\r
386 controller specified by ControllerHandle and\r
387 ChildHandle in the language specified by\r
388 Language from the point of view of the driver\r
389 specified by This.\r
390\r
391 @retval EFI_SUCCESS The Unicode string for the user readable name in\r
392 the language specified by Language for the\r
393 driver specified by This was returned in\r
394 DriverName.\r
395\r
396 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
397\r
398 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
399 EFI_HANDLE.\r
400\r
401 @retval EFI_INVALID_PARAMETER Language is NULL.\r
402\r
403 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
404\r
405 @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
406 managing the controller specified by\r
407 ControllerHandle and ChildHandle.\r
408\r
409 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
410 the language specified by Language.\r
411\r
412**/\r
95276127 413EFI_STATUS\r
414EFIAPI\r
415ConSplitterSimplePointerComponentNameGetControllerName (\r
416 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
417 IN EFI_HANDLE ControllerHandle,\r
418 IN EFI_HANDLE ChildHandle OPTIONAL,\r
419 IN CHAR8 *Language,\r
420 OUT CHAR16 **ControllerName\r
421 )\r
95276127 422{\r
423 EFI_STATUS Status;\r
424 EFI_SIMPLE_POINTER_PROTOCOL *SimplePointer;\r
425 //\r
426 // here ChildHandle is not an Optional parameter.\r
427 //\r
428 if (ChildHandle == NULL) {\r
429 return EFI_UNSUPPORTED;\r
430 }\r
431\r
432 Status = gBS->OpenProtocol (\r
433 ControllerHandle,\r
434 &gEfiSimplePointerProtocolGuid,\r
435 (VOID **) &SimplePointer,\r
436 NULL,\r
437 ControllerHandle,\r
438 EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
439 );\r
440 if (EFI_ERROR (Status)) {\r
441 return EFI_UNSUPPORTED;\r
442 }\r
443\r
5bca971e 444 return LookupUnicodeString2 (\r
445 Language,\r
446 This->SupportedLanguages,\r
447 mConSplitterSimplePointerControllerNameTable,\r
448 ControllerName,\r
449 (BOOLEAN)(This == &gConSplitterSimplePointerComponentName)\r
450 );\r
95276127 451}\r
452\r
8ae0b360 453EFI_STATUS\r
454EFIAPI\r
455ConSplitterAbsolutePointerComponentNameGetControllerName (\r
456 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
457 IN EFI_HANDLE ControllerHandle,\r
458 IN EFI_HANDLE ChildHandle OPTIONAL,\r
459 IN CHAR8 *Language,\r
460 OUT CHAR16 **ControllerName\r
461 )\r
462/*++\r
463\r
464 Routine Description:\r
465 Retrieves a Unicode string that is the user readable name of the controller\r
466 that is being managed by an EFI Driver.\r
467\r
468 Arguments:\r
469 This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
470 ControllerHandle - The handle of a controller that the driver specified by \r
471 This is managing. This handle specifies the controller \r
472 whose name is to be returned.\r
473 ChildHandle - The handle of the child controller to retrieve the name \r
474 of. This is an optional parameter that may be NULL. It \r
475 will be NULL for device drivers. It will also be NULL \r
476 for a bus drivers that wish to retrieve the name of the \r
477 bus controller. It will not be NULL for a bus driver \r
478 that wishes to retrieve the name of a child controller.\r
479 Language - A pointer to RFC3066 language identifier. \r
480 This is the language of the controller name \r
481 that that the caller is requesting, and it must match one\r
482 of the languages specified in SupportedLanguages. The \r
483 number of languages supported by a driver is up to the \r
484 driver writer.\r
485 ControllerName - A pointer to the Unicode string to return. This Unicode\r
486 string is the name of the controller specified by \r
487 ControllerHandle and ChildHandle in the language \r
488 specified by Language from the point of view of the \r
489 driver specified by This. \r
490\r
491 Returns:\r
492 EFI_SUCCESS - The Unicode string for the user readable name in the\r
493 language specified by Language for the driver \r
494 specified by This was returned in DriverName.\r
495 EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r
496 EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid \r
497 EFI_HANDLE.\r
498 EFI_INVALID_PARAMETER - Language is NULL.\r
499 EFI_INVALID_PARAMETER - ControllerName is NULL.\r
500 EFI_UNSUPPORTED - The driver specified by This is not currently \r
501 managing the controller specified by \r
502 ControllerHandle and ChildHandle.\r
503 EFI_UNSUPPORTED - The driver specified by This does not support the \r
504 language specified by Language.\r
505\r
506--*/\r
507{\r
508 EFI_STATUS Status;\r
509 EFI_ABSOLUTE_POINTER_PROTOCOL *AbsolutePointer;\r
510 //\r
511 // here ChildHandle is not an Optional parameter.\r
512 //\r
513 if (ChildHandle == NULL) {\r
514 return EFI_UNSUPPORTED;\r
515 }\r
516\r
517 Status = gBS->OpenProtocol (\r
518 ControllerHandle,\r
519 &gEfiAbsolutePointerProtocolGuid,\r
520 (VOID **) &AbsolutePointer,\r
521 NULL,\r
522 ControllerHandle,\r
523 EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
524 );\r
525 if (EFI_ERROR (Status)) {\r
526 return EFI_UNSUPPORTED;\r
527 }\r
528\r
529return LookupUnicodeString2 (\r
530 Language,\r
531 This->SupportedLanguages,\r
532 mConSplitterAbsolutePointerControllerNameTable,\r
533 ControllerName,\r
534 (BOOLEAN)(This == &gConSplitterAbsolutePointerComponentName)\r
535 );\r
536}\r
537\r
5bca971e 538/**\r
539 Retrieves a Unicode string that is the user readable name of the controller\r
540 that is being managed by a driver.\r
541\r
542 This function retrieves the user readable name of the controller specified by\r
543 ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
544 driver specified by This has a user readable name in the language specified by\r
545 Language, then a pointer to the controller name is returned in ControllerName,\r
546 and EFI_SUCCESS is returned. If the driver specified by This is not currently\r
547 managing the controller specified by ControllerHandle and ChildHandle,\r
548 then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r
549 support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
550\r
551 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
552 EFI_COMPONENT_NAME_PROTOCOL instance.\r
553\r
554 @param ControllerHandle[in] The handle of a controller that the driver\r
555 specified by This is managing. This handle\r
556 specifies the controller whose name is to be\r
557 returned.\r
558\r
559 @param ChildHandle[in] The handle of the child controller to retrieve\r
560 the name of. This is an optional parameter that\r
561 may be NULL. It will be NULL for device\r
562 drivers. It will also be NULL for a bus drivers\r
563 that wish to retrieve the name of the bus\r
564 controller. It will not be NULL for a bus\r
565 driver that wishes to retrieve the name of a\r
566 child controller.\r
567\r
568 @param Language[in] A pointer to a Null-terminated ASCII string\r
569 array indicating the language. This is the\r
570 language of the driver name that the caller is\r
571 requesting, and it must match one of the\r
572 languages specified in SupportedLanguages. The\r
573 number of languages supported by a driver is up\r
574 to the driver writer. Language is specified in\r
575 RFC 3066 or ISO 639-2 language code format.\r
576\r
577 @param ControllerName[out] A pointer to the Unicode string to return.\r
578 This Unicode string is the name of the\r
579 controller specified by ControllerHandle and\r
580 ChildHandle in the language specified by\r
581 Language from the point of view of the driver\r
582 specified by This.\r
583\r
584 @retval EFI_SUCCESS The Unicode string for the user readable name in\r
585 the language specified by Language for the\r
586 driver specified by This was returned in\r
587 DriverName.\r
588\r
589 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
590\r
591 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
592 EFI_HANDLE.\r
593\r
594 @retval EFI_INVALID_PARAMETER Language is NULL.\r
595\r
596 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
597\r
598 @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
599 managing the controller specified by\r
600 ControllerHandle and ChildHandle.\r
601\r
602 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
603 the language specified by Language.\r
604\r
605**/\r
95276127 606EFI_STATUS\r
607EFIAPI\r
608ConSplitterConOutComponentNameGetControllerName (\r
609 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
610 IN EFI_HANDLE ControllerHandle,\r
611 IN EFI_HANDLE ChildHandle OPTIONAL,\r
612 IN CHAR8 *Language,\r
613 OUT CHAR16 **ControllerName\r
614 )\r
95276127 615{\r
616 EFI_STATUS Status;\r
617 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOut;\r
618 //\r
619 // here ChildHandle is not an Optional parameter.\r
620 //\r
621 if (ChildHandle == NULL) {\r
622 return EFI_UNSUPPORTED;\r
623 }\r
624\r
625 Status = gBS->OpenProtocol (\r
626 ControllerHandle,\r
627 &gEfiSimpleTextOutProtocolGuid,\r
628 (VOID **) &TextOut,\r
629 NULL,\r
630 ControllerHandle,\r
631 EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
632 );\r
633 if (EFI_ERROR (Status)) {\r
634 return EFI_UNSUPPORTED;\r
635 }\r
636\r
5bca971e 637 return LookupUnicodeString2 (\r
638 Language,\r
639 This->SupportedLanguages,\r
640 mConSplitterConOutControllerNameTable,\r
641 ControllerName,\r
642 (BOOLEAN)(This == &gConSplitterConOutComponentName)\r
643 );\r
95276127 644}\r
645\r
5bca971e 646/**\r
647 Retrieves a Unicode string that is the user readable name of the controller\r
648 that is being managed by a driver.\r
649\r
650 This function retrieves the user readable name of the controller specified by\r
651 ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
652 driver specified by This has a user readable name in the language specified by\r
653 Language, then a pointer to the controller name is returned in ControllerName,\r
654 and EFI_SUCCESS is returned. If the driver specified by This is not currently\r
655 managing the controller specified by ControllerHandle and ChildHandle,\r
656 then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r
657 support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
658\r
659 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
660 EFI_COMPONENT_NAME_PROTOCOL instance.\r
661\r
662 @param ControllerHandle[in] The handle of a controller that the driver\r
663 specified by This is managing. This handle\r
664 specifies the controller whose name is to be\r
665 returned.\r
666\r
667 @param ChildHandle[in] The handle of the child controller to retrieve\r
668 the name of. This is an optional parameter that\r
669 may be NULL. It will be NULL for device\r
670 drivers. It will also be NULL for a bus drivers\r
671 that wish to retrieve the name of the bus\r
672 controller. It will not be NULL for a bus\r
673 driver that wishes to retrieve the name of a\r
674 child controller.\r
675\r
676 @param Language[in] A pointer to a Null-terminated ASCII string\r
677 array indicating the language. This is the\r
678 language of the driver name that the caller is\r
679 requesting, and it must match one of the\r
680 languages specified in SupportedLanguages. The\r
681 number of languages supported by a driver is up\r
682 to the driver writer. Language is specified in\r
683 RFC 3066 or ISO 639-2 language code format.\r
684\r
685 @param ControllerName[out] A pointer to the Unicode string to return.\r
686 This Unicode string is the name of the\r
687 controller specified by ControllerHandle and\r
688 ChildHandle in the language specified by\r
689 Language from the point of view of the driver\r
690 specified by This.\r
691\r
692 @retval EFI_SUCCESS The Unicode string for the user readable name in\r
693 the language specified by Language for the\r
694 driver specified by This was returned in\r
695 DriverName.\r
696\r
697 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
698\r
699 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
700 EFI_HANDLE.\r
701\r
702 @retval EFI_INVALID_PARAMETER Language is NULL.\r
703\r
704 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
705\r
706 @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
707 managing the controller specified by\r
708 ControllerHandle and ChildHandle.\r
709\r
710 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
711 the language specified by Language.\r
712\r
713**/\r
95276127 714EFI_STATUS\r
715EFIAPI\r
716ConSplitterStdErrComponentNameGetControllerName (\r
717 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
718 IN EFI_HANDLE ControllerHandle,\r
719 IN EFI_HANDLE ChildHandle OPTIONAL,\r
720 IN CHAR8 *Language,\r
721 OUT CHAR16 **ControllerName\r
722 )\r
95276127 723{\r
724 EFI_STATUS Status;\r
725 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *ErrOut;\r
726 //\r
727 // here ChildHandle is not an Optional parameter.\r
728 //\r
729 if (ChildHandle == NULL) {\r
730 return EFI_UNSUPPORTED;\r
731 }\r
732\r
733 Status = gBS->OpenProtocol (\r
734 ControllerHandle,\r
735 &gEfiSimpleTextOutProtocolGuid,\r
736 (VOID **) &ErrOut,\r
737 NULL,\r
738 ControllerHandle,\r
739 EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
740 );\r
741 if (EFI_ERROR (Status)) {\r
742 return EFI_UNSUPPORTED;\r
743 }\r
744\r
5bca971e 745 return LookupUnicodeString2 (\r
746 Language,\r
747 This->SupportedLanguages,\r
748 mConSplitterStdErrControllerNameTable,\r
749 ControllerName,\r
750 (BOOLEAN)(This == &gConSplitterStdErrComponentName)\r
751 );\r
95276127 752}\r