mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 16:18:12 +00:00
Kernel/USB: Add a simple UHCIController::stop()
This stops the controller and waits for it to complete.
This commit is contained in:
parent
1254447bd7
commit
eb74f62201
2 changed files with 13 additions and 0 deletions
|
@ -73,6 +73,8 @@ UHCIController::~UHCIController()
|
|||
|
||||
void UHCIController::reset()
|
||||
{
|
||||
stop();
|
||||
|
||||
write_usbcmd(UHCI_USBCMD_HOST_CONTROLLER_RESET);
|
||||
|
||||
// FIXME: Timeout
|
||||
|
@ -85,6 +87,16 @@ void UHCIController::reset()
|
|||
klog() << "UHCI: Reset completed!";
|
||||
}
|
||||
|
||||
void UHCIController::stop()
|
||||
{
|
||||
write_usbcmd(read_usbcmd() & ~UHCI_USBCMD_RUN);
|
||||
// FIXME: Timeout
|
||||
for (;;) {
|
||||
if (read_usbsts() & UHCI_USBSTS_HOST_CONTROLLER_HALTED)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void UHCIController::handle_irq(const RegisterState&)
|
||||
{
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue