Index: uspace/lib/usbdev/src/pipesio.c
===================================================================
--- uspace/lib/usbdev/src/pipesio.c	(revision 160b75e098f96312d13cf8c93e26f0ee3e46c1a5)
+++ uspace/lib/usbdev/src/pipesio.c	(revision 79ae36ddc409577eb0da3750b3a7280e034566a2)
@@ -44,4 +44,5 @@
  * obviously).
  */
+
 #include <usb/usb.h>
 #include <usb/dev/pipes.h>
@@ -50,4 +51,5 @@
 #include <usbhc_iface.h>
 #include <usb/dev/request.h>
+#include <async.h>
 #include "pipepriv.h"
 
@@ -79,33 +81,35 @@
 			return ENOTSUP;
 	}
-
+	
 	/* Ensure serialization over the phone. */
 	pipe_start_transaction(pipe);
-
+	async_exch_t *exch = async_exchange_begin(pipe->hc_sess);
+	
 	/*
 	 * Make call identifying target USB device and type of transfer.
 	 */
-	aid_t opening_request = async_send_3(pipe->hc_phone,
-	    DEV_IFACE_ID(USBHC_DEV_IFACE), ipc_method,
-	    pipe->wire->address, pipe->endpoint_no,
-	    NULL);
+	aid_t opening_request = async_send_3(exch, DEV_IFACE_ID(USBHC_DEV_IFACE),
+	    ipc_method, pipe->wire->address, pipe->endpoint_no, NULL);
+	
 	if (opening_request == 0) {
+		async_exchange_end(exch);
 		pipe_end_transaction(pipe);
 		return ENOMEM;
 	}
-
+	
 	/*
 	 * Retrieve the data.
 	 */
 	ipc_call_t data_request_call;
-	aid_t data_request = async_data_read(pipe->hc_phone, buffer, size,
+	aid_t data_request = async_data_read(exch, buffer, size,
 	    &data_request_call);
-
+	
 	/*
 	 * Since now on, someone else might access the backing phone
 	 * without breaking the transfer IPC protocol.
 	 */
+	async_exchange_end(exch);
 	pipe_end_transaction(pipe);
-
+	
 	if (data_request == 0) {
 		/*
@@ -116,5 +120,5 @@
 		return ENOMEM;
 	}
-
+	
 	/*
 	 * Wait for the answer.
@@ -124,5 +128,5 @@
 	async_wait_for(data_request, &data_request_rc);
 	async_wait_for(opening_request, &opening_request_rc);
-
+	
 	if (data_request_rc != EOK) {
 		/* Prefer the return code of the opening request. */
@@ -136,7 +140,7 @@
 		return (int) opening_request_rc;
 	}
-
+	
 	*size_transfered = IPC_GET_ARG2(data_request_call);
-
+	
 	return EOK;
 }
@@ -228,33 +232,35 @@
 	/* Ensure serialization over the phone. */
 	pipe_start_transaction(pipe);
-
+	async_exch_t *exch = async_exchange_begin(pipe->hc_sess);
+	
 	/*
 	 * Make call identifying target USB device and type of transfer.
 	 */
-	aid_t opening_request = async_send_3(pipe->hc_phone,
-	    DEV_IFACE_ID(USBHC_DEV_IFACE), ipc_method,
-	    pipe->wire->address, pipe->endpoint_no,
-	    NULL);
+	aid_t opening_request = async_send_3(exch, DEV_IFACE_ID(USBHC_DEV_IFACE),
+	    ipc_method, pipe->wire->address, pipe->endpoint_no, NULL);
+	
 	if (opening_request == 0) {
+		async_exchange_end(exch);
 		pipe_end_transaction(pipe);
 		return ENOMEM;
 	}
-
+	
 	/*
 	 * Send the data.
 	 */
-	int rc = async_data_write_start(pipe->hc_phone, buffer, size);
-
+	int rc = async_data_write_start(exch, buffer, size);
+	
 	/*
 	 * Since now on, someone else might access the backing phone
 	 * without breaking the transfer IPC protocol.
 	 */
+	async_exchange_end(exch);
 	pipe_end_transaction(pipe);
-
+	
 	if (rc != EOK) {
 		async_wait_for(opening_request, NULL);
 		return rc;
 	}
-
+	
 	/*
 	 * Wait for the answer.
@@ -262,5 +268,5 @@
 	sysarg_t opening_request_rc;
 	async_wait_for(opening_request, &opening_request_rc);
-
+	
 	return (int) opening_request_rc;
 }
@@ -349,38 +355,39 @@
 	 * Make call identifying target USB device and control transfer type.
 	 */
-	aid_t opening_request = async_send_3(pipe->hc_phone,
-	    DEV_IFACE_ID(USBHC_DEV_IFACE), IPC_M_USBHC_CONTROL_READ,
-	    pipe->wire->address, pipe->endpoint_no,
+	async_exch_t *exch = async_exchange_begin(pipe->hc_sess);
+	aid_t opening_request = async_send_3(exch, DEV_IFACE_ID(USBHC_DEV_IFACE),
+	    IPC_M_USBHC_CONTROL_READ, pipe->wire->address, pipe->endpoint_no,
 	    NULL);
+	
 	if (opening_request == 0) {
+		async_exchange_end(exch);
 		return ENOMEM;
 	}
-
+	
 	/*
 	 * Send the setup packet.
 	 */
-	int rc = async_data_write_start(pipe->hc_phone,
-	    setup_buffer, setup_buffer_size);
-	if (rc != EOK) {
+	int rc = async_data_write_start(exch, setup_buffer, setup_buffer_size);
+	if (rc != EOK) {
+		async_exchange_end(exch);
 		pipe_end_transaction(pipe);
 		async_wait_for(opening_request, NULL);
 		return rc;
 	}
-
+	
 	/*
 	 * Retrieve the data.
 	 */
 	ipc_call_t data_request_call;
-	aid_t data_request = async_data_read(pipe->hc_phone,
-	    data_buffer, data_buffer_size,
-	    &data_request_call);
-
+	aid_t data_request = async_data_read(exch, data_buffer,
+	    data_buffer_size, &data_request_call);
+	
 	/*
 	 * Since now on, someone else might access the backing phone
 	 * without breaking the transfer IPC protocol.
 	 */
+	async_exchange_end(exch);
 	pipe_end_transaction(pipe);
-
-
+	
 	if (data_request == 0) {
 		async_wait_for(opening_request, NULL);
@@ -494,35 +501,36 @@
 	 * Make call identifying target USB device and control transfer type.
 	 */
-	aid_t opening_request = async_send_4(pipe->hc_phone,
-	    DEV_IFACE_ID(USBHC_DEV_IFACE), IPC_M_USBHC_CONTROL_WRITE,
-	    pipe->wire->address, pipe->endpoint_no,
-	    data_buffer_size,
-	    NULL);
+	async_exch_t *exch = async_exchange_begin(pipe->hc_sess);
+	aid_t opening_request = async_send_4(exch, DEV_IFACE_ID(USBHC_DEV_IFACE),
+	    IPC_M_USBHC_CONTROL_WRITE, pipe->wire->address, pipe->endpoint_no,
+	    data_buffer_size, NULL);
+	
 	if (opening_request == 0) {
+		async_exchange_end(exch);
 		pipe_end_transaction(pipe);
 		return ENOMEM;
 	}
-
+	
 	/*
 	 * Send the setup packet.
 	 */
-	int rc = async_data_write_start(pipe->hc_phone,
-	    setup_buffer, setup_buffer_size);
-	if (rc != EOK) {
+	int rc = async_data_write_start(exch, setup_buffer, setup_buffer_size);
+	if (rc != EOK) {
+		async_exchange_end(exch);
 		pipe_end_transaction(pipe);
 		async_wait_for(opening_request, NULL);
 		return rc;
 	}
-
+	
 	/*
 	 * Send the data (if any).
 	 */
 	if (data_buffer_size > 0) {
-		rc = async_data_write_start(pipe->hc_phone,
-		    data_buffer, data_buffer_size);
-
+		rc = async_data_write_start(exch, data_buffer, data_buffer_size);
+		
 		/* All data sent, pipe can be released. */
+		async_exchange_end(exch);
 		pipe_end_transaction(pipe);
-
+	
 		if (rc != EOK) {
 			async_wait_for(opening_request, NULL);
@@ -531,7 +539,8 @@
 	} else {
 		/* No data to send, we can release the pipe for others. */
+		async_exchange_end(exch);
 		pipe_end_transaction(pipe);
 	}
-
+	
 	/*
 	 * Wait for the answer.
