Index: uspace/lib/usb/src/host/device_keeper.c
===================================================================
--- uspace/lib/usb/src/host/device_keeper.c	(revision 88dd355c45fef3b9eb9ec629a6161bfca2682fe1)
+++ uspace/lib/usb/src/host/device_keeper.c	(revision 8dc762e047944f4eeb1b533176031bd8bfe58813)
@@ -63,5 +63,12 @@
 /*----------------------------------------------------------------------------*/
 void usb_device_keeper_add_ep(
-    usb_device_keeper_t *instance, usb_address_t address, link_t *ep);
+    usb_device_keeper_t *instance, usb_address_t address, link_t *ep)
+{
+	assert(instance);
+	fibril_mutex_lock(&instance->guard);
+	assert(instance->devices[address].occupied);
+	list_append(ep, &instance->devices[address].endpoints);
+	fibril_mutex_unlock(&instance->guard);
+}
 /*----------------------------------------------------------------------------*/
 /** Attempt to obtain address 0, blocks.
Index: uspace/lib/usb/src/host/endpoint.c
===================================================================
--- uspace/lib/usb/src/host/endpoint.c	(revision 8dc762e047944f4eeb1b533176031bd8bfe58813)
+++ uspace/lib/usb/src/host/endpoint.c	(revision 8dc762e047944f4eeb1b533176031bd8bfe58813)
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2011 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 drvusbuhcihc
+ * @{
+ */
+/** @file
+ * @brief UHCI host controller driver structure
+ */
+
+#include <errno.h>
+
+#include <usb/host/endpoint.h>
+
+int endpoint_init(endpoint_t *instance, usb_transfer_type_t transfer_type,
+    usb_speed_t speed, size_t max_packet_size)
+{
+	assert(instance);
+	link_initialize(&instance->same_device_eps);
+	instance->transfer_type = transfer_type;
+	instance->speed = speed;
+	instance->max_packet_size = max_packet_size;
+	instance->toggle = 0;
+	return EOK;
+}
+/*----------------------------------------------------------------------------*/
+void endpoint_destroy(endpoint_t *instance)
+{
+	assert(instance);
+	list_remove(&instance->same_device_eps);
+	free(instance);
+}
+/*----------------------------------------------------------------------------*/
+void endpoint_toggle_reset(link_t *ep)
+{
+	endpoint_t *instance =
+	    list_get_instance(ep, endpoint_t, same_device_eps);
+	assert(instance);
+	instance->toggle = 0;
+}
+/**
+ * @}
+ */
Index: uspace/lib/usb/src/host/usb_endpoint_manager.c
===================================================================
--- uspace/lib/usb/src/host/usb_endpoint_manager.c	(revision 88dd355c45fef3b9eb9ec629a6161bfca2682fe1)
+++ uspace/lib/usb/src/host/usb_endpoint_manager.c	(revision 8dc762e047944f4eeb1b533176031bd8bfe58813)
@@ -48,9 +48,8 @@
 	link_t link;
 	size_t bw;
-	void *data;
-	void (*data_remove_callback)(void* data);
-} ep_t;
-/*----------------------------------------------------------------------------*/
-static hash_index_t ep_hash(unsigned long key[])
+	endpoint_t *ep;
+} node_t;
+/*----------------------------------------------------------------------------*/
+static hash_index_t node_hash(unsigned long key[])
 {
 	hash_index_t hash = 0;
@@ -63,11 +62,11 @@
 }
 /*----------------------------------------------------------------------------*/
-static int ep_compare(unsigned long key[], hash_count_t keys, link_t *item)
+static int node_compare(unsigned long key[], hash_count_t keys, link_t *item)
 {
 	assert(item);
-	ep_t *ep = hash_table_get_instance(item, ep_t, link);
+	node_t *node = hash_table_get_instance(item, node_t, link);
 	hash_count_t i = 0;
 	for (; i < keys; ++i) {
-		if (key[i] != ep->key[i])
+		if (key[i] != node->key[i])
 			return false;
 	}
@@ -75,17 +74,16 @@
 }
 /*----------------------------------------------------------------------------*/
-static void ep_remove(link_t *item)
+static void node_remove(link_t *item)
 {
 	assert(item);
-	ep_t *ep =
-	    hash_table_get_instance(item, ep_t, link);
-	ep->data_remove_callback(ep->data);
-	free(ep);
+	node_t *node = hash_table_get_instance(item, node_t, link);
+	endpoint_destroy(node->ep);
+	free(node);
 }
 /*----------------------------------------------------------------------------*/
 static hash_table_operations_t op = {
-	.hash = ep_hash,
-	.compare = ep_compare,
-	.remove_callback = ep_remove,
+	.hash = node_hash,
+	.compare = node_compare,
+	.remove_callback = node_remove,
 };
 /*----------------------------------------------------------------------------*/
@@ -145,6 +143,9 @@
 int usb_endpoint_manager_register_ep(usb_endpoint_manager_t *instance,
     usb_address_t address, usb_endpoint_t endpoint, usb_direction_t direction,
-    void *data, void (*data_remove_callback)(void* data), size_t bw)
-{
+    endpoint_t *ep, size_t data_size)
+{
+	assert(ep);
+	size_t bw = bandwidth_count_usb11(ep->speed, ep->transfer_type,
+	    data_size, ep->max_packet_size);
 	assert(instance);
 
@@ -168,16 +169,17 @@
 	}
 
-	ep_t *ep = malloc(sizeof(ep_t));
-	if (ep == NULL) {
+	node_t *node = malloc(sizeof(node_t));
+	if (node == NULL) {
 		fibril_mutex_unlock(&instance->guard);
 		return ENOMEM;
 	}
 
-	ep->id = id;
-	ep->bw = bw;
-	ep->data = data;
-	link_initialize(&ep->link);
-
-	hash_table_insert(&instance->ep_table, (unsigned long*)&id, &ep->link);
+	node->id = id;
+	node->bw = bw;
+	node->ep = ep;
+	link_initialize(&node->link);
+
+	hash_table_insert(&instance->ep_table,
+	    (unsigned long*)&id, &node->link);
 	instance->free_bw -= bw;
 	fibril_mutex_unlock(&instance->guard);
@@ -203,6 +205,6 @@
 	}
 
-	ep_t *ep = hash_table_get_instance(item, ep_t, link);
-	instance->free_bw += ep->bw;
+	node_t *node = hash_table_get_instance(item, node_t, link);
+	instance->free_bw += node->bw;
 	hash_table_remove(&instance->ep_table, (unsigned long*)&id, MAX_KEYS);
 
@@ -212,5 +214,5 @@
 }
 /*----------------------------------------------------------------------------*/
-void * usb_endpoint_manager_get_ep_data(usb_endpoint_manager_t *instance,
+endpoint_t * usb_endpoint_manager_get_ep(usb_endpoint_manager_t *instance,
     usb_address_t address, usb_endpoint_t endpoint, usb_direction_t direction,
     size_t *bw)
@@ -229,9 +231,9 @@
 		return NULL;
 	}
-	ep_t *ep = hash_table_get_instance(item, ep_t, link);
+	node_t *node = hash_table_get_instance(item, node_t, link);
 	if (bw)
-		*bw = ep->bw;
+		*bw = node->bw;
 
 	fibril_mutex_unlock(&instance->guard);
-	return ep->data;
-}
+	return node->ep;
+}
