]> git.proxmox.com Git - mirror_edk2.git/blame - PcAtChipsetPkg/IsaAcpiDxe/ComponentName.c
Add generic HPET Timer DXE Driver and support libraries
[mirror_edk2.git] / PcAtChipsetPkg / IsaAcpiDxe / ComponentName.c
CommitLineData
18c97f53 1/** @file\r
2 UEFI Component Name(2) protocol implementation for IsaAcpi driver.\r
c69dd9df 3\r
69cb32fc 4Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
18c97f53 5This program and the accompanying materials \r
c69dd9df 6are licensed and made available under the terms and conditions of the BSD License \r
7which accompanies this distribution. The full text of the license may be found at \r
8http://opensource.org/licenses/bsd-license.php \r
9 \r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
18c97f53 12**/\r
c69dd9df 13\r
18c97f53 14#include "PcatIsaAcpi.h"\r
c69dd9df 15\r
18c97f53 16//\r
17// EFI Component Name Functions\r
18//\r
19/**\r
20 Retrieves a Unicode string that is the user readable name of the driver.\r
c69dd9df 21\r
18c97f53 22 This function retrieves the user readable name of a driver in the form of a\r
23 Unicode string. If the driver specified by This has a user readable name in\r
24 the language specified by Language, then a pointer to the driver name is\r
25 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
26 by This does not support the language specified by Language,\r
27 then EFI_UNSUPPORTED is returned.\r
c69dd9df 28\r
18c97f53 29 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
30 EFI_COMPONENT_NAME_PROTOCOL instance.\r
c69dd9df 31\r
18c97f53 32 @param Language[in] A pointer to a Null-terminated ASCII string\r
33 array indicating the language. This is the\r
34 language of the driver name that the caller is\r
35 requesting, and it must match one of the\r
36 languages specified in SupportedLanguages. The\r
37 number of languages supported by a driver is up\r
38 to the driver writer. Language is specified\r
39 in RFC 4646 or ISO 639-2 language code format.\r
c69dd9df 40\r
18c97f53 41 @param DriverName[out] A pointer to the Unicode string to return.\r
42 This Unicode string is the name of the\r
43 driver specified by This in the language\r
44 specified by Language.\r
c69dd9df 45\r
18c97f53 46 @retval EFI_SUCCESS The Unicode string for the Driver specified by\r
47 This and the language specified by Language was\r
48 returned in DriverName.\r
49\r
50 @retval EFI_INVALID_PARAMETER Language is NULL.\r
51\r
52 @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
53\r
54 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
55 the language specified by Language.\r
56\r
57**/\r
c69dd9df 58EFI_STATUS\r
59EFIAPI\r
60PcatIsaAcpiComponentNameGetDriverName (\r
61 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
62 IN CHAR8 *Language,\r
63 OUT CHAR16 **DriverName\r
64 );\r
65\r
18c97f53 66/**\r
67 Retrieves a Unicode string that is the user readable name of the controller\r
68 that is being managed by a driver.\r
69\r
70 This function retrieves the user readable name of the controller specified by\r
71 ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
72 driver specified by This has a user readable name in the language specified by\r
73 Language, then a pointer to the controller name is returned in ControllerName,\r
74 and EFI_SUCCESS is returned. If the driver specified by This is not currently\r
75 managing the controller specified by ControllerHandle and ChildHandle,\r
76 then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r
77 support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
78\r
79 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
80 EFI_COMPONENT_NAME_PROTOCOL instance.\r
81\r
82 @param ControllerHandle[in] The handle of a controller that the driver\r
83 specified by This is managing. This handle\r
84 specifies the controller whose name is to be\r
85 returned.\r
86\r
87 @param ChildHandle[in] The handle of the child controller to retrieve\r
88 the name of. This is an optional parameter that\r
89 may be NULL. It will be NULL for device\r
90 drivers. It will also be NULL for a bus drivers\r
91 that wish to retrieve the name of the bus\r
92 controller. It will not be NULL for a bus\r
93 driver that wishes to retrieve the name of a\r
94 child controller.\r
95\r
96 @param Language[in] A pointer to a Null-terminated ASCII string\r
97 array indicating the language. This is the\r
98 language of the driver name that the caller is\r
99 requesting, and it must match one of the\r
100 languages specified in SupportedLanguages. The\r
101 number of languages supported by a driver is up\r
102 to the driver writer. Language is specified in\r
103 RFC 4646 or ISO 639-2 language code format.\r
104\r
105 @param ControllerName[out] A pointer to the Unicode string to return.\r
106 This Unicode string is the name of the\r
107 controller specified by ControllerHandle and\r
108 ChildHandle in the language specified by\r
109 Language from the point of view of the driver\r
110 specified by This.\r
111\r
112 @retval EFI_SUCCESS The Unicode string for the user readable name in\r
113 the language specified by Language for the\r
114 driver specified by This was returned in\r
115 DriverName.\r
116\r
69cb32fc 117 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r
18c97f53 118\r
119 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
120 EFI_HANDLE.\r
121\r
122 @retval EFI_INVALID_PARAMETER Language is NULL.\r
123\r
124 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
125\r
126 @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
127 managing the controller specified by\r
128 ControllerHandle and ChildHandle.\r
129\r
130 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
131 the language specified by Language.\r
132\r
133**/\r
c69dd9df 134EFI_STATUS\r
135EFIAPI\r
136PcatIsaAcpiComponentNameGetControllerName (\r
137 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
138 IN EFI_HANDLE ControllerHandle,\r
139 IN EFI_HANDLE ChildHandle OPTIONAL,\r
140 IN CHAR8 *Language,\r
141 OUT CHAR16 **ControllerName\r
142 );\r
143\r
144//\r
145// EFI Component Name Protocol\r
146//\r
147\r
148EFI_COMPONENT_NAME2_PROTOCOL gPcatIsaAcpiComponentName2 = {\r
149 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) PcatIsaAcpiComponentNameGetDriverName,\r
150 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) PcatIsaAcpiComponentNameGetControllerName,\r
151 "en"\r
152};\r
153\r
154EFI_COMPONENT_NAME_PROTOCOL gPcatIsaAcpiComponentName = {\r
155 PcatIsaAcpiComponentNameGetDriverName,\r
156 PcatIsaAcpiComponentNameGetControllerName,\r
157 "eng"\r
158};\r
159\r
160\r
e56dd2ce 161EFI_UNICODE_STRING_TABLE mPcatIsaAcpiDriverNameTable[] = {\r
c69dd9df 162 {\r
163 "eng;en",\r
164 L"PC-AT ISA Device Enumeration Driver"\r
165 },\r
166 {\r
167 NULL,\r
168 NULL\r
169 }\r
170};\r
171\r
18c97f53 172/**\r
173 Retrieves a Unicode string that is the user readable name of the driver.\r
174\r
175 This function retrieves the user readable name of a driver in the form of a\r
176 Unicode string. If the driver specified by This has a user readable name in\r
177 the language specified by Language, then a pointer to the driver name is\r
178 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
179 by This does not support the language specified by Language,\r
180 then EFI_UNSUPPORTED is returned.\r
181\r
182 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
183 EFI_COMPONENT_NAME_PROTOCOL instance.\r
184\r
185 @param Language[in] A pointer to a Null-terminated ASCII string\r
186 array indicating the language. This is the\r
187 language of the driver name that the caller is\r
188 requesting, and it must match one of the\r
189 languages specified in SupportedLanguages. The\r
190 number of languages supported by a driver is up\r
191 to the driver writer. Language is specified\r
192 in RFC 4646 or ISO 639-2 language code format.\r
193\r
194 @param DriverName[out] A pointer to the Unicode string to return.\r
195 This Unicode string is the name of the\r
196 driver specified by This in the language\r
197 specified by Language.\r
198\r
199 @retval EFI_SUCCESS The Unicode string for the Driver specified by\r
200 This and the language specified by Language was\r
201 returned in DriverName.\r
202\r
203 @retval EFI_INVALID_PARAMETER Language is NULL.\r
204\r
205 @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
206\r
207 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
208 the language specified by Language.\r
209\r
210**/\r
c69dd9df 211EFI_STATUS\r
212EFIAPI\r
213PcatIsaAcpiComponentNameGetDriverName (\r
214 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
215 IN CHAR8 *Language,\r
216 OUT CHAR16 **DriverName\r
217 )\r
c69dd9df 218{\r
219 return LookupUnicodeString2 (\r
220 Language,\r
221 This->SupportedLanguages,\r
222 mPcatIsaAcpiDriverNameTable, \r
223 DriverName,\r
224 (BOOLEAN)(This == &gPcatIsaAcpiComponentName)\r
225 );\r
226}\r
227\r
18c97f53 228/**\r
229 Retrieves a Unicode string that is the user readable name of the controller\r
230 that is being managed by a driver.\r
231\r
232 This function retrieves the user readable name of the controller specified by\r
233 ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
234 driver specified by This has a user readable name in the language specified by\r
235 Language, then a pointer to the controller name is returned in ControllerName,\r
236 and EFI_SUCCESS is returned. If the driver specified by This is not currently\r
237 managing the controller specified by ControllerHandle and ChildHandle,\r
238 then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r
239 support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
240\r
241 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
242 EFI_COMPONENT_NAME_PROTOCOL instance.\r
243\r
244 @param ControllerHandle[in] The handle of a controller that the driver\r
245 specified by This is managing. This handle\r
246 specifies the controller whose name is to be\r
247 returned.\r
248\r
249 @param ChildHandle[in] The handle of the child controller to retrieve\r
250 the name of. This is an optional parameter that\r
251 may be NULL. It will be NULL for device\r
252 drivers. It will also be NULL for a bus drivers\r
253 that wish to retrieve the name of the bus\r
254 controller. It will not be NULL for a bus\r
255 driver that wishes to retrieve the name of a\r
256 child controller.\r
257\r
258 @param Language[in] A pointer to a Null-terminated ASCII string\r
259 array indicating the language. This is the\r
260 language of the driver name that the caller is\r
261 requesting, and it must match one of the\r
262 languages specified in SupportedLanguages. The\r
263 number of languages supported by a driver is up\r
264 to the driver writer. Language is specified in\r
265 RFC 4646 or ISO 639-2 language code format.\r
266\r
267 @param ControllerName[out] A pointer to the Unicode string to return.\r
268 This Unicode string is the name of the\r
269 controller specified by ControllerHandle and\r
270 ChildHandle in the language specified by\r
271 Language from the point of view of the driver\r
272 specified by This.\r
273\r
274 @retval EFI_SUCCESS The Unicode string for the user readable name in\r
275 the language specified by Language for the\r
276 driver specified by This was returned in\r
277 DriverName.\r
278\r
69cb32fc 279 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r
18c97f53 280\r
281 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
282 EFI_HANDLE.\r
283\r
284 @retval EFI_INVALID_PARAMETER Language is NULL.\r
285\r
286 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
287\r
288 @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
289 managing the controller specified by\r
290 ControllerHandle and ChildHandle.\r
291\r
292 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
293 the language specified by Language.\r
294\r
295**/\r
c69dd9df 296EFI_STATUS\r
297EFIAPI\r
298PcatIsaAcpiComponentNameGetControllerName (\r
299 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
300 IN EFI_HANDLE ControllerHandle,\r
301 IN EFI_HANDLE ChildHandle OPTIONAL,\r
302 IN CHAR8 *Language,\r
303 OUT CHAR16 **ControllerName\r
304 )\r
c69dd9df 305{\r
306 return EFI_UNSUPPORTED;\r
307}\r