Author: janderwald
Date: Tue May 24 18:29:57 2011
New Revision: 51892
URL:
http://svn.reactos.org/svn/reactos?rev=51892&view=rev
Log:
[USBOHCI]
- Don't allocate buffer twice
- Cleanup endpoint / general transfer descriptors
Modified:
branches/usb-bringup/drivers/usb/usbohci/usb_queue.cpp
branches/usb-bringup/drivers/usb/usbohci/usb_request.cpp
Modified: branches/usb-bringup/drivers/usb/usbohci/usb_queue.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/usb/usbohci…
==============================================================================
--- branches/usb-bringup/drivers/usb/usbohci/usb_queue.cpp [iso-8859-1] (original)
+++ branches/usb-bringup/drivers/usb/usbohci/usb_queue.cpp [iso-8859-1] Tue May 24
18:29:57 2011
@@ -167,6 +167,8 @@
//
// request not supported, please try later
//
+ DPRINT1("Request Type %x not supported\n", Type);
+ ASSERT(FALSE);
return Status;
}
@@ -389,7 +391,7 @@
//
// FIXME: check if complete
//
-
+ ASSERT(Request->IsRequestComplete());
//
// release request
//
Modified: branches/usb-bringup/drivers/usb/usbohci/usb_request.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/usb/usbohci…
==============================================================================
--- branches/usb-bringup/drivers/usb/usbohci/usb_request.cpp [iso-8859-1] (original)
+++ branches/usb-bringup/drivers/usb/usbohci/usb_request.cpp [iso-8859-1] Tue May 24
18:29:57 2011
@@ -706,7 +706,7 @@
//
// now create the data descriptor
//
- Status = CreateGeneralTransferDescriptor(&DataDescriptor,
m_TransferBufferLength);
+ Status = CreateGeneralTransferDescriptor(&DataDescriptor, 0);
if (!NT_SUCCESS(Status))
{
//
@@ -924,6 +924,8 @@
CUSBRequest::CompletionCallback(
struct _OHCI_ENDPOINT_DESCRIPTOR * OutDescriptor)
{
+ POHCI_GENERAL_TD TransferDescriptor, NextTransferDescriptor;
+
DPRINT1("CUSBRequest::CompletionCallback\n");
//
@@ -937,6 +939,45 @@
//
// FIXME: cleanup descriptors
//
+
+ //
+ // get first general transfer descriptor
+ //
+ TransferDescriptor = (POHCI_GENERAL_TD)OutDescriptor->HeadLogicalDescriptor;
+
+ while(TransferDescriptor)
+ {
+ //
+ // get next
+ //
+ NextTransferDescriptor =
(POHCI_GENERAL_TD)TransferDescriptor->NextLogicalDescriptor;
+
+ //
+ // is there a buffer associated
+ //
+ if (TransferDescriptor->BufferSize)
+ {
+ //
+ // release buffer
+ //
+ m_DmaManager->Release(TransferDescriptor->BufferLogical,
TransferDescriptor->BufferSize);
+ }
+
+ //
+ // release descriptor
+ //
+ m_DmaManager->Release(TransferDescriptor, sizeof(OHCI_GENERAL_TD));
+
+ //
+ // move to next
+ //
+ TransferDescriptor = NextTransferDescriptor;
+ }
+
+ //
+ // release endpoint descriptor
+ //
+ m_DmaManager->Release(OutDescriptor, sizeof(OHCI_ENDPOINT_DESCRIPTOR));
//
// signal completion event