\r
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\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
-http://opensource.org/licenses/bsd-license.php<BR>\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
Instance->Operation = 0;\r
\r
Instance->BlkSize = MTFTP4_DEFAULT_BLKSIZE;\r
+ Instance->WindowSize = 1;\r
+ Instance->TotalBlock = 0;\r
+ Instance->AckedBlock = 0;\r
Instance->LastBlock = 0;\r
Instance->ServerIp = 0;\r
Instance->ListeningPort = 0;\r
UdpConfig.UseDefaultAddress = Config->UseDefaultSetting;\r
IP4_COPY_ADDRESS (&UdpConfig.StationAddress, &Config->StationIp);\r
IP4_COPY_ADDRESS (&UdpConfig.SubnetMask, &Config->SubnetMask);\r
- UdpConfig.StationPort = 0;\r
+ UdpConfig.StationPort = Config->LocalPort;\r
UdpConfig.RemotePort = 0;\r
\r
Ip = HTONL (Instance->ServerIp);\r
Token->OptionList,\r
Token->OptionCount,\r
TRUE,\r
+ Instance->Operation,\r
&Instance->RequestOption\r
);\r
\r
Config = &Instance->Config;\r
Instance->Token = Token;\r
Instance->BlkSize = MTFTP4_DEFAULT_BLKSIZE;\r
+ Instance->WindowSize = MTFTP4_DEFAULT_WINDOWSIZE;\r
\r
CopyMem (&Instance->ServerIp, &Config->ServerIp, sizeof (IP4_ADDR));\r
Instance->ServerIp = NTOHL (Instance->ServerIp);\r
goto ON_ERROR;\r
}\r
\r
+ gBS->RestoreTPL(OldTpl);\r
+\r
if (Token->Event != NULL) {\r
- gBS->RestoreTPL (OldTpl);\r
return EFI_SUCCESS;\r
}\r
\r
This->Poll (This);\r
}\r
\r
- gBS->RestoreTPL (OldTpl);\r
return Token->Status;\r
\r
ON_ERROR:\r
}\r
\r
if ((Gateway != 0) &&\r
- (!IP4_NET_EQUAL (Gateway, Ip, Netmask) || (Netmask != 0 && !NetIp4IsUnicast (Gateway, Netmask)))) {\r
+ ((Netmask != 0xFFFFFFFF && !IP4_NET_EQUAL (Gateway, Ip, Netmask)) || (Netmask != 0 && !NetIp4IsUnicast (Gateway, Netmask)))) {\r
\r
return EFI_INVALID_PARAMETER;\r
}\r