TianoCore EDK2 master
|
Go to the source code of this file.
Data Structures | |
struct | MTFTP4_BLOCK_RANGE |
Functions | |
EFI_STATUS | Mtftp4InitBlockRange (IN LIST_ENTRY *Head, IN UINT16 Start, IN UINT16 End) |
INTN | Mtftp4GetNextBlockNum (IN LIST_ENTRY *Head) |
VOID | Mtftp4SetLastBlockNum (IN LIST_ENTRY *Head, IN UINT16 Last) |
EFI_STATUS | Mtftp4RemoveBlockNum (IN LIST_ENTRY *Head, IN UINT16 Num, IN BOOLEAN Completed, OUT UINT64 *BlockCounter) |
VOID | Mtftp4SetTimeout (IN OUT MTFTP4_PROTOCOL *Instance) |
EFI_STATUS | Mtftp4SendPacket (IN OUT MTFTP4_PROTOCOL *Instance, IN OUT NET_BUF *Packet) |
EFI_STATUS | Mtftp4SendRequest (IN MTFTP4_PROTOCOL *Instance) |
EFI_STATUS | Mtftp4SendError (IN MTFTP4_PROTOCOL *Instance, IN UINT16 ErrCode, IN UINT8 *ErrInfo) |
VOID EFIAPI | Mtftp4OnTimerTickNotifyLevel (IN EFI_EVENT Event, IN VOID *Context) |
VOID EFIAPI | Mtftp4OnTimerTick (IN EFI_EVENT Event, IN VOID *Context) |
Support routines for MTFTP.
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Mtftp4Support.h.
INTN Mtftp4GetNextBlockNum | ( | IN LIST_ENTRY * | Head | ) |
Get the first valid block number on the range list.
Head | The block range head |
Definition at line 91 of file Mtftp4Support.c.
EFI_STATUS Mtftp4InitBlockRange | ( | IN LIST_ENTRY * | Head, |
IN UINT16 | Start, | ||
IN UINT16 | End | ||
) |
Initialize the block range for either RRQ or WRQ.
RRQ and WRQ have different requirements for Start and End. For example, during start up, WRQ initializes its whole valid block range to [0, 0xffff]. This is because the server will send us a ACK0 to inform us to start the upload. When the client received ACK0, it will remove 0 from the range, get the next block number, which is 1, then upload the BLOCK1. For RRQ without option negotiation, the server will directly send us the BLOCK1 in response to the client's RRQ. When received BLOCK1, the client will remove it from the block range and send an ACK. It also works if there is option negotiation.
Head | The block range head to initialize |
Start | The Start block number. |
End | The last block number. |
EFI_OUT_OF_RESOURCES | Failed to allocate memory for initial block range |
EFI_SUCCESS | The initial block range is created. |
Definition at line 64 of file Mtftp4Support.c.
The timer ticking function for the Mtftp service instance.
Event | The ticking event |
Context | The Mtftp service instance |
Definition at line 596 of file Mtftp4Support.c.
The timer ticking function in TPL_NOTIFY level for the Mtftp service instance.
Event | The ticking event |
Context | The Mtftp service instance |
Definition at line 561 of file Mtftp4Support.c.
EFI_STATUS Mtftp4RemoveBlockNum | ( | IN LIST_ENTRY * | Head, |
IN UINT16 | Num, | ||
IN BOOLEAN | Completed, | ||
OUT UINT64 * | BlockCounter | ||
) |
Remove the block number from the block range list.
Head | The block range list to remove from |
Num | The block number to remove |
Completed | Whether Num is the last block number. |
BlockCounter | The continuous block counter instead of the value after roll-over. |
EFI_NOT_FOUND | The block number isn't in the block range list |
EFI_SUCCESS | The block number has been removed from the list |
EFI_OUT_OF_RESOURCES | Failed to allocate resource |
Definition at line 159 of file Mtftp4Support.c.
EFI_STATUS Mtftp4SendError | ( | IN MTFTP4_PROTOCOL * | Instance, |
IN UINT16 | ErrCode, | ||
IN UINT8 * | ErrInfo | ||
) |
Build then send an error message.
Instance | The MTFTP session |
ErrCode | The error code |
ErrInfo | The error message |
EFI_OUT_OF_RESOURCES | Failed to allocate memory for the error packet |
EFI_SUCCESS | The error packet is transmitted. |
Others | Failed to transmit the packet. |
Definition at line 352 of file Mtftp4Support.c.
EFI_STATUS Mtftp4SendPacket | ( | IN OUT MTFTP4_PROTOCOL * | Instance, |
IN OUT NET_BUF * | Packet | ||
) |
Send the packet for the instance.
It will first save a reference to the packet for later retransmission. Then determine the destination port, listen port for requests, and connected port for others. At last, send the packet out.
Instance | The Mtftp instance |
Packet | The packet to send |
EFI_SUCCESS | The packet is sent out |
Others | Failed to transmit the packet. |
Definition at line 435 of file Mtftp4Support.c.
EFI_STATUS Mtftp4SendRequest | ( | IN MTFTP4_PROTOCOL * | Instance | ) |
Build then transmit the request packet for the MTFTP session.
Instance | The Mtftp session |
EFI_OUT_OF_RESOURCES | Failed to allocate memory for the request |
EFI_SUCCESS | The request is built and sent |
Others | Failed to transmit the packet. |
Definition at line 259 of file Mtftp4Support.c.
VOID Mtftp4SetLastBlockNum | ( | IN LIST_ENTRY * | Head, |
IN UINT16 | Last | ||
) |
Set the last block number of the block range list.
It will remove all the blocks after the Last. MTFTP initialize the block range to the maximum possible range, such as [0, 0xffff] for WRQ. When it gets the last block number, it will call this function to set the last block number.
Head | The block range list |
Last | The last block number |
Definition at line 117 of file Mtftp4Support.c.
VOID Mtftp4SetTimeout | ( | IN OUT MTFTP4_PROTOCOL * | Instance | ) |
Set the timeout for the instance. User a longer time for passive instances.
Instance | The Mtftp session to set time out |
Definition at line 409 of file Mtftp4Support.c.