~ubuntu-branches/ubuntu/vivid/virtualbox/vivid

« back to all changes in this revision

Viewing changes to src/VBox/Main/src-client/RemoteUSBDeviceImpl.cpp

  • Committer: Package Import Robot
  • Author(s): Felix Geyer
  • Date: 2011-12-29 12:29:25 UTC
  • mfrom: (3.1.8 sid)
  • Revision ID: package-import@ubuntu.com-20111229122925-8ota2o33fuk0bkf8
Tags: 4.1.8-dfsg-1
* New upstream release.
* Move all transitional packages to section oldlibs and priority extra.
* Refresh 16-no-update.patch.
* Drop 36-kernel-3.2.patch, applied upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
/**
55
55
 * Initializes the remote USB device object.
56
56
 */
57
 
HRESULT RemoteUSBDevice::init (uint32_t u32ClientId, VRDEUSBDEVICEDESC *pDevDesc)
 
57
HRESULT RemoteUSBDevice::init (uint32_t u32ClientId, VRDEUSBDEVICEDESC *pDevDesc, bool fDescExt)
58
58
{
59
59
    LogFlowThisFunc(("u32ClientId=%d,pDevDesc=%p\n", u32ClientId, pDevDesc));
60
60
 
78
78
 
79
79
    unconst(mData.port)         = pDevDesc->idPort;
80
80
    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
    }
82
104
 
83
105
    mData.state                  = USBDeviceState_Available;
84
106