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