Index: uspace/lib/c/generic/net/icmp_common.c
===================================================================
--- uspace/lib/c/generic/net/icmp_common.c	(revision 7c169cef1c068093084d1828dec3a4b96960c749)
+++ uspace/lib/c/generic/net/icmp_common.c	(revision 50c06df137e61ca4f6a5de9ada5a632686de0eed)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libc 
+/** @addtogroup libc
  *  @{
  */
@@ -38,28 +38,21 @@
 #include <net/modules.h>
 #include <net/icmp_common.h>
-
 #include <ipc/services.h>
 #include <ipc/icmp.h>
-
 #include <sys/time.h>
 #include <async.h>
 
-/** Connects to the ICMP module.
+/** Connect to the ICMP module.
  *
- * @param service	The ICMP module service. Ignored parameter.
- * @param[in] timeout	The connection timeout in microseconds. No timeout if
- *			set to zero.
- * @return		The ICMP module phone on success.
- * @return		ETIMEOUT if the connection timeouted.
+ * @param[in] timeout Connection timeout in microseconds, zero
+ *                    for no timeout.
+ *
+ * @return ICMP module phone on success.
+ * @return ETIMEOUT if the connection timeouted.
+ *
  */
-int icmp_connect_module(services_t service, suseconds_t timeout)
+int icmp_connect_module(suseconds_t timeout)
 {
-	int phone;
-
-	phone = connect_to_service_timeout(SERVICE_ICMP, timeout);
-	if (phone >= 0)
-		async_req_0_0(phone, NET_ICMP_INIT);
-
-	return phone;
+	return connect_to_service_timeout(SERVICE_ICMP, timeout);
 }
 
Index: uspace/lib/c/include/adt/hash_table.h
===================================================================
--- uspace/lib/c/include/adt/hash_table.h	(revision 7c169cef1c068093084d1828dec3a4b96960c749)
+++ uspace/lib/c/include/adt/hash_table.h	(revision 50c06df137e61ca4f6a5de9ada5a632686de0eed)
@@ -41,41 +41,42 @@
 typedef unsigned long hash_count_t;
 typedef unsigned long hash_index_t;
-typedef struct hash_table hash_table_t;
-typedef struct hash_table_operations hash_table_operations_t;
+
+/** Set of operations for hash table. */
+typedef struct {
+	/** Hash function.
+	 *
+	 * @param key Array of keys needed to compute hash index.
+	 *            All keys must be passed.
+	 *
+	 * @return Index into hash table.
+	 *
+	 */
+	hash_index_t (*hash)(unsigned long key[]);
+	
+	/** Hash table item comparison function.
+	 *
+	 * @param key Array of keys that will be compared with item. It is
+	 *            not necessary to pass all keys.
+	 *
+	 * @return True if the keys match, false otherwise.
+	 *
+	 */
+	int (*compare)(unsigned long key[], hash_count_t keys, link_t *item);
+	
+	/** Hash table item removal callback.
+	 *
+	 * @param item Item that was removed from the hash table.
+	 *
+	 */
+	void (*remove_callback)(link_t *item);
+} hash_table_operations_t;
 
 /** Hash table structure. */
-struct hash_table {
+typedef struct {
 	link_t *entry;
 	hash_count_t entries;
 	hash_count_t max_keys;
 	hash_table_operations_t *op;
-};
-
-/** Set of operations for hash table. */
-struct hash_table_operations {
-	/** Hash function.
-	 *
-	 * @param key 	Array of keys needed to compute hash index. All keys
-	 *		must be passed.
-	 *
-	 * @return	Index into hash table.
-	 */
-	hash_index_t (* hash)(unsigned long key[]);
-	
-	/** Hash table item comparison function.
-	 *
-	 * @param key 	Array of keys that will be compared with item. It is
-	 *		not necessary to pass all keys.
-	 *
-	 * @return 	true if the keys match, false otherwise.
-	 */
-	int (*compare)(unsigned long key[], hash_count_t keys, link_t *item);
-
-	/** Hash table item removal callback.
-	 *
-	 * @param item 	Item that was removed from the hash table.
-	 */
-	void (*remove_callback)(link_t *item);
-};
+} hash_table_t;
 
 #define hash_table_get_instance(item, type, member) \
Index: uspace/lib/c/include/ipc/icmp.h
===================================================================
--- uspace/lib/c/include/ipc/icmp.h	(revision 7c169cef1c068093084d1828dec3a4b96960c749)
+++ uspace/lib/c/include/ipc/icmp.h	(revision 50c06df137e61ca4f6a5de9ada5a632686de0eed)
@@ -33,5 +33,5 @@
 /** @file
  * ICMP module messages.
- * @see icmp_interface.h
+ * @see icmp_remote.h
  */
 
@@ -48,9 +48,9 @@
 /** ICMP module messages. */
 typedef enum {
-	/** Sends echo request. @see icmp_echo() */
+	/** Send echo request. @see icmp_echo() */
 	NET_ICMP_ECHO = NET_ICMP_FIRST,
 	
 	/**
-	 * Sends destination unreachable error message.
+	 * Send destination unreachable error message.
 	 * @see icmp_destination_unreachable_msg()
 	 */
@@ -58,5 +58,5 @@
 	
 	/**
-	 * Sends source quench error message.
+	 * Send source quench error message.
 	 * @see icmp_source_quench_msg()
 	 */
@@ -64,5 +64,5 @@
 	
 	/**
-	 * Sends time exceeded error message.
+	 * Send time exceeded error message.
 	 * @see icmp_time_exceeded_msg()
 	 */
@@ -70,12 +70,9 @@
 	
 	/**
-	 * Sends parameter problem error message.
+	 * Send parameter problem error message.
 	 * @see icmp_parameter_problem_msg()
 	 */
-	NET_ICMP_PARAMETERPROB,
-	
-	/** Initializes new connection. */
-	NET_ICMP_INIT
-} icmp_messages;
+	NET_ICMP_PARAMETERPROB
+} icmp_messages_t;
 
 /** @name ICMP specific message parameters definitions */
Index: uspace/lib/c/include/net/icmp_common.h
===================================================================
--- uspace/lib/c/include/net/icmp_common.h	(revision 7c169cef1c068093084d1828dec3a4b96960c749)
+++ uspace/lib/c/include/net/icmp_common.h	(revision 50c06df137e61ca4f6a5de9ada5a632686de0eed)
@@ -41,8 +41,8 @@
 #include <sys/time.h>
 
-/** Default timeout for incoming connections in microseconds. */
-#define ICMP_CONNECT_TIMEOUT	(1 * 1000 * 1000)
+/** Default timeout for incoming connections in microseconds (1 sec). */
+#define ICMP_CONNECT_TIMEOUT  1000000
 
-extern int icmp_connect_module(services_t, suseconds_t);
+extern int icmp_connect_module(suseconds_t);
 
 #endif
Index: uspace/lib/net/include/icmp_header.h
===================================================================
--- uspace/lib/net/include/icmp_header.h	(revision 7c169cef1c068093084d1828dec3a4b96960c749)
+++ uspace/lib/net/include/icmp_header.h	(revision 50c06df137e61ca4f6a5de9ada5a632686de0eed)
@@ -45,26 +45,16 @@
 
 /** ICMP header size in bytes. */
-#define ICMP_HEADER_SIZE	sizeof(icmp_header_t)
-
-/** Type definition of the echo specific data.
- * @see icmp_echo
- */
-typedef struct icmp_echo icmp_echo_t;
+#define ICMP_HEADER_SIZE  sizeof(icmp_header_t)
 
 /** Echo specific data. */
-struct icmp_echo {
+typedef struct icmp_echo {
 	/** Message idintifier. */
 	icmp_param_t identifier;
 	/** Message sequence number. */
 	icmp_param_t sequence_number;
-} __attribute__ ((packed));
-
-/** Type definition of the internet control message header.
- * @see icmp_header
- */
-typedef struct icmp_header icmp_header_t;
+} __attribute__((packed)) icmp_echo_t;
 
 /** Internet control message header. */
-struct icmp_header {
+typedef struct icmp_header {
 	/** The type of the message. */
 	uint8_t type;
@@ -83,9 +73,9 @@
 	 */
 	uint16_t checksum;
-
+	
 	/** Message specific data. */
 	union {
 		/** Echo specific data. */
-		icmp_echo_t  echo;
+		icmp_echo_t echo;
 		/** Proposed gateway value. */
 		in_addr_t gateway;
@@ -107,5 +97,5 @@
 		} param;
 	} un;
-} __attribute__ ((packed));
+} __attribute__((packed)) icmp_header_t;
 
 #endif
Index: uspace/lib/net/include/icmp_interface.h
===================================================================
--- uspace/lib/net/include/icmp_interface.h	(revision 7c169cef1c068093084d1828dec3a4b96960c749)
+++ 	(revision )
@@ -1,63 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libnet 
- *  @{
- */
-
-#ifndef LIBNET_ICMP_INTERFACE_H_
-#define LIBNET_ICMP_INTERFACE_H_
-
-#include <net/socket_codes.h>
-#include <sys/types.h>
-
-#include <net/device.h>
-#include <adt/measured_strings.h>
-#include <net/packet.h>
-#include <net/inet.h>
-#include <net/ip_codes.h>
-#include <net/icmp_codes.h>
-#include <net/icmp_common.h>
-
-/** @name ICMP module interface
- * This interface is used by other modules.
- */
-/*@{*/
-
-extern int icmp_destination_unreachable_msg(int, icmp_code_t, icmp_param_t,
-    packet_t *);
-extern int icmp_source_quench_msg(int, packet_t *);
-extern int icmp_time_exceeded_msg(int, icmp_code_t, packet_t *);
-extern int icmp_parameter_problem_msg(int, icmp_code_t, icmp_param_t, packet_t *);
-
-/*@}*/
-
-#endif
-
-/** @}
- */
Index: uspace/lib/net/include/icmp_remote.h
===================================================================
--- uspace/lib/net/include/icmp_remote.h	(revision 50c06df137e61ca4f6a5de9ada5a632686de0eed)
+++ uspace/lib/net/include/icmp_remote.h	(revision 50c06df137e61ca4f6a5de9ada5a632686de0eed)
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2009 Lukas Mejdrech
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libnet
+ *  @{
+ */
+
+#ifndef LIBNET_ICMP_REMOTE_H_
+#define LIBNET_ICMP_REMOTE_H_
+
+#include <net/socket_codes.h>
+#include <sys/types.h>
+
+#include <net/device.h>
+#include <adt/measured_strings.h>
+#include <net/packet.h>
+#include <net/inet.h>
+#include <net/ip_codes.h>
+#include <net/icmp_codes.h>
+#include <net/icmp_common.h>
+
+/** @name ICMP module interface
+ * This interface is used by other modules.
+ */
+/*@{*/
+
+extern int icmp_destination_unreachable_msg(int, icmp_code_t, icmp_param_t,
+    packet_t *);
+extern int icmp_source_quench_msg(int, packet_t *);
+extern int icmp_time_exceeded_msg(int, icmp_code_t, packet_t *);
+extern int icmp_parameter_problem_msg(int, icmp_code_t, icmp_param_t,
+    packet_t *);
+
+/*@}*/
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/net/include/tl_skel.h
===================================================================
--- uspace/lib/net/include/tl_skel.h	(revision 7c169cef1c068093084d1828dec3a4b96960c749)
+++ uspace/lib/net/include/tl_skel.h	(revision 50c06df137e61ca4f6a5de9ada5a632686de0eed)
@@ -61,4 +61,11 @@
 extern int tl_initialize(int net_phone);
 
+/** Per-connection module initialization.
+ *
+ * This has to be implemented in user code.
+ *
+ */
+extern void tl_connection(void);
+
 /** Process the transport layer module message.
  *
@@ -74,5 +81,5 @@
  *
  */
-extern int tl_module_message(ipc_callid_t, ipc_call_t *,
+extern int tl_message(ipc_callid_t, ipc_call_t *,
     ipc_call_t *, size_t *);
 
Index: uspace/lib/net/tl/icmp_remote.c
===================================================================
--- uspace/lib/net/tl/icmp_remote.c	(revision 7c169cef1c068093084d1828dec3a4b96960c749)
+++ uspace/lib/net/tl/icmp_remote.c	(revision 50c06df137e61ca4f6a5de9ada5a632686de0eed)
@@ -33,8 +33,8 @@
 /** @file
  * ICMP interface implementation for remote modules.
- * @see icmp_interface.h
+ * @see icmp_remote.h
  */
 
-#include <icmp_interface.h>
+#include <icmp_remote.h>
 #include <net/modules.h>
 #include <packet_client.h>
Index: uspace/lib/net/tl/tl_common.c
===================================================================
--- uspace/lib/net/tl/tl_common.c	(revision 7c169cef1c068093084d1828dec3a4b96960c749)
+++ uspace/lib/net/tl/tl_common.c	(revision 50c06df137e61ca4f6a5de9ada5a632686de0eed)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libnet 
+/** @addtogroup libnet
  * @{
  */
@@ -39,5 +39,5 @@
 #include <packet_client.h>
 #include <packet_remote.h>
-#include <icmp_interface.h>
+#include <icmp_remote.h>
 #include <ip_remote.h>
 #include <ip_interface.h>
Index: uspace/lib/net/tl/tl_skel.c
===================================================================
--- uspace/lib/net/tl/tl_skel.c	(revision 7c169cef1c068093084d1828dec3a4b96960c749)
+++ uspace/lib/net/tl/tl_skel.c	(revision 50c06df137e61ca4f6a5de9ada5a632686de0eed)
@@ -56,4 +56,7 @@
 	ipc_answer_0(iid, EOK);
 	
+	/* Per-connection initialization */
+	tl_connection();
+	
 	while (true) {
 		ipc_call_t answer;
@@ -68,6 +71,5 @@
 		
 		/* Process the message */
-		int res = tl_module_message(callid, &call, &answer,
-		    &count);
+		int res = tl_message(callid, &call, &answer, &count);
 		
 		/*
Index: uspace/lib/usb/src/recognise.c
===================================================================
--- uspace/lib/usb/src/recognise.c	(revision 7c169cef1c068093084d1828dec3a4b96960c749)
+++ uspace/lib/usb/src/recognise.c	(revision 50c06df137e61ca4f6a5de9ada5a632686de0eed)
@@ -203,4 +203,8 @@
 		uint8_t cur_descr_len = current_descriptor[0];
 		uint8_t cur_descr_type = current_descriptor[1];
+
+		if (cur_descr_len == 0) {
+			return ENOENT;
+		}
 		
 		position += cur_descr_len;
