Index: uspace/lib/c/generic/async.c
===================================================================
--- uspace/lib/c/generic/async.c	(revision 7f9d97f3ef14161b0334989eea3a64581e2c86cc)
+++ uspace/lib/c/generic/async.c	(revision abf2dfde554829308532f8d95a182c0db6fcf54c)
@@ -77,5 +77,5 @@
  *   }
  *
- *   my_client_connection(icallid, *icall)
+ *   port_handler(icallid, *icall)
  *   {
  *     if (want_refuse) {
@@ -232,8 +232,7 @@
 	/** Identification of the opening call. */
 	ipc_callid_t callid;
+	
 	/** Call data of the opening call. */
 	ipc_call_t call;
-	/** Local argument or NULL if none. */
-	void *carg;
 	
 	/** Identification of the closing call. */
@@ -241,5 +240,8 @@
 	
 	/** Fibril function that will be used to handle the connection. */
-	async_client_conn_t cfibril;
+	async_port_handler_t handler;
+	
+	/** Client data */
+	void *data;
 } connection_t;
 
@@ -335,7 +337,8 @@
 }
 
-/** Default fibril function that gets called to handle new connection.
- *
- * This function is defined as a weak symbol - to be redefined in user code.
+/** Default fallback fibril function.
+ *
+ * This fallback fibril function gets called on incomming
+ * connections that do not have a specific handler defined.
  *
  * @param callid Hash of the incoming call.
@@ -344,5 +347,5 @@
  *
  */
-static void default_client_connection(ipc_callid_t callid, ipc_call_t *call,
+static void default_fallback_port_handler(ipc_callid_t callid, ipc_call_t *call,
     void *arg)
 {
@@ -350,18 +353,10 @@
 }
 
-static async_client_conn_t client_connection = default_client_connection;
+static async_port_handler_t fallback_port_handler =
+    default_fallback_port_handler;
+static void *fallback_port_data = NULL;
+
 static size_t notification_handler_stksz = FIBRIL_DFLT_STK_SIZE;
 
-/** Setter for client_connection function pointer.
- *
- * @param conn Function that will implement a new connection fibril.
- *
- */
-void async_set_client_connection(async_client_conn_t conn)
-{
-	assert(client_connection == default_client_connection);
-	client_connection = conn;
-}
-
 /** Set the stack size for the notification handler notification fibrils.
  *
@@ -387,4 +382,12 @@
  */
 static FIBRIL_CONDVAR_INITIALIZE(avail_phone_cv);
+
+void async_set_fallback_port_handler(async_port_handler_t handler, void *data)
+{
+	assert(handler != NULL);
+	
+	fallback_port_handler = handler;
+	fallback_port_data = data;
+}
 
 static hash_table_t client_hash_table;
@@ -959,5 +962,5 @@
  *
  * When a new connection arrives, a fibril with this implementing function is
- * created. It calls client_connection() and does the final cleanup.
+ * created. It calls handler() and does the final cleanup.
  *
  * @param arg Connection structure pointer.
@@ -992,6 +995,6 @@
 	 * Call the connection handler function.
 	 */
-	fibril_connection->cfibril(fibril_connection->callid,
-	    &fibril_connection->call, fibril_connection->carg);
+	fibril_connection->handler(fibril_connection->callid,
+	    &fibril_connection->call, fibril_connection->data);
 	
 	/*
@@ -1044,7 +1047,7 @@
  *                      is called directly by the server.
  * @param call          Call data of the opening call.
- * @param cfibril       Fibril function that should be called upon opening the
+ * @param handler       Fibril function that should be called upon opening the
  *                      connection.
- * @param carg          Extra argument to pass to the connection fibril
+ * @param data          Extra argument to pass to the connection fibril
  *
  * @return New fibril id or NULL on failure.
@@ -1053,5 +1056,5 @@
 fid_t async_new_connection(task_id_t in_task_id, sysarg_t in_phone_hash,
     ipc_callid_t callid, ipc_call_t *call,
-    async_client_conn_t cfibril, void *carg)
+    async_port_handler_t handler, void *data)
 {
 	connection_t *conn = malloc(sizeof(*conn));
@@ -1068,5 +1071,5 @@
 	conn->callid = callid;
 	conn->close_callid = 0;
-	conn->carg = carg;
+	conn->data = data;
 	
 	if (call)
@@ -1075,5 +1078,5 @@
 	/* We will activate the fibril ASAP */
 	conn->wdata.active = true;
-	conn->cfibril = cfibril;
+	conn->handler = handler;
 	conn->wdata.fid = fibril_create(connection_fibril, conn);
 	
@@ -1111,5 +1114,5 @@
 	assert(call);
 	
-	/* Unrouted call - take some default action */
+	/* Kernel notification */
 	if ((callid & IPC_CALLID_NOTIFICATION)) {
 		process_notification(callid, call);
@@ -1122,5 +1125,5 @@
 		/* Open new connection with fibril, etc. */
 		async_new_connection(call->in_task_id, IPC_GET_ARG5(*call),
-		    callid, call, client_connection, NULL);
+		    callid, call, fallback_port_handler, fallback_port_data);
 		return;
 	}
@@ -1820,5 +1823,5 @@
  */
 int async_connect_to_me(async_exch_t *exch, sysarg_t arg1, sysarg_t arg2,
-    sysarg_t arg3, async_client_conn_t client_receiver, void *carg)
+    sysarg_t arg3, async_port_handler_t client_receiver, void *data)
 {
 	if (exch == NULL)
@@ -1840,5 +1843,5 @@
 	if (client_receiver != NULL)
 		async_new_connection(answer.in_task_id, phone_hash, 0, NULL,
-		    client_receiver, carg);
+		    client_receiver, data);
 	
 	return EOK;
