Index: uspace/srv/hw/char/i8042/i8042.c
===================================================================
--- uspace/srv/hw/char/i8042/i8042.c	(revision 16dc8870242df10ae64ee7bcbf125aa8607cb7fb)
+++ uspace/srv/hw/char/i8042/i8042.c	(revision 898e84788b1d147ab48122cb197b9910af5994b2)
@@ -32,5 +32,5 @@
  * @ingroup kbd
  * @{
- */ 
+ */
 /** @file
  * @brief i8042 PS/2 port driver.
@@ -41,5 +41,4 @@
 #include <loc.h>
 #include <async.h>
-#include <async_obsolete.h>
 #include <unistd.h>
 #include <sysinfo.h>
@@ -49,9 +48,6 @@
 #include "i8042.h"
 
-// FIXME: remove this header
-#include <abi/ipc/methods.h>
-
-#define NAME "i8042"
-#define NAMESPACE "char"
+#define NAME       "i8042"
+#define NAMESPACE  "char"
 
 /* Interesting bits for status register */
@@ -145,5 +141,5 @@
 
 	for (i = 0; i < MAX_DEVS; i++) {
-		i8042_port[i].client_phone = -1;
+		i8042_port[i].client_sess = NULL;
 
 		snprintf(name, 16, "%s/ps2%c", NAMESPACE, dchar[i]);
@@ -257,24 +253,26 @@
 		}
 		
-		switch (method) {
-		case IPC_M_CONNECT_TO_ME:
-			printf(NAME ": creating callback connection\n");
-			if (i8042_port[dev_id].client_phone != -1) {
+		async_sess_t *sess =
+		    async_callback_receive_start(EXCHANGE_SERIALIZE, &call);
+		if (sess != NULL) {
+			if (i8042_port[dev_id].client_sess == NULL) {
+				i8042_port[dev_id].client_sess = sess;
+				retval = EOK;
+			} else
 				retval = ELIMIT;
+		} else {
+			switch (method) {
+			case IPC_FIRST_USER_METHOD:
+				printf(NAME ": write %" PRIun " to devid %d\n",
+				    IPC_GET_ARG1(call), dev_id);
+				i8042_port_write(dev_id, IPC_GET_ARG1(call));
+				retval = 0;
+				break;
+			default:
+				retval = EINVAL;
 				break;
 			}
-			i8042_port[dev_id].client_phone = IPC_GET_ARG5(call);
-			retval = 0;
-			break;
-		case IPC_FIRST_USER_METHOD:
-			printf(NAME ": write %" PRIun " to devid %d\n",
-			    IPC_GET_ARG1(call), dev_id);
-			i8042_port_write(dev_id, IPC_GET_ARG1(call));
-			retval = 0;
-			break;
-		default:
-			retval = EINVAL;
-			break;
 		}
+		
 		async_answer_0(callid, retval);
 	}
@@ -305,7 +303,9 @@
 	}
 
-	if (i8042_port[devid].client_phone != -1) {
-		async_obsolete_msg_1(i8042_port[devid].client_phone,
-		    IPC_FIRST_USER_METHOD, data);
+	if (i8042_port[devid].client_sess != NULL) {
+		async_exch_t *exch =
+		    async_exchange_begin(i8042_port[devid].client_sess);
+		async_msg_1(exch, IPC_FIRST_USER_METHOD, data);
+		async_exchange_end(exch);
 	}
 }
