VirtualBox

Changeset 86491 in vbox for trunk


Ignore:
Timestamp:
Oct 8, 2020 10:09:52 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
140802
Message:

USB: Mask out USB remote wake capability by default to avoid devices going unresponsive (see bugref:9839).

File:
1 edited

Legend:

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

    r82968 r86491  
    10821082        AssertRCReturn(rc, rc);
    10831083
     1084    bool fEditRemoteWake;
     1085    rc = CFGMR3QueryBool(pCfg, "EditRemoteWake", &fEditRemoteWake);
     1086    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
     1087        rc = CFGMR3QueryBool(pCfgGlobalDev, "EditRemoteWake", &fEditRemoteWake);
     1088    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
     1089        fEditRemoteWake = true;    /* NB: On by default! */
     1090    else
     1091        AssertRCReturn(rc, rc);
     1092
    10841093    /*
    10851094     * If we're masking interfaces, edit the descriptors.
     
    11811190                    }
    11821191                }
     1192        }
     1193    }
     1194
     1195    /*
     1196     * Disable remote wakeup capability, see @bugref{9839}. This is done on
     1197     * a device/configuration level, no need to dig too deep through the descriptors.
     1198     * On most backends, we can't perform a real selective suspend, and more importantly
     1199     * can't receive a remote wake notification. If a guest suspends the device and waits
     1200     * for a remote wake, the device is effectively dead.
     1201     */
     1202    if (fEditRemoteWake)
     1203    {
     1204        PVUSBDESCCONFIGEX paCfgs = pThis->paCfgDescs;
     1205        for (unsigned iCfg = 0; iCfg < pThis->DevDesc.bNumConfigurations; iCfg++)
     1206        {
     1207            Log(("usb-proxy: pProxyDev=%s configuration %d with bmAttr=%02X\n",
     1208                 pUsbIns->pszName, paCfgs[iCfg].Core.bmAttributes, iCfg));
     1209                 paCfgs[iCfg].Core.bmAttributes = paCfgs[iCfg].Core.bmAttributes & ~RT_BIT(5); /* Remote wakeup. */
     1210            fEdited = true;
     1211            LogRel(("VUSB: Disabled '%s' remote wakeup for configuration %d\n", pUsbIns->pszName, iCfg));
    11831212        }
    11841213    }
Note: See TracChangeset for help on using the changeset viewer.

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