Index: uspace/drv/uhci/main.c
===================================================================
--- uspace/drv/uhci/main.c	(revision c9113d25996a4f40171e176244c93b274e3cd942)
+++ uspace/drv/uhci/main.c	(revision 138a7fd5df8a3a2ce43235c1b8c80c05ed534e15)
@@ -29,4 +29,5 @@
 #include <usb/debug.h>
 #include <errno.h>
+#include <driver.h>
 #include "uhci.h"
 
Index: uspace/drv/vhc/connhost.c
===================================================================
--- uspace/drv/vhc/connhost.c	(revision c9113d25996a4f40171e176244c93b274e3cd942)
+++ uspace/drv/vhc/connhost.c	(revision 138a7fd5df8a3a2ce43235c1b8c80c05ed534e15)
@@ -93,5 +93,5 @@
     usbhc_iface_transfer_out_callback_t callback, void *arg)
 {
-	printf(NAME ": transfer OUT [%d.%d (%s); %zu]\n",
+	dprintf(1, "transfer OUT [%d.%d (%s); %zu]",
 	    target.address, target.endpoint,
 	    usb_str_transfer_type(transfer_type),
@@ -113,5 +113,5 @@
     usbhc_iface_transfer_out_callback_t callback, void *arg)
 {
-	printf(NAME ": transfer SETUP [%d.%d (%s); %zu]\n",
+	dprintf(1, "transfer SETUP [%d.%d (%s); %zu]",
 	    target.address, target.endpoint,
 	    usb_str_transfer_type(transfer_type),
@@ -133,5 +133,5 @@
     usbhc_iface_transfer_in_callback_t callback, void *arg)
 {
-	printf(NAME ": transfer IN [%d.%d (%s); %zu]\n",
+	dprintf(1, "transfer IN [%d.%d (%s); %zu]",
 	    target.address, target.endpoint,
 	    usb_str_transfer_type(transfer_type),
Index: uspace/drv/vhc/hc.c
===================================================================
--- uspace/drv/vhc/hc.c	(revision c9113d25996a4f40171e176244c93b274e3cd942)
+++ uspace/drv/vhc/hc.c	(revision 138a7fd5df8a3a2ce43235c1b8c80c05ed534e15)
@@ -50,5 +50,5 @@
 #include "hub.h"
 
-#define USLEEP_BASE (500 * 1000)
+#define USLEEP_BASE (0 * 500 * 1000)
 
 #define USLEEP_VAR 5000
@@ -116,5 +116,5 @@
 		char ports[HUB_PORT_COUNT + 2];
 		hub_get_port_statuses(ports, HUB_PORT_COUNT + 1);
-		dprintf(3, "virtual hub: addr=%d ports=%s",
+		dprintf(0, "virtual hub: addr=%d ports=%s",
 		    virthub_dev.address, ports);
 		
Index: uspace/drv/vhc/hcd.c
===================================================================
--- uspace/drv/vhc/hcd.c	(revision c9113d25996a4f40171e176244c93b274e3cd942)
+++ uspace/drv/vhc/hcd.c	(revision 138a7fd5df8a3a2ce43235c1b8c80c05ed534e15)
@@ -110,5 +110,5 @@
 	printf("%s: virtual USB host controller driver.\n", NAME);
 
-	usb_dprintf_enable(NAME, 10);
+	usb_dprintf_enable(NAME, 1);
 
 	fid_t fid = fibril_create(hc_manager_fibril, NULL);
Index: uspace/drv/vhc/hub.c
===================================================================
--- uspace/drv/vhc/hub.c	(revision c9113d25996a4f40171e176244c93b274e3cd942)
+++ uspace/drv/vhc/hub.c	(revision 138a7fd5df8a3a2ce43235c1b8c80c05ed534e15)
@@ -144,5 +144,5 @@
 	.ops = &hub_ops,
 	.descriptors = &descriptors,
-	.lib_debug_level = 4,
+	.lib_debug_level = 1,
 	.lib_debug_enabled_tags = USBVIRT_DEBUGTAG_ALL
 };
@@ -177,7 +177,9 @@
 {
 	size_t i;
+	
 	for (i = 0; i < HUB_PORT_COUNT; i++) {
 		hub_port_t *port = &hub_dev.ports[i];
 		
+		port->index = (int) i;
 		port->device = NULL;
 		port->state = HUB_PORT_STATE_NOT_CONFIGURED;
Index: uspace/drv/vhc/hub.h
===================================================================
--- uspace/drv/vhc/hub.h	(revision c9113d25996a4f40171e176244c93b274e3cd942)
+++ uspace/drv/vhc/hub.h	(revision 138a7fd5df8a3a2ce43235c1b8c80c05ed534e15)
@@ -41,5 +41,5 @@
 #include "devices.h"
 
-#define HUB_PORT_COUNT 6
+#define HUB_PORT_COUNT 2
 
 #define BITS2BYTES(bits) \
Index: uspace/drv/vhc/hubintern.h
===================================================================
--- uspace/drv/vhc/hubintern.h	(revision c9113d25996a4f40171e176244c93b274e3cd942)
+++ uspace/drv/vhc/hubintern.h	(revision 138a7fd5df8a3a2ce43235c1b8c80c05ed534e15)
@@ -121,4 +121,5 @@
 typedef struct {
 	virtdev_connection_t *device;
+	int index;
 	hub_port_state_t state;
 	uint16_t status_change;
Index: uspace/drv/vhc/hubops.c
===================================================================
--- uspace/drv/vhc/hubops.c	(revision c9113d25996a4f40171e176244c93b274e3cd942)
+++ uspace/drv/vhc/hubops.c	(revision 138a7fd5df8a3a2ce43235c1b8c80c05ed534e15)
@@ -59,4 +59,6 @@
 static int on_get_descriptor(struct usbvirt_device *dev,
     usb_device_request_setup_packet_t *request, uint8_t *data);
+static int on_set_configuration(struct usbvirt_device *dev,
+    usb_device_request_setup_packet_t *request, uint8_t *data);
 static int on_class_request(struct usbvirt_device *dev,
     usb_device_request_setup_packet_t *request, uint8_t *data);
@@ -64,4 +66,5 @@
     usb_endpoint_t endpoint,
     void *buffer, size_t size, size_t *actual_size);
+static void set_port_state(hub_port_t *, hub_port_state_t);
 
 /** Standard USB requests. */
@@ -74,5 +77,5 @@
 	.on_set_descriptor = NULL,
 	.on_get_configuration = NULL,
-	.on_set_configuration = NULL,
+	.on_set_configuration = on_set_configuration,
 	.on_get_interface = NULL,
 	.on_set_interface = NULL,
@@ -102,9 +105,68 @@
 }
 
+/** Callback for SET_CONFIGURATION request. */
+int on_set_configuration(struct usbvirt_device *dev,
+    usb_device_request_setup_packet_t *request, uint8_t *data)
+{
+	/* We must suspend power source to all ports. */
+	size_t i;
+	for (i = 0; i < HUB_PORT_COUNT; i++) {
+		hub_port_t *port = &hub_dev.ports[i];
+		
+		set_port_state(port, HUB_PORT_STATE_POWERED_OFF);
+	}
+	
+	/* Let the framework handle the rest of the job. */
+	return EFORWARD;
+}
+
+struct delay_port_state_change {
+	suseconds_t delay;
+	hub_port_state_t old_state;
+	hub_port_state_t new_state;
+	hub_port_t *port;
+};
+
+static int set_port_state_delayed_fibril(void *arg)
+{
+	struct delay_port_state_change *change
+	    = (struct delay_port_state_change *) arg;
+	
+	async_usleep(change->delay);
+	
+	if (change->port->state == change->old_state) {
+		set_port_state(change->port, change->new_state);
+	}
+	
+	free(change);
+	
+	return EOK;
+}
+
+static void set_port_state_delayed(hub_port_t *port,
+    suseconds_t delay_time,
+    hub_port_state_t old_state, hub_port_state_t new_state)
+{
+	struct delay_port_state_change *change
+	    = malloc(sizeof(struct delay_port_state_change));
+	change->port = port;
+	change->delay = delay_time;
+	change->old_state = old_state;
+	change->new_state = new_state;
+	fid_t fibril = fibril_create(set_port_state_delayed_fibril, change);
+	if (fibril == 0) {
+		printf("Failed to create fibril\n");
+		return;
+	}
+	fibril_add_ready(fibril);
+}
+
 /** Change port status and updates status change status fields.
  */
-static void set_port_state(hub_port_t *port, hub_port_state_t state)
-{
-	port->state = state;
+void set_port_state(hub_port_t *port, hub_port_state_t state)
+{
+	dprintf(1, "setting port %d state to %d (%c)", port->index,
+	    state, hub_port_state_as_char(state));
+	
 	if (state == HUB_PORT_STATE_POWERED_OFF) {
 		clear_port_status_change(port, HUB_STATUS_C_PORT_CONNECTION);
@@ -113,16 +175,17 @@
 	}
 	if (state == HUB_PORT_STATE_RESUMING) {
-		async_usleep(10*1000);
-		if (port->state == state) {
-			set_port_state(port, HUB_PORT_STATE_ENABLED);
-		}
+		set_port_state_delayed(port, 10*1000,
+		    HUB_PORT_STATE_RESUMING, HUB_PORT_STATE_ENABLED);
 	}
 	if (state == HUB_PORT_STATE_RESETTING) {
-		async_usleep(10*1000);
-		if (port->state == state) {
-			set_port_status_change(port, HUB_STATUS_C_PORT_RESET);
-			set_port_state(port, HUB_PORT_STATE_ENABLED);
-		}
-	}
+		set_port_state_delayed(port, 10*1000,
+		    HUB_PORT_STATE_RESETTING, HUB_PORT_STATE_ENABLED);
+	}
+	if ((port->state == HUB_PORT_STATE_RESETTING)
+	    && (state == HUB_PORT_STATE_ENABLED)) {
+		set_port_status_change(port, HUB_STATUS_C_PORT_RESET);
+	}
+	
+	port->state = state;
 }
 
@@ -249,4 +312,6 @@
 	status |= (port->status_change << 16);
 	
+	dprintf(2, "GetPortStatus(port=%d, status=%u)\n", (int)portindex,
+	    (unsigned int) status);
 	return virthub_dev.control_transfer_reply(&virthub_dev, 0, &status, 4);
 }
@@ -291,5 +356,5 @@
     usb_device_request_setup_packet_t *request, uint8_t *data)
 {	
-	dprintf(2, "hub class request (%d)\n", (int) request->request);
+	dprintf(2, "hub class request (%d)", (int) request->request);
 	
 	uint8_t recipient = request->request_type & 31;
@@ -340,4 +405,6 @@
 			
 		default:
+			dprintf(0, "WARN: unknown request (%d)!\n",
+			    request->request);
 			break;
 	}
