Index: uspace/lib/usb/src/usbdrv.c
===================================================================
--- uspace/lib/usb/src/usbdrv.c	(revision 3937bda2a1beb458c852ac38c43e928cf9647e3e)
+++ uspace/lib/usb/src/usbdrv.c	(revision b9d910f478e726c33c5a0e72d0448d03b92734a0)
@@ -34,28 +34,6 @@
  */
 #include <usb/usbdrv.h>
-#include <usbhc_iface.h>
-#include <usb_iface.h>
 #include <errno.h>
-#include <str_error.h>
-
-/** Information about pending transaction on HC. */
-typedef struct {
-	/** Phone to host controller driver. */
-	int phone;
-	/** Data buffer. */
-	void *buffer;
-	/** Buffer size. */
-	size_t size;
-	/** Storage for actual number of bytes transferred. */
-	size_t *size_transferred;
-	/** Initial call reply data. */
-	ipc_call_t reply;
-	/** Initial call identifier. */
-	aid_t request;
-	/** Reply data for data read call. */
-	ipc_call_t read_reply;
-	/** Data read call identifier. */
-	aid_t read_request;
-} transfer_info_t;
+
 
 /** Find handle of host controller the device is physically attached to.
@@ -67,30 +45,5 @@
 int usb_drv_find_hc(device_t *dev, devman_handle_t *handle)
 {
-	if (dev == NULL) {
-		return EBADMEM;
-	}
-	if (handle == NULL) {
-		return EBADMEM;
-	}
-
-	int parent_phone = devman_parent_device_connect(dev->handle,
-	    IPC_FLAG_BLOCKING);
-	if (parent_phone < 0) {
-		return parent_phone;
-	}
-
-	devman_handle_t h;
-	int rc = async_req_1_1(parent_phone, DEV_IFACE_ID(USB_DEV_IFACE),
-	    IPC_M_USB_GET_HOST_CONTROLLER_HANDLE, &h);
-
-	async_hangup(parent_phone);
-
-	if (rc != EOK) {
-		return rc;
-	}
-
-	*handle = h;
-
-	return EOK;
+	return ENOTSUP;
 }
 
@@ -105,5 +58,5 @@
     unsigned int flags)
 {
-	return devman_device_connect(hc_handle, flags);
+	return ENOTSUP;
 }
 
@@ -116,16 +69,5 @@
 int usb_drv_hc_connect_auto(device_t *dev, unsigned int flags)
 {
-	int rc;
-	devman_handle_t hc_handle;
-
-	/*
-	 * Call parent hub to obtain device handle of respective HC.
-	 */
-	rc = usb_drv_find_hc(dev, &hc_handle);
-	if (rc != EOK) {
-		return rc;
-	}
-	
-	return usb_drv_hc_connect(dev, hc_handle, flags);
+	return ENOTSUP;
 }
 
@@ -138,14 +80,5 @@
 usb_address_t usb_drv_get_my_address(int phone, device_t *dev)
 {
-	sysarg_t address;
-	int rc = async_req_2_1(phone, DEV_IFACE_ID(USBHC_DEV_IFACE),
-	    IPC_M_USBHC_GET_ADDRESS,
-	    dev->handle, &address);
-
-	if (rc != EOK) {
-		return rc;
-	}
-
-	return (usb_address_t) address;
+	return ENOTSUP;
 }
 
@@ -157,6 +90,5 @@
 int usb_drv_reserve_default_address(int phone)
 {
-	return async_req_1_0(phone, DEV_IFACE_ID(USBHC_DEV_IFACE),
-	    IPC_M_USBHC_RESERVE_DEFAULT_ADDRESS);
+	return ENOTSUP;
 }
 
@@ -168,6 +100,5 @@
 int usb_drv_release_default_address(int phone)
 {
-	return async_req_1_0(phone, DEV_IFACE_ID(USBHC_DEV_IFACE),
-	    IPC_M_USBHC_RELEASE_DEFAULT_ADDRESS);
+	return ENOTSUP;
 }
 
@@ -179,12 +110,5 @@
 usb_address_t usb_drv_request_address(int phone)
 {
-	sysarg_t address;
-	int rc = async_req_1_1(phone, DEV_IFACE_ID(USBHC_DEV_IFACE),
-	    IPC_M_USBHC_REQUEST_ADDRESS, &address);
-	if (rc != EOK) {
-		return rc;
-	} else {
-		return (usb_address_t) address;
-	}
+	return ENOTSUP;
 }
 
@@ -199,9 +123,5 @@
     devman_handle_t handle)
 {
-	int rc = async_req_3_0(phone, DEV_IFACE_ID(USBHC_DEV_IFACE),
-	    IPC_M_USBHC_BIND_ADDRESS,
-	    address, handle);
-
-	return rc;
+	return ENOTSUP;
 }
 
@@ -214,132 +134,6 @@
 int usb_drv_release_address(int phone, usb_address_t address)
 {
-	return async_req_2_0(phone, DEV_IFACE_ID(USBHC_DEV_IFACE),
-	    IPC_M_USBHC_RELEASE_ADDRESS, address);
-}
-
-/** Send data to HCD.
- *
- * @param phone Phone to HC.
- * @param method Method used for calling.
- * @param target Targeted device.
- * @param buffer Data buffer (NULL to skip data transfer phase).
- * @param size Buffer size (must be zero when @p buffer is NULL).
- * @param handle Storage for transaction handle (cannot be NULL).
- * @return Error status.
- * @retval EINVAL Invalid parameter.
- * @retval ENOMEM Not enough memory to complete the operation.
- */
-static int async_send_buffer(int phone, int method,
-    usb_target_t target,
-    void *buffer, size_t size,
-    usb_handle_t *handle)
-{
-	if (phone < 0) {
-		return EINVAL;
-	}
-
-	if ((buffer == NULL) && (size > 0)) {
-		return EINVAL;
-	}
-
-	if (handle == NULL) {
-		return EINVAL;
-	}
-
-	transfer_info_t *transfer
-	    = (transfer_info_t *) malloc(sizeof(transfer_info_t));
-	if (transfer == NULL) {
-		return ENOMEM;
-	}
-
-	transfer->read_request = 0;
-	transfer->size_transferred = NULL;
-	transfer->buffer = NULL;
-	transfer->size = 0;
-	transfer->phone = phone;
-
-	int rc;
-
-	transfer->request = async_send_4(phone,
-	    DEV_IFACE_ID(USBHC_DEV_IFACE),
-	    method,
-	    target.address, target.endpoint,
-	    size,
-	    &transfer->reply);
-
-	if (size > 0) {
-		rc = async_data_write_start(phone, buffer, size);
-		if (rc != EOK) {
-			async_wait_for(transfer->request, NULL);
-			return rc;
-		}
-	}
-
-	*handle = (usb_handle_t) transfer;
-
-	return EOK;
-}
-
-/** Prepare data retrieval.
- *
- * @param phone Opened phone to HCD.
- * @param method Method used for calling.
- * @param target Targeted device.
- * @param buffer Buffer where to store retrieved data
- * 	(NULL to skip data transfer phase).
- * @param size Buffer size (must be zero when @p buffer is NULL).
- * @param actual_size Storage where actual number of bytes transferred will
- * 	be stored.
- * @param handle Storage for transaction handle (cannot be NULL).
- * @return Error status.
- * @retval EINVAL Invalid parameter.
- * @retval ENOMEM Not enough memory to complete the operation.
- */
-static int async_recv_buffer(int phone, int method,
-    usb_target_t target,
-    void *buffer, size_t size, size_t *actual_size,
-    usb_handle_t *handle)
-{
-	if (phone < 0) {
-		return EINVAL;
-	}
-
-	if ((buffer == NULL) && (size > 0)) {
-		return EINVAL;
-	}
-
-	if (handle == NULL) {
-		return EINVAL;
-	}
-
-	transfer_info_t *transfer
-	    = (transfer_info_t *) malloc(sizeof(transfer_info_t));
-	if (transfer == NULL) {
-		return ENOMEM;
-	}
-
-	transfer->read_request = 0;
-	transfer->size_transferred = actual_size;
-	transfer->buffer = buffer;
-	transfer->size = size;
-	transfer->phone = phone;
-
-	transfer->request = async_send_4(phone,
-	    DEV_IFACE_ID(USBHC_DEV_IFACE),
-	    method,
-	    target.address, target.endpoint,
-	    size,
-	    &transfer->reply);
-
-	if (buffer != NULL) {
-		transfer->read_request = async_data_read(phone, buffer, size,
-		    &transfer->read_reply);
-	}
-
-	*handle = (usb_handle_t) transfer;
-
-	return EOK;
-}
-
+	return ENOTSUP;
+}
 
 /** Blocks caller until given USB transaction is finished.
@@ -355,42 +149,5 @@
 int usb_drv_async_wait_for(usb_handle_t handle)
 {
-	if (handle == 0) {
-		return EBADMEM;
-	}
-
-	int rc = EOK;
-
-	transfer_info_t *transfer = (transfer_info_t *) handle;
-
-	sysarg_t answer_rc;
-
-	/*
-	 * If the buffer is not NULL, we must accept some data.
-	 */
-	if ((transfer->buffer != NULL) && (transfer->size > 0)) {
-		async_wait_for(transfer->read_request, &answer_rc);
-
-		if (answer_rc != EOK) {
-			rc = (int) answer_rc;
-			goto leave;
-		}
-
-		if (transfer->size_transferred != NULL) {
-			*(transfer->size_transferred)
-			    = IPC_GET_ARG2(transfer->read_reply);
-		}
-	}
-
-	async_wait_for(transfer->request, &answer_rc);
-
-	if (answer_rc != EOK) {
-		rc = (int) answer_rc;
-		goto leave;
-	}
-
-leave:
-	free(transfer);
-
-	return rc;
+	return ENOTSUP;
 }
 
@@ -400,9 +157,5 @@
     usb_handle_t *handle)
 {
-	return async_send_buffer(phone,
-	    IPC_M_USBHC_INTERRUPT_OUT,
-	    target,
-	    buffer, size,
-	    handle);
+	return ENOTSUP;
 }
 
@@ -412,9 +165,5 @@
     usb_handle_t *handle)
 {
-	return async_recv_buffer(phone,
-	    IPC_M_USBHC_INTERRUPT_IN,
-	    target,
-	    buffer, size, actual_size,
-	    handle);
+	return ENOTSUP;
 }
 
@@ -424,9 +173,5 @@
     usb_handle_t *handle)
 {
-	return async_send_buffer(phone,
-	    IPC_M_USBHC_CONTROL_WRITE_SETUP,
-	    target,
-	    buffer, size,
-	    handle);
+	return ENOTSUP;
 }
 
@@ -436,9 +181,5 @@
     usb_handle_t *handle)
 {
-	return async_send_buffer(phone,
-	    IPC_M_USBHC_CONTROL_WRITE_DATA,
-	    target,
-	    buffer, size,
-	    handle);
+	return ENOTSUP;
 }
 
@@ -447,9 +188,5 @@
     usb_handle_t *handle)
 {
-	return async_recv_buffer(phone,
-	    IPC_M_USBHC_CONTROL_WRITE_STATUS,
-	    target,
-	    NULL, 0, NULL,
-	    handle);
+	return ENOTSUP;
 }
 
@@ -460,49 +197,5 @@
     usb_handle_t *handle)
 {
-	// FIXME - check input parameters instead of asserting them
-	assert(phone > 0);
-	assert(setup_packet != NULL);
-	assert(setup_packet_size > 0);
-	assert(((buffer != NULL) && (buffer_size > 0))
-	    || ((buffer == NULL) && (buffer_size == 0)));
-	assert(handle != NULL);
-
-	transfer_info_t *transfer
-	    = (transfer_info_t *) malloc(sizeof(transfer_info_t));
-	if (transfer == NULL) {
-		return ENOMEM;
-	}
-
-	transfer->read_request = 0;
-	transfer->size_transferred = NULL;
-	transfer->buffer = NULL;
-	transfer->size = 0;
-	transfer->phone = phone;
-
-	int rc;
-
-	transfer->request = async_send_3(phone,
-	    DEV_IFACE_ID(USBHC_DEV_IFACE),
-	    IPC_M_USBHC_CONTROL_WRITE,
-	    target.address, target.endpoint,
-	    &transfer->reply);
-
-	rc = async_data_write_start(phone, setup_packet, setup_packet_size);
-	if (rc != EOK) {
-		async_wait_for(transfer->request, NULL);
-		return rc;
-	}
-
-	if (buffer_size > 0) {
-		rc = async_data_write_start(phone, buffer, buffer_size);
-		if (rc != EOK) {
-			async_wait_for(transfer->request, NULL);
-			return rc;
-		}
-	}
-
-	*handle = (usb_handle_t) transfer;
-
-	return EOK;
+	return ENOTSUP;
 }
 
@@ -512,9 +205,5 @@
     usb_handle_t *handle)
 {
-	return async_send_buffer(phone,
-	    IPC_M_USBHC_CONTROL_READ_SETUP,
-	    target,
-	    buffer, size,
-	    handle);
+	return ENOTSUP;
 }
 
@@ -524,9 +213,5 @@
     usb_handle_t *handle)
 {
-	return async_recv_buffer(phone,
-	    IPC_M_USBHC_CONTROL_READ_DATA,
-	    target,
-	    buffer, size, actual_size,
-	    handle);
+	return ENOTSUP;
 }
 
@@ -535,9 +220,5 @@
     usb_handle_t *handle)
 {
-	return async_send_buffer(phone,
-	    IPC_M_USBHC_CONTROL_READ_STATUS,
-	    target,
-	    NULL, 0,
-	    handle);
+	return ENOTSUP;
 }
 
@@ -548,44 +229,5 @@
     usb_handle_t *handle)
 {
-	// FIXME - check input parameters instead of asserting them
-	assert(phone > 0);
-	assert(setup_packet != NULL);
-	assert(setup_packet_size > 0);
-	assert(buffer != NULL);
-	assert(buffer_size > 0);
-	assert(handle != NULL);
-
-	transfer_info_t *transfer
-	    = (transfer_info_t *) malloc(sizeof(transfer_info_t));
-	if (transfer == NULL) {
-		return ENOMEM;
-	}
-
-	transfer->size_transferred = actual_size;
-	transfer->buffer = buffer;
-	transfer->size = buffer_size;
-	transfer->phone = phone;
-
-	int rc;
-
-	transfer->request = async_send_4(phone,
-	    DEV_IFACE_ID(USBHC_DEV_IFACE),
-	    IPC_M_USBHC_CONTROL_READ,
-	    target.address, target.endpoint,
-	    buffer_size,
-	    &transfer->reply);
-
-	rc = async_data_write_start(phone, setup_packet, setup_packet_size);
-	if (rc != EOK) {
-		async_wait_for(transfer->request, NULL);
-		return rc;
-	}
-
-	transfer->read_request = async_data_read(phone, buffer, buffer_size,
-	    &transfer->read_reply);
-
-	*handle = (usb_handle_t) transfer;
-
-	return EOK;
+	return ENOTSUP;
 }
 
