Changeset 40652 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Mar 26, 2012 4:36:16 PM (13 years ago)
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Makefile.kmk
r40638 r40652 391 391 endif 392 392 393 ifdef VBOX_WITH_NETSHAPER 394 VBoxDD_DEFS += VBOX_WITH_NETSHAPER 395 VBoxDD_SOURCES += \ 396 Network/DrvNetShaper.cpp 397 endif 398 393 399 # --- Storage bits. --- 394 400 -
trunk/src/VBox/Devices/Network/DevE1000.cpp
r40282 r40652 184 184 185 185 #define STATUS_LU 0x00000002 186 #define STATUS_TXOFF 0x00000010 186 187 187 188 #define EECD_EE_WIRES 0x0F … … 3113 3114 int rc = pDrv->pfnAllocBuf(pDrv, cbMin, fGso ? &pState->GsoCtx : NULL, &pSg); 3114 3115 if (RT_FAILURE(rc)) 3116 { 3117 /* Suspend TX as we are out of buffers atm */ 3118 STATUS |= STATUS_TXOFF; 3115 3119 return rc; 3120 } 3116 3121 } 3117 3122 else … … 3642 3647 * @thread E1000_TX 3643 3648 */ 3644 static void e1kXmitDesc(E1KSTATE* pState, E1KTXDESC* pDesc, RTGCPHYS addr, bool fOnWorkerThread) 3645 { 3649 static int e1kXmitDesc(E1KSTATE* pState, E1KTXDESC* pDesc, RTGCPHYS addr, bool fOnWorkerThread) 3650 { 3651 int rc = VINF_SUCCESS; 3646 3652 uint32_t cbVTag = 0; 3647 3653 … … 3731 3737 E1kLog3(("%s About to allocate TX buffer: cbVTag=%u\n", INSTANCE(pState), cbVTag)); 3732 3738 if (e1kCanDoGso(&pState->GsoCtx, &pDesc->data, &pState->contextTSE)) 3733 e1kXmitAllocBuf(pState, pState->contextTSE.dw2.u20PAYLEN + pState->contextTSE.dw3.u8HDRLEN + cbVTag,3739 rc = e1kXmitAllocBuf(pState, pState->contextTSE.dw2.u20PAYLEN + pState->contextTSE.dw3.u8HDRLEN + cbVTag, 3734 3740 true /*fExactSize*/, true /*fGso*/); 3741 else if (pDesc->data.cmd.fTSE) 3742 rc = e1kXmitAllocBuf(pState, pState->contextTSE.dw3.u16MSS + pState->contextTSE.dw3.u8HDRLEN + cbVTag, 3743 pDesc->data.cmd.fTSE /*fExactSize*/, false /*fGso*/); 3735 3744 else 3736 e1kXmitAllocBuf(pState, pState->contextTSE.dw3.u16MSS + pState->contextTSE.dw3.u8HDRLEN + cbVTag, 3737 pDesc->data.cmd.fTSE /*fExactSize*/, false /*fGso*/); 3745 rc = e1kXmitAllocBuf(pState, pDesc->data.cmd.u20DTALEN + cbVTag, 3746 pDesc->data.cmd.fEOP /*fExactSize*/, false /*fGso*/); 3747 3748 /** 3749 * @todo: Perhaps it is not that simple for GSO packets! We may 3750 * need to unwind some changes. 3751 */ 3752 if (RT_FAILURE(rc)) 3753 { 3754 STAM_PROFILE_ADV_STOP(&pState->CTX_SUFF_Z(StatTransmit), a); 3755 break; 3756 } 3738 3757 /** @todo Is there any way to indicating errors other than collisions? Like 3739 3758 * VERR_NET_DOWN. */ … … 3825 3844 E1kLog3(("%s About to allocate TX buffer: cbVTag=%u\n", INSTANCE(pState), cbVTag)); 3826 3845 /** @todo reset status bits? */ 3827 e1kXmitAllocBuf(pState, pDesc->legacy.cmd.u16Length + cbVTag, pDesc->legacy.cmd.fEOP, false /*fGso*/); 3846 rc = e1kXmitAllocBuf(pState, pDesc->legacy.cmd.u16Length + cbVTag, pDesc->legacy.cmd.fEOP, false /*fGso*/); 3847 if (RT_FAILURE(rc)) 3848 { 3849 STAM_PROFILE_ADV_STOP(&pState->CTX_SUFF_Z(StatTransmit), a); 3850 break; 3851 } 3852 3828 3853 /** @todo Is there any way to indicating errors other than collisions? Like 3829 3854 * VERR_NET_DOWN. */ … … 3861 3886 break; 3862 3887 } 3888 3889 return rc; 3863 3890 } 3864 3891 … … 3900 3927 3901 3928 e1kLoadDesc(pState, &desc, ((uint64_t)TDBAH << 32) + TDBAL + TDH * sizeof(desc)); 3902 e1kXmitDesc(pState, &desc, ((uint64_t)TDBAH << 32) + TDBAL + TDH * sizeof(desc), fOnWorkerThread); 3929 rc = e1kXmitDesc(pState, &desc, ((uint64_t)TDBAH << 32) + TDBAL + TDH * sizeof(desc), fOnWorkerThread); 3930 /* If we failed to transmit descriptor we will try it again later */ 3931 if (RT_FAILURE(rc)) 3932 break; 3903 3933 if (++TDH * sizeof(desc) >= TDLEN) 3904 3934 TDH = 0; … … 3935 3965 { 3936 3966 E1KSTATE *pState = RT_FROM_MEMBER(pInterface, E1KSTATE, INetworkDown); 3967 /* Resume suspended transmission */ 3968 STATUS &= ~STATUS_TXOFF; 3937 3969 e1kXmitPending(pState, true /*fOnWorkerThread*/); 3938 3970 } -
trunk/src/VBox/Devices/build/VBoxDD.cpp
r40591 r40652 257 257 if (RT_FAILURE(rc)) 258 258 return rc; 259 #ifdef VBOX_WITH_NETSHAPER 260 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvNetShaper); 261 if (RT_FAILURE(rc)) 262 return rc; 263 #endif /* VBOX_WITH_NETSHAPER */ 259 264 rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvAUDIO); 260 265 if (RT_FAILURE(rc)) -
trunk/src/VBox/Devices/build/VBoxDD.h
r38913 r40652 111 111 extern const PDMDRVREG g_DrvDedicatedNic; 112 112 extern const PDMDRVREG g_DrvNAT; 113 #ifdef VBOX_WITH_NETSHAPER 114 extern const PDMDRVREG g_DrvNetShaper; 115 #endif /* VBOX_WITH_NETSHAPER */ 113 116 extern const PDMDRVREG g_DrvNetSniffer; 114 117 extern const PDMDRVREG g_DrvAUDIO;
Note:
See TracChangeset
for help on using the changeset viewer.