[USBUHCI]

- Remove left-over assert
- Remove dead code
- Enable port after reset

svn path=/trunk/; revision=55831
This commit is contained in:
Johannes Anderwald 2012-02-23 05:07:07 +00:00
parent 36bbd6f1a1
commit 62517e4042
2 changed files with 26 additions and 33 deletions

View file

@ -647,7 +647,6 @@ CUSBHardwareDevice::InitializeController()
Value = 0; Value = 0;
BusInterface.GetBusData(BusInterface.Context, PCI_WHICHSPACE_CONFIG, &Value, 0x60, sizeof(UCHAR)); BusInterface.GetBusData(BusInterface.Context, PCI_WHICHSPACE_CONFIG, &Value, 0x60, sizeof(UCHAR));
DPRINT1("[USBUHCI] SBRN %x\n", Value); DPRINT1("[USBUHCI] SBRN %x\n", Value);
ASSERT(FALSE);
// //
// perform global reset // perform global reset
@ -925,15 +924,6 @@ CUSBHardwareDevice::ResetPort(
// //
Status = ReadRegister16(Port); 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 @@ CUSBHardwareDevice::ResetPort(
// //
// now wait a bit // now wait a bit
// //
KeStallExecutionProcessor(50); KeStallExecutionProcessor(250);
// //
// re-read status // re-read status
@ -966,10 +956,6 @@ CUSBHardwareDevice::ResetPort(
// //
WriteRegister16(Port, (Status & ~UHCI_PORTSC_RESET)); WriteRegister16(Port, (Status & ~UHCI_PORTSC_RESET));
//
// set enabled bit
//
WriteRegister16(Port, ReadRegister16(Port) | UHCI_PORTSC_ENABLED);
// //
// now wait a bit // now wait a bit
@ -978,20 +964,14 @@ CUSBHardwareDevice::ResetPort(
for (Index = 0; Index < 10; Index++) for (Index = 0; Index < 10; Index++)
{ {
//
// read port status // read port status
//
Status = ReadRegister16(Port); Status = ReadRegister16(Port);
//
// remove unwanted bits // remove unwanted bits
//
Status &= UHCI_PORTSC_DATAMASK; Status &= UHCI_PORTSC_DATAMASK;
//
// enable port // enable port
// WriteRegister16(Port, Status | UHCI_PORTSC_ENABLED);
WriteRegister16(Port, Status);
// //
// wait a bit // wait a bit
@ -1029,16 +1009,6 @@ CUSBHardwareDevice::ResetPort(
m_PortResetChange |= (1 << PortIndex); m_PortResetChange |= (1 << PortIndex);
DPRINT1("[USBUhci] Port Index %x Status after reset %x\n", PortIndex, ReadRegister16(Port)); 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; return STATUS_SUCCESS;
} }

View file

@ -845,7 +845,30 @@ CUSBRequest::BuildTransferDescriptorChain(
// //
// FIXME FIXME FIXME FIXME FIXME // 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 do
{ {