]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/Ftp4.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdePkg / Include / Protocol / Ftp4.h
CommitLineData
badd7e61 1/** @file\r
2 EFI FTPv4 (File Transfer Protocol version 4) Protocol Definition\r
9095d37b 3 The EFI FTPv4 Protocol is used to locate communication devices that are\r
badd7e61 4 supported by an EFI FTPv4 Protocol driver and to create and destroy instances\r
5 of the EFI FTPv4 Protocol child protocol driver that can use the underlying\r
6 communication device.\r
7 The definitions in this file are defined in UEFI Specification 2.3, which have\r
8 not been verified by one implementation yet.\r
9\r
9095d37b 10 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
9344f092 11 SPDX-License-Identifier: BSD-2-Clause-Patent\r
badd7e61 12\r
9095d37b 13 @par Revision Reference:\r
5899caf0 14 This Protocol is introduced in UEFI Specification 2.2\r
15\r
badd7e61 16**/\r
17\r
18#ifndef __EFI_FTP4_PROTOCOL_H__\r
19#define __EFI_FTP4_PROTOCOL_H__\r
20\r
badd7e61 21#define EFI_FTP4_SERVICE_BINDING_PROTOCOL_GUID \\r
22 { \\r
23 0xfaaecb1, 0x226e, 0x4782, {0xaa, 0xce, 0x7d, 0xb9, 0xbc, 0xbf, 0x4d, 0xaf } \\r
24 }\r
25\r
26#define EFI_FTP4_PROTOCOL_GUID \\r
27 { \\r
28 0xeb338826, 0x681b, 0x4295, {0xb3, 0x56, 0x2b, 0x36, 0x4c, 0x75, 0x7b, 0x9 } \\r
29 }\r
30\r
31typedef struct _EFI_FTP4_PROTOCOL EFI_FTP4_PROTOCOL;\r
32\r
33///\r
34/// EFI_FTP4_CONNECTION_TOKEN\r
35///\r
36typedef struct {\r
9095d37b
LG
37 ///\r
38 /// The Event to signal after the connection is established and Status field is updated\r
39 /// by the EFI FTP v4 Protocol driver. The type of Event must be\r
40 /// EVENT_NOTIFY_SIGNAL, and its Task Priority Level (TPL) must be lower than or\r
41 /// equal to TPL_CALLBACK. If it is set to NULL, this function will not return until the\r
badd7e61 42 /// function completes.\r
9095d37b 43 ///\r
2f88bd3a 44 EFI_EVENT Event;\r
badd7e61 45 ///\r
46 /// The variable to receive the result of the completed operation.\r
47 /// EFI_SUCCESS: The FTP connection is established successfully\r
9095d37b
LG
48 /// EFI_ACCESS_DENIED: The FTP server denied the access the user's request to access it.\r
49 /// EFI_CONNECTION_RESET: The connect fails because the connection is reset either by instance\r
badd7e61 50 /// itself or communication peer.\r
9095d37b 51 /// EFI_TIMEOUT: The connection establishment timer expired and no more specific\r
badd7e61 52 /// information is available.\r
9095d37b
LG
53 /// EFI_NETWORK_UNREACHABLE: The active open fails because an ICMP network unreachable error is\r
54 /// received.\r
55 /// EFI_HOST_UNREACHABLE: The active open fails because an ICMP host unreachable error is\r
56 /// received.\r
57 /// EFI_PROTOCOL_UNREACHABLE: The active open fails because an ICMP protocol unreachable error is\r
badd7e61 58 /// received.\r
9095d37b 59 /// EFI_PORT_UNREACHABLE: The connection establishment timer times out and an ICMP port\r
badd7e61 60 /// unreachable error is received.\r
9095d37b 61 /// EFI_ICMP_ERROR: The connection establishment timer timeout and some other ICMP\r
badd7e61 62 /// error is received.\r
63 /// EFI_DEVICE_ERROR: An unexpected system or network error occurred.\r
9095d37b 64 ///\r
2f88bd3a 65 EFI_STATUS Status;\r
badd7e61 66} EFI_FTP4_CONNECTION_TOKEN;\r
67\r
68///\r
9095d37b 69/// EFI_FTP4_CONFIG_DATA\r
badd7e61 70///\r
71typedef struct {\r
9095d37b
LG
72 ///\r
73 /// Pointer to a ASCII string that contains user name. The caller is\r
badd7e61 74 /// responsible for freeing Username after GetModeData() is called.\r
9095d37b 75 ///\r
2f88bd3a 76 UINT8 *Username;\r
9095d37b
LG
77 ///\r
78 /// Pointer to a ASCII string that contains password. The caller is\r
badd7e61 79 /// responsible for freeing Password after GetModeData() is called.\r
9095d37b 80 ///\r
2f88bd3a 81 UINT8 *Password;\r
9095d37b
LG
82 ///\r
83 /// Set it to TRUE to initiate an active data connection. Set it to\r
badd7e61 84 /// FALSE to initiate a passive data connection.\r
9095d37b 85 ///\r
2f88bd3a 86 BOOLEAN Active;\r
9095d37b 87 ///\r
badd7e61 88 /// Boolean value indicating if default network settting used.\r
9095d37b 89 ///\r
2f88bd3a 90 BOOLEAN UseDefaultSetting;\r
9095d37b 91 ///\r
badd7e61 92 /// IP address of station if UseDefaultSetting is FALSE.\r
9095d37b 93 ///\r
2f88bd3a 94 EFI_IPv4_ADDRESS StationIp;\r
9095d37b 95 ///\r
badd7e61 96 /// Subnet mask of station if UseDefaultSetting is FALSE.\r
9095d37b 97 ///\r
2f88bd3a 98 EFI_IPv4_ADDRESS SubnetMask;\r
9095d37b 99 ///\r
badd7e61 100 /// IP address of gateway if UseDefaultSetting is FALSE.\r
9095d37b 101 ///\r
2f88bd3a 102 EFI_IPv4_ADDRESS GatewayIp;\r
9095d37b 103 ///\r
badd7e61 104 /// IP address of FTPv4 server.\r
9095d37b 105 ///\r
2f88bd3a 106 EFI_IPv4_ADDRESS ServerIp;\r
9095d37b
LG
107 ///\r
108 /// FTPv4 server port number of control connection, and the default\r
badd7e61 109 /// value is 21 as convention.\r
9095d37b 110 ///\r
2f88bd3a 111 UINT16 ServerPort;\r
9095d37b
LG
112 ///\r
113 /// FTPv4 server port number of data connection. If it is zero, use\r
114 /// (ServerPort - 1) by convention.\r
115 ///\r
2f88bd3a 116 UINT16 AltDataPort;\r
9095d37b
LG
117 ///\r
118 /// A byte indicate the representation type. The right 4 bit is used for\r
badd7e61 119 /// first parameter, the left 4 bit is use for second parameter\r
120 /// - For the first parameter, 0x0 = image, 0x1 = EBCDIC, 0x2 = ASCII, 0x3 = local\r
9095d37b 121 /// - For the second parameter, 0x0 = Non-print, 0x1 = Telnet format effectors, 0x2 =\r
badd7e61 122 /// Carriage Control.\r
123 /// - If it is a local type, the second parameter is the local byte byte size.\r
124 /// - If it is a image type, the second parameter is undefined.\r
9095d37b 125 ///\r
2f88bd3a 126 UINT8 RepType;\r
9095d37b 127 ///\r
badd7e61 128 /// Defines the file structure in FTP used. 0x00 = file, 0x01 = record, 0x02 = page.\r
9095d37b 129 ///\r
2f88bd3a 130 UINT8 FileStruct;\r
9095d37b 131 ///\r
badd7e61 132 /// Defines the transifer mode used in FTP. 0x00 = stream, 0x01 = Block, 0x02 = Compressed.\r
9095d37b 133 ///\r
2f88bd3a 134 UINT8 TransMode;\r
badd7e61 135} EFI_FTP4_CONFIG_DATA;\r
136\r
137typedef struct _EFI_FTP4_COMMAND_TOKEN EFI_FTP4_COMMAND_TOKEN;\r
138\r
139/**\r
140 Callback function when process inbound or outbound data.\r
141\r
142 If it is receiving function that leads to inbound data, the callback function\r
143 is called when data buffer is full. Then, old data in the data buffer should be\r
144 flushed and new data is stored from the beginning of data buffer.\r
9095d37b
LG
145 If it is a transmit function that lead to outbound data and the size of\r
146 Data in daata buffer has been transmitted, this callback function is called to\r
147 supply additional data to be transmitted.\r
badd7e61 148\r
149 @param[in] This Pointer to the EFI_FTP4_PROTOCOL instance.\r
150 @param[in] Token Pointer to the token structure to provide the parameters that\r
151 are used in this operation.\r
152 @return User defined Status.\r
153\r
154**/\r
155typedef\r
9095d37b
LG
156EFI_STATUS\r
157(EFIAPI *EFI_FTP4_DATA_CALLBACK)(\r
badd7e61 158 IN EFI_FTP4_PROTOCOL *This,\r
159 IN EFI_FTP4_COMMAND_TOKEN *Token\r
160 );\r
161\r
162///\r
163/// EFI_FTP4_COMMAND_TOKEN\r
164///\r
165struct _EFI_FTP4_COMMAND_TOKEN {\r
9095d37b
LG
166 ///\r
167 /// The Event to signal after request is finished and Status field\r
168 /// is updated by the EFI FTP v4 Protocol driver. The type of Event\r
169 /// must be EVT_NOTIFY_SIGNAL, and its Task Priority Level\r
170 /// (TPL) must be lower than or equal to TPL_CALLBACK. If it is\r
171 /// set to NULL, related function must wait until the function\r
badd7e61 172 /// completes.\r
9095d37b 173 ///\r
2f88bd3a 174 EFI_EVENT Event;\r
9095d37b
LG
175 ///\r
176 /// Pointer to a null-terminated ASCII name string.\r
177 ///\r
2f88bd3a 178 UINT8 *Pathname;\r
9095d37b 179 ///\r
badd7e61 180 /// The size of data buffer in bytes.\r
9095d37b 181 ///\r
2f88bd3a 182 UINT64 DataBufferSize;\r
9095d37b
LG
183 ///\r
184 /// Pointer to the data buffer. Data downloaded from FTP server\r
badd7e61 185 /// through connection is downloaded here.\r
9095d37b 186 ///\r
2f88bd3a 187 VOID *DataBuffer;\r
9095d37b
LG
188 ///\r
189 /// Pointer to a callback function. If it is receiving function that leads\r
190 /// to inbound data, the callback function is called when databuffer is\r
191 /// full. Then, old data in the data buffer should be flushed and new\r
192 /// data is stored from the beginning of data buffer. If it is a transmit\r
193 /// function that lead to outbound data and DataBufferSize of\r
194 /// Data in DataBuffer has been transmitted, this callback\r
195 /// function is called to supply additional data to be transmitted. The\r
196 /// size of additional data to be transmitted is indicated in\r
197 /// DataBufferSize, again. If there is no data remained,\r
badd7e61 198 /// DataBufferSize should be set to 0.\r
9095d37b 199 ///\r
2f88bd3a 200 EFI_FTP4_DATA_CALLBACK DataCallback;\r
9095d37b 201 ///\r
badd7e61 202 /// Pointer to the parameter for DataCallback.\r
9095d37b 203 ///\r
2f88bd3a 204 VOID *Context;\r
9095d37b 205 ///\r
badd7e61 206 /// The variable to receive the result of the completed operation.\r
207 /// EFI_SUCCESS: The FTP command is completed successfully.\r
208 /// EFI_ACCESS_DENIED: The FTP server denied the access to the requested file.\r
209 /// EFI_CONNECTION_RESET: The connect fails because the connection is reset either\r
210 /// by instance itself or communication peer.\r
9095d37b 211 /// EFI_TIMEOUT: The connection establishment timer expired and no more\r
badd7e61 212 /// specific information is available.\r
213 /// EFI_NETWORK_UNREACHABLE: The active open fails because an ICMP network unreachable\r
9095d37b 214 /// error is received.\r
badd7e61 215 /// EFI_HOST_UNREACHABLE: The active open fails because an ICMP host unreachable\r
9095d37b 216 /// error is received.\r
badd7e61 217 /// EFI_PROTOCOL_UNREACHABLE: The active open fails because an ICMP protocol unreachable\r
218 /// error is received.\r
219 /// EFI_PORT_UNREACHABLE: The connection establishment timer times out and an ICMP port\r
220 /// unreachable error is received.\r
221 /// EFI_ICMP_ERROR: The connection establishment timer timeout and some other ICMP\r
222 /// error is received.\r
223 /// EFI_DEVICE_ERROR: An unexpected system or network error occurred.\r
224 ///\r
2f88bd3a 225 EFI_STATUS Status;\r
badd7e61 226};\r
227\r
228/**\r
229 Gets the current operational settings.\r
230\r
231 The GetModeData() function reads the current operational settings of this\r
9095d37b 232 EFI FTPv4 Protocol driver instance. EFI_FTP4_CONFIG_DATA is defined in the\r
badd7e61 233 EFI_FTP4_PROTOCOL.Configure.\r
234\r
235 @param[in] This Pointer to the EFI_FTP4_PROTOCOL instance.\r
9095d37b 236 @param[out] ModeData Pointer to storage for the EFI FTPv4 Protocol driver\r
badd7e61 237 mode data. The string buffers for Username and Password\r
238 in EFI_FTP4_CONFIG_DATA are allocated by the function,\r
9095d37b 239 and the caller should take the responsibility to free the\r
badd7e61 240 buffer later.\r
241\r
242 @retval EFI_SUCCESS This function is called successfully.\r
243 @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:\r
244 - This is NULL.\r
245 - ModeData is NULL.\r
246 @retval EFI_NOT_STARTED The EFI FTPv4 Protocol driver has not been started\r
247 @retval EFI_OUT_OF_RESOURCES Could not allocate enough resource to finish the operation.\r
248 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
249\r
250**/\r
9095d37b
LG
251typedef\r
252EFI_STATUS\r
badd7e61 253(EFIAPI *EFI_FTP4_GET_MODE_DATA)(\r
254 IN EFI_FTP4_PROTOCOL *This,\r
255 OUT EFI_FTP4_CONFIG_DATA *ModeData\r
256 );\r
257\r
258/**\r
259 Disconnecting a FTP connection gracefully.\r
260\r
261 The Connect() function will initiate a connection request to the remote FTP server\r
9095d37b 262 with the corresponding connection token. If this function returns EFI_SUCCESS, the\r
badd7e61 263 connection sequence is initiated successfully. If the connection succeeds or faild\r
264 due to any error, the Token->Event will be signaled and Token->Status will be updated\r
265 accordingly.\r
266\r
267 @param[in] This Pointer to the EFI_FTP4_PROTOCOL instance.\r
268 @param[in] Token Pointer to the token used to establish control connection.\r
269\r
270 @retval EFI_SUCCESS The connection sequence is successfully initiated.\r
271 @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:\r
272 - This is NULL.\r
273 - Token is NULL.\r
274 - Token->Event is NULL.\r
275 @retval EFI_NOT_STARTED The EFI FTPv4 Protocol driver has not been started.\r
9095d37b 276 @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,\r
badd7e61 277 RARP, etc.) is not finished yet.\r
278 @retval EFI_OUT_OF_RESOURCES Could not allocate enough resource to finish the operation.\r
279 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
280\r
281**/\r
282typedef\r
283EFI_STATUS\r
284(EFIAPI *EFI_FTP4_CONNECT)(\r
285 IN EFI_FTP4_PROTOCOL *This,\r
286 IN EFI_FTP4_CONNECTION_TOKEN *Token\r
287 );\r
288\r
289/**\r
290 Disconnecting a FTP connection gracefully.\r
291\r
292 The Close() function will initiate a close request to the remote FTP server with the\r
9095d37b 293 corresponding connection token. If this function returns EFI_SUCCESS, the control\r
badd7e61 294 connection with the remote FTP server is closed.\r
295\r
296 @param[in] This Pointer to the EFI_FTP4_PROTOCOL instance.\r
297 @param[in] Token Pointer to the token used to close control connection.\r
298\r
299 @retval EFI_SUCCESS The close request is successfully initiated.\r
300 @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:\r
301 - This is NULL.\r
302 - Token is NULL.\r
303 - Token->Event is NULL.\r
304 @retval EFI_NOT_STARTED The EFI FTPv4 Protocol driver has not been started.\r
9095d37b 305 @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,\r
badd7e61 306 RARP, etc.) is not finished yet.\r
307 @retval EFI_OUT_OF_RESOURCES Could not allocate enough resource to finish the operation.\r
308 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
309\r
310**/\r
311typedef\r
312EFI_STATUS\r
313(EFIAPI *EFI_FTP4_CLOSE)(\r
314 IN EFI_FTP4_PROTOCOL *This,\r
315 IN EFI_FTP4_CONNECTION_TOKEN *Token\r
316 );\r
317\r
318/**\r
319 Sets or clears the operational parameters for the FTP child driver.\r
320\r
9095d37b 321 The Configure() function will configure the connected FTP session with the\r
badd7e61 322 configuration setting specified in FtpConfigData. The configuration data can\r
323 be reset by calling Configure() with FtpConfigData set to NULL.\r
324\r
325 @param[in] This Pointer to the EFI_FTP4_PROTOCOL instance.\r
9095d37b 326 @param[in] FtpConfigData Pointer to configuration data that will be assigned to\r
badd7e61 327 the FTP child driver instance. If NULL, the FTP child\r
9095d37b 328 driver instance is reset to startup defaults and all\r
badd7e61 329 pending transmit and receive requests are flushed.\r
330\r
331 @retval EFI_SUCCESS The FTPv4 driver was configured successfully.\r
332 @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE:\r
333 - This is NULL.\r
334 - FtpConfigData.RepType is invalid.\r
335 - FtpConfigData.FileStruct is invalid.\r
336 - FtpConfigData.TransMode is invalid.\r
337 - IP address in FtpConfigData is invalid.\r
9095d37b 338 @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,\r
badd7e61 339 RARP, etc.) is not finished yet.\r
340 @retval EFI_UNSUPPORTED One or more of the configuration parameters are not supported\r
9095d37b
LG
341 by this implementation.\r
342 @retval EFI_OUT_OF_RESOURCES The EFI FTPv4 Protocol driver instance data could not be\r
badd7e61 343 allocated.\r
9095d37b 344 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The EFI FTPv4\r
badd7e61 345 Protocol driver instance is not configured.\r
346\r
347**/\r
348typedef\r
349EFI_STATUS\r
350(EFIAPI *EFI_FTP4_CONFIGURE)(\r
351 IN EFI_FTP4_PROTOCOL *This,\r
352 IN EFI_FTP4_CONFIG_DATA *FtpConfigData OPTIONAL\r
353 );\r
354\r
badd7e61 355/**\r
9095d37b 356 Downloads a file from an FTPv4 server.\r
badd7e61 357\r
358 The ReadFile() function is used to initialize and start an FTPv4 download process\r
359 and optionally wait for completion. When the download operation completes, whether\r
9095d37b 360 successfully or not, the Token.Status field is updated by the EFI FTPv4 Protocol\r
badd7e61 361 driver and then Token.Event is signaled (if it is not NULL).\r
362\r
363 Data will be downloaded from the FTPv4 server into Token.DataBuffer. If the file size\r
9095d37b 364 is larger than Token.DataBufferSize, Token.DataCallback will be called to allow for\r
badd7e61 365 processing data and then new data will be placed at the beginning of Token.DataBuffer.\r
366\r
367 @param[in] This Pointer to the EFI_FTP4_PROTOCOL instance.\r
368 @param[in] Token Pointer to the token structure to provide the parameters that\r
369 are used in this operation.\r
370\r
371 @retval EFI_SUCCESS The data file is being downloaded successfully.\r
372 @retval EFI_INVALID_PARAMETER One or more of the parameters is not valid.\r
373 - This is NULL.\r
374 - Token is NULL.\r
375 - Token.Pathname is NULL.\r
376 - Token. DataBuffer is NULL.\r
377 - Token. DataBufferSize is 0.\r
378 @retval EFI_NOT_STARTED The EFI FTPv4 Protocol driver has not been started.\r
9095d37b 379 @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,\r
badd7e61 380 RARP, etc.) is not finished yet.\r
381 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r
382 @retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.\r
383\r
384**/\r
9095d37b
LG
385typedef\r
386EFI_STATUS\r
badd7e61 387(EFIAPI *EFI_FTP4_READ_FILE)(\r
388 IN EFI_FTP4_PROTOCOL *This,\r
389 IN EFI_FTP4_COMMAND_TOKEN *Token\r
390 );\r
391\r
392/**\r
9095d37b 393 Uploads a file from an FTPv4 server.\r
badd7e61 394\r
395 The WriteFile() function is used to initialize and start an FTPv4 upload process and\r
396 optionally wait for completion. When the upload operation completes, whether successfully\r
397 or not, the Token.Status field is updated by the EFI FTPv4 Protocol driver and then\r
398 Token.Event is signaled (if it is not NULL). Data to be uploaded to server is stored\r
9095d37b 399 into Token.DataBuffer. Token.DataBufferSize is the number bytes to be transferred.\r
badd7e61 400 If the file size is larger than Token.DataBufferSize, Token.DataCallback will be called\r
9095d37b 401 to allow for processing data and then new data will be placed at the beginning of\r
badd7e61 402 Token.DataBuffer. Token.DataBufferSize is updated to reflect the actual number of bytes\r
403 to be transferred. Token.DataBufferSize is set to 0 by the call back to indicate the\r
404 completion of data transfer.\r
405\r
406 @param[in] This Pointer to the EFI_FTP4_PROTOCOL instance.\r
407 @param[in] Token Pointer to the token structure to provide the parameters that\r
408 are used in this operation.\r
409\r
410 @retval EFI_SUCCESS TThe data file is being uploaded successfully.\r
411 @retval EFI_UNSUPPORTED The operation is not supported by this implementation.\r
412 @retval EFI_INVALID_PARAMETER One or more of the parameters is not valid.\r
413 - This is NULL.\r
414 - Token is NULL.\r
415 - Token.Pathname is NULL.\r
416 - Token. DataBuffer is NULL.\r
417 - Token. DataBufferSize is 0.\r
418 @retval EFI_NOT_STARTED The EFI FTPv4 Protocol driver has not been started.\r
9095d37b 419 @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,\r
badd7e61 420 RARP, etc.) is not finished yet.\r
421 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r
422 @retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.\r
423\r
424**/\r
9095d37b
LG
425typedef\r
426EFI_STATUS\r
badd7e61 427(EFIAPI *EFI_FTP4_WRITE_FILE)(\r
428 IN EFI_FTP4_PROTOCOL *This,\r
429 IN EFI_FTP4_COMMAND_TOKEN *Token\r
430 );\r
431\r
432/**\r
9095d37b 433 Download a data file "directory" from a FTPv4 server. May be unsupported in some EFI\r
badd7e61 434 implementations.\r
435\r
436 The ReadDirectory() function is used to return a list of files on the FTPv4 server that\r
437 logically (or operationally) related to Token.Pathname, and optionally wait for completion.\r
9095d37b 438 When the download operation completes, whether successfully or not, the Token.Status field\r
badd7e61 439 is updated by the EFI FTPv4 Protocol driver and then Token.Event is signaled (if it is not\r
440 NULL). Data will be downloaded from the FTPv4 server into Token.DataBuffer. If the file size\r
441 is larger than Token.DataBufferSize, Token.DataCallback will be called to allow for processing\r
9095d37b 442 data and then new data will be placed at the beginning of Token.DataBuffer.\r
badd7e61 443\r
444 @param[in] This Pointer to the EFI_FTP4_PROTOCOL instance.\r
445 @param[in] Token Pointer to the token structure to provide the parameters that\r
446 are used in this operation.\r
447\r
448 @retval EFI_SUCCESS The file list information is being downloaded successfully.\r
449 @retval EFI_UNSUPPORTED The operation is not supported by this implementation.\r
450 @retval EFI_INVALID_PARAMETER One or more of the parameters is not valid.\r
451 - This is NULL.\r
452 - Token is NULL.\r
453 - Token. DataBuffer is NULL.\r
454 - Token. DataBufferSize is 0.\r
455 @retval EFI_NOT_STARTED The EFI FTPv4 Protocol driver has not been started.\r
9095d37b 456 @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,\r
badd7e61 457 RARP, etc.) is not finished yet.\r
458 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r
459 @retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.\r
460\r
461**/\r
462typedef\r
463EFI_STATUS\r
464(EFIAPI *EFI_FTP4_READ_DIRECTORY)(\r
465 IN EFI_FTP4_PROTOCOL *This,\r
466 IN EFI_FTP4_COMMAND_TOKEN *Token\r
467 );\r
468\r
469/**\r
9095d37b 470 Polls for incoming data packets and processes outgoing data packets.\r
badd7e61 471\r
472 The Poll() function can be used by network drivers and applications to increase the\r
473 rate that data packets are moved between the communications device and the transmit\r
474 and receive queues. In some systems, the periodic timer event in the managed network\r
9095d37b 475 driver may not poll the underlying communications device fast enough to transmit\r
badd7e61 476 and/or receive all data packets without missing incoming packets or dropping outgoing\r
477 packets. Drivers and applications that are experiencing packet loss should try calling\r
9095d37b 478 the Poll() function more often.\r
badd7e61 479\r
480 @param[in] This Pointer to the EFI_FTP4_PROTOCOL instance.\r
481\r
482 @retval EFI_SUCCESS Incoming or outgoing data was processed.\r
483 @retval EFI_NOT_STARTED This EFI FTPv4 Protocol instance has not been started.\r
484 @retval EFI_INVALID_PARAMETER This is NULL.\r
485 @retval EFI_DEVICE_ERROR EapAuthType An unexpected system or network error occurred.\r
486 @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.\r
487 Consider increasing the polling rate.\r
488\r
489**/\r
490typedef\r
491EFI_STATUS\r
492(EFIAPI *EFI_FTP4_POLL)(\r
493 IN EFI_FTP4_PROTOCOL *This\r
494 );\r
495\r
496///\r
9095d37b
LG
497/// EFI_FTP4_PROTOCOL\r
498/// provides basic services for client-side FTP (File Transfer Protocol)\r
badd7e61 499/// operations.\r
500///\r
501struct _EFI_FTP4_PROTOCOL {\r
502 EFI_FTP4_GET_MODE_DATA GetModeData;\r
503 EFI_FTP4_CONNECT Connect;\r
504 EFI_FTP4_CLOSE Close;\r
505 EFI_FTP4_CONFIGURE Configure;\r
506 EFI_FTP4_READ_FILE ReadFile;\r
507 EFI_FTP4_WRITE_FILE WriteFile;\r
508 EFI_FTP4_READ_DIRECTORY ReadDirectory;\r
509 EFI_FTP4_POLL Poll;\r
510};\r
511\r
2f88bd3a
MK
512extern EFI_GUID gEfiFtp4ServiceBindingProtocolGuid;\r
513extern EFI_GUID gEfiFtp4ProtocolGuid;\r
badd7e61 514\r
515#endif\r