remove member context from _EFI_MTFTP4_TOKEN structure.
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 20 Nov 2007 06:06:18 +0000 (06:06 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 20 Nov 2007 06:06:18 +0000 (06:06 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4308 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h

index 214ac44..3ce8792 100644 (file)
@@ -260,11 +260,13 @@ 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
-  State   = (MTFTP4_GETINFO_STATE *) Token->Context;\r
+  Instance = MTFTP4_PROTOCOL_FROM_THIS (This);\r
+  State    = &Instance->GetInfoState;\r
   OpCode   = NTOHS (Packet->OpCode);\r
 \r
   //\r
@@ -335,7 +337,8 @@ EfiMtftp4GetInfo (
   )\r
 {\r
   EFI_MTFTP4_TOKEN          Token;\r
-  MTFTP4_GETINFO_STATE      State;\r
+  MTFTP4_PROTOCOL           *Instance;\r
+  MTFTP4_GETINFO_STATE      *State;\r
   EFI_STATUS                Status;\r
 \r
   if ((This == NULL) || (Filename == NULL) || (PacketLength == NULL) ||\r
@@ -348,9 +351,11 @@ EfiMtftp4GetInfo (
   }\r
 \r
   *PacketLength         = 0;\r
-  State.Packet          = Packet;\r
-  State.PacketLen       = PacketLength;\r
-  State.Status          = EFI_SUCCESS;\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
 \r
   //\r
   // Fill in the Token to issue an synchronous ReadFile operation\r
@@ -364,7 +369,6 @@ 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
@@ -372,7 +376,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 9491506..c12b1dd 100644 (file)
@@ -86,6 +86,12 @@ struct _MTFTP4_SERVICE {
   UDP_IO_PORT                   *ConnectUdp;\r
 };\r
 \r
+typedef struct {\r
+  EFI_MTFTP4_PACKET             **Packet;\r
+  UINT32                        *PacketLen;\r
+  EFI_STATUS                    Status;\r
+} MTFTP4_GETINFO_STATE;\r
+\r
 struct _MTFTP4_PROTOCOL {\r
   UINT32                        Signature;\r
   NET_LIST_ENTRY                Link;\r
@@ -140,13 +146,9 @@ struct _MTFTP4_PROTOCOL {
   UINT16                        McastPort;\r
   BOOLEAN                       Master;\r
   UDP_IO_PORT                   *McastUdpPort;\r
-};\r
 \r
-typedef struct {\r
-  EFI_MTFTP4_PACKET             **Packet;\r
-  UINT32                        *PacketLen;\r
-  EFI_STATUS                    Status;\r
-} MTFTP4_GETINFO_STATE;\r
+  MTFTP4_GETINFO_STATE          GetInfoState;\r
+};\r
 \r
 VOID\r
 Mtftp4CleanOperation (\r