Index: uspace/drv/bus/usb/usbhub/port.c
===================================================================
--- uspace/drv/bus/usb/usbhub/port.c	(revision ef4043421c5f5a6e3e61bddcbe9ae96bc6bc7fb5)
+++ uspace/drv/bus/usb/usbhub/port.c	(revision 0f4bff87621aa4030f08ba0b27a9ce1d627bca2b)
@@ -258,54 +258,13 @@
 	assert(port);
 	assert(hub);
-	async_exch_t *exch = async_exchange_begin(hub->usb_device->bus_session);
+	async_exch_t *exch = usb_device_bus_exchange_begin(hub->usb_device);
 	if (!exch)
 		return ENOMEM;
 	const int rc = usb_device_remove(exch, port->attached_handle);
-	async_exchange_end(exch);
+	usb_device_bus_exchange_end(exch);
 	if (rc == EOK)
 		port->attached_handle = -1;
 	return rc;
 
-#if 0
-	if (port->attached_device.address < 0) {
-		usb_log_warning(
-		    "Device on port %zu removed before being registered.\n",
-		    port->port_number);
-
-		/*
-		 * Device was removed before port reset completed.
-		 * We will announce a failed port reset to unblock the
-		 * port reset callback from new device wrapper.
-		 */
-		usb_hub_port_reset_fail(port);
-		return EOK;
-	}
-
-	fibril_mutex_lock(&port->mutex);
-	assert(port->attached_device.fun);
-	usb_log_debug("Removing device on port %zu.\n", port->port_number);
-	int ret = ddf_fun_unbind(port->attached_device.fun);
-	if (ret != EOK) {
-		usb_log_error("Failed to unbind child function on port"
-		    " %zu: %s.\n", port->port_number, str_error(ret));
-		fibril_mutex_unlock(&port->mutex);
-		return ret;
-	}
-
-	ddf_fun_destroy(port->attached_device.fun);
-	port->attached_device.fun = NULL;
-
-	ret = usb_hub_unregister_device(&hub->usb_device->hc_conn,
-	    &port->attached_device);
-	if (ret != EOK) {
-		usb_log_warning("Failed to unregister address of the "
-		    "removed device: %s.\n", str_error(ret));
-	}
-
-	port->attached_device.address = -1;
-	fibril_mutex_unlock(&port->mutex);
-	usb_log_info("Removed device on port %zu.\n", port->port_number);
-	return EOK;
-#endif
 }
 
@@ -410,38 +369,4 @@
 }
 
-/** Callback for enabling a specific port.
- *
- * We wait on a CV until port is reseted.
- * That is announced via change on interrupt pipe.
- *
- * @param port_no Port number (starting at 1).
- * @param arg Custom argument, points to @c usb_hub_dev_t.
- * @return Error code.
- */
-#if 0
-static int enable_port_callback(void *arg)
-{
-	usb_hub_port_t *port = arg;
-	assert(port);
-	const int rc =
-	    usb_hub_port_set_feature(port, USB_HUB_FEATURE_PORT_RESET);
-	if (rc != EOK) {
-		usb_log_warning("Port reset failed: %s.\n", str_error(rc));
-		return rc;
-	}
-
-	/*
-	 * Wait until reset completes.
-	 */
-	fibril_mutex_lock(&port->mutex);
-	while (!port->reset_completed) {
-		fibril_condvar_wait(&port->reset_cv, &port->mutex);
-	}
-	fibril_mutex_unlock(&port->mutex);
-
-	return port->reset_okay ? EOK : ESTALL;
-}
-#endif
-
 /** Fibril for adding a new device.
  *
@@ -463,7 +388,5 @@
 	free(arg);
 
-	usb_log_fatal("Creating Exchange on session %p\n",
-	    hub->usb_device->bus_session);
-	async_exch_t *exch = async_exchange_begin(hub->usb_device->bus_session);
+	async_exch_t *exch = usb_device_bus_exchange_begin(hub->usb_device);
 	if (!exch) {
 		usb_log_error("Failed to begin bus exchange\n");
@@ -508,5 +431,5 @@
 	}
 out:
-	async_exchange_end(exch);
+	usb_device_bus_exchange_end(exch);
 
 	fibril_mutex_lock(&hub->pending_ops_mutex);
@@ -517,42 +440,4 @@
 
 	return ret;
-#if 0
-	struct add_device_phase1 *data = arg;
-	assert(data);
-
-	usb_address_t new_address;
-	ddf_fun_t *child_fun;
-
-	const int rc = usb_hc_new_device_wrapper(data->hub->usb_device->ddf_dev,
-	    &data->hub->usb_device->hc_conn, data->speed, enable_port_callback,
-	    data->port, &new_address, &child_fun);
-
-	if (rc == EOK) {
-		fibril_mutex_lock(&data->port->mutex);
-		data->port->attached_device.fun = child_fun;
-		data->port->attached_device.address = new_address;
-		fibril_mutex_unlock(&data->port->mutex);
-
-		usb_log_info("Detected new device on `%s' (port %zu), "
-		    "address %d (handle %" PRIun ").\n",
-		    ddf_dev_get_name(data->hub->usb_device->ddf_dev),
-		    data->port->port_number, new_address,
-		    ddf_fun_get_handle(child_fun));
-	} else {
-		usb_log_error("Failed registering device on port %zu: %s.\n",
-		    data->port->port_number, str_error(rc));
-	}
-
-
-	fibril_mutex_lock(&data->hub->pending_ops_mutex);
-	assert(data->hub->pending_ops_count > 0);
-	--data->hub->pending_ops_count;
-	fibril_condvar_signal(&data->hub->pending_ops_cv);
-	fibril_mutex_unlock(&data->hub->pending_ops_mutex);
-
-	free(arg);
-
-	return rc;
-#endif
 }
 
Index: uspace/drv/bus/usb/usbhub/usbhub.c
===================================================================
--- uspace/drv/bus/usb/usbhub/usbhub.c	(revision ef4043421c5f5a6e3e61bddcbe9ae96bc6bc7fb5)
+++ uspace/drv/bus/usb/usbhub/usbhub.c	(revision 0f4bff87621aa4030f08ba0b27a9ce1d627bca2b)
@@ -99,6 +99,7 @@
 	fibril_condvar_initialize(&hub_dev->pending_ops_cv);
 
-
-	int opResult = usb_pipe_start_long_transfer(&usb_dev->ctrl_pipe);
+	usb_pipe_t *control_pipe = usb_device_get_default_pipe(usb_dev);
+
+	int opResult = usb_pipe_start_long_transfer(control_pipe);
 	if (opResult != EOK) {
 		usb_log_error("Failed to start long ctrl pipe transfer: %s\n",
@@ -110,5 +111,5 @@
 	opResult = usb_set_first_configuration(usb_dev);
 	if (opResult != EOK) {
-		usb_pipe_end_long_transfer(&usb_dev->ctrl_pipe);
+		usb_pipe_end_long_transfer(control_pipe);
 		usb_log_error("Could not set hub configuration: %s\n",
 		    str_error(opResult));
@@ -119,5 +120,5 @@
 	opResult = usb_hub_process_hub_specific_info(hub_dev);
 	if (opResult != EOK) {
-		usb_pipe_end_long_transfer(&usb_dev->ctrl_pipe);
+		usb_pipe_end_long_transfer(control_pipe);
 		usb_log_error("Could process hub specific info, %s\n",
 		    str_error(opResult));
@@ -130,5 +131,5 @@
 	    fun_exposed, HUB_FNC_NAME);
 	if (hub_dev->hub_fun == NULL) {
-		usb_pipe_end_long_transfer(&usb_dev->ctrl_pipe);
+		usb_pipe_end_long_transfer(control_pipe);
 		usb_log_error("Failed to create hub function.\n");
 		return ENOMEM;
@@ -138,5 +139,5 @@
 	opResult = ddf_fun_bind(hub_dev->hub_fun);
 	if (opResult != EOK) {
-		usb_pipe_end_long_transfer(&usb_dev->ctrl_pipe);
+		usb_pipe_end_long_transfer(control_pipe);
 		usb_log_error("Failed to bind hub function: %s.\n",
 		   str_error(opResult));
@@ -151,5 +152,5 @@
 	    usb_hub_polling_terminated_callback, hub_dev);
 	if (opResult != EOK) {
-		usb_pipe_end_long_transfer(&usb_dev->ctrl_pipe);
+		usb_pipe_end_long_transfer(control_pipe);
 		/* Function is already bound */
 		ddf_fun_unbind(hub_dev->hub_fun);
@@ -163,5 +164,5 @@
 	    ddf_dev_get_name(hub_dev->usb_device->ddf_dev), hub_dev->port_count);
 
-	usb_pipe_end_long_transfer(&usb_dev->ctrl_pipe);
+	usb_pipe_end_long_transfer(control_pipe);
 	return EOK;
 }
@@ -186,5 +187,5 @@
 {
 	assert(usb_dev);
-	usb_hub_dev_t *hub = usb_dev->driver_data;
+	usb_hub_dev_t *hub = usb_device_data_get(usb_dev);
 	assert(hub);
 	unsigned tries = 10;
@@ -271,5 +272,6 @@
 	/* Get hub descriptor. */
 	usb_log_debug("Retrieving descriptor\n");
-	usb_pipe_t *control_pipe = &hub_dev->usb_device->ctrl_pipe;
+	usb_pipe_t *control_pipe =
+	    usb_device_get_default_pipe(hub_dev->usb_device);
 
 	usb_hub_descriptor_header_t descriptor;
@@ -360,5 +362,5 @@
 
 	// TODO: Make sure that the cast is correct
-	usb_standard_configuration_descriptor_t *config_descriptor
+	const usb_standard_configuration_descriptor_t *config_descriptor
 	    = (usb_standard_configuration_descriptor_t *)
 	    usb_device->descriptors.configuration;
@@ -367,5 +369,6 @@
 	 * usb_device->descriptors.configuration i.e. The first one. */
 	const int opResult = usb_request_set_configuration(
-	    &usb_device->ctrl_pipe, config_descriptor->configuration_number);
+	    usb_device_get_default_pipe(usb_device),
+	    config_descriptor->configuration_number);
 	if (opResult != EOK) {
 		usb_log_error("Failed to set hub configuration: %s.\n",
@@ -427,5 +430,6 @@
 	assert(hub_dev->usb_device);
 	usb_log_debug("Global interrupt on a hub\n");
-	usb_pipe_t *control_pipe = &hub_dev->usb_device->ctrl_pipe;
+	usb_pipe_t *control_pipe =
+	    usb_device_get_default_pipe(hub_dev->usb_device);
 
 	usb_hub_status_t status;
@@ -451,5 +455,5 @@
 		/* Ack change in hub OC flag */
 		const int ret = usb_request_clear_feature(
-		    &hub_dev->usb_device->ctrl_pipe, USB_REQUEST_TYPE_CLASS,
+		    control_pipe, USB_REQUEST_TYPE_CLASS,
 		    USB_REQUEST_RECIPIENT_DEVICE,
 		    USB_HUB_FEATURE_C_HUB_OVER_CURRENT, 0);
Index: uspace/lib/usbdev/include/usb/dev/driver.h
===================================================================
--- uspace/lib/usbdev/include/usb/dev/driver.h	(revision ef4043421c5f5a6e3e61bddcbe9ae96bc6bc7fb5)
+++ uspace/lib/usbdev/include/usb/dev/driver.h	(revision 0f4bff87621aa4030f08ba0b27a9ce1d627bca2b)
@@ -110,4 +110,5 @@
 	 */
 	void *driver_data;
+
 	usb_dev_session_t *bus_session;
 } usb_device_t;
@@ -170,4 +171,7 @@
 void usb_device_deinit(usb_device_t *);
 
+async_exch_t * usb_device_bus_exchange_begin(usb_device_t *);
+void usb_device_bus_exchange_end(async_exch_t *);
+
 int usb_device_select_interface(usb_device_t *, uint8_t,
     const usb_endpoint_description_t **);
@@ -180,6 +184,9 @@
     usb_endpoint_mapping_t **, size_t *);
 void usb_device_destroy_pipes(usb_endpoint_mapping_t *, size_t);
+usb_pipe_t *usb_device_get_default_pipe(usb_device_t *);
+usb_pipe_t *usb_device_get_pipe(usb_device_t *, usb_endpoint_t, usb_direction_t);
 
 void * usb_device_data_alloc(usb_device_t *, size_t);
+void * usb_device_data_get(usb_device_t *);
 
 size_t usb_interface_count_alternates(const uint8_t *, size_t, uint8_t);
Index: uspace/lib/usbdev/src/devdrv.c
===================================================================
--- uspace/lib/usbdev/src/devdrv.c	(revision ef4043421c5f5a6e3e61bddcbe9ae96bc6bc7fb5)
+++ uspace/lib/usbdev/src/devdrv.c	(revision 0f4bff87621aa4030f08ba0b27a9ce1d627bca2b)
@@ -388,4 +388,10 @@
 }
 
+usb_pipe_t *usb_device_get_default_pipe(usb_device_t *usb_dev)
+{
+	assert(usb_dev);
+	return &usb_dev->ctrl_pipe;
+}
+
 /** Initialize new instance of USB device.
  *
@@ -515,4 +521,15 @@
 }
 
+async_exch_t * usb_device_bus_exchange_begin(usb_device_t *usb_dev)
+{
+	assert(usb_dev);
+	return async_exchange_begin(usb_dev->bus_session);
+}
+
+void usb_device_bus_exchange_end(async_exch_t *exch)
+{
+	async_exchange_end(exch);
+}
+
 /** Allocate driver specific data.
  * @param usb_dev usb_device structure.
@@ -528,4 +545,9 @@
 }
 
+void * usb_device_data_get(usb_device_t *usb_dev)
+{
+	assert(usb_dev);
+	return usb_dev->driver_data;
+}
 /**
  * @}
