Index: uspace/app/usbinfo/info.c
===================================================================
--- uspace/app/usbinfo/info.c	(revision 79d2987615b780d65a2ce85f69be6227caa7ecb1)
+++ uspace/app/usbinfo/info.c	(revision 4e8e1f51aca228845c8d503a3f52fbf34a47bb20)
@@ -39,4 +39,5 @@
 #include <usb/usbdrv.h>
 #include <usb/pipes.h>
+#include <usb/recognise.h>
 #include <usb/request.h>
 #include "usbinfo.h"
@@ -47,27 +48,4 @@
 	usb_device_connection_t wire;
 	usb_endpoint_pipe_t ctrl_pipe;
-	ctrl_pipe.hc_phone = -1;
-
-	int hc_phone = devman_device_connect(hc_handle, 0);
-	if (hc_phone < 0) {
-		fprintf(stderr,
-		    NAME ": failed to connect to host controller (%zu): %s.\n",
-		        (size_t) hc_handle, str_error(hc_phone));
-		return hc_phone;
-	}
-
-	/*
-	 * Dump information about possible match ids.
-	 */
-	match_id_list_t match_id_list;
-	init_match_ids(&match_id_list);
-	rc = usb_drv_create_device_match_ids(hc_phone, &match_id_list, address);
-	if (rc != EOK) {
-		fprintf(stderr,
-		    NAME ": failed to fetch match ids of the device: %s.\n",
-		    str_error(rc));
-		goto leave;
-	}
-	dump_match_ids(&match_id_list);
 
 	/*
@@ -95,4 +73,18 @@
 		goto leave;
 	}
+
+	/*
+	 * Dump information about possible match ids.
+	 */
+	match_id_list_t match_id_list;
+	init_match_ids(&match_id_list);
+	rc = usb_device_create_match_ids(&ctrl_pipe, &match_id_list);
+	if (rc != EOK) {
+		fprintf(stderr,
+		    NAME ": failed to fetch match ids of the device: %s.\n",
+		    str_error(rc));
+		goto leave;
+	}
+	dump_match_ids(&match_id_list);
 
 	/*
@@ -141,5 +133,4 @@
 leave:
 	/* Ignoring errors here. */
-	async_hangup(hc_phone);
 	usb_endpoint_pipe_end_session(&ctrl_pipe);
 
Index: uspace/drv/uhci-rhd/port.c
===================================================================
--- uspace/drv/uhci-rhd/port.c	(revision 79d2987615b780d65a2ce85f69be6227caa7ecb1)
+++ uspace/drv/uhci-rhd/port.c	(revision 4e8e1f51aca228845c8d503a3f52fbf34a47bb20)
@@ -33,8 +33,10 @@
  */
 #include <errno.h>
+#include <str_error.h>
 
 #include <usb/usb.h>    /* usb_address_t */
 #include <usb/usbdrv.h> /* usb_drv_*     */
 #include <usb/debug.h>
+#include <usb/recognise.h>
 
 #include "port.h"
@@ -204,7 +206,15 @@
 	assert(port->attached_device == 0);
 
-	ret = usb_drv_register_child_in_devman(port->hc_phone, port->rh,
-	  usb_address, &port->attached_device);
-
+	devman_handle_t hc_handle;
+	ret = usb_drv_find_hc(port->rh, &hc_handle);
+	if (ret != EOK) {
+		usb_log_error("Failed to get handle of host controller: %s.\n",
+		    str_error(ret));
+		uhci_port_set_enabled(port, false);
+		return ENOMEM;
+	}
+
+	ret = usb_device_register_child_in_devman(usb_address, hc_handle,
+	    port->rh, &port->attached_device);
 	if (ret != EOK) { /* something went wrong */
 		usb_log_error("Failed(%d) in usb_drv_register_child.\n", ret);
Index: uspace/drv/usbhub/usbhub.c
===================================================================
--- uspace/drv/usbhub/usbhub.c	(revision 79d2987615b780d65a2ce85f69be6227caa7ecb1)
+++ uspace/drv/usbhub/usbhub.c	(revision 4e8e1f51aca228845c8d503a3f52fbf34a47bb20)
@@ -36,8 +36,10 @@
 #include <bool.h>
 #include <errno.h>
+#include <str_error.h>
 
 #include <usb_iface.h>
 #include <usb/usbdrv.h>
 #include <usb/descriptor.h>
+#include <usb/recognise.h>
 #include <usb/devreq.h>
 #include <usb/classes/hub.h>
@@ -317,7 +319,15 @@
 	}
 
+	devman_handle_t hc_handle;
+	opResult = usb_drv_find_hc(hub->device, &hc_handle);
+	if (opResult != EOK) {
+		usb_log_error("Failed to get handle of host controller: %s.\n",
+		    str_error(opResult));
+		return;
+	}
+
 	devman_handle_t child_handle;
-	opResult = usb_drv_register_child_in_devman(hc, hub->device,
-            new_device_address, &child_handle);
+        opResult = usb_device_register_child_in_devman(new_device_address,
+            hc_handle, hub->device, &child_handle);
 	if (opResult != EOK) {
 		dprintf(USB_LOG_LEVEL_ERROR, "could not start driver for new device");
Index: uspace/drv/vhc/hub.c
===================================================================
--- uspace/drv/vhc/hub.c	(revision 79d2987615b780d65a2ce85f69be6227caa7ecb1)
+++ uspace/drv/vhc/hub.c	(revision 4e8e1f51aca228845c8d503a3f52fbf34a47bb20)
@@ -41,4 +41,5 @@
 #include <driver.h>
 #include <usb/usbdrv.h>
+#include <usb/recognise.h>
 
 #include "hub.h"
@@ -93,5 +94,7 @@
 
 	devman_handle_t hub_handle;
-	usb_drv_register_child_in_devman(hc, hc_dev, hub_address, &hub_handle);
+	usb_device_register_child_in_devman(hub_address, hc_dev->handle,
+	    hc_dev, &hub_handle);
+	//usb_drv_register_child_in_devman(hc, hc_dev, hub_address, &hub_handle);
 	usb_drv_bind_address(hc, hub_address, hub_handle);
 
Index: uspace/lib/usb/include/usb/recognise.h
===================================================================
--- uspace/lib/usb/include/usb/recognise.h	(revision 4e8e1f51aca228845c8d503a3f52fbf34a47bb20)
+++ uspace/lib/usb/include/usb/recognise.h	(revision 4e8e1f51aca228845c8d503a3f52fbf34a47bb20)
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2011 Vojtech Horky
+ * 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 libusb
+ * @{
+ */
+/** @file
+ * USB device recognition.
+ */
+#ifndef LIBUSB_RECOGNISE_H_
+#define LIBUSB_RECOGNISE_H_
+
+#include <sys/types.h>
+#include <usb/usb.h>
+#include <usb/pipes.h>
+
+int usb_device_create_match_ids(usb_endpoint_pipe_t *, match_id_list_t *);
+
+int usb_device_register_child_in_devman(usb_address_t address, devman_handle_t hc_handle,
+    device_t *parent, devman_handle_t *child_handle);
+
+#endif
+/**
+ * @}
+ */
Index: uspace/lib/usb/include/usb/usbdrv.h
===================================================================
--- uspace/lib/usb/include/usb/usbdrv.h	(revision 79d2987615b780d65a2ce85f69be6227caa7ecb1)
+++ uspace/lib/usb/include/usb/usbdrv.h	(revision 4e8e1f51aca228845c8d503a3f52fbf34a47bb20)
@@ -106,8 +106,4 @@
     const void *, size_t);
 
-int usb_drv_create_device_match_ids(int, match_id_list_t *, usb_address_t);
-int usb_drv_register_child_in_devman(int, device_t *, usb_address_t,
-    devman_handle_t *);
-
 
 #endif
Index: uspace/lib/usb/src/recognise.c
===================================================================
--- uspace/lib/usb/src/recognise.c	(revision 79d2987615b780d65a2ce85f69be6227caa7ecb1)
+++ uspace/lib/usb/src/recognise.c	(revision 4e8e1f51aca228845c8d503a3f52fbf34a47bb20)
@@ -36,7 +36,13 @@
 #include <usb_iface.h>
 #include <usb/usbdrv.h>
+#include <usb/pipes.h>
+#include <usb/recognise.h>
+#include <usb/request.h>
 #include <usb/classes/classes.h>
 #include <stdio.h>
 #include <errno.h>
+
+static size_t device_name_index = 0;
+static FIBRIL_MUTEX_INITIALIZE(device_name_index_mutex);
 
 /** Callback for getting host controller handle.
@@ -241,13 +247,11 @@
 /** Add match ids based on configuration descriptor.
  *
- * @param hc Open phone to host controller.
+ * @param pipe Control pipe to the device.
  * @param matches Match ids list to add matches to.
- * @param address USB address of the attached device.
  * @param config_count Number of configurations the device has.
  * @return Error code.
  */
-static int usb_add_config_descriptor_match_ids(int hc,
-    match_id_list_t *matches, usb_address_t address,
-    int config_count)
+static int usb_add_config_descriptor_match_ids(usb_endpoint_pipe_t *pipe,
+    match_id_list_t *matches, int config_count)
 {
 	int final_rc = EOK;
@@ -257,6 +261,6 @@
 		int rc;
 		usb_standard_configuration_descriptor_t config_descriptor;
-		rc = usb_drv_req_get_bare_configuration_descriptor(hc,
-		    address,  config_index, &config_descriptor);
+		rc = usb_request_get_bare_configuration_descriptor(pipe,
+		    config_index, &config_descriptor);
 		if (rc != EOK) {
 			final_rc = rc;
@@ -267,6 +271,6 @@
 		void *full_config_descriptor
 		    = malloc(config_descriptor.total_length);
-		rc = usb_drv_req_get_full_configuration_descriptor(hc,
-		    address, config_index,
+		rc = usb_request_get_full_configuration_descriptor(pipe,
+		    config_index,
 		    full_config_descriptor, config_descriptor.total_length,
 		    &full_config_descriptor_size);
@@ -299,14 +303,13 @@
  * function exits with error.
  *
- * @param hc Open phone to host controller.
+ * @param ctrl_pipe Control pipe to given device (session must be already
+ *	started).
  * @param matches Initialized list of match ids.
- * @param address USB address of the attached device.
- * @return Error code.
- */
-int usb_drv_create_device_match_ids(int hc, match_id_list_t *matches,
-    usb_address_t address)
+ * @return Error code.
+ */
+int usb_device_create_match_ids(usb_endpoint_pipe_t *ctrl_pipe,
+    match_id_list_t *matches)
 {
 	int rc;
-	
 	/*
 	 * Retrieve device descriptor and add matches from it.
@@ -314,10 +317,9 @@
 	usb_standard_device_descriptor_t device_descriptor;
 
-	rc = usb_drv_req_get_device_descriptor(hc, address,
-	    &device_descriptor);
+	rc = usb_request_get_device_descriptor(ctrl_pipe, &device_descriptor);
 	if (rc != EOK) {
 		return rc;
 	}
-	
+
 	rc = usb_drv_create_match_ids_from_device_descriptor(matches,
 	    &device_descriptor);
@@ -325,11 +327,11 @@
 		return rc;
 	}
-	
+
 	/*
 	 * Go through all configurations and add matches
 	 * based on interface class.
 	 */
-	rc = usb_add_config_descriptor_match_ids(hc, matches,
-	    address, device_descriptor.configuration_count);
+	rc = usb_add_config_descriptor_match_ids(ctrl_pipe, matches,
+	    device_descriptor.configuration_count);
 	if (rc != EOK) {
 		return rc;
@@ -347,19 +349,16 @@
 }
 
-
 /** Probe for device kind and register it in devman.
  *
- * @param[in] hc Open phone to the host controller.
+ * @param[in] address Address of the (unknown) attached device.
+ * @param[in] hc_handle Handle of the host controller.
  * @param[in] parent Parent device.
- * @param[in] address Address of the (unknown) attached device.
  * @param[out] child_handle Handle of the child device.
  * @return Error code.
  */
-int usb_drv_register_child_in_devman(int hc, device_t *parent,
-    usb_address_t address, devman_handle_t *child_handle)
-{
-	static size_t device_name_index = 0;
-	static FIBRIL_MUTEX_INITIALIZE(device_name_index_mutex);
-
+int usb_device_register_child_in_devman(usb_address_t address,
+    devman_handle_t hc_handle,
+    device_t *parent, devman_handle_t *child_handle)
+{
 	size_t this_device_name_index;
 
@@ -369,8 +368,20 @@
 	fibril_mutex_unlock(&device_name_index_mutex);
 
-
 	device_t *child = NULL;
 	char *child_name = NULL;
 	int rc;
+	usb_device_connection_t dev_connection;
+	usb_endpoint_pipe_t ctrl_pipe;
+
+	rc = usb_device_connection_initialize(&dev_connection, hc_handle, address);
+	if (rc != EOK) {
+		goto failure;
+	}
+
+	rc = usb_endpoint_pipe_initialize_default_control(&ctrl_pipe,
+	    &dev_connection);
+	if (rc != EOK) {
+		goto failure;
+	}
 
 	child = create_device();
@@ -391,6 +402,16 @@
 	child->name = child_name;
 	child->ops = &child_ops;
-	
-	rc = usb_drv_create_device_match_ids(hc, &child->match_ids, address);
+
+	rc = usb_endpoint_pipe_start_session(&ctrl_pipe);
+	if (rc != EOK) {
+		goto failure;
+	}
+
+	rc = usb_device_create_match_ids(&ctrl_pipe, &child->match_ids);
+	if (rc != EOK) {
+		goto failure;
+	}
+
+	rc = usb_endpoint_pipe_end_session(&ctrl_pipe);
 	if (rc != EOK) {
 		goto failure;
@@ -405,5 +426,5 @@
 		*child_handle = child->handle;
 	}
-	
+
 	return EOK;
 
@@ -419,5 +440,4 @@
 
 	return rc;
-
 }
 
