summaryrefslogtreecommitdiff
path: root/Kernel/Devices
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/Devices')
-rw-r--r--Kernel/Devices/UHCIController.cpp12
-rw-r--r--Kernel/Devices/UHCIController.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/Kernel/Devices/UHCIController.cpp b/Kernel/Devices/UHCIController.cpp
index 192eab8829..d53e6342b2 100644
--- a/Kernel/Devices/UHCIController.cpp
+++ b/Kernel/Devices/UHCIController.cpp
@@ -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&)
{
}
diff --git a/Kernel/Devices/UHCIController.h b/Kernel/Devices/UHCIController.h
index 4816cfd990..b031449df0 100644
--- a/Kernel/Devices/UHCIController.h
+++ b/Kernel/Devices/UHCIController.h
@@ -35,6 +35,7 @@ public:
virtual ~UHCIController() override;
void reset();
+ void stop();
private:
UHCIController(PCI::Address, PCI::ID);