Author: janderwald
Date: Thu Feb 23 05:07:07 2012
New Revision: 55831
URL:
http://svn.reactos.org/svn/reactos?rev=55831&view=rev
Log:
[USBUHCI]
- Remove left-over assert
- Remove dead code
- Enable port after reset
Modified:
trunk/reactos/drivers/usb/usbuhci/hardware.cpp
trunk/reactos/drivers/usb/usbuhci/usb_request.cpp
Modified: trunk/reactos/drivers/usb/usbuhci/hardware.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbuhci/hardwa…
==============================================================================
--- trunk/reactos/drivers/usb/usbuhci/hardware.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/usb/usbuhci/hardware.cpp [iso-8859-1] Thu Feb 23 05:07:07 2012
@@ -647,7 +647,6 @@
Value = 0;
BusInterface.GetBusData(BusInterface.Context, PCI_WHICHSPACE_CONFIG, &Value,
0x60, sizeof(UCHAR));
DPRINT1("[USBUHCI] SBRN %x\n", Value);
- ASSERT(FALSE);
//
// perform global reset
@@ -925,15 +924,6 @@
//
Status = ReadRegister16(Port);
- //
- // Before port reset, disable the port
- //
- WriteRegister16(Port, ReadRegister16(Port) & ~UHCI_PORTSC_ENABLED);
- while(ReadRegister16(Port) & UHCI_PORTSC_ENABLED)
- {
- DPRINT1("Port %x Status %x\n", PortIndex, ReadRegister16(Port));
- KeStallExecutionProcessor(5);
- }
//
@@ -949,7 +939,7 @@
//
// now wait a bit
//
- KeStallExecutionProcessor(50);
+ KeStallExecutionProcessor(250);
//
// re-read status
@@ -966,10 +956,6 @@
//
WriteRegister16(Port, (Status & ~UHCI_PORTSC_RESET));
- //
- // set enabled bit
- //
- WriteRegister16(Port, ReadRegister16(Port) | UHCI_PORTSC_ENABLED);
//
// now wait a bit
@@ -978,20 +964,14 @@
for (Index = 0; Index < 10; Index++)
{
- //
// read port status
- //
Status = ReadRegister16(Port);
- //
// remove unwanted bits
- //
Status &= UHCI_PORTSC_DATAMASK;
- //
// enable port
- //
- WriteRegister16(Port, Status);
+ WriteRegister16(Port, Status | UHCI_PORTSC_ENABLED);
//
// wait a bit
@@ -1029,16 +1009,6 @@
m_PortResetChange |= (1 << PortIndex);
DPRINT1("[USBUhci] Port Index %x Status after reset %x\n", PortIndex,
ReadRegister16(Port));
-#if 0
- if (Status & UHCI_PORTSC_CURSTAT)
- {
- //
- // queue work item
- //
- DPRINT1("Queueing work item\n");
- ExQueueWorkItem(&m_StatusChangeWorkItem, DelayedWorkQueue);
- }
-#endif
return STATUS_SUCCESS;
}
Modified: trunk/reactos/drivers/usb/usbuhci/usb_request.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbuhci/usb_re…
==============================================================================
--- trunk/reactos/drivers/usb/usbuhci/usb_request.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/usb/usbuhci/usb_request.cpp [iso-8859-1] Thu Feb 23 05:07:07
2012
@@ -845,7 +845,30 @@
//
// FIXME FIXME FIXME FIXME FIXME
//
- MaxPacketSize = 1280;
+ if (GetDeviceSpeed() == UsbLowSpeed)
+ {
+ //
+ // low speed use max 8 bytes
+ //
+ MaxPacketSize = 8;
+ }
+ else
+ {
+ if (m_EndpointDescriptor)
+ {
+ //
+ // use endpoint size
+ //
+ MaxPacketSize = m_EndpointDescriptor->EndPointDescriptor.wMaxPacketSize;
+ }
+ else
+ {
+ //
+ // use max 64 bytes
+ //
+ MaxPacketSize = 64;
+ }
+ }
do
{