implemented CancelQueuedTransfers for uhci

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21057 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2007-05-07 14:08:30 +00:00
parent 633a699447
commit 40fd232817
2 changed files with 40 additions and 0 deletions

View File

@ -538,6 +538,45 @@ UHCI::SubmitTransfer(Transfer *transfer)
}
status_t
UHCI::CancelQueuedTransfers(Pipe *pipe)
{
if (!Lock())
return B_ERROR;
transfer_data *last = NULL;
transfer_data *current = fFirstTransfer;
while (current) {
if (current->transfer->TransferPipe() == pipe) {
current->queue->RemoveTransfer(current->transfer_queue);
FreeDescriptorChain(current->first_descriptor);
FreeTransferQueue(current->transfer_queue);
current->transfer->Finished(B_CANCELED, 0);
delete current->transfer;
transfer_data *next = current->link;
if (last)
last->link = next;
else
fFirstTransfer = next;
if (fLastTransfer == current)
fLastTransfer = last;
delete current;
current = next;
} else {
last = current;
current = current->link;
}
}
Unlock();
return B_OK;
}
status_t
UHCI::SubmitRequest(Transfer *transfer)
{

View File

@ -68,6 +68,7 @@ public:
status_t Start();
virtual status_t SubmitTransfer(Transfer *transfer);
virtual status_t CancelQueuedTransfers(Pipe *pipe);
status_t SubmitRequest(Transfer *transfer);
static status_t AddTo(Stack *stack);