1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 02:17: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()); klog() << "UHCI: Interrupt line: " << PCI::get_interrupt_line(pci_address());
reset(); reset();
start();
} }
UHCIController::~UHCIController() 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&) void UHCIController::handle_irq(const RegisterState&)
{ {
} }

View file

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