- Timestamp:
- Oct 15, 2014 1:10:29 PM (10 years ago)
- Location:
- trunk/src/VBox/Devices/USB
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/USB/DrvVUSBRootHub.cpp
r53062 r53067 499 499 #endif 500 500 501 /* If there is a sniffer on the roothub record the URB there. */ 502 if (pRh->hSniffer != VUSBSNIFFER_NIL) 503 { 504 int rc = VUSBSnifferRecordEvent(pRh->hSniffer, pUrb, VUSBSNIFFEREVENT_SUBMIT); 505 if (RT_FAILURE(rc)) 506 LogRel(("VUSB: Capturing URB submit event on the root hub failed with %Rrc\n", rc)); 507 } 508 501 509 /* 502 510 * The device was resolved when we allocated the URB. … … 888 896 pRh->Hub.pszName = NULL; 889 897 } 898 if (pRh->hSniffer != VUSBSNIFFER_NIL) 899 VUSBSnifferDestroy(pRh->hSniffer); 890 900 RTCritSectDelete(&pRh->CritSectDevices); 891 901 RTCritSectDelete(&pRh->CritSectFreeUrbs); … … 907 917 * Validate configuration. 908 918 */ 909 if (!CFGMR3AreValuesValid(pCfg, " \0"))919 if (!CFGMR3AreValuesValid(pCfg, "CaptureFilename\0")) 910 920 return VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES; 911 921 … … 927 937 if (RT_FAILURE(rc)) 928 938 return rc; 939 940 char *pszCaptureFilename = NULL; 941 rc = CFGMR3QueryStringAlloc(pCfg, "CaptureFilename", &pszCaptureFilename); 942 if ( RT_FAILURE(rc) 943 && rc != VERR_CFGM_VALUE_NOT_FOUND) 944 return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, 945 N_("Configuration error: Failed to query value of \"CaptureFilename\"")); 929 946 930 947 /* … … 958 975 pThis->IRhConnector.pfnAttachDevice = vusbRhAttachDevice; 959 976 pThis->IRhConnector.pfnDetachDevice = vusbRhDetachDevice; 977 pThis->hSniffer = VUSBSNIFFER_NIL; 960 978 /* 961 979 * Resolve interface(s). … … 977 995 pThis->fHcVersions = pThis->pIRhPort->pfnGetUSBVersions(pThis->pIRhPort); 978 996 Log(("vusbRhConstruct: fHcVersions=%u\n", pThis->fHcVersions)); 997 998 if (pszCaptureFilename) 999 { 1000 rc = VUSBSnifferCreate(&pThis->hSniffer, 0, pszCaptureFilename, NULL); 1001 if (RT_FAILURE(rc)) 1002 return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, 1003 N_("Failed to create USB sniffer instance")); 1004 1005 MMR3HeapFree(pszCaptureFilename); 1006 } 979 1007 980 1008 /* -
trunk/src/VBox/Devices/USB/VUSBInternal.h
r53062 r53067 383 383 /** Chain of free URBs. (Singly linked) */ 384 384 PVUSBURB pFreeUrbs; 385 /** Sniffer instance for the root hub. */ 386 VUSBSNIFFER hSniffer; 385 387 /** The number of URBs in the pool. */ 386 388 uint32_t cUrbsInPool; … … 388 390 uint32_t fHcVersions; 389 391 #ifdef VBOX_WITH_STATISTICS 390 #if HC_ARCH_BITS == 32391 uint32_t Alignment2; /**< Counters must be 64-bit aligned. */392 #endif393 392 VUSBROOTHUBTYPESTATS Total; 394 393 VUSBROOTHUBTYPESTATS aTypes[VUSBXFERTYPE_MSG]; -
trunk/src/VBox/Devices/USB/VUSBUrb.cpp
r53062 r53067 1028 1028 PVUSBROOTHUB pRh = vusbDevGetRh(pUrb->VUsb.pDev); 1029 1029 AssertPtrReturnVoid(pRh); 1030 1031 /* If there is a sniffer on the roothub record the completed URB there too. */ 1032 if (pRh->hSniffer != VUSBSNIFFER_NIL) 1033 { 1034 int rc = VUSBSnifferRecordEvent(pRh->hSniffer, pUrb, 1035 pUrb->enmStatus == VUSBSTATUS_OK 1036 ? VUSBSNIFFEREVENT_COMPLETE 1037 : VUSBSNIFFEREVENT_ERROR_COMPLETE); 1038 if (RT_FAILURE(rc)) 1039 LogRel(("VUSB: Capturing URB completion event on the root hub failed with %Rrc\n", rc)); 1040 } 1041 1030 1042 if (pUrb->enmType != VUSBXFERTYPE_MSG) 1031 1043 {
Note:
See TracChangeset
for help on using the changeset viewer.