NetworkPkg/Mtftp6Dxe: Support windowsize in read request operation.
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=886 This patch is to support the TFTP windowsize option described in RFC 7440. The feature allows the client and server to negotiate a window size of consecutive blocks to send as an alternative for replacing the single-block lockstep schema. Currently, the windowsize for write request operation is not supported since there is no real use cases. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Shao Ming <ming.shao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
This commit is contained in:
@@ -979,6 +979,10 @@ Mtftp6OperationClean (
|
||||
Instance->ServerDataPort = 0;
|
||||
Instance->McastPort = 0;
|
||||
Instance->BlkSize = 0;
|
||||
Instance->Operation = 0;
|
||||
Instance->WindowSize = 1;
|
||||
Instance->TotalBlock = 0;
|
||||
Instance->AckedBlock = 0;
|
||||
Instance->LastBlk = 0;
|
||||
Instance->PacketToLive = 0;
|
||||
Instance->MaxRetry = 0;
|
||||
@@ -1051,6 +1055,8 @@ Mtftp6OperationStart (
|
||||
Status = EFI_SUCCESS;
|
||||
Instance->OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
|
||||
|
||||
Instance->Operation = OpCode;
|
||||
|
||||
//
|
||||
// Parse the extension options in the request packet.
|
||||
//
|
||||
@@ -1060,6 +1066,7 @@ Mtftp6OperationStart (
|
||||
Token->OptionList,
|
||||
Token->OptionCount,
|
||||
TRUE,
|
||||
Instance->Operation,
|
||||
&Instance->ExtInfo
|
||||
);
|
||||
|
||||
@@ -1105,6 +1112,9 @@ Mtftp6OperationStart (
|
||||
if (Instance->BlkSize == 0) {
|
||||
Instance->BlkSize = MTFTP6_DEFAULT_BLK_SIZE;
|
||||
}
|
||||
if (Instance->WindowSize == 0) {
|
||||
Instance->WindowSize = MTFTP6_DEFAULT_WINDOWSIZE;
|
||||
}
|
||||
if (Instance->MaxRetry == 0) {
|
||||
Instance->MaxRetry = MTFTP6_DEFAULT_MAX_RETRY;
|
||||
}
|
||||
|
Reference in New Issue
Block a user