| | 3524 | /* |
| | 3525 | * Test every URB in flight to ensure it hasn't been cancelled |
| | 3526 | * |
| | 3527 | * When the guest OS cancels a USB request we must ensure that it is removed from the USB |
| | 3528 | * proxy subsystem immediately. If this isn't done, the guest OS may submit a new request |
| | 3529 | * while the USB proxy system doesn't realize the old one is canceled. The old URB will receive |
| | 3530 | * the data for the new request, be subsequently discarded, and the guest USB device driver will |
| | 3531 | * timeout and fail. |
| | 3532 | */ |
| | 3533 | static int ohciPerformCancellations(POHCI pOhci) |
| | 3534 | { |
| | 3535 | unsigned i, cLeft = pOhci->cInFlight; |
| | 3536 | PVUSBURB pUrb; |
| | 3537 | for (i = 0; cLeft && i < RT_ELEMENTS(pOhci->aInFlight); i++) |
| | 3538 | if (pOhci->aInFlight[i].GCPhysTD) { |
| | 3539 | pUrb = pOhci->aInFlight[i].pUrb; |
| | 3540 | if (ohciHasUrbBeenCanceled(pOhci, pUrb, NULL)) |
| | 3541 | pOhci->RootHub.pIRhConn->pfnCancelUrbsEp(pOhci->RootHub.pIRhConn, pUrb); |
| | 3542 | cLeft--; |
| | 3543 | } |
| | 3544 | } |