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