Author: janderwald
Date: Wed Feb  8 01:10:36 2012
New Revision: 55491

URL: http://svn.reactos.org/svn/reactos?rev=55491&view=rev
Log:
[USBEHCI]
- Fix a few bulk transfer bugs
- Enable interrupt completion on last interrupt 
- Increment transferred offset 
- Mass storage device now gets further (passing SRB_FUNCTION_CLAIM_DEVICE)

Modified:
    branches/usb-bringup-trunk/drivers/usb/usbehci_new/usb_request.cpp

Modified: branches/usb-bringup-trunk/drivers/usb/usbehci_new/usb_request.cpp
URL: 
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/usbehci_new/usb_request.cpp?rev=55491&r1=55490&r2=55491&view=diff
==============================================================================
--- branches/usb-bringup-trunk/drivers/usb/usbehci_new/usb_request.cpp 
[iso-8859-1] (original)
+++ branches/usb-bringup-trunk/drivers/usb/usbehci_new/usb_request.cpp 
[iso-8859-1] Wed Feb  8 01:10:36 2012
@@ -594,6 +594,7 @@
         // initialized with setup packet, must be a control transfer
         //
         TransferType = USB_ENDPOINT_TYPE_CONTROL;
+        ASSERT(m_EndpointDescriptor == FALSE);
     }
 
     //
@@ -1048,7 +1049,7 @@
     PQUEUE_HEAD QueueHead;
     PVOID Base;
     ULONG ChainDescriptorLength;
-    PQUEUE_TRANSFER_DESCRIPTOR FirstDescriptor;
+    PQUEUE_TRANSFER_DESCRIPTOR FirstDescriptor, LastDescriptor;
 
     //
     // Allocate the queue head
@@ -1096,7 +1097,7 @@
                                           InternalGetPidDirection(),
                                           m_EndpointDescriptor->DataToggle,
                                           &FirstDescriptor,
-                                          NULL,
+                                          &LastDescriptor,
                                           &m_EndpointDescriptor->DataToggle,
                                           &ChainDescriptorLength);
 
@@ -1104,6 +1105,13 @@
     // FIXME: handle errors
     //
     ASSERT(ChainDescriptorLength == m_TransferBufferLength);
+
+    //
+    // move to next offset
+    //
+    m_TransferBufferLengthCompleted += ChainDescriptorLength;
+
+
     ASSERT(Status == STATUS_SUCCESS);
 
     //
@@ -1114,10 +1122,27 @@
     QueueHead->EndPointCharacteristics.MaximumPacketLength = 
m_EndpointDescriptor->EndPointDescriptor.wMaxPacketSize;
     QueueHead->NextPointer = FirstDescriptor->PhysicalAddr;
 
+
+    ASSERT(QueueHead->EndPointCharacteristics.DeviceAddress);
+    ASSERT(QueueHead->EndPointCharacteristics.EndPointNumber);
+    ASSERT(QueueHead->EndPointCharacteristics.MaximumPacketLength);
+    ASSERT(QueueHead->NextPointer);
+
+    //
+    // interrupt on last descriptor
+    //
+    LastDescriptor->Token.Bits.InterruptOnComplete = TRUE;
+
     //
     // store result
     //
     *OutHead = QueueHead;
+
+    //
+    // dump status
+    //
+    //DPRINT1("bEndpoint %x\n", 
m_EndpointDescriptor->EndPointDescriptor.bEndpointAddress);
+    //DumpQueueHead(QueueHead);
 
     //
     // done


Reply via email to