]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Console/ConPlatformDxe/ComponentName.c
Removed CommonHeader.h from MdePkg & MdeModulePkg
[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
27 //
28 // EFI Component Name Protocol
29 //
30 EFI_COMPONENT_NAME_PROTOCOL gConPlatformComponentName = {
31 ConPlatformComponentNameGetDriverName,
32 ConPlatformComponentNameGetControllerName,
33 "eng"
34 };
35
36 STATIC EFI_UNICODE_STRING_TABLE mConPlatformDriverNameTable[] = {
37 {
38 "eng",
39 L"Platform Console Management Driver"
40 },
41 {
42 NULL,
43 NULL
44 }
45 };
46
47 EFI_STATUS
48 EFIAPI
49 ConPlatformComponentNameGetDriverName (
50 IN EFI_COMPONENT_NAME_PROTOCOL *This,
51 IN CHAR8 *Language,
52 OUT CHAR16 **DriverName
53 )
54 /*++
55
56 Routine Description:
57 Retrieves a Unicode string that is the user readable name of the EFI Driver.
58
59 Arguments:
60 This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
61 Language - A pointer to a three character ISO 639-2 language identifier.
62 This is the language of the driver name that that the caller
63 is requesting, and it must match one of the languages specified
64 in SupportedLanguages. The number of languages supported by a
65 driver is up to the driver writer.
66 DriverName - A pointer to the Unicode string to return. This Unicode string
67 is the name of the driver specified by This in the language
68 specified by Language.
69
70 Returns:
71 EFI_SUCCESS - The Unicode string for the Driver specified by This
72 and the language specified by Language was returned
73 in DriverName.
74 EFI_INVALID_PARAMETER - Language is NULL.
75 EFI_INVALID_PARAMETER - DriverName is NULL.
76 EFI_UNSUPPORTED - The driver specified by This does not support the
77 language specified by Language.
78
79 --*/
80 {
81 return LookupUnicodeString (
82 Language,
83 gConPlatformComponentName.SupportedLanguages,
84 mConPlatformDriverNameTable,
85 DriverName
86 );
87 }
88
89 EFI_STATUS
90 EFIAPI
91 ConPlatformComponentNameGetControllerName (
92 IN EFI_COMPONENT_NAME_PROTOCOL *This,
93 IN EFI_HANDLE ControllerHandle,
94 IN EFI_HANDLE ChildHandle OPTIONAL,
95 IN CHAR8 *Language,
96 OUT CHAR16 **ControllerName
97 )
98 /*++
99
100 Routine Description:
101 Retrieves a Unicode string that is the user readable name of the controller
102 that is being managed by an EFI Driver.
103
104 Arguments:
105 This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
106 ControllerHandle - The handle of a controller that the driver specified by
107 This is managing. This handle specifies the controller
108 whose name is to be returned.
109 ChildHandle - The handle of the child controller to retrieve the name
110 of. This is an optional parameter that may be NULL. It
111 will be NULL for device drivers. It will also be NULL
112 for a bus drivers that wish to retrieve the name of the
113 bus controller. It will not be NULL for a bus driver
114 that wishes to retrieve the name of a child controller.
115 Language - A pointer to a three character ISO 639-2 language
116 identifier. This is the language of the controller name
117 that that the caller is requesting, and it must match one
118 of the languages specified in SupportedLanguages. The
119 number of languages supported by a driver is up to the
120 driver writer.
121 ControllerName - A pointer to the Unicode string to return. This Unicode
122 string is the name of the controller specified by
123 ControllerHandle and ChildHandle in the language
124 specified by Language from the point of view of the
125 driver specified by This.
126
127 Returns:
128 EFI_SUCCESS - The Unicode string for the user readable name in the
129 language specified by Language for the driver
130 specified by This was returned in DriverName.
131 EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
132 EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid
133 EFI_HANDLE.
134 EFI_INVALID_PARAMETER - Language is NULL.
135 EFI_INVALID_PARAMETER - ControllerName is NULL.
136 EFI_UNSUPPORTED - The driver specified by This is not currently
137 managing the controller specified by
138 ControllerHandle and ChildHandle.
139 EFI_UNSUPPORTED - The driver specified by This does not support the
140 language specified by Language.
141
142 --*/
143 {
144 return EFI_UNSUPPORTED;
145 }