Index: uspace/drv/ehci-hcd/main.c
===================================================================
--- uspace/drv/ehci-hcd/main.c	(revision 55f324fd05578d73222871a21d25858f46fb5c4a)
+++ uspace/drv/ehci-hcd/main.c	(revision 89aca2daa9842c0d607fe46c12988a078a3d9d53)
@@ -75,17 +75,16 @@
 }
 
-	uintptr_t mem_reg_base = 0;
-	size_t mem_reg_size = 0;
+	uintptr_t reg_base = 0;
+	size_t reg_size = 0;
 	int irq = 0;
 
-	int ret =
-	    pci_get_my_registers(device, &mem_reg_base, &mem_reg_size, &irq);
+	int ret = pci_get_my_registers(device, &reg_base, &reg_size, &irq);
 	CHECK_RET_RETURN(ret,
 	    "Failed to get memory addresses for %" PRIun ": %s.\n",
 	    device->handle, str_error(ret));
 	usb_log_info("Memory mapped regs at 0x%" PRIxn " (size %zu), IRQ %d.\n",
-	    mem_reg_base, mem_reg_size, irq);
+	    reg_base, reg_size, irq);
 
-	ret = pci_disable_legacy(device);
+	ret = pci_disable_legacy(device, reg_base, reg_size, irq);
 	CHECK_RET_RETURN(ret,
 	    "Failed(%d) disable legacy USB: %s.\n", ret, str_error(ret));
Index: uspace/drv/ehci-hcd/pci.c
===================================================================
--- uspace/drv/ehci-hcd/pci.c	(revision 55f324fd05578d73222871a21d25858f46fb5c4a)
+++ uspace/drv/ehci-hcd/pci.c	(revision 89aca2daa9842c0d607fe46c12988a078a3d9d53)
@@ -87,13 +87,13 @@
 } while(0)
 
-static int pci_read32(ddf_dev_t *dev, int address, uint32_t *value)
+static int pci_read32(const ddf_dev_t *dev, int address, uint32_t *value)
 {
 	PCI_READ(32);
 }
-static int pci_read16(ddf_dev_t *dev, int address, uint16_t *value)
+static int pci_read16(const ddf_dev_t *dev, int address, uint16_t *value)
 {
 	PCI_READ(16);
 }
-static int pci_read8(ddf_dev_t *dev, int address, uint8_t *value)
+static int pci_read8(const ddf_dev_t *dev, int address, uint8_t *value)
 {
 	PCI_READ(8);
@@ -115,13 +115,13 @@
 } while(0)
 
-static int pci_write32(ddf_dev_t *dev, int address, uint32_t value)
+static int pci_write32(const ddf_dev_t *dev, int address, uint32_t value)
 {
 	PCI_WRITE(32);
 }
-static int pci_write16(ddf_dev_t *dev, int address, uint16_t value)
+static int pci_write16(const ddf_dev_t *dev, int address, uint16_t value)
 {
 	PCI_WRITE(16);
 }
-static int pci_write8(ddf_dev_t *dev, int address, uint8_t value)
+static int pci_write8(const ddf_dev_t *dev, int address, uint8_t value)
 {
 	PCI_WRITE(8);
@@ -136,5 +136,5 @@
  * @return Error code.
  */
-int pci_get_my_registers(ddf_dev_t *dev,
+int pci_get_my_registers(const ddf_dev_t *dev,
     uintptr_t *mem_reg_address, size_t *mem_reg_size, int *irq_no)
 {
@@ -206,5 +206,5 @@
  * @return Error code.
  */
-int pci_enable_interrupts(ddf_dev_t *device)
+int pci_enable_interrupts(const ddf_dev_t *device)
 {
 	const int parent_phone =
@@ -223,5 +223,6 @@
  * @return Error code.
  */
-int pci_disable_legacy(ddf_dev_t *device)
+int pci_disable_legacy(
+    const ddf_dev_t *device, uintptr_t reg_base, size_t reg_size, int irq)
 {
 	assert(device);
@@ -236,18 +237,7 @@
 	} else (void)0
 
-	uintptr_t reg_base = 0;
-	size_t reg_size = 0;
-	int irq = 0;
-
-	int ret = pci_get_my_registers(device, &reg_base, &reg_size, &irq);
-	CHECK_RET_RETURN(ret, "Failed(%d) to get EHCI registers.\n", ret);
-
-	usb_log_info("EHCI: Memory registers:%p size: %zu irq:%d.\n",
-	    (void *) reg_base, reg_size, irq);
-
-
-	/* map EHCI registers */
+	/* Map EHCI registers */
 	void *regs = NULL;
-	ret = pio_enable((void*)reg_base, reg_size, &regs);
+	int ret = pio_enable((void*)reg_base, reg_size, &regs);
 	CHECK_RET_RETURN(ret, "Failed(%d) to map registers %p.\n",
 	    ret, (void *) reg_base);
@@ -316,4 +306,5 @@
 			CHECK_RET_RETURN(ret,
 			    "Failed(%d) zero USBLEGCTLSTS.\n", ret);
+			udelay(10);
 			ret = pci_read32(
 			    device, eecp + USBLEGCTLSTS_OFFSET, &usblegctlsts);
@@ -350,10 +341,11 @@
 	usb_log_debug("USBCMD value: %x.\n", *usbcmd);
 	if (*usbcmd & USBCMD_RUN) {
-		*usbcmd = 0;
-		/* Wait until hc is halted */
-		while ((*usbsts & USBSTS_HALTED) != 0);
 		*usbsts = 0x3f; /* ack all interrupts */
 		*usbint = 0; /* disable all interrutps */
 		*usbconf = 0; /* relase control of RH ports */
+
+		*usbcmd = 0;
+		/* Wait until hc is halted */
+		while ((*usbsts & USBSTS_HALTED) == 0);
 		usb_log_info("EHCI turned off.\n");
 	} else {
Index: uspace/drv/ehci-hcd/pci.h
===================================================================
--- uspace/drv/ehci-hcd/pci.h	(revision 55f324fd05578d73222871a21d25858f46fb5c4a)
+++ uspace/drv/ehci-hcd/pci.h	(revision 89aca2daa9842c0d607fe46c12988a078a3d9d53)
@@ -38,7 +38,7 @@
 #include <ddf/driver.h>
 
-int pci_get_my_registers(ddf_dev_t *, uintptr_t *, size_t *, int *);
-int pci_enable_interrupts(ddf_dev_t *);
-int pci_disable_legacy(ddf_dev_t *);
+int pci_get_my_registers(const ddf_dev_t *, uintptr_t *, size_t *, int *);
+int pci_enable_interrupts(const ddf_dev_t *);
+int pci_disable_legacy(const ddf_dev_t *, uintptr_t, size_t, int);
 
 #endif
