1. Enable Mtftp4Dxe in MdeModulePkg.dsc
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 7 Aug 2007 02:25:50 +0000 (02:25 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 7 Aug 2007 02:25:50 +0000 (02:25 +0000)
2. Changed CustomDecompressLib's default instance to BaseCustomDecompressLibNull.inf

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3561 6f19259b-4bc3-4df7-8a09-765794883524

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

index e19e463..0f35f07 100644 (file)
@@ -42,7 +42,7 @@
   TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf\r
   UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf\r
   PeCoffLoaderLib|MdeModulePkg/Library/PeiDxePeCoffLoaderLib/PeCoffLoaderLib.inf\r
   TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf\r
   UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf\r
   PeCoffLoaderLib|MdeModulePkg/Library/PeiDxePeCoffLoaderLib/PeCoffLoaderLib.inf\r
-  CustomDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf\r
+  CustomDecompressLib|MdePkg/Library/BaseCustomDecompressLibNull/BaseCustomDecompressLibNull.inf\r
 \r
 [LibraryClasses.IA32]\r
   IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf\r
 \r
 [LibraryClasses.IA32]\r
   IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf\r
   MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxe.inf\r
   MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf\r
   MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf\r
   MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxe.inf\r
   MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf\r
   MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf\r
+  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf\r
   MdeModulePkg/Universal/Network/PxeBcDxe/PxeBcDxe.inf\r
   MdeModulePkg/Universal/Network/PxeDhcp4Dxe/PxeDhcp4Dxe.inf\r
   MdeModulePkg/Universal/Network/SnpDxe/SnpDxe.inf\r
   MdeModulePkg/Universal/Network/PxeBcDxe/PxeBcDxe.inf\r
   MdeModulePkg/Universal/Network/PxeDhcp4Dxe/PxeDhcp4Dxe.inf\r
   MdeModulePkg/Universal/Network/SnpDxe/SnpDxe.inf\r
index 5bfd253..2d3c4f5 100644 (file)
@@ -260,12 +260,14 @@ Mtftp4GetInfoCheckPacket (
   IN EFI_MTFTP4_PACKET      *Packet\r
   )\r
 {\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
   MTFTP4_GETINFO_STATE      *State;\r
   EFI_STATUS                Status;\r
   UINT16                    OpCode;\r
 \r
-  State   = (MTFTP4_GETINFO_STATE *) Token->Context;\r
-  OpCode  = NTOHS (Packet->OpCode);\r
+  Instance = MTFTP4_PROTOCOL_FROM_THIS (This);\r
+  State    = &Instance->GetInfoState;\r
+  OpCode   = NTOHS (Packet->OpCode);\r
 \r
   //\r
   // Set the GetInfo's return status according to the OpCode.\r
 \r
   //\r
   // Set the GetInfo's return status according to the OpCode.\r
@@ -335,7 +337,8 @@ EfiMtftp4GetInfo (
   )\r
 {\r
   EFI_MTFTP4_TOKEN          Token;\r
   )\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
   EFI_STATUS                Status;\r
 \r
   if ((This == NULL) || (Filename == NULL) || (PacketLength == NULL) ||\r
@@ -348,9 +351,11 @@ EfiMtftp4GetInfo (
   }\r
 \r
   *PacketLength         = 0;\r
   }\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
 \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.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
   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
   Status                = EfiMtftp4ReadFile (This, &Token);\r
 \r
   if (EFI_ABORTED == Status) {\r
-    return State.Status;\r
+    return State->Status;\r
   }\r
 \r
   return Status;\r
   }\r
 \r
   return Status;\r
index 24afe6b..9bf5bd5 100644 (file)
@@ -86,6 +86,12 @@ typedef struct _MTFTP4_SERVICE {
   UDP_IO_PORT                   *ConnectUdp;
 };
 
   UDP_IO_PORT                   *ConnectUdp;
 };
 
+typedef struct {
+  EFI_MTFTP4_PACKET             **Packet;
+  UINT32                        *PacketLen;
+  EFI_STATUS                    Status;
+} MTFTP4_GETINFO_STATE;
+
 typedef struct _MTFTP4_PROTOCOL {
   UINT32                        Signature;
   NET_LIST_ENTRY                Link;
 typedef struct _MTFTP4_PROTOCOL {
   UINT32                        Signature;
   NET_LIST_ENTRY                Link;
@@ -140,13 +146,9 @@ typedef struct _MTFTP4_PROTOCOL {
   UINT16                        McastPort;
   BOOLEAN                       Master;
   UDP_IO_PORT                   *McastUdpPort;
   UINT16                        McastPort;
   BOOLEAN                       Master;
   UDP_IO_PORT                   *McastUdpPort;
-};
 
 
-typedef struct {
-  EFI_MTFTP4_PACKET             **Packet;
-  UINT32                        *PacketLen;
-  EFI_STATUS                    Status;
-} MTFTP4_GETINFO_STATE;
+  MTFTP4_GETINFO_STATE          GetInfoState;
+};
 
 VOID
 Mtftp4CleanOperation (
 
 VOID
 Mtftp4CleanOperation (