Check in following modules,
[mirror_edk2.git] / MdeModulePkg / Universal / Console / ConPlatformDxe / ComponentName.c
1 /*++
2
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 ComponentName.c
15
16 Abstract:
17
18 --*/
19
20 //
21 // Include common header file for this module.
22 //
23
24
25 #include "ConPlatform.h"
26 #include "ComponentName.h"
27
28 //
29 // EFI Component Name Protocol
30 //
31 EFI_COMPONENT_NAME_PROTOCOL gConPlatformComponentName = {
32 ConPlatformComponentNameGetDriverName,
33 ConPlatformComponentNameGetControllerName,
34 "eng"
35 };
36
37 STATIC EFI_UNICODE_STRING_TABLE mConPlatformDriverNameTable[] = {
38 {
39 "eng",
40 L"Platform Console Management Driver"
41 },
42 {
43 NULL,
44 NULL
45 }
46 };
47
48 EFI_STATUS
49 EFIAPI
50 ConPlatformComponentNameGetDriverName (
51 IN EFI_COMPONENT_NAME_PROTOCOL *This,
52 IN CHAR8 *Language,
53 OUT CHAR16 **DriverName
54 )
55 /*++
56
57 Routine Description:
58 Retrieves a Unicode string that is the user readable name of the EFI Driver.
59
60 Arguments:
61 This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
62 Language - A pointer to a three character ISO 639-2 language identifier.
63 This is the language of the driver name that that the caller
64 is requesting, and it must match one of the languages specified
65 in SupportedLanguages. The number of languages supported by a
66 driver is up to the driver writer.
67 DriverName - A pointer to the Unicode string to return. This Unicode string
68 is the name of the driver specified by This in the language
69 specified by Language.
70
71 Returns:
72 EFI_SUCCESS - The Unicode string for the Driver specified by This
73 and the language specified by Language was returned
74 in DriverName.
75 EFI_INVALID_PARAMETER - Language is NULL.
76 EFI_INVALID_PARAMETER - DriverName is NULL.
77 EFI_UNSUPPORTED - The driver specified by This does not support the
78 language specified by Language.
79
80 --*/
81 {
82 return LookupUnicodeString (
83 Language,
84 gConPlatformComponentName.SupportedLanguages,
85 mConPlatformDriverNameTable,
86 DriverName
87 );
88 }
89
90 EFI_STATUS
91 EFIAPI
92 ConPlatformComponentNameGetControllerName (
93 IN EFI_COMPONENT_NAME_PROTOCOL *This,
94 IN EFI_HANDLE ControllerHandle,
95 IN EFI_HANDLE ChildHandle OPTIONAL,
96 IN CHAR8 *Language,
97 OUT CHAR16 **ControllerName
98 )
99 /*++
100
101 Routine Description:
102 Retrieves a Unicode string that is the user readable name of the controller
103 that is being managed by an EFI Driver.
104
105 Arguments:
106 This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
107 ControllerHandle - The handle of a controller that the driver specified by
108 This is managing. This handle specifies the controller
109 whose name is to be returned.
110 ChildHandle - The handle of the child controller to retrieve the name
111 of. This is an optional parameter that may be NULL. It
112 will be NULL for device drivers. It will also be NULL
113 for a bus drivers that wish to retrieve the name of the
114 bus controller. It will not be NULL for a bus driver
115 that wishes to retrieve the name of a child controller.
116 Language - A pointer to a three character ISO 639-2 language
117 identifier. This is the language of the controller name
118 that that the caller is requesting, and it must match one
119 of the languages specified in SupportedLanguages. The
120 number of languages supported by a driver is up to the
121 driver writer.
122 ControllerName - A pointer to the Unicode string to return. This Unicode
123 string is the name of the controller specified by
124 ControllerHandle and ChildHandle in the language
125 specified by Language from the point of view of the
126 driver specified by This.
127
128 Returns:
129 EFI_SUCCESS - The Unicode string for the user readable name in the
130 language specified by Language for the driver
131 specified by This was returned in DriverName.
132 EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
133 EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid
134 EFI_HANDLE.
135 EFI_INVALID_PARAMETER - Language is NULL.
136 EFI_INVALID_PARAMETER - ControllerName is NULL.
137 EFI_UNSUPPORTED - The driver specified by This is not currently
138 managing the controller specified by
139 ControllerHandle and ChildHandle.
140 EFI_UNSUPPORTED - The driver specified by This does not support the
141 language specified by Language.
142
143 --*/
144 {
145 return EFI_UNSUPPORTED;
146 }