Index: uspace/drv/bus/usb/ehci/ehci_bus.c
===================================================================
--- uspace/drv/bus/usb/ehci/ehci_bus.c	(revision 69b2dfeeee479d9e4635b9c021ff6493aefd76a6)
+++ uspace/drv/bus/usb/ehci/ehci_bus.c	(revision c6f82e543978d3fafa47bd89b2e23a3d0a86cf50)
@@ -43,10 +43,11 @@
 #include "hc.h"
 
-/** Callback to set toggle on ED.
+/**
+ * Callback to set toggle on ED.
  *
  * @param[in] hcd_ep hcd endpoint structure
  * @param[in] toggle new value of toggle bit
  */
-static void ehci_ep_toggle_reset(endpoint_t *ep)
+void ehci_ep_toggle_reset(endpoint_t *ep)
 {
 	ehci_endpoint_t *instance = ehci_endpoint_get(ep);
@@ -54,5 +55,4 @@
 		usb_log_warning("EP(%p): Resetting toggle bit for transfer directed EP", instance);
 	qh_toggle_set(instance->qh, 0);
-	ep->toggle = 0;
 }
 
@@ -169,10 +169,11 @@
 	.interrupt = ehci_hc_interrupt,
 	.status = ehci_hc_status,
+
 	.endpoint_destroy = ehci_endpoint_destroy,
 	.endpoint_create = ehci_endpoint_create,
 	.endpoint_register = ehci_register_ep,
 	.endpoint_unregister = ehci_unregister_ep,
-	.endpoint_toggle_reset = ehci_ep_toggle_reset,
 	.endpoint_count_bw = bandwidth_count_usb20,
+
 	.batch_create = ehci_create_batch,
 	.batch_destroy = ehci_destroy_batch,
Index: uspace/drv/bus/usb/ehci/ehci_bus.h
===================================================================
--- uspace/drv/bus/usb/ehci/ehci_bus.h	(revision 69b2dfeeee479d9e4635b9c021ff6493aefd76a6)
+++ uspace/drv/bus/usb/ehci/ehci_bus.h	(revision c6f82e543978d3fafa47bd89b2e23a3d0a86cf50)
@@ -68,4 +68,5 @@
 } ehci_bus_t;
 
+void ehci_ep_toggle_reset(endpoint_t *);
 void ehci_bus_prepare_ops(void);
 
Index: uspace/drv/bus/usb/ehci/hc.c
===================================================================
--- uspace/drv/bus/usb/ehci/hc.c	(revision 69b2dfeeee479d9e4635b9c021ff6493aefd76a6)
+++ uspace/drv/bus/usb/ehci/hc.c	(revision c6f82e543978d3fafa47bd89b2e23a3d0a86cf50)
@@ -45,4 +45,5 @@
 #include <usb/debug.h>
 #include <usb/usb.h>
+#include <usb/host/utility.h>
 
 #include "ehci_batch.h"
@@ -379,4 +380,5 @@
 				list_remove(current);
 				endpoint_del_ref(&ep->base);
+				hc_reset_toggles(&batch->base, &ehci_ep_toggle_reset);
 				usb_transfer_batch_finish(&batch->base);
 			}
Index: uspace/drv/bus/usb/ohci/hc.c
===================================================================
--- uspace/drv/bus/usb/ohci/hc.c	(revision 69b2dfeeee479d9e4635b9c021ff6493aefd76a6)
+++ uspace/drv/bus/usb/ohci/hc.c	(revision c6f82e543978d3fafa47bd89b2e23a3d0a86cf50)
@@ -45,4 +45,5 @@
 
 #include <usb/debug.h>
+#include <usb/host/utility.h>
 #include <usb/usb.h>
 
@@ -377,4 +378,5 @@
 				list_remove(current);
 				endpoint_del_ref(&ep->base);
+				hc_reset_toggles(&batch->base, &ohci_ep_toggle_reset);
 				usb_transfer_batch_finish(&batch->base);
 			}
Index: uspace/drv/bus/usb/ohci/hw_struct/endpoint_descriptor.c
===================================================================
--- uspace/drv/bus/usb/ohci/hw_struct/endpoint_descriptor.c	(revision 69b2dfeeee479d9e4635b9c021ff6493aefd76a6)
+++ uspace/drv/bus/usb/ohci/hw_struct/endpoint_descriptor.c	(revision c6f82e543978d3fafa47bd89b2e23a3d0a86cf50)
@@ -100,9 +100,4 @@
 	OHCI_MEM32_WR(instance->td_head, pa & ED_TDHEAD_PTR_MASK);
 	OHCI_MEM32_WR(instance->td_tail, pa & ED_TDTAIL_PTR_MASK);
-
-	/* Set toggle bit */
-	if (ep->toggle)
-		OHCI_MEM32_SET(instance->td_head, ED_TDHEAD_TOGGLE_CARRY);
-
 }
 /**
Index: uspace/drv/bus/usb/ohci/ohci_bus.c
===================================================================
--- uspace/drv/bus/usb/ohci/ohci_bus.c	(revision 69b2dfeeee479d9e4635b9c021ff6493aefd76a6)
+++ uspace/drv/bus/usb/ohci/ohci_bus.c	(revision c6f82e543978d3fafa47bd89b2e23a3d0a86cf50)
@@ -43,15 +43,15 @@
 #include "hc.h"
 
-/** Callback to reset toggle on ED.
+/**
+ * Callback to reset toggle on ED.
  *
  * @param[in] hcd_ep hcd endpoint structure
  * @param[in] toggle new value of toggle bit
  */
-static void ohci_ep_toggle_reset(endpoint_t *ep)
+void ohci_ep_toggle_reset(endpoint_t *ep)
 {
 	ohci_endpoint_t *instance = ohci_endpoint_get(ep);
 	assert(instance);
 	assert(instance->ed);
-	ep->toggle = 0;
 	ed_toggle_set(instance->ed, 0);
 }
@@ -179,5 +179,5 @@
 	.endpoint_unregister = ohci_unregister_ep,
 	.endpoint_count_bw = bandwidth_count_usb11,
-	.endpoint_toggle_reset = ohci_ep_toggle_reset,
+
 	.batch_create = ohci_create_batch,
 	.batch_destroy = ohci_destroy_batch,
Index: uspace/drv/bus/usb/ohci/ohci_bus.h
===================================================================
--- uspace/drv/bus/usb/ohci/ohci_bus.h	(revision 69b2dfeeee479d9e4635b9c021ff6493aefd76a6)
+++ uspace/drv/bus/usb/ohci/ohci_bus.h	(revision c6f82e543978d3fafa47bd89b2e23a3d0a86cf50)
@@ -65,4 +65,5 @@
 
 int ohci_bus_init(ohci_bus_t *, hc_t *);
+void ohci_ep_toggle_reset(endpoint_t *);
 
 /** Get and convert assigned ohci_endpoint_t structure
Index: uspace/drv/bus/usb/uhci/hc.h
===================================================================
--- uspace/drv/bus/usb/uhci/hc.h	(revision 69b2dfeeee479d9e4635b9c021ff6493aefd76a6)
+++ uspace/drv/bus/usb/uhci/hc.h	(revision c6f82e543978d3fafa47bd89b2e23a3d0a86cf50)
@@ -127,4 +127,10 @@
 } hc_t;
 
+typedef struct uhci_endpoint {
+	endpoint_t base;
+
+	bool toggle;
+} uhci_endpoint_t;
+
 static inline hc_t *hcd_to_hc(hc_device_t *hcd)
 {
Index: uspace/drv/bus/usb/uhci/transfer_list.c
===================================================================
--- uspace/drv/bus/usb/uhci/transfer_list.c	(revision 69b2dfeeee479d9e4635b9c021ff6493aefd76a6)
+++ uspace/drv/bus/usb/uhci/transfer_list.c	(revision c6f82e543978d3fafa47bd89b2e23a3d0a86cf50)
@@ -41,7 +41,9 @@
 #include <usb/host/usb_transfer_batch.h>
 #include <usb/host/utils/malloc32.h>
+#include <usb/host/utility.h>
 
 #include "hw_struct/link_pointer.h"
 #include "transfer_list.h"
+#include "hc.h"
 
 /** Initialize transfer list structures.
@@ -155,4 +157,13 @@
 }
 
+/**
+ * Reset toggle on endpoint callback.
+ */
+static void uhci_reset_toggle(endpoint_t *ep)
+{
+	uhci_endpoint_t *uhci_ep = (uhci_endpoint_t *) ep;
+	uhci_ep->toggle = 0;
+}
+
 /** Add completed batches to the provided list.
  *
@@ -176,4 +187,5 @@
 			fibril_mutex_lock(&batch->base.ep->guard);
 			assert(batch->base.ep->active_batch == &batch->base);
+			hc_reset_toggles(&batch->base, &uhci_reset_toggle);
 			endpoint_deactivate_locked(batch->base.ep);
 			transfer_list_remove_batch(instance, batch);
Index: uspace/drv/bus/usb/uhci/uhci_batch.c
===================================================================
--- uspace/drv/bus/usb/uhci/uhci_batch.c	(revision 69b2dfeeee479d9e4635b9c021ff6493aefd76a6)
+++ uspace/drv/bus/usb/uhci/uhci_batch.c	(revision c6f82e543978d3fafa47bd89b2e23a3d0a86cf50)
@@ -46,4 +46,5 @@
 
 #include "uhci_batch.h"
+#include "hc.h"
 #include "hw_struct/transfer_descriptor.h"
 
@@ -164,4 +165,6 @@
 	batch->transfered_size = 0;
 
+	uhci_endpoint_t *uhci_ep = (uhci_endpoint_t *) batch->ep;
+
 	for (size_t i = 0;i < uhci_batch->td_count; ++i) {
 		if (td_is_active(&uhci_batch->tds[i])) {
@@ -178,5 +181,5 @@
 			td_print_status(&uhci_batch->tds[i]);
 
-			batch->ep->toggle = td_toggle(&uhci_batch->tds[i]);
+			uhci_ep->toggle = td_toggle(&uhci_batch->tds[i]);
 			goto substract_ret;
 		}
@@ -230,5 +233,7 @@
 	const size_t mps = uhci_batch->base.ep->max_packet_size;
 
-	int toggle = uhci_batch->base.ep->toggle;
+	uhci_endpoint_t *uhci_ep = (uhci_endpoint_t *) uhci_batch->base.ep;
+
+	int toggle = uhci_ep->toggle;
 	assert(toggle == 0 || toggle == 1);
 
@@ -254,5 +259,5 @@
 	}
 	td_set_ioc(&uhci_batch->tds[td - 1]);
-	uhci_batch->base.ep->toggle = toggle;
+	uhci_ep->toggle = toggle;
 	usb_log_debug2(
 	    "Batch %p %s %s " USB_TRANSFER_BATCH_FMT " initialized.", \
Index: uspace/lib/usbhost/include/usb/host/bus.h
===================================================================
--- uspace/lib/usbhost/include/usb/host/bus.h	(revision 69b2dfeeee479d9e4635b9c021ff6493aefd76a6)
+++ uspace/lib/usbhost/include/usb/host/bus.h	(revision c6f82e543978d3fafa47bd89b2e23a3d0a86cf50)
@@ -115,5 +115,4 @@
 	void (*endpoint_unregister)(endpoint_t *);
 	void (*endpoint_destroy)(endpoint_t *);			/**< Optional */
-	void (*endpoint_toggle_reset)(endpoint_t *);		/**< Optional */
 	ssize_t (*endpoint_count_bw) (endpoint_t *, size_t);	/**< Optional */
 	usb_transfer_batch_t *(*batch_create)(endpoint_t *);	/**< Optional */
Index: uspace/lib/usbhost/include/usb/host/endpoint.h
===================================================================
--- uspace/lib/usbhost/include/usb/host/endpoint.h	(revision 69b2dfeeee479d9e4635b9c021ff6493aefd76a6)
+++ uspace/lib/usbhost/include/usb/host/endpoint.h	(revision c6f82e543978d3fafa47bd89b2e23a3d0a86cf50)
@@ -61,6 +61,4 @@
 	/** Reserved bandwidth. */
 	size_t bandwidth;
-	/** Value of the toggle bit. Untouched by the library. */
-	unsigned toggle:1;
 	/** The currently active transfer batch. Write using methods, read under guard. */
 	usb_transfer_batch_t *active_batch;
Index: uspace/lib/usbhost/include/usb/host/usb_transfer_batch.h
===================================================================
--- uspace/lib/usbhost/include/usb/host/usb_transfer_batch.h	(revision 69b2dfeeee479d9e4635b9c021ff6493aefd76a6)
+++ uspace/lib/usbhost/include/usb/host/usb_transfer_batch.h	(revision c6f82e543978d3fafa47bd89b2e23a3d0a86cf50)
@@ -52,11 +52,4 @@
 typedef struct bus bus_t;
 
-/** How many toggles need to be reset */
-typedef enum {
-	RESET_NONE,
-	RESET_EP,
-	RESET_ALL
-} toggle_reset_mode_t;
-
 /** Structure stores additional data needed for communication with EP */
 typedef struct usb_transfer_batch {
@@ -81,7 +74,4 @@
 		uint64_t packed;
 	} setup;
-
-	/** Resetting the Toggle */
-	toggle_reset_mode_t toggle_reset_mode;
 
 	/** Place for data to send/receive */
Index: uspace/lib/usbhost/include/usb/host/utility.h
===================================================================
--- uspace/lib/usbhost/include/usb/host/utility.h	(revision 69b2dfeeee479d9e4635b9c021ff6493aefd76a6)
+++ uspace/lib/usbhost/include/usb/host/utility.h	(revision c6f82e543978d3fafa47bd89b2e23a3d0a86cf50)
@@ -44,6 +44,8 @@
 #include <usb/request.h>
 
+typedef void (*endpoint_reset_toggle_t)(endpoint_t *);
+
 int hc_get_ep0_max_packet_size(uint16_t *, bus_t *, device_t *);
-toggle_reset_mode_t hc_get_request_toggle_reset_mode(const usb_device_request_setup_packet_t *request);
+void hc_reset_toggles(const usb_transfer_batch_t *batch, endpoint_reset_toggle_t);
 int hc_setup_virtual_root_hub(hc_device_t *);
 int hc_get_device_desc(device_t *, usb_standard_device_descriptor_t *);
Index: uspace/lib/usbhost/src/endpoint.c
===================================================================
--- uspace/lib/usbhost/src/endpoint.c	(revision 69b2dfeeee479d9e4635b9c021ff6493aefd76a6)
+++ uspace/lib/usbhost/src/endpoint.c	(revision c6f82e543978d3fafa47bd89b2e23a3d0a86cf50)
@@ -121,6 +121,4 @@
 }
 
-static void endpoint_toggle_reset(endpoint_t *ep, toggle_reset_mode_t mode);
-
 /**
  * Wait until the endpoint have no transfer scheduled.
@@ -166,40 +164,6 @@
 	assert(ep);
 	assert(fibril_mutex_is_locked(&ep->guard));
-
-	if (ep->active_batch && ep->active_batch->error == EOK)
-		endpoint_toggle_reset(ep, ep->active_batch->toggle_reset_mode);
-
 	ep->active_batch = NULL;
 	fibril_condvar_signal(&ep->avail);
-}
-
-/**
- * The transfer on an endpoint can trigger a reset of the toggle bit. This
- * function calls the respective bus callbacks to resolve it.
- *
- * @param ep The endpoint that triggered the reset
- * @param mode Whether to reset no, one or all endpoints on a device.
- */
-static void endpoint_toggle_reset(endpoint_t *ep, toggle_reset_mode_t mode)
-{
-	assert(ep);
-
-	if (mode == RESET_NONE)
-		return;
-
-	const bus_ops_t *ops = BUS_OPS_LOOKUP(get_bus_ops(ep), endpoint_toggle_reset);
-	if (!ops)
-		return;
-
-
-	if (mode == RESET_ALL) {
-		const device_t *dev = ep->device;
-		for (usb_endpoint_t i = 0; i < USB_ENDPOINT_MAX; ++i) {
-			if (dev->endpoints[i])
-				ops->endpoint_toggle_reset(dev->endpoints[i]);
-		}
-	} else {
-		ops->endpoint_toggle_reset(ep);
-	}
 }
 
@@ -282,9 +246,4 @@
 	batch->on_complete_data = arg;
 
-	/* Check for commands that reset toggle bit */
-	if (ep->transfer_type == USB_TRANSFER_CONTROL)
-		batch->toggle_reset_mode
-			= hc_get_request_toggle_reset_mode(&batch->setup.packet);
-
 	const int ret = ops->batch_schedule(batch);
 	if (ret != EOK) {
Index: uspace/lib/usbhost/src/utility.c
===================================================================
--- uspace/lib/usbhost/src/utility.c	(revision 69b2dfeeee479d9e4635b9c021ff6493aefd76a6)
+++ uspace/lib/usbhost/src/utility.c	(revision c6f82e543978d3fafa47bd89b2e23a3d0a86cf50)
@@ -37,4 +37,5 @@
 #include <usb/debug.h>
 #include <usb/descriptor.h>
+#include <usb/request.h>
 
 #include "ddf_helpers.h"
@@ -101,16 +102,133 @@
 }
 
-/** Check setup packet data for signs of toggle reset.
- *
- * @param[in] requst Setup requst data.
- *
- * @retval -1 No endpoints need reset.
- * @retval 0 All endpoints need reset.
- * @retval >0 Specified endpoint needs reset.
- *
- */
-toggle_reset_mode_t hc_get_request_toggle_reset_mode(const usb_device_request_setup_packet_t *request)
-{
-	assert(request);
+int hc_get_device_desc(device_t *device, usb_standard_device_descriptor_t *desc)
+{
+	const usb_target_t control_ep = {{
+		.address = device->address,
+		.endpoint = 0,
+	}};
+
+	/* Get std device descriptor */
+	const usb_device_request_setup_packet_t get_device_desc =
+	    GET_DEVICE_DESC(sizeof(*desc));
+
+	usb_log_debug("Device(%d): Requesting full device descriptor.",
+	    device->address);
+	ssize_t got = bus_device_send_batch_sync(device, control_ep, USB_DIRECTION_IN,
+	    (char *) desc, sizeof(*desc), *(uint64_t *)&get_device_desc,
+	    "read device descriptor");
+
+	if (got < 0)
+		return got;
+
+	return got == sizeof(*desc) ? EOK : EOVERFLOW;
+}
+
+int hc_get_hub_desc(device_t *device, usb_hub_descriptor_header_t *desc)
+{
+	const usb_target_t control_ep = {{
+		.address = device->address,
+		.endpoint = 0,
+	}};
+
+	const usb_device_request_setup_packet_t get_hub_desc = {
+		.request_type = SETUP_REQUEST_TYPE_DEVICE_TO_HOST
+		    | (USB_REQUEST_TYPE_CLASS << 5)
+		    | USB_REQUEST_RECIPIENT_DEVICE,
+		.request = USB_DEVREQ_GET_DESCRIPTOR, \
+		.value = uint16_host2usb(USB_DESCTYPE_HUB << 8), \
+		.length = sizeof(*desc),
+	};
+
+	usb_log_debug("Device(%d): Requesting hub descriptor.",
+	    device->address);
+	ssize_t got = bus_device_send_batch_sync(device, control_ep, USB_DIRECTION_IN,
+	    (char *) desc, sizeof(*desc), *(uint64_t *)&get_hub_desc,
+	    "get hub descriptor");
+
+	if (got < 0)
+		return got;
+
+	return got == sizeof(*desc) ? EOK : EOVERFLOW;
+}
+
+int hc_device_explore(device_t *device)
+{
+	int err;
+	usb_standard_device_descriptor_t desc = { 0 };
+
+	if ((err = hc_get_device_desc(device, &desc))) {
+		usb_log_error("Device(%d): Failed to get dev descriptor: %s",
+		    device->address, str_error(err));
+		return err;
+	}
+
+	if ((err = hcd_ddf_setup_match_ids(device, &desc))) {
+		usb_log_error("Device(%d): Failed to setup match ids: %s", device->address, str_error(err));
+		return err;
+	}
+
+	return EOK;
+}
+
+/** Announce root hub to the DDF
+ *
+ * @param[in] device Host controller ddf device
+ * @return Error code
+ */
+int hc_setup_virtual_root_hub(hc_device_t *hcd)
+{
+	int err;
+
+	assert(hcd);
+
+	device_t *dev = hcd_ddf_fun_create(hcd, USB_SPEED_MAX);
+	if (!dev) {
+		usb_log_error("Failed to create function for the root hub.");
+		return ENOMEM;
+	}
+
+	ddf_fun_set_name(dev->fun, "roothub");
+
+	/* Assign an address to the device */
+	if ((err = bus_device_enumerate(dev))) {
+		usb_log_error("Failed to enumerate roothub device: %s", str_error(err));
+		goto err_usb_dev;
+	}
+
+	if ((err = ddf_fun_bind(dev->fun))) {
+		usb_log_error("Failed to register roothub: %s.", str_error(err));
+		goto err_enumerated;
+	}
+
+	return EOK;
+
+err_enumerated:
+	bus_device_gone(dev);
+err_usb_dev:
+	hcd_ddf_fun_destroy(dev);
+	return err;
+}
+
+/** How many toggles need to be reset */
+typedef enum {
+	RESET_NONE,
+	RESET_EP,
+	RESET_ALL
+} toggle_reset_mode_t;
+
+/**
+ * Check setup packet data for signs of toggle reset.
+ *
+ * @param[in] batch USB batch
+ */
+static toggle_reset_mode_t get_request_toggle_reset_mode(const usb_transfer_batch_t *batch)
+{
+	if (batch->ep->transfer_type != USB_TRANSFER_CONTROL
+	    || batch->dir != USB_DIRECTION_OUT)
+		return RESET_NONE;
+
+	const usb_device_request_setup_packet_t *request = &batch->setup.packet;
+
 	switch (request->request)
 	{
@@ -139,111 +257,27 @@
 }
 
-int hc_get_device_desc(device_t *device, usb_standard_device_descriptor_t *desc)
-{
-	const usb_target_t control_ep = {{
-		.address = device->address,
-		.endpoint = 0,
-	}};
-
-	/* Get std device descriptor */
-	const usb_device_request_setup_packet_t get_device_desc =
-	    GET_DEVICE_DESC(sizeof(*desc));
-
-	usb_log_debug("Device(%d): Requesting full device descriptor.",
-	    device->address);
-	ssize_t got = bus_device_send_batch_sync(device, control_ep, USB_DIRECTION_IN,
-	    (char *) desc, sizeof(*desc), *(uint64_t *)&get_device_desc,
-	    "read device descriptor");
-
-	if (got < 0)
-		return got;
-
-	return got == sizeof(*desc) ? EOK : EOVERFLOW;
-}
-
-int hc_get_hub_desc(device_t *device, usb_hub_descriptor_header_t *desc)
-{
-	const usb_target_t control_ep = {{
-		.address = device->address,
-		.endpoint = 0,
-	}};
-
-	const usb_device_request_setup_packet_t get_hub_desc = {
-		.request_type = SETUP_REQUEST_TYPE_DEVICE_TO_HOST
-		    | (USB_REQUEST_TYPE_CLASS << 5)
-		    | USB_REQUEST_RECIPIENT_DEVICE,
-		.request = USB_DEVREQ_GET_DESCRIPTOR, \
-		.value = uint16_host2usb(USB_DESCTYPE_HUB << 8), \
-		.length = sizeof(*desc),
-	};
-
-	usb_log_debug("Device(%d): Requesting hub descriptor.",
-	    device->address);
-	ssize_t got = bus_device_send_batch_sync(device, control_ep, USB_DIRECTION_IN,
-	    (char *) desc, sizeof(*desc), *(uint64_t *)&get_hub_desc,
-	    "get hub descriptor");
-
-	if (got < 0)
-		return got;
-
-	return got == sizeof(*desc) ? EOK : EOVERFLOW;
-}
-
-int hc_device_explore(device_t *device)
-{
-	int err;
-	usb_standard_device_descriptor_t desc = { 0 };
-
-	if ((err = hc_get_device_desc(device, &desc))) {
-		usb_log_error("Device(%d): Failed to get dev descriptor: %s",
-		    device->address, str_error(err));
-		return err;
-	}
-
-	if ((err = hcd_ddf_setup_match_ids(device, &desc))) {
-		usb_log_error("Device(%d): Failed to setup match ids: %s", device->address, str_error(err));
-		return err;
-	}
-
-	return EOK;
-}
-
-/** Announce root hub to the DDF
- *
- * @param[in] device Host controller ddf device
- * @return Error code
- */
-int hc_setup_virtual_root_hub(hc_device_t *hcd)
-{
-	int err;
-
-	assert(hcd);
-
-	device_t *dev = hcd_ddf_fun_create(hcd, USB_SPEED_MAX);
-	if (!dev) {
-		usb_log_error("Failed to create function for the root hub.");
-		return ENOMEM;
-	}
-
-	ddf_fun_set_name(dev->fun, "roothub");
-
-	/* Assign an address to the device */
-	if ((err = bus_device_enumerate(dev))) {
-		usb_log_error("Failed to enumerate roothub device: %s", str_error(err));
-		goto err_usb_dev;
-	}
-
-	if ((err = ddf_fun_bind(dev->fun))) {
-		usb_log_error("Failed to register roothub: %s.", str_error(err));
-		goto err_enumerated;
-	}
-
-	return EOK;
-
-err_enumerated:
-	bus_device_gone(dev);
-err_usb_dev:
-	hcd_ddf_fun_destroy(dev);
-	return err;
+void hc_reset_toggles(const usb_transfer_batch_t *batch, endpoint_reset_toggle_t reset_cb)
+{
+	assert(reset_cb);
+	assert(batch->ep);
+	assert(batch->ep->device);
+
+	if (batch->error != EOK)
+		return;
+
+	toggle_reset_mode_t mode = get_request_toggle_reset_mode(batch);
+
+	if (mode == RESET_NONE)
+		return;
+
+	if (mode == RESET_ALL) {
+		const device_t *dev = batch->ep->device;
+		for (usb_endpoint_t i = 0; i < 2 * USB_ENDPOINT_MAX; ++i) {
+			if (dev->endpoints[i])
+				reset_cb(dev->endpoints[i]);
+		}
+	} else {
+		reset_cb(batch->ep);
+	}
 }
 
