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
Notes: sideshowbarker 2024-07-19 02:54:48 +09:00
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&)
{
}

View File

@ -38,6 +38,7 @@ public:
void reset();
void stop();
void start();
private:
UHCIController(PCI::Address, PCI::ID);