Revision: 15017
          http://sourceforge.net/p/edk2/code/15017
Author:   jiaxinwu
Date:     2013-12-23 08:43:09 +0000 (Mon, 23 Dec 2013)
Log Message:
-----------
Fix a bug for vlan ping failure.

Signed-off-by: Wu Jiaxin <[email protected] >
Reviewed-by: Fu Siyuan <[email protected]>
Reviewed-by: Jin Eric <[email protected]>

Modified Paths:
--------------
    trunk/edk2/MdeModulePkg/Universal/Network/MnpDxe/MnpIo.c
    trunk/edk2/MdeModulePkg/Universal/Network/MnpDxe/MnpVlan.c
    trunk/edk2/MdeModulePkg/Universal/Network/MnpDxe/MnpVlan.h

Modified: trunk/edk2/MdeModulePkg/Universal/Network/MnpDxe/MnpIo.c
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/Network/MnpDxe/MnpIo.c    2013-12-23 
06:41:36 UTC (rev 15016)
+++ trunk/edk2/MdeModulePkg/Universal/Network/MnpDxe/MnpIo.c    2013-12-23 
08:43:09 UTC (rev 15017)
@@ -1,7 +1,7 @@
 /** @file
   Implementation of Managed Network Protocol I/O functions.
 
-Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2005 - 2013, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials
 are licensed and made available under the terms and conditions
 of the BSD License which accompanies this distribution.  The full
@@ -130,10 +130,20 @@
   MnpDerviceData = MnpServiceData->MnpDeviceData;
   if ((TxData->DestinationAddress == NULL) && (TxData->FragmentCount == 1)) {
     //
-    // Media header is in FragmentTable and there is only one fragment,
-    // use fragment buffer directly.
+    // Reserve space for vlan tag,if necessary.
     //
-    *PktBuf = TxData->FragmentTable[0].FragmentBuffer;
+    if (MnpServiceData->VlanId != 0) {
+      *PktBuf = MnpDerviceData->TxBuf + NET_VLAN_TAG_LEN;
+    } else {
+      *PktBuf = MnpDerviceData->TxBuf;
+    } 
+    
+    CopyMem (
+        *PktBuf,
+        TxData->FragmentTable[0].FragmentBuffer,
+        TxData->FragmentTable[0].FragmentLength
+        );
+    
     *PktLen = TxData->FragmentTable[0].FragmentLength;
   } else {
     //
@@ -235,10 +245,15 @@
     goto SIGNAL_TOKEN;
   }
 
-  //
-  // Insert VLAN tag
-  //
-  MnpInsertVlanTag (MnpServiceData, TxData, &ProtocolType, &Packet, &Length);
+  
+  if (MnpServiceData->VlanId != 0) {
+    //
+    // Insert VLAN tag
+    //
+    MnpInsertVlanTag (MnpServiceData, TxData, &ProtocolType, &Packet, &Length);
+  } else {
+    ProtocolType = TxData->ProtocolType;
+  }
 
   for (;;) {
     //

Modified: trunk/edk2/MdeModulePkg/Universal/Network/MnpDxe/MnpVlan.c
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/Network/MnpDxe/MnpVlan.c  2013-12-23 
06:41:36 UTC (rev 15016)
+++ trunk/edk2/MdeModulePkg/Universal/Network/MnpDxe/MnpVlan.c  2013-12-23 
08:43:09 UTC (rev 15017)
@@ -1,7 +1,7 @@
 /** @file
   VLAN Config Protocol implementation and VLAN packet process routine.
 
-Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials
 are licensed and made available under the terms and conditions
 of the BSD License which accompanies this distribution.  The full
@@ -171,7 +171,7 @@
 
 
 /**
-  Build the packet to transmit from the TxData passed in.
+  Build the vlan packet to transmit from the TxData passed in.
 
   @param  MnpServiceData         Pointer to the mnp service context data.
   @param  TxData                 Pointer to the transmit data containing the
@@ -197,11 +197,6 @@
   MNP_DEVICE_DATA         *MnpDeviceData;
   EFI_SIMPLE_NETWORK_MODE *SnpMode;
 
-  if (MnpServiceData->VlanId == 0) {
-    *ProtocolType = TxData->ProtocolType;
-    return ;
-  }
-
   MnpDeviceData = MnpServiceData->MnpDeviceData;
   SnpMode       = MnpDeviceData->Snp->Mode;
 

Modified: trunk/edk2/MdeModulePkg/Universal/Network/MnpDxe/MnpVlan.h
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/Network/MnpDxe/MnpVlan.h  2013-12-23 
06:41:36 UTC (rev 15016)
+++ trunk/edk2/MdeModulePkg/Universal/Network/MnpDxe/MnpVlan.h  2013-12-23 
08:43:09 UTC (rev 15017)
@@ -1,7 +1,7 @@
 /** @file
   Header file to be included by MnpVlan.c.
 
-Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials
 are licensed and made available under the terms and conditions
 of the BSD License which accompanies this distribution.  The full
@@ -59,7 +59,7 @@
   );
 
 /**
-  Build the packet to transmit from the TxData passed in.
+  Build the vlan packet to transmit from the TxData passed in.
 
   @param  MnpServiceData         Pointer to the mnp service context data.
   @param  TxData                 Pointer to the transmit data containing the

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to