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