Index: uspace/drv/uhci-hcd/endpoint.c
===================================================================
--- uspace/drv/uhci-hcd/endpoint.c	(revision fb8927d7e12bfafe2cd8b4ef6d343bffe2f5bf54)
+++ uspace/drv/uhci-hcd/endpoint.c	(revision 1e7015755f65dfcb9f747089dadc580b8ddd0952)
@@ -34,7 +34,10 @@
  */
 
+#include <errno.h>
+
 #include "endpoint.h"
+#include "utils/malloc32.h"
 
-void endpoint_init(endpoint_t *instance, usb_transfer_type_t transfer_type,
+int endpoint_init(endpoint_t *instance, usb_transfer_type_t transfer_type,
     usb_speed_t speed, size_t max_packet_size)
 {
@@ -45,10 +48,25 @@
 	instance->max_packet_size = max_packet_size;
 	instance->toggle = 0;
+	instance->qh = malloc32(sizeof(qh_t));
+	if (instance->qh == NULL)
+		return ENOMEM;
+	return EOK;
 }
 /*----------------------------------------------------------------------------*/
-void endpoint_destroy(void *instance)
+void endpoint_destroy(void *ep)
 {
+	endpoint_t *instance = ep;
 	assert(instance);
+	list_remove(&instance->same_device_eps);
+	free32(instance->qh);
 	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/drv/uhci-hcd/endpoint.h
===================================================================
--- uspace/drv/uhci-hcd/endpoint.h	(revision fb8927d7e12bfafe2cd8b4ef6d343bffe2f5bf54)
+++ uspace/drv/uhci-hcd/endpoint.h	(revision 1e7015755f65dfcb9f747089dadc580b8ddd0952)
@@ -41,4 +41,6 @@
 #include <usb/usb.h>
 
+#include "hw_struct/queue_head.h"
+
 typedef struct endpoint {
 	link_t same_device_eps;
@@ -48,10 +50,13 @@
 	bool active;
 	int toggle:1;
+	qh_t *qh;
 } endpoint_t;
 
-void endpoint_init(endpoint_t *instance, usb_transfer_type_t transfer_type,
+int endpoint_init(endpoint_t *instance, usb_transfer_type_t transfer_type,
     usb_speed_t speed, size_t max_packet_size);
 
-void endpoint_destroy(void *instance);
+void endpoint_destroy(void *ep);
+
+void endpoint_toggle_reset(link_t *ep);
 
 #endif
Index: uspace/drv/uhci-hcd/hw_struct/queue_head.h
===================================================================
--- uspace/drv/uhci-hcd/hw_struct/queue_head.h	(revision fb8927d7e12bfafe2cd8b4ef6d343bffe2f5bf54)
+++ uspace/drv/uhci-hcd/hw_struct/queue_head.h	(revision 1e7015755f65dfcb9f747089dadc580b8ddd0952)
@@ -39,5 +39,4 @@
 
 #include "link_pointer.h"
-#include "utils/malloc32.h"
 
 typedef struct queue_head {
Index: uspace/drv/uhci-hcd/iface.c
===================================================================
--- uspace/drv/uhci-hcd/iface.c	(revision fb8927d7e12bfafe2cd8b4ef6d343bffe2f5bf54)
+++ uspace/drv/uhci-hcd/iface.c	(revision 1e7015755f65dfcb9f747089dadc580b8ddd0952)
@@ -160,9 +160,14 @@
 	    usb_device_keeper_get_speed(&hc->manager, address);
 	const size_t size = max_packet_size;
+	int ret;
 
 	endpoint_t *ep = malloc(sizeof(endpoint_t));
 	if (ep == NULL)
 		return ENOMEM;
-	endpoint_init(ep, transfer_type, speed, max_packet_size);
+	ret = endpoint_init(ep, transfer_type, speed, max_packet_size);
+	if (ret != EOK) {
+		free(ep);
+		return ret;
+	}
 
 	usb_log_debug("Register endpoint %d:%d %s %s(%d) %zu(%zu) %u.\n",
@@ -176,8 +181,10 @@
 	    0;
 
-	int ret = usb_endpoint_manager_register_ep(&hc->ep_manager,
+	ret = usb_endpoint_manager_register_ep(&hc->ep_manager,
 	    address, endpoint, direction, ep, endpoint_destroy, bw);
 	if (ret != EOK) {
 		endpoint_destroy(ep);
+	} else {
+		usb_device_keeper_add_ep(&hc->manager, address, &ep->same_device_eps);
 	}
 	return ret;
@@ -345,5 +352,4 @@
 	assert(ep->transfer_type == USB_TRANSFER_BULK);
 
-
 	usb_transfer_batch_t *batch =
 	    batch_get(fun, target, ep->transfer_type, ep->max_packet_size,
@@ -394,6 +400,7 @@
 
 	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, &hc->manager);
+	    batch_get(fun, target, ep->transfer_type, ep->max_packet_size,
+	        ep->speed, data, size, NULL, 0, callback, NULL, arg,
+		&hc->manager);
 	if (!batch)
 		return ENOMEM;
Index: uspace/drv/uhci-hcd/transfer_list.h
===================================================================
--- uspace/drv/uhci-hcd/transfer_list.h	(revision fb8927d7e12bfafe2cd8b4ef6d343bffe2f5bf54)
+++ uspace/drv/uhci-hcd/transfer_list.h	(revision 1e7015755f65dfcb9f747089dadc580b8ddd0952)
@@ -39,4 +39,5 @@
 #include "batch.h"
 #include "hw_struct/queue_head.h"
+#include "utils/malloc32.h"
 
 typedef struct transfer_list
Index: uspace/drv/uhci-hcd/utils/malloc32.h
===================================================================
--- uspace/drv/uhci-hcd/utils/malloc32.h	(revision fb8927d7e12bfafe2cd8b4ef6d343bffe2f5bf54)
+++ uspace/drv/uhci-hcd/utils/malloc32.h	(revision 1e7015755f65dfcb9f747089dadc580b8ddd0952)
@@ -36,4 +36,5 @@
 
 #include <assert.h>
+#include <errno.h>
 #include <malloc.h>
 #include <mem.h>
