/** @file\r
Support routines for MTFTP.\r
- \r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
LIST_ENTRY Link;\r
INTN Start;\r
INTN End;\r
+ INTN Round;\r
+ INTN Bound;\r
} MTFTP4_BLOCK_RANGE;\r
\r
\r
/**\r
- Initialize the block range for either RRQ or WRQ. \r
- \r
- RRQ and WRQ have different requirements for Start and End. \r
- For example, during start up, WRQ initializes its whole valid block range \r
- to [0, 0xffff]. This is bacause the server will send us a ACK0 to inform us \r
- to start the upload. When the client received ACK0, it will remove 0 from the \r
+ Initialize the block range for either RRQ or WRQ.\r
+\r
+ RRQ and WRQ have different requirements for Start and End.\r
+ For example, during start up, WRQ initializes its whole valid block range\r
+ to [0, 0xffff]. This is bacause the server will send us a ACK0 to inform us\r
+ to start the upload. When the client received ACK0, it will remove 0 from the\r
range, get the next block number, which is 1, then upload the BLOCK1. For RRQ\r
- without option negotiation, the server will directly send us the BLOCK1 in \r
- response to the client's RRQ. When received BLOCK1, the client will remove \r
- it from the block range and send an ACK. It also works if there is option \r
+ without option negotiation, the server will directly send us the BLOCK1 in\r
+ response to the client's RRQ. When received BLOCK1, the client will remove\r
+ it from the block range and send an ACK. It also works if there is option\r
negotiation.\r
\r
@param Head The block range head to initialize\r
\r
@param Head The block range head\r
\r
- @return The first valid block number, -1 if the block range is empty. \r
+ @return The first valid block number, -1 if the block range is empty.\r
\r
**/\r
INTN\r
);\r
\r
/**\r
- Set the last block number of the block range list. \r
- \r
+ Set the last block number of the block range list.\r
+\r
It will remove all the blocks after the Last. MTFTP initialize the block range\r
- to the maximum possible range, such as [0, 0xffff] for WRQ. When it gets the \r
+ to the maximum possible range, such as [0, 0xffff] for WRQ. When it gets the\r
last block number, it will call this function to set the last block number.\r
\r
@param Head The block range list\r
\r
@param Head The block range list to remove from\r
@param Num The block number to remove\r
+ @param Completed Whether Num is the last block number.\r
+ @param BlockCounter The continuous block counter instead of the value after roll-over.\r
\r
@retval EFI_NOT_FOUND The block number isn't in the block range list\r
@retval EFI_SUCCESS The block number has been removed from the list\r
EFI_STATUS\r
Mtftp4RemoveBlockNum (\r
IN LIST_ENTRY *Head,\r
- IN UINT16 Num\r
+ IN UINT16 Num,\r
+ IN BOOLEAN Completed,\r
+ OUT UINT64 *BlockCounter\r
);\r
\r
/**\r
);\r
\r
/**\r
- Send the packet for the instance. \r
- \r
- It will first save a reference to the packet for later retransmission. \r
- Then determine the destination port, listen port for requests, and connected \r
+ Send the packet for the instance.\r
+\r
+ It will first save a reference to the packet for later retransmission.\r
+ Then determine the destination port, listen port for requests, and connected\r
port for others. At last, send the packet out.\r
\r
@param Instance The Mtftp instance\r
Build then send an error message.\r
\r
@param Instance The MTFTP session\r
- @param ErrCode The error code \r
+ @param ErrCode The error code\r
@param ErrInfo The error message\r
\r
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory for the error packet\r
IN UINT8 *ErrInfo\r
);\r
\r
-/**\r
- Retransmit the last packet for the instance.\r
\r
- @param Instance The Mtftp instance\r
+/**\r
+ The timer ticking function in TPL_NOTIFY level for the Mtftp service instance.\r
\r
- @retval EFI_SUCCESS The last packet is retransmitted.\r
- @retval Others Failed to retransmit.\r
+ @param Event The ticking event\r
+ @param Context The Mtftp service instance\r
\r
**/\r
-EFI_STATUS\r
-Mtftp4Retransmit (\r
- IN MTFTP4_PROTOCOL *Instance\r
+VOID\r
+EFIAPI\r
+Mtftp4OnTimerTickNotifyLevel (\r
+ IN EFI_EVENT Event,\r
+ IN VOID *Context\r
);\r
\r
/**\r