Index: uspace/lib/libc/generic/async.c
===================================================================
--- uspace/lib/libc/generic/async.c	(revision daa90e8e7088c799912351760ca507292df5f906)
+++ uspace/lib/libc/generic/async.c	(revision f5b4fb9e3f8394a50dce063b7a44b6e5b2ab1468)
@@ -107,16 +107,18 @@
 static LIST_INITIALIZE(timeout_list);
 
+/** Structures of this type represent a waiting fibril. */
 typedef struct {
-	/** Expiration time for waiting fibril. */
+	/** Expiration time. */
 	struct timeval expires;		
 	/** If true, this struct is in the timeout list. */
 	int inlist;
+	/** Timeout list link. */
 	link_t link;
 
 	/** Fibril waiting for this message. */
 	fid_t fid;
-	/** If this fibril is currently active. */
+	/** If true, this fibril is currently active. */
 	int active;
-	/** If true, we timed out. */
+	/** If true, we have timed out. */
 	int timedout;
 } awaiter_t;
@@ -124,8 +126,10 @@
 typedef struct {
 	awaiter_t wdata;
-
-	int done;               	/**< If reply was received */
-	ipc_call_t *dataptr;		/**< Pointer where the answer data
-					 *   is stored */
+	
+	/** If reply was received. */
+	int done;
+	/** Pointer to where the answer data is stored. */
+ 	ipc_call_t *dataptr;
+
 	ipcarg_t retval;
 } amsg_t;
@@ -140,12 +144,22 @@
 	awaiter_t wdata;
 
-	link_t link;			/**< Hash table link. */
-	ipcarg_t in_phone_hash;		/**< Incoming phone hash. */
-	link_t msg_queue;		/**< Messages that should be delivered
-					 *   to this fibril. */
-	/* Structures for connection opening packet */
+	/** Hash table link. */
+	link_t link;
+
+	/** Incoming phone hash. */
+	ipcarg_t in_phone_hash;		
+
+	/** Messages that should be delivered to this fibril. */
+	link_t msg_queue;		
+					 
+	/** Identification of the opening call. */
 	ipc_callid_t callid;
+	/** Call data of the opening call. */
 	ipc_call_t call;
-	ipc_callid_t close_callid;	/* Identification of closing packet. */
+
+	/** Identification of the closing call. */
+	ipc_callid_t close_callid;
+
+	/** Fibril function that will be used to handle the connection. */
 	void (*cfibril)(ipc_callid_t, ipc_call_t *);
 } connection_t;
@@ -153,6 +167,7 @@
 /** Identifier of the incoming connection handled by the current fibril. */
 __thread connection_t *FIBRIL_connection;
-/** If true, it is forbidden to use async_req functions and
- *  all preemption is disabled */
+
+/** If true, it is forbidden to use async_req functions and all preemption is
+ * disabled. */
 __thread int in_interrupt_handler;
 
@@ -162,7 +177,12 @@
 static async_client_conn_t interrupt_received = default_interrupt_received;
 
-/* Hash table functions */
 #define CONN_HASH_TABLE_CHAINS	32
 
+/** Compute hash into the connection hash table based on the source phone hash.
+ *
+ * @param key		Pointer to source phone hash.
+ *
+ * @return		Index into the connection hash table.
+ */
 static hash_index_t conn_hash(unsigned long *key)
 {
@@ -171,4 +191,12 @@
 }
 
+/** Compare hash table item with a key.
+ *
+ * @param key		Array containing the source phone hash as the only item.
+ * @param keys		Expected 1 but ignored.
+ * @param item		Connection hash table item.
+ *
+ * @return		True on match, false otherwise.
+ */
 static int conn_compare(unsigned long key[], hash_count_t keys, link_t *item)
 {
@@ -180,4 +208,11 @@
 }
 
+/** Connection hash table removal callback function.
+ *
+ * This function is called whenever a connection is removed from the connection
+ * hash table.
+ *
+ * @param item		Connection hash table item being removed.
+ */
 static void conn_remove(link_t *item)
 {
@@ -186,5 +221,5 @@
 
 
-/** Operations for NS hash table. */
+/** Operations for the connection hash table. */
 static hash_table_operations_t conn_hash_table_ops = {
 	.hash = conn_hash,
@@ -193,6 +228,7 @@
 };
 
-/** Insert sort timeout msg into timeouts list
- *
+/** Sort in current fibril's timeout request.
+ *
+ * @param wd		Wait data of the current fibril.
  */
 static void insert_timeout(awaiter_t *wd)
@@ -214,5 +250,5 @@
 }
 
-/** Try to route a call to an appropriate connection fibril
+/** Try to route a call to an appropriate connection fibril.
  *
  */
@@ -258,5 +294,15 @@
 }
 
-/** Return new incoming message for the current (fibril-local) connection */
+/** Return new incoming message for the current (fibril-local) connection.
+ *
+ * @param call		Storage where the incoming call data will be stored.
+ * @param usecs		Timeout in microseconds. Zero denotes no timeout.
+ *
+ * @return		If no timeout was specified, then a hash of the
+ * 			incoming call is returned. If a timeout is specified,
+ * 			then a hash of the incoming call is returned unless
+ * 			the timeout expires prior to receiving a message. In
+ * 			that case zero is returned.
+ */
 ipc_callid_t async_get_call_timeout(ipc_call_t *call, suseconds_t usecs)
 {
@@ -281,5 +327,5 @@
 		conn->wdata.inlist = 0;
 	}
-	/* If nothing in queue, wait until something appears */
+	/* If nothing in queue, wait until something arrives */
 	while (list_empty(&conn->msg_queue)) {
 		if (usecs)
@@ -288,10 +334,12 @@
 		conn->wdata.active = 0;
 		fibril_schedule_next_adv(FIBRIL_TO_MANAGER);
-		/* Futex is up after getting back from async_manager 
-		 * get it again */
+		/*
+		 * Futex is up after getting back from async_manager get it
+		 * again.
+		*/
 		futex_down(&async_futex);
 		if (usecs && conn->wdata.timedout &&
 		    list_empty(&conn->msg_queue)) {
-			/* If we timed out-> exit */
+			/* If we timed out -> exit */
 			futex_up(&async_futex);
 			return 0;
@@ -311,6 +359,5 @@
 /** Fibril function that gets created on new connection
  *
- * This function is defined as a weak symbol - to be redefined in
- * user code.
+ * This function is defined as a weak symbol - to be redefined in user code.
  */
 static void default_client_connection(ipc_callid_t callid, ipc_call_t *call)
