]>
Commit | Line | Data |
---|---|---|
a3bcde70 HT |
1 | /** @file\r |
2 | Mtftp6 internal data structure and definition declaration.\r | |
3 | \r | |
4 | Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved. <BR>\r | |
5 | \r | |
6 | This program and the accompanying materials\r | |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php.\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | #ifndef __EFI_MTFTP6_IMPL_H__\r | |
17 | #define __EFI_MTFTP6_IMPL_H__\r | |
18 | \r | |
19 | #include <Uefi.h>\r | |
20 | \r | |
21 | #include <Protocol/Udp6.h>\r | |
22 | #include <Protocol/Mtftp6.h>\r | |
23 | #include <Protocol/ServiceBinding.h>\r | |
24 | #include <Protocol/DriverBinding.h>\r | |
25 | \r | |
26 | #include <Library/DebugLib.h>\r | |
27 | #include <Library/UefiDriverEntryPoint.h>\r | |
28 | #include <Library/UefiBootServicesTableLib.h>\r | |
29 | #include <Library/UefiLib.h>\r | |
30 | #include <Library/BaseLib.h>\r | |
31 | #include <Library/NetLib.h>\r | |
32 | \r | |
33 | typedef struct _MTFTP6_SERVICE MTFTP6_SERVICE;\r | |
34 | typedef struct _MTFTP6_INSTANCE MTFTP6_INSTANCE;\r | |
35 | \r | |
36 | #include "Mtftp6Driver.h"\r | |
37 | #include "Mtftp6Option.h"\r | |
38 | #include "Mtftp6Support.h"\r | |
39 | \r | |
40 | #define MTFTP6_SERVICE_SIGNATURE SIGNATURE_32 ('M', 'F', '6', 'S')\r | |
41 | #define MTFTP6_INSTANCE_SIGNATURE SIGNATURE_32 ('M', 'F', '6', 'I')\r | |
42 | \r | |
43 | #define MTFTP6_DEFAULT_SERVER_CMD_PORT 69\r | |
44 | #define MTFTP6_DEFAULT_TIMEOUT 3\r | |
45 | #define MTFTP6_GET_MAPPING_TIMEOUT 3\r | |
46 | #define MTFTP6_DEFAULT_MAX_RETRY 5\r | |
47 | #define MTFTP6_DEFAULT_BLK_SIZE 512\r | |
48 | #define MTFTP6_TICK_PER_SECOND 10000000U\r | |
49 | \r | |
50 | #define MTFTP6_SERVICE_FROM_THIS(a) CR (a, MTFTP6_SERVICE, ServiceBinding, MTFTP6_SERVICE_SIGNATURE)\r | |
51 | #define MTFTP6_INSTANCE_FROM_THIS(a) CR (a, MTFTP6_INSTANCE, Mtftp6, MTFTP6_INSTANCE_SIGNATURE)\r | |
52 | \r | |
53 | extern EFI_MTFTP6_PROTOCOL gMtftp6ProtocolTemplate;\r | |
54 | \r | |
55 | typedef struct _MTFTP6_GETINFO_CONTEXT{\r | |
56 | EFI_MTFTP6_PACKET **Packet;\r | |
57 | UINT32 *PacketLen;\r | |
58 | EFI_STATUS Status;\r | |
59 | } MTFTP6_GETINFO_CONTEXT;\r | |
60 | \r | |
61 | //\r | |
62 | // Control block for MTFTP6 instance, it's per configuration data.\r | |
63 | //\r | |
64 | struct _MTFTP6_INSTANCE {\r | |
65 | UINT32 Signature;\r | |
66 | EFI_HANDLE Handle;\r | |
67 | LIST_ENTRY Link;\r | |
68 | EFI_MTFTP6_PROTOCOL Mtftp6;\r | |
69 | MTFTP6_SERVICE *Service;\r | |
70 | EFI_MTFTP6_CONFIG_DATA *Config;\r | |
71 | \r | |
72 | EFI_MTFTP6_TOKEN *Token;\r | |
73 | MTFTP6_EXT_OPTION_INFO ExtInfo;\r | |
74 | \r | |
75 | UINT16 BlkSize;\r | |
76 | UINT16 LastBlk;\r | |
77 | LIST_ENTRY BlkList;\r | |
78 | \r | |
79 | EFI_IPv6_ADDRESS ServerIp;\r | |
80 | UINT16 ServerCmdPort;\r | |
81 | UINT16 ServerDataPort;\r | |
82 | UDP_IO *UdpIo;\r | |
83 | \r | |
84 | EFI_IPv6_ADDRESS McastIp;\r | |
85 | UINT16 McastPort;\r | |
86 | UDP_IO *McastUdpIo;\r | |
87 | \r | |
88 | NET_BUF *LastPacket;\r | |
89 | UINT32 CurRetry;\r | |
90 | UINT32 MaxRetry;\r | |
91 | UINT32 PacketToLive;\r | |
92 | UINT32 Timeout;\r | |
93 | \r | |
94 | EFI_TPL OldTpl;\r | |
95 | BOOLEAN IsTransmitted;\r | |
96 | BOOLEAN IsMaster;\r | |
97 | BOOLEAN InDestory;\r | |
98 | };\r | |
99 | \r | |
100 | //\r | |
101 | // Control block for MTFTP6 service, it's per Nic handle.\r | |
102 | //\r | |
103 | struct _MTFTP6_SERVICE {\r | |
104 | UINT32 Signature;\r | |
105 | EFI_SERVICE_BINDING_PROTOCOL ServiceBinding;\r | |
106 | EFI_HANDLE Controller;\r | |
107 | EFI_HANDLE Image;\r | |
108 | \r | |
109 | UINT16 ChildrenNum;\r | |
110 | LIST_ENTRY Children;\r | |
111 | //\r | |
112 | // It is used to be as internal calculagraph for all instances.\r | |
113 | //\r | |
114 | EFI_EVENT Timer;\r | |
115 | //\r | |
116 | // It is used to maintain the parent-child relationship between\r | |
117 | // mtftp driver and udp driver.\r | |
118 | //\r | |
119 | UDP_IO *DummyUdpIo;\r | |
120 | BOOLEAN InDestory;\r | |
121 | };\r | |
122 | \r | |
123 | /**\r | |
124 | Returns the current operating mode data for the MTFTP6 instance.\r | |
125 | \r | |
126 | The GetModeData() function returns the current operating mode and\r | |
127 | cached data packet for the MTFTP6 instance.\r | |
128 | \r | |
129 | @param[in] This Pointer to the EFI_MTFTP6_PROTOCOL instance.\r | |
130 | @param[out] ModeData The buffer in which the EFI MTFTPv6 Protocol driver mode\r | |
131 | data is returned.\r | |
132 | \r | |
133 | @retval EFI_SUCCESS The configuration data was returned successfully.\r | |
134 | @retval EFI_OUT_OF_RESOURCES The required mode data could not be allocated.\r | |
135 | @retval EFI_INVALID_PARAMETER This is NULL, or ModeData is NULL.\r | |
136 | \r | |
137 | **/\r | |
138 | EFI_STATUS\r | |
139 | EFIAPI\r | |
140 | EfiMtftp6GetModeData (\r | |
141 | IN EFI_MTFTP6_PROTOCOL *This,\r | |
142 | OUT EFI_MTFTP6_MODE_DATA *ModeData\r | |
143 | );\r | |
144 | \r | |
145 | /**\r | |
146 | Initializes, changes, or resets the default operational setting for\r | |
147 | this EFI MTFTPv6 Protocol driver instance.\r | |
148 | \r | |
149 | The Configure() function is used to set and change the configuration\r | |
150 | data for this EFI MTFTPv6 Protocol driver instance. The configuration\r | |
151 | data can be reset to startup defaults by calling Configure() with\r | |
152 | MtftpConfigData set to NULL. Whenever the instance is reset, any\r | |
153 | pending operation is aborted. By changing the EFI MTFTPv6 Protocol\r | |
154 | driver instance configuration data, the client can connect to\r | |
155 | different MTFTPv6 servers. The configuration parameters in\r | |
156 | MtftpConfigData are used as the default parameters in later MTFTPv6\r | |
157 | operations and can be overridden in later operations.\r | |
158 | \r | |
159 | @param[in] This Pointer to the EFI_MTFTP6_PROTOCOL instance.\r | |
160 | @param[in] MtftpConfigData Pointer to the configuration data structure.\r | |
161 | \r | |
162 | @retval EFI_SUCCESS The EFI MTFTPv6 Protocol instance was configured successfully.\r | |
163 | @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE:\r | |
164 | - This is NULL.\r | |
165 | - MtftpConfigData.StationIp is neither zero nor one\r | |
166 | of the configured IP addresses in the underlying IPv6 driver.\r | |
167 | - MtftpCofigData.ServerIp is not a valid IPv6 unicast address.\r | |
168 | Note: It does not match the UEFI 2.3 Specification.\r | |
169 | @retval EFI_ACCESS_DENIED - The configuration could not be changed at this time because there\r | |
170 | is some MTFTP background operation in progress.\r | |
171 | - MtftpCofigData.LocalPort is already in use.\r | |
172 | Note: It does not match the UEFI 2.3 Specification.\r | |
173 | @retval EFI_NO_MAPPING The underlying IPv6 driver was responsible for choosing a source\r | |
174 | address for this instance, but no source address was available for use.\r | |
175 | @retval EFI_OUT_OF_RESOURCES The EFI MTFTPv6 Protocol driver instance data could not be\r | |
176 | allocated.\r | |
177 | Note: It is not defined in the UEFI 2.3 Specification.\r | |
178 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The EFI\r | |
179 | MTFTPv6 Protocol driver instance is not configured.\r | |
180 | Note: It is not defined in the UEFI 2.3 Specification.\r | |
181 | \r | |
182 | **/\r | |
183 | EFI_STATUS\r | |
184 | EFIAPI\r | |
185 | EfiMtftp6Configure (\r | |
186 | IN EFI_MTFTP6_PROTOCOL *This,\r | |
187 | IN EFI_MTFTP6_CONFIG_DATA *MtftpConfigData OPTIONAL\r | |
188 | );\r | |
189 | \r | |
190 | /**\r | |
191 | Get the information of the download from the server.\r | |
192 | \r | |
193 | The GetInfo() function assembles an MTFTPv6 request packet\r | |
194 | with options, sends it to the MTFTPv6 server, and may return\r | |
195 | an MTFTPv6 OACK, MTFTPv6 ERROR, or ICMP ERROR packet. Retries\r | |
196 | occur only if no response packets are received from the MTFTPv6\r | |
197 | server before the timeout expires.\r | |
198 | \r | |
199 | @param[in] This Pointer to the EFI_MTFTP6_PROTOCOL instance.\r | |
200 | @param[in] OverrideData Data that is used to override the existing parameters. If NULL, the\r | |
201 | default parameters that were set in the EFI_MTFTP6_PROTOCOL.Configure()\r | |
202 | function are used.\r | |
203 | @param[in] Filename Pointer to ASCIIZ file name string.\r | |
204 | @param[in] ModeStr Pointer to ASCIIZ mode string. If NULL, octet will be used\r | |
205 | @param[in] OptionCount Number of option/value string pairs in OptionList.\r | |
206 | @param[in] OptionList Pointer to array of option/value string pairs. Ignored if\r | |
207 | OptionCount is zero.\r | |
208 | @param[out] PacketLength The number of bytes in the returned packet.\r | |
209 | @param[out] Packet The pointer to the received packet. This buffer must be freed by\r | |
210 | the caller.\r | |
211 | \r | |
212 | @retval EFI_SUCCESS An MTFTPv6 OACK packet was received and is in the Packet.\r | |
213 | Note: It does not match the UEFI 2.3 Specification.\r | |
214 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
215 | - This is NULL.\r | |
216 | - Filename is NULL.\r | |
217 | - OptionCount is not zero and OptionList is NULL.\r | |
218 | - One or more options in OptionList have wrong format.\r | |
219 | - PacketLength is NULL.\r | |
220 | - OverrideData.ServerIp is not a valid unicast IPv6 address.\r | |
221 | @retval EFI_UNSUPPORTED One or more options in the OptionList are unsupported by\r | |
222 | this implementation.\r | |
223 | @retval EFI_NOT_STARTED The EFI MTFTPv6 Protocol driver has not been started.\r | |
224 | @retval EFI_NO_MAPPING The underlying IPv6 driver was responsible for choosing a source\r | |
225 | address for this instance, but no source address was available for use.\r | |
226 | @retval EFI_ACCESS_DENIED The previous operation has not completed yet.\r | |
227 | @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r | |
228 | @retval EFI_TFTP_ERROR An MTFTPv6 ERROR packet was received and is in the Packet.\r | |
229 | @retval EFI_NETWORK_UNREACHABLE An ICMP network unreachable error packet was received, and the Packet is set to NULL.\r | |
230 | Note: It is not defined in the UEFI 2.3 Specification.\r | |
231 | @retval EFI_HOST_UNREACHABLE An ICMP host unreachable error packet was received, and the Packet is set to NULL.\r | |
232 | Note: It is not defined in the UEFI 2.3 Specification.\r | |
233 | @retval EFI_PROTOCOL_UNREACHABLE An ICMP protocol unreachable error packet was received, and the Packet is set to NULL.\r | |
234 | Note: It is not defined in the UEFI 2.3 Specification.\r | |
235 | @retval EFI_PORT_UNREACHABLE An ICMP port unreachable error packet was received, and the Packet is set to NULL.\r | |
236 | @retval EFI_ICMP_ERROR Some other ICMP ERROR packet was received, and the Packet is set to NULL.\r | |
237 | Note: It does not match the UEFI 2.3 Specification.\r | |
238 | @retval EFI_PROTOCOL_ERROR An unexpected MTFTPv6 packet was received and is in the Packet.\r | |
239 | @retval EFI_TIMEOUT No responses were received from the MTFTPv6 server.\r | |
240 | @retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.\r | |
241 | \r | |
242 | **/\r | |
243 | EFI_STATUS\r | |
244 | EFIAPI\r | |
245 | EfiMtftp6GetInfo (\r | |
246 | IN EFI_MTFTP6_PROTOCOL *This,\r | |
247 | IN EFI_MTFTP6_OVERRIDE_DATA *OverrideData OPTIONAL,\r | |
248 | IN UINT8 *Filename,\r | |
249 | IN UINT8 *ModeStr OPTIONAL,\r | |
250 | IN UINT8 OptionCount,\r | |
251 | IN EFI_MTFTP6_OPTION *OptionList OPTIONAL,\r | |
252 | OUT UINT32 *PacketLength,\r | |
253 | OUT EFI_MTFTP6_PACKET **Packet OPTIONAL\r | |
254 | );\r | |
255 | \r | |
256 | /**\r | |
257 | Parse the options in an MTFTPv6 OACK packet.\r | |
258 | \r | |
259 | The ParseOptions() function parses the option fields in an MTFTPv6 OACK\r | |
260 | packet and returns the number of options that were found, and optionally,\r | |
261 | a list of pointers to the options in the packet. If one or more of the\r | |
262 | option fields are not valid, then EFI_PROTOCOL_ERROR is returned and\r | |
263 | *OptionCount and *OptionList stop at the last valid option.\r | |
264 | \r | |
265 | @param[in] This Pointer to the EFI_MTFTP6_PROTOCOL instance.\r | |
266 | @param[in] PacketLen Length of the OACK packet to be parsed.\r | |
267 | @param[in] Packet Pointer to the OACK packet to be parsed.\r | |
268 | @param[out] OptionCount Pointer to the number of options in the following OptionList.\r | |
269 | @param[out] OptionList Pointer to EFI_MTFTP6_OPTION storage. Each pointer in the\r | |
270 | OptionList points to the corresponding MTFTP option buffer\r | |
271 | in the Packet. Call the EFI Boot Service FreePool() to\r | |
272 | release the OptionList if the options in this OptionList\r | |
273 | are not needed any more.\r | |
274 | \r | |
275 | @retval EFI_SUCCESS The OACK packet was valid and the OptionCount, and\r | |
276 | OptionList parameters have been updated.\r | |
277 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
278 | - PacketLen is 0.\r | |
279 | - Packet is NULL or Packet is not a valid MTFTPv6 packet.\r | |
280 | - OptionCount is NULL.\r | |
281 | @retval EFI_NOT_FOUND No options were found in the OACK packet.\r | |
282 | @retval EFI_OUT_OF_RESOURCES Storage for the OptionList array can not be allocated.\r | |
283 | @retval EFI_PROTOCOL_ERROR One or more of the option fields is invalid.\r | |
284 | \r | |
285 | **/\r | |
286 | EFI_STATUS\r | |
287 | EFIAPI\r | |
288 | EfiMtftp6ParseOptions (\r | |
289 | IN EFI_MTFTP6_PROTOCOL *This,\r | |
290 | IN UINT32 PacketLen,\r | |
291 | IN EFI_MTFTP6_PACKET *Packet,\r | |
292 | OUT UINT32 *OptionCount,\r | |
293 | OUT EFI_MTFTP6_OPTION **OptionList OPTIONAL\r | |
294 | );\r | |
295 | \r | |
296 | /**\r | |
297 | Download a file from an MTFTPv6 server.\r | |
298 | \r | |
299 | The ReadFile() function is used to initialize and start an MTFTPv6 download\r | |
300 | process and optionally wait for completion. When the download operation\r | |
301 | completes, whether successfully or not, the Token.Status field is updated\r | |
302 | by the EFI MTFTPv6 Protocol driver, and then Token.Event is signaled if it\r | |
303 | is not NULL.\r | |
304 | Data can be downloaded from the MTFTPv6 server into either of the following\r | |
305 | locations:\r | |
306 | - A fixed buffer that is pointed to by Token.Buffer.\r | |
307 | - A download service function that is pointed to by Token.CheckPacket.\r | |
308 | If both Token.Buffer and Token.CheckPacket are used, then Token.CheckPacket\r | |
309 | will be called first. If the call is successful, the packet will be stored\r | |
310 | in Token.Buffer.\r | |
311 | \r | |
312 | @param[in] This Pointer to the EFI_MTFTP6_PROTOCOL instance.\r | |
313 | @param[in] Token Pointer to the token structure to provide the parameters that are\r | |
314 | used in this operation.\r | |
315 | \r | |
316 | @retval EFI_SUCCESS The data file has been transferred successfully.\r | |
317 | @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r | |
318 | @retval EFI_BUFFER_TOO_SMALL BufferSize is not zero but not large enough to hold the\r | |
319 | downloaded data in downloading process.\r | |
320 | Note: It does not match the UEFI 2.3 Specification.\r | |
321 | @retval EFI_ABORTED Current operation is aborted by user.\r | |
322 | @retval EFI_NETWORK_UNREACHABLE An ICMP network unreachable error packet was received.\r | |
323 | Note: It is not defined in the UEFI 2.3 Specification.\r | |
324 | @retval EFI_HOST_UNREACHABLE An ICMP host unreachable error packet was received.\r | |
325 | Note: It is not defined in the UEFI 2.3 Specification.\r | |
326 | @retval EFI_PROTOCOL_UNREACHABLE An ICMP protocol unreachable error packet was received.\r | |
327 | Note: It is not defined in the UEFI 2.3 Specification.\r | |
328 | @retval EFI_PORT_UNREACHABLE An ICMP port unreachable error packet was received.\r | |
329 | Note: It is not defined in the UEFI 2.3 Specification.\r | |
330 | @retval EFI_ICMP_ERROR An ICMP ERROR packet was received.\r | |
331 | @retval EFI_TIMEOUT No responses were received from the MTFTPv6 server.\r | |
332 | @retval EFI_TFTP_ERROR An MTFTPv6 ERROR packet was received.\r | |
333 | @retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.\r | |
334 | \r | |
335 | **/\r | |
336 | EFI_STATUS\r | |
337 | EFIAPI\r | |
338 | EfiMtftp6ReadFile (\r | |
339 | IN EFI_MTFTP6_PROTOCOL *This,\r | |
340 | IN EFI_MTFTP6_TOKEN *Token\r | |
341 | );\r | |
342 | \r | |
343 | /**\r | |
344 | Send a file to an MTFTPv6 server.\r | |
345 | \r | |
346 | The WriteFile() function is used to initialize an uploading operation\r | |
347 | with the given option list, and optionally, wait for completion. If one\r | |
348 | or more of the options is not supported by the server, the unsupported\r | |
349 | options are ignored and a standard TFTP process starts instead. When\r | |
350 | the upload process completes, whether successfully or not, Token.Event\r | |
351 | is signaled, and the EFI MTFTPv6 Protocol driver updates Token.Status.\r | |
352 | The caller can supply the data to be uploaded in the following two modes:\r | |
353 | - Through the user-provided buffer.\r | |
354 | - Through a callback function.\r | |
355 | With the user-provided buffer, the Token.BufferSize field indicates\r | |
356 | the length of the buffer, and the driver will upload the data in the\r | |
357 | buffer. With an EFI_MTFTP6_PACKET_NEEDED callback function, the driver\r | |
358 | will call this callback function to get more data from the user to upload.\r | |
359 | \r | |
360 | @param[in] This Pointer to the EFI_MTFTP6_PROTOCOL instance.\r | |
361 | @param[in] Token Pointer to the token structure to provide the parameters that are\r | |
362 | used in this operation.\r | |
363 | \r | |
364 | @retval EFI_SUCCESS The upload session has started.\r | |
365 | @retval EFI_UNSUPPORTED The operation is not supported by this implementation.\r | |
366 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
367 | - This is NULL.\r | |
368 | - Token is NULL.\r | |
369 | - Token.Filename is NULL.\r | |
370 | - Token.OptionCount is not zero and Token.OptionList is NULL.\r | |
371 | - One or more options in Token.OptionList have wrong format.\r | |
372 | - Token.Buffer and Token.PacketNeeded are both NULL.\r | |
373 | - Token.OverrideData.ServerIp is not valid unicast IPv6 addresses.\r | |
374 | @retval EFI_UNSUPPORTED One or more options in the Token.OptionList are not\r | |
375 | supported by this implementation.\r | |
376 | @retval EFI_NOT_STARTED The EFI MTFTPv6 Protocol driver has not been started.\r | |
377 | @retval EFI_NO_MAPPING The underlying IPv6 driver was responsible for choosing a source\r | |
378 | address for this instance, but no source address was available for use.\r | |
379 | @retval EFI_ALREADY_STARTED This Token is already being used in another MTFTPv6 session.\r | |
380 | @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r | |
381 | @retval EFI_ACCESS_DENIED The previous operation has not completed yet.\r | |
382 | @retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.\r | |
383 | \r | |
384 | **/\r | |
385 | EFI_STATUS\r | |
386 | EFIAPI\r | |
387 | EfiMtftp6WriteFile (\r | |
388 | IN EFI_MTFTP6_PROTOCOL *This,\r | |
389 | IN EFI_MTFTP6_TOKEN *Token\r | |
390 | );\r | |
391 | \r | |
392 | /**\r | |
393 | Download a data file directory from an MTFTPv6 server.\r | |
394 | \r | |
395 | The ReadDirectory() function is used to return a list of files on the\r | |
396 | MTFTPv6 server that are logically (or operationally) related to\r | |
397 | Token.Filename. The directory request packet that is sent to the server\r | |
398 | is built with the option list that was provided by caller, if present.\r | |
399 | The file information that the server returns is put into either of\r | |
400 | the following locations:\r | |
401 | - A fixed buffer that is pointed to by Token.Buffer.\r | |
402 | - A download service function that is pointed to by Token.CheckPacket.\r | |
403 | If both Token.Buffer and Token.CheckPacket are used, then Token.CheckPacket\r | |
404 | will be called first. If the call is successful, the packet will be stored\r | |
405 | in Token.Buffer.\r | |
406 | \r | |
407 | @param[in] This Pointer to the EFI_MTFTP6_PROTOCOL instance.\r | |
408 | @param[in] Token Pointer to the token structure to provide the parameters that are\r | |
409 | used in this operation.\r | |
410 | \r | |
411 | @retval EFI_SUCCESS The MTFTPv6 related file "directory" has been downloaded.\r | |
412 | @retval EFI_UNSUPPORTED The EFI MTFTPv6 Protocol driver does not support this function.\r | |
413 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
414 | - This is NULL.\r | |
415 | - Token is NULL.\r | |
416 | - Token.Filename is NULL.\r | |
417 | - Token.OptionCount is not zero and Token.OptionList is NULL.\r | |
418 | - One or more options in Token.OptionList have wrong format.\r | |
419 | - Token.Buffer and Token.CheckPacket are both NULL.\r | |
420 | - Token.OverrideData.ServerIp is not valid unicast IPv6 addresses.\r | |
421 | @retval EFI_UNSUPPORTED One or more options in the Token.OptionList are not\r | |
422 | supported by this implementation.\r | |
423 | @retval EFI_NOT_STARTED The EFI MTFTPv6 Protocol driver has not been started.\r | |
424 | @retval EFI_NO_MAPPING The underlying IPv6 driver was responsible for choosing a source\r | |
425 | address for this instance, but no source address was available for use.\r | |
426 | @retval EFI_ALREADY_STARTED This Token is already being used in another MTFTPv6 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 | |
432 | EFI_STATUS\r | |
433 | EFIAPI\r | |
434 | EfiMtftp6ReadDirectory (\r | |
435 | IN EFI_MTFTP6_PROTOCOL *This,\r | |
436 | IN EFI_MTFTP6_TOKEN *Token\r | |
437 | );\r | |
438 | \r | |
439 | /**\r | |
440 | Polls for incoming data packets and processes outgoing data packets.\r | |
441 | \r | |
442 | The Poll() function can be used by network drivers and applications\r | |
443 | to increase the rate that data packets are moved between the\r | |
444 | communications device and the transmit and receive queues.In some\r | |
445 | systems, the periodic timer event in the managed network driver may\r | |
446 | not poll the underlying communications device fast enough to transmit\r | |
447 | and/or receive all data packets without missing incoming packets or\r | |
448 | dropping outgoing packets. Drivers and applications that are\r | |
449 | experiencing packet loss should try calling the Poll() function\r | |
450 | more often.\r | |
451 | \r | |
452 | @param[in] This The MTFTP6 protocol instance.\r | |
453 | \r | |
454 | \r | |
455 | @retval EFI_SUCCESS Incoming or outgoing data was processed.\r | |
456 | @retval EFI_NOT_STARTED This EFI MTFTPv6 Protocol instance has not been started.\r | |
457 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
458 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
459 | @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.\r | |
460 | Consider increasing the polling rate.\r | |
461 | \r | |
462 | **/\r | |
463 | EFI_STATUS\r | |
464 | EFIAPI\r | |
465 | EfiMtftp6Poll (\r | |
466 | IN EFI_MTFTP6_PROTOCOL *This\r | |
467 | );\r | |
468 | \r | |
469 | #endif\r |