2 Mtftp6 Rrq process functions implementation.
4 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #include "Mtftp6Impl.h"
13 Build and send a ACK packet for download.
15 @param[in] Instance The pointer to the Mtftp6 instance.
16 @param[in] BlockNum The block number to be acked.
18 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory for the packet.
19 @retval EFI_SUCCESS The ACK has been sent.
20 @retval Others Failed to send the ACK.
25 IN MTFTP6_INSTANCE
*Instance
,
29 EFI_MTFTP6_PACKET
*Ack
;
36 // Allocate net buffer to create ack packet.
38 Packet
= NetbufAlloc (sizeof (EFI_MTFTP6_ACK_HEADER
));
41 return EFI_OUT_OF_RESOURCES
;
44 Ack
= (EFI_MTFTP6_PACKET
*)NetbufAllocSpace (
46 sizeof (EFI_MTFTP6_ACK_HEADER
),
51 Ack
->Ack
.OpCode
= HTONS (EFI_MTFTP6_OPCODE_ACK
);
52 Ack
->Ack
.Block
[0] = HTONS (BlockNum
);
55 // Reset current retry count of the instance.
57 Instance
->CurRetry
= 0;
58 Instance
->LastPacket
= Packet
;
60 Status
= Mtftp6TransmitPacket (Instance
, Packet
);
61 if (!EFI_ERROR (Status
)) {
62 Instance
->AckedBlock
= Instance
->TotalBlock
;
69 Deliver the received data block to the user, which can be saved
70 in the user provide buffer or through the CheckPacket callback.
72 @param[in] Instance The pointer to the Mtftp6 instance.
73 @param[in] Packet The pointer to the received packet.
74 @param[in] Len The packet length.
75 @param[out] UdpPacket The net buf of the received packet.
77 @retval EFI_SUCCESS The data was saved successfully.
78 @retval EFI_ABORTED The user tells to abort by return an error through
80 @retval EFI_BUFFER_TOO_SMALL The user's buffer is too small, and buffer length is
81 updated to the actual buffer size needed.
86 IN MTFTP6_INSTANCE
*Instance
,
87 IN EFI_MTFTP6_PACKET
*Packet
,
89 OUT NET_BUF
**UdpPacket
92 EFI_MTFTP6_TOKEN
*Token
;
101 Token
= Instance
->Token
;
102 Block
= NTOHS (Packet
->Data
.Block
);
103 DataLen
= Len
- MTFTP6_DATA_HEAD_LEN
;
106 // This is the last block, save the block num
108 if (DataLen
< Instance
->BlkSize
) {
110 Instance
->LastBlk
= Block
;
111 Mtftp6SetLastBlockNum (&Instance
->BlkList
, Block
);
115 // Remove this block number from the file hole. If Mtftp6RemoveBlockNum
116 // returns EFI_NOT_FOUND, the block has been saved, don't save it again.
117 // Note that : For bigger files, allowing the block counter to roll over
118 // to accept transfers of unlimited size. So BlockCounter is memorised as
119 // continuous block counter.
121 Status
= Mtftp6RemoveBlockNum (&Instance
->BlkList
, Block
, Completed
, &BlockCounter
);
123 if (Status
== EFI_NOT_FOUND
) {
125 } else if (EFI_ERROR (Status
)) {
129 if (Token
->CheckPacket
!= NULL
) {
131 // Callback to the check packet routine with the received packet.
133 Status
= Token
->CheckPacket (&Instance
->Mtftp6
, Token
, (UINT16
)Len
, Packet
);
135 if (EFI_ERROR (Status
)) {
137 // Free the received packet before send new packet in ReceiveNotify,
138 // since the Udp6Io might need to be reconfigured.
140 NetbufFree (*UdpPacket
);
143 // Send the Mtftp6 error message if user aborted the current session.
147 EFI_MTFTP6_ERRORCODE_ILLEGAL_OPERATION
,
148 (UINT8
*)"User aborted download"
155 if (Token
->Buffer
!= NULL
) {
156 Start
= MultU64x32 (BlockCounter
- 1, Instance
->BlkSize
);
157 if (Start
+ DataLen
<= Token
->BufferSize
) {
158 CopyMem ((UINT8
*)Token
->Buffer
+ Start
, Packet
->Data
.Data
, DataLen
);
160 // Update the file size when received the last block
162 if ((Instance
->LastBlk
== Block
) && Completed
) {
163 Token
->BufferSize
= Start
+ DataLen
;
165 } else if (Instance
->LastBlk
!= 0) {
167 // Don't save the data if the buffer is too small, return
168 // EFI_BUFFER_TOO_SMALL if received the last packet. This
169 // will give a accurate file length.
171 Token
->BufferSize
= Start
+ DataLen
;
174 // Free the received packet before send new packet in ReceiveNotify,
175 // since the udpio might need to be reconfigured.
177 NetbufFree (*UdpPacket
);
180 // Send the Mtftp6 error message if no enough buffer.
184 EFI_MTFTP6_ERRORCODE_DISK_FULL
,
185 (UINT8
*)"User provided memory block is too small"
188 return EFI_BUFFER_TOO_SMALL
;
196 Process the received data packets. It will save the block
197 then send back an ACK if it is active.
199 @param[in] Instance The pointer to the Mtftp6 instance.
200 @param[in] Packet The pointer to the received packet.
201 @param[in] Len The length of the packet.
202 @param[out] UdpPacket The net buf of received packet.
203 @param[out] IsCompleted If TRUE, the download has been completed.
204 Otherwise, the download has not been completed.
206 @retval EFI_SUCCESS The data packet was successfully processed.
207 @retval EFI_ABORTED The download was aborted by the user.
208 @retval EFI_BUFFER_TOO_SMALL The user-provided buffer is too small.
212 Mtftp6RrqHandleData (
213 IN MTFTP6_INSTANCE
*Instance
,
214 IN EFI_MTFTP6_PACKET
*Packet
,
216 OUT NET_BUF
**UdpPacket
,
217 OUT BOOLEAN
*IsCompleted
224 *IsCompleted
= FALSE
;
225 Status
= EFI_SUCCESS
;
226 BlockNum
= NTOHS (Packet
->Data
.Block
);
227 Expected
= Mtftp6GetNextBlockNum (&Instance
->BlkList
);
229 ASSERT (Expected
>= 0);
232 // If we are active (Master) and received an unexpected packet, transmit
233 // the ACK for the block we received, then restart receiving the
234 // expected one. If we are passive (Slave), save the block.
236 if (Instance
->IsMaster
&& (Expected
!= BlockNum
)) {
238 // Free the received packet before send new packet in ReceiveNotify,
239 // since the udpio might need to be reconfigured.
241 NetbufFree (*UdpPacket
);
245 // If Expected is 0, (UINT16) (Expected - 1) is also the expected Ack number (65535).
247 return Mtftp6RrqSendAck (Instance
, (UINT16
)(Expected
- 1));
250 Status
= Mtftp6RrqSaveBlock (Instance
, Packet
, Len
, UdpPacket
);
252 if (EFI_ERROR (Status
)) {
257 // Record the total received and saved block number.
259 Instance
->TotalBlock
++;
262 // Reset the passive client's timer whenever it received a valid data packet.
264 if (!Instance
->IsMaster
) {
265 Instance
->PacketToLive
= Instance
->Timeout
* 2;
269 // Check whether we have received all the blocks. Send the ACK if we
270 // are active (unicast client or master client for multicast download).
271 // If we have received all the blocks, send an ACK even if we are passive
272 // to tell the server that we are done.
274 Expected
= Mtftp6GetNextBlockNum (&Instance
->BlkList
);
276 if (Instance
->IsMaster
|| (Expected
< 0)) {
279 // If we are passive client, then the just received Block maybe
280 // isn't the last block. We need to send an ACK to the last block
281 // to inform the server that we are done. If we are active client,
282 // the Block == Instance->LastBlock.
284 BlockNum
= Instance
->LastBlk
;
287 BlockNum
= (UINT16
)(Expected
- 1);
291 // Free the received packet before send new packet in ReceiveNotify,
292 // since the udpio might need to be reconfigured.
294 NetbufFree (*UdpPacket
);
297 if ((Instance
->WindowSize
== (Instance
->TotalBlock
- Instance
->AckedBlock
)) || (Expected
< 0)) {
298 Status
= Mtftp6RrqSendAck (Instance
, BlockNum
);
306 Validate whether the options received in the server's OACK packet is valid.
307 The options are valid only if:
308 1. The server doesn't include options not requested by us.
309 2. The server can only use smaller blksize than that is requested.
310 3. The server can only use the same timeout as requested.
311 4. The server doesn't change its multicast channel.
313 @param[in] Instance The pointer to the Mtftp6 instance.
314 @param[in] ReplyInfo The pointer to options information in reply packet.
315 @param[in] RequestInfo The pointer to requested options info.
317 @retval TRUE If the option in the OACK is valid.
318 @retval FALSE If the option is invalid.
323 IN MTFTP6_INSTANCE
*Instance
,
324 IN MTFTP6_EXT_OPTION_INFO
*ReplyInfo
,
325 IN MTFTP6_EXT_OPTION_INFO
*RequestInfo
329 // It is invalid for server to return options we don't request
331 if ((ReplyInfo
->BitMap
& ~RequestInfo
->BitMap
) != 0) {
336 // Server can only specify a smaller block size and windowsize to be used and
337 // return the timeout matches that requested.
339 if ((((ReplyInfo
->BitMap
& MTFTP6_OPT_BLKSIZE_BIT
) != 0) && (ReplyInfo
->BlkSize
> RequestInfo
->BlkSize
)) ||
340 (((ReplyInfo
->BitMap
& MTFTP6_OPT_WINDOWSIZE_BIT
) != 0) && (ReplyInfo
->BlkSize
> RequestInfo
->BlkSize
)) ||
341 (((ReplyInfo
->BitMap
& MTFTP6_OPT_TIMEOUT_BIT
) != 0) && (ReplyInfo
->Timeout
!= RequestInfo
->Timeout
))
348 // The server can send ",,master" to client to change its master
349 // setting. But if it use the specific multicast channel, it can't
350 // change the setting.
352 if (((ReplyInfo
->BitMap
& MTFTP6_OPT_MCAST_BIT
) != 0) && !NetIp6IsUnspecifiedAddr (&Instance
->McastIp
)) {
353 if (!NetIp6IsUnspecifiedAddr (&ReplyInfo
->McastIp
) && (CompareMem (
356 sizeof (EFI_IPv6_ADDRESS
)
362 if ((ReplyInfo
->McastPort
!= 0) && (ReplyInfo
->McastPort
!= Instance
->McastPort
)) {
371 Configure Udp6Io to receive a packet from a multicast address.
373 @param[in] McastIo The pointer to the mcast Udp6Io.
374 @param[in] Context The pointer to the context.
376 @retval EFI_SUCCESS The mcast Udp6Io was successfully configured.
377 @retval Others Failed to configure the Udp6Io.
382 Mtftp6RrqConfigMcastUdpIo (
388 EFI_UDP6_PROTOCOL
*Udp6
;
389 EFI_UDP6_CONFIG_DATA
*Udp6Cfg
;
390 EFI_IPv6_ADDRESS Group
;
391 MTFTP6_INSTANCE
*Instance
;
393 Udp6
= McastIo
->Protocol
.Udp6
;
394 Udp6Cfg
= &(McastIo
->Config
.Udp6
);
395 Instance
= (MTFTP6_INSTANCE
*)Context
;
398 // Set the configure data for the mcast Udp6Io.
400 ZeroMem (Udp6Cfg
, sizeof (EFI_UDP6_CONFIG_DATA
));
402 Udp6Cfg
->AcceptPromiscuous
= FALSE
;
403 Udp6Cfg
->AcceptAnyPort
= FALSE
;
404 Udp6Cfg
->AllowDuplicatePort
= FALSE
;
405 Udp6Cfg
->TrafficClass
= 0;
406 Udp6Cfg
->HopLimit
= 128;
407 Udp6Cfg
->ReceiveTimeout
= 0;
408 Udp6Cfg
->TransmitTimeout
= 0;
409 Udp6Cfg
->StationPort
= Instance
->McastPort
;
410 Udp6Cfg
->RemotePort
= 0;
413 &Udp6Cfg
->RemoteAddress
,
415 sizeof (EFI_IPv6_ADDRESS
)
419 // Configure the mcast Udp6Io.
421 Status
= Udp6
->Configure (Udp6
, Udp6Cfg
);
423 if (EFI_ERROR (Status
)) {
428 // Join the multicast group
430 CopyMem (&Group
, &Instance
->McastIp
, sizeof (EFI_IPv6_ADDRESS
));
432 return Udp6
->Groups (Udp6
, TRUE
, &Group
);
436 Process the OACK packet for Rrq.
438 @param[in] Instance The pointer to the Mtftp6 instance.
439 @param[in] Packet The pointer to the received packet.
440 @param[in] Len The length of the packet.
441 @param[out] UdpPacket The net buf of received packet.
442 @param[out] IsCompleted If TRUE, the download has been completed.
443 Otherwise, the download has not been completed.
445 @retval EFI_DEVICE_ERROR Failed to create/start a multicast Udp6 child.
446 @retval EFI_TFTP_ERROR An error happened during the process.
447 @retval EFI_SUCCESS The OACK packet successfully processed.
451 Mtftp6RrqHandleOack (
452 IN MTFTP6_INSTANCE
*Instance
,
453 IN EFI_MTFTP6_PACKET
*Packet
,
455 OUT NET_BUF
**UdpPacket
,
456 OUT BOOLEAN
*IsCompleted
459 EFI_MTFTP6_OPTION
*Options
;
461 MTFTP6_EXT_OPTION_INFO ExtInfo
;
464 EFI_UDP6_PROTOCOL
*Udp6
;
466 *IsCompleted
= FALSE
;
470 // If already started the master download, don't change the
471 // setting. Master download always succeeds.
473 Expected
= Mtftp6GetNextBlockNum (&Instance
->BlkList
);
474 ASSERT (Expected
!= -1);
476 if (Instance
->IsMaster
&& (Expected
!= 1)) {
480 ZeroMem (&ExtInfo
, sizeof (MTFTP6_EXT_OPTION_INFO
));
483 // Parse the options in the packet.
485 Status
= Mtftp6ParseStart (Packet
, Len
, &Count
, &Options
);
487 if (EFI_ERROR (Status
)) {
491 ASSERT (Options
!= NULL
);
494 // Parse the extensive options in the packet.
496 Status
= Mtftp6ParseExtensionOption (Options
, Count
, FALSE
, Instance
->Operation
, &ExtInfo
);
498 if (EFI_ERROR (Status
) || !Mtftp6RrqOackValid (Instance
, &ExtInfo
, &Instance
->ExtInfo
)) {
500 // Don't send an ERROR packet if the error is EFI_OUT_OF_RESOURCES.
502 if (Status
!= EFI_OUT_OF_RESOURCES
) {
504 // Free the received packet before send new packet in ReceiveNotify,
505 // since the udpio might need to be reconfigured.
507 NetbufFree (*UdpPacket
);
510 // Send the Mtftp6 error message if invalid packet.
514 EFI_MTFTP6_ERRORCODE_ILLEGAL_OPERATION
,
515 (UINT8
*)"Malformatted OACK packet"
519 return EFI_TFTP_ERROR
;
522 if ((ExtInfo
.BitMap
& MTFTP6_OPT_MCAST_BIT
) != 0) {
524 // Save the multicast info. Always update the Master, only update the
525 // multicast IP address, block size, window size, timeoute at the first time. If IP
526 // address is updated, create a UDP child to receive the multicast.
528 Instance
->IsMaster
= ExtInfo
.IsMaster
;
530 if (NetIp6IsUnspecifiedAddr (&Instance
->McastIp
)) {
531 if (NetIp6IsUnspecifiedAddr (&ExtInfo
.McastIp
) || (ExtInfo
.McastPort
== 0)) {
533 // Free the received packet before send new packet in ReceiveNotify,
534 // since the udpio might need to be reconfigured.
536 NetbufFree (*UdpPacket
);
539 // Send the Mtftp6 error message if invalid multi-cast setting.
543 EFI_MTFTP6_ERRORCODE_ILLEGAL_OPERATION
,
544 (UINT8
*)"Illegal multicast setting"
547 return EFI_TFTP_ERROR
;
551 // Create a UDP child then start receive the multicast from it.
556 sizeof (EFI_IP_ADDRESS
)
559 Instance
->McastPort
= ExtInfo
.McastPort
;
560 if (Instance
->McastUdpIo
== NULL
) {
561 Instance
->McastUdpIo
= UdpIoCreateIo (
562 Instance
->Service
->Controller
,
563 Instance
->Service
->Image
,
564 Mtftp6RrqConfigMcastUdpIo
,
568 if (Instance
->McastUdpIo
!= NULL
) {
569 Status
= gBS
->OpenProtocol (
570 Instance
->McastUdpIo
->UdpHandle
,
571 &gEfiUdp6ProtocolGuid
,
573 Instance
->Service
->Image
,
575 EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
577 if (EFI_ERROR (Status
)) {
578 UdpIoFreeIo (Instance
->McastUdpIo
);
579 Instance
->McastUdpIo
= NULL
;
580 return EFI_DEVICE_ERROR
;
585 if (Instance
->McastUdpIo
== NULL
) {
586 return EFI_DEVICE_ERROR
;
589 Status
= UdpIoRecvDatagram (
590 Instance
->McastUdpIo
,
596 if (EFI_ERROR (Status
)) {
598 // Free the received packet before send new packet in ReceiveNotify,
599 // since the udpio might need to be reconfigured.
601 NetbufFree (*UdpPacket
);
604 // Send the Mtftp6 error message if failed to create Udp6Io to receive.
608 EFI_MTFTP6_ERRORCODE_ACCESS_VIOLATION
,
609 (UINT8
*)"Failed to create socket to receive multicast packet"
616 // Update the parameters used.
618 if (ExtInfo
.BlkSize
!= 0) {
619 Instance
->BlkSize
= ExtInfo
.BlkSize
;
622 if (ExtInfo
.WindowSize
!= 0) {
623 Instance
->WindowSize
= ExtInfo
.WindowSize
;
626 if (ExtInfo
.Timeout
!= 0) {
627 Instance
->Timeout
= ExtInfo
.Timeout
;
631 Instance
->IsMaster
= TRUE
;
633 if (ExtInfo
.BlkSize
!= 0) {
634 Instance
->BlkSize
= ExtInfo
.BlkSize
;
637 if (ExtInfo
.WindowSize
!= 0) {
638 Instance
->WindowSize
= ExtInfo
.WindowSize
;
641 if (ExtInfo
.Timeout
!= 0) {
642 Instance
->Timeout
= ExtInfo
.Timeout
;
647 // Free the received packet before send new packet in ReceiveNotify,
648 // since the udpio might need to be reconfigured.
650 NetbufFree (*UdpPacket
);
653 // Send an ACK to (Expected - 1) which is 0 for unicast download,
654 // or tell the server we want to receive the Expected block.
656 return Mtftp6RrqSendAck (Instance
, (UINT16
)(Expected
- 1));
660 The packet process callback for Mtftp6 download.
662 @param[in] UdpPacket The pointer to the packet received.
663 @param[in] UdpEpt The pointer to the Udp6 access point.
664 @param[in] IoStatus The status from Udp6 instance.
665 @param[in] Context The pointer to the context.
671 IN NET_BUF
*UdpPacket
,
672 IN UDP_END_POINT
*UdpEpt
,
673 IN EFI_STATUS IoStatus
,
677 MTFTP6_INSTANCE
*Instance
;
678 EFI_MTFTP6_PACKET
*Packet
;
686 Instance
= (MTFTP6_INSTANCE
*)Context
;
688 NET_CHECK_SIGNATURE (Instance
, MTFTP6_INSTANCE_SIGNATURE
);
690 Status
= EFI_SUCCESS
;
697 // Return error status if Udp6 instance failed to receive.
699 if (EFI_ERROR (IoStatus
)) {
704 ASSERT (UdpPacket
!= NULL
);
706 if (UdpPacket
->TotalSize
< MTFTP6_OPCODE_LEN
) {
711 // Find the port this packet is from to restart receive correctly.
714 Ip6Swap128 (&UdpEpt
->LocalAddr
.v6
),
716 sizeof (EFI_IPv6_ADDRESS
)
725 // Client send initial request to server's listening port. Server
726 // will select a UDP port to communicate with the client. The server
727 // is required to use the same port as RemotePort to multicast the
730 if (UdpEpt
->RemotePort
!= Instance
->ServerDataPort
) {
731 if (Instance
->ServerDataPort
!= 0) {
735 // For the subsequent exchange of requests, reconfigure the udpio as
736 // (serverip, serverport, localip, localport).
737 // Usually, the client set serverport as 0 to receive and reset it
738 // once the first packet arrives to send ack.
740 Instance
->ServerDataPort
= UdpEpt
->RemotePort
;
745 // Copy the MTFTP packet to a continuous buffer if it isn't already so.
747 Len
= UdpPacket
->TotalSize
;
748 TotalNum
= UdpPacket
->BlockOpNum
;
751 Packet
= AllocateZeroPool (Len
);
753 if (Packet
== NULL
) {
754 Status
= EFI_OUT_OF_RESOURCES
;
758 NetbufCopy (UdpPacket
, 0, Len
, (UINT8
*)Packet
);
760 Packet
= (EFI_MTFTP6_PACKET
*)NetbufGetByte (UdpPacket
, 0, NULL
);
761 ASSERT (Packet
!= NULL
);
764 Opcode
= NTOHS (Packet
->OpCode
);
767 // Callback to the user's CheckPacket if provided. Abort the transmission
768 // if CheckPacket returns an EFI_ERROR code.
770 if ((Instance
->Token
->CheckPacket
!= NULL
) &&
771 ((Opcode
== EFI_MTFTP6_OPCODE_OACK
) || (Opcode
== EFI_MTFTP6_OPCODE_ERROR
))
774 Status
= Instance
->Token
->CheckPacket (
781 if (EFI_ERROR (Status
)) {
783 // Send an error message to the server to inform it
785 if (Opcode
!= EFI_MTFTP6_OPCODE_ERROR
) {
787 // Free the received packet before send new packet in ReceiveNotify,
788 // since the udpio might need to be reconfigured.
790 NetbufFree (UdpPacket
);
793 // Send the Mtftp6 error message if user aborted the current session.
797 EFI_MTFTP6_ERRORCODE_REQUEST_DENIED
,
798 (UINT8
*)"User aborted the transfer"
802 Status
= EFI_ABORTED
;
808 // Switch the process routines by the operation code.
811 case EFI_MTFTP6_OPCODE_DATA
:
812 if ((Len
> (UINT32
)(MTFTP6_DATA_HEAD_LEN
+ Instance
->BlkSize
)) || (Len
< (UINT32
)MTFTP6_DATA_HEAD_LEN
)) {
817 // Handle the data packet of Rrq.
819 Status
= Mtftp6RrqHandleData (
828 case EFI_MTFTP6_OPCODE_OACK
:
829 if (IsMcast
|| (Len
<= MTFTP6_OPCODE_LEN
)) {
834 // Handle the Oack packet of Rrq.
836 Status
= Mtftp6RrqHandleOack (
847 // Drop and return error if received error message.
849 Status
= EFI_TFTP_ERROR
;
855 // Free the resources, then if !EFI_ERROR (Status), restart the
856 // receive, otherwise end the session.
858 if ((Packet
!= NULL
) && (TotalNum
> 1)) {
862 if (UdpPacket
!= NULL
) {
863 NetbufFree (UdpPacket
);
866 if (!EFI_ERROR (Status
) && !IsCompleted
) {
868 Status
= UdpIoRecvDatagram (
869 Instance
->McastUdpIo
,
875 Status
= UdpIoRecvDatagram (
885 // Clean up the current session if failed to continue.
887 if (EFI_ERROR (Status
) || IsCompleted
) {
888 Mtftp6OperationClean (Instance
, Status
);
893 Start the Mtftp6 instance to download. It first initializes some
894 of the internal states, then builds and sends an RRQ request packet.
895 Finally, it starts receive for the downloading.
897 @param[in] Instance The pointer to the Mtftp6 instance.
898 @param[in] Operation The operation code of current packet.
900 @retval EFI_SUCCESS The Mtftp6 is started to download.
901 @retval Others Failed to start to download.
906 IN MTFTP6_INSTANCE
*Instance
,
913 // The valid block number range are [1, 0xffff]. For example:
914 // the client sends an RRQ request to the server, the server
915 // transfers the DATA1 block. If option negotiation is ongoing,
916 // the server will send back an OACK, then client will send ACK0.
918 Status
= Mtftp6InitBlockRange (&Instance
->BlkList
, 1, 0xffff);
920 if (EFI_ERROR (Status
)) {
924 Status
= Mtftp6SendRequest (Instance
, Operation
);
926 if (EFI_ERROR (Status
)) {
930 return UdpIoRecvDatagram (