]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/Mtftp4.h
update codes per MdePkg doxgen review comments.
[mirror_edk2.git] / MdePkg / Include / Protocol / Mtftp4.h
CommitLineData
d1f95000 1/** @file\r
2 EFI Multicast Trivial File Tranfer Protocol Definition\r
3\r
4ca9b6c4 4 Copyright (c) 2006 - 2008, Intel Corporation \r
d1f95000 5 All rights reserved. This program and the accompanying materials \r
6 are licensed and made available under the terms and conditions of the BSD License \r
7 which accompanies this distribution. The full text of the license may be found at \r
8 http://opensource.org/licenses/bsd-license.php \r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
12\r
d1f95000 13**/\r
14\r
15#ifndef __EFI_MTFTP4_PROTOCOL_H__\r
16#define __EFI_MTFTP4_PROTOCOL_H__\r
17\r
18#define EFI_MTFTP4_SERVICE_BINDING_PROTOCOL_GUID \\r
19 { \\r
20 0x2FE800BE, 0x8F01, 0x4aa6, {0x94, 0x6B, 0xD7, 0x13, 0x88, 0xE1, 0x83, 0x3F } \\r
21 }\r
22\r
23#define EFI_MTFTP4_PROTOCOL_GUID \\r
24 { \\r
25 0x78247c57, 0x63db, 0x4708, {0x99, 0xc2, 0xa8, 0xb4, 0xa9, 0xa6, 0x1f, 0x6b } \\r
26 }\r
27\r
28typedef struct _EFI_MTFTP4_PROTOCOL EFI_MTFTP4_PROTOCOL;\r
29typedef struct _EFI_MTFTP4_TOKEN EFI_MTFTP4_TOKEN;\r
30\r
31//\r
32//MTFTP4 packet opcode definition\r
33//\r
34#define EFI_MTFTP4_OPCODE_RRQ 1\r
35#define EFI_MTFTP4_OPCODE_WRQ 2\r
36#define EFI_MTFTP4_OPCODE_DATA 3\r
37#define EFI_MTFTP4_OPCODE_ACK 4\r
38#define EFI_MTFTP4_OPCODE_ERROR 5\r
39#define EFI_MTFTP4_OPCODE_OACK 6\r
40#define EFI_MTFTP4_OPCODE_DIR 7\r
41#define EFI_MTFTP4_OPCODE_DATA8 8\r
42#define EFI_MTFTP4_OPCODE_ACK8 9\r
43\r
44//\r
45// MTFTP4 error code definition\r
46//\r
47#define EFI_MTFTP4_ERRORCODE_NOT_DEFINED 0\r
48#define EFI_MTFTP4_ERRORCODE_FILE_NOT_FOUND 1\r
49#define EFI_MTFTP4_ERRORCODE_ACCESS_VIOLATION 2\r
50#define EFI_MTFTP4_ERRORCODE_DISK_FULL 3\r
51#define EFI_MTFTP4_ERRORCODE_ILLEGAL_OPERATION 4\r
52#define EFI_MTFTP4_ERRORCODE_UNKNOWN_TRANSFER_ID 5\r
53#define EFI_MTFTP4_ERRORCODE_FILE_ALREADY_EXISTS 6\r
54#define EFI_MTFTP4_ERRORCODE_NO_SUCH_USER 7\r
55#define EFI_MTFTP4_ERRORCODE_REQUEST_DENIED 8\r
56\r
57//\r
58// MTFTP4 pacekt definitions\r
59//\r
60#pragma pack(1)\r
61\r
62typedef struct {\r
63 UINT16 OpCode;\r
64 UINT8 Filename[1];\r
65} EFI_MTFTP4_REQ_HEADER;\r
66\r
67typedef struct {\r
68 UINT16 OpCode;\r
69 UINT8 Data[1];\r
70} EFI_MTFTP4_OACK_HEADER;\r
71\r
72typedef struct {\r
73 UINT16 OpCode;\r
74 UINT16 Block;\r
75 UINT8 Data[1];\r
76} EFI_MTFTP4_DATA_HEADER;\r
77\r
78typedef struct {\r
79 UINT16 OpCode;\r
80 UINT16 Block[1];\r
81} EFI_MTFTP4_ACK_HEADER;\r
82\r
83typedef struct {\r
84 UINT16 OpCode;\r
85 UINT64 Block;\r
86 UINT8 Data[1];\r
87} EFI_MTFTP4_DATA8_HEADER;\r
88\r
89typedef struct {\r
90 UINT16 OpCode;\r
91 UINT64 Block[1];\r
92} EFI_MTFTP4_ACK8_HEADER;\r
93\r
94typedef struct {\r
95 UINT16 OpCode;\r
96 UINT16 ErrorCode;\r
97 UINT8 ErrorMessage[1];\r
98} EFI_MTFTP4_ERROR_HEADER;\r
99\r
100typedef union {\r
992f22b9
LG
101 ///\r
102 /// Type of packets as defined by the MTFTPv4 packet opcodes.\r
103 ///\r
d1f95000 104 UINT16 OpCode;\r
992f22b9
LG
105 ///\r
106 /// Read request packet header.\r
107 ///\r
d1f95000 108 EFI_MTFTP4_REQ_HEADER Rrq;\r
992f22b9
LG
109 ///\r
110 /// Write request packet header.\r
111 ///\r
d1f95000 112 EFI_MTFTP4_REQ_HEADER Wrq;\r
992f22b9
LG
113 ///\r
114 /// Option acknowledge packet header.\r
115 ///\r
d1f95000 116 EFI_MTFTP4_OACK_HEADER Oack;\r
992f22b9
LG
117 ///\r
118 /// Data packet header.\r
119 ///\r
d1f95000 120 EFI_MTFTP4_DATA_HEADER Data;\r
992f22b9
LG
121 ///\r
122 /// Acknowledgement packet header.\r
123 ///\r
d1f95000 124 EFI_MTFTP4_ACK_HEADER Ack;\r
992f22b9
LG
125 ///\r
126 /// Data packet header with big block number.\r
127 ///\r
d1f95000 128 EFI_MTFTP4_DATA8_HEADER Data8;\r
992f22b9
LG
129 ///\r
130 /// Acknowledgement header with big block num.\r
131 ///\r
d1f95000 132 EFI_MTFTP4_ACK8_HEADER Ack8;\r
992f22b9
LG
133 ///\r
134 /// Error packet header.\r
135 ///\r
d1f95000 136 EFI_MTFTP4_ERROR_HEADER Error;\r
137} EFI_MTFTP4_PACKET;\r
138\r
139#pragma pack()\r
140\r
99e8ed21 141///\r
142/// MTFTP4 option definition\r
143///\r
d1f95000 144typedef struct {\r
145 UINT8 *OptionStr;\r
146 UINT8 *ValueStr;\r
147} EFI_MTFTP4_OPTION;\r
148\r
149\r
150typedef struct {\r
151 BOOLEAN UseDefaultSetting;\r
152 EFI_IPv4_ADDRESS StationIp;\r
153 EFI_IPv4_ADDRESS SubnetMask;\r
154 UINT16 LocalPort;\r
155 EFI_IPv4_ADDRESS GatewayIp;\r
156 EFI_IPv4_ADDRESS ServerIp;\r
157 UINT16 InitialServerPort;\r
158 UINT16 TryCount;\r
159 UINT16 TimeoutValue;\r
160} EFI_MTFTP4_CONFIG_DATA;\r
161\r
162\r
163typedef struct {\r
164 EFI_MTFTP4_CONFIG_DATA ConfigData;\r
165 UINT8 SupportedOptionCount; \r
166 UINT8 **SupportedOptoins;\r
167 UINT8 UnsupportedOptionCount; \r
168 UINT8 **UnsupportedOptoins;\r
169} EFI_MTFTP4_MODE_DATA;\r
170\r
171\r
172typedef struct {\r
173 EFI_IPv4_ADDRESS GatewayIp;\r
174 EFI_IPv4_ADDRESS ServerIp;\r
175 UINT16 ServerPort;\r
176 UINT16 TryCount;\r
177 UINT16 TimeoutValue;\r
178} EFI_MTFTP4_OVERRIDE_DATA;\r
179\r
180//\r
181// Protocol interfaces definition\r
182//\r
183\r
184/**\r
630b4187 185 A callback function that is provided by the caller to intercept \r
d1f95000 186 the EFI_MTFTP4_OPCODE_DATA or EFI_MTFTP4_OPCODE_DATA8 packets processed in the\r
f754f721 187 EFI_MTFTP4_PROTOCOL.ReadFile() function, and alternatively to intercept \r
d1f95000 188 EFI_MTFTP4_OPCODE_OACK or EFI_MTFTP4_OPCODE_ERROR packets during a call to \r
189 EFI_MTFTP4_PROTOCOL.ReadFile(), WriteFile() or ReadDirectory(). \r
190\r
191 @param This Pointer to the EFI_MTFTP4_PROTOCOL instance.\r
192 @param Token The token that the caller provided in the\r
193 EFI_MTFTP4_PROTOCOL.ReadFile(), WriteFile()\r
194 or ReadDirectory() function.\r
195 @param PacketLen Indicates the length of the packet.\r
196 @param Packet Pointer to an MTFTPv4 packet.\r
197\r
198 @retval EFI_SUCCESS Operation sucess\r
199 @retval Others Abort transfer process\r
200\r
201**/\r
202typedef \r
203EFI_STATUS \r
204(EFIAPI *EFI_MTFTP4_CHECK_PACKET)( \r
205 IN EFI_MTFTP4_PROTOCOL *This,\r
206 IN EFI_MTFTP4_TOKEN *Token,\r
207 IN UINT16 PacketLen,\r
208 IN EFI_MTFTP4_PACKET *Paket\r
ed66e1bc 209 );\r
d1f95000 210\r
211/**\r
212 Timeout callback funtion. \r
213\r
214 @param This Pointer to the EFI_MTFTP4_PROTOCOL instance.\r
215 @param Token The token that is provided in the\r
216 EFI_MTFTP4_PROTOCOL.ReadFile() or\r
217 EFI_MTFTP4_PROTOCOL.WriteFile() or\r
218 EFI_MTFTP4_PROTOCOL.ReadDirectory() functions\r
219 by the caller.\r
220 \r
221 @retval EFI_SUCCESS Operation sucess\r
222 @retval Others Aborts download process.\r
223\r
224**/\r
225typedef \r
226EFI_STATUS \r
227(EFIAPI *EFI_MTFTP4_TIMEOUT_CALLBACK)( \r
228 IN EFI_MTFTP4_PROTOCOL *This,\r
229 IN EFI_MTFTP4_TOKEN *Token\r
ed66e1bc 230 );\r
d1f95000 231\r
232/**\r
630b4187 233 A callback function that the caller provides to feed data to the\r
d1f95000 234 EFI_MTFTP4_PROTOCOL.WriteFile() function.\r
235\r
236 @param This Pointer to the EFI_MTFTP4_PROTOCOL instance.\r
237 @param Token The token provided in the\r
238 EFI_MTFTP4_PROTOCOL.WriteFile() by the caller.\r
239 @param Length Indicates the length of the raw data wanted on input, and the\r
240 length the data available on output.\r
241 @param Buffer Pointer to the buffer where the data is stored.\r
242\r
243 @retval EFI_SUCCESS Operation sucess\r
244 @retval Others Aborts session.\r
245\r
246**/\r
247typedef \r
248EFI_STATUS \r
249(EFIAPI *EFI_MTFTP4_PACKET_NEEDED)( \r
250 IN EFI_MTFTP4_PROTOCOL *This,\r
251 IN EFI_MTFTP4_TOKEN *Token,\r
252 IN OUT UINT16 *Length,\r
253 OUT VOID **Buffer\r
ed66e1bc 254 );\r
d1f95000 255\r
256\r
257/**\r
258 Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device.\r
259\r
260 @param This Pointer to the EFI_MTFTP4_PROTOCOL instance.\r
261 @param ModeData Pointer to storage for the EFI MTFTPv4 Protocol driver mode data.\r
262\r
263 @retval EFI_SUCCESS The configuration data was successfully returned.\r
264 @retval EFI_OUT_OF_RESOURCES The required mode data could not be allocated.\r
265 @retval EFI_INVALID_PARAMETER This is NULL or ModeData is NULL.\r
266\r
267**/\r
268typedef \r
269EFI_STATUS \r
270(EFIAPI *EFI_MTFTP4_GET_MODE_DATA)(\r
271 IN EFI_MTFTP4_PROTOCOL *This,\r
272 OUT EFI_MTFTP4_MODE_DATA *ModeData\r
ed66e1bc 273 );\r
d1f95000 274\r
275\r
276/**\r
277 Initializes, changes, or resets the default operational setting for this \r
278 EFI MTFTPv4 Protocol driver instance.\r
279\r
280 @param This Pointer to the EFI_MTFTP4_PROTOCOL instance.\r
281 @param MtftpConfigData Pointer to the configuration data structure.\r
282\r
283 @retval EFI_SUCCESS The EFI MTFTPv4 Protocol driver was configured successfully.\r
284 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
285 @retval EFI_ACCESS_DENIED The EFI configuration could not be changed at this time because\r
286 there is one MTFTP background operation in progress.\r
287 @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,\r
288 RARP, etc.) has not finished yet.\r
289 @retval EFI_UNSUPPORTED A configuration protocol (DHCP, BOOTP, RARP, etc.) could not\r
290 be located when clients choose to use the default address\r
291 settings.\r
292 @retval EFI_OUT_OF_RESOURCES The EFI MTFTPv4 Protocol driver instance data could not be\r
293 allocated.\r
294 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The EFI\r
295 MTFTPv4 Protocol driver instance is not configured.\r
296\r
297**/\r
298typedef \r
299EFI_STATUS \r
300(EFIAPI *EFI_MTFTP4_CONFIGURE)(\r
301 IN EFI_MTFTP4_PROTOCOL *This,\r
302 IN EFI_MTFTP4_CONFIG_DATA *MtftpConfigData OPTIONAL\r
ed66e1bc 303 ); \r
d1f95000 304 \r
305 \r
306/**\r
307 Gets information about a file from an MTFTPv4 server.\r
308\r
309 @param This Pointer to the EFI_MTFTP4_PROTOCOL instance.\r
310 @param OverrideData Data that is used to override the existing parameters. If NULL,\r
311 the default parameters that were set in the\r
312 EFI_MTFTP4_PROTOCOL.Configure() function are used.\r
313 @param Filename Pointer to ASCIIZ file name string.\r
314 @param ModeStr Pointer to ASCIIZ mode string. If NULL, "octet" will be used.\r
315 @param OptionCount Number of option/value string pairs in OptionList.\r
316 @param OptionList Pointer to array of option/value string pairs. Ignored if\r
317 OptionCount is zero.\r
318 @param PacketLength The number of bytes in the returned packet.\r
319 @param Packet The pointer to the received packet. This buffer must be freed by\r
320 the caller.\r
321\r
322 @retval EFI_SUCCESS An MTFTPv4 OACK packet was received and is in the Buffer.\r
323 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
324 @retval EFI_UNSUPPORTED One or more options in the OptionList are in the\r
325 unsupported list of structure EFI_MTFTP4_MODE_DATA.\r
326 @retval EFI_NOT_STARTED The EFI MTFTPv4 Protocol driver has not been started.\r
327 @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,\r
328 RARP, etc.) has not finished yet.\r
329 @retval EFI_ACCESS_DENIED The previous operation has not completed yet.\r
330 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r
331 @retval EFI_TFTP_ERROR An MTFTPv4 ERROR packet was received and is in the buffer.\r
332 @retval EFI_ICMP_ERROR An ICMP ERROR packet was received and is in the Buffer.\r
333 @retval EFI_PROTOCOL_ERROR An unexpected MTFTPv4 packet was received and is in the buffer.\r
334 @retval EFI_TIMEOUT No responses were received from the MTFTPv4 server.\r
335 @retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.\r
336\r
337**/\r
338typedef \r
339EFI_STATUS \r
340(EFIAPI *EFI_MTFTP4_GET_INFO)(\r
341 IN EFI_MTFTP4_PROTOCOL *This,\r
342 IN EFI_MTFTP4_OVERRIDE_DATA *OverrideData OPTIONAL,\r
343 IN UINT8 *Filename,\r
344 IN UINT8 *ModeStr OPTIONAL,\r
345 IN UINT8 OptionCount,\r
346 IN EFI_MTFTP4_OPTION *OptionList,\r
347 OUT UINT32 *PacketLength,\r
348 OUT EFI_MTFTP4_PACKET **Packet OPTIONAL\r
ed66e1bc 349 );\r
d1f95000 350\r
351/**\r
352 Parses the options in an MTFTPv4 OACK packet.\r
353\r
354 @param This Pointer to the EFI_MTFTP4_PROTOCOL instance.\r
355 @param PacketLen Length of the OACK packet to be parsed.\r
356 @param Packet Pointer to the OACK packet to be parsed.\r
357 @param OptionCount Pointer to the number of options in following OptionList.\r
358 @param OptionList Pointer to EFI_MTFTP4_OPTION storage. Call the EFI Boot\r
359 Service FreePool() to release each option if they are not\r
360 needed any more.\r
361\r
362 @retval EFI_SUCCESS The OACK packet was valid and the OptionCount and\r
363 OptionList parameters have been updated.\r
364 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
365 - PacketLen is 0.\r
366 - Packet is NULL or Packet is not a valid MTFTPv4 packet.\r
367 - OptionCount is NULL.\r
368 @retval EFI_NOT_FOUND No options were found in the OACK packet.\r
369 @retval EFI_OUT_OF_RESOURCES Storage for the OptionList array cannot be allocated.\r
370 @retval EFI_PROTOCOL_ERROR One or more of the option fields is invalid.\r
371\r
372**/\r
373typedef \r
374EFI_STATUS \r
375(EFIAPI *EFI_MTFTP4_PARSE_OPTIONS)(\r
376 IN EFI_MTFTP4_PROTOCOL *This,\r
377 IN UINT32 PacketLen,\r
378 IN EFI_MTFTP4_PACKET *Packet,\r
379 OUT UINT32 *OptionCount,\r
380 OUT EFI_MTFTP4_OPTION **OptionList OPTIONAL\r
ed66e1bc 381 ); \r
d1f95000 382\r
383\r
384/**\r
385 Downloads a file from an MTFTPv4 server.\r
386\r
387 @param This Pointer to the EFI_MTFTP4_PROTOCOL instance.\r
388 @param Token Pointer to the token structure to provide the parameters that are\r
389 used in this operation.\r
390\r
391 @retval EFI_SUCCESS The data file has been transferred successfully.\r
392 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r
393 @retval EFI_BUFFER_TOO_SMALL BufferSize is not large enough to hold the downloaded data\r
394 in downloading process.\r
395 @retval EFI_ABORTED Current operation is aborted by user.\r
396 @retval EFI_ICMP_ERROR An ICMP ERROR packet was received.\r
397 @retval EFI_TIMEOUT No responses were received from the MTFTPv4 server.\r
398 @retval EFI_TFTP_ERROR An MTFTPv4 ERROR packet was received.\r
399 @retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.\r
400\r
401**/\r
402typedef \r
403EFI_STATUS \r
404(EFIAPI *EFI_MTFTP4_READ_FILE)(\r
405 IN EFI_MTFTP4_PROTOCOL *This,\r
406 IN EFI_MTFTP4_TOKEN *Token\r
ed66e1bc 407 ); \r
d1f95000 408 \r
409\r
410\r
411/**\r
412 Sends a file to an MTFTPv4 server.\r
413\r
414 @param This Pointer to the EFI_MTFTP4_PROTOCOL instance.\r
415 @param Token Pointer to the token structure to provide the parameters that are\r
416 used in this operation.\r
417\r
418 @retval EFI_SUCCESS The upload session has started.\r
419 @retval EFI_UNSUPPORTED The operation is not supported by this implementation.\r
420 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
421 @retval EFI_UNSUPPORTED One or more options in the Token.OptionList are in\r
422 the unsupported list of structure EFI_MTFTP4_MODE_DATA.\r
423 @retval EFI_NOT_STARTED The EFI MTFTPv4 Protocol driver has not been started.\r
424 @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,\r
425 RARP, etc.) is not finished yet.\r
426 @retval EFI_ALREADY_STARTED This Token is already being used in another MTFTPv4 session.\r
427 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r
428 @retval EFI_ACCESS_DENIED The previous operation has not completed yet.\r
429 @retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.\r
430\r
431**/\r
432typedef \r
433EFI_STATUS \r
434(EFIAPI *EFI_MTFTP4_WRITE_FILE)(\r
435 IN EFI_MTFTP4_PROTOCOL *This,\r
436 IN EFI_MTFTP4_TOKEN *Token\r
ed66e1bc 437 ); \r
d1f95000 438 \r
439\r
440/**\r
441 Downloads a data file "directory" from an MTFTPv4 server. May be unsupported in some EFI\r
442 implementations. \r
443\r
444 @param This Pointer to the EFI_MTFTP4_PROTOCOL instance.\r
445 @param Token Pointer to the token structure to provide the parameters that are\r
446 used in this operation.\r
447\r
448 @retval EFI_SUCCESS The MTFTPv4 related file "directory" has been downloaded.\r
449 @retval EFI_UNSUPPORTED The operation is not supported by this implementation.\r
450 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
451 @retval EFI_UNSUPPORTED One or more options in the Token.OptionList are in\r
452 the unsupported list of structure EFI_MTFTP4_MODE_DATA.\r
453 @retval EFI_NOT_STARTED The EFI MTFTPv4 Protocol driver has not been started.\r
454 @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,\r
455 RARP, etc.) is not finished yet.\r
456 @retval EFI_ALREADY_STARTED This Token is already being used in another MTFTPv4 session.\r
457 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r
458 @retval EFI_ACCESS_DENIED The previous operation has not completed yet.\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_MTFTP4_READ_DIRECTORY)(\r
465 IN EFI_MTFTP4_PROTOCOL *This,\r
466 IN EFI_MTFTP4_TOKEN *Token\r
ed66e1bc 467 ); \r
d1f95000 468\r
469/**\r
470 Polls for incoming data packets and processes outgoing data packets.\r
471\r
472 @param This Pointer to the EFI_MTFTP4_PROTOCOL instance.\r
473\r
474 @retval EFI_SUCCESS Incoming or outgoing data was processed.\r
475 @retval EFI_NOT_STARTED This EFI MTFTPv4 Protocol instance has not been started.\r
476 @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,\r
477 RARP, etc.) is not finished yet.\r
478 @retval EFI_INVALID_PARAMETER This is NULL.\r
479 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
480 @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.\r
481 Consider increasing the polling rate.\r
482\r
483**/\r
484typedef\r
485EFI_STATUS\r
8b13229b 486(EFIAPI *EFI_MTFTP4_POLL)(\r
d1f95000 487 IN EFI_MTFTP4_PROTOCOL *This\r
ed66e1bc 488 ); \r
d1f95000 489 \r
44717a39 490///\r
491/// The EFI_MTFTP4_PROTOCOL is designed to be used by UEFI drivers and applications \r
492/// to transmit and receive data files. The EFI MTFTPv4 Protocol driver uses \r
493/// the underlying EFI UDPv4 Protocol driver and EFI IPv4 Protocol driver.\r
494/// \r
d1f95000 495struct _EFI_MTFTP4_PROTOCOL {\r
496 EFI_MTFTP4_GET_MODE_DATA GetModeData;\r
497 EFI_MTFTP4_CONFIGURE Configure;\r
498 EFI_MTFTP4_GET_INFO GetInfo;\r
499 EFI_MTFTP4_PARSE_OPTIONS ParseOptions;\r
500 EFI_MTFTP4_READ_FILE ReadFile;\r
501 EFI_MTFTP4_WRITE_FILE WriteFile;\r
502 EFI_MTFTP4_READ_DIRECTORY ReadDirectory;\r
503 EFI_MTFTP4_POLL Poll;\r
504};\r
505\r
506struct _EFI_MTFTP4_TOKEN {\r
992f22b9
LG
507 ///\r
508 /// The status that is returned to the caller at the end of the operation\r
509 /// to indicate whether this operation completed successfully.\r
510 ///\r
bb8fb476 511 EFI_STATUS Status;\r
992f22b9
LG
512 ///\r
513 /// The event that will be signaled when the operation completes. If\r
514 /// set to NULL, the corresponding function will wait until the read or\r
515 /// write operation finishes. The type of Event must be\r
516 /// EVT_NOTIFY_SIGNAL. The Task Priority Level (TPL) of\r
517 /// Event must be lower than or equal to TPL_CALLBACK.\r
518 ///\r
bb8fb476 519 EFI_EVENT Event;\r
992f22b9
LG
520 ///\r
521 /// If not NULL, the data that will be used to override the existing configure data.\r
522 ///\r
bb8fb476 523 EFI_MTFTP4_OVERRIDE_DATA *OverrideData;\r
992f22b9
LG
524 ///\r
525 /// Pointer to the ASCIIZ file name string.\r
526 ///\r
bb8fb476 527 UINT8 *Filename;\r
992f22b9 528 ///\r
de2314f8 529 /// Pointer to the ASCIIZ mode string. If NULL, "octet" is used.\r
992f22b9 530 ///\r
bb8fb476 531 UINT8 *ModeStr;\r
992f22b9
LG
532 ///\r
533 /// Number of option/value string pairs.\r
534 ///\r
bb8fb476 535 UINT32 OptionCount;\r
992f22b9
LG
536 ///\r
537 /// Pointer to an array of option/value string pairs. Ignored if OptionCount is zero.\r
538 ///\r
bb8fb476 539 EFI_MTFTP4_OPTION *OptionList;\r
992f22b9
LG
540 ///\r
541 /// Size of the data buffer.\r
542 ///\r
bb8fb476 543 OUT UINT64 BufferSize;\r
992f22b9
LG
544 ///\r
545 /// Pointer to the data buffer. Data that is downloaded from the\r
546 /// MTFTPv4 server is stored here. Data that is uploaded to the\r
547 /// MTFTPv4 server is read from here. Ignored if BufferSize is zero.\r
548 ///\r
bb8fb476 549 OUT VOID *Buffer;\r
992f22b9
LG
550 ///\r
551 /// Pointer to the callback function to check the contents of the received packet.\r
552 ///\r
bb8fb476 553 EFI_MTFTP4_CHECK_PACKET CheckPacket;\r
992f22b9
LG
554 ///\r
555 /// Pointer to the function to be called when a timeout occurs.\r
556 ///\r
bb8fb476 557 EFI_MTFTP4_TIMEOUT_CALLBACK TimeoutCallback;\r
992f22b9
LG
558 ///\r
559 /// Pointer to the function to provide the needed packet contents.\r
560 ///\r
bb8fb476 561 EFI_MTFTP4_PACKET_NEEDED PacketNeeded;\r
d1f95000 562};\r
563\r
564extern EFI_GUID gEfiMtftp4ServiceBindingProtocolGuid;\r
565extern EFI_GUID gEfiMtftp4ProtocolGuid; \r
566\r
567#endif\r
568\r