summaryrefslogtreecommitdiffstats
path: root/NetworkPkg
diff options
context:
space:
mode:
authorJiaxin Wu <Jiaxin.wu@intel.com>2018-09-14 15:49:23 +0800
committerJiaxin Wu <Jiaxin.wu@intel.com>2018-09-27 09:00:02 +0800
commit160b082e64a8336ac23eb4c28216a6097e6ba648 (patch)
tree05814e04806c2e56170eafc0f2cac25f723cb0df /NetworkPkg
parent2fff697f1eaaeba1e24fe0af381f39dc64b85061 (diff)
downloadedk2-160b082e64a8336ac23eb4c28216a6097e6ba648.tar.gz
edk2-160b082e64a8336ac23eb4c28216a6097e6ba648.tar.bz2
edk2-160b082e64a8336ac23eb4c28216a6097e6ba648.zip
NetworkPkg/UefiPxeBcDxe: Use the specified MTFTP windowsize.
*v2: Since the new PCD (PcdPxeTftpWindowSize) was renamed/defined in NetworkPkg instead of MdeModulePkg, this new version is to update the consuming PXE driver. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=886 This patch is to use the specified MTFTP windowsize to benefit the PXE download performance. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Shao Ming <ming.shao@intel.com> Cc: Laszlo Ersek <lersek@redhat.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>
Diffstat (limited to 'NetworkPkg')
-rw-r--r--NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c10
-rw-r--r--NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.c137
-rw-r--r--NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.h6
-rw-r--r--NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf3
4 files changed, 121 insertions, 35 deletions
diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
index 13396903f5..468b38d887 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
@@ -849,7 +849,7 @@ EfiPxeBcMtftp (
VOID *Config;
EFI_STATUS Status;
EFI_PXE_BASE_CODE_IP_FILTER IpFilter;
-
+ UINTN WindowSize;
if ((This == NULL) ||
(Filename == NULL) ||
@@ -873,6 +873,11 @@ EfiPxeBcMtftp (
Private = PXEBC_PRIVATE_DATA_FROM_PXEBC (This);
Mode = Private->PxeBc.Mode;
+ //
+ // Get PcdPxeTftpWindowSize.
+ //
+ WindowSize = (UINTN) PcdGet64 (PcdPxeTftpWindowSize);
+
if (Mode->UsingIpv6) {
if (!NetIp6IsValidUnicast (&ServerIp->v6)) {
return EFI_INVALID_PARAMETER;
@@ -930,6 +935,7 @@ EfiPxeBcMtftp (
Config,
Filename,
BlockSize,
+ (WindowSize > 1) ? &WindowSize : NULL,
BufferSize
);
@@ -944,6 +950,7 @@ EfiPxeBcMtftp (
Config,
Filename,
BlockSize,
+ (WindowSize > 1) ? &WindowSize : NULL,
BufferPtr,
BufferSize,
DontUseBuffer
@@ -976,6 +983,7 @@ EfiPxeBcMtftp (
Config,
Filename,
BlockSize,
+ (WindowSize > 1) ? &WindowSize : NULL,
BufferPtr,
BufferSize,
DontUseBuffer
diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.c b/NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.c
index 270190d42e..9725fb40dd 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.c
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.c
@@ -19,7 +19,8 @@ CHAR8 *mMtftpOptions[PXE_MTFTP_OPTION_MAXIMUM_INDEX] = {
"blksize",
"timeout",
"tsize",
- "multicast"
+ "multicast",
+ "windowsize"
};
@@ -122,15 +123,17 @@ PxeBcMtftp6GetFileSize (
IN EFI_MTFTP6_CONFIG_DATA *Config,
IN UINT8 *Filename,
IN UINTN *BlockSize,
+ IN UINTN *WindowSize,
IN OUT UINT64 *BufferSize
)
{
EFI_MTFTP6_PROTOCOL *Mtftp6;
- EFI_MTFTP6_OPTION ReqOpt[2];
+ EFI_MTFTP6_OPTION ReqOpt[3];
EFI_MTFTP6_PACKET *Packet;
EFI_MTFTP6_OPTION *Option;
UINT32 PktLen;
- UINT8 OptBuf[128];
+ UINT8 OptBuf[PXE_MTFTP_OPTBUF_MAXNUM_INDEX];
+ UINTN OptBufSize;
UINT32 OptCnt;
EFI_STATUS Status;
@@ -140,6 +143,7 @@ PxeBcMtftp6GetFileSize (
Packet = NULL;
Option = NULL;
PktLen = 0;
+ OptBufSize = PXE_MTFTP_OPTBUF_MAXNUM_INDEX;
OptCnt = 1;
Config->InitialServerPort = PXEBC_BS_DOWNLOAD_PORT;
@@ -152,13 +156,22 @@ PxeBcMtftp6GetFileSize (
// Build the required options for get info.
//
ReqOpt[0].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_TSIZE_INDEX];
- PxeBcUintnToAscDec (0, OptBuf, PXE_MTFTP_OPTBUF_MAXNUM_INDEX);
+ PxeBcUintnToAscDec (0, OptBuf, OptBufSize);
ReqOpt[0].ValueStr = OptBuf;
if (BlockSize != NULL) {
- ReqOpt[1].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_BLKSIZE_INDEX];
- ReqOpt[1].ValueStr = (UINT8 *) (ReqOpt[0].ValueStr + AsciiStrLen ((CHAR8 *) ReqOpt[0].ValueStr) + 1);
- PxeBcUintnToAscDec (*BlockSize, ReqOpt[1].ValueStr, PXE_MTFTP_OPTBUF_MAXNUM_INDEX - (AsciiStrLen ((CHAR8 *) ReqOpt[0].ValueStr) + 1));
+ ReqOpt[OptCnt].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_BLKSIZE_INDEX];
+ ReqOpt[OptCnt].ValueStr = (UINT8 *) (ReqOpt[OptCnt-1].ValueStr + AsciiStrLen ((CHAR8 *) ReqOpt[OptCnt-1].ValueStr) + 1);
+ OptBufSize -= (AsciiStrLen ((CHAR8 *) ReqOpt[OptCnt-1].ValueStr) + 1);
+ PxeBcUintnToAscDec (*BlockSize, ReqOpt[OptCnt].ValueStr, OptBufSize);
+ OptCnt++;
+ }
+
+ if (WindowSize != NULL) {
+ ReqOpt[OptCnt].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_WINDOWSIZE_INDEX];
+ ReqOpt[OptCnt].ValueStr = (UINT8 *) (ReqOpt[OptCnt-1].ValueStr + AsciiStrLen ((CHAR8 *) ReqOpt[OptCnt-1].ValueStr) + 1);
+ OptBufSize -= (AsciiStrLen ((CHAR8 *) ReqOpt[OptCnt-1].ValueStr) + 1);
+ PxeBcUintnToAscDec (*WindowSize, ReqOpt[OptCnt].ValueStr, OptBufSize);
OptCnt++;
}
@@ -250,6 +263,7 @@ PxeBcMtftp6ReadFile (
IN EFI_MTFTP6_CONFIG_DATA *Config,
IN UINT8 *Filename,
IN UINTN *BlockSize,
+ IN UINTN *WindowSize,
IN UINT8 *BufferPtr,
IN OUT UINT64 *BufferSize,
IN BOOLEAN DontUseBuffer
@@ -257,9 +271,10 @@ PxeBcMtftp6ReadFile (
{
EFI_MTFTP6_PROTOCOL *Mtftp6;
EFI_MTFTP6_TOKEN Token;
- EFI_MTFTP6_OPTION ReqOpt[1];
+ EFI_MTFTP6_OPTION ReqOpt[2];
UINT32 OptCnt;
- UINT8 OptBuf[128];
+ UINT8 BlksizeBuf[10];
+ UINT8 WindowsizeBuf[10];
EFI_STATUS Status;
Status = EFI_DEVICE_ERROR;
@@ -273,12 +288,20 @@ PxeBcMtftp6ReadFile (
}
if (BlockSize != NULL) {
- ReqOpt[0].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_BLKSIZE_INDEX];
- ReqOpt[0].ValueStr = OptBuf;
- PxeBcUintnToAscDec (*BlockSize, ReqOpt[0].ValueStr, PXE_MTFTP_OPTBUF_MAXNUM_INDEX);
+ ReqOpt[OptCnt].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_BLKSIZE_INDEX];
+ ReqOpt[OptCnt].ValueStr = BlksizeBuf;
+ PxeBcUintnToAscDec (*BlockSize, ReqOpt[OptCnt].ValueStr, sizeof (BlksizeBuf));
OptCnt++;
}
+ if (WindowSize != NULL) {
+ ReqOpt[OptCnt].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_WINDOWSIZE_INDEX];
+ ReqOpt[OptCnt].ValueStr = WindowsizeBuf;
+ PxeBcUintnToAscDec (*WindowSize, ReqOpt[OptCnt].ValueStr, sizeof (WindowsizeBuf));
+ OptCnt++;
+ }
+
+
Token.Event = NULL;
Token.OverrideData = NULL;
Token.Filename = Filename;
@@ -408,6 +431,7 @@ PxeBcMtftp6ReadDirectory (
IN EFI_MTFTP6_CONFIG_DATA *Config,
IN UINT8 *Filename,
IN UINTN *BlockSize,
+ IN UINTN *WindowSize,
IN UINT8 *BufferPtr,
IN OUT UINT64 *BufferSize,
IN BOOLEAN DontUseBuffer
@@ -415,9 +439,10 @@ PxeBcMtftp6ReadDirectory (
{
EFI_MTFTP6_PROTOCOL *Mtftp6;
EFI_MTFTP6_TOKEN Token;
- EFI_MTFTP6_OPTION ReqOpt[1];
+ EFI_MTFTP6_OPTION ReqOpt[2];
UINT32 OptCnt;
- UINT8 OptBuf[128];
+ UINT8 BlksizeBuf[10];
+ UINT8 WindowsizeBuf[10];
EFI_STATUS Status;
Status = EFI_DEVICE_ERROR;
@@ -431,9 +456,16 @@ PxeBcMtftp6ReadDirectory (
}
if (BlockSize != NULL) {
- ReqOpt[0].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_BLKSIZE_INDEX];
- ReqOpt[0].ValueStr = OptBuf;
- PxeBcUintnToAscDec (*BlockSize, ReqOpt[0].ValueStr, PXE_MTFTP_OPTBUF_MAXNUM_INDEX);
+ ReqOpt[OptCnt].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_BLKSIZE_INDEX];
+ ReqOpt[OptCnt].ValueStr = BlksizeBuf;
+ PxeBcUintnToAscDec (*BlockSize, ReqOpt[OptCnt].ValueStr, sizeof (BlksizeBuf));
+ OptCnt++;
+ }
+
+ if (WindowSize != NULL) {
+ ReqOpt[OptCnt].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_WINDOWSIZE_INDEX];
+ ReqOpt[OptCnt].ValueStr = WindowsizeBuf;
+ PxeBcUintnToAscDec (*WindowSize, ReqOpt[OptCnt].ValueStr, sizeof (WindowsizeBuf));
OptCnt++;
}
@@ -568,15 +600,17 @@ PxeBcMtftp4GetFileSize (
IN EFI_MTFTP4_CONFIG_DATA *Config,
IN UINT8 *Filename,
IN UINTN *BlockSize,
+ IN UINTN *WindowSize,
IN OUT UINT64 *BufferSize
)
{
EFI_MTFTP4_PROTOCOL *Mtftp4;
- EFI_MTFTP4_OPTION ReqOpt[2];
+ EFI_MTFTP4_OPTION ReqOpt[3];
EFI_MTFTP4_PACKET *Packet;
EFI_MTFTP4_OPTION *Option;
UINT32 PktLen;
- UINT8 OptBuf[128];
+ UINT8 OptBuf[PXE_MTFTP_OPTBUF_MAXNUM_INDEX];
+ UINTN OptBufSize;
UINT32 OptCnt;
EFI_STATUS Status;
@@ -586,6 +620,7 @@ PxeBcMtftp4GetFileSize (
Packet = NULL;
Option = NULL;
PktLen = 0;
+ OptBufSize = PXE_MTFTP_OPTBUF_MAXNUM_INDEX;
OptCnt = 1;
Config->InitialServerPort = PXEBC_BS_DOWNLOAD_PORT;
@@ -598,13 +633,22 @@ PxeBcMtftp4GetFileSize (
// Build the required options for get info.
//
ReqOpt[0].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_TSIZE_INDEX];
- PxeBcUintnToAscDec (0, OptBuf, PXE_MTFTP_OPTBUF_MAXNUM_INDEX);
+ PxeBcUintnToAscDec (0, OptBuf, OptBufSize);
ReqOpt[0].ValueStr = OptBuf;
if (BlockSize != NULL) {
- ReqOpt[1].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_BLKSIZE_INDEX];
- ReqOpt[1].ValueStr = (UINT8 *) (ReqOpt[0].ValueStr + AsciiStrLen ((CHAR8 *) ReqOpt[0].ValueStr) + 1);
- PxeBcUintnToAscDec (*BlockSize, ReqOpt[1].ValueStr, PXE_MTFTP_OPTBUF_MAXNUM_INDEX - (AsciiStrLen ((CHAR8 *) ReqOpt[0].ValueStr) + 1));
+ ReqOpt[OptCnt].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_BLKSIZE_INDEX];
+ ReqOpt[OptCnt].ValueStr = (UINT8 *) (ReqOpt[OptCnt-1].ValueStr + AsciiStrLen ((CHAR8 *) ReqOpt[OptCnt-1].ValueStr) + 1);
+ OptBufSize -= (AsciiStrLen ((CHAR8 *) ReqOpt[OptCnt-1].ValueStr) + 1);
+ PxeBcUintnToAscDec (*BlockSize, ReqOpt[OptCnt].ValueStr, OptBufSize);
+ OptCnt++;
+ }
+
+ if (WindowSize != NULL) {
+ ReqOpt[OptCnt].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_WINDOWSIZE_INDEX];
+ ReqOpt[OptCnt].ValueStr = (UINT8 *) (ReqOpt[OptCnt-1].ValueStr + AsciiStrLen ((CHAR8 *) ReqOpt[OptCnt-1].ValueStr) + 1);
+ OptBufSize -= (AsciiStrLen ((CHAR8 *) ReqOpt[OptCnt-1].ValueStr) + 1);
+ PxeBcUintnToAscDec (*WindowSize, ReqOpt[OptCnt].ValueStr, OptBufSize);
OptCnt++;
}
@@ -696,6 +740,7 @@ PxeBcMtftp4ReadFile (
IN EFI_MTFTP4_CONFIG_DATA *Config,
IN UINT8 *Filename,
IN UINTN *BlockSize,
+ IN UINTN *WindowSize,
IN UINT8 *BufferPtr,
IN OUT UINT64 *BufferSize,
IN BOOLEAN DontUseBuffer
@@ -703,9 +748,10 @@ PxeBcMtftp4ReadFile (
{
EFI_MTFTP4_PROTOCOL *Mtftp4;
EFI_MTFTP4_TOKEN Token;
- EFI_MTFTP4_OPTION ReqOpt[1];
+ EFI_MTFTP4_OPTION ReqOpt[2];
UINT32 OptCnt;
- UINT8 OptBuf[128];
+ UINT8 BlksizeBuf[10];
+ UINT8 WindowsizeBuf[10];
EFI_STATUS Status;
Status = EFI_DEVICE_ERROR;
@@ -719,9 +765,16 @@ PxeBcMtftp4ReadFile (
}
if (BlockSize != NULL) {
- ReqOpt[0].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_BLKSIZE_INDEX];
- ReqOpt[0].ValueStr = OptBuf;
- PxeBcUintnToAscDec (*BlockSize, ReqOpt[0].ValueStr, PXE_MTFTP_OPTBUF_MAXNUM_INDEX);
+ ReqOpt[OptCnt].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_BLKSIZE_INDEX];
+ ReqOpt[OptCnt].ValueStr = BlksizeBuf;
+ PxeBcUintnToAscDec (*BlockSize, ReqOpt[OptCnt].ValueStr, sizeof (BlksizeBuf));
+ OptCnt++;
+ }
+
+ if (WindowSize != NULL) {
+ ReqOpt[OptCnt].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_WINDOWSIZE_INDEX];
+ ReqOpt[OptCnt].ValueStr = WindowsizeBuf;
+ PxeBcUintnToAscDec (*WindowSize, ReqOpt[OptCnt].ValueStr, sizeof (WindowsizeBuf));
OptCnt++;
}
@@ -854,6 +907,7 @@ PxeBcMtftp4ReadDirectory (
IN EFI_MTFTP4_CONFIG_DATA *Config,
IN UINT8 *Filename,
IN UINTN *BlockSize,
+ IN UINTN *WindowSize,
IN UINT8 *BufferPtr,
IN OUT UINT64 *BufferSize,
IN BOOLEAN DontUseBuffer
@@ -861,9 +915,10 @@ PxeBcMtftp4ReadDirectory (
{
EFI_MTFTP4_PROTOCOL *Mtftp4;
EFI_MTFTP4_TOKEN Token;
- EFI_MTFTP4_OPTION ReqOpt[1];
+ EFI_MTFTP4_OPTION ReqOpt[2];
UINT32 OptCnt;
- UINT8 OptBuf[128];
+ UINT8 BlksizeBuf[10];
+ UINT8 WindowsizeBuf[10];
EFI_STATUS Status;
Status = EFI_DEVICE_ERROR;
@@ -877,9 +932,16 @@ PxeBcMtftp4ReadDirectory (
}
if (BlockSize != NULL) {
- ReqOpt[0].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_BLKSIZE_INDEX];
- ReqOpt[0].ValueStr = OptBuf;
- PxeBcUintnToAscDec (*BlockSize, ReqOpt[0].ValueStr, PXE_MTFTP_OPTBUF_MAXNUM_INDEX);
+ ReqOpt[OptCnt].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_BLKSIZE_INDEX];
+ ReqOpt[OptCnt].ValueStr = BlksizeBuf;
+ PxeBcUintnToAscDec (*BlockSize, ReqOpt[OptCnt].ValueStr, sizeof (BlksizeBuf));
+ OptCnt++;
+ }
+
+ if (WindowSize != NULL) {
+ ReqOpt[OptCnt].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_WINDOWSIZE_INDEX];
+ ReqOpt[OptCnt].ValueStr = WindowsizeBuf;
+ PxeBcUintnToAscDec (*WindowSize, ReqOpt[OptCnt].ValueStr, sizeof (WindowsizeBuf));
OptCnt++;
}
@@ -936,6 +998,7 @@ PxeBcTftpGetFileSize (
IN VOID *Config,
IN UINT8 *Filename,
IN UINTN *BlockSize,
+ IN UINTN *WindowSize,
IN OUT UINT64 *BufferSize
)
{
@@ -945,6 +1008,7 @@ PxeBcTftpGetFileSize (
(EFI_MTFTP6_CONFIG_DATA *) Config,
Filename,
BlockSize,
+ WindowSize,
BufferSize
);
} else {
@@ -953,6 +1017,7 @@ PxeBcTftpGetFileSize (
(EFI_MTFTP4_CONFIG_DATA *) Config,
Filename,
BlockSize,
+ WindowSize,
BufferSize
);
}
@@ -981,6 +1046,7 @@ PxeBcTftpReadFile (
IN VOID *Config,
IN UINT8 *Filename,
IN UINTN *BlockSize,
+ IN UINTN *WindowSize,
IN UINT8 *BufferPtr,
IN OUT UINT64 *BufferSize,
IN BOOLEAN DontUseBuffer
@@ -992,6 +1058,7 @@ PxeBcTftpReadFile (
(EFI_MTFTP6_CONFIG_DATA *) Config,
Filename,
BlockSize,
+ WindowSize,
BufferPtr,
BufferSize,
DontUseBuffer
@@ -1002,6 +1069,7 @@ PxeBcTftpReadFile (
(EFI_MTFTP4_CONFIG_DATA *) Config,
Filename,
BlockSize,
+ WindowSize,
BufferPtr,
BufferSize,
DontUseBuffer
@@ -1083,6 +1151,7 @@ PxeBcTftpReadDirectory (
IN VOID *Config,
IN UINT8 *Filename,
IN UINTN *BlockSize,
+ IN UINTN *WindowSize,
IN UINT8 *BufferPtr,
IN OUT UINT64 *BufferSize,
IN BOOLEAN DontUseBuffer
@@ -1094,6 +1163,7 @@ PxeBcTftpReadDirectory (
(EFI_MTFTP6_CONFIG_DATA *) Config,
Filename,
BlockSize,
+ WindowSize,
BufferPtr,
BufferSize,
DontUseBuffer
@@ -1104,6 +1174,7 @@ PxeBcTftpReadDirectory (
(EFI_MTFTP4_CONFIG_DATA *) Config,
Filename,
BlockSize,
+ WindowSize,
BufferPtr,
BufferSize,
DontUseBuffer
diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.h b/NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.h
index f1150762c6..edd8decbd8 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.h
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.h
@@ -20,7 +20,8 @@
#define PXE_MTFTP_OPTION_TIMEOUT_INDEX 1
#define PXE_MTFTP_OPTION_TSIZE_INDEX 2
#define PXE_MTFTP_OPTION_MULTICAST_INDEX 3
-#define PXE_MTFTP_OPTION_MAXIMUM_INDEX 4
+#define PXE_MTFTP_OPTION_WINDOWSIZE_INDEX 4
+#define PXE_MTFTP_OPTION_MAXIMUM_INDEX 5
#define PXE_MTFTP_OPTBUF_MAXNUM_INDEX 128
#define PXE_MTFTP_ERROR_STRING_LENGTH 127 // refer to definition of struct EFI_PXE_BASE_CODE_TFTP_ERROR.
@@ -48,6 +49,7 @@ PxeBcTftpGetFileSize (
IN VOID *Config,
IN UINT8 *Filename,
IN UINTN *BlockSize,
+ IN UINTN *WindowSize,
IN OUT UINT64 *BufferSize
);
@@ -74,6 +76,7 @@ PxeBcTftpReadFile (
IN VOID *Config,
IN UINT8 *Filename,
IN UINTN *BlockSize,
+ IN UINTN *WindowSize,
IN UINT8 *BufferPtr,
IN OUT UINT64 *BufferSize,
IN BOOLEAN DontUseBuffer
@@ -130,6 +133,7 @@ PxeBcTftpReadDirectory (
IN VOID *Config,
IN UINT8 *Filename,
IN UINTN *BlockSize,
+ IN UINTN *WindowSize,
IN UINT8 *BufferPtr,
IN OUT UINT64 *BufferSize,
IN BOOLEAN DontUseBuffer
diff --git a/NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf b/NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
index 55fa2b3c8c..e2a0eb44b1 100644
--- a/NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
+++ b/NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
@@ -55,6 +55,7 @@
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
+ NetworkPkg/NetworkPkg.dec
[LibraryClasses]
@@ -107,5 +108,7 @@
[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdTftpBlockSize ## SOMETIMES_CONSUMES
+ gEfiNetworkPkgTokenSpaceGuid.PcdPxeTftpWindowSize ## SOMETIMES_CONSUMES
+
[UserExtensions.TianoCore."ExtraFiles"]
UefiPxeBcDxeExtra.uni