mirror of
https://github.com/reactos/reactos.git
synced 2025-04-11 16:24:39 +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
1 changed files with 29 additions and 0 deletions
|
@ -1266,10 +1266,39 @@ CUSBHardwareDevice::SetPortFeature(
|
|||
}
|
||||
else if (Feature == PORT_POWER)
|
||||
{
|
||||
LARGE_INTEGER Timeout;
|
||||
|
||||
//
|
||||
// enable power
|
||||
//
|
||||
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;
|
||||
}
|
||||
else if (Feature == PORT_SUSPEND)
|
||||
|
|
Loading…
Reference in a new issue