VirtualBox

Changeset 38911 in vbox


Ignore:
Timestamp:
Sep 30, 2011 9:52:40 AM (13 years ago)
Author:
vboxsync
Message:

RemoteUSB: support the extended device description.

Location:
trunk/src/VBox/Main
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/ConsoleImpl.h

    r38873 r38911  
    228228    void VRDPInterceptClipboard(uint32_t u32ClientId);
    229229
    230     void processRemoteUSBDevices(uint32_t u32ClientId, VRDEUSBDEVICEDESC *pDevList, uint32_t cbDevList);
     230    void processRemoteUSBDevices(uint32_t u32ClientId, VRDEUSBDEVICEDESC *pDevList, uint32_t cbDevList, bool fDescExt);
    231231
    232232    // callback callers (partly; for some events console callbacks are notified
  • trunk/src/VBox/Main/include/RemoteUSBBackend.h

    r33004 r38911  
    131131        /* VRDP_USB_VERSION_2: the client version. */
    132132        uint32_t mClientVersion;
     133
     134        /* VRDP_USB_VERSION_3: the client sends VRDE_USB_REQ_DEVICE_LIST_EXT_RET. */
     135        bool mfDescExt;
    133136};
    134137
  • trunk/src/VBox/Main/include/RemoteUSBDeviceImpl.h

    r35638 r38911  
    5050
    5151    // public initializer/uninitializer for internal purposes only
    52     HRESULT init(uint32_t u32ClientId, VRDEUSBDEVICEDESC *pDevDesc);
     52    HRESULT init(uint32_t u32ClientId, VRDEUSBDEVICEDESC *pDevDesc, bool fDescExt);
    5353    void uninit();
    5454
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r38495 r38911  
    82618261 * @note Locks this object for writing.
    82628262 */
    8263 void Console::processRemoteUSBDevices(uint32_t u32ClientId, VRDEUSBDEVICEDESC *pDevList, uint32_t cbDevList)
     8263void Console::processRemoteUSBDevices(uint32_t u32ClientId, VRDEUSBDEVICEDESC *pDevList, uint32_t cbDevList, bool fDescExt)
    82648264{
    82658265    LogFlowThisFuncEnter();
    8266     LogFlowThisFunc(("u32ClientId = %d, pDevList=%p, cbDevList = %d\n", u32ClientId, pDevList, cbDevList));
     8266    LogFlowThisFunc(("u32ClientId = %d, pDevList=%p, cbDevList = %d, fDescExt = %d\n", u32ClientId, pDevList, cbDevList, fDescExt));
    82678267
    82688268    AutoCaller autoCaller(this);
     
    83358335            ComObjPtr<RemoteUSBDevice> pUSBDevice;
    83368336            pUSBDevice.createObject();
    8337             pUSBDevice->init(u32ClientId, e);
     8337            pUSBDevice->init(u32ClientId, e, fDescExt);
    83388338
    83398339            mRemoteUSBDevices.push_back(pUSBDevice);
  • trunk/src/VBox/Main/src-client/RemoteUSBBackend.cpp

    r35368 r38911  
    805805    {
    806806        /* Unmount all remote USB devices. */
    807         mConsole->processRemoteUSBDevices (mu32ClientId, NULL, 0);
     807        mConsole->processRemoteUSBDevices (mu32ClientId, NULL, 0, false);
    808808
    809809        menmPollRemoteDevicesStatus = PollRemoteDevicesStatus_Dereferenced;
     
    822822            parm.code = VRDE_USB_REQ_NEGOTIATE;
    823823            parm.version = VRDE_USB_VERSION;
    824             parm.flags = 0;
     824            /* VRDE_USB_VERSION_3: support VRDE_USB_REQ_DEVICE_LIST_EXT_RET. */
     825            parm.flags = VRDE_USB_SERVER_CAPS_PORT_VERSION;
    825826
    826827            mServer->SendUSBRequest (mu32ClientId, &parm, sizeof (parm));
     
    864865            if (mfHasDeviceList)
    865866            {
    866                 mConsole->processRemoteUSBDevices (mu32ClientId, (VRDEUSBDEVICEDESC *)mpvDeviceList, mcbDeviceList);
     867                mConsole->processRemoteUSBDevices (mu32ClientId, (VRDEUSBDEVICEDESC *)mpvDeviceList, mcbDeviceList, mfDescExt);
    867868                LogFlow(("USB::PollRemoteDevices: WaitResponse after process\n"));
    868869
     
    950951    mpDevices (NULL),
    951952    mfWillBeDeleted (false),
    952     mClientVersion (0)                   /* VRDE_USB_VERSION_2: the client version. */
     953    mClientVersion (0),                   /* VRDE_USB_VERSION_2: the client version. */
     954    mfDescExt (false)                     /* VRDE_USB_VERSION_3: VRDE_USB_REQ_DEVICE_LIST_EXT_RET. */
    953955{
    954956    Assert(console);
     
    10451047        LogRel(("VRDP: remote USB protocol version %d.\n", mClientVersion));
    10461048
     1049        /* VRDE_USB_VERSION_3: check the client capabilities: VRDE_USB_CLIENT_CAPS_*. */
     1050        if (mClientVersion == VRDE_USB_VERSION_3)
     1051        {
     1052            if (cbRet >= sizeof (VRDEUSBREQNEGOTIATERET_3))
     1053            {
     1054                VRDEUSBREQNEGOTIATERET_3 *pret3 = (VRDEUSBREQNEGOTIATERET_3 *)pret;
     1055
     1056                mfDescExt = (pret3->u32Flags & VRDE_USB_CLIENT_CAPS_PORT_VERSION) != 0;
     1057            }
     1058            else
     1059            {
     1060                LogRel(("VRDP: ERROR: invalid remote USB negotiate request packet size %d.\n", cbRet));
     1061                rc = VERR_NOT_SUPPORTED;
     1062            }
     1063        }
     1064
    10471065        menmPollRemoteDevicesStatus = PollRemoteDevicesStatus_SendRequest;
    10481066    }
  • trunk/src/VBox/Main/src-client/RemoteUSBDeviceImpl.cpp

    r35638 r38911  
    5555 * Initializes the remote USB device object.
    5656 */
    57 HRESULT RemoteUSBDevice::init (uint32_t u32ClientId, VRDEUSBDEVICEDESC *pDevDesc)
     57HRESULT RemoteUSBDevice::init (uint32_t u32ClientId, VRDEUSBDEVICEDESC *pDevDesc, bool fDescExt)
    5858{
    5959    LogFlowThisFunc(("u32ClientId=%d,pDevDesc=%p\n", u32ClientId, pDevDesc));
     
    7979    unconst(mData.port)         = pDevDesc->idPort;
    8080    unconst(mData.version)      = pDevDesc->bcdUSB >> 8;
    81     unconst(mData.portVersion)  = mData.version; /** @todo fix this */
     81    if (fDescExt)
     82    {
     83        VRDEUSBDEVICEDESCEXT *pDevDescExt = (VRDEUSBDEVICEDESCEXT *)pDevDesc;
     84        switch (pDevDescExt->u16DeviceSpeed)
     85        {
     86            default:
     87            case VRDE_USBDEVICESPEED_UNKNOWN:
     88            case VRDE_USBDEVICESPEED_LOW:
     89            case VRDE_USBDEVICESPEED_FULL:
     90                unconst(mData.portVersion) = 1;
     91                break;
     92
     93            case VRDE_USBDEVICESPEED_HIGH:
     94            case VRDE_USBDEVICESPEED_VARIABLE:
     95            case VRDE_USBDEVICESPEED_SUPERSPEED:
     96                unconst(mData.portVersion) = 2;
     97                break;
     98        }
     99    }
     100    else
     101    {
     102        unconst(mData.portVersion)  = mData.version;
     103    }
    82104
    83105    mData.state                  = USBDeviceState_Available;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette