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