Index: uspace/drv/usbmouse/init.c
===================================================================
--- uspace/drv/usbmouse/init.c	(revision 8869f7b310c75def5ca6f30c89f5c71101c214a9)
+++ uspace/drv/usbmouse/init.c	(revision e6211f839bdbf45238fd7eeaf0ba0e042c0021b8)
@@ -43,7 +43,4 @@
 #include <errno.h>
 
-// FIXME: remove this header
-#include <kernel/ipc/ipc_methods.h>
-
 /** Mouse polling endpoint description for boot protocol subclass. */
 usb_endpoint_description_t poll_endpoint_description = {
@@ -56,39 +53,34 @@
 };
 
-static void default_connection_handler(ddf_fun_t *, ipc_callid_t, ipc_call_t *);
+/** Default handler for IPC methods not handled by DDF.
+ *
+ * @param fun     Device function handling the call.
+ * @param icallid Call ID.
+ * @param icall   Call data.
+ *
+ */
+static void default_connection_handler(ddf_fun_t *fun, ipc_callid_t icallid,
+    ipc_call_t *icall)
+{
+	usb_mouse_t *mouse = (usb_mouse_t *) fun->driver_data;
+	assert(mouse != NULL);
+	
+	async_sess_t *callback =
+	    async_callback_receive_start(EXCHANGE_SERIALIZE, icall);
+	
+	if (callback) {
+		if (mouse->console_sess == NULL) {
+			mouse->console_sess = callback;
+			async_answer_0(icallid, EOK);
+		} else
+			async_answer_0(icallid, ELIMIT);
+	} else
+		async_answer_0(icallid, EINVAL);
+}
+
 /** Device ops for USB mouse. */
 static ddf_dev_ops_t mouse_ops = {
 	.default_handler = default_connection_handler
 };
-
-/** Default handler for IPC methods not handled by DDF.
- *
- * @param fun Device function handling the call.
- * @param icallid Call id.
- * @param icall Call data.
- */
-void default_connection_handler(ddf_fun_t *fun,
-    ipc_callid_t icallid, ipc_call_t *icall)
-{
-	sysarg_t method = IPC_GET_IMETHOD(*icall);
-
-	usb_mouse_t *mouse = (usb_mouse_t *) fun->driver_data;
-	assert(mouse != NULL);
-
-	if (method == IPC_M_CONNECT_TO_ME) {
-		int callback = IPC_GET_ARG5(*icall);
-
-		if (mouse->console_phone != -1) {
-			async_answer_0(icallid, ELIMIT);
-			return;
-		}
-
-		mouse->console_phone = callback;
-		async_answer_0(icallid, EOK);
-		return;
-	}
-
-	async_answer_0(icallid, EINVAL);
-}
 
 /** Create USB mouse device.
@@ -102,12 +94,12 @@
 {
 	usb_mouse_t *mouse = malloc(sizeof(usb_mouse_t));
-	if (mouse == NULL) {
+	if (mouse == NULL)
 		return ENOMEM;
-	}
+	
 	mouse->dev = dev;
-	mouse->console_phone = -1;
-
+	mouse->console_sess = NULL;
+	
 	int rc;
-
+	
 	/* Create DDF function. */
 	mouse->mouse_fun = ddf_fun_create(dev->ddf_dev, fun_exposed, "mouse");
@@ -116,34 +108,30 @@
 		goto leave;
 	}
-
+	
 	mouse->mouse_fun->ops = &mouse_ops;
-
+	
 	rc = ddf_fun_bind(mouse->mouse_fun);
-	if (rc != EOK) {
+	if (rc != EOK)
 		goto leave;
-	}
-
+	
 	/* Add the function to mouse class. */
 	rc = ddf_fun_add_to_class(mouse->mouse_fun, "mouse");
-	if (rc != EOK) {
+	if (rc != EOK)
 		goto leave;
-	}
 	
 	/* Set the boot protocol. */
 	rc = usbhid_req_set_protocol(&dev->ctrl_pipe, dev->interface_no,
 	    USB_HID_PROTOCOL_BOOT);
-	if (rc != EOK) {
+	if (rc != EOK)
 		goto leave;
-	}
 	
-	/* Everything all right. */
+	/* Everything allright. */
 	dev->driver_data = mouse;
 	mouse->mouse_fun->driver_data = mouse;
-
+	
 	return EOK;
-
+	
 leave:
 	free(mouse);
-
 	return rc;
 }
Index: uspace/drv/usbmouse/main.c
===================================================================
--- uspace/drv/usbmouse/main.c	(revision 8869f7b310c75def5ca6f30c89f5c71101c214a9)
+++ uspace/drv/usbmouse/main.c	(revision e6211f839bdbf45238fd7eeaf0ba0e042c0021b8)
@@ -34,4 +34,5 @@
  * Main routines of USB boot protocol mouse driver.
  */
+
 #include "mouse.h"
 #include <usb/debug.h>
@@ -40,8 +41,12 @@
 #include <str_error.h>
 
+#define NAME  "usbmouse"
+
 /** Callback when new mouse device is attached and recognised by DDF.
  *
  * @param dev Representation of a generic DDF device.
+ *
  * @return Error code.
+ *
  */
 static int usbmouse_add_device(usb_device_t *dev)
@@ -53,12 +58,12 @@
 		return rc;
 	}
-
+	
 	usb_log_debug("Polling pipe at endpoint %d.\n",
 	    dev->pipes[0].pipe->endpoint_no);
-
-	rc = usb_device_auto_poll(dev, 0,
-	    usb_mouse_polling_callback, dev->pipes[0].pipe->max_packet_size,
+	
+	rc = usb_device_auto_poll(dev, 0, usb_mouse_polling_callback,
+	    dev->pipes[0].pipe->max_packet_size,
 	    usb_mouse_polling_ended_callback, dev->driver_data);
-
+	
 	if (rc != EOK) {
 		usb_log_error("Failed to start polling fibril: %s.\n",
@@ -66,8 +71,8 @@
 		return rc;
 	}
-
+	
 	usb_log_info("controlling new mouse (handle %" PRIun ").\n",
 	    dev->ddf_dev->handle);
-
+	
 	return EOK;
 }
@@ -93,5 +98,4 @@
 {
 	usb_log_enable(USB_LOG_LEVEL_DEFAULT, NAME);
-
 	return usb_driver_main(&mouse_driver);
 }
Index: uspace/drv/usbmouse/mouse.c
===================================================================
--- uspace/drv/usbmouse/mouse.c	(revision 8869f7b310c75def5ca6f30c89f5c71101c214a9)
+++ uspace/drv/usbmouse/mouse.c	(revision e6211f839bdbf45238fd7eeaf0ba0e042c0021b8)
@@ -40,23 +40,24 @@
 #include <ipc/mouse.h>
 #include <async.h>
-#include <async_obsolete.h>
 #include "mouse.h"
 
 /** Mouse polling callback.
  *
- * @param dev Device that is being polled.
+ * @param dev    Device that is being polled.
  * @param buffer Data buffer.
- * @param buffer_size Buffer size in bytes.
- * @param arg Custom argument - points to usb_mouse_t.
+ * @param size   Buffer size in bytes.
+ * @param arg    Pointer to usb_mouse_t.
+ *
  * @return Always true.
+ *
  */
-bool usb_mouse_polling_callback(usb_device_t *dev,
-    uint8_t *buffer, size_t buffer_size, void *arg)
+bool usb_mouse_polling_callback(usb_device_t *dev, uint8_t *buffer,
+    size_t size, void *arg)
 {
 	usb_mouse_t *mouse = (usb_mouse_t *) arg;
-
+	
 	usb_log_debug2("got buffer: %s.\n",
-	    usb_debug_str_buffer(buffer, buffer_size, 0));
-
+	    usb_debug_str_buffer(buffer, size, 0));
+	
 	uint8_t butt = buffer[0];
 	char str_buttons[4] = {
@@ -66,41 +67,42 @@
 		0
 	};
-
+	
 	int shift_x = ((int) buffer[1]) - 127;
 	int shift_y = ((int) buffer[2]) - 127;
 	int wheel = ((int) buffer[3]) - 127;
-
-	if (buffer[1] == 0) {
+	
+	if (buffer[1] == 0)
 		shift_x = 0;
-	}
-	if (buffer[2] == 0) {
+	
+	if (buffer[2] == 0)
 		shift_y = 0;
-	}
-	if (buffer[3] == 0) {
+	
+	if (buffer[3] == 0)
 		wheel = 0;
-	}
-
-	if (mouse->console_phone >= 0) {
+	
+	if (mouse->console_sess) {
 		if ((shift_x != 0) || (shift_y != 0)) {
-			/* FIXME: guessed for QEMU */
-			async_obsolete_req_2_0(mouse->console_phone,
-			    MEVENT_MOVE,
-			    - shift_x / 10,  - shift_y / 10);
+			// FIXME: guessed for QEMU
+			
+			async_exch_t *exch = async_exchange_begin(mouse->console_sess);
+			async_req_2_0(exch, MEVENT_MOVE, -shift_x / 10, -shift_y / 10);
+			async_exchange_end(exch);
 		}
 		if (butt) {
-			/* FIXME: proper button clicking. */
-			async_obsolete_req_2_0(mouse->console_phone,
-			    MEVENT_BUTTON, 1, 1);
-			async_obsolete_req_2_0(mouse->console_phone,
-			    MEVENT_BUTTON, 1, 0);
+			// FIXME: proper button clicking
+			
+			async_exch_t *exch = async_exchange_begin(mouse->console_sess);
+			async_req_2_0(exch, MEVENT_BUTTON, 1, 1);
+			async_req_2_0(exch, MEVENT_BUTTON, 1, 0);
+			async_exchange_end(exch);
 		}
 	}
-
+	
 	usb_log_debug("buttons=%s  dX=%+3d  dY=%+3d  wheel=%+3d\n",
 	    str_buttons, shift_x, shift_y, wheel);
-
+	
 	/* Guess. */
 	async_usleep(1000);
-
+	
 	return true;
 }
@@ -108,17 +110,18 @@
 /** Callback when polling is terminated.
  *
- * @param dev Device where the polling terminated.
+ * @param dev              Device where the polling terminated.
  * @param recurring_errors Whether the polling was terminated due to
- *	recurring errors.
- * @param arg Custom argument - points to usb_mouse_t.
+ *                         recurring errors.
+ * @param arg              Pointer to usb_mouse_t.
+ *
  */
-void usb_mouse_polling_ended_callback(usb_device_t *dev,
-    bool recurring_errors, void *arg)
+void usb_mouse_polling_ended_callback(usb_device_t *dev, bool recurring_errors,
+    void *arg)
 {
 	usb_mouse_t *mouse = (usb_mouse_t *) arg;
-
-	async_obsolete_hangup(mouse->console_phone);
-	mouse->console_phone = -1;
-
+	
+	async_hangup(mouse->console_sess);
+	mouse->console_sess = NULL;
+	
 	usb_device_destroy(dev);
 }
Index: uspace/drv/usbmouse/mouse.h
===================================================================
--- uspace/drv/usbmouse/mouse.h	(revision 8869f7b310c75def5ca6f30c89f5c71101c214a9)
+++ uspace/drv/usbmouse/mouse.h	(revision e6211f839bdbf45238fd7eeaf0ba0e042c0021b8)
@@ -34,4 +34,5 @@
  * Common definitions for USB mouse driver.
  */
+
 #ifndef USBMOUSE_MOUSE_H_
 #define USBMOUSE_MOUSE_H_
@@ -40,6 +41,8 @@
 #include <usb/dev/pipes.h>
 #include <time.h>
+#include <async.h>
 
-#define NAME "usbmouse"
+#define POLL_PIPE(dev) \
+	((dev)->pipes[0].pipe)
 
 /** Container for USB mouse device. */
@@ -47,22 +50,24 @@
 	/** Generic device container. */
 	usb_device_t *dev;
+	
 	/** Function representing the device. */
 	ddf_fun_t *mouse_fun;
+	
 	/** Polling interval in microseconds. */
 	suseconds_t poll_interval_us;
-	/** IPC phone to console (consumer). */
-	int console_phone;
+	
+	/** Callback session to console (consumer). */
+	async_sess_t *console_sess;
 } usb_mouse_t;
-
-#define POLL_PIPE(dev) ((dev)->pipes[0].pipe)
 
 extern usb_endpoint_description_t poll_endpoint_description;
 
-int usb_mouse_create(usb_device_t *);
-
-bool usb_mouse_polling_callback(usb_device_t *, uint8_t *, size_t, void *);
-void usb_mouse_polling_ended_callback(usb_device_t *, bool, void *);
+extern int usb_mouse_create(usb_device_t *);
+extern bool usb_mouse_polling_callback(usb_device_t *, uint8_t *, size_t,
+    void *);
+extern void usb_mouse_polling_ended_callback(usb_device_t *, bool, void *);
 
 #endif
+
 /**
  * @}
