/** @file\r
Interface routine for Mtftp4.\r
\r
-Copyright (c) 2006 - 2007, 2009, Intel Corporation<BR>\r
+Copyright (c) 2006 - 2009, Intel Corporation<BR>\r
All rights reserved. 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
IN EFI_MTFTP4_PACKET *Packet\r
)\r
{\r
- MTFTP4_PROTOCOL *Instance;\r
MTFTP4_GETINFO_STATE *State;\r
EFI_STATUS Status;\r
UINT16 OpCode;\r
\r
- Instance = MTFTP4_PROTOCOL_FROM_THIS (This);\r
- State = &Instance->GetInfoState;\r
+ State = (MTFTP4_GETINFO_STATE *) Token->Context;\r
OpCode = NTOHS (Packet->OpCode);\r
\r
//\r
)\r
{\r
EFI_MTFTP4_TOKEN Token;\r
- MTFTP4_PROTOCOL *Instance;\r
- MTFTP4_GETINFO_STATE *State;\r
+ MTFTP4_GETINFO_STATE State;\r
EFI_STATUS Status;\r
\r
if ((This == NULL) || (Filename == NULL) || (PacketLength == NULL) ||\r
}\r
\r
*PacketLength = 0;\r
- Instance = MTFTP4_PROTOCOL_FROM_THIS (This);\r
- State = &Instance->GetInfoState;\r
- State->Packet = Packet;\r
- State->PacketLen = PacketLength;\r
- State->Status = EFI_SUCCESS;\r
+ State.Packet = Packet;\r
+ State.PacketLen = PacketLength;\r
+ State.Status = EFI_SUCCESS;\r
\r
//\r
// Fill in the Token to issue an synchronous ReadFile operation\r
Token.OptionList = OptionList;\r
Token.BufferSize = 0;\r
Token.Buffer = NULL;\r
+ Token.Context = &State;\r
Token.CheckPacket = Mtftp4GetInfoCheckPacket;\r
Token.TimeoutCallback = NULL;\r
Token.PacketNeeded = NULL;\r
Status = EfiMtftp4ReadFile (This, &Token);\r
\r
if (EFI_ABORTED == Status) {\r
- return State->Status;\r
+ return State.Status;\r
}\r
\r
return Status;\r
RFC2348 - TFTP Blocksize Option\r
RFC2349 - TFTP Timeout Interval and Transfer Size Options\r
\r
-Copyright (c) 2006 - 2007, Intel Corporation<BR>\r
+Copyright (c) 2006 - 2009, Intel Corporation<BR>\r
All rights reserved. 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
UINT16 McastPort;\r
BOOLEAN Master;\r
UDP_IO_PORT *McastUdpPort;\r
-\r
- MTFTP4_GETINFO_STATE GetInfoState;\r
};\r
\r
/**\r
\r
#include "PxeBcImpl.h"\r
\r
-VOID *TokenContext = NULL;\r
-\r
-CHAR8 *mMtftpOptions[PXE_MTFTP_OPTION_MAXIMUM_INDEX] = {\r
+UINT8 *mMtftpOptions[PXE_MTFTP_OPTION_MAXIMUM_INDEX] = {\r
"blksize",\r
"timeout",\r
"tsize",\r
EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL *Callback;\r
EFI_STATUS Status;\r
\r
- Private = (PXEBC_PRIVATE_DATA *) TokenContext;\r
+ Private = (PXEBC_PRIVATE_DATA *) Token->Context;\r
Callback = Private->PxeBcCallback;\r
Status = EFI_SUCCESS;\r
\r
Token.ModeStr = NULL;\r
Token.OptionCount = OptCnt;\r
Token.OptionList = ReqOpt;\r
- TokenContext = Private;\r
+ Token.Context = Private;\r
\r
if (DontUseBuffer) {\r
Token.BufferSize = 0;\r
Token.ModeStr = NULL;\r
Token.OptionCount = OptCnt;\r
Token.OptionList = ReqOpt;\r
- TokenContext = Private;\r
+ Token.Context = Private;\r
\r
if (DontUseBuffer) {\r
Token.BufferSize = 0;\r
/** @file\r
EFI Multicast Trivial File Tranfer Protocol Definition\r
\r
- Copyright (c) 2006 - 2008, Intel Corporation \r
+ Copyright (c) 2006 - 2009, Intel Corporation \r
All rights reserved. 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
@param Packet Pointer to the OACK packet to be parsed.\r
@param OptionCount Pointer to the number of options in following OptionList.\r
@param OptionList Pointer to EFI_MTFTP4_OPTION storage. Call the EFI Boot\r
- Service FreePool() to release each option if they are not\r
- needed any more.\r
+ Service FreePool() to release the OptionList if the options\r
+ in this OptionList are not needed any more.\r
\r
@retval EFI_SUCCESS The OACK packet was valid and the OptionCount and\r
OptionList parameters have been updated.\r
///\r
/// Size of the data buffer.\r
///\r
- OUT UINT64 BufferSize;\r
+ UINT64 BufferSize;\r
///\r
/// Pointer to the data buffer. Data that is downloaded from the\r
/// MTFTPv4 server is stored here. Data that is uploaded to the\r
/// MTFTPv4 server is read from here. Ignored if BufferSize is zero.\r
///\r
- OUT VOID *Buffer;\r
+ VOID *Buffer;\r
+ ///\r
+ /// Pointer to the context that will be used by CheckPacket, \r
+ /// TimeoutCallback and PacketNeeded.\r
+ ///\r
+ VOID *Context;\r
///\r
/// Pointer to the callback function to check the contents of the received packet.\r
///\r