genode/repos/ports/src/virtualbox/patches/usb.patch
Josef Söntgen 71b621775b vbox: remove USB (OHCI) pass-through support
The usage of the USBProxyDevice is no longer necessary because USB
pass-through is now supported by using the xHCI device model.

Issue #1863.
2016-02-05 10:47:44 +01:00

163 lines
6.5 KiB
Diff

usb.patch
diff --git a/src/app/virtualbox/src/VBox/Devices/USB/USBProxyDevice.cpp b/src/app/virtualbox/src/VBox/Devices/USB/USBProxyDevice.cpp
index a51bc36..bed42e8 100644
--- a/src/app/virtualbox/src/VBox/Devices/USB/USBProxyDevice.cpp
+++ b/src/app/virtualbox/src/VBox/Devices/USB/USBProxyDevice.cpp
@@ -843,10 +843,14 @@ static DECLCALLBACK(int) usbProxyConstruct(PPDMUSBINS pUsbIns, int iInstance, PC
/*
* Select backend and open the device.
*/
+
+ return PDMUSB_SET_ERROR(pUsbIns, VERR_NOT_SUPPORTED, N_("USBProxy: not supported on Genode"));
+#if 0
if (!fRemote)
pThis->pOps = &g_USBProxyDeviceHost;
else
pThis->pOps = &g_USBProxyDeviceVRDP;
+#endif /* if 0 */
pThis->pvInstanceDataR3 = RTMemAllocZ(pThis->pOps->cbBackend);
if (!pThis->pvInstanceDataR3)
diff --git a/src/app/virtualbox/src/VBox/Devices/USB/VUSBDevice.cpp b/src/app/virtualbox/src/VBox/Devices/USB/VUSBDevice.cpp
index 4790fcb..d649ad6 100644
--- a/src/app/virtualbox/src/VBox/Devices/USB/VUSBDevice.cpp
+++ b/src/app/virtualbox/src/VBox/Devices/USB/VUSBDevice.cpp
@@ -230,7 +230,14 @@ bool vusbDevDoSelectConfig(PVUSBDEV pDev, PCVUSBDESCCONFIGEX pCfgDesc)
if (i != VUSB_PIPE_DEFAULT)
{
vusbMsgFreeExtraData(pDev->aPipes[i].pCtrl);
+
+ int rc = RTCritSectDelete(&pDev->aPipes[i].CritSectCtrl);
+ AssertRC(rc);
+
memset(&pDev->aPipes[i], 0, sizeof(pDev->aPipes[i]));
+
+ rc = RTCritSectInit(&pDev->aPipes[i].CritSectCtrl);
+ AssertRC(rc);
}
}
memset(pDev->paIfStates, 0, pCfgDesc->Core.bNumInterfaces * sizeof(pDev->paIfStates[0]));
@@ -1089,8 +1096,10 @@ static DECLCALLBACK(int) vusbDevCancelAllUrbsWorker(PVUSBDEV pDev, bool fDetachi
PVUSBURB pNext = pUrb->VUsb.pNext;
Assert(pUrb->VUsb.pDev == pDev);
+#if 0
AssertMsgFailed(("%s: Leaking left over URB! state=%d pDev=%p[%s]\n",
pUrb->pszDesc, pUrb->enmState, pDev, pDev->pUsbIns->pszName));
+#endif
vusbUrbUnlink(pUrb);
/* Unlink isn't enough, because boundary timer and detaching will try to reap it.
* It was tested with MSD & iphone attachment to vSMP guest, if
@@ -1134,7 +1143,7 @@ static DECLCALLBACK(int) vusbDevUrbIoThread(RTTHREAD hThread, void *pvUser)
vusbUrbDoReapAsyncDev(pDev, RT_INDEFINITE_WAIT);
/* Process any URBs waiting to be cancelled first. */
- int rc = RTReqQueueProcess(pDev->hReqQueueSync, 0); /* Don't wait if there is nothing to do. */
+ int rc = RTReqQueueProcess(pDev->hReqQueueSync, pDev->enmState == VUSB_DEVICE_STATE_RESET ? 5 : 0); /* if in reset state (takes 10ms) sleep a bit - otherwise this thread consumes in this loop a lot of cpu time */
Assert(RT_SUCCESS(rc) || rc == VERR_TIMEOUT);
}
diff --git a/src/app/virtualbox/src/VBox/Devices/build/VBoxDD.cpp b/src/app/virtualbox/src/VBox/Devices/build/VBoxDD.cpp
index 3173a36..8105987 100644
--- a/src/app/virtualbox/src/VBox/Devices/build/VBoxDD.cpp
+++ b/src/app/virtualbox/src/VBox/Devices/build/VBoxDD.cpp
@@ -39,6 +39,7 @@ const void *g_apvVBoxDDDependencies[] =
NULL,
};
+#if 0
/**
* Register builtin devices.
@@ -329,6 +330,7 @@ extern "C" DECLEXPORT(int) VBoxDriversRegister(PCPDMDRVREGCB pCallbacks, uint32_
return VINF_SUCCESS;
}
+#endif /* if 0 */
/**
* Register builtin USB device.
diff --git a/src/app/virtualbox/src/VBox/Main/include/Matching.h b/src/app/virtualbox/src/VBox/Main/include/Matching.h
index 2f01f69..9b13e37 100644
--- a/src/app/virtualbox/src/VBox/Main/include/Matching.h
+++ b/src/app/virtualbox/src/VBox/Main/include/Matching.h
@@ -291,10 +291,12 @@ public:
return mValueAny || mValue == aValue;
}
+#if 0
bool isMatch (const BOOL aValue) const
{
return isMatch (bool (aValue == TRUE));
}
+#endif /* if 0 */
private:
diff --git a/src/app/virtualbox/src/VBox/Main/src-server/MachineImpl.cpp b/src/app/virtualbox/src/VBox/Main/src-server/MachineImpl.cpp
index 3889a01..7ae9d1c 100644
--- a/src/app/virtualbox/src/VBox/Main/src-server/MachineImpl.cpp
+++ b/src/app/virtualbox/src/VBox/Main/src-server/MachineImpl.cpp
@@ -13571,6 +13582,7 @@ STDMETHODIMP SessionMachine::AutoCaptureUSBDevices()
AutoCaller autoCaller(this);
AssertComRCReturn(autoCaller.rc(), autoCaller.rc());
+#if 0
#ifdef VBOX_WITH_USB
HRESULT rc = mUSBDeviceFilters->notifyProxy(true /* aInsertFilters */);
AssertComRC(rc);
@@ -13579,6 +13591,7 @@ STDMETHODIMP SessionMachine::AutoCaptureUSBDevices()
USBProxyService *service = mParent->host()->usbProxyService();
AssertReturn(service, E_FAIL);
return service->autoCaptureDevicesForVM(this);
+#endif /* if 0 */
#else
return S_OK;
#endif
@@ -13614,6 +13614,7 @@
AutoCaller autoCaller(this);
AssertComRCReturn(autoCaller.rc(), autoCaller.rc());
+#if 0
#ifdef VBOX_WITH_USB
HRESULT rc = mUSBDeviceFilters->notifyProxy(false /* aInsertFilters */);
AssertComRC(rc);
@@ -13622,6 +13623,7 @@
USBProxyService *service = mParent->host()->usbProxyService();
AssertReturn(service, E_FAIL);
return service->detachAllDevicesFromVM(this, !!aDone, false /* aAbnormal */);
+#endif /* if 0 */
#else
NOREF(aDone);
return S_OK;
diff --git a/src/app/virtualbox/src/VBox/Main/src-server/USBDeviceFiltersImpl.cpp b/src/app/virtualbox/src/VBox/Main/src-server/USBDeviceFiltersImpl.cpp
index 09b42f5..c179ca6 100644
--- a/src/app/virtualbox/src/VBox/Main/src-server/USBDeviceFiltersImpl.cpp
+++ b/src/app/virtualbox/src/VBox/Main/src-server/USBDeviceFiltersImpl.cpp
@@ -1037,13 +1037,10 @@ HRESULT USBDeviceFilters::notifyProxy(bool aInsertFilters)
LogFlowThisFunc(("aInsertFilters=%RTbool\n", aInsertFilters));
AutoCaller autoCaller(this);
- AssertComRCReturn(autoCaller.rc(), false);
+ AssertComRCReturnRC(autoCaller.rc());
AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
- USBProxyService *pProxySvc = m->pHost->usbProxyService();
- AssertReturn(pProxySvc, E_FAIL);
-
DeviceFilterList::const_iterator it = m->llDeviceFilters->begin();
while (it != m->llDeviceFilters->end())
{
@@ -1054,6 +1051,9 @@ HRESULT USBDeviceFilters::notifyProxy(bool aInsertFilters)
&& pFilter->getData().mRemote.isMatch(false) /* and if the filter is NOT remote */
)
{
+ USBProxyService *pProxySvc = m->pHost->usbProxyService();
+ AssertReturn(pProxySvc, E_FAIL);
+
if (aInsertFilters)
{
AssertReturn(pFilter->getId() == NULL, E_FAIL);