Index: uspace/drv/uhci-hcd/batch.c
===================================================================
--- uspace/drv/uhci-hcd/batch.c	(revision fec47d4d4a2130ab84e58b61c1e5433ef7bacea3)
+++ uspace/drv/uhci-hcd/batch.c	(revision 1c6f4ff244cfa0736f1fa6008c02b5f8ce30c723)
@@ -80,12 +80,10 @@
  * transaction and callback.
  */
-usb_transfer_batch_t * batch_get(ddf_fun_t *fun, usb_target_t target,
-    usb_transfer_type_t transfer_type, size_t max_packet_size,
-    usb_speed_t speed, char *buffer, size_t buffer_size,
-    char* setup_buffer, size_t setup_size,
+usb_transfer_batch_t * batch_get(ddf_fun_t *fun, endpoint_t *ep,
+    char *buffer, size_t buffer_size, char* setup_buffer, size_t setup_size,
     usbhc_iface_transfer_in_callback_t func_in,
-    usbhc_iface_transfer_out_callback_t func_out, void *arg, endpoint_t *ep
-    )
-{
+    usbhc_iface_transfer_out_callback_t func_out, void *arg)
+{
+	assert(ep);
 	assert(func_in == NULL || func_out == NULL);
 	assert(func_in != NULL || func_out != NULL);
@@ -103,6 +101,8 @@
 	CHECK_NULL_DISPOSE_RETURN(instance,
 	    "Failed to allocate batch instance.\n");
+	usb_target_t target =
+	    { .address = ep->address, .endpoint = ep->endpoint };
 	usb_transfer_batch_init(instance, target,
-	    transfer_type, speed, max_packet_size,
+	    ep->transfer_type, ep->speed, ep->max_packet_size,
 	    buffer, NULL, buffer_size, NULL, setup_size, func_in,
 	    func_out, arg, fun, ep, NULL);
@@ -115,6 +115,7 @@
 	instance->private_data = data;
 
-	data->transfers = (buffer_size + max_packet_size - 1) / max_packet_size;
-	if (transfer_type == USB_TRANSFER_CONTROL) {
+	data->transfers =
+	    (buffer_size + ep->max_packet_size - 1) / ep->max_packet_size;
+	if (ep->transfer_type == USB_TRANSFER_CONTROL) {
 		data->transfers += 2;
 	}
@@ -178,7 +179,8 @@
 			    instance, i, data->tds[i].status);
 			td_print_status(&data->tds[i]);
-			if (instance->ep != NULL)
-				endpoint_toggle_set(instance->ep,
-				    td_toggle(&data->tds[i]));
+			assert(instance->ep != NULL);
+
+			endpoint_toggle_set(instance->ep,
+			    td_toggle(&data->tds[i]));
 			if (i > 0)
 				goto substract_ret;
Index: uspace/drv/uhci-hcd/batch.h
===================================================================
--- uspace/drv/uhci-hcd/batch.h	(revision fec47d4d4a2130ab84e58b61c1e5433ef7bacea3)
+++ uspace/drv/uhci-hcd/batch.h	(revision 1c6f4ff244cfa0736f1fa6008c02b5f8ce30c723)
@@ -44,18 +44,9 @@
 
 usb_transfer_batch_t * batch_get(
-    ddf_fun_t *fun,
-		usb_target_t target,
-    usb_transfer_type_t transfer_type,
-		size_t max_packet_size,
-    usb_speed_t speed,
-		char *buffer,
-		size_t size,
-		char *setup_buffer,
-		size_t setup_size,
+    ddf_fun_t *fun, endpoint_t *ep, char *buffer, size_t size,
+    char *setup_buffer, size_t setup_size,
     usbhc_iface_transfer_in_callback_t func_in,
     usbhc_iface_transfer_out_callback_t func_out,
-		void *arg,
-		endpoint_t *ep
-		);
+    void *arg);
 
 void batch_dispose(usb_transfer_batch_t *instance);
Index: uspace/drv/uhci-hcd/iface.c
===================================================================
--- uspace/drv/uhci-hcd/iface.c	(revision fec47d4d4a2130ab84e58b61c1e5433ef7bacea3)
+++ uspace/drv/uhci-hcd/iface.c	(revision 1c6f4ff244cfa0736f1fa6008c02b5f8ce30c723)
@@ -40,4 +40,51 @@
 #include "iface.h"
 #include "hc.h"
+
+static inline int setup_batch(
+    ddf_fun_t *fun, usb_target_t target, usb_direction_t direction,
+    void *data, size_t size, void * setup_data, size_t setup_size,
+    usbhc_iface_transfer_in_callback_t in,
+    usbhc_iface_transfer_out_callback_t out, void *arg, const char* name,
+    hc_t **hc, usb_transfer_batch_t **batch)
+{
+	assert(hc);
+	assert(batch);
+	assert(fun);
+	*hc = fun_to_hc(fun);
+	assert(*hc);
+
+	size_t res_bw;
+	endpoint_t *ep = usb_endpoint_manager_get_ep(&(*hc)->ep_manager,
+	    target.address, target.endpoint, direction, &res_bw);
+	if (ep == NULL) {
+		usb_log_error("Endpoint(%d:%d) not registered for %s.\n",
+		    target.address, target.endpoint, name);
+		return ENOENT;
+	}
+
+	const size_t bw = bandwidth_count_usb11(
+	    ep->speed, ep->transfer_type, size, ep->max_packet_size);
+	if (res_bw < bw) {
+		usb_log_error("Endpoint(%d:%d) %s needs %zu bw "
+		    "but only %zu is reserved.\n",
+		    name, target.address, target.endpoint, bw, res_bw);
+		return ENOSPC;
+	}
+	usb_log_debug("%s %d:%d %zu(%zu).\n",
+	    name, target.address, target.endpoint, size, ep->max_packet_size);
+
+	assert(ep->speed ==
+	    usb_device_keeper_get_speed(&(*hc)->manager, target.address));
+//	assert(ep->max_packet_size == max_packet_size);
+//	assert(ep->transfer_type == USB_TRANSFER_CONTROL);
+
+	*batch =
+	    batch_get(fun, ep, data, size, setup_data, setup_size,
+		in, out, arg);
+	if (!batch)
+		return ENOMEM;
+	return EOK;
+}
+
 
 /** Reserve default address interface function
@@ -215,40 +262,12 @@
     size_t size, usbhc_iface_transfer_out_callback_t callback, void *arg)
 {
-	assert(fun);
-	hc_t *hc = fun_to_hc(fun);
-	assert(hc);
-
-	usb_log_debug("Interrupt OUT %d:%d %zu(%zu).\n",
-	    target.address, target.endpoint, size, max_packet_size);
-
-	size_t res_bw;
-	endpoint_t *ep = usb_endpoint_manager_get_ep(&hc->ep_manager,
-	    target.address, target.endpoint, USB_DIRECTION_OUT, &res_bw);
-	if (ep == NULL) {
-		usb_log_error("Endpoint(%d:%d) not registered for INT OUT.\n",
-			target.address, target.endpoint);
-		return ENOENT;
-	}
-	const size_t bw = bandwidth_count_usb11(ep->speed, ep->transfer_type,
-	    size, ep->max_packet_size);
-	if (res_bw < bw)
-	{
-		usb_log_error("Endpoint(%d:%d) INT IN needs %zu bw "
-		    "but only %zu is reserved.\n",
-		    target.address, target.endpoint, bw, res_bw);
-		return ENOENT;
-	}
-	assert(ep->speed ==
-	    usb_device_keeper_get_speed(&hc->manager, target.address));
-	assert(ep->max_packet_size == max_packet_size);
-	assert(ep->transfer_type == USB_TRANSFER_INTERRUPT);
-
-	usb_transfer_batch_t *batch =
-	    batch_get(fun, target, ep->transfer_type, ep->max_packet_size,
-	        ep->speed, data, size, NULL, 0, NULL, callback, arg, ep);
-	if (!batch)
-		return ENOMEM;
+	usb_transfer_batch_t *batch = NULL;
+	hc_t *hc = NULL;
+	int ret = setup_batch(fun, target, USB_DIRECTION_OUT, data, size,
+	    NULL, 0, NULL, callback, arg, "Interrupt OUT", &hc, &batch);
+	if (ret != EOK)
+		return ret;
 	batch_interrupt_out(batch);
-	const int ret = hc_schedule(hc, batch);
+	ret = hc_schedule(hc, batch);
 	if (ret != EOK) {
 		batch_dispose(batch);
@@ -272,41 +291,12 @@
     size_t size, usbhc_iface_transfer_in_callback_t callback, void *arg)
 {
-	assert(fun);
-	hc_t *hc = fun_to_hc(fun);
-	assert(hc);
-
-	usb_log_debug("Interrupt IN %d:%d %zu(%zu).\n",
-	    target.address, target.endpoint, size, max_packet_size);
-
-	size_t res_bw;
-	endpoint_t *ep = usb_endpoint_manager_get_ep(&hc->ep_manager,
-	    target.address, target.endpoint, USB_DIRECTION_IN, &res_bw);
-	if (ep == NULL) {
-		usb_log_error("Endpoint(%d:%d) not registered for INT IN.\n",
-		    target.address, target.endpoint);
-		return ENOENT;
-	}
-	const size_t bw = bandwidth_count_usb11(ep->speed, ep->transfer_type,
-	    size, ep->max_packet_size);
-	if (res_bw < bw)
-	{
-		usb_log_error("Endpoint(%d:%d) INT IN needs %zu bw "
-		    "but only %zu bw is reserved.\n",
-		    target.address, target.endpoint, bw, res_bw);
-		return ENOENT;
-	}
-
-	assert(ep->speed ==
-	    usb_device_keeper_get_speed(&hc->manager, target.address));
-	assert(ep->max_packet_size == max_packet_size);
-	assert(ep->transfer_type == USB_TRANSFER_INTERRUPT);
-
-	usb_transfer_batch_t *batch =
-	    batch_get(fun, target, ep->transfer_type, ep->max_packet_size,
-	        ep->speed, data, size, NULL, 0, callback, NULL, arg, ep);
-	if (!batch)
-		return ENOMEM;
+	usb_transfer_batch_t *batch = NULL;
+	hc_t *hc = NULL;
+	int ret = setup_batch(fun, target, USB_DIRECTION_IN, data, size,
+	    NULL, 0, callback, NULL, arg, "Interrupt IN", &hc, &batch);
+	if (ret != EOK)
+		return ret;
 	batch_interrupt_in(batch);
-	const int ret = hc_schedule(hc, batch);
+	ret = hc_schedule(hc, batch);
 	if (ret != EOK) {
 		batch_dispose(batch);
@@ -330,30 +320,12 @@
     size_t size, usbhc_iface_transfer_out_callback_t callback, void *arg)
 {
-	assert(fun);
-	hc_t *hc = fun_to_hc(fun);
-	assert(hc);
-
-	usb_log_debug("Bulk OUT %d:%d %zu(%zu).\n",
-	    target.address, target.endpoint, size, max_packet_size);
-
-	endpoint_t *ep = usb_endpoint_manager_get_ep(&hc->ep_manager,
-	    target.address, target.endpoint, USB_DIRECTION_OUT, NULL);
-	if (ep == NULL) {
-		usb_log_error("Endpoint(%d:%d) not registered for BULK OUT.\n",
-			target.address, target.endpoint);
-		return ENOENT;
-	}
-	assert(ep->speed ==
-	    usb_device_keeper_get_speed(&hc->manager, target.address));
-	assert(ep->max_packet_size == max_packet_size);
-	assert(ep->transfer_type == USB_TRANSFER_BULK);
-
-	usb_transfer_batch_t *batch =
-	    batch_get(fun, target, ep->transfer_type, ep->max_packet_size,
-	        ep->speed, data, size, NULL, 0, NULL, callback, arg, ep);
-	if (!batch)
-		return ENOMEM;
+	usb_transfer_batch_t *batch = NULL;
+	hc_t *hc = NULL;
+	int ret = setup_batch(fun, target, USB_DIRECTION_OUT, data, size,
+	    NULL, 0, NULL, callback, arg, "Bulk OUT", &hc, &batch);
+	if (ret != EOK)
+		return ret;
 	batch_bulk_out(batch);
-	const int ret = hc_schedule(hc, batch);
+	ret = hc_schedule(hc, batch);
 	if (ret != EOK) {
 		batch_dispose(batch);
@@ -377,29 +349,12 @@
     size_t size, usbhc_iface_transfer_in_callback_t callback, void *arg)
 {
-	assert(fun);
-	hc_t *hc = fun_to_hc(fun);
-	assert(hc);
-	usb_log_debug("Bulk IN %d:%d %zu(%zu).\n",
-	    target.address, target.endpoint, size, max_packet_size);
-
-	endpoint_t *ep = usb_endpoint_manager_get_ep(&hc->ep_manager,
-	    target.address, target.endpoint, USB_DIRECTION_IN, NULL);
-	if (ep == NULL) {
-		usb_log_error("Endpoint(%d:%d) not registered for BULK IN.\n",
-			target.address, target.endpoint);
-		return ENOENT;
-	}
-	assert(ep->speed ==
-	    usb_device_keeper_get_speed(&hc->manager, target.address));
-	assert(ep->max_packet_size == max_packet_size);
-	assert(ep->transfer_type == USB_TRANSFER_BULK);
-
-	usb_transfer_batch_t *batch =
-	    batch_get(fun, target, ep->transfer_type, ep->max_packet_size,
-	        ep->speed, data, size, NULL, 0, callback, NULL, arg, ep);
-	if (!batch)
-		return ENOMEM;
+	usb_transfer_batch_t *batch = NULL;
+	hc_t *hc = NULL;
+	int ret = setup_batch(fun, target, USB_DIRECTION_IN, data, size,
+	    NULL, 0, callback, NULL, arg, "Bulk IN", &hc, &batch);
+	if (ret != EOK)
+		return ret;
 	batch_bulk_in(batch);
-	const int ret = hc_schedule(hc, batch);
+	ret = hc_schedule(hc, batch);
 	if (ret != EOK) {
 		batch_dispose(batch);
@@ -426,29 +381,14 @@
     usbhc_iface_transfer_out_callback_t callback, void *arg)
 {
-	assert(fun);
-	hc_t *hc = fun_to_hc(fun);
-	assert(hc);
-	usb_speed_t speed =
-	    usb_device_keeper_get_speed(&hc->manager, target.address);
-	usb_log_debug("Control WRITE (%d) %d:%d %zu(%zu).\n",
-	    speed, target.address, target.endpoint, size, max_packet_size);
-	endpoint_t *ep = usb_endpoint_manager_get_ep(&hc->ep_manager,
-	    target.address, target.endpoint, USB_DIRECTION_BOTH, NULL);
-	if (ep == NULL) {
-		usb_log_warning("Endpoint(%d:%d) not registered for CONTROL.\n",
-			target.address, target.endpoint);
-	}
-
-	if (setup_size != 8)
-		return EINVAL;
-
-	usb_transfer_batch_t *batch =
-	    batch_get(fun, target, USB_TRANSFER_CONTROL, max_packet_size, speed,
-	        data, size, setup_data, setup_size, NULL, callback, arg, ep);
-	if (!batch)
-		return ENOMEM;
+	usb_transfer_batch_t *batch = NULL;
+	hc_t *hc = NULL;
+	int ret = setup_batch(fun, target, USB_DIRECTION_BOTH, data, size,
+	    setup_data, setup_size, NULL, callback, arg, "Control WRITE",
+	    &hc, &batch);
+	if (ret != EOK)
+		return ret;
 	usb_device_keeper_reset_if_need(&hc->manager, target, setup_data);
 	batch_control_write(batch);
-	const int ret = hc_schedule(hc, batch);
+	ret = hc_schedule(hc, batch);
 	if (ret != EOK) {
 		batch_dispose(batch);
@@ -475,25 +415,13 @@
     usbhc_iface_transfer_in_callback_t callback, void *arg)
 {
-	assert(fun);
-	hc_t *hc = fun_to_hc(fun);
-	assert(hc);
-	usb_speed_t speed =
-	    usb_device_keeper_get_speed(&hc->manager, target.address);
-
-	usb_log_debug("Control READ(%d) %d:%d %zu(%zu).\n",
-	    speed, target.address, target.endpoint, size, max_packet_size);
-	endpoint_t *ep = usb_endpoint_manager_get_ep(&hc->ep_manager,
-	    target.address, target.endpoint, USB_DIRECTION_BOTH, NULL);
-	if (ep == NULL) {
-		usb_log_warning("Endpoint(%d:%d) not registered for CONTROL.\n",
-			target.address, target.endpoint);
-	}
-	usb_transfer_batch_t *batch =
-	    batch_get(fun, target, USB_TRANSFER_CONTROL, max_packet_size, speed,
-	        data, size, setup_data, setup_size, callback, NULL, arg, ep);
-	if (!batch)
-		return ENOMEM;
+	usb_transfer_batch_t *batch = NULL;
+	hc_t *hc = NULL;
+	int ret = setup_batch(fun, target, USB_DIRECTION_BOTH, data, size,
+	    setup_data, setup_size, callback, NULL, arg, "Control READ",
+	    &hc, &batch);
+	if (ret != EOK)
+		return ret;
 	batch_control_read(batch);
-	const int ret = hc_schedule(hc, batch);
+	ret = hc_schedule(hc, batch);
 	if (ret != EOK) {
 		batch_dispose(batch);
Index: uspace/drv/uhci-rhd/root_hub.h
===================================================================
--- uspace/drv/uhci-rhd/root_hub.h	(revision fec47d4d4a2130ab84e58b61c1e5433ef7bacea3)
+++ uspace/drv/uhci-rhd/root_hub.h	(revision 1c6f4ff244cfa0736f1fa6008c02b5f8ce30c723)
@@ -40,5 +40,5 @@
 
 #define UHCI_ROOT_HUB_PORT_COUNT 2
-#define ROOT_HUB_WAIT_USEC 5000000 /* 5 seconds */
+#define ROOT_HUB_WAIT_USEC 250000 /* 250 miliseconds */
 
 typedef struct root_hub {
