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