Author: janderwald
Date: Sun Jan 29 17:30:31 2012
New Revision: 55293
URL:
http://svn.reactos.org/svn/reactos?rev=55293&view=rev
Log:
[USBEHCI]
- Update async address everytime a new queue head is added as specified in EHCI spec
section 3.2
- Add more checks
- Vmware EHCI not yet working
Modified:
branches/usb-bringup-trunk/drivers/usb/usbehci_new/interfaces.h
branches/usb-bringup-trunk/drivers/usb/usbehci_new/usb_queue.cpp
branches/usb-bringup-trunk/drivers/usb/usbehci_new/usb_request.cpp
Modified: branches/usb-bringup-trunk/drivers/usb/usbehci_new/interfaces.h
URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
==============================================================================
--- branches/usb-bringup-trunk/drivers/usb/usbehci_new/interfaces.h [iso-8859-1]
(original)
+++ branches/usb-bringup-trunk/drivers/usb/usbehci_new/interfaces.h [iso-8859-1] Sun Jan
29 17:30:31 2012
@@ -301,6 +301,15 @@
// Description: releases the device lock
virtual void ReleaseDeviceLock(KIRQL OldLevel) = 0;
+
+ // set command
+ virtual void SetCommandRegister(struct _EHCI_USBCMD_CONTENT *UsbCmd) = 0;
+
+ // get command
+ virtual void GetCommandRegister(struct _EHCI_USBCMD_CONTENT *UsbCmd) = 0;
+
+
+
};
typedef IUSBHardwareDevice *PUSBHARDWAREDEVICE;
Modified: branches/usb-bringup-trunk/drivers/usb/usbehci_new/usb_queue.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
==============================================================================
--- branches/usb-bringup-trunk/drivers/usb/usbehci_new/usb_queue.cpp [iso-8859-1]
(original)
+++ branches/usb-bringup-trunk/drivers/usb/usbehci_new/usb_queue.cpp [iso-8859-1] Sun Jan
29 17:30:31 2012
@@ -141,6 +141,11 @@
//
Status = InitializeSyncSchedule(Hardware, MemManager);
+ //
+ // store hardware object
+ //
+ m_Hardware = Hardware;
+
return Status;
}
@@ -358,6 +363,13 @@
KeAcquireSpinLock(m_Lock, &OldLevel);
LinkQueueHead(AsyncListQueueHead, QueueHead);
KeReleaseSpinLock(m_Lock, OldLevel);
+
+ EHCI_USBCMD_CONTENT UsbCmd;
+ m_Hardware->GetCommandRegister(&UsbCmd);
+ ASSERT(UsbCmd.AsyncEnable == TRUE);
+
+ m_Hardware->SetAsyncListRegister(QueueHead->PhysicalAddr);
+
}
@@ -419,6 +431,7 @@
//
// Link the LIST_ENTRYs
//
+ ASSERT(IsListEmpty(&HeadQueueHead->LinkedQueueHeads));
InsertTailList(&HeadQueueHead->LinkedQueueHeads,
&NewQueueHead->LinkedQueueHeads);
//
@@ -426,6 +439,7 @@
//
Entry = NewQueueHead->LinkedQueueHeads.Blink;
LastQueueHead = CONTAINING_RECORD(Entry, QUEUE_HEAD, LinkedQueueHeads);
+ ASSERT(LastQueueHead == HeadQueueHead);
LastQueueHead->HorizontalLinkPointer = (NewQueueHead->PhysicalAddr |
QH_TYPE_QH);
//
@@ -435,6 +449,11 @@
NextQueueHead = CONTAINING_RECORD(Entry, QUEUE_HEAD, LinkedQueueHeads);
ASSERT(NextQueueHead == HeadQueueHead);
NewQueueHead->HorizontalLinkPointer = (NextQueueHead->PhysicalAddr |
QH_TYPE_QH);
+
+ //
+ // head queue head must be halted
+ //
+ PC_ASSERT(HeadQueueHead->Token.Bits.Halted == TRUE);
}
//
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/u…
==============================================================================
--- 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] Sun
Jan 29 17:30:31 2012
@@ -767,7 +767,14 @@
// link transfer descriptors to queue head
//
QueueHead->NextPointer = m_TransferDescriptors[0]->PhysicalAddr;
-
+/*
+ if (m_TransferBufferMDL)
+ QueueHead->AlternateNextPointer = m_TransferDescriptors[2]->PhysicalAddr;
+ else
+ QueueHead->AlternateNextPointer = m_TransferDescriptors[1]->PhysicalAddr;
+
+ QueueHead->EndPointCapabilities.InterruptScheduleMask = 0x0;
+*/
//
// store result
//