Index: uspace/lib/net/netif/netif_local.c
===================================================================
--- uspace/lib/net/netif/netif_local.c	(revision 995689d125f7f186bf072db2d8270c513856a969)
+++ uspace/lib/net/netif/netif_local.c	(revision b14b71e4c383761942ffe166e7deed2e27aa7360)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup netif
+/** @addtogroup libnet 
  * @{
  */
@@ -58,6 +58,5 @@
 DEVICE_MAP_IMPLEMENT(netif_device_map, netif_device_t);
 
-/** Network interface global data.
- */
+/** Network interface global data. */
 netif_globals_t netif_globals;
 
@@ -65,13 +64,13 @@
  *
  * @param[in] netif_phone The network interface phone.
- * @param[in] device_id   The device identifier.
- * @param[in] irq         The device interrupt number.
- * @param[in] io          The device input/output address.
- *
- * @return EOK on success.
- * @return Other errro codes as defined for the netif_probe_message().
- *
- */
-int netif_probe_req_local(int netif_phone, device_id_t device_id, int irq, int io)
+ * @param[in] device_id	The device identifier.
+ * @param[in] irq	The device interrupt number.
+ * @param[in] io	The device input/output address.
+ * @return		EOK on success.
+ * @return		Other error codes as defined for the
+ *			netif_probe_message().
+ */
+int
+netif_probe_req_local(int netif_phone, device_id_t device_id, int irq, int io)
 {
 	fibril_rwlock_write_lock(&netif_globals.lock);
@@ -85,11 +84,10 @@
  *
  * @param[in] netif_phone The network interface phone.
- * @param[in] device_id   The device identifier.
- * @param[in] packet      The packet queue.
- * @param[in] sender      The sending module service.
- *
- * @return EOK on success.
- * @return Other error codes as defined for the generic_send_msg() function.
- *
+ * @param[in] device_id	The device identifier.
+ * @param[in] packet	The packet queue.
+ * @param[in] sender	The sending module service.
+ * @return		EOK on success.
+ * @return		Other error codes as defined for the generic_send_msg()
+ *			function.
  */
 int netif_send_msg_local(int netif_phone, device_id_t device_id,
@@ -106,10 +104,10 @@
  *
  * @param[in] netif_phone The network interface phone.
- * @param[in] device_id   The device identifier.
- *
- * @return EOK on success.
- * @return Other error codes as defined for the find_device() function.
- * @return Other error codes as defined for the netif_start_message() function.
- *
+ * @param[in] device_id	The device identifier.
+ * @return		EOK on success.
+ * @return		Other error codes as defined for the find_device()
+ *			function.
+ * @return		Other error codes as defined for the
+ *			netif_start_message() function.
  */
 int netif_start_req_local(int netif_phone, device_id_t device_id)
@@ -141,10 +139,10 @@
  *
  * @param[in] netif_phone The network interface phone.
- * @param[in] device_id   The device identifier.
- *
- * @return EOK on success.
- * @return Other error codes as defined for the find_device() function.
- * @return Other error codes as defined for the netif_stop_message() function.
- *
+ * @param[in] device_id	The device identifier.
+ * @return		EOK on success.
+ * @return		Other error codes as defined for the find_device()
+ *			function.
+ * @return		Other error codes as defined for the
+ *			netif_stop_message() function.
  */
 int netif_stop_req_local(int netif_phone, device_id_t device_id)
@@ -175,10 +173,8 @@
 /** Return the device usage statistics.
  *
- * @param[in]  netif_phone The network interface phone.
- * @param[in]  device_id   The device identifier.
- * @param[out] stats       The device usage statistics.
- *
+ * @param[in] netif_phone The network interface phone.
+ * @param[in] device_id	The device identifier.
+ * @param[out] stats	The device usage statistics.
  * @return EOK on success.
- *
  */
 int netif_stats_req_local(int netif_phone, device_id_t device_id,
@@ -194,15 +190,13 @@
 /** Return the device local hardware address.
  *
- * @param[in]  netif_phone The network interface phone.
- * @param[in]  device_id   The device identifier.
- * @param[out] address     The device local hardware address.
- * @param[out] data        The address data.
- *
- * @return EOK on success.
- * @return EBADMEM if the address parameter is NULL.
- * @return ENOENT if there no such device.
- * @return Other error codes as defined for the netif_get_addr_message()
- *         function.
- *
+ * @param[in] netif_phone The network interface phone.
+ * @param[in] device_id	The device identifier.
+ * @param[out] address	The device local hardware address.
+ * @param[out] data	The address data.
+ * @return		EOK on success.
+ * @return		EBADMEM if the address parameter is NULL.
+ * @return		ENOENT if there no such device.
+ * @return		Other error codes as defined for the
+ *			netif_get_addr_message() function.
  */
 int netif_get_addr_req_local(int netif_phone, device_id_t device_id,
@@ -211,5 +205,5 @@
 	ERROR_DECLARE;
 	
-	if ((!address) || (!data))
+	if (!address || !data)
 		return EBADMEM;
 	
@@ -231,11 +225,9 @@
 /** Find the device specific data.
  *
- * @param[in]  device_id The device identifier.
- * @param[out] device    The device specific data.
- *
- * @return EOK on success.
- * @return ENOENT if device is not found.
- * @return EPERM if the device is not initialized.
- *
+ * @param[in] device_id	The device identifier.
+ * @param[out] device	The device specific data.
+ * @return		EOK on success.
+ * @return		ENOENT if device is not found.
+ * @return		EPERM if the device is not initialized.
  */
 int find_device(device_id_t device_id, netif_device_t **device)
@@ -256,6 +248,5 @@
 /** Clear the usage statistics.
  *
- * @param[in] stats The usage statistics.
- *
+ * @param[in] stats	The usage statistics.
  */
 void null_device_stats(device_stats_ref stats)
@@ -266,11 +257,8 @@
 /** Initialize the netif module.
  *
- *  @param[in] client_connection The client connection functio to be
- *                               registered.
- *
- *  @return EOK on success.
- *  @return Other error codes as defined for each specific module
- *          message function.
- *
+ * @param[in] client_connection The client connection functio to be registered.
+ * @return		EOK on success.
+ * @return		Other error codes as defined for each specific module
+ *			message function.
  */
 int netif_init_module(async_client_conn_t client_connection)
@@ -298,6 +286,5 @@
  * Prepared for future optimization.
  *
- * @param[in] packet_id The packet identifier.
- *
+ * @param[in] packet_id	The packet identifier.
  */
 void netif_pq_release(packet_id_t packet_id)
@@ -308,8 +295,7 @@
 /** Allocate new packet to handle the given content size.
  *
- * @param[in] content The minimum content size.
- *
- * @return The allocated packet.
- * @return NULL if there is an error.
+ * @param[in] content	The minimum content size.
+ * @return		The allocated packet.
+ * @return		NULL if there is an error.
  *
  */
@@ -319,14 +305,13 @@
 }
 
-/** Register the device notification receiver, the network interface layer module.
- *
- * @param[in] name      Module name.
- * @param[in] device_id The device identifier.
- * @param[in] phone     The network interface layer module phone.
- *
- * @return EOK on success.
- * @return ENOENT if there is no such device.
- * @return ELIMIT if there is another module registered.
- *
+/** Register the device notification receiver, the network interface layer
+ * module.
+ *
+ * @param[in] name	Module name.
+ * @param[in] device_id	The device identifier.
+ * @param[in] phone	The network interface layer module phone.
+ * @return		EOK on success.
+ * @return		ENOENT if there is no such device.
+ * @return		ELIMIT if there is another module registered.
  */
 static int register_message(const char *name, device_id_t device_id, int phone)
@@ -347,14 +332,14 @@
 /** Process the netif module messages.
  *
- * @param[in]  name         Module name.
- * @param[in]  callid       The message identifier.
- * @param[in]  call         The message parameters.
- * @param[out] answer       The message answer parameters.
- * @param[out] answer_count The last parameter for the actual answer
- *                          in the answer parameter.
- *
- * @return EOK on success.
- * @return ENOTSUP if the message is not known.
- * @return Other error codes as defined for each specific module message function.
+ * @param[in] name 	Module name.
+ * @param[in] callid	The message identifier.
+ * @param[in] call	The message parameters.
+ * @param[out] answer	The message answer parameters.
+ * @param[out] answer_count The last parameter for the actual answer in the
+ *			answer parameter.
+ * @return		EOK on success.
+ * @return		ENOTSUP if the message is not known.
+ * @return		Other error codes as defined for each specific module
+ *			message function.
  *
  * @see IS_NET_NETIF_MESSAGE()
@@ -373,45 +358,58 @@
 	*answer_count = 0;
 	switch (IPC_GET_METHOD(*call)) {
-		case IPC_M_PHONE_HUNGUP:
-			return EOK;
-		case NET_NETIF_PROBE:
-			return netif_probe_req_local(0, IPC_GET_DEVICE(call),
-			    NETIF_GET_IRQ(call), NETIF_GET_IO(call));
-		case IPC_M_CONNECT_TO_ME:
-			fibril_rwlock_write_lock(&netif_globals.lock);
-			ERROR_CODE = register_message(name, IPC_GET_DEVICE(call),
-			    IPC_GET_PHONE(call));
-			fibril_rwlock_write_unlock(&netif_globals.lock);
-			return ERROR_CODE;
-		case NET_NETIF_SEND:
-			ERROR_PROPAGATE(packet_translate_remote(netif_globals.net_phone,
-			    &packet, IPC_GET_PACKET(call)));
-			return netif_send_msg_local(0, IPC_GET_DEVICE(call), packet,
-			    IPC_GET_SENDER(call));
-		case NET_NETIF_START:
-			return netif_start_req_local(0, IPC_GET_DEVICE(call));
-		case NET_NETIF_STATS:
-			fibril_rwlock_read_lock(&netif_globals.lock);
-			if (!ERROR_OCCURRED(async_data_read_receive(&callid, &length))) {
-				if (length < sizeof(device_stats_t))
-					ERROR_CODE = EOVERFLOW;
-				else {
-					if (!ERROR_OCCURRED(netif_get_device_stats(
-					    IPC_GET_DEVICE(call), &stats)))
-						ERROR_CODE = async_data_read_finalize(callid, &stats,
-						    sizeof(device_stats_t));
-				}
-			}
+	case IPC_M_PHONE_HUNGUP:
+		return EOK;
+	
+	case NET_NETIF_PROBE:
+		return netif_probe_req_local(0, IPC_GET_DEVICE(call),
+		    NETIF_GET_IRQ(call), NETIF_GET_IO(call));
+		    
+	case IPC_M_CONNECT_TO_ME:
+		fibril_rwlock_write_lock(&netif_globals.lock);
+		ERROR_CODE = register_message(name, IPC_GET_DEVICE(call),
+		    IPC_GET_PHONE(call));
+		fibril_rwlock_write_unlock(&netif_globals.lock);
+		return ERROR_CODE;
+		
+	case NET_NETIF_SEND:
+		ERROR_PROPAGATE(packet_translate_remote(netif_globals.net_phone,
+		    &packet, IPC_GET_PACKET(call)));
+		return netif_send_msg_local(0, IPC_GET_DEVICE(call), packet,
+		    IPC_GET_SENDER(call));
+		    
+	case NET_NETIF_START:
+		return netif_start_req_local(0, IPC_GET_DEVICE(call));
+		
+	case NET_NETIF_STATS:
+		fibril_rwlock_read_lock(&netif_globals.lock);
+
+		if (ERROR_OCCURRED(async_data_read_receive(&callid, &length))) {
 			fibril_rwlock_read_unlock(&netif_globals.lock);
 			return ERROR_CODE;
-		case NET_NETIF_STOP:
-			return netif_stop_req_local(0, IPC_GET_DEVICE(call));
-		case NET_NETIF_GET_ADDR:
-			fibril_rwlock_read_lock(&netif_globals.lock);
-			if (!ERROR_OCCURRED(netif_get_addr_message(IPC_GET_DEVICE(call),
-			    &address)))
-				ERROR_CODE = measured_strings_reply(&address, 1);
+		}
+		if (length < sizeof(device_stats_t)) {
 			fibril_rwlock_read_unlock(&netif_globals.lock);
-			return ERROR_CODE;
+			return EOVERFLOW;
+		}
+
+		if (ERROR_NONE(netif_get_device_stats(IPC_GET_DEVICE(call),
+		    &stats))) {
+			ERROR_CODE = async_data_read_finalize(callid, &stats,
+			    sizeof(device_stats_t));
+		}
+
+		fibril_rwlock_read_unlock(&netif_globals.lock);
+		return ERROR_CODE;
+
+	case NET_NETIF_STOP:
+		return netif_stop_req_local(0, IPC_GET_DEVICE(call));
+		
+	case NET_NETIF_GET_ADDR:
+		fibril_rwlock_read_lock(&netif_globals.lock);
+		if (ERROR_NONE(netif_get_addr_message(IPC_GET_DEVICE(call),
+		    &address)))
+			ERROR_CODE = measured_strings_reply(&address, 1);
+		fibril_rwlock_read_unlock(&netif_globals.lock);
+		return ERROR_CODE;
 	}
 	
@@ -421,16 +419,13 @@
 /** Start the network interface module.
  *
- * Initialize the client connection serving function, initialize
- * the module, registers the module service and start the async
- * manager, processing IPC messages in an infinite loop.
- *
- * @param[in] client_connection The client connection processing
- *                              function. The module skeleton propagates
- *                              its own one.
- *
- * @return EOK on success.
- * @return Other error codes as defined for each specific module message
- *         function.
- *
+ * Initialize the client connection serving function, initialize the module,
+ * registers the module service and start the async manager, processing IPC
+ * messages in an infinite loop.
+ *
+ * @param[in] client_connection The client connection processing function.
+ *			The module skeleton propagates its own one.
+ * @return		EOK on success.
+ * @return		Other error codes as defined for each specific module
+ *			message function.
  */
 int netif_module_start_standalone(async_client_conn_t client_connection)
