third_party/virtualbox/src/VBox/Devices/USB/VUSBUrb.cpp
/**
 * Cancels an URB with CRC failure.
 *
 * Cancelling an URB is a tricky thing. The USBProxy backend can not
 * all cancel it and we must keep the URB around until it's ripe and
 * can be reaped the normal way. However, we must complete the URB
 * now, before leaving this function. This is not nice. sigh.
 *
 * This function will cancel the URB if it's in-flight and complete
 * it. The device will in its pfnCancel method be given the chance to
 * say that the URB doesn't need reaping and should be unlinked.
 *
 * An URB which is in the cancel state after pfnCancel will remain in that
 * state and in the async list until its reaped. When it's finally reaped
 * it will be unlinked and freed without doing any completion.
 *
 * There are different modes of canceling an URB. When devices are being
 * disconnected etc., they will be completed with an error (CRC). However,
 * when the HC needs to temporarily halt communication with a device, the
 * URB/TD must be left alone if possible.
 *
 * @param   pUrb        The URB to cancel.
 * @param   mode        The way the URB should be canceled.
 */
Cancels an URB with CRC failure.
Cancelling an URB is a tricky thing. The USBProxy backend can not
all cancel it and we must keep the URB around until it's ripe and
can be reaped the normal way. However, we must complete the URB
now, before leaving this function. This is not nice. sigh.

This function will cancel the URB if it's in-flight and complete
it. The device will in its pfnCancel method be given the chance to
say that the URB doesn't need reaping and should be unlinked.

An URB which is in the cancel state after pfnCancel will remain in that
state and in the async list until its reaped. When it's finally reaped
it will be unlinked and freed without doing any completion.

There are different modes of canceling an URB. When devices are being
disconnected etc., they will be completed with an error (CRC). However,
when the HC needs to temporarily halt communication with a device, the
URB/TD must be left alone if possible.

@param   pUrb        The URB to cancel.
@param   mode        The way the URB should be canceled.
Cancels an URB with CRC failure . Cancelling an URB is a tricky thing . The USBProxy backend can not all cancel it and we must keep the URB around until it ' s ripe and can be reaped the normal way . However we must complete the URB now before leaving this function . This is not nice . sigh . This function will cancel the URB if it ' s in - flight and complete it . The device will in its pfnCancel method be given the chance to say that the URB doesn ' t need reaping and should be unlinked . An URB which is in the cancel state after pfnCancel will remain in that state and in the async list until its reaped . When it ' s finally reaped it will be unlinked and freed without doing any completion . There are different modes of canceling an URB . When devices are being disconnected etc . they will be completed with an error ( CRC ) . However when the HC needs to temporarily halt communication with a device the URB / TD must be left alone if possible . @param pUrb The URB to cancel . @param mode The way the URB should be canceled .
void vusbUrbCancel(PVUSBURB pUrb, CANCELMODE mode)
{
    int rc = vusbDevIoThreadExecSync(pUrb->pVUsb->pDev, (PFNRT)vusbUrbCancelWorker, 2, pUrb, mode);
    AssertRC(rc);
}
void vusbUrbCancel ( PVUSBURB pUrb , CANCELMODE mode ) { int rc = vusbDevIoThreadExecSync ( pUrb -> pVUsb -> pDev , ( PFNRT ) vusbUrbCancelWorker , 2 , pUrb , mode ) ; AssertRC ( rc ) ; }
Cancels an URB with CRC failure.
Cancels an URB with CRC failure .