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:
parent
633a699447
commit
40fd232817
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user