mirror of
https://github.com/reactos/reactos.git
synced 2024-07-31 00:28:56 +00:00
[USBOHCI]
- Wait the required time for the port to be ready after powering it up svn path=/branches/usb-bringup-trunk/; revision=55196
This commit is contained in:
parent
1cede4f077
commit
b4c6fa3b4c
|
@ -1266,10 +1266,39 @@ CUSBHardwareDevice::SetPortFeature(
|
||||||
}
|
}
|
||||||
else if (Feature == PORT_POWER)
|
else if (Feature == PORT_POWER)
|
||||||
{
|
{
|
||||||
|
LARGE_INTEGER Timeout;
|
||||||
|
|
||||||
//
|
//
|
||||||
// enable power
|
// enable power
|
||||||
//
|
//
|
||||||
WRITE_REGISTER_ULONG((PULONG)((PUCHAR)m_Base + OHCI_RH_PORT_STATUS(PortId)), OHCI_RH_PORTSTATUS_PPS);
|
WRITE_REGISTER_ULONG((PULONG)((PUCHAR)m_Base + OHCI_RH_PORT_STATUS(PortId)), OHCI_RH_PORTSTATUS_PPS);
|
||||||
|
|
||||||
|
//
|
||||||
|
// read descriptor A for the delay data
|
||||||
|
//
|
||||||
|
Value = READ_REGISTER_ULONG((PULONG)((PUCHAR)m_Base + OHCI_RH_DESCRIPTOR_A_OFFSET));
|
||||||
|
|
||||||
|
//
|
||||||
|
// compute the delay
|
||||||
|
//
|
||||||
|
Timeout.QuadPart = OHCI_RH_GET_POWER_ON_TO_POWER_GOOD_TIME(Value);
|
||||||
|
|
||||||
|
//
|
||||||
|
// delay is multiplied by 2 ms
|
||||||
|
//
|
||||||
|
Timeout.QuadPart *= 2;
|
||||||
|
DPRINT1("Waiting %d milliseconds for port power up\n", Timeout.LowPart);
|
||||||
|
|
||||||
|
//
|
||||||
|
// convert to 100 ns units (absolute)
|
||||||
|
//
|
||||||
|
Timeout.QuadPart *= -10000;
|
||||||
|
|
||||||
|
//
|
||||||
|
// perform the wait
|
||||||
|
//
|
||||||
|
KeDelayExecutionThread(KernelMode, FALSE, &Timeout);
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
else if (Feature == PORT_SUSPEND)
|
else if (Feature == PORT_SUSPEND)
|
||||||
|
|
Loading…
Reference in a new issue