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