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