Changeset 10762 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jul 19, 2008 12:13:03 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DrvIntNet.cpp
r10746 r10762 38 38 #include <iprt/string.h> 39 39 #include <iprt/time.h> 40 #ifdef RT_OS_DARWIN 41 # include <iprt/ctype.h> 42 #endif 40 43 41 44 #include "Builtins.h" … … 237 240 SendReq.Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC; 238 241 SendReq.Hdr.cbReq = sizeof(SendReq); 239 SendReq.pSession = N ULL;242 SendReq.pSession = NIL_RTR0PTR; 240 243 SendReq.hIf = pThis->hIf; 241 244 pThis->pDrvIns->pDrvHlp->pfnSUPCallVMMR0Ex(pThis->pDrvIns, VMMR0_DO_INTNET_IF_SEND, &SendReq, sizeof(SendReq)); … … 249 252 SendReq.Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC; 250 253 SendReq.Hdr.cbReq = sizeof(SendReq); 251 SendReq.pSession = N ULL;254 SendReq.pSession = NIL_RTR0PTR; 252 255 SendReq.hIf = pThis->hIf; 253 256 rc = pThis->pDrvIns->pDrvHlp->pfnSUPCallVMMR0Ex(pThis->pDrvIns, VMMR0_DO_INTNET_IF_SEND, &SendReq, sizeof(SendReq)); … … 276 279 Req.Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC; 277 280 Req.Hdr.cbReq = sizeof(Req); 278 Req.pSession = N ULL;281 Req.pSession = NIL_RTR0PTR; 279 282 Req.hIf = pThis->hIf; 280 283 Req.fPromiscuous = fPromiscuous; … … 431 434 WaitReq.Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC; 432 435 WaitReq.Hdr.cbReq = sizeof(WaitReq); 433 WaitReq.pSession = N ULL;436 WaitReq.pSession = NIL_RTR0PTR; 434 437 WaitReq.hIf = pThis->hIf; 435 438 WaitReq.cMillies = 30000; /* 30s - don't wait forever, timeout now and then. */ … … 619 622 CloseReq.Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC; 620 623 CloseReq.Hdr.cbReq = sizeof(CloseReq); 621 CloseReq.pSession = N ULL;624 CloseReq.pSession = NIL_RTR0PTR; 622 625 CloseReq.hIf = pThis->hIf; 623 626 pThis->hIf = INTNET_HANDLE_INVALID; … … 709 712 OpenReq.Hdr.cbReq = sizeof(OpenReq); 710 713 OpenReq.Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC; 711 OpenReq.pSession = N ULL;714 OpenReq.pSession = NIL_RTR0PTR; 712 715 713 716 /** @cfgm{Network, string} … … 755 758 OpenReq.fFlags = fRestrictAccess ? 0 : INTNET_OPEN_FLAGS_PUBLIC; 756 759 757 /** @cfgm{ReceiveBufferSize, uint32_t, 2 56KB}760 /** @cfgm{ReceiveBufferSize, uint32_t, 234 KB} 758 761 * The size of the receive buffer. 759 762 */ 760 763 rc = CFGMR3QueryU32(pCfgHandle, "ReceiveBufferSize", &OpenReq.cbRecv); 761 764 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 762 OpenReq.cbRecv = _256K;765 OpenReq.cbRecv = 234 * _1K ; 763 766 else if (VBOX_FAILURE(rc)) 764 767 return PDMDRV_SET_ERROR(pDrvIns, rc, 765 768 N_("Configuration error: Failed to get the \"ReceiveBufferSize\" value")); 766 769 767 /** @cfgm{SendBufferSize, uint32_t, 4KB}770 /** @cfgm{SendBufferSize, uint32_t, 17 KB} 768 771 * The size of the send (transmit) buffer. 769 772 */ 770 773 rc = CFGMR3QueryU32(pCfgHandle, "SendBufferSize", &OpenReq.cbSend); 771 774 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 772 OpenReq.cbSend = _4K;775 OpenReq.cbSend = 17*_1K; 773 776 else if (VBOX_FAILURE(rc)) 774 777 return PDMDRV_SET_ERROR(pDrvIns, rc, 775 778 N_("Configuration error: Failed to get the \"SendBufferSize\" value")); 776 if (OpenReq.cbSend < 16)779 if (OpenReq.cbSend < 32) 777 780 return PDMDRV_SET_ERROR(pDrvIns, rc, 778 781 N_("Configuration error: The \"SendBufferSize\" value is too small")); 779 if (OpenReq.cbSend < 1536*2 + 4)780 LogRel(("DrvIntNet: Warning! SendBufferSize=%u, Recommended minimum size %u butes.\n", OpenReq.cbSend, 1536*2 + 4));782 if (OpenReq.cbSend < 1536*2 + 64) 783 LogRel(("DrvIntNet: Warning! SendBufferSize=%u, Recommended minimum size %u butes.\n", OpenReq.cbSend, 1536*2 + 64)); 781 784 782 785 /** @cfgm{IsService, boolean, true} … … 794 797 pDrvIns->iInstance, OpenReq.szNetwork, OpenReq.enmTrunkType, OpenReq.szTrunk, OpenReq.fFlags, 795 798 OpenReq.cbRecv, OpenReq.cbSend)); 799 800 #ifdef RT_OS_DARWIN 801 /* Temporary hack: attach to a network with the name 'if=en0' and you're hitting the wire. */ 802 if ( !OpenReq.szTrunk[0] 803 && OpenReq.enmTrunkType == kIntNetTrunkType_None 804 && !strncmp(pThis->szNetwork, "if=en", sizeof("if=en") - 1) 805 && RT_C_IS_DIGIT(pThis->szNetwork[sizeof("if=en") - 1]) 806 && !pThis->szNetwork[sizeof("if=en")]) 807 { 808 OpenReq.enmTrunkType = kIntNetTrunkType_NetFlt; 809 strcpy(OpenReq.szTrunk, &pThis->szNetwork[sizeof("if=") - 1]); 810 } 811 #endif 796 812 797 813 /* … … 820 836 GetRing3BufferReq.Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC; 821 837 GetRing3BufferReq.Hdr.cbReq = sizeof(GetRing3BufferReq); 822 GetRing3BufferReq.pSession = N ULL;838 GetRing3BufferReq.pSession = NIL_RTR0PTR; 823 839 GetRing3BufferReq.hIf = pThis->hIf; 824 840 GetRing3BufferReq.pRing3Buf = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.