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