mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03: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
Notes:
sideshowbarker
2024-07-19 02:55:02 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/eb74f622019
@ -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&)
|
||||
{
|
||||
}
|
||||
|
@ -35,6 +35,7 @@ public:
|
||||
virtual ~UHCIController() override;
|
||||
|
||||
void reset();
|
||||
void stop();
|
||||
|
||||
private:
|
||||
UHCIController(PCI::Address, PCI::ID);
|
||||
|
Loading…
Reference in New Issue
Block a user