From 5b03912b5f9783e9652ba9925f44e901af8e24e6 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Mon, 19 May 2008 20:41:58 +0000 Subject: [PATCH] * Correct removal of failed transfers by applying the address mask. As the head pointer also contains the toggle carry and the halt bit (which was obviously always set as the endpoint had an error) the address comparison failed and the head was dead in the water with all further transfers timing out until a subsequet cancel cleaned the mess up again. * Add the OHCI host controller driver to the image as it should now be fully functional except for isochronous transfers. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25565 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- build/jam/HaikuImage | 2 +- src/add-ons/kernel/busses/usb/ohci.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/build/jam/HaikuImage b/build/jam/HaikuImage index 95dc0d3adc..250d582e3b 100644 --- a/build/jam/HaikuImage +++ b/build/jam/HaikuImage @@ -149,7 +149,7 @@ AddFilesToHaikuImage beos system add-ons kernel busses ide AddFilesToHaikuImage beos system add-ons kernel busses scsi : ahci ; AddFilesToHaikuImage beos system add-ons kernel busses usb - : uhci ehci ; + : uhci ohci ehci ; AddFilesToHaikuImage beos system add-ons kernel console : vga_text ; AddFilesToHaikuImage beos system add-ons kernel debugger : hangman invalidate_on_exit ; diff --git a/src/add-ons/kernel/busses/usb/ohci.cpp b/src/add-ons/kernel/busses/usb/ohci.cpp index e079799a0e..b043a7f572 100644 --- a/src/add-ons/kernel/busses/usb/ohci.cpp +++ b/src/add-ons/kernel/busses/usb/ohci.cpp @@ -992,7 +992,8 @@ OHCI::_FinishTransfers() // break the descriptor chain on the last descriptor transfer->last_descriptor->next_logical_descriptor = NULL; - TRACE(("usb_ohci: transfer %p done\n", transfer)); + TRACE(("usb_ohci: transfer %p done with status 0x%08lx\n", + transfer, callbackStatus)); // if canceled the callback has already been called if (!transfer->canceled) { @@ -1240,7 +1241,8 @@ OHCI::_RemoveTransferFromEndpoint(transfer_data *transfer) ohci_endpoint_descriptor *endpoint = transfer->endpoint; ohci_general_td *descriptor = transfer->first_descriptor; while (descriptor) { - if (endpoint->head_physical_descriptor == descriptor->physical_address) { + if ((endpoint->head_physical_descriptor & OHCI_ENDPOINT_HEAD_MASK) + == descriptor->physical_address) { // This descriptor caused the halt. Advance the head pointer. This // will either move the head to the next valid transfer that can // then be restarted, or it will move the head to the tail when