Changeset 33540 in vbox for trunk/src/VBox/HostDrivers
- Timestamp:
- Oct 28, 2010 9:27:05 AM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 67140
- Location:
- trunk/src/VBox/HostDrivers
- Files:
-
- 57 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Makefile.kmk
r32230 r33540 42 42 if1of ($(KBUILD_TARGET),linux freebsd) 43 43 # 44 # Install the Makefile for module comp liation on Linux and FreeBSD hosts44 # Install the Makefile for module compilation on Linux and FreeBSD hosts 45 45 # 46 46 INSTALLS += HostDrivers-src -
trunk/src/VBox/HostDrivers/Support/Makefile.kmk
r33375 r33540 170 170 # VBoxDrv.sys - The Windows driver. 171 171 # 172 ## @todo consoli ate all the targets into a single mess.172 ## @todo consolidate all the targets into a single mess. 173 173 ifeq ($(KBUILD_TARGET),win) 174 174 VBoxDrv_TEMPLATE = VBOXR0DRV -
trunk/src/VBox/HostDrivers/Support/SUPDrv.c
r33375 r33540 84 84 * 85 85 * Logging requires BUILD_TYPE=debug and possibly changes to the logger 86 * instan ciation in log-vbox.c(pp).86 * instantiation in log-vbox.c(pp). 87 87 */ 88 88 … … 1853 1853 1854 1854 /** 1855 * Inter-Driver Commun cation (IDC) worker.1855 * Inter-Driver Communication (IDC) worker. 1856 1856 * 1857 1857 * @returns VBox status code. … … 2868 2868 * @param cbSub How much to map. Must be page aligned. 2869 2869 * @param fFlags Flags, MBZ. 2870 * @param ppvR0 Where to re utrn the address of the ring-0 mapping on2870 * @param ppvR0 Where to return the address of the ring-0 mapping on 2871 2871 * success. 2872 2872 */ … … 2922 2922 { 2923 2923 /* 2924 * Do some furt er input validations before calling IPRT.2924 * Do some further input validations before calling IPRT. 2925 2925 * (Cleanup is done indirectly by telling RTR0MemObjFree to include mappings.) 2926 2926 */ … … 3012 3012 { 3013 3013 /* 3014 * Do some furt er input validations before calling IPRT.3014 * Do some further input validations before calling IPRT. 3015 3015 */ 3016 3016 size_t cbMemObj = hMemObjR0 != NIL_RTR0PTR ? RTR0MemObjSize(hMemObjR0) : RTR0MemObjSize(hMemObjR3); … … 5108 5108 * 5109 5109 * @param poffMin Pointer to the determined difference between different cores. 5110 * @return false if the time stamp counters appear to be synchron , true otherwise.5110 * @return false if the time stamp counters appear to be synchronized, true otherwise. 5111 5111 */ 5112 5112 static bool supdrvDetermineAsyncTsc(uint64_t *poffMin) … … 5178 5178 5179 5179 /** 5180 * Determin the GIP TSC mode.5180 * Determine the GIP TSC mode. 5181 5181 * 5182 5182 * @returns The most suitable TSC mode. … … 5188 5188 * On SMP we're faced with two problems: 5189 5189 * (1) There might be a skew between the CPU, so that cpu0 5190 * returns a TSC that is slig tly different from cpu1.5190 * returns a TSC that is slightly different from cpu1. 5191 5191 * (2) Power management (and other things) may cause the TSC 5192 5192 * to run at a non-constant speed, and cause the speed … … 5194 5194 * 5195 5195 * So, on SMP systems we'll have to select the ASYNC update method 5196 * if there are symp homs of these problems.5196 * if there are symptoms of these problems. 5197 5197 */ 5198 5198 if (RTMpGetCount() > 1) … … 5201 5201 uint64_t u64DiffCoresIgnored; 5202 5202 5203 /* Permit the user and/or the OS spec fic bits to force async mode. */5203 /* Permit the user and/or the OS specific bits to force async mode. */ 5204 5204 if (supdrvOSGetForcedAsyncTscMode(pDevExt)) 5205 5205 return SUPGIPMODE_ASYNC_TSC; … … 5243 5243 * @param HCPhys The physical address of the GIP. 5244 5244 * @param u64NanoTS The current nanosecond timestamp. 5245 * @param uUpdateHz The update freq ence.5245 * @param uUpdateHz The update frequency. 5246 5246 */ 5247 5247 static void supdrvGipInit(PSUPDRVDEVEXT pDevExt, PSUPGLOBALINFOPAGE pGip, RTHCPHYS HCPhys, uint64_t u64NanoTS, unsigned uUpdateHz) … … 5400 5400 u32UpdateIntervalTSC >>= 1; 5401 5401 5402 /* Value cho osen for a 2GHz Athlon64 running linux 2.6.10/11, . */5402 /* Value chosen for a 2GHz Athlon64 running linux 2.6.10/11, . */ 5403 5403 u32UpdateIntervalTSCSlack = u32UpdateIntervalTSC >> 14; 5404 5404 } … … 5409 5409 u32UpdateIntervalTSC >>= 1; 5410 5410 5411 /* value cho osen on a 2GHz thinkpad running windows */5411 /* value chosen on a 2GHz thinkpad running windows */ 5412 5412 u32UpdateIntervalTSCSlack = u32UpdateIntervalTSC >> 7; 5413 5413 } … … 5440 5440 { 5441 5441 /* 5442 * Determin the relevant CPU data.5442 * Determine the relevant CPU data. 5443 5443 */ 5444 5444 PSUPGIPCPU pGipCpu; -
trunk/src/VBox/HostDrivers/Support/SUPDrvIDC.h
r28800 r33540 1 1 /* $Id$ */ 2 2 /** @file 3 * VirtualBox Support Driver - Inter-Driver Commun ciation (IDC) definitions.3 * VirtualBox Support Driver - Inter-Driver Communication (IDC) definitions. 4 4 */ 5 5 … … 35 35 * @param Function The function number to encode, 1..255. 36 36 * 37 * @remarks We can take a slig tly more relaxed attitude wrt to size encoding37 * @remarks We can take a slightly more relaxed attitude wrt to size encoding 38 38 * here since only windows will use standard I/O control function code. 39 39 */ … … 194 194 195 195 /** 196 * SUPDRV IDC: Der gister a component factory.196 * SUPDRV IDC: Deregister a component factory. 197 197 * This request takes a SUPDRVIDCREQCOMPDEREGFACTORY packet. 198 198 */ -
trunk/src/VBox/HostDrivers/Support/SUPDrvIOC.h
r33167 r33540 285 285 struct 286 286 { 287 /** Size of the image we'll be loading (includ eing tables). */287 /** Size of the image we'll be loading (including tables). */ 288 288 uint32_t cbImageWithTabs; 289 289 /** The size of the image bits. (Less or equal to cbImageWithTabs.) */ … … 772 772 struct 773 773 { 774 /** Start of page range of a range previ uosly pinned. */774 /** Start of page range of a range previously pinned. */ 775 775 RTR3PTR pvR3; 776 776 } In; … … 781 781 782 782 /** @name SUP_IOCTL_CONT_ALLOC 783 * Allocate conti ous memory.783 * Allocate continuous memory. 784 784 * @{ 785 785 */ … … 817 817 * @{ 818 818 */ 819 /** Free conti ous memory. */819 /** Free continuous memory. */ 820 820 #define SUP_IOCTL_CONT_FREE SUP_CTL_CODE_SIZE(17, SUP_IOCTL_CONT_FREE_SIZE) 821 821 #define SUP_IOCTL_CONT_FREE_SIZE sizeof(SUPCONTFREE) … … 1081 1081 /** Signal the semaphore. */ 1082 1082 #define SUPSEMOP_SIGNAL 1 1083 /** Reset the sem pahore (only applicable to SUP_SEM_TYPE_EVENT_MULTI). */1083 /** Reset the semaphore (only applicable to SUP_SEM_TYPE_EVENT_MULTI). */ 1084 1084 #define SUPSEMOP_RESET 2 1085 1085 /** Close the semaphore handle. */ … … 1141 1141 /** Signal the semaphore. */ 1142 1142 #define SUPSEMOP2_SIGNAL 3 1143 /** Reset the sem pahore (only applicable to SUP_SEM_TYPE_EVENT_MULTI). */1143 /** Reset the semaphore (only applicable to SUP_SEM_TYPE_EVENT_MULTI). */ 1144 1144 #define SUPSEMOP2_RESET 4 1145 1145 /** Close the semaphore handle. */ -
trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h
r29250 r33540 179 179 180 180 /** @name Context values for the per-session handle tables. 181 * The context value is used to disti guish between the different kinds of181 * The context value is used to distinguish between the different kinds of 182 182 * handles, making the handle table API do all the work. 183 183 * @{ */ … … 216 216 /** Locked memory (r3 mapping only). */ 217 217 MEMREF_TYPE_LOCKED, 218 /** Contin ous memory block (r3 and r0 mapping). */218 /** Continuous memory block (r3 and r0 mapping). */ 219 219 MEMREF_TYPE_CONT, 220 220 /** Low memory block (r3 and r0 mapping). */ … … 290 290 /** Service request handler. This is NULL for non-service modules. */ 291 291 PFNSUPR0SERVICEREQHANDLER pfnServiceReqHandler; 292 /** The ldr image state. (IOCtl code of last op ration.) */292 /** The ldr image state. (IOCtl code of last operation.) */ 293 293 uint32_t uState; 294 294 /** Usage count. */ … … 548 548 * success, pvImageAlloc can also be set if 549 549 * appropriate. 550 * @param pszFilename The file name - UTF-8, may contain g UNIX550 * @param pszFilename The file name - UTF-8, may containing UNIX 551 551 * slashes on non-UNIX systems. 552 552 */ -
trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
r33167 r33540 37 37 * 38 38 * The Ring-0 calling is done thru a generic SUP interface which will 39 * tran fer an argument set and call a predefined entry point in the Host39 * transfer an argument set and call a predefined entry point in the Host 40 40 * VMM Ring-0 code. 41 41 * … … 94 94 static bool g_fPreInited = false; 95 95 /** The SUPLib instance data. 96 * Well, at least parts of it, specific ly the parts that are being handed over96 * Well, at least parts of it, specifically the parts that are being handed over 97 97 * via the pre-init mechanism from the hardened executable stub. */ 98 98 SUPLIBDATA g_supLibData = … … 109 109 * 110 110 * This pointer is valid as long as SUPLib has a open session. Anyone using 111 * the page must treat this pointer as hig ly volatile and not trust it beyond111 * the page must treat this pointer as highly volatile and not trust it beyond 112 112 * one transaction. 113 113 * … … 762 762 * @param pszFlags The flags settings. 763 763 * @param pszGroups The groups settings. 764 * @param pszDest The desti onation specificier.764 * @param pszDest The destination specificier. 765 765 */ 766 766 static int supR3LoggerSettings(SUPLOGGER enmWhich, uint32_t fWhat, const char *pszFlags, const char *pszGroups, const char *pszDest) -
trunk/src/VBox/HostDrivers/Support/SUPR0IdcClient.c
r30111 r33540 43 43 * 44 44 * This will perform basic version negotiations and fail if the 45 * min mum requirements aren't met.45 * minimum requirements aren't met. 46 46 * 47 47 * @returns VBox status code. -
trunk/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp
r28800 r33540 119 119 /** The pre-init data we pass on to SUPR3 (residing in VBoxRT). */ 120 120 static SUPPREINITDATA g_SupPreInitData; 121 /** The prog am executable path. */121 /** The program executable path. */ 122 122 static char g_szSupLibHardenedExePath[RTPATH_MAX]; 123 123 /** The program directory path. */ … … 467 467 * find it. We'll fork before we attempt this because that way the 468 468 * session management in main will see us exiting immediately (if 469 * it's invo vled with us).469 * it's involved with us). 470 470 */ 471 471 #if !defined(RT_OS_WINDOWS) && !defined(RT_OS_OS2) … … 733 733 # if defined(RT_OS_DARWIN) 734 734 /* The really great thing here is that setreuid isn't available on 735 OS X 10.4, libc emulates it. While 10.4 have a slig tly different and735 OS X 10.4, libc emulates it. While 10.4 have a slightly different and 736 736 non-standard setuid implementation compared to 10.5, the following 737 737 works the same way with both version since we're super user (10.5 req). -
trunk/src/VBox/HostDrivers/Support/SUPR3HardenedVerify.cpp
r29250 r33540 198 198 199 199 /** 200 * Assembles the path to a dir tory.200 * Assembles the path to a directory. 201 201 * 202 202 * @returns VINF_SUCCESS on success, some error code on failure (fFatal … … 613 613 * @returns VINF_SUCCESS on success. 614 614 * VERR_NOT_FOUND if the file isn't in the table, this isn't ever a fatal error. 615 * On ver fication failure, an error code will be returned when fFatal is clear,616 * otherwise the program will be termin dated.615 * On verification failure, an error code will be returned when fFatal is clear, 616 * otherwise the program will be terminated. 617 617 * 618 618 * @param pszFilename The filename. … … 711 711 * 712 712 * @returns VINF_SUCCESS on success. 713 * On ver fication failure, an error code will be returned when fFatal is clear,714 * otherwise the program will be termin dated.713 * On verification failure, an error code will be returned when fFatal is clear, 714 * otherwise the program will be terminated. 715 715 * 716 716 * @param fFatal Whether validation failures should be treated as 717 717 * fatal (true) or not (false). 718 * @param fLeaveFilesOpen If set, all the ver fied files are left open.718 * @param fLeaveFilesOpen If set, all the verified files are left open. 719 719 * @param pszProgName Optional program name. This is used by SUPR3HardenedMain 720 720 * to verify that both the executable and corresponding -
trunk/src/VBox/HostDrivers/Support/SUPSvc.cpp
r28800 r33540 283 283 284 284 /** 285 * Logs the message to the approp irate system log.285 * Logs the message to the appropriate system log. 286 286 * 287 287 * In debug builds this will also put it in the debug log. … … 299 299 300 300 /** 301 * Logs the message to the approp irate system log.301 * Logs the message to the appropriate system log. 302 302 * 303 303 * In debug builds this will also put it in the debug log. … … 325 325 326 326 /** 327 * Logs the error message to the approp irate system log.327 * Logs the error message to the appropriate system log. 328 328 * 329 329 * In debug builds this will also put it in the debug log. -
trunk/src/VBox/HostDrivers/Support/SUPSvcGrant.cpp
r30112 r33540 168 168 169 169 /* 170 * Process client requests until lit quits or we're cancelled on termination.170 * Process client requests until it quits or we're cancelled on termination. 171 171 */ 172 172 while (!ASMAtomicUoReadBool(&pThis->fTerminate)) … … 252 252 { 253 253 /* 254 * Iterate until lbe make it all the way thru the list.254 * Iterate until be make it all the way thru the list. 255 255 * 256 256 * Only use the thread state as and indicator on whether we can destroy -
trunk/src/VBox/HostDrivers/Support/SUPSvcInternal.h
r28800 r33540 52 52 * @{ */ 53 53 /** 54 * Logs the message to the approp irate system log.54 * Logs the message to the appropriate system log. 55 55 * 56 56 * @param psMsg The log string. -
trunk/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp
r29255 r33540 392 392 kauth_cred_unref(&pCred); 393 393 #else /* 10.4 */ 394 /* The 10.4u SDK headers and 10.4.11 kernel source have inconsisten defintions394 /* The 10.4u SDK headers and 10.4.11 kernel source have inconsistent definitions 395 395 of kauth_cred_unref(), so use the other (now deprecated) API for releasing it. */ 396 396 kauth_cred_rele(pCred); … … 720 720 kernel map on another CPU while this is going on, there is a fair chance 721 721 that it might cause the host_vmxon thread to block and hence panic since 722 preemption is disabled. Ar rrg! */722 preemption is disabled. Argh! */ 723 723 #if 0 /*def VBOX_WITH_HOST_VMX*/ 724 724 int rc; -
trunk/src/VBox/HostDrivers/Support/darwin/SUPLib-darwin.cpp
r28800 r33540 235 235 236 236 /* 237 * Check if we're init ited at all.237 * Check if we're inited at all. 238 238 */ 239 239 if (pThis->hDevice != NIL_RTFILE) -
trunk/src/VBox/HostDrivers/Support/freebsd/SUPLib-freebsd.cpp
r28800 r33540 131 131 { 132 132 /* 133 * Check if we're init ited at all.133 * Check if we're inited at all. 134 134 */ 135 135 if (pThis->hDevice != NIL_RTFILE) -
trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
r28800 r33540 232 232 .resume = VBoxDrvResume, /* after wakeup from deep sleep */ 233 233 .freeze = VBoxDrvSuspend, /* before creating hibernation image */ 234 .restore = VBoxDrvResume, /* after wak eing up from hibernation */234 .restore = VBoxDrvResume, /* after waking up from hibernation */ 235 235 }; 236 236 # endif … … 410 410 #ifdef CONFIG_X86_LOCAL_APIC 411 411 /* 412 * If an NMI occurs while we are inside the world switcher the mac ine will crash.412 * If an NMI occurs while we are inside the world switcher the machine will crash. 413 413 * The Linux NMI watchdog generates periodic NMIs increasing a counter which is 414 414 * compared with another counter increased in the timer interrupt handler. Therefore … … 417 417 # if !defined(VBOX_REDHAT_KABI) 418 418 /* 419 * First test: NMI acti ated? Works only works with Linux 2.6 -- 2.4 does not export419 * First test: NMI activated? Works only works with Linux 2.6 -- 2.4 does not export 420 420 * the nmi_watchdog variable. 421 421 */ … … 472 472 # else /* < 2.6.19 */ 473 473 /* 474 * Older 2.6 kernels: nmi_watchdog is not init alized by default474 * Older 2.6 kernels: nmi_watchdog is not initialized by default 475 475 */ 476 476 if (nmi_watchdog != NMI_NONE) … … 503 503 * vector as NMI. We can't disable the framework but the kernel loader 504 504 * script will do 'echo 2 > /proc/sys/kernel/perf_counter_paranoid' 505 * which hopef illy prevents any usage of hardware performance counters505 * which hopefully prevents any usage of hardware performance counters 506 506 * and therefore triggering of NMIs. 507 507 * 2.6.32+: CONFIG_PERF_COUNTERS => CONFIG_PERF_EVENTS */ -
trunk/src/VBox/HostDrivers/Support/os2/SUPLib-os2.cpp
r28800 r33540 110 110 { 111 111 /* 112 * Check if we're init ited at all.112 * Check if we're inited at all. 113 113 */ 114 114 if (pThis->hDevice != NIL_RTFILE) -
trunk/src/VBox/HostDrivers/Support/win/SUPLib-win.cpp
r28800 r33540 473 473 { 474 474 /* 475 * Check if we're init ited at all.475 * Check if we're inited at all. 476 476 */ 477 477 if (pThis->hDevice != NIL_RTFILE) -
trunk/src/VBox/HostDrivers/Support/win/SUPR0IdcClient-win.c
r28800 r33540 82 82 Executive, /* WaitReason */ 83 83 KernelMode, /* WaitMode */ 84 FALSE, /* Al tertable */84 FALSE, /* Alertable */ 85 85 NULL); /* TimeOut */ 86 86 rcNt = IoStatusBlock.Status; -
trunk/src/VBox/HostDrivers/Support/win/SUPSvc-win.cpp
r28854 r33540 111 111 * NULL on failure, will display an error message unless it's ignored. 112 112 * 113 * @param pszAction The action which is requesti onaccess to the service.113 * @param pszAction The action which is requesting access to the service. 114 114 * @param dwSCMAccess The service control manager access. 115 115 * @param dwSVCAccess The desired service access. … … 446 446 * @param dwControl The control code. 447 447 * @param dwEventType Event type. (specific to the control?) 448 * @param pvEventData Event data, spec fic to the event.448 * @param pvEventData Event data, specific to the event. 449 449 * @param pvContext The context pointer registered with the handler. 450 450 * Currently not used. … … 573 573 * 574 574 * The work loop is just a dummy wait here as the services run 575 * in independ ant threads.575 * in independent threads. 576 576 */ 577 577 if (supSvcWinSetServiceStatus(SERVICE_RUNNING, 0, 0)) … … 783 783 784 784 /* 785 * Parse the initial arguments to determin the desired action.785 * Parse the initial arguments to determine the desired action. 786 786 */ 787 787 enum -
trunk/src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk
r32183 r33540 94 94 ifeq ($(KBUILD_TARGET),linux) 95 95 # 96 # Install source files for comp liation on Linux.96 # Install source files for compilation on Linux. 97 97 # files_vboxnetadp defines VBOX_VBOXNETADP_SOURCES. 98 98 # … … 143 143 ifeq ($(KBUILD_TARGET),freebsd) 144 144 # 145 # Install source files for comp liation on FreeBSD.145 # Install source files for compilation on FreeBSD. 146 146 # files_vboxnetadp defines VBOX_VBOXNETADP_SOURCES. 147 147 # -
trunk/src/VBox/HostDrivers/VBoxNetAdp/VBoxNetAdp.c
r28830 r33540 45 45 #include <VBox/version.h> 46 46 47 /** r=bird: why is this here in the agnos itc code? */47 /** r=bird: why is this here in the agnostic code? */ 48 48 #ifdef RT_OS_DARWIN 49 49 # include <net/ethernet.h> … … 803 803 * though the "base is still needed for the driver to functions". 804 804 * @param pGlobals 805 * @return VINF_SUCCESS on succes , VERR_WRONG_ORDER if we're busy.805 * @return VINF_SUCCESS on success, VERR_WRONG_ORDER if we're busy. 806 806 */ 807 807 DECLHIDDEN(int) vboxNetAdpTryDeleteIdc(PVBOXNETADPGLOBALS pGlobals) … … 926 926 * Called by the native part when the OS wants the driver to unload. 927 927 * 928 * @returns VINF_SUCCESS on succes , VERR_WRONG_ORDER if we're busy.928 * @returns VINF_SUCCESS on success, VERR_WRONG_ORDER if we're busy. 929 929 * 930 930 * @param pGlobals Pointer to the globals. -
trunk/src/VBox/HostDrivers/VBoxNetAdp/freebsd/VBoxNetAdp-freebsd.c
r31556 r33540 202 202 /** 203 203 * Transmit packets. 204 * netflt has al dready done everything for us so we just hand the204 * netflt has already done everything for us so we just hand the 205 205 * packets to BPF and increment the packet stats. 206 206 */ -
trunk/src/VBox/HostDrivers/VBoxNetAdp/linux/Makefile
r32537 r33540 179 179 180 180 # By default we use remap_pfn_range() kernel API to make kernel pages 181 # visible for userland. Unfortu ately, it leads to situation that181 # visible for userland. Unfortunately, it leads to situation that 182 182 # during debug session all structures on that page (such as PVM pointer) 183 183 # are not accessible to the debugger (see #3214). -
trunk/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c
r31730 r33540 279 279 280 280 Log(("VBoxNetAdpLinuxIOCtl: param len %#x; uCmd=%#x; add=%#x\n", _IOC_SIZE(uCmd), uCmd, VBOXNETADP_CTL_ADD)); 281 if (RT_UNLIKELY(_IOC_SIZE(uCmd) != sizeof(Req))) /* para onia */281 if (RT_UNLIKELY(_IOC_SIZE(uCmd) != sizeof(Req))) /* paranoia */ 282 282 { 283 283 Log(("VBoxNetAdpLinuxIOCtl: bad ioctl sizeof(Req)=%#x _IOC_SIZE=%#x; uCmd=%#x.\n", sizeof(Req), _IOC_SIZE(uCmd), uCmd)); -
trunk/src/VBox/HostDrivers/VBoxNetAdp/solaris/VBoxNetAdp-solaris.c
r28800 r33540 296 296 297 297 /* 298 * Setup GLD MAC layer regist eration info.298 * Setup GLD MAC layer registration info. 299 299 */ 300 300 pMacInfo->gldm_reset = vboxNetAdpSolarisStub; … … 334 334 /* 335 335 * Now try registering our GLD with the MAC layer. 336 * Regist eration can fail on some S10 versions when the MTU size is more than 1500.336 * Registration can fail on some S10 versions when the MTU size is more than 1500. 337 337 * When we implement jumbo frames we should probably retry with MTU 1500 for S10. 338 338 */ -
trunk/src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk
r32773 r33540 354 354 ifeq ($(KBUILD_TARGET),linux) 355 355 # 356 # Install source files for comp liation on Linux.356 # Install source files for compilation on Linux. 357 357 # files_vboxnetflt defines VBOX_VBOXNETFLT_SOURCES. 358 358 # … … 408 408 409 409 # 410 # Install source files for comp liation on FreeBSD.410 # Install source files for compilation on FreeBSD. 411 411 # files_vboxnetflt defines VBOX_VBOXNETFLT_SOURCES. 412 412 # -
trunk/src/VBox/HostDrivers/VBoxNetFlt/VBoxNetFlt.c
r29696 r33540 383 383 * Don't do rediscovery if we're called with preemption disabled. 384 384 * 385 * Note! This may cause trouble if we're always called with preemption i385 * Note! This may cause trouble if we're always called with preemption 386 386 * disabled and vboxNetFltOsMaybeRediscovered actually does some real 387 387 * work. For the time being though, only Darwin and FreeBSD depends … … 1144 1144 /** @todo This reconnect stuff should be serialized correctly for static 1145 1145 * devices. Shouldn't it? In the dynamic case we're using the INTNET 1146 * outbound th runk lock, but that doesn't quite cut it here, or does1146 * outbound thunk lock, but that doesn't quite cut it here, or does 1147 1147 * it? We could either transition to initializing or make a callback 1148 * while owning the mutex there... */1148 * while owning the mutex here... */ 1149 1149 if (enmState == kVBoxNetFltInsState_Disconnecting) 1150 1150 { … … 1324 1324 * @returns Pointer to an interface. NULL if not supported. 1325 1325 * 1326 * @param pSupDrvFactory Pointer to the compone t factory registration structure.1326 * @param pSupDrvFactory Pointer to the component factory registration structure. 1327 1327 * @param pSession The session - unused. 1328 1328 * @param pszInterfaceUuid The factory interface id. -
trunk/src/VBox/HostDrivers/VBoxNetFlt/darwin/VBoxNetFlt-darwin.cpp
r32740 r33540 95 95 * We have to associate the ethernet header with each packet we're sending 96 96 * because things like icmp will inherit the tag it self so the tag along 97 * isn't suffic ent to identify our mbufs. For the icmp scenario the ethernet98 * header natura rlly changes before the packet is send pack, so let check it.97 * isn't sufficient to identify our mbufs. For the icmp scenario the ethernet 98 * header naturally changes before the packet is send pack, so let check it. 99 99 */ 100 100 typedef struct VBOXNETFLTTAG … … 132 132 133 133 /** The unique tag id for this module. 134 * This is basically a unique string hash that lives on until lreboot.134 * This is basically a unique string hash that lives on until reboot. 135 135 * It is used for tagging mbufs. */ 136 136 static mbuf_tag_id_t g_idTag; … … 324 324 static mbuf_t vboxNetFltDarwinMBufFromSG(PVBOXNETFLTINS pThis, PINTNETSG pSG) 325 325 { 326 /// @todo future? mbuf_how_t How = preem tion enabled ? MBUF_DONTWAIT : MBUF_WAITOK;326 /// @todo future? mbuf_how_t How = preemption enabled ? MBUF_DONTWAIT : MBUF_WAITOK; 327 327 mbuf_how_t How = MBUF_WAITOK; 328 328 … … 350 350 * 351 351 * So, in the end it's better to just do it the simple way that will work 352 * 100%, even if it invol es some extra work (alloc + copy) we really wished352 * 100%, even if it involves some extra work (alloc + copy) we really wished 353 353 * to avoid. 354 354 * 355 355 * Note. We can't make use of the physical addresses on darwin because the 356 * way the mbuf / cluster stuff eworks (see mbuf_data_to_physical and356 * way the mbuf / cluster stuff works (see mbuf_data_to_physical and 357 357 * mcl_to_paddr). 358 358 */ … … 1056 1056 * This api is a bit weird, the best reference is the code. 1057 1057 * 1058 * Also, we have a bit or race conditions wrt the maint ance of1058 * Also, we have a bit or race conditions wrt the maintenance of 1059 1059 * host the interface promiscuity for vboxNetFltPortOsIsPromiscuous. 1060 1060 */ -
trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/Makefile
r32537 r33540 183 183 184 184 # By default we use remap_pfn_range() kernel API to make kernel pages 185 # visible for userland. Unfortu ately, it leads to situation that185 # visible for userland. Unfortunately, it leads to situation that 186 186 # during debug session all structures on that page (such as PVM pointer) 187 187 # are not accessible to the debugger (see #3214). -
trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
r33506 r33540 635 635 # endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32) */ 636 636 # endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) */ 637 /* Sync hthe queue len with our child */637 /* Sync the queue len with our child */ 638 638 pNew->q.qlen = pPriv->pChild->q.qlen; 639 639 } … … 808 808 809 809 /** 810 * Experiment where we filter traf ic from the host to the internal network810 * Experiment where we filter traffic from the host to the internal network 811 811 * before it reaches the NIC driver. 812 812 * … … 881 881 882 882 /* 883 * Do the filtering base on the defaul OUI of our virtual NICs883 * Do the filtering base on the default OUI of our virtual NICs 884 884 * 885 885 * Note! In a real solution, we would ask the switch whether the … … 1132 1132 /* 1133 1133 * We need to set checksum fields even if the packet goes to the host 1134 * directly as it may be immediately forwar ed by IP layer @bugref{5020}.1134 * directly as it may be immediately forwarded by IP layer @bugref{5020}. 1135 1135 */ 1136 1136 Assert(skb_headlen(pPkt) >= pSG->GsoCtx.cbHdrs); … … 1840 1840 1841 1841 /** 1842 * Reports the GSO capabilit es of the hardware NIC.1842 * Reports the GSO capabilities of the hardware NIC. 1843 1843 * 1844 1844 * @param pThis The net filter instance. The caller hold a … … 1889 1889 1890 1890 /** 1891 * Helper that determin s whether the host (ignoreing us) is operating the1891 * Helper that determines whether the host (ignoreing us) is operating the 1892 1892 * interface in promiscuous mode or not. 1893 1893 */ … … 2019 2019 2020 2020 /* 2021 * If the above succeeded report GSO capabilit es, if not undo and2021 * If the above succeeded report GSO capabilities, if not undo and 2022 2022 * release the device. 2023 2023 */ … … 2275 2275 * This api is a bit weird, the best reference is the code. 2276 2276 * 2277 * Also, we have a bit or race conditions wrt the maint ance of2277 * Also, we have a bit or race conditions wrt the maintenance of 2278 2278 * host the interface promiscuity for vboxNetFltPortOsIsPromiscuous. 2279 2279 */ -
trunk/src/VBox/HostDrivers/VBoxNetFlt/solaris/VBoxNetFlt-solaris.c
r33141 r33540 328 328 { 329 329 vboxnetflt_stream_t Stream; /* dedicated/promiscuous stream */ 330 bool fPromisc; /* cached promisc ous value */330 bool fPromisc; /* cached promiscuous value */ 331 331 bool fRawMode; /* whether raw mode request was successful */ 332 332 uint32_t ModeReqId; /* track MIOCTLs for swallowing our fake request acknowledgements */ … … 1118 1118 { 1119 1119 /* 1120 * Swallow our fake promisc ous request acknowledgement.1120 * Swallow our fake promiscuous request acknowledgement. 1121 1121 */ 1122 1122 dl_ok_ack_t *pOkAck = (dl_ok_ack_t *)pMsg->b_rptr; … … 1383 1383 /** 1384 1384 * Callback wrapper for qtimeout() to safely send promiscuous requests. This is 1385 * called at the inner perime nter with shared lock.1385 * called at the inner perimeter with shared lock. 1386 1386 * 1387 1387 * @param pvData Pointer to vboxnetflt_promisc_params_t. See … … 2093 2093 2094 2094 /* 2095 * Statu atory Warning: Hackish code ahead.2095 * Statutory Warning: Hackish code ahead. 2096 2096 */ 2097 2097 char *pszModName = DEVICE_NAME; … … 2360 2360 2361 2361 /* 2362 * Statu atory Warning: Hackish code ahead.2362 * Statutory Warning: Hackish code ahead. 2363 2363 */ 2364 2364 char *pszModName = DEVICE_NAME; … … 2700 2700 /* 2701 2701 * If Ip6 interface is not plumbed and an Ip6 polling interval is specified, we need 2702 * to begin polling to attach on the Ip6 interface when ver it comes up.2702 * to begin polling to attach on the Ip6 interface whenever it comes up. 2703 2703 */ 2704 2704 if ( rc2 == VERR_INTNET_FLT_IF_NOT_FOUND … … 3257 3257 /* 3258 3258 * MAC address change acknowledgements are intercepted on the read side 3259 * hence theor itically we are always update to date with any changes.3259 * hence theoretically we are always update to date with any changes. 3260 3260 */ 3261 3261 return pThis->u.s.MacAddr.au16[0] == pMac->au16[0] -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/NetFltInstall.cpp
r28800 r33540 32 32 } 33 33 34 /** Wrapper aroun gGetfullPathNameW that will try an alternative INF location.34 /** Wrapper around GetfullPathNameW that will try an alternative INF location. 35 35 * 36 36 * The default location is the current directory. If not found there, the 37 * alternative locat oin is the executable directory. If not found there either,37 * alternative location is the executable directory. If not found there either, 38 38 * the first alternative is present to the caller. 39 39 */ -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFlt-win.c
r30007 r33540 41 41 42 42 /** 43 * represents the queue of jobs processed by the worker thre d43 * represents the queue of jobs processed by the worker thread 44 44 * 45 45 * we use the thread to process tasks which are required to be done at passive level … … 508 508 if (pMyPacket) 509 509 { 510 /* we have successful y initialized our packet, post it to the host or to the wire */510 /* we have successfully initialized our packet, post it to the host or to the wire */ 511 511 if(bSrcHost) 512 512 { … … 601 601 * Besides that the NDIS_PACKET contained in the queue could be either the one passed to us in our send/receive callback 602 602 * or the one created by us. The latter is possible in case our ProtocolReceive callback is called and we call NdisTransferData 603 * in this case we need to allocate the packet the data to be transfer ed to.603 * in this case we need to allocate the packet the data to be transferred to. 604 604 * If the enqueued packet is the one allocated by us the PACKET_MINE flag is set 605 605 * */ … … 1826 1826 1827 1827 /* 1828 * frees NDIS_PACKET crea ed with vboxNetFltWinNdisPacketFromSG1828 * frees NDIS_PACKET created with vboxNetFltWinNdisPacketFromSG 1829 1829 */ 1830 1830 DECLHIDDEN(void) vboxNetFltWinFreeSGNdisPacket(PNDIS_PACKET pPacket, bool bFreeMem) … … 2157 2157 int rc; 2158 2158 PVBOXNETFLTINS pInstance; 2159 USHORT cbAnsiName = pBindToMiniportName->Length;/* the leng htis is bytes ; *2 ;RtlUnicodeStringToAnsiSize(pBindToMiniportName)*/2159 USHORT cbAnsiName = pBindToMiniportName->Length;/* the length is is bytes ; *2 ;RtlUnicodeStringToAnsiSize(pBindToMiniportName)*/ 2160 2160 CREATE_INSTANCE_CONTEXT Context; 2161 2161 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; … … 2987 2987 } 2988 2988 2989 /* it's inter upted */2989 /* it's interrupted */ 2990 2990 rc = VERR_INTERRUPTED; 2991 2991 } … … 3111 3111 /* Assert(!pThis->fActive); */ 3112 3112 3113 /* parano ya to ensyre the instance is not removed while we're waiting on the mutex3113 /* paranoia to ensyre the instance is not removed while we're waiting on the mutex 3114 3114 * in case ndis does something unpredictable, e.g. calls our miniport halt independently 3115 3115 * from protocol unbind and concurrently with it*/ … … 3148 3148 Assert(vboxNetFltWinGetOpState(&pAdapt->PTState) == kVBoxNetDevOpState_Deinitialized); 3149 3149 #endif 3150 // /* parano ya */3150 // /* paranoia */ 3151 3151 // vboxNetFltWinSetOpState(&pAdapt->MPState, kVBoxNetDevOpState_Deinitialized); 3152 3152 //#ifndef VBOXNETADP … … 3317 3317 Assert(vboxNetFltWinGetOpState(&pAdapt->PTState) == kVBoxNetDevOpState_Initialized); 3318 3318 #endif 3319 // /* parano ya */3319 // /* paranoia */ 3320 3320 //// vboxNetFltWinSetAdaptState(&pAdapt->MPState, kVBoxNetDevOpState_Initialized); 3321 3321 //#ifndef VBOXNETADP … … 3364 3364 Assert(vboxNetFltWinGetOpState(&pAdapt->PTState) == kVBoxNetDevOpState_Deinitialized); 3365 3365 #endif 3366 // /* parano ya */3366 // /* paranoia */ 3367 3367 // vboxNetFltWinSetOpState(&pAdapt->MPState, kVBoxNetDevOpState_Deinitialized); 3368 3368 //#ifndef VBOXNETADP -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFlt-win.h
r30111 r33540 898 898 899 899 /* convenience method used which allocates and initializes the PINTNETSG containing one 900 * segment refer ing the buffer of size cbBufSize900 * segment referring the buffer of size cbBufSize 901 901 * the allocated PINTNETSG should be freed with the vboxNetFltWinMemFree. 902 902 * … … 1004 1004 1005 1005 /************************************************************** 1006 * utility metho fs for ndis packet creation/initialization *1006 * utility methods for ndis packet creation/initialization * 1007 1007 **************************************************************/ 1008 1008 -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFltCommon-win.h
r32338 r33540 1 1 /* $Id$ */ 2 2 /** @file 3 * VBoxNetFltCommon.h - Network Filter Driver (Host), Windows Specific Code. Common heade er with commonly used defines and decls3 * VBoxNetFltCommon.h - Network Filter Driver (Host), Windows Specific Code. Common header with commonly used defines and decls 4 4 */ 5 5 … … 182 182 * i.e. we could use it on our needs and should not return it 183 183 * we are enqueueing "our" packets on ProtocolReceive call-back when 184 * Ndis does not give us a receive acket (the driver below us has called NdisM..IndicateReceive)184 * Ndis does not give us a receive packet (the driver below us has called NdisM..IndicateReceive) 185 185 * this is supported for Ndis Packet only */ 186 186 #define PACKET_MINE 0x00000004 … … 212 212 /* 213 213 * we are using non-interlocked versions of LIST_ENTRY-related operations macros and synchronize 214 * access to the queue and its elements by a quiring/releasing a spinlock using Ndis[Acquire,Release]Spinlock214 * access to the queue and its elements by acquiring/releasing a spinlock using Ndis[Acquire,Release]Spinlock 215 215 * 216 216 * we are NOT using interlocked versions of insert/remove head/tail list functions because we need to iterate though … … 395 395 NDIS_HANDLE hSendBufferPoolHandle; 396 396 /** open/close adapter status. 397 * Since ndis adapter open and close requests may complete as synchronously,397 * Since ndis adapter open and close requests may complete asynchronously, 398 398 * we are using event mechanism to wait for open/close completion 399 399 * the status field is being set by the completion call-back */ … … 443 443 } SEND_RSVD, *PSEND_RSVD; 444 444 445 /** represents the data stored in the protocol re cerved field of ndis packet on NdisTransferData processing*/445 /** represents the data stored in the protocol reserved field of ndis packet on NdisTransferData processing*/ 446 446 typedef struct _TRANSFERDATA_RSVD 447 447 { -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFltMp-win.c
r29592 r33540 210 210 #ifdef VBOXNETFLT_WITH_IOCTL_SECURITY 211 211 /* NdisMRegisterDevice does not offers us the ability to set security attributes */ 212 /* need to do this "manual y" for the device to be accessible by the non-privileged users */212 /* need to do this "manually" for the device to be accessible by the non-privileged users */ 213 213 Status = vboxNetFltWinSetSecurity(&DeviceLinkUnicodeString); 214 214 Assert(Status == STATUS_SUCCESS); … … 347 347 348 348 Assert(vboxNetFltWinGetOpState(&pAdapt->MPState) == kVBoxNetDevOpState_Initializing); 349 /* the MP state should be already set to kVBoxNetDevOpState_Initializing, just a parano ya350 * in case NDIS for some reason calls us in some unregular way */349 /* the MP state should be already set to kVBoxNetDevOpState_Initializing, just a paranoia 350 * in case NDIS for some reason calls us in some irregular way */ 351 351 vboxNetFltWinSetOpState(&pAdapt->MPState, kVBoxNetDevOpState_Initializing); 352 352 … … 496 496 /* 497 497 * Set the flag that the miniport below is unbinding, so the request handlers will 498 * fail any request com ming later498 * fail any request coming later 499 499 */ 500 500 RTSpinlockAcquireNoInts(pNetFlt->hSpinlock, &Tmp); … … 1151 1151 1152 1152 /** 1153 * This routine does all the proc ssing for a request with a SetPower Oid1153 * This routine does all the processing for a request with a SetPower Oid 1154 1154 * The miniport shoud accept the Set Power and transition to the new state 1155 1155 * … … 1616 1616 case OID_GEN_MEDIA_IN_USE: 1617 1617 // 1618 // Specif iy a complete list of the media types that the NIC1618 // Specify a complete list of the media types that the NIC 1619 1619 // currently uses. 1620 1620 // … … 1650 1650 case OID_GEN_MAXIMUM_FRAME_SIZE: 1651 1651 // 1652 // Specif iy the maximum network packet size, in bytes, that the1652 // Specify the maximum network packet size, in bytes, that the 1653 1653 // NIC supports excluding the header. A NIC driver that emulates 1654 1654 // another medium type for binding to a transport must ensure that … … 1837 1837 case OID_GEN_CURRENT_PACKET_FILTER: 1838 1838 // 1839 // Specif iy the types of net packets such as directed, broadcast1839 // Specify the types of net packets such as directed, broadcast 1840 1840 // multicast, for which a protocol receives indications from a 1841 1841 // NIC driver. After NIC is initialized, a protocol driver … … 1895 1895 // Return the MAC address the NIC is currently programmed to 1896 1896 // use. Note that this address could be different from the 1897 // perman anent address as the user can override using1897 // permanent address as the user can override using 1898 1898 // registry. Read NdisReadNetworkAddress doc for more info. 1899 1899 // … … 2129 2129 2130 2130 // 2131 // Program the hardware to add sup ort for these muticast addresses2131 // Program the hardware to add support for these multicast addresses 2132 2132 // 2133 2133 -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFltPt-win.c
r32338 r33540 28 28 /** protocol handle */ 29 29 static NDIS_HANDLE g_hProtHandle = NULL; 30 /** medium array used while opening underlying adap rot30 /** medium array used while opening underlying adaptor 31 31 * we are actually binding to NdisMedium802_3 and NdisMediumWan 32 32 * as specified in VBoxNetFlt.inf: … … 161 161 * @param DeviceName - Device name to bind to. This is passed to NdisOpenAdapter. 162 162 * @param SystemSpecific1 - Can be passed to NdisOpenProtocolConfiguration to read per-binding information 163 * @para nSystemSpecific2 - Unused163 * @param SystemSpecific2 - Unused 164 164 * @return NDIS_STATUS_PENDING if this call is pended. In this case call NdisCompleteBindAdapter to complete. 165 165 * Anything else Completes this call synchronously */ … … 297 297 /* 298 298 * Set the flag that the miniport below is unbinding, so the request handlers will 299 * fail any request com ming later299 * fail any request coming later 300 300 */ 301 301 RTSpinlockAcquireNoInts(pNetFlt->hSpinlock, &Tmp); … … 513 513 if(pSynchRequest == NdisRequest) 514 514 { 515 /* as synchronous completion of our synchrequest */515 /* asynchronous completion of our sync request */ 516 516 517 517 /*1.set the status */ … … 789 789 #endif 790 790 { 791 /* if the ptk is zer ro - the ptk was originated by netFlt send/receive791 /* if the ptk is zero - the ptk was originated by netFlt send/receive 792 792 * need to free packet buffers */ 793 793 PVOID pBufToFree = SendRsvd->pBufToFree; … … 856 856 857 857 /* 858 * pAdapt->Rece viePacketCount must be less than MAX_RECEIVE_PACKET_ARRAY_SIZE because858 * pAdapt->ReceivePacketCount must be less than MAX_RECEIVE_PACKET_ARRAY_SIZE because 859 859 * the thread which held the pVElan->Lock before should already indicate the packet(s) 860 * up if pAdapt->Rece viePacketCount == MAX_RECEIVE_PACKET_ARRAY_SIZE.860 * up if pAdapt->ReceivePacketCount == MAX_RECEIVE_PACKET_ARRAY_SIZE. 861 861 */ 862 862 pAdapt->aReceivedPackets[pAdapt->cReceivedPacketCount] = Packet; … … 875 875 /* 876 876 * If our receive packet array is full, or the miniport below indicated the packets 877 * with resources, do the indicatin now.877 * with resources, do the indicating now. 878 878 */ 879 879 … … 905 905 { 906 906 /* the tcp stack can send ACK packets right in the context of its PtReceive for this packet, 907 * and tho ose (tcp-sent) packets can be looped back again.907 * and those (tcp-sent) packets can be looped back again. 908 908 * If this happens there is a possibility that new RX packets are received by us 909 909 * after we do this NdisMIndicateReceivePacket and before we do a new NdisMIndicateReceivePacket -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/WinNetConfig.cpp
r28800 r33540 1469 1469 * @param pencbp Binding path enumerator reference. 1470 1470 * @param ppncbp Address the Binding path reference to be stored to 1471 * @return S_OK on suc ess, otherwise an error code.1471 * @return S_OK on success, otherwise an error code. 1472 1472 */ 1473 1473 VBOXNETCFGWIN_DECL(HRESULT) … … 2591 2591 /* if the function failed and GetLastError() returned 2592 2592 * ERROR_NO_MORE_ITEMS, then we have reached the end of the 2593 * list. Othe wise there was something wrong with this2593 * list. Otherwise there was something wrong with this 2594 2594 * particular driver. */ 2595 2595 if (!ret) -
trunk/src/VBox/HostDrivers/VBoxUSB/USBFilter.cpp
r31898 r33540 32 32 33 33 /** 34 * Init alizes an USBFILTER structure.34 * Initializes an USBFILTER structure. 35 35 * 36 36 * @param pFilter The filter to initialize. 37 37 * @param enmType The filter type. If not valid, the filter will not 38 * be properly init alized and all other calls will fail.38 * be properly initialized and all other calls will fail. 39 39 */ 40 40 USBLIB_DECL(void) USBFilterInit(PUSBFILTER pFilter, USBFILTERTYPE enmType) … … 152 152 153 153 /** 154 * Reads a number from a num bereric expression.154 * Reads a number from a numeric expression. 155 155 * 156 156 * @returns IPRT status code. … … 290 290 291 291 /** 292 * Thoroug ly validates the USB Filter.292 * Thoroughly validates the USB Filter. 293 293 * 294 294 * @returns Appropriate VBox status code. … … 1467 1467 1468 1468 /** 1469 * Gets the numeric avalue of a field.1469 * Gets the numeric value of a field. 1470 1470 * 1471 1471 * The field must contain a number, we're not doing any conversions for you. … … 1492 1492 1493 1493 /** 1494 * Gets the numeric avalue of a field.1494 * Gets the numeric value of a field. 1495 1495 * 1496 1496 * The field must contain a number, we're not doing any conversions for you. -
trunk/src/VBox/HostDrivers/VBoxUSB/VBoxUSBFilterMgr.cpp
r31898 r33540 72 72 73 73 /** 74 * VBoxUSB internal filter represen ation.74 * VBoxUSB internal filter representation. 75 75 */ 76 76 typedef struct VBOXUSBFILTER … … 117 117 118 118 /** 119 * Init alizes the VBoxUSB filter manager.119 * Initializes the VBoxUSB filter manager. 120 120 * 121 121 * @returns IPRT status code. … … 397 397 * 398 398 * The code does NOT implement the case where there are two or more 399 * filter clients, and one of them is releas eing a device that's399 * filter clients, and one of them is releasing a device that's 400 400 * requested by some of the others. It's just too much work for a 401 401 * situation that noone will encounter. -
trunk/src/VBox/HostDrivers/VBoxUSB/darwin/VBoxUSB.cpp
r31898 r33540 4 4 * 5 5 * This driver is responsible for hijacking USB devices when any of the 6 * VBoxSVC daemons requests it. It is also responsible for arb riating6 * VBoxSVC daemons requests it. It is also responsible for arbitrating 7 7 * access to hijacked USB devices. 8 8 */ … … 287 287 org_virtualbox_VBoxUSBDevice * volatile org_virtualbox_VBoxUSBDevice::s_pHead = NULL; 288 288 289 /** Global instance count - just for checking pro oving that everything is destroyed correctly. */289 /** Global instance count - just for checking proving that everything is destroyed correctly. */ 290 290 static volatile uint32_t g_cInstances = 0; 291 291 … … 993 993 * that we'll be the first driver to be started. We'll also set a couple of 994 994 * attributes so that it's not necessary to do a rematch in init to find 995 * the appropriate filter (might not be nec ssary..., see todo).995 * the appropriate filter (might not be necessary..., see todo). 996 996 * 997 997 * @returns Service instance to be started and *pi32Score if matching. … … 1284 1284 * But, when we're unloaded the provider service isn't terminated, and 1285 1285 * for some funny reason we're frequently causing kernel panics when the 1286 * device is det eached (after we're unloaded). So, for now, let's try1286 * device is detached (after we're unloaded). So, for now, let's try 1287 1287 * re-enumerate it in stop. 1288 1288 * … … 1321 1321 * This message is send to the current IOService client from IOService::handleOpen(), 1322 1322 * expecting it to call pProvider->close() if it agrees to the other party seizing 1323 * the service. It is also called in IOSer ivce::didTerminate() and perhaps some other1323 * the service. It is also called in IOService::didTerminate() and perhaps some other 1324 1324 * odd places. The way to find out is to examin the pvArg, which would be including 1325 1325 * kIOServiceSeize if it's the handleOpen case. … … 1712 1712 1713 1713 /* 1714 * Close and rel ase the IOUSBInterface if didn't do that already in message().1714 * Close and release the IOUSBInterface if didn't do that already in message(). 1715 1715 */ 1716 1716 if (m_pInterface) -
trunk/src/VBox/HostDrivers/VBoxUSB/os2/usbcalls.c
r31896 r33540 53 53 54 54 #define IOCAT_USBRES 0x000000A0 /* USB Resource device control */ 55 #define IOCTLF_NUMDEVICE 0x00000031 /* Get Number of plug ed in Devices */55 #define IOCTLF_NUMDEVICE 0x00000031 /* Get Number of plugged in Devices */ 56 56 #define IOCTLF_GETINFO 0x00000032 /* Get Info About a device */ 57 57 #define IOCTLF_AQUIREDEVICE 0x00000033 … … 123 123 USHORT usProductID; 124 124 USHORT usBCDDevice; 125 USHORT usDeviceNumber; /* Get the usDeviceNumber device in the system fi. if 2 a quire the 2nd device126 0 means first not a quired device. */125 USHORT usDeviceNumber; /* Get the usDeviceNumber device in the system fi. if 2 acquire the 2nd device 126 0 means first not acquired device. */ 127 127 } AQUIREDEV, *PAQUIREDEV; 128 128 … … 164 164 typedef struct 165 165 { 166 ULONG hSemAccess; /* Sync ronise access to the Pos values */166 ULONG hSemAccess; /* Synchronise access to the Pos values */ 167 167 ULONG hDevice; 168 168 USHORT usPosWrite; … … 275 275 { 276 276 pIter->hDevice = 0; 277 pIter->hSemAccess = 0; /* Sync ronise access to the Pos values */277 pIter->hSemAccess = 0; /* Synchronise access to the Pos values */ 278 278 pIter->usPosWrite = 0; 279 279 pIter->usPosRead = 0; … … 672 672 pHandle, ulDataLen, &ulDataLen); 673 673 674 /* @@ ToDO maybe gether some info about device here (endpoints etc for sa vety checks) */674 /* @@ ToDO maybe gether some info about device here (endpoints etc for safety checks) */ 675 675 return rc; 676 676 … … 821 821 if (BulkRequest.usDataProcessed != ulDataLen) 822 822 { 823 /* Transfer ed less than we wanted? so something is wrong,823 /* Transferred less than we wanted? so something is wrong, 824 824 or device doesn't wish to send more, exit loop */ 825 825 rc = USB_ERROR_LESSTRANSFERED; -
trunk/src/VBox/HostDrivers/VBoxUSB/solaris/VBoxUSB-solaris.c
r31898 r33540 208 208 uint16_t cIsocInUrbs; /* Number of Isoc. IN inflight URBs */ 209 209 list_t hIsocInLandedReqs; /* Isoc. IN landed requests */ 210 uint16_t cbIsocInLandedReqs; /* Cum mulative size of landed Isoc. IN requests */210 uint16_t cbIsocInLandedReqs; /* Cumulative size of landed Isoc. IN requests */ 211 211 size_t cbMaxIsocData; /* Maximum size of Isoc. IN landed buffer */ 212 212 } vboxusb_ep_t; … … 286 286 int fPoll; /* Polling status flag */ 287 287 RTPROCESS Process; /* The process (id) of the session */ 288 VBOXUSBREQ_CLIENT_INFO ClientInfo; /* Regist eration data */288 VBOXUSBREQ_CLIENT_INFO ClientInfo; /* Registration data */ 289 289 vboxusb_power_t *pPower; /* Power Management */ 290 290 } vboxusb_state_t; … … 1126 1126 1127 1127 /** 1128 * IOCtl processor for user to kernel and kernel to kernel commun cation.1128 * IOCtl processor for user to kernel and kernel to kernel communication. 1129 1129 * 1130 1130 * @returns VBox status code. … … 2831 2831 { 2832 2832 /* 2833 * Remove from head and move to tail so that when several URBs are reaped contin ously we get to use2833 * Remove from head and move to tail so that when several URBs are reaped continuously we get to use 2834 2834 * up each one free 'head'. 2835 2835 */ -
trunk/src/VBox/HostDrivers/VBoxUSB/solaris/VBoxUSBHelper.cpp
r31898 r33540 65 65 * -1 - no root permission 66 66 * -2 - insufficient arguments 67 * -3 - ab ormal termination of udpate_drv (not likely)67 * -3 - abnormal termination of update_drv (not likely) 68 68 * -4 - update_drv failed (mostly trying to add already existing alias) 69 69 */ -
trunk/src/VBox/HostDrivers/VBoxUSB/solaris/VBoxUSBMon-solaris.c
r31911 r33540 148 148 { 149 149 dev_info_t *pDip; /* Client device info. pointer */ 150 VBOXUSB_CLIENT_INFO Info; /* Client regist eration data. */150 VBOXUSB_CLIENT_INFO Info; /* Client registration data. */ 151 151 struct vboxusbmon_client_t *pNext; /* Pointer to next client */ 152 152 } vboxusbmon_client_t; … … 664 664 665 665 /** 666 * IOCtl processor for user to kernel and kernel to kernel commun cation.666 * IOCtl processor for user to kernel and kernel to kernel communication. 667 667 * 668 668 * @returns VBox status code. -
trunk/src/VBox/HostDrivers/VBoxUSB/solaris/include/usbai_private.h
r31896 r33540 178 178 /* 179 179 * USB CPR support 180 * A client driver must call this fun tion in pre-suspend event handler180 * A client driver must call this function in pre-suspend event handler 181 181 * to inform the USBA framework that it can't suspend because 182 182 * driver instance or device could not be quiesced. … … 573 573 * 574 574 * Return Values: 575 * USB_SUCCESS - the regist eration was successful576 * USB_FAILURE - the regist eration failed575 * USB_SUCCESS - the registration was successful 576 * USB_FAILURE - the registration failed 577 577 */ 578 578 int usb_register_dev_driver( -
trunk/src/VBox/HostDrivers/VBoxUSB/win/Device/vboxdev.cpp
r32431 r33540 1149 1149 // 1. completion routine does not attempt to touch the irp freed by 1150 1150 // CancelSelectSuspend routine. 1151 // 2. CancelSelectSuspend routine doesn t wait for ever for the completion1151 // 2. CancelSelectSuspend routine doesn't wait for ever for the completion 1152 1152 // routine to complete! 1153 1153 // … … 1323 1323 // count is decremented twice (one for the system Irp and the 1324 1324 // other for the device Irp. An increment here compensates for 1325 // the sy tem irp..The decrement corresponding to this increment1325 // the system irp..The decrement corresponding to this increment 1326 1326 // is in the completion function 1327 1327 // … … 1595 1595 // This routine has the irp pointer. 1596 1596 // It is safe to call IoCancelIrp because we know that 1597 // the comple iton routine will not free this irp unless...1597 // the completion routine will not free this irp unless... 1598 1598 // 1599 1599 // -
trunk/src/VBox/HostDrivers/VBoxUSB/win/Device/vboxpnp.cpp
r31896 r33540 493 493 // Read the first configuration descriptor 494 494 // This requires two steps: 495 // 1. Read the fixed sized configuration desc iptor (CD)495 // 1. Read the fixed sized configuration descriptor (CD) 496 496 // 2. Read the CD with all embedded interface and endpoint descriptors 497 497 // … … 1781 1781 // 1782 1782 // since its safe to surprise-remove this device, we shall 1783 // set the SurpriseRemoveOK flag to sup ress any dialog to1783 // set the SurpriseRemoveOK flag to suppress any dialog to 1784 1784 // user. 1785 1785 // … … 2030 2030 2031 2031 // 2032 // the cancel routine for this IRP hasn t been called yet2032 // the cancel routine for this IRP hasn't been called yet 2033 2033 // so queue the IRP in the cancelledIrp list and complete 2034 2034 // after releasing the lock … … 2105 2105 Routine Description: 2106 2106 2107 This routine reads the specified re qistry value.2107 This routine reads the specified registry value. 2108 2108 2109 2109 Arguments: -
trunk/src/VBox/HostDrivers/VBoxUSB/win/Device/vboxrwr.cpp
r31896 r33540 137 137 This read/write is performed in stages of VBoxUSB_MAX_TRANSFER_SIZE. 138 138 once a stage of transfer is complete, then the irp is circulated again, 139 until the requested length of tran fer is performed.139 until the requested length of transfer is performed. 140 140 141 141 Arguments: -
trunk/src/VBox/HostDrivers/VBoxUSB/win/Device/vboxrwr.h
r31896 r33540 27 27 PMDL Mdl; 28 28 ULONG Length; // remaining to xfer 29 ULONG Numxfer; // cumulatexfer29 ULONG Numxfer; // acumulated xfer 30 30 ULONG_PTR VirtualAddress; // va for next segment of xfer. 31 31 PDEVICE_EXTENSION DeviceExtension; -
trunk/src/VBox/HostDrivers/VBoxUSB/win/Device/vboxusb.cpp
r31896 r33540 212 212 213 213 PhysicalDeviceObject - Pointer to the device object created by the 214 unde lying bus driver.214 underlying bus driver. 215 215 216 216 Return: -
trunk/src/VBox/HostDrivers/VBoxUSB/win/Device/vboxusb.h
r31896 r33540 255 255 KEVENT NoIdleReqPendEvent; 256 256 257 // default power state to power down to on self-suspe d257 // default power state to power down to on self-suspend 258 258 ULONG PowerDownLevel; 259 259 -
trunk/src/VBox/HostDrivers/VBoxUSB/win/Filter/USBFilt-win32.cpp
r31898 r33540 147 147 148 148 // 149 // On the way up, pag able might become clear. Mimic the driver below us.149 // On the way up, pageable might become clear. Mimic the driver below us. 150 150 // 151 151 if (!(pdx->NextLowerDriver->Flags & DO_POWER_PAGABLE)) { … … 442 442 } 443 443 444 /* depr icated */444 /* deprecated */ 445 445 case SUPUSBFLT_IOCTL_IGNORE_DEVICE: 446 446 { -
trunk/src/VBox/HostDrivers/VBoxUSB/win/Filter/USBFilter.c
r31896 r33540 258 258 // 259 259 // Let us use remove lock to keep count of IRPs so that we don't 260 // det each and delete our deviceobject until all pending I/Os in our260 // detach and delete our deviceobject until all pending I/Os in our 261 261 // devstack are completed. Remlock is required to protect us from 262 262 // various race conditions where our driver can get unloaded while we … … 555 555 556 556 // 557 // On the way down, pag able might become set. Mimic the driver558 // above us. If no one is above us, just set pag able.557 // On the way down, pageable might become set. Mimic the driver 558 // above us. If no one is above us, just set pageable. 559 559 // 560 560 if ((DeviceObject->AttachedDevice == NULL) || … … 584 584 #endif 585 585 // 586 // On the way down, pag able might become set. Mimic the driver587 // above us. If no one is above us, just set pag able.586 // On the way down, pageable might become set. Mimic the driver 587 // above us. If no one is above us, just set pageable. 588 588 // 589 589 if ((DeviceObject->AttachedDevice == NULL) || … … 707 707 708 708 // 709 // On the way up, pag able might become clear. Mimic the driver below us.709 // On the way up, pageable might become clear. Mimic the driver below us. 710 710 // 711 711 if (!(deviceExtension->NextLowerDriver->Flags & DO_POWER_PAGABLE)) { -
trunk/src/VBox/HostDrivers/VBoxUSB/win/USBLib-win.cpp
r31898 r33540 430 430 431 431 // 432 // Structures assoc ated with TreeView items through the lParam. When an item432 // Structures associated with TreeView items through the lParam. When an item 433 433 // is selected, the lParam is retrieved and the structure it which it points 434 434 // is used to display information in the edit control. … … 1668 1668 // bRequest = 0x06 1669 1669 // 1670 // We must initi tialize these fields:1670 // We must initialize these fields: 1671 1671 // wValue = Descriptor Type (high) and Descriptor Index (low byte) 1672 1672 // wIndex = Zero (or Language ID for String Descriptors) … … 1738 1738 // bRequest = 0x06 1739 1739 // 1740 // We must initi tialize these fields:1740 // We must initialize these fields: 1741 1741 // wValue = Descriptor Type (high) and Descriptor Index (low byte) 1742 1742 // wIndex = Zero (or Language ID for String Descriptors) … … 2089 2089 // bRequest = 0x06 2090 2090 // 2091 // We must initi tialize these fields:2091 // We must initialize these fields: 2092 2092 // wValue = Descriptor Type (high) and Descriptor Index (low byte) 2093 2093 // wIndex = Zero (or Language ID for String Descriptors) … … 2785 2785 2786 2786 AssertMsg((int32_t)numdev.cUSBDevices >= 0, ("%d", numdev.cUSBDevices)); 2787 if ((int32_t)numdev.cUSBDevices <= 0) /** @todo why does this return -1. Happen d here when detaching a captured device which hadn't yet been opened by a VM process. */2787 if ((int32_t)numdev.cUSBDevices <= 0) /** @todo why does this return -1. Happened here when detaching a captured device which hadn't yet been opened by a VM process. */ 2788 2788 break; 2789 2789
Note:
See TracChangeset
for help on using the changeset viewer.