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