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