]>
Commit | Line | Data |
---|---|---|
772db4bb | 1 | /** @file\r |
2 | \r | |
284ee2e8 | 3 | Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r |
e5eed7d3 | 4 | This program and the accompanying materials\r |
772db4bb | 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\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 | |
772db4bb | 12 | **/\r |
13 | \r | |
14 | \r | |
15 | #include "Dhcp4Impl.h"\r | |
16 | \r | |
17 | //\r | |
18 | // EFI Component Name Functions\r | |
19 | //\r | |
83cbd279 | 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 | |
3e8c18da | 30 | @param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r |
83cbd279 | 31 | EFI_COMPONENT_NAME_PROTOCOL instance.\r |
32 | \r | |
3e8c18da | 33 | @param[in] Language A pointer to a Null-terminated ASCII string\r |
83cbd279 | 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 | |
0254efc0 | 40 | in RFC 4646 or ISO 639-2 language code format.\r |
83cbd279 | 41 | \r |
3e8c18da | 42 | @param[out] DriverName A pointer to the Unicode string to return.\r |
83cbd279 | 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 | |
772db4bb | 59 | EFI_STATUS\r |
60 | EFIAPI\r | |
61 | DhcpComponentNameGetDriverName (\r | |
62 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
63 | IN CHAR8 *Language,\r | |
64 | OUT CHAR16 **DriverName\r | |
65 | );\r | |
66 | \r | |
83cbd279 | 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 | |
3e8c18da | 81 | @param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r |
83cbd279 | 82 | EFI_COMPONENT_NAME_PROTOCOL instance.\r |
83 | \r | |
3e8c18da | 84 | @param[in] ControllerHandle The handle of a controller that the driver\r |
83cbd279 | 85 | specified by This is managing. This handle\r |
86 | specifies the controller whose name is to be\r | |
87 | returned.\r | |
88 | \r | |
3e8c18da | 89 | @param[in] ChildHandle The handle of the child controller to retrieve\r |
83cbd279 | 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 | |
3e8c18da | 98 | @param[in] Language A pointer to a Null-terminated ASCII string\r |
83cbd279 | 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 | |
0254efc0 | 105 | RFC 4646 or ISO 639-2 language code format.\r |
83cbd279 | 106 | \r |
3e8c18da | 107 | @param[out] ControllerName A pointer to the Unicode string to return.\r |
83cbd279 | 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 | |
284ee2e8 | 119 | @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r |
83cbd279 | 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 | |
772db4bb | 136 | EFI_STATUS\r |
137 | EFIAPI\r | |
138 | DhcpComponentNameGetControllerName (\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 | |
83cbd279 | 146 | \r |
772db4bb | 147 | //\r |
148 | // EFI Component Name Protocol\r | |
149 | //\r | |
1307dcd7 | 150 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gDhcp4ComponentName = {\r |
772db4bb | 151 | DhcpComponentNameGetDriverName,\r |
152 | DhcpComponentNameGetControllerName,\r | |
153 | "eng"\r | |
1307dcd7 | 154 | };\r |
83cbd279 | 155 | \r |
156 | //\r | |
157 | // EFI Component Name 2 Protocol\r | |
158 | //\r | |
1307dcd7 | 159 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gDhcp4ComponentName2 = {\r |
83cbd279 | 160 | (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) DhcpComponentNameGetDriverName,\r |
161 | (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) DhcpComponentNameGetControllerName,\r | |
162 | "en"\r | |
1307dcd7 | 163 | };\r |
83cbd279 | 164 | \r |
772db4bb | 165 | \r |
d1aeb0bd | 166 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mDhcpDriverNameTable[] = {\r |
772db4bb | 167 | {\r |
83cbd279 | 168 | "eng;en",\r |
772db4bb | 169 | L"DHCP Protocol Driver"\r |
170 | },\r | |
171 | {\r | |
172 | NULL,\r | |
173 | NULL\r | |
174 | }\r | |
175 | };\r | |
176 | \r | |
83cbd279 | 177 | /**\r |
178 | Retrieves a Unicode string that is the user readable name of the driver.\r | |
179 | \r | |
180 | This function retrieves the user readable name of a driver in the form of a\r | |
181 | Unicode string. If the driver specified by This has a user readable name in\r | |
182 | the language specified by Language, then a pointer to the driver name is\r | |
183 | returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r | |
184 | by This does not support the language specified by Language,\r | |
185 | then EFI_UNSUPPORTED is returned.\r | |
186 | \r | |
3e8c18da | 187 | @param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r |
83cbd279 | 188 | EFI_COMPONENT_NAME_PROTOCOL instance.\r |
189 | \r | |
3e8c18da | 190 | @param[in] Language A pointer to a Null-terminated ASCII string\r |
83cbd279 | 191 | array indicating the language. This is the\r |
192 | language of the driver name that the caller is\r | |
193 | requesting, and it must match one of the\r | |
194 | languages specified in SupportedLanguages. The\r | |
195 | number of languages supported by a driver is up\r | |
196 | to the driver writer. Language is specified\r | |
0254efc0 | 197 | in RFC 4646 or ISO 639-2 language code format.\r |
83cbd279 | 198 | \r |
3e8c18da | 199 | @param[out] DriverName A pointer to the Unicode string to return.\r |
83cbd279 | 200 | This Unicode string is the name of the\r |
201 | driver specified by This in the language\r | |
202 | specified by Language.\r | |
203 | \r | |
204 | @retval EFI_SUCCESS The Unicode string for the Driver specified by\r | |
205 | This and the language specified by Language was\r | |
206 | returned in DriverName.\r | |
207 | \r | |
208 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
209 | \r | |
210 | @retval EFI_INVALID_PARAMETER DriverName is NULL.\r | |
211 | \r | |
212 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
213 | the language specified by Language.\r | |
214 | \r | |
215 | **/\r | |
772db4bb | 216 | EFI_STATUS\r |
217 | EFIAPI\r | |
218 | DhcpComponentNameGetDriverName (\r | |
219 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
220 | IN CHAR8 *Language,\r | |
221 | OUT CHAR16 **DriverName\r | |
222 | )\r | |
772db4bb | 223 | {\r |
83cbd279 | 224 | return LookupUnicodeString2 (\r |
225 | Language,\r | |
226 | This->SupportedLanguages,\r | |
227 | mDhcpDriverNameTable,\r | |
228 | DriverName,\r | |
229 | (BOOLEAN)(This == &gDhcp4ComponentName)\r | |
230 | );\r | |
772db4bb | 231 | }\r |
232 | \r | |
83cbd279 | 233 | /**\r |
234 | Retrieves a Unicode string that is the user readable name of the controller\r | |
235 | that is being managed by a driver.\r | |
236 | \r | |
237 | This function retrieves the user readable name of the controller specified by\r | |
238 | ControllerHandle and ChildHandle in the form of a Unicode string. If the\r | |
239 | driver specified by This has a user readable name in the language specified by\r | |
240 | Language, then a pointer to the controller name is returned in ControllerName,\r | |
241 | and EFI_SUCCESS is returned. If the driver specified by This is not currently\r | |
242 | managing the controller specified by ControllerHandle and ChildHandle,\r | |
243 | then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r | |
244 | support the language specified by Language, then EFI_UNSUPPORTED is returned.\r | |
245 | \r | |
3e8c18da | 246 | @param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r |
83cbd279 | 247 | EFI_COMPONENT_NAME_PROTOCOL instance.\r |
248 | \r | |
3e8c18da | 249 | @param[in] ControllerHandle The handle of a controller that the driver\r |
83cbd279 | 250 | specified by This is managing. This handle\r |
251 | specifies the controller whose name is to be\r | |
252 | returned.\r | |
253 | \r | |
3e8c18da | 254 | @param[in] ChildHandle The handle of the child controller to retrieve\r |
83cbd279 | 255 | the name of. This is an optional parameter that\r |
256 | may be NULL. It will be NULL for device\r | |
257 | drivers. It will also be NULL for a bus drivers\r | |
258 | that wish to retrieve the name of the bus\r | |
259 | controller. It will not be NULL for a bus\r | |
260 | driver that wishes to retrieve the name of a\r | |
261 | child controller.\r | |
262 | \r | |
3e8c18da | 263 | @param[in] Language A pointer to a Null-terminated ASCII string\r |
83cbd279 | 264 | array indicating the language. This is the\r |
265 | language of the driver name that the caller is\r | |
266 | requesting, and it must match one of the\r | |
267 | languages specified in SupportedLanguages. The\r | |
268 | number of languages supported by a driver is up\r | |
269 | to the driver writer. Language is specified in\r | |
0254efc0 | 270 | RFC 4646 or ISO 639-2 language code format.\r |
83cbd279 | 271 | \r |
3e8c18da | 272 | @param[out] ControllerName A pointer to the Unicode string to return.\r |
83cbd279 | 273 | This Unicode string is the name of the\r |
274 | controller specified by ControllerHandle and\r | |
275 | ChildHandle in the language specified by\r | |
276 | Language from the point of view of the driver\r | |
277 | specified by This.\r | |
278 | \r | |
279 | @retval EFI_SUCCESS The Unicode string for the user readable name in\r | |
280 | the language specified by Language for the\r | |
281 | driver specified by This was returned in\r | |
282 | DriverName.\r | |
283 | \r | |
284ee2e8 | 284 | @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r |
83cbd279 | 285 | \r |
286 | @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r | |
287 | EFI_HANDLE.\r | |
288 | \r | |
289 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
290 | \r | |
291 | @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r | |
292 | \r | |
293 | @retval EFI_UNSUPPORTED The driver specified by This is not currently\r | |
294 | managing the controller specified by\r | |
295 | ControllerHandle and ChildHandle.\r | |
296 | \r | |
297 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
298 | the language specified by Language.\r | |
299 | \r | |
300 | **/\r | |
772db4bb | 301 | EFI_STATUS\r |
302 | EFIAPI\r | |
303 | DhcpComponentNameGetControllerName (\r | |
304 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
305 | IN EFI_HANDLE ControllerHandle,\r | |
306 | IN EFI_HANDLE ChildHandle OPTIONAL,\r | |
307 | IN CHAR8 *Language,\r | |
308 | OUT CHAR16 **ControllerName\r | |
309 | )\r | |
772db4bb | 310 | {\r |
311 | return EFI_UNSUPPORTED;\r | |
312 | }\r |