Changeset 39357 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Nov 17, 2011 9:27:04 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevE1000.cpp
r39344 r39357 3206 3206 if (cbFrame > 16 && pState->fVTag) 3207 3207 { 3208 /* 3209 * We should have 'adjusted' pvSeg earlier to make room for four 3210 * additional bytes at the beginning of buffer. Now we move it back. 3211 */ 3212 uint32_t *pSrc = (uint32_t*)pSg->aSegs[0].pvSeg; 3213 uint32_t *pDst = pSrc - 1; 3214 pSg->aSegs[0].pvSeg = pDst; 3215 *pDst++ = *pSrc++; /* Copy destination address */ 3216 *pDst++ = *pSrc++; /* Copy destination and source addresses */ 3217 *pDst++ = *pSrc++; /* Copy source address */ 3218 *pDst++ = RT_BE2H_U16(VET) | (RT_BE2H_U16(pState->u16VTagTCI) << 16); 3219 E1kLog3(("%s Inserted VLAN tag %08x\n", 3208 E1kLog3(("%s Inserting VLAN tag %08x\n", 3220 3209 INSTANCE(pState), RT_BE2H_U16(VET) | (RT_BE2H_U16(pState->u16VTagTCI) << 16))); 3210 memmove((uint8_t*)pSg->aSegs[0].pvSeg + 16, (uint8_t*)pSg->aSegs[0].pvSeg + 12, cbFrame - 12); 3211 *((uint32_t*)pSg->aSegs[0].pvSeg + 3) = RT_BE2H_U16(VET) | (RT_BE2H_U16(pState->u16VTagTCI) << 16); 3221 3212 } 3222 3213 /* Update the stats */ … … 3743 3734 /** @todo Is there any way to indicating errors other than collisions? Like 3744 3735 * VERR_NET_DOWN. */ 3745 /*3746 * If allocate a bigger buffer we need to move pvSeg3747 * accordingly, leaving room in front.3748 *3749 * Note that e1kTransmitFrame not necessarily moves it back. In3750 * case of multi-descriptor packet with TSE we won't know if3751 * VLAN tag has to be inserted until the last descriptor is3752 * fetched. If it has not we simply leave pvSeg as it is (+4)3753 * and send the packet without inserting VLAN tag.3754 */3755 if (cbVTag)3756 {3757 Assert(cbVTag == 4);3758 pState->CTX_SUFF(pTxSg)->aSegs[0].pvSeg =3759 (uint8_t*)(pState->CTX_SUFF(pTxSg)->aSegs[0].pvSeg) + cbVTag;3760 }3761 3736 } 3762 3737 … … 3849 3824 /** @todo Is there any way to indicating errors other than collisions? Like 3850 3825 * VERR_NET_DOWN. */ 3851 /*3852 * If allocate a bigger buffer we need to move pvSeg3853 * accordingly, leaving room in front. Also see the comment3854 * in data descriptor processing.3855 */3856 if (cbVTag)3857 {3858 Assert(cbVTag == 4);3859 pState->CTX_SUFF(pTxSg)->aSegs[0].pvSeg =3860 (uint8_t*)(pState->CTX_SUFF(pTxSg)->aSegs[0].pvSeg) + cbVTag;3861 }3862 3826 } 3863 3827
Note:
See TracChangeset
for help on using the changeset viewer.