Changeset 39367 in vbox
- Timestamp:
- Nov 18, 2011 2:16:57 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevE1000.cpp
r39357 r39367 3192 3192 { 3193 3193 PPDMSCATTERGATHER pSg = pState->CTX_SUFF(pTxSg); 3194 uint32_t const cbFrame = pSg ? ((uint32_t)pSg->cbUsed + (pState->fVTag ? 4 : 0)): 0;3194 uint32_t cbFrame = pSg ? (uint32_t)pSg->cbUsed : 0; 3195 3195 Assert(!pSg || pSg->cSegs == 1); 3196 3196 3197 if (cbFrame > 70) /* unqualified guess */ 3198 pState->led.Asserted.s.fWriting = pState->led.Actual.s.fWriting = 1; 3199 3200 /* Add VLAN tag */ 3201 if (cbFrame > 12 && pState->fVTag) 3202 { 3203 E1kLog3(("%s Inserting VLAN tag %08x\n", 3204 INSTANCE(pState), RT_BE2H_U16(VET) | (RT_BE2H_U16(pState->u16VTagTCI) << 16))); 3205 memmove((uint8_t*)pSg->aSegs[0].pvSeg + 16, (uint8_t*)pSg->aSegs[0].pvSeg + 12, cbFrame - 12); 3206 *((uint32_t*)pSg->aSegs[0].pvSeg + 3) = RT_BE2H_U16(VET) | (RT_BE2H_U16(pState->u16VTagTCI) << 16); 3207 pSg->cbUsed += 4; 3208 cbFrame += 4; 3209 Assert(pSg->cbUsed == cbFrame); 3210 Assert(pSg->cbUsed <= pSg->cbAvailable); 3211 } 3197 3212 /* E1kLog2(("%s <<< Outgoing packet. Dump follows: >>>\n" 3198 3213 "%.*Rhxd\n" … … 3200 3215 INSTANCE(pState), cbFrame, pSg->aSegs[0].pvSeg, INSTANCE(pState)));*/ 3201 3216 3202 if (cbFrame > 70) /* unqualified guess */3203 pState->led.Asserted.s.fWriting = pState->led.Actual.s.fWriting = 1;3204 3205 /* Add VLAN tag */3206 if (cbFrame > 16 && pState->fVTag)3207 {3208 E1kLog3(("%s Inserting VLAN tag %08x\n",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);3212 }3213 3217 /* Update the stats */ 3214 3218 E1K_INC_CNT32(TPT); … … 3417 3421 */ 3418 3422 if (!pState->CTX_SUFF(pTxSg)) 3419 e1kXmitAllocBuf(pState, pState->u16TxPktLen , true /*fExactSize*/, false /*fGso*/);3423 e1kXmitAllocBuf(pState, pState->u16TxPktLen + (pState->fVTag ? 4 : 0), true /*fExactSize*/, false /*fGso*/); 3420 3424 if (pState->CTX_SUFF(pTxSg)) 3421 3425 {
Note:
See TracChangeset
for help on using the changeset viewer.