- Timestamp:
- Dec 22, 2017 4:53:41 PM (7 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/ConsoleImpl.h
r68992 r70322 738 738 static DECLCALLBACK(int) i_usbAttachCallback(Console *that, PUVM pUVM, IUSBDevice *aHostDevice, PCRTUUID aUuid, 739 739 const char *aBackend, const char *aAddress, void *pvRemoteBackend, 740 USHORT aPortVersion, ULONG aMaskedIfs, const char *pszCaptureFilename); 740 USBConnectionSpeed_T enmSpeed, ULONG aMaskedIfs, 741 const char *pszCaptureFilename); 741 742 static DECLCALLBACK(int) i_usbDetachCallback(Console *that, PUVM pUVM, PCRTUUID aUuid); 742 743 #endif -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r70063 r70322 8922 8922 } 8923 8923 8924 US HORT portVersion = 0;8925 hrc = aHostDevice->COMGETTER( PortVersion)(&portVersion);8924 USBConnectionSpeed_T enmSpeed; 8925 hrc = aHostDevice->COMGETTER(Speed)(&enmSpeed); 8926 8926 AssertComRCReturnRC(hrc); 8927 Assert(portVersion == 1 || portVersion == 2 || portVersion == 3);8928 8927 8929 8928 int vrc = VMR3ReqCallWaitU(ptrVM.rawUVM(), 0 /* idDstCpu (saved state, see #6232) */, 8930 8929 (PFNRT)i_usbAttachCallback, 10, 8931 8930 this, ptrVM.rawUVM(), aHostDevice, uuid.raw(), Backend.c_str(), 8932 Address.c_str(), pvRemoteBackend, portVersion, aMaskedIfs,8931 Address.c_str(), pvRemoteBackend, enmSpeed, aMaskedIfs, 8933 8932 aCaptureFilename.isEmpty() ? NULL : aCaptureFilename.c_str()); 8934 8933 if (RT_SUCCESS(vrc)) … … 8981 8980 DECLCALLBACK(int) 8982 8981 Console::i_usbAttachCallback(Console *that, PUVM pUVM, IUSBDevice *aHostDevice, PCRTUUID aUuid, const char *pszBackend, 8983 const char *aAddress, void *pvRemoteBackend, US HORT aPortVersion, ULONG aMaskedIfs,8982 const char *aAddress, void *pvRemoteBackend, USBConnectionSpeed_T aEnmSpeed, ULONG aMaskedIfs, 8984 8983 const char *pszCaptureFilename) 8985 8984 { … … 8991 8990 AssertReturn(!that->isWriteLockOnCurrentThread(), VERR_GENERAL_FAILURE); 8992 8991 8992 VUSBSPEED enmSpeed = VUSB_SPEED_UNKNOWN; 8993 switch (aEnmSpeed) 8994 { 8995 case USBConnectionSpeed_Low: enmSpeed = VUSB_SPEED_LOW; break; 8996 case USBConnectionSpeed_Full: enmSpeed = VUSB_SPEED_FULL; break; 8997 case USBConnectionSpeed_High: enmSpeed = VUSB_SPEED_HIGH; break; 8998 case USBConnectionSpeed_Super: enmSpeed = VUSB_SPEED_SUPER; break; 8999 case USBConnectionSpeed_SuperPlus: enmSpeed = VUSB_SPEED_SUPERPLUS; break; 9000 default: AssertFailed(); break; 9001 } 9002 8993 9003 int vrc = PDMR3UsbCreateProxyDevice(pUVM, aUuid, pszBackend, aAddress, pvRemoteBackend, 8994 aPortVersion == 3 ? VUSB_STDVER_30 : 8995 aPortVersion == 2 ? VUSB_STDVER_20 : VUSB_STDVER_11, 8996 aMaskedIfs, pszCaptureFilename); 9004 enmSpeed, aMaskedIfs, pszCaptureFilename); 8997 9005 LogFlowFunc(("vrc=%Rrc\n", vrc)); 8998 9006 LogFlowFuncLeave(); -
trunk/src/VBox/VMM/VMMR3/PDMUsb.cpp
r70039 r70322 459 459 460 460 /** 461 * Translates a USB ve sion (a bit-mask) to USB speed (enum). Picks461 * Translates a USB version (a bit-mask) to USB speed (enum). Picks 462 462 * the highest available version. 463 463 * … … 480 480 481 481 return enmSpd; 482 } 483 484 485 /** 486 * Translates a USB speed (enum) to USB version. 487 * 488 * @returns USB version mask 489 * 490 * @param enmSpeed The USB connection speed. 491 * 492 */ 493 static uint32_t pdmR3UsbSpd2Ver(VUSBSPEED enmSpeed) 494 { 495 uint32_t iUsbVersion = 0; 496 Assert(enmSpeed != VUSB_SPEED_UNKNOWN); 497 498 switch (enmSpeed) 499 { 500 case VUSB_SPEED_LOW: 501 case VUSB_SPEED_FULL: 502 iUsbVersion = VUSB_STDVER_11; 503 break; 504 case VUSB_SPEED_HIGH: 505 iUsbVersion = VUSB_STDVER_20; 506 break; 507 case VUSB_SPEED_SUPER: 508 case VUSB_SPEED_SUPERPLUS: 509 default: 510 iUsbVersion = VUSB_STDVER_30; 511 break; 512 } 513 514 return iUsbVersion; 482 515 } 483 516 … … 987 1020 * @param pszAddress The address string. 988 1021 * @param pvBackend Pointer to the backend. 989 * @param iUsbVersion The preferred USB version.1022 * @param enmSpeed The speed the USB device is operating at. 990 1023 * @param fMaskedIfs The interfaces to hide from the guest. 991 1024 * @param pszCaptureFilename Path to the file for USB traffic capturing, optional. 992 1025 */ 993 1026 VMMR3DECL(int) PDMR3UsbCreateProxyDevice(PUVM pUVM, PCRTUUID pUuid, const char *pszBackend, const char *pszAddress, void *pvBackend, 994 uint32_t iUsbVersion, uint32_t fMaskedIfs, const char *pszCaptureFilename)1027 VUSBSPEED enmSpeed, uint32_t fMaskedIfs, const char *pszCaptureFilename) 995 1028 { 996 1029 /* … … 1003 1036 AssertPtrReturn(pUuid, VERR_INVALID_POINTER); 1004 1037 AssertPtrReturn(pszAddress, VERR_INVALID_POINTER); 1005 AssertReturn( iUsbVersion == VUSB_STDVER_30 1006 || iUsbVersion == VUSB_STDVER_20 1007 || iUsbVersion == VUSB_STDVER_11, VERR_INVALID_PARAMETER); 1038 AssertReturn( enmSpeed == VUSB_SPEED_LOW 1039 || enmSpeed == VUSB_SPEED_FULL 1040 || enmSpeed == VUSB_SPEED_HIGH 1041 || enmSpeed == VUSB_SPEED_SUPER 1042 || enmSpeed == VUSB_SPEED_SUPERPLUS, VERR_INVALID_PARAMETER); 1008 1043 1009 1044 /* … … 1021 1056 */ 1022 1057 PPDMUSBHUB pHub; 1058 uint32_t iUsbVersion = pdmR3UsbSpd2Ver(enmSpeed); 1023 1059 int rc = pdmR3UsbFindHub(pVM, iUsbVersion, &pHub); 1024 1060 if (RT_FAILURE(rc)) … … 1042 1078 rc = CFGMR3InsertString(pConfig, "UUID", szUuid); AssertRCBreak(rc); 1043 1079 rc = CFGMR3InsertString(pConfig, "Backend", pszBackend); AssertRCBreak(rc); 1044 rc = CFGMR3InsertInteger(pConfig, "USBVersion", iUsbVersion); AssertRCBreak(rc);1045 1080 rc = CFGMR3InsertInteger(pConfig, "pvBackend", (uintptr_t)pvBackend); AssertRCBreak(rc); 1046 1081 rc = CFGMR3InsertInteger(pConfig, "MaskedIfs", fMaskedIfs); AssertRCBreak(rc); … … 1054 1089 } 1055 1090 1056 VUSBSPEED enmSpeed = pdmR3UsbVer2Spd(iUsbVersion); 1091 if (enmSpeed == VUSB_SPEED_UNKNOWN) 1092 enmSpeed = pdmR3UsbVer2Spd(iUsbVersion); 1057 1093 1058 1094 /*
Note:
See TracChangeset
for help on using the changeset viewer.