* Simplify the way fragmented transfers are resubmited.

* This also paves the way for a different way to handle transfer freeing.
* Also fixes that errors in reappending would previously not be propagated to
  the caller.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30712 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2009-05-11 23:37:30 +00:00
parent 60a3c33b87
commit 9bc8951dc9

View File

@ -1361,31 +1361,20 @@ UHCI::FinishTransfers()
TRACE("still %ld bytes left on transfer\n",
transfer->transfer->VectorLength());
Transfer *resubmit = transfer->transfer;
// free the used descriptors
transfer->queue->RemoveTransfer(transfer->transfer_queue);
FreeDescriptorChain(transfer->first_descriptor);
// resubmit the advanced transfer so the rest
// of the buffers are transmitted over the bus
transfer->transfer->PrepareKernelAccess();
status_t result = CreateFilledTransfer(transfer->transfer,
&transfer->first_descriptor,
&transfer->transfer_queue);
transfer->data_descriptor = transfer->first_descriptor;
if (result == B_OK && Lock()) {
// reappend the transfer
if (fLastTransfer)
fLastTransfer->link = transfer;
if (!fFirstTransfer)
fFirstTransfer = transfer;
resubmit->PrepareKernelAccess();
if (SubmitTransfer(resubmit) != B_OK)
resubmit->Finished(B_ERROR, 0);
fLastTransfer = transfer;
Unlock();
transfer->queue->AppendTransfer(transfer->transfer_queue);
transfer = next;
continue;
}
transfer = next;
continue;
}
// the transfer is done, but we already set the