Index: uspace/srv/hid/adb_mouse/adb_dev.c
===================================================================
--- uspace/srv/hid/adb_mouse/adb_dev.c	(revision 9c0242b0b40302f92f8d0ac933b78ff30bf0348d)
+++ uspace/srv/hid/adb_mouse/adb_dev.c	(revision 9934f7d3082d2ffdd107cc0c78d61d504b0f401e)
@@ -48,5 +48,5 @@
 #include "adb_dev.h"
 
-static void adb_dev_events(ipc_callid_t iid, ipc_call_t *icall);
+static void adb_dev_events(ipc_callid_t iid, ipc_call_t *icall, void *arg);
 
 int adb_dev_init(void)
@@ -68,5 +68,6 @@
 	
 	/* NB: The callback connection is slotted for removal */
-	if (async_obsolete_connect_to_me(dev_phone, 0, 0, 0, adb_dev_events) != 0) {
+	if (async_obsolete_connect_to_me(dev_phone, 0, 0, 0, adb_dev_events,
+	    NULL) != 0) {
 		printf(NAME ": Failed to create callback from device\n");
 		return false;
@@ -76,5 +77,5 @@
 }
 
-static void adb_dev_events(ipc_callid_t iid, ipc_call_t *icall)
+static void adb_dev_events(ipc_callid_t iid, ipc_call_t *icall, void *arg)
 {
 	/* Ignore parameters, the connection is already opened */
Index: uspace/srv/hid/adb_mouse/adb_mouse.c
===================================================================
--- uspace/srv/hid/adb_mouse/adb_mouse.c	(revision 9c0242b0b40302f92f8d0ac933b78ff30bf0348d)
+++ uspace/srv/hid/adb_mouse/adb_mouse.c	(revision 9934f7d3082d2ffdd107cc0c78d61d504b0f401e)
@@ -52,5 +52,5 @@
 #include <kernel/ipc/ipc_methods.h>
 
-static void client_connection(ipc_callid_t iid, ipc_call_t *icall);
+static void client_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg);
 static void mouse_ev_btn(int button, int press);
 static void mouse_ev_move(int dx, int dy);
@@ -94,5 +94,5 @@
 }
 
-static void client_connection(ipc_callid_t iid, ipc_call_t *icall)
+static void client_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg)
 {
 	ipc_callid_t callid;
Index: uspace/srv/hid/char_mouse/char_mouse.c
===================================================================
--- uspace/srv/hid/char_mouse/char_mouse.c	(revision 9c0242b0b40302f92f8d0ac933b78ff30bf0348d)
+++ uspace/srv/hid/char_mouse/char_mouse.c	(revision 9934f7d3082d2ffdd107cc0c78d61d504b0f401e)
@@ -79,5 +79,5 @@
 }
 
-static void client_connection(ipc_callid_t iid, ipc_call_t *icall)
+static void client_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg)
 {
 	ipc_callid_t callid;
Index: uspace/srv/hid/char_mouse/chardev.c
===================================================================
--- uspace/srv/hid/char_mouse/chardev.c	(revision 9c0242b0b40302f92f8d0ac933b78ff30bf0348d)
+++ uspace/srv/hid/char_mouse/chardev.c	(revision 9934f7d3082d2ffdd107cc0c78d61d504b0f401e)
@@ -45,5 +45,5 @@
 #include <mouse_port.h>
 
-static void chardev_events(ipc_callid_t iid, ipc_call_t *icall);
+static void chardev_events(ipc_callid_t iid, ipc_call_t *icall, void *arg);
 
 static int dev_phone;
@@ -69,5 +69,6 @@
 	
 	/* NB: The callback connection is slotted for removal */
-	if (async_obsolete_connect_to_me(dev_phone, 0, 0, 0, chardev_events) != 0) {
+	if (async_obsolete_connect_to_me(dev_phone, 0, 0, 0, chardev_events,
+	    NULL) != 0) {
 		printf(NAME ": Failed to create callback from device\n");
 		return false;
@@ -90,5 +91,5 @@
 }
 
-static void chardev_events(ipc_callid_t iid, ipc_call_t *icall)
+static void chardev_events(ipc_callid_t iid, ipc_call_t *icall, void *arg)
 {
 	/* Ignore parameters, the connection is already opened */
Index: uspace/srv/hid/console/console.c
===================================================================
--- uspace/srv/hid/console/console.c	(revision 9c0242b0b40302f92f8d0ac933b78ff30bf0348d)
+++ uspace/srv/hid/console/console.c	(revision 9934f7d3082d2ffdd107cc0c78d61d504b0f401e)
@@ -427,5 +427,5 @@
 
 /** Handler for keyboard */
-static void keyboard_events(ipc_callid_t iid, ipc_call_t *icall)
+static void keyboard_events(ipc_callid_t iid, ipc_call_t *icall, void *arg)
 {
 	/* Ignore parameters, the connection is already opened */
@@ -474,5 +474,5 @@
 
 /** Handler for mouse events */
-static void mouse_events(ipc_callid_t iid, ipc_call_t *icall)
+static void mouse_events(ipc_callid_t iid, ipc_call_t *icall, void *arg)
 {
 	/* Ignore parameters, the connection is already opened */
@@ -597,5 +597,5 @@
 
 /** Default thread for new connections */
-static void client_connection(ipc_callid_t iid, ipc_call_t *icall)
+static void client_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg)
 {
 	console_t *cons = NULL;
@@ -759,5 +759,5 @@
 	if (client_receiver != NULL)
 		async_new_connection(task_hash, phone_hash, phone_hash, NULL,
-		    client_receiver);
+		    client_receiver, NULL);
 	
 	if (hash != NULL)
Index: uspace/srv/hid/fb/ega.c
===================================================================
--- uspace/srv/hid/fb/ega.c	(revision 9c0242b0b40302f92f8d0ac933b78ff30bf0348d)
+++ uspace/srv/hid/fb/ega.c	(revision 9934f7d3082d2ffdd107cc0c78d61d504b0f401e)
@@ -256,5 +256,6 @@
 }
 
-static void ega_client_connection(ipc_callid_t iid, ipc_call_t *icall)
+static void ega_client_connection(ipc_callid_t iid, ipc_call_t *icall,
+    void *arg)
 {
 	size_t intersize = 0;
Index: uspace/srv/hid/fb/fb.c
===================================================================
--- uspace/srv/hid/fb/fb.c	(revision 9c0242b0b40302f92f8d0ac933b78ff30bf0348d)
+++ uspace/srv/hid/fb/fb.c	(revision 9934f7d3082d2ffdd107cc0c78d61d504b0f401e)
@@ -1576,5 +1576,6 @@
  *
  */
-static void fb_client_connection(ipc_callid_t iid, ipc_call_t *icall)
+static void fb_client_connection(ipc_callid_t iid, ipc_call_t *icall,
+    void *arg)
 {
 	unsigned int vp = 0;
Index: uspace/srv/hid/fb/serial_console.c
===================================================================
--- uspace/srv/hid/fb/serial_console.c	(revision 9c0242b0b40302f92f8d0ac933b78ff30bf0348d)
+++ uspace/srv/hid/fb/serial_console.c	(revision 9934f7d3082d2ffdd107cc0c78d61d504b0f401e)
@@ -315,5 +315,5 @@
  * Main function of the thread serving client connections.
  */
-void serial_client_connection(ipc_callid_t iid, ipc_call_t *icall)
+void serial_client_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg)
 {
 	keyfield_t *interbuf = NULL;
Index: uspace/srv/hid/fb/serial_console.h
===================================================================
--- uspace/srv/hid/fb/serial_console.h	(revision 9c0242b0b40302f92f8d0ac933b78ff30bf0348d)
+++ uspace/srv/hid/fb/serial_console.h	(revision 9934f7d3082d2ffdd107cc0c78d61d504b0f401e)
@@ -52,5 +52,5 @@
 extern void serial_set_scroll_region(sysarg_t);
 extern void serial_console_init(putc_function_t, sysarg_t, sysarg_t);
-extern void serial_client_connection(ipc_callid_t, ipc_call_t *);
+extern void serial_client_connection(ipc_callid_t, ipc_call_t *, void *arg);
 
 #endif
Index: uspace/srv/hid/input/ctl/kbdev.c
===================================================================
--- uspace/srv/hid/input/ctl/kbdev.c	(revision 9c0242b0b40302f92f8d0ac933b78ff30bf0348d)
+++ uspace/srv/hid/input/ctl/kbdev.c	(revision 9934f7d3082d2ffdd107cc0c78d61d504b0f401e)
@@ -54,5 +54,5 @@
 static void kbdev_ctl_set_ind(kbd_dev_t *, unsigned);
 
-static void kbdev_callback_conn(ipc_callid_t, ipc_call_t *);
+static void kbdev_callback_conn(ipc_callid_t, ipc_call_t *, void *arg);
 
 kbd_ctl_ops_t kbdev_ctl = {
@@ -73,7 +73,4 @@
 	int fd;
 } kbdev_t;
-
-/** XXX Need to pass data from async_connect_to_me() to connection handler */
-static kbdev_t *unprotected_kbdev;
 
 static kbdev_t *kbdev_new(kbd_dev_t *kdev)
@@ -140,12 +137,5 @@
 	}
 
-	/*
-	 * XXX We need to pass kbdev to the connection handler. Since the
-	 * framework does not support this, use a global variable.
-	 * This needs to be fixed ASAP.
-	 */
-	unprotected_kbdev = kbdev;
-
-	rc = async_connect_to_me(exch, 0, 0, 0, kbdev_callback_conn);
+	rc = async_connect_to_me(exch, 0, 0, 0, kbdev_callback_conn, kbdev);
 	if (rc != EOK) {
 		printf(NAME ": Failed creating callback connection from '%s'.\n",
@@ -177,5 +167,5 @@
 }
 
-static void kbdev_callback_conn(ipc_callid_t iid, ipc_call_t *icall)
+static void kbdev_callback_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg)
 {
 	kbdev_t *kbdev;
@@ -183,5 +173,6 @@
 	int type, key;
 
-	kbdev = unprotected_kbdev;
+	/* Kbdev device structure */
+	kbdev = arg;
 
 	while (true) {
Index: uspace/srv/hid/input/generic/input.c
===================================================================
--- uspace/srv/hid/input/generic/input.c	(revision 9c0242b0b40302f92f8d0ac933b78ff30bf0348d)
+++ uspace/srv/hid/input/generic/input.c	(revision 9934f7d3082d2ffdd107cc0c78d61d504b0f401e)
@@ -178,5 +178,5 @@
 }
 
-static void client_connection(ipc_callid_t iid, ipc_call_t *icall)
+static void client_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg)
 {
 	ipc_callid_t callid;
Index: uspace/srv/hid/input/port/adb.c
===================================================================
--- uspace/srv/hid/input/port/adb.c	(revision 9c0242b0b40302f92f8d0ac933b78ff30bf0348d)
+++ uspace/srv/hid/input/port/adb.c	(revision 9934f7d3082d2ffdd107cc0c78d61d504b0f401e)
@@ -46,5 +46,5 @@
 #include <devmap_obsolete.h>
 
-static void kbd_port_events(ipc_callid_t iid, ipc_call_t *icall);
+static void kbd_port_events(ipc_callid_t iid, ipc_call_t *icall, void *arg);
 static void adb_kbd_reg0_data(uint16_t data);
 
@@ -82,5 +82,6 @@
 	
 	/* NB: The callback connection is slotted for removal */
-	rc = async_obsolete_connect_to_me(dev_phone, 0, 0, 0, kbd_port_events);
+	rc = async_obsolete_connect_to_me(dev_phone, 0, 0, 0, kbd_port_events,
+	    NULL);
 	if (rc != EOK) {
 		printf(NAME ": Failed to create callback from device\n");
@@ -104,5 +105,5 @@
 }
 
-static void kbd_port_events(ipc_callid_t iid, ipc_call_t *icall)
+static void kbd_port_events(ipc_callid_t iid, ipc_call_t *icall, void *arg)
 {
 	/* Ignore parameters, the connection is already opened */
Index: uspace/srv/hid/input/port/chardev.c
===================================================================
--- uspace/srv/hid/input/port/chardev.c	(revision 9c0242b0b40302f92f8d0ac933b78ff30bf0348d)
+++ uspace/srv/hid/input/port/chardev.c	(revision 9934f7d3082d2ffdd107cc0c78d61d504b0f401e)
@@ -45,5 +45,5 @@
 #include <stdio.h>
 
-static void kbd_port_events(ipc_callid_t iid, ipc_call_t *icall);
+static void kbd_port_events(ipc_callid_t iid, ipc_call_t *icall, void *arg);
 
 static int chardev_port_init(kbd_dev_t *);
@@ -96,5 +96,6 @@
 	
 	/* NB: The callback connection is slotted for removal */
-	if (async_obsolete_connect_to_me(dev_phone, 0, 0, 0, kbd_port_events) != 0) {
+	if (async_obsolete_connect_to_me(dev_phone, 0, 0, 0, kbd_port_events,
+	    NULL) != 0) {
 		printf(NAME ": Failed to create callback from device\n");
 		return -1;
@@ -117,5 +118,5 @@
 }
 
-static void kbd_port_events(ipc_callid_t iid, ipc_call_t *icall)
+static void kbd_port_events(ipc_callid_t iid, ipc_call_t *icall, void *arg)
 {
 	/* Ignore parameters, the connection is already opened */
Index: uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c
===================================================================
--- uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c	(revision 9c0242b0b40302f92f8d0ac933b78ff30bf0348d)
+++ uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c	(revision 9934f7d3082d2ffdd107cc0c78d61d504b0f401e)
@@ -73,5 +73,6 @@
 static s3c24xx_ts_t *ts;
 
-static void s3c24xx_ts_connection(ipc_callid_t iid, ipc_call_t *icall);
+static void s3c24xx_ts_connection(ipc_callid_t iid, ipc_call_t *icall,
+    void *arg);
 static void s3c24xx_ts_irq_handler(ipc_callid_t iid, ipc_call_t *call);
 static void s3c24xx_ts_pen_down(s3c24xx_ts_t *ts);
@@ -373,5 +374,6 @@
 
 /** Handle mouse client connection. */
-static void s3c24xx_ts_connection(ipc_callid_t iid, ipc_call_t *icall)
+static void s3c24xx_ts_connection(ipc_callid_t iid, ipc_call_t *icall,
+    void *arg)
 {
 	ipc_callid_t callid;
