Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com >
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Jin Eric <eric.jin@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15017
6f19259b-4bc3-4df7-8a09-
765794883524
/** @file\r
Implementation of Managed Network Protocol I/O functions.\r
\r
/** @file\r
Implementation of Managed Network Protocol I/O functions.\r
\r
-Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2013, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions\r
of the BSD License which accompanies this distribution. The full\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions\r
of the BSD License which accompanies this distribution. The full\r
MnpDerviceData = MnpServiceData->MnpDeviceData;\r
if ((TxData->DestinationAddress == NULL) && (TxData->FragmentCount == 1)) {\r
//\r
MnpDerviceData = MnpServiceData->MnpDeviceData;\r
if ((TxData->DestinationAddress == NULL) && (TxData->FragmentCount == 1)) {\r
//\r
- // Media header is in FragmentTable and there is only one fragment,\r
- // use fragment buffer directly.\r
+ // Reserve space for vlan tag,if necessary.\r
- *PktBuf = TxData->FragmentTable[0].FragmentBuffer;\r
+ if (MnpServiceData->VlanId != 0) {\r
+ *PktBuf = MnpDerviceData->TxBuf + NET_VLAN_TAG_LEN;\r
+ } else {\r
+ *PktBuf = MnpDerviceData->TxBuf;\r
+ } \r
+ \r
+ CopyMem (\r
+ *PktBuf,\r
+ TxData->FragmentTable[0].FragmentBuffer,\r
+ TxData->FragmentTable[0].FragmentLength\r
+ );\r
+ \r
*PktLen = TxData->FragmentTable[0].FragmentLength;\r
} else {\r
//\r
*PktLen = TxData->FragmentTable[0].FragmentLength;\r
} else {\r
//\r
goto SIGNAL_TOKEN;\r
}\r
\r
goto SIGNAL_TOKEN;\r
}\r
\r
- //\r
- // Insert VLAN tag\r
- //\r
- MnpInsertVlanTag (MnpServiceData, TxData, &ProtocolType, &Packet, &Length);\r
+ \r
+ if (MnpServiceData->VlanId != 0) {\r
+ //\r
+ // Insert VLAN tag\r
+ //\r
+ MnpInsertVlanTag (MnpServiceData, TxData, &ProtocolType, &Packet, &Length);\r
+ } else {\r
+ ProtocolType = TxData->ProtocolType;\r
+ }\r
/** @file\r
VLAN Config Protocol implementation and VLAN packet process routine.\r
\r
/** @file\r
VLAN Config Protocol implementation and VLAN packet process routine.\r
\r
-Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions\r
of the BSD License which accompanies this distribution. The full\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions\r
of the BSD License which accompanies this distribution. The full\r
- Build the packet to transmit from the TxData passed in.\r
+ Build the vlan packet to transmit from the TxData passed in.\r
\r
@param MnpServiceData Pointer to the mnp service context data.\r
@param TxData Pointer to the transmit data containing the\r
\r
@param MnpServiceData Pointer to the mnp service context data.\r
@param TxData Pointer to the transmit data containing the\r
MNP_DEVICE_DATA *MnpDeviceData;\r
EFI_SIMPLE_NETWORK_MODE *SnpMode;\r
\r
MNP_DEVICE_DATA *MnpDeviceData;\r
EFI_SIMPLE_NETWORK_MODE *SnpMode;\r
\r
- if (MnpServiceData->VlanId == 0) {\r
- *ProtocolType = TxData->ProtocolType;\r
- return ;\r
- }\r
-\r
MnpDeviceData = MnpServiceData->MnpDeviceData;\r
SnpMode = MnpDeviceData->Snp->Mode;\r
\r
MnpDeviceData = MnpServiceData->MnpDeviceData;\r
SnpMode = MnpDeviceData->Snp->Mode;\r
\r
/** @file\r
Header file to be included by MnpVlan.c.\r
\r
/** @file\r
Header file to be included by MnpVlan.c.\r
\r
-Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions\r
of the BSD License which accompanies this distribution. The full\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions\r
of the BSD License which accompanies this distribution. The full\r
- Build the packet to transmit from the TxData passed in.\r
+ Build the vlan packet to transmit from the TxData passed in.\r
\r
@param MnpServiceData Pointer to the mnp service context data.\r
@param TxData Pointer to the transmit data containing the\r
\r
@param MnpServiceData Pointer to the mnp service context data.\r
@param TxData Pointer to the transmit data containing the\r