Index: uspace/srv/net/tcp/service.c
===================================================================
--- uspace/srv/net/tcp/service.c	(revision 3be9d10120f7923a0b3d52282b8de0b670566c71)
+++ uspace/srv/net/tcp/service.c	(revision 064e0fd3dd59d9aa7137ab66a590344cd891fddd)
@@ -724,10 +724,10 @@
  * Handle client request to create callback session.
  *
- * @param client  TCP client
- * @param iid     Async request ID
- * @param icall   Async request data
- */
-static void tcp_callback_create_srv(tcp_client_t *client, cap_call_handle_t iid,
-    ipc_call_t *icall)
+ * @param client        TCP client
+ * @param icall_handle  Async request call handle
+ * @param icall         Async request data
+ */
+static void tcp_callback_create_srv(tcp_client_t *client,
+    cap_call_handle_t icall_handle, ipc_call_t *icall)
 {
 	log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_callback_create_srv()");
@@ -735,10 +735,10 @@
 	async_sess_t *sess = async_callback_receive(EXCHANGE_SERIALIZE);
 	if (sess == NULL) {
-		async_answer_0(iid, ENOMEM);
+		async_answer_0(icall_handle, ENOMEM);
 		return;
 	}
 
 	client->sess = sess;
-	async_answer_0(iid, EOK);
+	async_answer_0(icall_handle, EOK);
 }
 
@@ -747,12 +747,12 @@
  * Handle client request to create connection.
  *
- * @param client   TCP client
- * @param iid      Async request ID
- * @param icall    Async request data
- */
-static void tcp_conn_create_srv(tcp_client_t *client, cap_call_handle_t iid,
-    ipc_call_t *icall)
-{
-	cap_call_handle_t callid;
+ * @param client        TCP client
+ * @param icall_handle  Async request call handle
+ * @param icall         Async request data
+ */
+static void tcp_conn_create_srv(tcp_client_t *client,
+    cap_call_handle_t icall_handle, ipc_call_t *icall)
+{
+	cap_call_handle_t chandle;
 	size_t size;
 	inet_ep2_t epp;
@@ -762,20 +762,20 @@
 	log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_create_srv()");
 
-	if (!async_data_write_receive(&callid, &size)) {
-		async_answer_0(callid, EREFUSED);
-		async_answer_0(iid, EREFUSED);
+	if (!async_data_write_receive(&chandle, &size)) {
+		async_answer_0(chandle, EREFUSED);
+		async_answer_0(icall_handle, EREFUSED);
 		return;
 	}
 
 	if (size != sizeof(inet_ep2_t)) {
-		async_answer_0(callid, EINVAL);
-		async_answer_0(iid, EINVAL);
-		return;
-	}
-
-	rc = async_data_write_finalize(callid, &epp, size);
-	if (rc != EOK) {
-		async_answer_0(callid, rc);
-		async_answer_0(iid, rc);
+		async_answer_0(chandle, EINVAL);
+		async_answer_0(icall_handle, EINVAL);
+		return;
+	}
+
+	rc = async_data_write_finalize(chandle, &epp, size);
+	if (rc != EOK) {
+		async_answer_0(chandle, rc);
+		async_answer_0(icall_handle, rc);
 		return;
 	}
@@ -783,9 +783,9 @@
 	rc = tcp_conn_create_impl(client, &epp, &conn_id);
 	if (rc != EOK) {
-		async_answer_0(iid, rc);
-		return;
-	}
-
-	async_answer_1(iid, EOK, conn_id);
+		async_answer_0(icall_handle, rc);
+		return;
+	}
+
+	async_answer_1(icall_handle, EOK, conn_id);
 }
 
@@ -794,10 +794,10 @@
  * Handle client request to destroy connection.
  *
- * @param client   TCP client
- * @param iid      Async request ID
- * @param icall    Async request data
- */
-static void tcp_conn_destroy_srv(tcp_client_t *client, cap_call_handle_t iid,
-    ipc_call_t *icall)
+ * @param client        TCP client
+ * @param icall_handle  Async request call handle 
+ * @param icall         Async request data
+ */
+static void tcp_conn_destroy_srv(tcp_client_t *client,
+    cap_call_handle_t icall_handle, ipc_call_t *icall)
 {
 	sysarg_t conn_id;
@@ -808,5 +808,5 @@
 	conn_id = IPC_GET_ARG1(*icall);
 	rc = tcp_conn_destroy_impl(client, conn_id);
-	async_answer_0(iid, rc);
+	async_answer_0(icall_handle, rc);
 }
 
@@ -815,12 +815,12 @@
  * Handle client request to create listener.
  *
- * @param client   TCP client
- * @param iid      Async request ID
- * @param icall    Async request data
- */
-static void tcp_listener_create_srv(tcp_client_t *client, cap_call_handle_t iid,
-    ipc_call_t *icall)
-{
-	cap_call_handle_t callid;
+ * @param client        TCP client
+ * @param icall_handle  Async request call handle 
+ * @param icall         Async request data
+ */
+static void tcp_listener_create_srv(tcp_client_t *client,
+    cap_call_handle_t icall_handle, ipc_call_t *icall)
+{
+	cap_call_handle_t chandle;
 	size_t size;
 	inet_ep_t ep;
@@ -830,20 +830,20 @@
 	log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_listener_create_srv()");
 
-	if (!async_data_write_receive(&callid, &size)) {
-		async_answer_0(callid, EREFUSED);
-		async_answer_0(iid, EREFUSED);
+	if (!async_data_write_receive(&chandle, &size)) {
+		async_answer_0(chandle, EREFUSED);
+		async_answer_0(icall_handle, EREFUSED);
 		return;
 	}
 
 	if (size != sizeof(inet_ep_t)) {
-		async_answer_0(callid, EINVAL);
-		async_answer_0(iid, EINVAL);
-		return;
-	}
-
-	rc = async_data_write_finalize(callid, &ep, size);
-	if (rc != EOK) {
-		async_answer_0(callid, rc);
-		async_answer_0(iid, rc);
+		async_answer_0(chandle, EINVAL);
+		async_answer_0(icall_handle, EINVAL);
+		return;
+	}
+
+	rc = async_data_write_finalize(chandle, &ep, size);
+	if (rc != EOK) {
+		async_answer_0(chandle, rc);
+		async_answer_0(icall_handle, rc);
 		return;
 	}
@@ -851,9 +851,9 @@
 	rc = tcp_listener_create_impl(client, &ep, &lst_id);
 	if (rc != EOK) {
-		async_answer_0(iid, rc);
-		return;
-	}
-
-	async_answer_1(iid, EOK, lst_id);
+		async_answer_0(icall_handle, rc);
+		return;
+	}
+
+	async_answer_1(icall_handle, EOK, lst_id);
 }
 
@@ -862,10 +862,10 @@
  * Handle client request to destroy listener.
  *
- * @param client   TCP client
- * @param iid      Async request ID
- * @param icall    Async request data
- */
-static void tcp_listener_destroy_srv(tcp_client_t *client, cap_call_handle_t iid,
-    ipc_call_t *icall)
+ * @param client        TCP client
+ * @param icall_handle  Async request call handle
+ * @param icall         Async request data
+ */
+static void tcp_listener_destroy_srv(tcp_client_t *client,
+    cap_call_handle_t icall_handle, ipc_call_t *icall)
 {
 	sysarg_t lst_id;
@@ -876,5 +876,5 @@
 	lst_id = IPC_GET_ARG1(*icall);
 	rc = tcp_listener_destroy_impl(client, lst_id);
-	async_answer_0(iid, rc);
+	async_answer_0(icall_handle, rc);
 }
 
@@ -883,10 +883,10 @@
  * Handle client request to send FIN.
  *
- * @param client   TCP client
- * @param iid      Async request ID
- * @param icall    Async request data
- */
-static void tcp_conn_send_fin_srv(tcp_client_t *client, cap_call_handle_t iid,
-    ipc_call_t *icall)
+ * @param client        TCP client
+ * @param icall_handle  Async request call handle 
+ * @param icall         Async request data
+ */
+static void tcp_conn_send_fin_srv(tcp_client_t *client,
+    cap_call_handle_t icall_handle, ipc_call_t *icall)
 {
 	sysarg_t conn_id;
@@ -897,5 +897,5 @@
 	conn_id = IPC_GET_ARG1(*icall);
 	rc = tcp_conn_send_fin_impl(client, conn_id);
-	async_answer_0(iid, rc);
+	async_answer_0(icall_handle, rc);
 }
 
@@ -904,10 +904,10 @@
  * Handle client request to push connection.
  *
- * @param client   TCP client
- * @param iid      Async request ID
- * @param icall    Async request data
- */
-static void tcp_conn_push_srv(tcp_client_t *client, cap_call_handle_t iid,
-    ipc_call_t *icall)
+ * @param client        TCP client
+ * @param icall_handle  Async request call handle
+ * @param icall         Async request data
+ */
+static void tcp_conn_push_srv(tcp_client_t *client,
+    cap_call_handle_t icall_handle, ipc_call_t *icall)
 {
 	sysarg_t conn_id;
@@ -918,5 +918,5 @@
 	conn_id = IPC_GET_ARG1(*icall);
 	rc = tcp_conn_push_impl(client, conn_id);
-	async_answer_0(iid, rc);
+	async_answer_0(icall_handle, rc);
 }
 
@@ -925,10 +925,10 @@
  * Handle client request to reset connection.
  *
- * @param client   TCP client
- * @param iid      Async request ID
- * @param icall    Async request data
- */
-static void tcp_conn_reset_srv(tcp_client_t *client, cap_call_handle_t iid,
-    ipc_call_t *icall)
+ * @param client        TCP client
+ * @param icall_handle  Async request call handle
+ * @param icall         Async request data
+ */
+static void tcp_conn_reset_srv(tcp_client_t *client,
+    cap_call_handle_t icall_handle, ipc_call_t *icall)
 {
 	sysarg_t conn_id;
@@ -939,5 +939,5 @@
 	conn_id = IPC_GET_ARG1(*icall);
 	rc = tcp_conn_reset_impl(client, conn_id);
-	async_answer_0(iid, rc);
+	async_answer_0(icall_handle, rc);
 }
 
@@ -946,12 +946,12 @@
  * Handle client request to send data via connection.
  *
- * @param client   TCP client
- * @param iid      Async request ID
- * @param icall    Async request data
- */
-static void tcp_conn_send_srv(tcp_client_t *client, cap_call_handle_t iid,
-    ipc_call_t *icall)
-{
-	cap_call_handle_t callid;
+ * @param client        TCP client
+ * @param icall_handle  Async request call handle
+ * @param icall         Async request data
+ */
+static void tcp_conn_send_srv(tcp_client_t *client,
+    cap_call_handle_t icall_handle, ipc_call_t *icall)
+{
+	cap_call_handle_t chandle;
 	size_t size;
 	sysarg_t conn_id;
@@ -963,13 +963,13 @@
 	/* Receive message data */
 
-	if (!async_data_write_receive(&callid, &size)) {
-		async_answer_0(callid, EREFUSED);
-		async_answer_0(iid, EREFUSED);
+	if (!async_data_write_receive(&chandle, &size)) {
+		async_answer_0(chandle, EREFUSED);
+		async_answer_0(icall_handle, EREFUSED);
 		return;
 	}
 
 	if (size > MAX_MSG_SIZE) {
-		async_answer_0(callid, EINVAL);
-		async_answer_0(iid, EINVAL);
+		async_answer_0(chandle, EINVAL);
+		async_answer_0(icall_handle, EINVAL);
 		return;
 	}
@@ -977,13 +977,13 @@
 	data = malloc(size);
 	if (data == NULL) {
-		async_answer_0(callid, ENOMEM);
-		async_answer_0(iid, ENOMEM);
-		return;
-	}
-
-	rc = async_data_write_finalize(callid, data, size);
-	if (rc != EOK) {
-		async_answer_0(callid, rc);
-		async_answer_0(iid, rc);
+		async_answer_0(chandle, ENOMEM);
+		async_answer_0(icall_handle, ENOMEM);
+		return;
+	}
+
+	rc = async_data_write_finalize(chandle, data, size);
+	if (rc != EOK) {
+		async_answer_0(chandle, rc);
+		async_answer_0(icall_handle, rc);
 		free(data);
 		return;
@@ -994,10 +994,10 @@
 	rc = tcp_conn_send_impl(client, conn_id, data, size);
 	if (rc != EOK) {
-		async_answer_0(iid, rc);
+		async_answer_0(icall_handle, rc);
 		free(data);
 		return;
 	}
 
-	async_answer_0(iid, EOK);
+	async_answer_0(icall_handle, EOK);
 	free(data);
 }
@@ -1007,12 +1007,12 @@
  * Handle client request to read received data via connection without blocking.
  *
- * @param client   TCP client
- * @param iid      Async request ID
- * @param icall    Async request data
- */
-static void tcp_conn_recv_srv(tcp_client_t *client, cap_call_handle_t iid,
-    ipc_call_t *icall)
-{
-	cap_call_handle_t callid;
+ * @param client        TCP client
+ * @param icall_handle  Async request call handle
+ * @param icall         Async request data
+ */
+static void tcp_conn_recv_srv(tcp_client_t *client,
+    cap_call_handle_t icall_handle, ipc_call_t *icall)
+{
+	cap_call_handle_t chandle;
 	sysarg_t conn_id;
 	size_t size, rsize;
@@ -1024,7 +1024,7 @@
 	conn_id = IPC_GET_ARG1(*icall);
 
-	if (!async_data_read_receive(&callid, &size)) {
-		async_answer_0(callid, EREFUSED);
-		async_answer_0(iid, EREFUSED);
+	if (!async_data_read_receive(&chandle, &size)) {
+		async_answer_0(chandle, EREFUSED);
+		async_answer_0(icall_handle, EREFUSED);
 		return;
 	}
@@ -1033,6 +1033,6 @@
 	data = malloc(size);
 	if (data == NULL) {
-		async_answer_0(callid, ENOMEM);
-		async_answer_0(iid, ENOMEM);
+		async_answer_0(chandle, ENOMEM);
+		async_answer_0(icall_handle, ENOMEM);
 		return;
 	}
@@ -1040,18 +1040,18 @@
 	rc = tcp_conn_recv_impl(client, conn_id, data, size, &rsize);
 	if (rc != EOK) {
-		async_answer_0(callid, rc);
-		async_answer_0(iid, rc);
+		async_answer_0(chandle, rc);
+		async_answer_0(icall_handle, rc);
 		free(data);
 		return;
 	}
 
-	rc = async_data_read_finalize(callid, data, size);
-	if (rc != EOK) {
-		async_answer_0(iid, rc);
+	rc = async_data_read_finalize(chandle, data, size);
+	if (rc != EOK) {
+		async_answer_0(icall_handle, rc);
 		free(data);
 		return;
 	}
 
-	async_answer_1(iid, EOK, rsize);
+	async_answer_1(icall_handle, EOK, rsize);
 	free(data);
 
@@ -1063,12 +1063,12 @@
  * Handle client request to read received data via connection with blocking.
  *
- * @param client   TCP client
- * @param iid      Async request ID
- * @param icall    Async request data
- */
-static void tcp_conn_recv_wait_srv(tcp_client_t *client, cap_call_handle_t iid,
-    ipc_call_t *icall)
-{
-	cap_call_handle_t callid;
+ * @param client        TCP client
+ * @param icall_handle  Async request call handle
+ * @param icall         Async request data
+ */
+static void tcp_conn_recv_wait_srv(tcp_client_t *client,
+    cap_call_handle_t icall_handle, ipc_call_t *icall)
+{
+	cap_call_handle_t chandle;
 	sysarg_t conn_id;
 	size_t size, rsize;
@@ -1080,8 +1080,8 @@
 	conn_id = IPC_GET_ARG1(*icall);
 
-	if (!async_data_read_receive(&callid, &size)) {
+	if (!async_data_read_receive(&chandle, &size)) {
 		log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_recv_wait_srv - data_receive failed");
-		async_answer_0(callid, EREFUSED);
-		async_answer_0(iid, EREFUSED);
+		async_answer_0(chandle, EREFUSED);
+		async_answer_0(icall_handle, EREFUSED);
 		return;
 	}
@@ -1091,6 +1091,6 @@
 	if (data == NULL) {
 		log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_recv_wait_srv - allocation failed");
-		async_answer_0(callid, ENOMEM);
-		async_answer_0(iid, ENOMEM);
+		async_answer_0(chandle, ENOMEM);
+		async_answer_0(icall_handle, ENOMEM);
 		return;
 	}
@@ -1099,14 +1099,14 @@
 	if (rc != EOK) {
 		log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_recv_wait_srv - recv_impl failed rc=%s", str_error_name(rc));
-		async_answer_0(callid, rc);
-		async_answer_0(iid, rc);
+		async_answer_0(chandle, rc);
+		async_answer_0(icall_handle, rc);
 		free(data);
 		return;
 	}
 
-	rc = async_data_read_finalize(callid, data, size);
+	rc = async_data_read_finalize(chandle, data, size);
 	if (rc != EOK) {
 		log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_recv_wait_srv - finalize failed");
-		async_answer_0(iid, rc);
+		async_answer_0(icall_handle, rc);
 		free(data);
 		return;
@@ -1114,5 +1114,5 @@
 
 	log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_recv_wait_srv(): rsize=%zu", size);
-	async_answer_1(iid, EOK, rsize);
+	async_answer_1(icall_handle, EOK, rsize);
 	free(data);
 
@@ -1168,14 +1168,15 @@
 /** Handle TCP client connection.
  *
- * @param iid   Connect call ID
- * @param icall Connect call data
- * @param arg   Connection argument
- */
-static void tcp_client_conn(cap_call_handle_t iid, ipc_call_t *icall, void *arg)
+ * @param icall_handle  Connect call handle
+ * @param icall         Connect call data
+ * @param arg           Connection argument
+ */
+static void tcp_client_conn(cap_call_handle_t icall_handle, ipc_call_t *icall,
+    void *arg)
 {
 	tcp_client_t client;
 
 	/* Accept the connection */
-	async_answer_0(iid, EOK);
+	async_answer_0(icall_handle, EOK);
 
 	log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_client_conn() - client=%p",
@@ -1187,5 +1188,5 @@
 		log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_client_conn: wait req");
 		ipc_call_t call;
-		cap_call_handle_t callid = async_get_call(&call);
+		cap_call_handle_t chandle = async_get_call(&call);
 		sysarg_t method = IPC_GET_IMETHOD(call);
 
@@ -1194,5 +1195,5 @@
 		if (!method) {
 			/* The other side has hung up */
-			async_answer_0(callid, EOK);
+			async_answer_0(chandle, EOK);
 			break;
 		}
@@ -1200,38 +1201,38 @@
 		switch (method) {
 		case TCP_CALLBACK_CREATE:
-			tcp_callback_create_srv(&client, callid, &call);
+			tcp_callback_create_srv(&client, chandle, &call);
 			break;
 		case TCP_CONN_CREATE:
-			tcp_conn_create_srv(&client, callid, &call);
+			tcp_conn_create_srv(&client, chandle, &call);
 			break;
 		case TCP_CONN_DESTROY:
-			tcp_conn_destroy_srv(&client, callid, &call);
+			tcp_conn_destroy_srv(&client, chandle, &call);
 			break;
 		case TCP_LISTENER_CREATE:
-			tcp_listener_create_srv(&client, callid, &call);
+			tcp_listener_create_srv(&client, chandle, &call);
 			break;
 		case TCP_LISTENER_DESTROY:
-			tcp_listener_destroy_srv(&client, callid, &call);
+			tcp_listener_destroy_srv(&client, chandle, &call);
 			break;
 		case TCP_CONN_SEND_FIN:
-			tcp_conn_send_fin_srv(&client, callid, &call);
+			tcp_conn_send_fin_srv(&client, chandle, &call);
 			break;
 		case TCP_CONN_PUSH:
-			tcp_conn_push_srv(&client, callid, &call);
+			tcp_conn_push_srv(&client, chandle, &call);
 			break;
 		case TCP_CONN_RESET:
-			tcp_conn_reset_srv(&client, callid, &call);
+			tcp_conn_reset_srv(&client, chandle, &call);
 			break;
 		case TCP_CONN_SEND:
-			tcp_conn_send_srv(&client, callid, &call);
+			tcp_conn_send_srv(&client, chandle, &call);
 			break;
 		case TCP_CONN_RECV:
-			tcp_conn_recv_srv(&client, callid, &call);
+			tcp_conn_recv_srv(&client, chandle, &call);
 			break;
 		case TCP_CONN_RECV_WAIT:
-			tcp_conn_recv_wait_srv(&client, callid, &call);
+			tcp_conn_recv_wait_srv(&client, chandle, &call);
 			break;
 		default:
-			async_answer_0(callid, ENOTSUP);
+			async_answer_0(chandle, ENOTSUP);
 			break;
 		}
