]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Updated EFI_MTFTP4_TOKEN structure to add member Context. It's an incompatible change...
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 24 Jul 2009 17:36:07 +0000 (17:36 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 24 Jul 2009 17:36:07 +0000 (17:36 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9005 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h
MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcMtftp.c
MdePkg/Include/Protocol/Mtftp4.h

index ea463edc556a4829929049fd79932edf3d79427a..4c459b22b88f40a3e54bacc6c243f1498b3a1861 100644 (file)
@@ -1,7 +1,7 @@
 /** @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
@@ -111,13 +111,11 @@ Mtftp4GetInfoCheckPacket (
   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
@@ -984,8 +982,7 @@ EfiMtftp4GetInfo (
   )\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
@@ -998,11 +995,9 @@ EfiMtftp4GetInfo (
   }\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
@@ -1016,6 +1011,7 @@ EfiMtftp4GetInfo (
   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
@@ -1023,7 +1019,7 @@ EfiMtftp4GetInfo (
   Status                = EfiMtftp4ReadFile (This, &Token);\r
 \r
   if (EFI_ABORTED == Status) {\r
-    return State->Status;\r
+    return State.Status;\r
   }\r
 \r
   return Status;\r
index 877164abb616f7e1a674b2bb044fe06f1d7a2ea6..8f39df3c4f2edeae414f019b1b2656b72c7d4b9f 100644 (file)
@@ -9,7 +9,7 @@
   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
@@ -149,8 +149,6 @@ struct _MTFTP4_PROTOCOL {
   UINT16                        McastPort;\r
   BOOLEAN                       Master;\r
   UDP_IO_PORT                   *McastUdpPort;\r
-\r
-  MTFTP4_GETINFO_STATE          GetInfoState;\r
 };\r
 \r
 /**\r
index d6d4cd581f5edcdd1798a9c9c4de3867791b9021..6eb0e64be0352cfb961094fc17e1af8a76a3b75a 100644 (file)
@@ -14,9 +14,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \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
@@ -55,7 +53,7 @@ PxeBcCheckPacket (
   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
@@ -271,7 +269,7 @@ PxeBcTftpReadFile (
   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
@@ -428,7 +426,7 @@ PxeBcTftpReadDirectory (
   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
index 988cbe16278b6f147d9db3ecb6aeef1cbade3f61..a0151b07a5d888afa97f67c7c0e441949d039ac7 100644 (file)
@@ -1,7 +1,7 @@
 /** @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
@@ -356,8 +356,8 @@ EFI_STATUS
   @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
@@ -540,13 +540,18 @@ struct _EFI_MTFTP4_TOKEN {
   ///\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