]> git.proxmox.com Git - mirror_edk2.git/blob - NetworkPkg/Udp6Dxe/ComponentName.c
Add NetworkPkg (P.UDK2010.UP3.Network.P1)
[mirror_edk2.git] / NetworkPkg / Udp6Dxe / ComponentName.c
1 /** @file
2 UEFI Component Name(2) protocol implementation for UDP6 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 "Udp6Impl.h"
17
18 //
19 // EFI Component Name Functions
20 //
21 /**
22 Retrieves a Unicode string that is the user-readable name of the driver.
23
24 This function retrieves the user-readable name of a driver in the form of a
25 Unicode string. If the driver specified by This has a user-readable name in
26 the language specified by Language, then a pointer to the driver name is
27 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
28 by This does not support the language specified by Language,
29 then EFI_UNSUPPORTED is returned.
30
31 @param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
32 EFI_COMPONENT_NAME_PROTOCOL instance.
33
34 @param[in] Language A pointer to a Null-terminated ASCII string
35 array indicating the language. This is the
36 language of the driver name that the caller is
37 requesting, and it must match one of the
38 languages specified in SupportedLanguages. The
39 number of languages supported by a driver is up
40 to the driver writer. Language is specified
41 in RFC 4646 or ISO 639-2 language code format.
42
43 @param[out] DriverName A pointer to the Unicode string to return.
44 This Unicode string is the name of the
45 driver specified by This in the language
46 specified by Language.
47
48 @retval EFI_SUCCESS The Unicode string for the Driver specified by
49 This and the language specified by Language was
50 returned in DriverName.
51
52 @retval EFI_INVALID_PARAMETER Language is NULL.
53
54 @retval EFI_INVALID_PARAMETER DriverName is NULL.
55
56 @retval EFI_UNSUPPORTED The driver specified by This does not support
57 the language specified by Language.
58
59 **/
60 EFI_STATUS
61 EFIAPI
62 Udp6ComponentNameGetDriverName (
63 IN EFI_COMPONENT_NAME_PROTOCOL *This,
64 IN CHAR8 *Language,
65 OUT CHAR16 **DriverName
66 );
67
68
69 /**
70 Retrieves a Unicode string that is the user-readable name of the controller
71 that is being managed by a driver.
72
73 This function retrieves the user-readable name of the controller specified by
74 ControllerHandle and ChildHandle in the form of a Unicode string. If the
75 driver specified by This has a user-readable name in the language specified by
76 Language, then a pointer to the controller name is returned in ControllerName,
77 and EFI_SUCCESS is returned. If the driver specified by This is not currently
78 managing the controller specified by ControllerHandle and ChildHandle,
79 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
80 support the language specified by Language, then EFI_UNSUPPORTED is returned.
81
82 @param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
83 EFI_COMPONENT_NAME_PROTOCOL instance.
84
85 @param[in] ControllerHandle The handle of a controller that the driver
86 specified by This is managing. This handle
87 specifies the controller whose name is to be
88 returned.
89
90 @param[in] ChildHandle The handle of the child controller to retrieve
91 the name of. This is an optional parameter that
92 may be NULL. It will be NULL for device
93 drivers. It will also be NULL for a bus drivers
94 that wish to retrieve the name of the bus
95 controller. It will not be NULL for a bus
96 driver that wishes to retrieve the name of a
97 child controller.
98
99 @param[in] Language A pointer to a Null-terminated ASCII string
100 array indicating the language. This is the
101 language of the driver name that the caller is
102 requesting, and it must match one of the
103 languages specified in SupportedLanguages. The
104 number of languages supported by a driver is up
105 to the driver writer. Language is specified in
106 RFC 4646 or ISO 639-2 language code format.
107
108 @param[out] ControllerName A pointer to the Unicode string to return.
109 This Unicode string is the name of the
110 controller specified by ControllerHandle and
111 ChildHandle in the language specified by
112 Language from the point of view of the driver
113 specified by This.
114
115 @retval EFI_SUCCESS The Unicode string for the user-readable name in
116 the language specified by Language for the
117 driver specified by This was returned in
118 DriverName.
119
120 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
121
122 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
123 EFI_HANDLE.
124
125 @retval EFI_INVALID_PARAMETER Language is NULL.
126
127 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
128
129 @retval EFI_UNSUPPORTED The driver specified by This is not currently
130 managing the controller specified by
131 ControllerHandle and ChildHandle.
132
133 @retval EFI_UNSUPPORTED The driver specified by This does not support
134 the language specified by Language.
135
136 **/
137 EFI_STATUS
138 EFIAPI
139 Udp6ComponentNameGetControllerName (
140 IN EFI_COMPONENT_NAME_PROTOCOL *This,
141 IN EFI_HANDLE ControllerHandle,
142 IN EFI_HANDLE ChildHandle OPTIONAL,
143 IN CHAR8 *Language,
144 OUT CHAR16 **ControllerName
145 );
146
147 //
148 // EFI Component Name Protocol
149 //
150 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gUdp6ComponentName = {
151 Udp6ComponentNameGetDriverName,
152 Udp6ComponentNameGetControllerName,
153 "eng"
154 };
155
156 //
157 // EFI Component Name 2 Protocol
158 //
159 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gUdp6ComponentName2 = {
160 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) Udp6ComponentNameGetDriverName,
161 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) Udp6ComponentNameGetControllerName,
162 "en"
163 };
164
165
166 GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mUdp6DriverNameTable[] = {
167 {
168 "eng;en",
169 L"UDP6 Network Service Driver"
170 },
171 {
172 NULL,
173 NULL
174 }
175 };
176
177 /**
178 Retrieves a Unicode string that is the user-readable name of the driver.
179
180 This function retrieves the user-readable name of a driver in the form of a
181 Unicode string. If the driver specified by This has a user-readable name in
182 the language specified by Language, then a pointer to the driver name is
183 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
184 by This does not support the language specified by Language,
185 then EFI_UNSUPPORTED is returned.
186
187 @param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
188 EFI_COMPONENT_NAME_PROTOCOL instance.
189
190 @param[in] Language A pointer to a Null-terminated ASCII string
191 array indicating the language. This is the
192 language of the driver name that the caller is
193 requesting, and it must match one of the
194 languages specified in SupportedLanguages. The
195 number of languages supported by a driver is up
196 to the driver writer. Language is specified
197 in RFC 4646 or ISO 639-2 language code format.
198
199 @param[out] DriverName A pointer to the Unicode string to return.
200 This Unicode string is the name of the
201 driver specified by This in the language
202 specified by Language.
203
204 @retval EFI_SUCCESS The Unicode string for the Driver specified by
205 This and the language specified by Language was
206 returned in DriverName.
207
208 @retval EFI_INVALID_PARAMETER Language is NULL.
209
210 @retval EFI_INVALID_PARAMETER DriverName is NULL.
211
212 @retval EFI_UNSUPPORTED The driver specified by This does not support
213 the language specified by Language.
214
215 **/
216 EFI_STATUS
217 EFIAPI
218 Udp6ComponentNameGetDriverName (
219 IN EFI_COMPONENT_NAME_PROTOCOL *This,
220 IN CHAR8 *Language,
221 OUT CHAR16 **DriverName
222 )
223 {
224 return LookupUnicodeString2 (
225 Language,
226 This->SupportedLanguages,
227 mUdp6DriverNameTable,
228 DriverName,
229 (BOOLEAN) (This == &gUdp6ComponentName)
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
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 Udp6ComponentNameGetControllerName (
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 }
313