mirror of
https://github.com/reactos/reactos.git
synced 2025-01-01 12:04:51 +00:00
[USBOHCI]
- Implement interrupt routing svn path=/branches/usb-bringup-trunk/; revision=55085
This commit is contained in:
parent
abb3023120
commit
7ec08a5b86
1 changed files with 51 additions and 5 deletions
|
@ -879,7 +879,7 @@ CUSBHardwareDevice::InitializeController()
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
CUSBHardwareDevice::StopController(void)
|
CUSBHardwareDevice::StopController(void)
|
||||||
{
|
{
|
||||||
ULONG Control, Reset;
|
ULONG Control, Reset, Status;
|
||||||
ULONG Index, FrameInterval;
|
ULONG Index, FrameInterval;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -892,10 +892,56 @@ CUSBHardwareDevice::StopController(void)
|
||||||
//
|
//
|
||||||
Control = READ_REGISTER_ULONG((PULONG)((PUCHAR)m_Base + OHCI_CONTROL_OFFSET));
|
Control = READ_REGISTER_ULONG((PULONG)((PUCHAR)m_Base + OHCI_CONTROL_OFFSET));
|
||||||
|
|
||||||
//
|
|
||||||
// FIXME: support routing
|
if ((Control & OHCI_INTERRUPT_ROUTING))
|
||||||
//
|
{
|
||||||
ASSERT((Control & OHCI_INTERRUPT_ROUTING) == 0);
|
//
|
||||||
|
// read command status
|
||||||
|
//
|
||||||
|
Status = READ_REGISTER_ULONG((PULONG)((PUCHAR)m_Base + OHCI_COMMAND_STATUS_OFFSET));
|
||||||
|
|
||||||
|
//
|
||||||
|
// change ownership
|
||||||
|
//
|
||||||
|
WRITE_REGISTER_ULONG((PULONG)((PUCHAR)m_Base + OHCI_COMMAND_STATUS_OFFSET), Status | OHCI_OWNERSHIP_CHANGE_REQUEST);
|
||||||
|
for(Index = 0; Index < 100; Index++)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// wait a bit
|
||||||
|
//
|
||||||
|
KeStallExecutionProcessor(100);
|
||||||
|
|
||||||
|
//
|
||||||
|
// check control
|
||||||
|
//
|
||||||
|
Control = READ_REGISTER_ULONG((PULONG)((PUCHAR)m_Base + OHCI_CONTROL_OFFSET));
|
||||||
|
if (!(Control & OHCI_INTERRUPT_ROUTING))
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// acquired ownership
|
||||||
|
//
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// if the ownership is still not changed, perform reset
|
||||||
|
//
|
||||||
|
if (Control & OHCI_INTERRUPT_ROUTING)
|
||||||
|
{
|
||||||
|
DPRINT1("SMM not responding\n");
|
||||||
|
//
|
||||||
|
// some controllers also depend on this
|
||||||
|
//
|
||||||
|
WRITE_REGISTER_ULONG((PULONG)((PUCHAR)m_Base + OHCI_CONTROL_OFFSET), OHCI_HC_FUNCTIONAL_STATE_RESET);
|
||||||
|
|
||||||
|
//
|
||||||
|
// wait a bit
|
||||||
|
//
|
||||||
|
KeStallExecutionProcessor(100);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// have a break
|
// have a break
|
||||||
|
|
Loading…
Reference in a new issue