Index: uspace/lib/drv/generic/remote_audio_pcm.c
===================================================================
--- uspace/lib/drv/generic/remote_audio_pcm.c	(revision 7c3fb9bd77e4d2f6c10517a052e567f176fa91ee)
+++ uspace/lib/drv/generic/remote_audio_pcm.c	(revision 984a9ba2fa05c490a7066737655ed19130c714e8)
@@ -600,16 +600,16 @@
  * SERVER SIDE
  */
-static void remote_audio_pcm_get_info_str(ddf_fun_t *, void *, cap_call_handle_t, ipc_call_t *);
-static void remote_audio_pcm_query_caps(ddf_fun_t *, void *, cap_call_handle_t, ipc_call_t *);
-static void remote_audio_pcm_events_register(ddf_fun_t *, void *, cap_call_handle_t, ipc_call_t *);
-static void remote_audio_pcm_events_unregister(ddf_fun_t *, void *, cap_call_handle_t, ipc_call_t *);
-static void remote_audio_pcm_get_buffer_pos(ddf_fun_t *, void *, cap_call_handle_t, ipc_call_t *);
-static void remote_audio_pcm_test_format(ddf_fun_t *, void *, cap_call_handle_t, ipc_call_t *);
-static void remote_audio_pcm_get_buffer(ddf_fun_t *, void *, cap_call_handle_t, ipc_call_t *);
-static void remote_audio_pcm_release_buffer(ddf_fun_t *, void *, cap_call_handle_t, ipc_call_t *);
-static void remote_audio_pcm_start_playback(ddf_fun_t *, void *, cap_call_handle_t, ipc_call_t *);
-static void remote_audio_pcm_stop_playback(ddf_fun_t *, void *, cap_call_handle_t, ipc_call_t *);
-static void remote_audio_pcm_start_capture(ddf_fun_t *, void *, cap_call_handle_t, ipc_call_t *);
-static void remote_audio_pcm_stop_capture(ddf_fun_t *, void *, cap_call_handle_t, ipc_call_t *);
+static void remote_audio_pcm_get_info_str(ddf_fun_t *, void *, ipc_call_t *);
+static void remote_audio_pcm_query_caps(ddf_fun_t *, void *, ipc_call_t *);
+static void remote_audio_pcm_events_register(ddf_fun_t *, void *, ipc_call_t *);
+static void remote_audio_pcm_events_unregister(ddf_fun_t *, void *, ipc_call_t *);
+static void remote_audio_pcm_get_buffer_pos(ddf_fun_t *, void *, ipc_call_t *);
+static void remote_audio_pcm_test_format(ddf_fun_t *, void *, ipc_call_t *);
+static void remote_audio_pcm_get_buffer(ddf_fun_t *, void *, ipc_call_t *);
+static void remote_audio_pcm_release_buffer(ddf_fun_t *, void *, ipc_call_t *);
+static void remote_audio_pcm_start_playback(ddf_fun_t *, void *, ipc_call_t *);
+static void remote_audio_pcm_stop_playback(ddf_fun_t *, void *, ipc_call_t *);
+static void remote_audio_pcm_start_capture(ddf_fun_t *, void *, ipc_call_t *);
+static void remote_audio_pcm_stop_capture(ddf_fun_t *, void *, ipc_call_t *);
 
 /** Remote audio pcm buffer interface operations. */
@@ -636,34 +636,38 @@
 
 void remote_audio_pcm_get_info_str(ddf_fun_t *fun, void *iface,
-    cap_call_handle_t chandle, ipc_call_t *call)
+    ipc_call_t *call)
 {
 	const audio_pcm_iface_t *pcm_iface = iface;
 
 	if (!pcm_iface->get_info_str) {
-		async_answer_0(chandle, ENOTSUP);
-		return;
-	}
+		async_answer_0(call, ENOTSUP);
+		return;
+	}
+
 	const char *name = NULL;
 	const errno_t ret = pcm_iface->get_info_str(fun, &name);
 	const size_t name_size = name ? str_size(name) + 1 : 0;
-	async_answer_1(chandle, ret, name_size);
+	async_answer_1(call, ret, name_size);
+
 	/* Send the string. */
 	if (ret == EOK && name_size > 0) {
+		ipc_call_t call;
 		size_t size;
-		cap_call_handle_t name_id;
-		if (!async_data_read_receive(&name_id, &size)) {
-			async_answer_0(name_id, EPARTY);
+		if (!async_data_read_receive(&call, &size)) {
+			async_answer_0(&call, EPARTY);
 			return;
 		}
+
 		if (size != name_size) {
-			async_answer_0(name_id, ELIMIT);
+			async_answer_0(&call, ELIMIT);
 			return;
 		}
-		async_data_read_finalize(name_id, name, name_size);
+
+		async_data_read_finalize(&call, name, name_size);
 	}
 }
 
 void remote_audio_pcm_query_caps(ddf_fun_t *fun, void *iface,
-    cap_call_handle_t chandle, ipc_call_t *call)
+    ipc_call_t *call)
 {
 	const audio_pcm_iface_t *pcm_iface = iface;
@@ -671,50 +675,53 @@
 	if (pcm_iface->query_cap) {
 		const unsigned value = pcm_iface->query_cap(fun, cap);
-		async_answer_1(chandle, EOK, value);
+		async_answer_1(call, EOK, value);
 	} else {
-		async_answer_0(chandle, ENOTSUP);
+		async_answer_0(call, ENOTSUP);
 	}
 }
 
 static void remote_audio_pcm_events_register(ddf_fun_t *fun, void *iface,
-    cap_call_handle_t chandle, ipc_call_t *call)
+    ipc_call_t *call)
 {
 	const audio_pcm_iface_t *pcm_iface = iface;
 	if (!pcm_iface->get_event_session ||
 	    !pcm_iface->set_event_session) {
-		async_answer_0(chandle, ENOTSUP);
-		return;
-	}
-
-	async_answer_0(chandle, EOK);
+		async_answer_0(call, ENOTSUP);
+		return;
+	}
+
+	async_answer_0(call, EOK);
 
 	ipc_call_t callback_call;
-	cap_call_handle_t callback_handle = async_get_call(&callback_call);
+	async_get_call(&callback_call);
 	async_sess_t *sess =
 	    async_callback_receive_start(EXCHANGE_ATOMIC, &callback_call);
 	if (sess == NULL) {
 		ddf_msg(LVL_DEBUG, "Failed to create event callback");
-		async_answer_0(callback_handle, EAGAIN);
-		return;
-	}
+		async_answer_0(&callback_call, EAGAIN);
+		return;
+	}
+
 	const errno_t ret = pcm_iface->set_event_session(fun, sess);
 	if (ret != EOK) {
 		ddf_msg(LVL_DEBUG, "Failed to set event callback.");
 		async_hangup(sess);
-		async_answer_0(callback_handle, ret);
-		return;
-	}
-	async_answer_0(callback_handle, EOK);
+		async_answer_0(&callback_call, ret);
+		return;
+	}
+
+	async_answer_0(&callback_call, EOK);
 }
 
 static void remote_audio_pcm_events_unregister(ddf_fun_t *fun, void *iface,
-    cap_call_handle_t chandle, ipc_call_t *call)
+    ipc_call_t *call)
 {
 	const audio_pcm_iface_t *pcm_iface = iface;
 	if (!pcm_iface->get_event_session ||
 	    !pcm_iface->set_event_session) {
-		async_answer_0(chandle, ENOTSUP);
-		return;
-	}
+		async_answer_0(call, ENOTSUP);
+		return;
+	}
+
 	async_sess_t *sess = pcm_iface->get_event_session(fun);
 	if (sess) {
@@ -722,9 +729,10 @@
 		pcm_iface->set_event_session(fun, NULL);
 	}
-	async_answer_0(chandle, EOK);
+
+	async_answer_0(call, EOK);
 }
 
 void remote_audio_pcm_get_buffer_pos(ddf_fun_t *fun, void *iface,
-    cap_call_handle_t chandle, ipc_call_t *call)
+    ipc_call_t *call)
 {
 	const audio_pcm_iface_t *pcm_iface = iface;
@@ -732,9 +740,9 @@
 	const errno_t ret = pcm_iface->get_buffer_pos ?
 	    pcm_iface->get_buffer_pos(fun, &pos) : ENOTSUP;
-	async_answer_1(chandle, ret, pos);
+	async_answer_1(call, ret, pos);
 }
 
 void remote_audio_pcm_test_format(ddf_fun_t *fun, void *iface,
-    cap_call_handle_t chandle, ipc_call_t *call)
+    ipc_call_t *call)
 {
 	const audio_pcm_iface_t *pcm_iface = iface;
@@ -744,9 +752,9 @@
 	const errno_t ret = pcm_iface->test_format ?
 	    pcm_iface->test_format(fun, &channels, &rate, &format) : ENOTSUP;
-	async_answer_3(chandle, ret, channels, rate, format);
+	async_answer_3(call, ret, channels, rate, format);
 }
 
 void remote_audio_pcm_get_buffer(ddf_fun_t *fun, void *iface,
-    cap_call_handle_t chandle, ipc_call_t *call)
+    ipc_call_t *call)
 {
 	const audio_pcm_iface_t *pcm_iface = iface;
@@ -754,5 +762,5 @@
 	if (!pcm_iface->get_buffer ||
 	    !pcm_iface->release_buffer) {
-		async_answer_0(chandle, ENOTSUP);
+		async_answer_0(call, ENOTSUP);
 		return;
 	}
@@ -760,17 +768,17 @@
 	size_t size = DEV_IPC_GET_ARG1(*call);
 	errno_t ret = pcm_iface->get_buffer(fun, &buffer, &size);
-	async_answer_1(chandle, ret, size);
+	async_answer_1(call, ret, size);
 	if (ret != EOK || size == 0)
 		return;
 
 	/* Share the buffer. */
+	ipc_call_t share;
 	size_t share_size = 0;
-	cap_call_handle_t share_id = 0;
 
 	ddf_msg(LVL_DEBUG2, "Receiving share request.");
-	if (!async_share_in_receive(&share_id, &share_size)) {
+	if (!async_share_in_receive(&share, &share_size)) {
 		ddf_msg(LVL_DEBUG, "Failed to share pcm buffer.");
 		pcm_iface->release_buffer(fun);
-		async_answer_0(share_id, EPARTY);
+		async_answer_0(&share, EPARTY);
 		return;
 	}
@@ -780,10 +788,10 @@
 		ddf_msg(LVL_DEBUG, "Incorrect pcm buffer size requested.");
 		pcm_iface->release_buffer(fun);
-		async_answer_0(share_id, ELIMIT);
+		async_answer_0(&share, ELIMIT);
 		return;
 	}
 
 	ddf_msg(LVL_DEBUG2, "Calling share finalize.");
-	ret = async_share_in_finalize(share_id, buffer, AS_AREA_WRITE |
+	ret = async_share_in_finalize(&share, buffer, AS_AREA_WRITE |
 	    AS_AREA_READ);
 	if (ret != EOK) {
@@ -797,5 +805,5 @@
 
 void remote_audio_pcm_release_buffer(ddf_fun_t *fun, void *iface,
-    cap_call_handle_t chandle, ipc_call_t *call)
+    ipc_call_t *call)
 {
 	const audio_pcm_iface_t *pcm_iface = iface;
@@ -803,9 +811,9 @@
 	const errno_t ret = pcm_iface->release_buffer ?
 	    pcm_iface->release_buffer(fun) : ENOTSUP;
-	async_answer_0(chandle, ret);
+	async_answer_0(call, ret);
 }
 
 void remote_audio_pcm_start_playback(ddf_fun_t *fun, void *iface,
-    cap_call_handle_t chandle, ipc_call_t *call)
+    ipc_call_t *call)
 {
 	const audio_pcm_iface_t *pcm_iface = iface;
@@ -819,9 +827,9 @@
 	    pcm_iface->start_playback(fun, frames, channels, rate, format) :
 	    ENOTSUP;
-	async_answer_0(chandle, ret);
+	async_answer_0(call, ret);
 }
 
 void remote_audio_pcm_stop_playback(ddf_fun_t *fun, void *iface,
-    cap_call_handle_t chandle, ipc_call_t *call)
+    ipc_call_t *call)
 {
 	const audio_pcm_iface_t *pcm_iface = iface;
@@ -830,9 +838,9 @@
 	const errno_t ret = pcm_iface->stop_playback ?
 	    pcm_iface->stop_playback(fun, immediate) : ENOTSUP;
-	async_answer_0(chandle, ret);
+	async_answer_0(call, ret);
 }
 
 void remote_audio_pcm_start_capture(ddf_fun_t *fun, void *iface,
-    cap_call_handle_t chandle, ipc_call_t *call)
+    ipc_call_t *call)
 {
 	const audio_pcm_iface_t *pcm_iface = iface;
@@ -846,9 +854,9 @@
 	    pcm_iface->start_capture(fun, frames, channels, rate, format) :
 	    ENOTSUP;
-	async_answer_0(chandle, ret);
+	async_answer_0(call, ret);
 }
 
 void remote_audio_pcm_stop_capture(ddf_fun_t *fun, void *iface,
-    cap_call_handle_t chandle, ipc_call_t *call)
+    ipc_call_t *call)
 {
 	const audio_pcm_iface_t *pcm_iface = iface;
@@ -857,5 +865,5 @@
 	const errno_t ret = pcm_iface->stop_capture ?
 	    pcm_iface->stop_capture(fun, immediate) : ENOTSUP;
-	async_answer_0(chandle, ret);
+	async_answer_0(call, ret);
 }
 
@@ -863,3 +871,2 @@
  * @}
  */
-
