Index: uspace/drv/uhci/Makefile
===================================================================
--- uspace/drv/uhci/Makefile	(revision 28f660d2d933fbece3b8e41bc9300c5ed4977324)
+++ uspace/drv/uhci/Makefile	(revision 92f924c8f47ac9cd03d5e435a2c244dee1a328a6)
@@ -38,5 +38,6 @@
 	root_hub/port_status.c \
 	root_hub/root_hub.c \
-	uhci.c
+	uhci.c \
+	utils/hc_synchronizer.c
 
 include $(USPACE_PREFIX)/Makefile.common
Index: uspace/drv/uhci/root_hub/port.c
===================================================================
--- uspace/drv/uhci/root_hub/port.c	(revision 28f660d2d933fbece3b8e41bc9300c5ed4977324)
+++ uspace/drv/uhci/root_hub/port.c	(revision 92f924c8f47ac9cd03d5e435a2c244dee1a328a6)
@@ -1,6 +1,7 @@
 
+#include <atomic.h>
+#include <errno.h>
 #include <usb/devreq.h>
 #include <usb/usb.h>
-#include <errno.h>
 
 #include "debug.h"
@@ -8,4 +9,5 @@
 #include "port.h"
 #include "port_status.h"
+#include "utils/hc_synchronizer.h"
 
 struct usb_match {
@@ -104,5 +106,5 @@
 	pio_write_16( port->address, port_status.raw_value );
 
-	uhci_print_info( "Enabled port %d.\n", port );
+	uhci_print_info( "Enabled port %d.\n", port->number );
 	return EOK;
 }
@@ -191,14 +193,29 @@
 	/* get new address */
 	const usb_address_t usb_address =
-	  usb_address_keeping_request( &uhci_instance->address_manager );
+	  usb_address_keeping_request(&uhci_instance->address_manager);
+
+	if (usb_address <= 0) {
+		return usb_address;
+	}
 
 	/* assign new address */
 	usb_target_t new_device = { USB_ADDRESS_DEFAULT, 0 };
-	usb_device_request_setup_packet_t data;
+	usb_device_request_setup_packet_t data =
+	{
+		.request_type = 0,
+		.request = USB_DEVREQ_SET_ADDRESS,
+		{ .value = usb_address },
+		.index = 0,
+		.length = 0
+	};
+
+	sync_value_t value;
 
 	uhci_setup(
-	  hc, new_device, USB_TRANSFER_CONTROL, &data, sizeof(data), NULL, NULL );
-	uhci_print_verbose( "address assignment sent, waiting to complete.\n" );
-
+	  hc, new_device, USB_TRANSFER_CONTROL, &data, sizeof(data),
+		sync_out_callback, (void*)&value );
+	uhci_print_verbose("address assignment sent, waiting to complete.\n");
+
+//	sync_wait_for(&value);
 
 	uhci_print_info( "Assigned address %#x.\n", usb_address );
Index: uspace/drv/uhci/root_hub/root_hub.c
===================================================================
--- uspace/drv/uhci/root_hub/root_hub.c	(revision 28f660d2d933fbece3b8e41bc9300c5ed4977324)
+++ uspace/drv/uhci/root_hub/root_hub.c	(revision 92f924c8f47ac9cd03d5e435a2c244dee1a328a6)
@@ -26,5 +26,5 @@
 	/* add fibrils for periodic port checks */
 	unsigned i = 0;
-	for (; i< UHCI_ROOT_HUB_PORT_COUNT; ++i) {
+	for (; i < UHCI_ROOT_HUB_PORT_COUNT; ++i) {
 		/* mind pointer arithmetics */
 		uhci_port_init(
@@ -37,4 +37,5 @@
 		}
 		fibril_add_ready(hub->checker[i]);
+		uhci_print_verbose(" added fibril for port %d: %p.\n", i, hub->checker[i]);
 	}
 
Index: uspace/drv/uhci/uhci.c
===================================================================
--- uspace/drv/uhci/uhci.c	(revision 28f660d2d933fbece3b8e41bc9300c5ed4977324)
+++ uspace/drv/uhci/uhci.c	(revision 92f924c8f47ac9cd03d5e435a2c244dee1a328a6)
@@ -89,4 +89,5 @@
 	    usb_str_transfer_type(transfer_type),
 	    size);
+//	callback( dev, USB_OUTCOME_OK, arg );
 
 	return ENOTSUP;
Index: uspace/drv/uhci/utils/hc_synchronizer.c
===================================================================
--- uspace/drv/uhci/utils/hc_synchronizer.c	(revision 92f924c8f47ac9cd03d5e435a2c244dee1a328a6)
+++ uspace/drv/uhci/utils/hc_synchronizer.c	(revision 92f924c8f47ac9cd03d5e435a2c244dee1a328a6)
@@ -0,0 +1,29 @@
+#include "hc_synchronizer.h"
+
+void sync_wait_for(sync_value_t *value)
+{
+	assert( value );
+	value->waiting_fibril = fibril_get_id();
+	uhci_print_verbose("turning off fibril %p.\n", value->waiting_fibril);
+	fibril_switch(FIBRIL_TO_MANAGER);
+}
+/*----------------------------------------------------------------------------*/
+void sync_in_callback(
+  device_t *device, usb_transaction_outcome_t result, size_t size, void *arg)
+{
+	sync_value_t *value = arg;
+	assert(value);
+	value->size = size;
+	value->result = result;
+	fibril_add_ready(value->waiting_fibril);
+}
+/*----------------------------------------------------------------------------*/
+void sync_out_callback(
+  device_t *device, usb_transaction_outcome_t result, void *arg)
+{
+	sync_value_t *value = arg;
+	assert(value);
+	value->result = result;
+	uhci_print_verbose("resuming fibril %p.\n", value->waiting_fibril);
+	fibril_add_ready(value->waiting_fibril);
+}
Index: uspace/drv/uhci/utils/hc_synchronizer.h
===================================================================
--- uspace/drv/uhci/utils/hc_synchronizer.h	(revision 92f924c8f47ac9cd03d5e435a2c244dee1a328a6)
+++ uspace/drv/uhci/utils/hc_synchronizer.h	(revision 92f924c8f47ac9cd03d5e435a2c244dee1a328a6)
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2010 Jan Vesely
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+/** @addtogroup usb
+ * @{
+ */
+/** @file
+ * @brief UHCI driver
+ */
+#ifndef DRV_UHCI_UTIL_SYNCHRONIZER_H
+#define DRV_UHCI_UTIL_SYNCHRONIZER_H
+
+#include <assert.h>
+#include <driver.h>
+#include <fibril.h>
+#include <usb/usb.h>
+
+#include "debug.h"
+
+typedef struct value
+{
+	/* TODO Think of better fibril synch to use */
+	fid_t waiting_fibril;
+	usb_transaction_outcome_t result;
+	size_t size;
+	bool done;
+} sync_value_t;
+
+void sync_wait_for(sync_value_t *value);
+
+void sync_in_callback(
+  device_t *device, usb_transaction_outcome_t result, size_t size, void *value);
+
+void sync_out_callback(
+  device_t *device, usb_transaction_outcome_t result, void *value);
+#endif
+/**
+ * @}
+ */
