1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:37:34 +00:00

Kernel/USB: Start the UHCI controller after resetting it

This commit is contained in:
Andreas Kling 2020-09-05 00:32:52 +02:00
parent c8668e9b7c
commit 3f36903201
2 changed files with 13 additions and 0 deletions

View file

@ -65,6 +65,7 @@ UHCIController::UHCIController(PCI::Address address, PCI::ID id)
klog() << "UHCI: Interrupt line: " << PCI::get_interrupt_line(pci_address());
reset();
start();
}
UHCIController::~UHCIController()
@ -97,6 +98,17 @@ void UHCIController::stop()
}
}
void UHCIController::start()
{
write_usbcmd(read_usbcmd() | UHCI_USBCMD_RUN);
// FIXME: Timeout
for (;;) {
if (!(read_usbsts() & UHCI_USBSTS_HOST_CONTROLLER_HALTED))
break;
}
klog() << "UHCI: Started!";
}
void UHCIController::handle_irq(const RegisterState&)
{
}