Index: uspace/lib/c/generic/io/con_srv.c
===================================================================
--- uspace/lib/c/generic/io/con_srv.c	(revision 47e00b8364871fedb5a2508cfc367b91b0cb8e63)
+++ uspace/lib/c/generic/io/con_srv.c	(revision 984a9ba2fa05c490a7066737655ed19130c714e8)
@@ -42,20 +42,20 @@
 #include <io/con_srv.h>
 
-static errno_t console_ev_encode(cons_event_t *event, ipc_call_t *call)
-{
-	IPC_SET_ARG1(*call, event->type);
+static errno_t console_ev_encode(cons_event_t *event, ipc_call_t *icall)
+{
+	IPC_SET_ARG1(*icall, event->type);
 
 	switch (event->type) {
 	case CEV_KEY:
-		IPC_SET_ARG2(*call, event->ev.key.type);
-		IPC_SET_ARG3(*call, event->ev.key.key);
-		IPC_SET_ARG4(*call, event->ev.key.mods);
-		IPC_SET_ARG5(*call, event->ev.key.c);
+		IPC_SET_ARG2(*icall, event->ev.key.type);
+		IPC_SET_ARG3(*icall, event->ev.key.key);
+		IPC_SET_ARG4(*icall, event->ev.key.mods);
+		IPC_SET_ARG5(*icall, event->ev.key.c);
 		break;
 	case CEV_POS:
-		IPC_SET_ARG2(*call, (event->ev.pos.pos_id << 16) | (event->ev.pos.type & 0xffff));
-		IPC_SET_ARG3(*call, event->ev.pos.btn_num);
-		IPC_SET_ARG4(*call, event->ev.pos.hpos);
-		IPC_SET_ARG5(*call, event->ev.pos.vpos);
+		IPC_SET_ARG2(*icall, (event->ev.pos.pos_id << 16) | (event->ev.pos.type & 0xffff));
+		IPC_SET_ARG3(*icall, event->ev.pos.btn_num);
+		IPC_SET_ARG4(*icall, event->ev.pos.hpos);
+		IPC_SET_ARG5(*icall, event->ev.pos.vpos);
 		break;
 	default:
@@ -66,14 +66,13 @@
 }
 
-static void con_read_srv(con_srv_t *srv, cap_call_handle_t chandle,
-    ipc_call_t *call)
+static void con_read_srv(con_srv_t *srv, ipc_call_t *icall)
 {
 	void *buf;
 	size_t size;
 	errno_t rc;
-	cap_call_handle_t rcall_handle;
-
-	if (!async_data_read_receive(&rcall_handle, &size)) {
-		async_answer_0(chandle, EINVAL);
+
+	ipc_call_t call;
+	if (!async_data_read_receive(&call, &size)) {
+		async_answer_0(icall, EINVAL);
 		return;
 	}
@@ -81,12 +80,12 @@
 	buf = malloc(size);
 	if (buf == NULL) {
-		async_answer_0(rcall_handle, ENOMEM);
-		async_answer_0(chandle, ENOMEM);
+		async_answer_0(&call, ENOMEM);
+		async_answer_0(icall, ENOMEM);
 		return;
 	}
 
 	if (srv->srvs->ops->read == NULL) {
-		async_answer_0(rcall_handle, ENOTSUP);
-		async_answer_0(chandle, ENOTSUP);
+		async_answer_0(&call, ENOTSUP);
+		async_answer_0(icall, ENOTSUP);
 		free(buf);
 		return;
@@ -96,18 +95,17 @@
 	rc = srv->srvs->ops->read(srv, buf, size, &nread);
 	if (rc != EOK) {
-		async_answer_0(rcall_handle, rc);
-		async_answer_0(chandle, rc);
+		async_answer_0(&call, rc);
+		async_answer_0(icall, rc);
 		free(buf);
 		return;
 	}
 
-	async_data_read_finalize(rcall_handle, buf, nread);
+	async_data_read_finalize(&call, buf, nread);
 	free(buf);
 
-	async_answer_1(chandle, EOK, nread);
-}
-
-static void con_write_srv(con_srv_t *srv, cap_call_handle_t chandle,
-    ipc_call_t *call)
+	async_answer_1(icall, EOK, nread);
+}
+
+static void con_write_srv(con_srv_t *srv, ipc_call_t *icall)
 {
 	void *data;
@@ -117,10 +115,10 @@
 	rc = async_data_write_accept(&data, false, 0, 0, 0, &size);
 	if (rc != EOK) {
-		async_answer_0(chandle, rc);
+		async_answer_0(icall, rc);
 		return;
 	}
 
 	if (srv->srvs->ops->write == NULL) {
-		async_answer_0(chandle, ENOTSUP);
+		async_answer_0(icall, ENOTSUP);
 		return;
 	}
@@ -130,51 +128,47 @@
 	free(data);
 
-	async_answer_1(chandle, rc, nwritten);
-}
-
-static void con_sync_srv(con_srv_t *srv, cap_call_handle_t chandle,
-    ipc_call_t *call)
+	async_answer_1(icall, rc, nwritten);
+}
+
+static void con_sync_srv(con_srv_t *srv, ipc_call_t *icall)
 {
 	if (srv->srvs->ops->sync == NULL) {
-		async_answer_0(chandle, ENOTSUP);
+		async_answer_0(icall, ENOTSUP);
 		return;
 	}
 
 	srv->srvs->ops->sync(srv);
-	async_answer_0(chandle, EOK);
-}
-
-static void con_clear_srv(con_srv_t *srv, cap_call_handle_t chandle,
-    ipc_call_t *call)
+	async_answer_0(icall, EOK);
+}
+
+static void con_clear_srv(con_srv_t *srv, ipc_call_t *icall)
 {
 	if (srv->srvs->ops->clear == NULL) {
-		async_answer_0(chandle, ENOTSUP);
+		async_answer_0(icall, ENOTSUP);
 		return;
 	}
 
 	srv->srvs->ops->clear(srv);
-	async_answer_0(chandle, EOK);
-}
-
-static void con_set_pos_srv(con_srv_t *srv, cap_call_handle_t chandle,
-    ipc_call_t *call)
+	async_answer_0(icall, EOK);
+}
+
+static void con_set_pos_srv(con_srv_t *srv, ipc_call_t *icall)
 {
 	sysarg_t col;
 	sysarg_t row;
 
-	col = IPC_GET_ARG1(*call);
-	row = IPC_GET_ARG2(*call);
+	col = IPC_GET_ARG1(*icall);
+	row = IPC_GET_ARG2(*icall);
 
 	if (srv->srvs->ops->set_pos == NULL) {
-		async_answer_0(chandle, ENOTSUP);
+		async_answer_0(icall, ENOTSUP);
 		return;
 	}
 
 	srv->srvs->ops->set_pos(srv, col, row);
-	async_answer_0(chandle, EOK);
-}
-
-static void con_get_pos_srv(con_srv_t *srv, cap_call_handle_t chandle,
-    ipc_call_t *call)
+	async_answer_0(icall, EOK);
+}
+
+static void con_get_pos_srv(con_srv_t *srv, ipc_call_t *icall)
 {
 	errno_t rc;
@@ -183,14 +177,13 @@
 
 	if (srv->srvs->ops->get_pos == NULL) {
-		async_answer_0(chandle, ENOTSUP);
+		async_answer_0(icall, ENOTSUP);
 		return;
 	}
 
 	rc = srv->srvs->ops->get_pos(srv, &col, &row);
-	async_answer_2(chandle, rc, col, row);
-}
-
-static void con_get_size_srv(con_srv_t *srv, cap_call_handle_t chandle,
-    ipc_call_t *call)
+	async_answer_2(icall, rc, col, row);
+}
+
+static void con_get_size_srv(con_srv_t *srv, ipc_call_t *icall)
 {
 	errno_t rc;
@@ -199,14 +192,13 @@
 
 	if (srv->srvs->ops->get_size == NULL) {
-		async_answer_0(chandle, ENOTSUP);
+		async_answer_0(icall, ENOTSUP);
 		return;
 	}
 
 	rc = srv->srvs->ops->get_size(srv, &cols, &rows);
-	async_answer_2(chandle, rc, cols, rows);
-}
-
-static void con_get_color_cap_srv(con_srv_t *srv, cap_call_handle_t chandle,
-    ipc_call_t *call)
+	async_answer_2(icall, rc, cols, rows);
+}
+
+static void con_get_color_cap_srv(con_srv_t *srv, ipc_call_t *icall)
 {
 	errno_t rc;
@@ -214,30 +206,28 @@
 
 	if (srv->srvs->ops->get_color_cap == NULL) {
-		async_answer_0(chandle, ENOTSUP);
+		async_answer_0(icall, ENOTSUP);
 		return;
 	}
 
 	rc = srv->srvs->ops->get_color_cap(srv, &ccap);
-	async_answer_1(chandle, rc, (sysarg_t)ccap);
-}
-
-static void con_set_style_srv(con_srv_t *srv, cap_call_handle_t chandle,
-    ipc_call_t *call)
+	async_answer_1(icall, rc, (sysarg_t)ccap);
+}
+
+static void con_set_style_srv(con_srv_t *srv, ipc_call_t *icall)
 {
 	console_style_t style;
 
-	style = IPC_GET_ARG1(*call);
+	style = IPC_GET_ARG1(*icall);
 
 	if (srv->srvs->ops->set_style == NULL) {
-		async_answer_0(chandle, ENOTSUP);
+		async_answer_0(icall, ENOTSUP);
 		return;
 	}
 
 	srv->srvs->ops->set_style(srv, style);
-	async_answer_0(chandle, EOK);
-}
-
-static void con_set_color_srv(con_srv_t *srv, cap_call_handle_t chandle,
-    ipc_call_t *call)
+	async_answer_0(icall, EOK);
+}
+
+static void con_set_color_srv(con_srv_t *srv, ipc_call_t *icall)
 {
 	console_color_t bgcolor;
@@ -245,53 +235,50 @@
 	console_color_attr_t flags;
 
-	bgcolor = IPC_GET_ARG1(*call);
-	fgcolor = IPC_GET_ARG2(*call);
-	flags = IPC_GET_ARG3(*call);
+	bgcolor = IPC_GET_ARG1(*icall);
+	fgcolor = IPC_GET_ARG2(*icall);
+	flags = IPC_GET_ARG3(*icall);
 
 	if (srv->srvs->ops->set_color == NULL) {
-		async_answer_0(chandle, ENOTSUP);
+		async_answer_0(icall, ENOTSUP);
 		return;
 	}
 
 	srv->srvs->ops->set_color(srv, bgcolor, fgcolor, flags);
-	async_answer_0(chandle, EOK);
-}
-
-static void con_set_rgb_color_srv(con_srv_t *srv, cap_call_handle_t chandle,
-    ipc_call_t *call)
+	async_answer_0(icall, EOK);
+}
+
+static void con_set_rgb_color_srv(con_srv_t *srv, ipc_call_t *icall)
 {
 	pixel_t bgcolor;
 	pixel_t fgcolor;
 
-	bgcolor = IPC_GET_ARG1(*call);
-	fgcolor = IPC_GET_ARG2(*call);
+	bgcolor = IPC_GET_ARG1(*icall);
+	fgcolor = IPC_GET_ARG2(*icall);
 
 	if (srv->srvs->ops->set_rgb_color == NULL) {
-		async_answer_0(chandle, ENOTSUP);
+		async_answer_0(icall, ENOTSUP);
 		return;
 	}
 
 	srv->srvs->ops->set_rgb_color(srv, bgcolor, fgcolor);
-	async_answer_0(chandle, EOK);
-}
-
-static void con_set_cursor_visibility_srv(con_srv_t *srv, cap_call_handle_t chandle,
-    ipc_call_t *call)
+	async_answer_0(icall, EOK);
+}
+
+static void con_set_cursor_visibility_srv(con_srv_t *srv, ipc_call_t *icall)
 {
 	bool show;
 
-	show = IPC_GET_ARG1(*call);
+	show = IPC_GET_ARG1(*icall);
 
 	if (srv->srvs->ops->set_cursor_visibility == NULL) {
-		async_answer_0(chandle, ENOTSUP);
+		async_answer_0(icall, ENOTSUP);
 		return;
 	}
 
 	srv->srvs->ops->set_cursor_visibility(srv, show);
-	async_answer_0(chandle, EOK);
-}
-
-static void con_get_event_srv(con_srv_t *srv, cap_call_handle_t chandle,
-    ipc_call_t *call)
+	async_answer_0(icall, EOK);
+}
+
+static void con_get_event_srv(con_srv_t *srv, ipc_call_t *icall)
 {
 	errno_t rc;
@@ -300,5 +287,5 @@
 
 	if (srv->srvs->ops->get_event == NULL) {
-		async_answer_0(chandle, ENOTSUP);
+		async_answer_0(icall, ENOTSUP);
 		return;
 	}
@@ -306,5 +293,5 @@
 	rc = srv->srvs->ops->get_event(srv, &event);
 	if (rc != EOK) {
-		async_answer_0(chandle, rc);
+		async_answer_0(icall, rc);
 		return;
 	}
@@ -312,9 +299,9 @@
 	rc = console_ev_encode(&event, &result);
 	if (rc != EOK) {
-		async_answer_0(chandle, rc);
-		return;
-	}
-
-	async_answer_5(chandle, rc, IPC_GET_ARG1(result), IPC_GET_ARG2(result),
+		async_answer_0(icall, rc);
+		return;
+	}
+
+	async_answer_5(icall, rc, IPC_GET_ARG1(result), IPC_GET_ARG2(result),
 	    IPC_GET_ARG3(result), IPC_GET_ARG4(result), IPC_GET_ARG5(result));
 }
@@ -340,5 +327,5 @@
 }
 
-errno_t con_conn(cap_call_handle_t icall_handle, ipc_call_t *icall, con_srvs_t *srvs)
+errno_t con_conn(ipc_call_t *icall, con_srvs_t *srvs)
 {
 	con_srv_t *srv;
@@ -346,5 +333,5 @@
 
 	/* Accept the connection */
-	async_answer_0(icall_handle, EOK);
+	async_answer_0(icall, EOK);
 
 	srv = con_srv_create(srvs);
@@ -360,19 +347,19 @@
 	while (true) {
 		ipc_call_t call;
-		cap_call_handle_t chandle = 0;
-
-		while (chandle == 0) {
+		bool received = false;
+
+		while (!received) {
 			/* XXX Need to be able to abort immediately */
-			chandle = async_get_call_timeout(&call,
+			received = async_get_call_timeout(&call,
 			    srvs->abort_timeout);
 
 			if (srv->srvs->aborted) {
-				if (chandle != 0)
-					async_answer_0(chandle, EINTR);
+				if (received)
+					async_answer_0(&call, EINTR);
 				break;
 			}
 		}
 
-		if (chandle == 0)
+		if (!received)
 			break;
 
@@ -381,5 +368,5 @@
 		if (!method) {
 			/* The other side has hung up */
-			async_answer_0(chandle, EOK);
+			async_answer_0(&call, EOK);
 			break;
 		}
@@ -387,44 +374,44 @@
 		switch (method) {
 		case VFS_OUT_READ:
-			con_read_srv(srv, chandle, &call);
+			con_read_srv(srv, &call);
 			break;
 		case VFS_OUT_WRITE:
-			con_write_srv(srv, chandle, &call);
+			con_write_srv(srv, &call);
 			break;
 		case VFS_OUT_SYNC:
-			con_sync_srv(srv, chandle, &call);
+			con_sync_srv(srv, &call);
 			break;
 		case CONSOLE_CLEAR:
-			con_clear_srv(srv, chandle, &call);
+			con_clear_srv(srv, &call);
 			break;
 		case CONSOLE_SET_POS:
-			con_set_pos_srv(srv, chandle, &call);
+			con_set_pos_srv(srv, &call);
 			break;
 		case CONSOLE_GET_POS:
-			con_get_pos_srv(srv, chandle, &call);
+			con_get_pos_srv(srv, &call);
 			break;
 		case CONSOLE_GET_SIZE:
-			con_get_size_srv(srv, chandle, &call);
+			con_get_size_srv(srv, &call);
 			break;
 		case CONSOLE_GET_COLOR_CAP:
-			con_get_color_cap_srv(srv, chandle, &call);
+			con_get_color_cap_srv(srv, &call);
 			break;
 		case CONSOLE_SET_STYLE:
-			con_set_style_srv(srv, chandle, &call);
+			con_set_style_srv(srv, &call);
 			break;
 		case CONSOLE_SET_COLOR:
-			con_set_color_srv(srv, chandle, &call);
+			con_set_color_srv(srv, &call);
 			break;
 		case CONSOLE_SET_RGB_COLOR:
-			con_set_rgb_color_srv(srv, chandle, &call);
+			con_set_rgb_color_srv(srv, &call);
 			break;
 		case CONSOLE_SET_CURSOR_VISIBILITY:
-			con_set_cursor_visibility_srv(srv, chandle, &call);
+			con_set_cursor_visibility_srv(srv, &call);
 			break;
 		case CONSOLE_GET_EVENT:
-			con_get_event_srv(srv, chandle, &call);
+			con_get_event_srv(srv, &call);
 			break;
 		default:
-			async_answer_0(chandle, ENOTSUP);
+			async_answer_0(&call, ENOTSUP);
 		}
 	}
