Index: uspace/drv/vhc/hubops.c
===================================================================
--- uspace/drv/vhc/hubops.c	(revision d5e76686497cace0d5ab653dee609bfc1fc6974b)
+++ uspace/drv/vhc/hubops.c	(revision 266d0871dba029aae0bcd196cb56080cb90b71b7)
@@ -59,6 +59,4 @@
 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_data_request(struct usbvirt_device *dev,
     usb_endpoint_t endpoint,
@@ -83,18 +81,29 @@
 }
 
-/** 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. */
+static void change_all_ports_state(hub_device_t *hub, hub_port_state_t state)
+{
 	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;
+		hub_port_t *port = &hub->ports[i];
+		set_port_state(port, state);
+	}
+}
+
+/** Callback when device changes states. */
+static void on_state_change(struct usbvirt_device *dev,
+    usbvirt_device_state_t old_state, usbvirt_device_state_t new_state)
+{
+	switch (new_state) {
+		case USBVIRT_STATE_CONFIGURED:
+			change_all_ports_state(&hub_dev,
+			    HUB_PORT_STATE_POWERED_OFF);
+			break;
+		case USBVIRT_STATE_ADDRESS:
+			change_all_ports_state(&hub_dev,
+			    HUB_PORT_STATE_NOT_CONFIGURED);
+			break;
+		default:
+			break;
+	}
 }
 
@@ -518,9 +527,4 @@
 static usbvirt_control_transfer_handler_t endpoint_zero_handlers[] = {
 	{
-		STD_REQ(DIR_OUT, REC_DEVICE, USB_DEVREQ_SET_CONFIGURATION),
-		.name = "SetConfiguration",
-		.callback = on_set_configuration
-	},
-	{
 		STD_REQ(DIR_IN, REC_DEVICE, USB_DEVREQ_GET_DESCRIPTOR),
 		.name = "GetDescriptor",
@@ -585,5 +589,6 @@
 	.control_transfer_handlers = endpoint_zero_handlers,
 	.on_data = NULL,
-	.on_data_request = on_data_request
+	.on_data_request = on_data_request,
+	.on_state_change = on_state_change,
 };
 
