VirtualBox

Changeset 43814 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Nov 6, 2012 4:59:33 PM (12 years ago)
Author:
vboxsync
Message:

PDMUSB: Support attaching virtual USB devices to EHCI.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/PDMUsb.cpp

    r42139 r43814  
    226226                    ("Invalid name '%.s'\n", sizeof(pReg->szName), pReg->szName),
    227227                    VERR_PDM_INVALID_USB_REGISTRATION);
    228     AssertMsgReturn(pReg->fFlags == 0, ("fFlags=%#x\n", pReg->fFlags), VERR_PDM_INVALID_USB_REGISTRATION);
     228    AssertMsgReturn((pReg->fFlags & ~(PDM_USBREG_HIGHSPEED_CAPABLE)) == 0,
     229                    ("fFlags=%#x\n", pReg->fFlags), VERR_PDM_INVALID_USB_REGISTRATION);
    229230    AssertMsgReturn(pReg->cMaxInstances > 0,
    230231                    ("Max instances %u! (USB Device %s)\n", pReg->cMaxInstances, pReg->szName),
     
    579580    //pUsbIns->fTracing                       = 0;
    580581    pUsbIns->idTracing                      = ++pVM->pdm.s.idTracingOther;
     582    pUsbIns->iUsbHubVersion                 = iUsbVersion;
    581583
    582584    /*
     
    800802        CFGMR3SetRestrictedRoot(pConfigNode);
    801803
    802         /** @todo
    803          * Figure out the USB version from the USB device registration and the configuration.
     804        /*
     805         * Every device must support USB 1.x hubs; optionally, high-speed USB 2.0 hubs
     806         * might be also supported. This determines where to attach the device.
    804807         */
    805808        uint32_t iUsbVersion = VUSB_STDVER_11;
    806809
     810        if (paUsbDevs[i].pUsbDev->pReg->fFlags & PDM_USBREG_HIGHSPEED_CAPABLE)
     811            iUsbVersion |= VUSB_STDVER_20;
     812       
    807813        /*
    808814         * Find a suitable hub with free ports.
     
    815821            return rc;
    816822        }
     823
     824        /*
     825         * This is how we inform the device what speed it's communicating at, and hence
     826         * which descriptors it should present to the guest.
     827         */
     828        iUsbVersion &= pHub->fVersions;
    817829
    818830        /*
     
    904916
    905917    /*
    906      * Finally, try create it.
     918     * Finally, try to create it.
    907919     */
    908920    rc = pdmR3UsbCreateDevice(pVM, pHub, pUsbDev, -1, pUuid, NULL, &pConfig, iUsbVersion);
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