]> git.proxmox.com Git - mirror_edk2.git/blob - DuetPkg/IsaAcpiDxe/ComponentName.c
Porting Duet module from EDKI to EDKII
[mirror_edk2.git] / DuetPkg / IsaAcpiDxe / ComponentName.c
1 /*++
2
3 Copyright (c) 2006 - 2007, 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
13 Module Name:
14
15 ComponentName.c
16
17 Abstract:
18
19 --*/
20
21 #include "PcatIsaAcpi.h"
22
23 //
24 // EFI Component Name Functions
25 //
26 EFI_STATUS
27 EFIAPI
28 PcatIsaAcpiComponentNameGetDriverName (
29 IN EFI_COMPONENT_NAME_PROTOCOL *This,
30 IN CHAR8 *Language,
31 OUT CHAR16 **DriverName
32 );
33
34 EFI_STATUS
35 EFIAPI
36 PcatIsaAcpiComponentNameGetControllerName (
37 IN EFI_COMPONENT_NAME_PROTOCOL *This,
38 IN EFI_HANDLE ControllerHandle,
39 IN EFI_HANDLE ChildHandle OPTIONAL,
40 IN CHAR8 *Language,
41 OUT CHAR16 **ControllerName
42 );
43
44 //
45 // EFI Component Name Protocol
46 //
47
48 EFI_COMPONENT_NAME2_PROTOCOL gPcatIsaAcpiComponentName2 = {
49 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) PcatIsaAcpiComponentNameGetDriverName,
50 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) PcatIsaAcpiComponentNameGetControllerName,
51 "en"
52 };
53
54 EFI_COMPONENT_NAME_PROTOCOL gPcatIsaAcpiComponentName = {
55 PcatIsaAcpiComponentNameGetDriverName,
56 PcatIsaAcpiComponentNameGetControllerName,
57 "eng"
58 };
59
60
61 static EFI_UNICODE_STRING_TABLE mPcatIsaAcpiDriverNameTable[] = {
62 {
63 "eng;en",
64 L"PC-AT ISA Device Enumeration Driver"
65 },
66 {
67 NULL,
68 NULL
69 }
70 };
71
72 EFI_STATUS
73 EFIAPI
74 PcatIsaAcpiComponentNameGetDriverName (
75 IN EFI_COMPONENT_NAME_PROTOCOL *This,
76 IN CHAR8 *Language,
77 OUT CHAR16 **DriverName
78 )
79 /*++
80
81 Routine Description:
82 Retrieves a Unicode string that is the user readable name of the EFI Driver.
83
84 Arguments:
85 This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
86 Language - A pointer to a three character ISO 639-2 language identifier.
87 This is the language of the driver name that that the caller
88 is requesting, and it must match one of the languages specified
89 in SupportedLanguages. The number of languages supported by a
90 driver is up to the driver writer.
91 DriverName - A pointer to the Unicode string to return. This Unicode string
92 is the name of the driver specified by This in the language
93 specified by Language.
94
95 Returns:
96 EFI_SUCCES - The Unicode string for the Driver specified by This
97 and the language specified by Language was returned
98 in DriverName.
99 EFI_INVALID_PARAMETER - Language is NULL.
100 EFI_INVALID_PARAMETER - DriverName is NULL.
101 EFI_UNSUPPORTED - The driver specified by This does not support the
102 language specified by Language.
103
104 --*/
105 {
106 return LookupUnicodeString2 (
107 Language,
108 This->SupportedLanguages,
109 mPcatIsaAcpiDriverNameTable,
110 DriverName,
111 (BOOLEAN)(This == &gPcatIsaAcpiComponentName)
112 );
113 }
114
115 EFI_STATUS
116 EFIAPI
117 PcatIsaAcpiComponentNameGetControllerName (
118 IN EFI_COMPONENT_NAME_PROTOCOL *This,
119 IN EFI_HANDLE ControllerHandle,
120 IN EFI_HANDLE ChildHandle OPTIONAL,
121 IN CHAR8 *Language,
122 OUT CHAR16 **ControllerName
123 )
124 /*++
125
126 Routine Description:
127 Retrieves a Unicode string that is the user readable name of the controller
128 that is being managed by an EFI Driver.
129
130 Arguments:
131 This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
132 ControllerHandle - The handle of a controller that the driver specified by
133 This is managing. This handle specifies the controller
134 whose name is to be returned.
135 ChildHandle - The handle of the child controller to retrieve the name
136 of. This is an optional parameter that may be NULL. It
137 will be NULL for device drivers. It will also be NULL
138 for a bus drivers that wish to retrieve the name of the
139 bus controller. It will not be NULL for a bus driver
140 that wishes to retrieve the name of a child controller.
141 Language - A pointer to a three character ISO 639-2 language
142 identifier. This is the language of the controller name
143 that that the caller is requesting, and it must match one
144 of the languages specified in SupportedLanguages. The
145 number of languages supported by a driver is up to the
146 driver writer.
147 ControllerName - A pointer to the Unicode string to return. This Unicode
148 string is the name of the controller specified by
149 ControllerHandle and ChildHandle in the language specified
150 by Language from the point of view of the driver specified
151 by This.
152
153 Returns:
154 EFI_SUCCESS - The Unicode string for the user readable name in the
155 language specified by Language for the driver
156 specified by This was returned in DriverName.
157 EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
158 EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.
159 EFI_INVALID_PARAMETER - Language is NULL.
160 EFI_INVALID_PARAMETER - ControllerName is NULL.
161 EFI_UNSUPPORTED - The driver specified by This is not currently managing
162 the controller specified by ControllerHandle and
163 ChildHandle.
164 EFI_UNSUPPORTED - The driver specified by This does not support the
165 language specified by Language.
166
167 --*/
168 {
169 return EFI_UNSUPPORTED;
170 }