Index: uspace/drv/vhc/conn.h
===================================================================
--- uspace/drv/vhc/conn.h	(revision d15809b4e19527baeaa89740f7e55aa76f993db9)
+++ uspace/drv/vhc/conn.h	(revision 962ce10025c52289f67bb6e66afe52da89a3ad1b)
@@ -37,5 +37,4 @@
 
 #include <usb/usb.h>
-#include <usb/hcdhubd.h>
 #include <usbhc_iface.h>
 #include "vhcd.h"
@@ -44,5 +43,4 @@
 void connection_handler_host(sysarg_t);
 
-usb_hcd_transfer_ops_t vhc_transfer_ops;
 usbhc_iface_t vhc_iface;
 
Index: uspace/lib/usb/Makefile
===================================================================
--- uspace/lib/usb/Makefile	(revision d15809b4e19527baeaa89740f7e55aa76f993db9)
+++ uspace/lib/usb/Makefile	(revision 962ce10025c52289f67bb6e66afe52da89a3ad1b)
@@ -39,12 +39,8 @@
 	src/drvpsync.c \
 	src/dump.c \
-	src/hcdhubd.c \
-	src/hcdrv.c \
 	src/hidparser.c \
-	src/localdrv.c \
 	src/pipes.c \
 	src/pipesinit.c \
 	src/recognise.c \
-	src/remotedrv.c \
 	src/request.c \
 	src/usb.c \
Index: uspace/lib/usb/include/usb/hcdhubd.h
===================================================================
--- uspace/lib/usb/include/usb/hcdhubd.h	(revision d15809b4e19527baeaa89740f7e55aa76f993db9)
+++ uspace/lib/usb/include/usb/hcdhubd.h	(revision 962ce10025c52289f67bb6e66afe52da89a3ad1b)
@@ -65,147 +65,4 @@
 } usb_hcd_attached_device_info_t;
 
-
-/** Host controller device. */
-typedef struct usb_hc_device usb_hc_device_t;
-
-/** Callback for OUT transfers. */
-typedef void (*usb_hcd_transfer_callback_out_t)
-    (usb_hc_device_t *, usb_transaction_outcome_t, void *);
-
-/** Callback for IN transfers. */
-typedef void (*usb_hcd_transfer_callback_in_t)
-    (usb_hc_device_t *, size_t, usb_transaction_outcome_t, void *);
-
-
-/** Transfer functions provided by each USB host controller driver. */
-typedef struct {
-	/** OUT transfer.
-	 * @param hc Host controller that shall enqueue the transfer.
-	 * @param dev Target device.
-	 * @param ep Target endpoint.
-	 * @param buffer Buffer to be sent.
-	 * @param size Buffer size.
-	 * @param callback Callback after transfer was processed by hardware.
-	 * @param arg Callback argument.
-	 */
-	int (*transfer_out)(usb_hc_device_t *hc,
-	    usb_hcd_attached_device_info_t *dev, usb_hc_endpoint_info_t *ep,
-	    void *buffer, size_t size,
-	    usb_hcd_transfer_callback_out_t callback, void *arg);
-
-	/** SETUP transfer. */
-	int (*transfer_setup)(usb_hc_device_t *,
-	    usb_hcd_attached_device_info_t *, usb_hc_endpoint_info_t *,
-	    void *, size_t,
-	    usb_hcd_transfer_callback_out_t, void *);
-
-	/** IN transfer. */
-	int (*transfer_in)(usb_hc_device_t *,
-	    usb_hcd_attached_device_info_t *, usb_hc_endpoint_info_t *,
-	    void *, size_t,
-	    usb_hcd_transfer_callback_in_t, void *);
-} usb_hcd_transfer_ops_t;
-
-/**
- * @brief structure holding information about free and used addresses
- *
- * This structure should not be used outside usb hcd driver.
- * You better consider it to be 'private'.
- */
-typedef struct {
-	/** lower bound included in the interval */
-	usb_address_t lower_bound;
-
-	/** upper bound, excluded from the interval */
-	usb_address_t upper_bound;
-
-	/** */
-	link_t link;
-}usb_address_list_t;
-
-struct usb_hc_device {
-	/** Transfer operations. */
-	usb_hcd_transfer_ops_t *transfer_ops;
-
-	/** Custom HC data. */
-	void *data;
-
-	/** Generic device entry (read-only). */
-	device_t *generic;
-
-	/** List of attached devices. */
-	link_t attached_devices;
-
-	/** List of hubs operating from this HC. */
-	link_t hubs;
-
-	/** Structure with free and used addresses */
-	link_t addresses;
-
-	/** Link to other driven HCs. */
-	link_t link;
-};
-
-/** Host controller driver. */
-typedef struct {
-	/** Driver name. */
-	const char *name;
-	/** Callback when device (host controller) is added. */
-	int (*add_hc)(usb_hc_device_t *device);
-} usb_hc_driver_t;
-
-
-int usb_hcd_main(usb_hc_driver_t *);
-int usb_hcd_add_root_hub(device_t *dev);
-
-/**
- * find first not yet used address on this host controller and use it
- * @param this_hcd
- * @return number in the range of allowed usb addresses or
- *     a negative number if not succesful
- */
-usb_address_t usb_use_free_address(usb_hc_device_t * this_hcd);
-
-/**
- * @brief free the address in the address space of this hcd.
- *
- * if address is not used, nothing happens
- * @param this_hcd
- * @param addr
- */
-void usb_free_used_address(usb_hc_device_t * this_hcd, usb_address_t addr );
-
-
-/*
- * Functions to be used by drivers within same task as the HC driver.
- * This will probably include only hub drivers.
- */
-
-device_t *usb_hc_connect(device_t *);
-
-int usb_hc_async_interrupt_out(usb_hc_device_t *, usb_target_t,
-    void *, size_t, usb_handle_t *);
-int usb_hc_async_interrupt_in(usb_hc_device_t *, usb_target_t,
-    void *, size_t, size_t *, usb_handle_t *);
-
-int usb_hc_async_control_write_setup(usb_hc_device_t *, usb_target_t,
-    void *, size_t, usb_handle_t *);
-int usb_hc_async_control_write_data(usb_hc_device_t *, usb_target_t,
-    void *, size_t, usb_handle_t *);
-int usb_hc_async_control_write_status(usb_hc_device_t *, usb_target_t,
-    usb_handle_t *);
-
-int usb_hc_async_control_read_setup(usb_hc_device_t *, usb_target_t,
-    void *, size_t, usb_handle_t *);
-int usb_hc_async_control_read_data(usb_hc_device_t *, usb_target_t,
-    void *, size_t, size_t *, usb_handle_t *);
-int usb_hc_async_control_read_status(usb_hc_device_t *, usb_target_t,
-    usb_handle_t *);
-
-int usb_hc_async_wait_for(usb_handle_t);
-
-int usb_hc_add_child_device(device_t *, const char *, const char *, bool);
-
-
 /**
  * @}
Index: pace/lib/usb/src/hcdhubd.c
===================================================================
--- uspace/lib/usb/src/hcdhubd.c	(revision d15809b4e19527baeaa89740f7e55aa76f993db9)
+++ 	(revision )
@@ -1,341 +1,0 @@
-/*
- * Copyright (c) 2010 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
- * @brief Common stuff for both HC driver and hub driver.
- */
-#include <usb/hcdhubd.h>
-#include <usb/devreq.h>
-#include <usbhc_iface.h>
-#include <usb_iface.h>
-#include <usb/descriptor.h>
-#include <driver.h>
-#include <bool.h>
-#include <errno.h>
-#include <str_error.h>
-#include <usb/classes/hub.h>
-
-#include "hcdhubd_private.h"
-
-
-static int usb_iface_get_hc_handle(device_t *dev, devman_handle_t *handle)
-{
-	assert(dev);
-	assert(dev->parent != NULL);
-
-	device_t *parent = dev->parent;
-
-	if (parent->ops && parent->ops->interfaces[USB_DEV_IFACE]) {
-		usb_iface_t *usb_iface
-		    = (usb_iface_t *) parent->ops->interfaces[USB_DEV_IFACE];
-		assert(usb_iface != NULL);
-		if (usb_iface->get_hc_handle) {
-			int rc = usb_iface->get_hc_handle(parent, handle);
-			return rc;
-		}
-	}
-
-	return ENOTSUP;
-}
-
-static usb_iface_t usb_iface = {
-	.get_hc_handle = usb_iface_get_hc_handle
-};
-
-static device_ops_t child_ops = {
-	.interfaces[USB_DEV_IFACE] = &usb_iface
-};
-
-/** Callback when new device is detected and must be handled by this driver.
- *
- * @param dev New device.
- * @return Error code.
- */
-static int add_device(device_t *dev) {
-	return ENOTSUP;
-}
-
-/** Operations for combined HC and HUB driver. */
-static driver_ops_t hc_driver_generic_ops = {
-	.add_device = add_device
-};
-
-/** Combined HC and HUB driver. */
-static driver_t hc_driver_generic = {
-	.driver_ops = &hc_driver_generic_ops
-};
-
-/** Main USB host controller driver routine.
- *
- * @see driver_main
- *
- * @param hc Host controller driver.
- * @return Error code.
- */
-int usb_hcd_main(usb_hc_driver_t *hc) {
-	hc_driver = hc;
-	hc_driver_generic.name = hc->name;
-
-	/*
-	 * Run the device driver framework.
-	 */
-	return driver_main(&hc_driver_generic);
-}
-
-/** Add a root hub for given host controller.
- * This function shall be called only once for each host controller driven
- * by this driver.
- * It takes care of creating child device - hub - that will be driven by
- * this task.
- *
- * @param dev Host controller device.
- * @return Error code.
- */
-int usb_hcd_add_root_hub(device_t *dev)
-{
-	char *id;
-	int rc = asprintf(&id, "usb&hub");
-	if (rc <= 0) {
-		return rc;
-	}
-
-	rc = usb_hc_add_child_device(dev, USB_HUB_DEVICE_NAME, id, true);
-	if (rc != EOK) {
-		free(id);
-	}
-
-	return rc;
-}
-
-/** Info about child device. */
-struct child_device_info {
-	device_t *parent;
-	const char *name;
-	const char *match_id;
-};
-
-/** Adds a child device fibril worker. */
-static int fibril_add_child_device(void *arg) {
-	struct child_device_info *child_info
-			= (struct child_device_info *) arg;
-	int rc;
-
-	async_usleep(1000);
-
-	device_t *child = create_device();
-	match_id_t *match_id = NULL;
-
-	if (child == NULL) {
-		rc = ENOMEM;
-		goto failure;
-	}
-	child->name = child_info->name;
-	child->parent = child_info->parent;
-	child->ops = &child_ops;
-
-	match_id = create_match_id();
-	if (match_id == NULL) {
-		rc = ENOMEM;
-		goto failure;
-	}
-	match_id->id = child_info->match_id;
-	match_id->score = 10;
-	add_match_id(&child->match_ids, match_id);
-
-	printf("%s: adding child device `%s' with match \"%s\"\n",
-			hc_driver->name, child->name, match_id->id);
-	rc = child_device_register(child, child_info->parent);
-	printf("%s: child device `%s' registration: %s\n",
-			hc_driver->name, child->name, str_error(rc));
-
-	if (rc != EOK) {
-		goto failure;
-	}
-
-	goto leave;
-
-failure:
-	if (child != NULL) {
-		child->name = NULL;
-		delete_device(child);
-	}
-
-	if (match_id != NULL) {
-		match_id->id = NULL;
-		delete_match_id(match_id);
-	}
-
-leave:
-	free(arg);
-	return EOK;
-}
-
-/** Adds a child.
- * Due to deadlock in devman when parent registers child that oughts to be
- * driven by the same task, the child adding is done in separate fibril.
- * Not optimal, but it works.
- * Update: not under all circumstances the new fibril is successful either.
- * Thus the last parameter to let the caller choose.
- *
- * @param parent Parent device.
- * @param name Device name.
- * @param match_id Match id.
- * @param create_fibril Whether to run the addition in new fibril.
- * @return Error code.
- */
-int usb_hc_add_child_device(device_t *parent, const char *name,
-		const char *match_id, bool create_fibril) {
-	printf("%s: about to add child device `%s' (%s)\n", hc_driver->name,
-			name, match_id);
-
-	/*
-	 * Seems that creating fibril which postpones the action
-	 * is the best solution.
-	 */
-	create_fibril = true;
-
-	struct child_device_info *child_info
-			= malloc(sizeof (struct child_device_info));
-
-	child_info->parent = parent;
-	child_info->name = name;
-	child_info->match_id = match_id;
-
-	if (create_fibril) {
-		fid_t fibril = fibril_create(fibril_add_child_device, child_info);
-		if (!fibril) {
-			return ENOMEM;
-		}
-		fibril_add_ready(fibril);
-	} else {
-		fibril_add_child_device(child_info);
-	}
-
-	return EOK;
-}
-
-/** Tell USB address of given device.
- *
- * @param handle Devman handle of the device.
- * @return USB device address or error code.
- */
-usb_address_t usb_get_address_by_handle(devman_handle_t handle) {
-	/* TODO: search list of attached devices. */
-	return ENOENT;
-}
-
-usb_address_t usb_use_free_address(usb_hc_device_t * this_hcd) {
-	//is there free address?
-	link_t * addresses = &this_hcd->addresses;
-	if (list_empty(addresses)) return -1;
-	link_t * link_addr = addresses;
-	bool found = false;
-	usb_address_list_t * range = NULL;
-	while (!found) {
-		link_addr = link_addr->next;
-		if (link_addr == addresses) return -2;
-		range = list_get_instance(link_addr,
-				usb_address_list_t, link);
-		if (range->upper_bound - range->lower_bound > 0) {
-			found = true;
-		}
-	}
-	//now we have interval
-	int result = range->lower_bound;
-	++(range->lower_bound);
-	if (range->upper_bound - range->lower_bound == 0) {
-		list_remove(&range->link);
-		free(range);
-	}
-	return result;
-}
-
-void usb_free_used_address(usb_hc_device_t * this_hcd, usb_address_t addr) {
-	//check range
-	if (addr < usb_lowest_address || addr > usb_highest_address)
-		return;
-	link_t * addresses = &this_hcd->addresses;
-	link_t * link_addr = addresses;
-	//find 'good' interval
-	usb_address_list_t * found_range = NULL;
-	bool found = false;
-	while (!found) {
-		link_addr = link_addr->next;
-		if (link_addr == addresses) {
-			found = true;
-		} else {
-			usb_address_list_t * range = list_get_instance(link_addr,
-					usb_address_list_t, link);
-			if (	(range->lower_bound - 1 == addr) ||
-					(range->upper_bound == addr)) {
-				found = true;
-				found_range = range;
-			}
-			if (range->lower_bound - 1 > addr) {
-				found = true;
-			}
-
-		}
-	}
-	if (found_range == NULL) {
-		//no suitable range found
-		usb_address_list_t * result_range =
-				(usb_address_list_t*) malloc(sizeof (usb_address_list_t));
-		result_range->lower_bound = addr;
-		result_range->upper_bound = addr + 1;
-		list_insert_before(&result_range->link, link_addr);
-	} else {
-		//we have good range
-		if (found_range->lower_bound - 1 == addr) {
-			--found_range->lower_bound;
-		} else {
-			//only one possible case
-			++found_range->upper_bound;
-			if (found_range->link.next != addresses) {
-				usb_address_list_t * next_range =
-						list_get_instance( &found_range->link.next,
-						usb_address_list_t, link);
-				//check neighbour range
-				if (next_range->lower_bound == addr + 1) {
-					//join ranges
-					found_range->upper_bound = next_range->upper_bound;
-					list_remove(&next_range->link);
-					free(next_range);
-				}
-			}
-		}
-	}
-
-}
-
-/**
- * @}
- */
Index: pace/lib/usb/src/hcdrv.c
===================================================================
--- uspace/lib/usb/src/hcdrv.c	(revision d15809b4e19527baeaa89740f7e55aa76f993db9)
+++ 	(revision )
@@ -1,127 +1,0 @@
-/*
- * Copyright (c) 2010 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
- * @brief HC driver.
- */
-#include <usb/hcdhubd.h>
-#include <usb/devreq.h>
-#include <usbhc_iface.h>
-#include <usb/descriptor.h>
-#include <driver.h>
-#include <bool.h>
-#include <errno.h>
-#include <usb/classes/hub.h>
-
-#include "hcdhubd_private.h"
-
-/** List of handled host controllers. */
-LIST_INITIALIZE(hc_list);
-
-/* Fake driver to have the name item initialized. */
-static usb_hc_driver_t hc_driver_fake = {
-	.name = "HCD",
-};
-
-/** Our HC driver. */
-usb_hc_driver_t *hc_driver = &hc_driver_fake;
-
-int usb_lowest_address = 1;
-
-int usb_highest_address = 255;
-
-static device_ops_t usb_device_ops = {
-	.interfaces[USBHC_DEV_IFACE] = &usbhc_interface
-};
-
-
-void usb_create_address_list(usb_hc_device_t * hcd){
-	list_initialize(&hcd->addresses);
-	usb_address_list_t * range =
-			(usb_address_list_t*)malloc(sizeof(usb_address_list_t));
-	range->lower_bound = usb_lowest_address;
-	range->upper_bound = usb_highest_address + 1;
-	list_append(&range->link, &hcd->addresses);
-}
-
-static usb_hc_device_t *usb_hc_device_create(device_t *dev) {
-	usb_hc_device_t *hc_dev = malloc(sizeof (usb_hc_device_t));
-
-	list_initialize(&hc_dev->link);
-	list_initialize(&hc_dev->hubs);
-	usb_create_address_list(hc_dev);
-	list_initialize(&hc_dev->attached_devices);
-	hc_dev->transfer_ops = NULL;
-
-	hc_dev->generic = dev;
-	dev->ops = &usb_device_ops;
-	hc_dev->generic->driver_data = hc_dev;
-
-	return hc_dev;
-}
-
-int usb_add_hc_device(device_t *dev)
-{
-	return ENOTSUP;
-	usb_hc_device_t *hc_dev = usb_hc_device_create(dev);
-
-	int rc = hc_driver->add_hc(hc_dev);
-	if (rc != EOK) {
-		free(hc_dev);
-		return rc;
-	}
-
-	/*
-	 * FIXME: The following line causes devman to hang.
-	 * Will investigate later why.
-	 */
-	// add_device_to_class(dev, "usbhc");
-
-	list_append(&hc_dev->link, &hc_list);
-
-	/*
-	 * FIXME: the following is a workaround to force loading of USB
-	 * keyboard driver.
-	 * Will be removed as soon as the hub driver is completed and
-	 * can detect connected devices.
-	 */
-	printf("%s: trying to add USB HID child device...\n", hc_driver->name);
-	rc = usb_hc_add_child_device(dev, USB_KBD_DEVICE_NAME, "usb&hid", false);
-	if (rc != EOK) {
-		printf("%s: adding USB HID child failed...\n", hc_driver->name);
-	}
-
-	return EOK;
-}
-
-/**
- * @}
- */
Index: pace/lib/usb/src/localdrv.c
===================================================================
--- uspace/lib/usb/src/localdrv.c	(revision d15809b4e19527baeaa89740f7e55aa76f993db9)
+++ 	(revision )
@@ -1,414 +1,0 @@
-/*
- * Copyright (c) 2010 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
- * @brief Driver communication for local drivers (hubs).
- */
-#include <usb/hcdhubd.h>
-#include <usbhc_iface.h>
-#include <driver.h>
-#include <bool.h>
-#include <errno.h>
-
-/** Find host controller when handled by current task.
- *
- * @param dev Device asking for connection.
- * @return Device structure corresponding to parent host controller.
- * @retval NULL Corresponding host controller not found.
- */
-device_t *usb_hc_connect(device_t *dev)
-{
-	/*
-	 * FIXME: this will not work when some hub on the path is
-	 * not driven by the same task.
-	 */
-	device_t *parent = dev;
-	while (parent->parent != NULL) {
-		parent = parent->parent;
-	}
-	
-	if (dev == parent) {
-		printf("FIXME in %s:%d encountered!\n", __FILE__, __LINE__);
-		parent = NULL;
-	}
-
-	return parent;
-}
-
-/** Information about pending transaction on HC. */
-typedef struct {
-	/** Storage for actual number of bytes transferred. */
-	size_t *size_transferred;
-
-	/** Target device. */
-	usb_hcd_attached_device_info_t *device;
-	/** Target endpoint. */
-	usb_hc_endpoint_info_t *endpoint;
-
-	/** Guard for the condition variable. */
-	fibril_mutex_t condvar_guard;
-	/** Condition variable for waiting for done. */
-	fibril_condvar_t condvar;
-
-	/** Flag whether the transfer is done. */
-	bool done;
-} transfer_info_t;
-
-/** Create new transfer info.
- *
- * @param device Attached device.
- * @param endpoint Endpoint.
- * @return Transfer info with pre-filled values.
- */
-static transfer_info_t *transfer_info_create(
-    usb_hcd_attached_device_info_t *device, usb_hc_endpoint_info_t *endpoint)
-{
-	transfer_info_t *transfer = malloc(sizeof(transfer_info_t));
-
-	transfer->size_transferred = NULL;
-	fibril_condvar_initialize(&transfer->condvar);
-	fibril_mutex_initialize(&transfer->condvar_guard);
-	transfer->done = false;
-
-	transfer->device = device;
-	transfer->endpoint = endpoint;
-
-	return transfer;
-}
-
-/** Destroy transfer info.
- *
- * @param transfer Transfer to be destroyed.
- */
-static void transfer_info_destroy(transfer_info_t *transfer)
-{
-	free(transfer->device);
-	free(transfer->endpoint);
-	free(transfer);
-}
-
-/** Create info about attached device.
- *
- * @param address Device address.
- * @return Device info structure.
- */
-static usb_hcd_attached_device_info_t *create_attached_device_info(
-    usb_address_t address)
-{
-	usb_hcd_attached_device_info_t *dev
-	    = malloc(sizeof(usb_hcd_attached_device_info_t));
-
-	dev->address = address;
-	dev->endpoint_count = 0;
-	dev->endpoints = NULL;
-	list_initialize(&dev->link);
-
-	return dev;
-}
-
-/** Create info about device endpoint.
- *
- * @param endpoint Endpoint number.
- * @param direction Endpoint data direction.
- * @param transfer_type Transfer type of the endpoint.
- * @return Endpoint info structure.
- */
-static usb_hc_endpoint_info_t *create_endpoint_info(usb_endpoint_t endpoint,
-    usb_direction_t direction, usb_transfer_type_t transfer_type)
-{
-	usb_hc_endpoint_info_t *ep = malloc(sizeof(usb_hc_endpoint_info_t));
-	ep->data_toggle = 0;
-	ep->direction = direction;
-	ep->transfer_type = transfer_type;
-	ep->endpoint = endpoint;
-
-	return ep;
-}
-
-/** Marks given transfer as done.
- *
- * @param transfer Transfer to be completed.
- */
-static void transfer_mark_complete(transfer_info_t *transfer)
-{
-	fibril_mutex_lock(&transfer->condvar_guard);
-	transfer->done = true;
-	fibril_condvar_signal(&transfer->condvar);
-	fibril_mutex_unlock(&transfer->condvar_guard);
-}
-
-/** Callback for OUT transfers.
- *
- * @param hc Host controller that processed the transfer.
- * @param outcome Transfer outcome.
- * @param arg Custom argument.
- */
-static void callback_out(usb_hc_device_t *hc,
-    usb_transaction_outcome_t outcome, void *arg)
-{
-	transfer_info_t *transfer = (transfer_info_t *) arg;
-
-	/*
-	 * For out transfers, marking them complete is enough.
-	 * No other processing is necessary.
-	 */
-	transfer_mark_complete(transfer);
-}
-
-/** Callback for IN transfers.
- *
- * @param hc Host controller that processed the transfer.
- * @param actual_size Number of actually transferred bytes.
- * @param outcome Transfer outcome.
- * @param arg Custom argument.
- */
-static void callback_in(usb_hc_device_t *hc,
-    size_t actual_size, usb_transaction_outcome_t outcome, void *arg)
-{
-	transfer_info_t *transfer = (transfer_info_t *) arg;
-
-	/*
-	 * Set the number of actually transferred bytes and
-	 * mark the transfer as complete.
-	 */
-	if (transfer->size_transferred != NULL) {
-		*transfer->size_transferred = actual_size;
-	}
-
-	transfer_mark_complete(transfer);
-}
-
-static int async_transfer_out(usb_hc_device_t *hc,
-    usb_target_t target, usb_transfer_type_t transfer_type,
-    void *data, size_t size,
-    usb_handle_t *handle)
-{
-	if ((hc->transfer_ops == NULL)
-	    || (hc->transfer_ops->transfer_out == NULL)) {
-		return ENOTSUP;
-	}
-
-	/* This creation of the device on the fly is just a workaround. */
-
-	transfer_info_t *transfer = transfer_info_create(
-	    create_attached_device_info(target.address),
-	    create_endpoint_info(target.endpoint,
-		USB_DIRECTION_OUT, transfer_type));
-
-	int rc = hc->transfer_ops->transfer_out(hc,
-	    transfer->device, transfer->endpoint,
-	    data, size,
-	    callback_out, transfer);
-
-	if (rc != EOK) {
-		transfer_info_destroy(transfer);
-		return rc;
-	}
-
-	*handle = (usb_handle_t)transfer;
-
-	return EOK;
-}
-
-static int async_transfer_setup(usb_hc_device_t *hc,
-    usb_target_t target, usb_transfer_type_t transfer_type,
-    void *data, size_t size,
-    usb_handle_t *handle)
-{
-	if ((hc->transfer_ops == NULL)
-	    || (hc->transfer_ops->transfer_setup == NULL)) {
-		return ENOTSUP;
-	}
-
-	/* This creation of the device on the fly is just a workaround. */
-
-	transfer_info_t *transfer = transfer_info_create(
-	    create_attached_device_info(target.address),
-	    create_endpoint_info(target.endpoint,
-		USB_DIRECTION_OUT, transfer_type));
-
-	int rc = hc->transfer_ops->transfer_setup(hc,
-	    transfer->device, transfer->endpoint,
-	    data, size,
-	    callback_out, transfer);
-
-	if (rc != EOK) {
-		transfer_info_destroy(transfer);
-		return rc;
-	}
-
-	*handle = (usb_handle_t)transfer;
-
-	return EOK;
-}
-
-static int async_transfer_in(usb_hc_device_t *hc, usb_target_t target,
-    usb_transfer_type_t transfer_type,
-    void *buffer, size_t size, size_t *actual_size,
-    usb_handle_t *handle)
-{
-	if ((hc->transfer_ops == NULL)
-	    || (hc->transfer_ops->transfer_in == NULL)) {
-		return ENOTSUP;
-	}
-
-	/* This creation of the device on the fly is just a workaround. */
-
-	transfer_info_t *transfer = transfer_info_create(
-	    create_attached_device_info(target.address),
-	    create_endpoint_info(target.endpoint,
-		USB_DIRECTION_IN, transfer_type));
-	transfer->size_transferred = actual_size;
-
-	int rc = hc->transfer_ops->transfer_in(hc,
-	    transfer->device, transfer->endpoint,
-	    buffer, size,
-	    callback_in, transfer);
-
-	if (rc != EOK) {
-		transfer_info_destroy(transfer);
-		return rc;
-	}
-
-	*handle = (usb_handle_t)transfer;
-
-	return EOK;
-}
-
-
-/** Issue interrupt OUT transfer to HC driven by current task.
- *
- * @param hc Host controller to handle the transfer.
- * @param target Target device address.
- * @param buffer Data buffer.
- * @param size Buffer size.
- * @param handle Transfer handle.
- * @return Error code.
- */
-int usb_hc_async_interrupt_out(usb_hc_device_t *hc, usb_target_t target,
-    void *buffer, size_t size,
-    usb_handle_t *handle)
-{
-	return async_transfer_out(hc, target,
-	    USB_TRANSFER_INTERRUPT, buffer, size, handle);
-}
-
-
-/** Issue interrupt IN transfer to HC driven by current task.
- *
- * @warning The @p buffer and @p actual_size parameters shall not be
- * touched until this transfer is waited for by usb_hc_async_wait_for().
- *
- * @param hc Host controller to handle the transfer.
- * @param target Target device address.
- * @param buffer Data buffer.
- * @param size Buffer size.
- * @param actual_size Size of actually transferred data.
- * @param handle Transfer handle.
- * @return Error code.
- */
-int usb_hc_async_interrupt_in(usb_hc_device_t *hc, usb_target_t target,
-    void *buffer, size_t size, size_t *actual_size,
-    usb_handle_t *handle)
-{
-	return async_transfer_in(hc, target,
-	    USB_TRANSFER_INTERRUPT, buffer, size, actual_size, handle);
-}
-
-int usb_hc_async_control_write_setup(usb_hc_device_t *hc, usb_target_t target,
-    void *data, size_t size, usb_handle_t *handle)
-{
-	return async_transfer_setup(hc, target,
-	    USB_TRANSFER_CONTROL, data, size, handle);
-}
-
-int usb_hc_async_control_write_data(usb_hc_device_t *hc, usb_target_t target,
-    void *data, size_t size, usb_handle_t *handle)
-{
-	return async_transfer_out(hc, target,
-	    USB_TRANSFER_CONTROL, data, size, handle);
-}
-
-int usb_hc_async_control_write_status(usb_hc_device_t *hc, usb_target_t target,
-    usb_handle_t *handle)
-{
-	return async_transfer_in(hc, target,
-	    USB_TRANSFER_CONTROL, NULL, 0, NULL, handle);
-}
-
-int usb_hc_async_control_read_setup(usb_hc_device_t *hc, usb_target_t target,
-    void *data, size_t size, usb_handle_t *handle)
-{
-	return async_transfer_setup(hc, target,
-	    USB_TRANSFER_CONTROL, data, size, handle);
-}
-
-int usb_hc_async_control_read_data(usb_hc_device_t *hc, usb_target_t target,
-    void *buffer, size_t size, size_t *actual_size,
-    usb_handle_t *handle)
-{
-	return async_transfer_in(hc, target,
-	    USB_TRANSFER_CONTROL, buffer, size, actual_size, handle);
-}
-
-int usb_hc_async_control_read_status(usb_hc_device_t *hc, usb_target_t target,
-    usb_handle_t *handle)
-{
-	return async_transfer_out(hc, target,
-	    USB_TRANSFER_CONTROL, NULL, 0, handle);
-}
-
-/** Wait for transfer to complete.
- *
- * @param handle Transfer handle.
- * @return Error code.
- */
-int usb_hc_async_wait_for(usb_handle_t handle)
-{
-	transfer_info_t *transfer = (transfer_info_t *) handle;
-	if (transfer == NULL) {
-		return ENOENT;
-	}
-
-	fibril_mutex_lock(&transfer->condvar_guard);
-	while (!transfer->done) {
-		fibril_condvar_wait(&transfer->condvar, &transfer->condvar_guard);
-	}
-	fibril_mutex_unlock(&transfer->condvar_guard);
-
-	transfer_info_destroy(transfer);
-
-	return EOK;
-}
-
-/**
- * @}
- */
Index: pace/lib/usb/src/remotedrv.c
===================================================================
--- uspace/lib/usb/src/remotedrv.c	(revision d15809b4e19527baeaa89740f7e55aa76f993db9)
+++ 	(revision )
@@ -1,437 +1,0 @@
-/*
- * Copyright (c) 2010 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
- * @brief Driver communication for remote drivers (interface implementation).
- */
-#include <usb/hcdhubd.h>
-#include <usbhc_iface.h>
-#include <driver.h>
-#include <bool.h>
-#include <errno.h>
-
-#include "hcdhubd_private.h"
-
-static int remote_get_address(device_t *, devman_handle_t, usb_address_t *);
-
-static int remote_interrupt_out(device_t *, usb_target_t, void *, size_t,
-    usbhc_iface_transfer_out_callback_t, void *);
-static int remote_interrupt_in(device_t *, usb_target_t, void *, size_t,
-    usbhc_iface_transfer_in_callback_t, void *);
-
-static int remote_control_write_setup(device_t *, usb_target_t,
-    void *, size_t,
-    usbhc_iface_transfer_out_callback_t, void *);
-static int remote_control_write_data(device_t *, usb_target_t,
-    void *, size_t,
-    usbhc_iface_transfer_out_callback_t, void *);
-static int remote_control_write_status(device_t *, usb_target_t,
-    usbhc_iface_transfer_in_callback_t, void *);
-
-static int remote_control_read_setup(device_t *, usb_target_t,
-    void *, size_t,
-    usbhc_iface_transfer_out_callback_t, void *);
-static int remote_control_read_data(device_t *, usb_target_t,
-    void *, size_t,
-    usbhc_iface_transfer_in_callback_t, void *);
-static int remote_control_read_status(device_t *, usb_target_t,
-    usbhc_iface_transfer_out_callback_t, void *);
-
-/** Implementation of USB HC interface. */
-usbhc_iface_t usbhc_interface = {
-	.tell_address = remote_get_address,
-	.interrupt_out = remote_interrupt_out,
-	.interrupt_in = remote_interrupt_in,
-	.control_write_setup = remote_control_write_setup,
-	.control_write_data = remote_control_write_data,
-	.control_write_status = remote_control_write_status,
-	.control_read_setup = remote_control_read_setup,
-	.control_read_data = remote_control_read_data,
-	.control_read_status = remote_control_read_status
-};
-
-/** Get USB address for remote USBHC interface.
- *
- * @param dev Device asked for the information.
- * @param handle Devman handle of the USB device.
- * @param address Storage for obtained address.
- * @return Error code.
- */
-int remote_get_address(device_t *dev, devman_handle_t handle,
-    usb_address_t *address)
-{
-	usb_address_t addr = usb_get_address_by_handle(handle);
-	if (addr < 0) {
-		return addr;
-	}
-
-	*address = addr;
-
-	return EOK;
-}
-
-/** Information about pending transaction on HC. */
-typedef struct {
-	/** Target device. */
-	usb_hcd_attached_device_info_t *device;
-	/** Target endpoint. */
-	usb_hc_endpoint_info_t *endpoint;
-
-	/** Callbacks. */
-	union {
-		/** Callback for outgoing transfers. */
-		usbhc_iface_transfer_out_callback_t out_callback;
-		/** Callback for incoming transfers. */
-		usbhc_iface_transfer_in_callback_t in_callback;
-	};
-
-	/** Custom argument for the callback. */
-	void *arg;
-} transfer_info_t;
-
-/** Create new transfer info.
- *
- * @param device Attached device.
- * @param endpoint Endpoint.
- * @param custom_arg Custom argument.
- * @return Transfer info with pre-filled values.
- */
-static transfer_info_t *transfer_info_create(
-    usb_hcd_attached_device_info_t *device, usb_hc_endpoint_info_t *endpoint,
-    void *custom_arg)
-{
-	transfer_info_t *transfer = malloc(sizeof(transfer_info_t));
-
-	transfer->device = device;
-	transfer->endpoint = endpoint;
-	transfer->arg = custom_arg;
-	transfer->out_callback = NULL;
-	transfer->in_callback = NULL;
-
-	return transfer;
-}
-
-/** Destroy transfer info.
- *
- * @param transfer Transfer to be destroyed.
- */
-static void transfer_info_destroy(transfer_info_t *transfer)
-{
-	free(transfer->device);
-	free(transfer->endpoint);
-	free(transfer);
-}
-
-/** Create info about attached device.
- *
- * @param address Device address.
- * @return Device info structure.
- */
-static usb_hcd_attached_device_info_t *create_attached_device_info(
-    usb_address_t address)
-{
-	usb_hcd_attached_device_info_t *dev
-	    = malloc(sizeof(usb_hcd_attached_device_info_t));
-
-	dev->address = address;
-	dev->endpoint_count = 0;
-	dev->endpoints = NULL;
-	list_initialize(&dev->link);
-
-	return dev;
-}
-
-/** Create info about device endpoint.
- *
- * @param endpoint Endpoint number.
- * @param direction Endpoint data direction.
- * @param transfer_type Transfer type of the endpoint.
- * @return Endpoint info structure.
- */
-static usb_hc_endpoint_info_t *create_endpoint_info(usb_endpoint_t endpoint,
-    usb_direction_t direction, usb_transfer_type_t transfer_type)
-{
-	usb_hc_endpoint_info_t *ep = malloc(sizeof(usb_hc_endpoint_info_t));
-	ep->data_toggle = 0;
-	ep->direction = direction;
-	ep->transfer_type = transfer_type;
-	ep->endpoint = endpoint;
-
-	return ep;
-}
-
-
-
-/** Callback for OUT transfers.
- * This callback is called by implementation of HC operations.
- *
- * @param hc Host controller that processed the transfer.
- * @param outcome Transfer outcome.
- * @param arg Custom argument.
- */
-static void remote_out_callback(usb_hc_device_t *hc,
-    usb_transaction_outcome_t outcome, void *arg)
-{
-	transfer_info_t *transfer = (transfer_info_t *) arg;
-	transfer->out_callback(hc->generic, outcome, transfer->arg);
-
-	transfer_info_destroy(transfer);
-}
-
-/** Start an OUT transfer.
- *
- * @param dev Device that shall process the transfer.
- * @param target Target device for the data.
- * @param transfer_type Transfer type.
- * @param data Data buffer.
- * @param size Size of data buffer.
- * @param callback Callback after transfer is complete.
- * @param arg Custom argument to the callback.
- * @return Error code.
- */
-static int remote_out_transfer(device_t *dev, usb_target_t target,
-    usb_transfer_type_t transfer_type, void *data, size_t size,
-    usbhc_iface_transfer_out_callback_t callback, void *arg)
-{
-	usb_hc_device_t *hc = (usb_hc_device_t *) dev->driver_data;
-
-	if ((hc->transfer_ops == NULL)
-	    || (hc->transfer_ops->transfer_out == NULL)) {
-		return ENOTSUP;
-	}
-
-	transfer_info_t *transfer = transfer_info_create(
-	    create_attached_device_info(target.address),
-	    create_endpoint_info(target.endpoint,
-		USB_DIRECTION_OUT, transfer_type),
-	    arg);
-	transfer->out_callback = callback;
-
-	int rc = hc->transfer_ops->transfer_out(hc,
-	    transfer->device, transfer->endpoint,
-	    data, size,
-	    remote_out_callback, transfer);
-
-	if (rc != EOK) {
-		transfer_info_destroy(transfer);
-		return rc;
-	}
-
-	return EOK;
-}
-
-/** Start a SETUP transfer.
- *
- * @param dev Device that shall process the transfer.
- * @param target Target device for the data.
- * @param transfer_type Transfer type.
- * @param data Data buffer.
- * @param size Size of data buffer.
- * @param callback Callback after transfer is complete.
- * @param arg Custom argument to the callback.
- * @return Error code.
- */
-static int remote_setup_transfer(device_t *dev, usb_target_t target,
-    usb_transfer_type_t transfer_type, void *data, size_t size,
-    usbhc_iface_transfer_out_callback_t callback, void *arg)
-{
-	usb_hc_device_t *hc = (usb_hc_device_t *) dev->driver_data;
-
-	if ((hc->transfer_ops == NULL)
-	    || (hc->transfer_ops->transfer_setup == NULL)) {
-		return ENOTSUP;
-	}
-
-	transfer_info_t *transfer = transfer_info_create(
-	    create_attached_device_info(target.address),
-	    create_endpoint_info(target.endpoint,
-		USB_DIRECTION_OUT, transfer_type),
-	    arg);
-	transfer->out_callback = callback;
-
-	int rc = hc->transfer_ops->transfer_setup(hc,
-	    transfer->device, transfer->endpoint,
-	    data, size,
-	    remote_out_callback, transfer);
-
-	if (rc != EOK) {
-		transfer_info_destroy(transfer);
-		return rc;
-	}
-
-	return EOK;
-}
-
-/** Callback for IN transfers.
- * This callback is called by implementation of HC operations.
- *
- * @param hc Host controller that processed the transfer.
- * @param outcome Transfer outcome.
- * @param actual_size Size of actually received data.
- * @param arg Custom argument.
- */
-static void remote_in_callback(usb_hc_device_t *hc,
-    size_t actual_size, usb_transaction_outcome_t outcome, void *arg)
-{
-	transfer_info_t *transfer = (transfer_info_t *) arg;
-	transfer->in_callback(hc->generic, outcome, actual_size, transfer->arg);
-
-	transfer_info_destroy(transfer);
-}
-
-/** Start an IN transfer.
- *
- * @param dev Device that shall process the transfer.
- * @param target Target device for the data.
- * @param transfer_type Transfer type.
- * @param data Data buffer.
- * @param size Size of data buffer.
- * @param callback Callback after transfer is complete.
- * @param arg Custom argument to the callback.
- * @return Error code.
- */
-static int remote_in_transfer(device_t *dev, usb_target_t target,
-    usb_transfer_type_t transfer_type, void *data, size_t size,
-    usbhc_iface_transfer_in_callback_t callback, void *arg)
-{
-	usb_hc_device_t *hc = (usb_hc_device_t *) dev->driver_data;
-
-	if ((hc->transfer_ops == NULL)
-	    || (hc->transfer_ops->transfer_in == NULL)) {
-		return ENOTSUP;
-	}
-
-	transfer_info_t *transfer = transfer_info_create(
-	    create_attached_device_info(target.address),
-	    create_endpoint_info(target.endpoint,
-		USB_DIRECTION_OUT, transfer_type),
-	    arg);
-	transfer->in_callback = callback;
-
-	int rc = hc->transfer_ops->transfer_in(hc,
-	    transfer->device, transfer->endpoint,
-	    data, size,
-	    remote_in_callback, transfer);
-
-	if (rc != EOK) {
-		transfer_info_destroy(transfer);
-		return rc;
-	}
-
-	return EOK;
-}
-
-/** Start outgoing interrupt transfer (USBHC remote interface).
- *
- * @param dev Host controller device processing the transfer.
- * @param target Target USB device.
- * @param buffer Data buffer.
- * @param size Data buffer size.
- * @param callback Callback after the transfer is completed.
- * @param arg Custom argument to the callback.
- * @return Error code.
- */
-int remote_interrupt_out(device_t *dev, usb_target_t target,
-    void *buffer, size_t size,
-    usbhc_iface_transfer_out_callback_t callback, void *arg)
-{
-	return remote_out_transfer(dev, target, USB_TRANSFER_INTERRUPT,
-	    buffer, size, callback, arg);
-}
-
-/** Start incoming interrupt transfer (USBHC remote interface).
- *
- * @param dev Host controller device processing the transfer.
- * @param target Target USB device.
- * @param buffer Data buffer.
- * @param size Data buffer size.
- * @param callback Callback after the transfer is completed.
- * @param arg Custom argument to the callback.
- * @return Error code.
- */
-int remote_interrupt_in(device_t *dev, usb_target_t target,
-    void *buffer, size_t size,
-    usbhc_iface_transfer_in_callback_t callback, void *arg)
-{
-	return remote_in_transfer(dev, target, USB_TRANSFER_INTERRUPT,
-	    buffer, size, callback, arg);
-}
-
-
-int remote_control_write_setup(device_t *device, usb_target_t target,
-    void *buffer, size_t size,
-    usbhc_iface_transfer_out_callback_t callback, void *arg)
-{
-	return remote_setup_transfer(device, target, USB_TRANSFER_CONTROL,
-	    buffer, size, callback, arg);
-}
-
-int remote_control_write_data(device_t *device, usb_target_t target,
-    void *buffer, size_t size,
-    usbhc_iface_transfer_out_callback_t callback, void *arg)
-{
-	return remote_out_transfer(device, target, USB_TRANSFER_CONTROL,
-	    buffer, size, callback, arg);
-}
-
-int remote_control_write_status(device_t *device, usb_target_t target,
-    usbhc_iface_transfer_in_callback_t callback, void *arg)
-{
-	return remote_in_transfer(device, target, USB_TRANSFER_CONTROL,
-	    NULL, 0, callback, arg);
-}
-
-int remote_control_read_setup(device_t *device, usb_target_t target,
-    void *buffer, size_t size,
-    usbhc_iface_transfer_out_callback_t callback, void *arg)
-{
-	return remote_setup_transfer(device, target, USB_TRANSFER_CONTROL,
-	    buffer, size, callback, arg);
-}
-
-int remote_control_read_data(device_t *dev, usb_target_t target,
-    void *buffer, size_t size,
-    usbhc_iface_transfer_in_callback_t callback, void *arg)
-{
-	return remote_in_transfer(dev, target, USB_TRANSFER_CONTROL,
-	    buffer, size, callback, arg);
-}
-
-int remote_control_read_status(device_t *device, usb_target_t target,
-    usbhc_iface_transfer_out_callback_t callback, void *arg)
-{
-	return remote_out_transfer(device, target, USB_TRANSFER_CONTROL,
-	    NULL, 0, callback, arg);
-}
-
-/**
- * @}
- */
