VirtualBox

Changeset 49092 in vbox for trunk/src


Ignore:
Timestamp:
Oct 14, 2013 10:01:16 PM (11 years ago)
Author:
vboxsync
Message:

VUSB,EHCI,OHCI: Add a method to query whether a device is emulated or not. Required for working saved states when using the MSD device

Location:
trunk/src/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/USB/DevOHCI.cpp

    r48947 r49092  
    50035003     */
    50045004    PDMCritSectEnter(pThis->pDevInsR3->pCritSectRoR3, VERR_IGNORED);
    5005     /** @todo we a) can't tell which are proxied, and b) this won't work well when continuing after saving! */
     5005    /** @todo this won't work well when continuing after saving! */
    50065006    for (unsigned i = 0; i < RT_ELEMENTS(pRh->aPorts); i++)
    50075007    {
     
    50095009        if (pDev)
    50105010        {
    5011             VUSBIRhDetachDevice(pRh->pIRhConn, pDev);
    5012             /*
    5013              * Save the device pointers here so we can reattach them afterwards.
    5014              * This will work fine even if the save fails since the Done handler is
    5015              * called unconditionally if the Prep handler was called.
    5016              */
    5017             pRh->aPorts[i].pDev = pDev;
     5011            if (!VUSBIDevIsEmulated(pDev))
     5012            {
     5013                VUSBIRhDetachDevice(pRh->pIRhConn, pDev);
     5014                /*
     5015                 * Save the device pointers here so we can reattach them afterwards.
     5016                 * This will work fine even if the save fails since the Done handler is
     5017                 * called unconditionally if the Prep handler was called.
     5018                 */
     5019                pRh->aPorts[i].pDev = pDev;
     5020            }
     5021            else /* Reap URBs one last time to make sure the lists are empty. */
     5022                VUSBIRhReapAsyncUrbs(pEhci->RootHub.pIRhConn, 0);
    50185023        }
    50195024    }
     
    50805085    {
    50815086        PVUSBIDEVICE pDev = Rh.aPorts[i].pDev;
    5082         if (pDev)
     5087        if (   pDev
     5088            && !VUSBIDevIsEmulated(pDev))
    50835089            VUSBIRhAttachDevice(pRh->pIRhConn, pDev);
    50845090    }
     
    51185124        {
    51195125            PVUSBIDEVICE pDev = pRh->aPorts[i].pDev;
    5120             if (pDev)
     5126            if (   pDev
     5127                && !VUSBIDevIsEmulated(pDev))
    51215128            {
    51225129                Load.apDevs[Load.cDevs++] = pDev;
  • trunk/src/VBox/VMM/VMMR3/PDMUsb.cpp

    r48986 r49092  
    227227                    ("Invalid name '%.s'\n", sizeof(pReg->szName), pReg->szName),
    228228                    VERR_PDM_INVALID_USB_REGISTRATION);
    229     AssertMsgReturn((pReg->fFlags & ~(PDM_USBREG_HIGHSPEED_CAPABLE)) == 0,
     229    AssertMsgReturn((pReg->fFlags & ~(PDM_USBREG_HIGHSPEED_CAPABLE | PDM_USBREG_EMULATED_DEVICE)) == 0,
    230230                    ("fFlags=%#x\n", pReg->fFlags), VERR_PDM_INVALID_USB_REGISTRATION);
    231231    AssertMsgReturn(pReg->cMaxInstances > 0,
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