Index: kernel/arch/amd64/include/mm/as.h
===================================================================
--- kernel/arch/amd64/include/mm/as.h	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ kernel/arch/amd64/include/mm/as.h	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -36,11 +36,14 @@
 #define KERN_amd64_AS_H_
 
+#define ADDRESS_SPACE_HOLE_START	0x0000800000000000ULL
+#define ADDRESS_SPACE_HOLE_END		0xffff7fffffffffffULL
+
 #define KERNEL_ADDRESS_SPACE_SHADOWED_ARCH  0
 
-#define KERNEL_ADDRESS_SPACE_START_ARCH  (unsigned long) 0xffff800000000000
-#define KERNEL_ADDRESS_SPACE_END_ARCH    (unsigned long) 0xffffffffffffffff
+#define KERNEL_ADDRESS_SPACE_START_ARCH	0xffff800000000000ULL
+#define KERNEL_ADDRESS_SPACE_END_ARCH	0xffffffffffffffffULL
 
-#define USER_ADDRESS_SPACE_START_ARCH    (unsigned long) 0x0000000000000000
-#define USER_ADDRESS_SPACE_END_ARCH      (unsigned long) 0x00007fffffffffff
+#define USER_ADDRESS_SPACE_START_ARCH	0x0000000000000000ULL
+#define USER_ADDRESS_SPACE_END_ARCH	0x00007fffffffffffULL
 
 #define USTACK_ADDRESS_ARCH  (USER_ADDRESS_SPACE_END_ARCH - (PAGE_SIZE - 1))
Index: kernel/arch/amd64/include/pm.h
===================================================================
--- kernel/arch/amd64/include/pm.h	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ kernel/arch/amd64/include/pm.h	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -83,5 +83,5 @@
 
 #define TSS_BASIC_SIZE  104
-#define TSS_IOMAP_SIZE  (16 * 1024 + 1)  /* 16K for bitmap + 1 terminating byte for convenience */
+#define TSS_IOMAP_SIZE  (8 * 1024 + 1)  /* 8K for bitmap + 1 terminating byte for convenience */
 
 #define IO_PORTS  (64 * 1024)
Index: kernel/arch/amd64/src/ddi/ddi.c
===================================================================
--- kernel/arch/amd64/src/ddi/ddi.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ kernel/arch/amd64/src/ddi/ddi.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -126,11 +126,16 @@
 		bitmap_initialize(&iomap, CPU->arch.tss->iomap,
 		    TSS_IOMAP_SIZE * 8);
-		bitmap_copy(&iomap, &TASK->arch.iomap, TASK->arch.iomap.bits);
+		bitmap_copy(&iomap, &TASK->arch.iomap, bits);
 		
+		/*
+		 * Set the trailing bits in the last byte of the map to disable
+		 * I/O access.
+		 */
+		bitmap_set_range(&iomap, bits, ALIGN_UP(bits, 8) - bits);
 		/*
 		 * It is safe to set the trailing eight bits because of the
 		 * extra convenience byte in TSS_IOMAP_SIZE.
 		 */
-		bitmap_set_range(&iomap, ALIGN_UP(TASK->arch.iomap.bits, 8), 8);
+		bitmap_set_range(&iomap, ALIGN_UP(bits, 8), 8);
 	}
 	irq_spinlock_unlock(&TASK->lock, false);
Index: kernel/arch/ia32/include/pm.h
===================================================================
--- kernel/arch/ia32/include/pm.h	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ kernel/arch/ia32/include/pm.h	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -75,5 +75,5 @@
 
 #define TSS_BASIC_SIZE  104
-#define TSS_IOMAP_SIZE  (16 * 1024 + 1)  /* 16K for bitmap + 1 terminating byte for convenience */
+#define TSS_IOMAP_SIZE  (8 * 1024 + 1)  /* 8K for bitmap + 1 terminating byte for convenience */
 
 #define IO_PORTS  (64 * 1024)
Index: kernel/arch/ia32/src/ddi/ddi.c
===================================================================
--- kernel/arch/ia32/src/ddi/ddi.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ kernel/arch/ia32/src/ddi/ddi.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -127,11 +127,16 @@
 		bitmap_initialize(&iomap, CPU->arch.tss->iomap,
 		    TSS_IOMAP_SIZE * 8);
-		bitmap_copy(&iomap, &TASK->arch.iomap, TASK->arch.iomap.bits);
+		bitmap_copy(&iomap, &TASK->arch.iomap, bits);
 		
+		/*
+		 * Set the trailing bits in the last byte of the map to disable
+		 * I/O access.
+		 */
+		bitmap_set_range(&iomap, bits, ALIGN_UP(bits, 8) - bits);
 		/*
 		 * It is safe to set the trailing eight bits because of the
 		 * extra convenience byte in TSS_IOMAP_SIZE.
 		 */
-		bitmap_set_range(&iomap, ALIGN_UP(TASK->arch.iomap.bits, 8), 8);
+		bitmap_set_range(&iomap, ALIGN_UP(bits, 8), 8);
 	}
 	irq_spinlock_unlock(&TASK->lock, false);
Index: kernel/generic/include/typedefs.h
===================================================================
--- kernel/generic/include/typedefs.h	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ kernel/generic/include/typedefs.h	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -40,5 +40,5 @@
 #include <arch/types.h>
 
-#define NULL  0
+#define NULL  0UL
 
 #define false  0
Index: kernel/generic/src/adt/bitmap.c
===================================================================
--- kernel/generic/src/adt/bitmap.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ kernel/generic/src/adt/bitmap.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -32,5 +32,5 @@
 /**
  * @file
- * @brief	Implementation of bitmap ADT.
+ * @brief Implementation of bitmap ADT.
  *
  * This file implements bitmap ADT and provides functions for
@@ -51,7 +51,7 @@
  * No portion of the bitmap is set or cleared by this function.
  *
- * @param bitmap Bitmap structure.
- * @param map Address of the memory used to hold the map.
- * @param bits Number of bits stored in bitmap.
+ * @param bitmap	Bitmap structure.
+ * @param map		Address of the memory used to hold the map.
+ * @param bits		Number of bits stored in bitmap.
  */
 void bitmap_initialize(bitmap_t *bitmap, uint8_t *map, size_t bits)
@@ -63,7 +63,7 @@
 /** Set range of bits.
  *
- * @param bitmap Bitmap structure.
- * @param start Starting bit.
- * @param bits Number of bits to set.
+ * @param bitmap	Bitmap structure.
+ * @param start		Starting bit.
+ * @param bits		Number of bits to set.
  */
 void bitmap_set_range(bitmap_t *bitmap, size_t start, size_t bits)
@@ -71,7 +71,7 @@
 	size_t i = 0;
 	size_t aligned_start;
-	size_t lub;		/* leading unaligned bits */
-	size_t amb;		/* aligned middle bits */
-	size_t tab;		/* trailing aligned bits */
+	size_t lub;	/* leading unaligned bits */
+	size_t amb;	/* aligned middle bits */
+	size_t tab;	/* trailing aligned bits */
 	
 	ASSERT(start + bits <= bitmap->bits);
@@ -82,28 +82,23 @@
 	tab = amb % 8;
 	
-	if ( start + bits < aligned_start ) {
-	    /*
-	    * Set bits in the middle of byte
-	    */
-	    bitmap->map[start / 8] |= ((1 << lub)-1) << (start&7);
-	    return;
+	if (!bits)
+		return;
+
+	if (start + bits < aligned_start) {
+		/* Set bits in the middle of byte. */
+		bitmap->map[start / 8] |= ((1 << lub) - 1) << (start & 7);
+		return;
 	}
 	
 	if (lub) {
-		/*
-		 * Make sure to set any leading unaligned bits.
-		 */
+		/* Make sure to set any leading unaligned bits. */
 		bitmap->map[start / 8] |= ~((1 << (8 - lub)) - 1);
 	}
 	for (i = 0; i < amb / 8; i++) {
-		/*
-		 * The middle bits can be set byte by byte.
-		 */
+		/* The middle bits can be set byte by byte. */
 		bitmap->map[aligned_start / 8 + i] = ALL_ONES;
 	}
 	if (tab) {
-		/*
-		 * Make sure to set any trailing aligned bits.
-		 */
+		/* Make sure to set any trailing aligned bits. */
 		bitmap->map[aligned_start / 8 + i] |= (1 << tab) - 1;
 	}
@@ -113,7 +108,7 @@
 /** Clear range of bits.
  *
- * @param bitmap Bitmap structure.
- * @param start Starting bit.
- * @param bits Number of bits to clear.
+ * @param bitmap	Bitmap structure.
+ * @param start		Starting bit.
+ * @param bits		Number of bits to clear.
  */
 void bitmap_clear_range(bitmap_t *bitmap, size_t start, size_t bits)
@@ -121,7 +116,7 @@
 	size_t i = 0;
 	size_t aligned_start;
-	size_t lub;		/* leading unaligned bits */
-	size_t amb;		/* aligned middle bits */
-	size_t tab;		/* trailing aligned bits */
+	size_t lub;	/* leading unaligned bits */
+	size_t amb;	/* aligned middle bits */
+	size_t tab;	/* trailing aligned bits */
 	
 	ASSERT(start + bits <= bitmap->bits);
@@ -132,30 +127,23 @@
 	tab = amb % 8;
 
-	if ( start + bits < aligned_start )
-	{
-	    /*
-	    * Set bits in the middle of byte
-	    */
-	    bitmap->map[start / 8] &= ~(((1 << lub)-1) << (start&7));
-	    return;
+	if (!bits)
+		return;
+
+	if (start + bits < aligned_start) {
+		/* Set bits in the middle of byte */
+		bitmap->map[start / 8] &= ~(((1 << lub) - 1) << (start & 7));
+		return;
 	}
 
-
 	if (lub) {
-		/*
-		 * Make sure to clear any leading unaligned bits.
-		 */
+		/* Make sure to clear any leading unaligned bits. */
 		bitmap->map[start / 8] &= (1 << (8 - lub)) - 1;
 	}
 	for (i = 0; i < amb / 8; i++) {
-		/*
-		 * The middle bits can be cleared byte by byte.
-		 */
+		/* The middle bits can be cleared byte by byte. */
 		bitmap->map[aligned_start / 8 + i] = ALL_ZEROES;
 	}
 	if (tab) {
-		/*
-		 * Make sure to clear any trailing aligned bits.
-		 */
+		/* Make sure to clear any trailing aligned bits. */
 		bitmap->map[aligned_start / 8 + i] &= ~((1 << tab) - 1);
 	}
@@ -165,7 +153,7 @@
 /** Copy portion of one bitmap into another bitmap.
  *
- * @param dst Destination bitmap.
- * @param src Source bitmap.
- * @param bits Number of bits to copy.
+ * @param dst		Destination bitmap.
+ * @param src		Source bitmap.
+ * @param bits		Number of bits to copy.
  */
 void bitmap_copy(bitmap_t *dst, bitmap_t *src, size_t bits)
Index: kernel/generic/src/syscall/copy.c
===================================================================
--- kernel/generic/src/syscall/copy.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ kernel/generic/src/syscall/copy.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -68,5 +68,6 @@
 	if (!KERNEL_ADDRESS_SPACE_SHADOWED) {
 		if (overlaps((uintptr_t) uspace_src, size,
-			KERNEL_ADDRESS_SPACE_START, KERNEL_ADDRESS_SPACE_END-KERNEL_ADDRESS_SPACE_START)) {
+			KERNEL_ADDRESS_SPACE_START,
+			KERNEL_ADDRESS_SPACE_END - KERNEL_ADDRESS_SPACE_START)) {
 			/*
 			 * The userspace source block conflicts with kernel address space.
@@ -75,4 +76,13 @@
 		}
 	}
+
+#ifdef ADDRESS_SPACE_HOLE_START
+	/*
+	 * Check whether the address is outside the address space hole.
+	 */
+	if (overlaps((uintptr_t) uspace_src, size, ADDRESS_SPACE_HOLE_START,
+	    ADDRESS_SPACE_HOLE_END - ADDRESS_SPACE_HOLE_START))
+		return EPERM;
+#endif
 	
 	ipl = interrupts_disable();
@@ -109,5 +119,6 @@
 	if (!KERNEL_ADDRESS_SPACE_SHADOWED) {
 		if (overlaps((uintptr_t) uspace_dst, size,
-			KERNEL_ADDRESS_SPACE_START, KERNEL_ADDRESS_SPACE_END-KERNEL_ADDRESS_SPACE_START)) {
+			KERNEL_ADDRESS_SPACE_START,
+			KERNEL_ADDRESS_SPACE_END - KERNEL_ADDRESS_SPACE_START)) {
 			/*
 			 * The userspace destination block conflicts with kernel address space.
@@ -116,4 +127,13 @@
 		}
 	}
+
+#ifdef ADDRESS_SPACE_HOLE_START
+	/*
+	 * Check whether the address is outside the address space hole.
+	 */
+	if (overlaps((uintptr_t) uspace_dst, size, ADDRESS_SPACE_HOLE_START,
+	    ADDRESS_SPACE_HOLE_END - ADDRESS_SPACE_HOLE_START))
+		return EPERM;
+#endif
 	
 	ipl = interrupts_disable();
Index: tools/toolchain.sh
===================================================================
--- tools/toolchain.sh	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ tools/toolchain.sh	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -62,6 +62,7 @@
 	echo " ia32       IA-32 (x86, i386)"
 	echo " ia64       IA-64 (Itanium)"
-	echo " mips32     MIPS little-endian"
-	echo " mips32eb   MIPS big-endian"
+	echo " mips32     MIPS little-endian 32b"
+	echo " mips32eb   MIPS big-endian 32b"
+	echo " mips64     MIPS little-endian 64b"
 	echo " ppc32      32-bit PowerPC"
 	echo " ppc64      64-bit PowerPC"
@@ -303,4 +304,7 @@
 		build_target "mips32eb" "mips-linux-gnu"
 		;;
+	"mips64")
+		build_target "mips64" "mips64el-linux-gnu"
+		;;
 	"ppc32")
 		build_target "ppc32" "ppc-linux-gnu"
@@ -320,4 +324,5 @@
 		build_target "mips32" "mipsel-linux-gnu"
 		build_target "mips32eb" "mips-linux-gnu"
+		build_target "mips64" "mips64el-linux-gnu"
 		build_target "ppc32" "ppc-linux-gnu"
 		build_target "ppc64" "ppc64-linux-gnu"
Index: uspace/app/bdsh/cmds/modules/bdd/bdd.c
===================================================================
--- uspace/app/bdsh/cmds/modules/bdd/bdd.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/app/bdsh/cmds/modules/bdd/bdd.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -68,5 +68,5 @@
 	unsigned int argc;
 	unsigned int i, j;
-	dev_handle_t handle;
+	devmap_handle_t handle;
 	uint8_t *blk;
 	size_t size, bytes, rows;
Index: uspace/app/bdsh/cmds/modules/help/help.c
===================================================================
--- uspace/app/bdsh/cmds/modules/help/help.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/app/bdsh/cmds/modules/help/help.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -45,7 +45,8 @@
 extern const char *progname;
 
-#define HELP_IS_MODULE   1
-#define HELP_IS_BUILTIN  0
-#define HELP_IS_RUBBISH  -1
+#define HELP_IS_COMMANDS	2
+#define HELP_IS_MODULE		1
+#define HELP_IS_BUILTIN		0
+#define HELP_IS_RUBBISH 	-1
 
 volatile int mod_switch = -1;
@@ -55,4 +56,7 @@
 {
 	int rc = HELP_IS_RUBBISH;
+
+	if (str_cmp(cmd, "commands") == 0)
+		return HELP_IS_COMMANDS;
 
 	rc = is_builtin(cmd);
@@ -90,44 +94,11 @@
 }
 
-int cmd_help(char *argv[])
+static void help_commands(void)
 {
+	builtin_t *cmd;
 	module_t *mod;
-	builtin_t *cmd;
-	unsigned int i = 0;
-	int rc = 0;
-	int argc;
-	int level = HELP_SHORT;
+	unsigned int i;
 
-	argc = cli_count_args(argv);
-
-	if (argc > 3) {
-		printf("\nToo many arguments to `%s', try:\n", cmdname);
-		help_cmd_help(HELP_SHORT);
-		return CMD_FAILURE;
-	}
-
-	if (argc == 3) {
-		if (!str_cmp("extended", argv[2]))
-			level = HELP_LONG;
-		else
-			level = HELP_SHORT;
-	}
-
-	if (argc > 1) {
-		rc = is_mod_or_builtin(argv[1]);
-		switch (rc) {
-		case HELP_IS_RUBBISH:
-			printf("Invalid command %s\n", argv[1]);
-			return CMD_FAILURE;
-		case HELP_IS_MODULE:
-			help_module(mod_switch, level);
-			return CMD_SUCCESS;
-		case HELP_IS_BUILTIN:
-			help_builtin(mod_switch, level);
-			return CMD_SUCCESS;
-		}
-	}
-
-	printf("\n  Available commands are:\n");
+	printf("\n  Bdsh built-in commands:\n");
 	printf("  ------------------------------------------------------------\n");
 
@@ -154,4 +125,73 @@
 	printf("\n  Try %s %s for more information on how `%s' works.\n\n",
 		cmdname, cmdname, cmdname);
+}
+
+/** Display survival tips. ('help' without arguments) */
+static void help_survival(void)
+{
+	printf("Don't panic!\n\n");
+
+	printf("This is Bdsh, the Brain dead shell, currently "
+	    "the primary user interface to HelenOS. Bdsh allows you to enter "
+	    "commands and supports history (Up, Down arrow keys), "
+	    "line editing (Left Arrow, Right Arrow, Home, End, Backspace), "
+	    "selection (Shift + movement keys), copy and paste (Ctrl-C, "
+	    "Ctrl-V), similar to common desktop environments.\n\n");
+
+	printf("The most basic filesystem commands are Bdsh builtins. Type "
+	    "'help commands' [Enter] to see the list of Bdsh builtin commands. "
+	    "Other commands are external executables located in the /app and "
+	    "/srv directories. Type 'ls /app' [Enter] and 'ls /srv' [Enter] "
+	    "to see their list. You can execute an external command simply "
+	    "by entering its name (e.g. type 'tetris' [Enter]).\n\n");
+
+	printf("HelenOS has virtual consoles (VCs). You can switch between "
+	    "these using the F1-F11 keys.\n\n");
+
+	printf("This is but a small glimpse of what you can do with HelenOS. "
+	    "To learn more please point your browser to the HelenOS User's "
+	    "Guide: http://trac.helenos.org/trac.fcgi/wiki/UsersGuide\n\n");
+}
+
+int cmd_help(char *argv[])
+{
+	int rc = 0;
+	int argc;
+	int level = HELP_SHORT;
+
+	argc = cli_count_args(argv);
+
+	if (argc > 3) {
+		printf("\nToo many arguments to `%s', try:\n", cmdname);
+		help_cmd_help(HELP_SHORT);
+		return CMD_FAILURE;
+	}
+
+	if (argc == 3) {
+		if (!str_cmp("extended", argv[2]))
+			level = HELP_LONG;
+		else
+			level = HELP_SHORT;
+	}
+
+	if (argc > 1) {
+		rc = is_mod_or_builtin(argv[1]);
+		switch (rc) {
+		case HELP_IS_RUBBISH:
+			printf("Invalid topic %s\n", argv[1]);
+			return CMD_FAILURE;
+		case HELP_IS_COMMANDS:
+			help_commands();
+			return CMD_SUCCESS;
+		case HELP_IS_MODULE:
+			help_module(mod_switch, level);
+			return CMD_SUCCESS;
+		case HELP_IS_BUILTIN:
+			help_builtin(mod_switch, level);
+			return CMD_SUCCESS;
+		}
+	}
+
+	help_survival();
 
 	return CMD_SUCCESS;
Index: uspace/app/bdsh/scli.c
===================================================================
--- uspace/app/bdsh/scli.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/app/bdsh/scli.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -89,7 +89,4 @@
 		exit(EXIT_FAILURE);
 
-	printf("Welcome to %s - %s\nType `help' at any time for usage information.\n",
-		progname, PACKAGE_STRING);
-
 	while (!cli_quit) {
 		get_input(&usr);
Index: uspace/app/getterm/Makefile
===================================================================
--- uspace/app/getterm/Makefile	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/app/getterm/Makefile	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -34,5 +34,6 @@
 SOURCES = \
 	getterm.c \
-	version.c
+	version.c \
+	welcome.c
 
 include $(USPACE_PREFIX)/Makefile.common
Index: uspace/app/getterm/getterm.c
===================================================================
--- uspace/app/getterm/getterm.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/app/getterm/getterm.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -43,4 +43,5 @@
 #include <errno.h>
 #include "version.h"
+#include "welcome.h"
 
 #define APP_NAME  "getterm"
@@ -48,5 +49,5 @@
 static void usage(void)
 {
-	printf("Usage: %s <terminal> <path>\n", APP_NAME);
+	printf("Usage: %s <terminal> [-w] <command> [<arguments...>]\n", APP_NAME);
 }
 
@@ -73,29 +74,41 @@
 }
 
-static task_id_t spawn(const char *fname)
-{
-	task_id_t id;
-	int rc;
-	
-	rc = task_spawnl(&id, fname, fname, NULL);
-	if (rc != EOK) {
-		printf("%s: Error spawning %s (%s)\n", APP_NAME, fname,
-		    str_error(rc));
-		return 0;
-	}
-	
-	return id;
-}
-
 int main(int argc, char *argv[])
 {
-	if (argc < 3) {
+	int rc;
+	task_exit_t texit;
+	int retval;
+	task_id_t id;
+	char *fname, *term;
+	char **cmd_args;
+	bool print_wmsg;
+
+	argv++;
+	argc--;
+	if (argc < 1) {
 		usage();
 		return -1;
 	}
+
+	if (str_cmp(*argv, "-w") == 0) {
+		print_wmsg = true;
+		argv++;
+		argc--;
+	} else {
+		print_wmsg = false;
+	}
+
+	if (argc < 2) {
+		usage();
+		return -1;
+	}
+
+	term = *argv++;
+	fname = *argv;
+	cmd_args = argv;
 	
-	reopen(&stdin, 0, argv[1], O_RDONLY, "r");
-	reopen(&stdout, 1, argv[1], O_WRONLY, "w");
-	reopen(&stderr, 2, argv[1], O_WRONLY, "w");
+	reopen(&stdin, 0, term, O_RDONLY, "r");
+	reopen(&stdout, 1, term, O_WRONLY, "w");
+	reopen(&stderr, 2, term, O_WRONLY, "w");
 	
 	/*
@@ -114,16 +127,23 @@
 		return -4;
 	
-	version_print(argv[1]);
-	task_id_t id = spawn(argv[2]);
-	
-	if (id != 0) {
-		task_exit_t texit;
-		int retval;
-		task_wait(id, &texit, &retval);
-		
-		return 0;
+	version_print(term);
+	if (print_wmsg)
+		welcome_msg_print();
+
+	rc = task_spawnv(&id, fname, (const char * const *) cmd_args);
+	if (rc != EOK) {
+		printf("%s: Error spawning %s (%s)\n", APP_NAME, fname,
+		    str_error(rc));
+		return -5;
 	}
-	
-	return -5;
+
+	rc = task_wait(id, &texit, &retval);
+	if (rc != EOK) {
+		printf("%s: Error waiting for %s (%s)\n", APP_NAME, fname,
+		    str_error(rc));
+		return -6;
+	}
+
+	return 0;
 }
 
Index: uspace/app/getterm/version.c
===================================================================
--- uspace/app/getterm/version.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/app/getterm/version.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -61,5 +61,5 @@
 	printf("HelenOS release %s (%s)%s%s\n", release, name, revision, timestamp);
 	printf("Running on %s (%s)\n", arch, term);
-	printf("Copyright (c) 2001-2009 HelenOS project\n\n");
+	printf("Copyright (c) 2001-2010 HelenOS project\n\n");
 }
 
Index: uspace/app/getterm/welcome.c
===================================================================
--- uspace/app/getterm/welcome.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
+++ uspace/app/getterm/welcome.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2010 Jiri Svoboda
+ * 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 getterm
+ * @{
+ */
+/**
+ * @file
+ */
+
+#include <stdio.h>
+#include "welcome.h"
+
+/** Welcome message and survival tips. */
+void welcome_msg_print(void)
+{
+	printf("Welcome to HelenOS!\n");
+	printf("http://www.helenos.org/\n\n");
+	printf("Type 'help' [Enter] to see a few survival tips.\n\n");
+}
+
+/** @}
+ */
Index: uspace/app/getterm/welcome.h
===================================================================
--- uspace/app/getterm/welcome.h	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
+++ uspace/app/getterm/welcome.h	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2010 Jiri Svoboda
+ * 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 getterm
+ * @{
+ */
+/**
+ * @file
+ */
+
+#ifndef WELCOME_H__
+#define WELCOME_H__
+
+extern void welcome_msg_print(void);
+
+#endif
+
+/** @}
+ */
Index: uspace/app/init/init.c
===================================================================
--- uspace/app/init/init.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/app/init/init.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -185,5 +185,5 @@
 	
 	/* Wait for the input device to be ready */
-	dev_handle_t handle;
+	devmap_handle_t handle;
 	rc = devmap_device_get_handle(dev, &handle, IPC_FLAG_BLOCKING);
 	if (rc != EOK) {
@@ -200,5 +200,5 @@
 }
 
-static void getterm(const char *dev, const char *app)
+static void getterm(const char *dev, const char *app, bool wmsg)
 {
 	char term[DEVMAP_NAME_MAXLEN];
@@ -210,5 +210,5 @@
 	
 	/* Wait for the terminal device to be ready */
-	dev_handle_t handle;
+	devmap_handle_t handle;
 	rc = devmap_device_get_handle(dev, &handle, IPC_FLAG_BLOCKING);
 	if (rc != EOK) {
@@ -218,8 +218,18 @@
 	}
 	
-	rc = task_spawnl(NULL, APP_GETTERM, APP_GETTERM, term, app, NULL);
-	if (rc != EOK) {
-		printf("%s: Error spawning %s %s %s (%s)\n", NAME,
-		    APP_GETTERM, term, app, str_error(rc));
+	if (wmsg) {
+		rc = task_spawnl(NULL, APP_GETTERM, APP_GETTERM, "-w", term,
+		    app, NULL);
+		if (rc != EOK) {
+			printf("%s: Error spawning %s -w %s %s (%s)\n", NAME,
+			    APP_GETTERM, term, app, str_error(rc));
+		}
+	} else {
+		rc = task_spawnl(NULL, APP_GETTERM, APP_GETTERM, term, app,
+		    NULL);
+		if (rc != EOK) {
+			printf("%s: Error spawning %s %s %s (%s)\n", NAME,
+			    APP_GETTERM, term, app, str_error(rc));
+		}
 	}
 }
@@ -295,11 +305,11 @@
 #endif
 	
-	getterm("term/vc0", "/app/bdsh");
-	getterm("term/vc1", "/app/bdsh");
-	getterm("term/vc2", "/app/bdsh");
-	getterm("term/vc3", "/app/bdsh");
-	getterm("term/vc4", "/app/bdsh");
-	getterm("term/vc5", "/app/bdsh");
-	getterm("term/vc6", "/app/klog");
+	getterm("term/vc0", "/app/bdsh", true);
+	getterm("term/vc1", "/app/bdsh", false);
+	getterm("term/vc2", "/app/bdsh", false);
+	getterm("term/vc3", "/app/bdsh", false);
+	getterm("term/vc4", "/app/bdsh", false);
+	getterm("term/vc5", "/app/bdsh", false);
+	getterm("term/vc6", "/app/klog", false);
 	
 	return 0;
Index: uspace/app/mkfat/mkfat.c
===================================================================
--- uspace/app/mkfat/mkfat.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/app/mkfat/mkfat.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -85,5 +85,5 @@
     struct fat_params *par);
 static int fat_blocks_write(struct fat_params const *par,
-    dev_handle_t handle);
+    devmap_handle_t handle);
 static void fat_bootsec_create(struct fat_params const *par, struct fat_bs *bs);
 
@@ -95,5 +95,5 @@
 	int rc;
 	char *dev_path;
-	dev_handle_t handle;
+	devmap_handle_t handle;
 	size_t block_size;
 	char *endptr;
@@ -234,5 +234,5 @@
 
 /** Create file system with the given parameters. */
-static int fat_blocks_write(struct fat_params const *par, dev_handle_t handle)
+static int fat_blocks_write(struct fat_params const *par, devmap_handle_t handle)
 {
 	aoff64_t addr;
Index: uspace/app/netecho/netecho.c
===================================================================
--- uspace/app/netecho/netecho.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/app/netecho/netecho.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -173,4 +173,6 @@
 				} else if (str_lcmp(argv[index] + 2, "count=", 6) == 0) {
 					rc = arg_parse_int(argc, argv, &index, &count, 8);
+					if (rc != EOK)
+						return rc;
 				} else if (str_lcmp(argv[index] + 2, "family=", 7) == 0) {
 					rc = arg_parse_name_int(argc, argv, &index, &family, 9, socket_parse_protocol_family);
Index: uspace/app/netstart/Makefile
===================================================================
--- uspace/app/netstart/Makefile	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/app/netstart/Makefile	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -29,6 +29,6 @@
 
 USPACE_PREFIX = ../..
-LIBS = $(LIBNET_PREFIX)/libnet.a
-EXTRA_CFLAGS = -I$(LIBNET_PREFIX)/include
+LIBS = 
+EXTRA_CFLAGS = 
 
 BINARY = netstart
Index: uspace/app/nettest1/nettest1.c
===================================================================
--- uspace/app/nettest1/nettest1.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/app/nettest1/nettest1.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -287,9 +287,6 @@
 int main(int argc, char *argv[])
 {
-
-	socklen_t max_length;
-	uint8_t *address_data[sizeof(struct sockaddr_in6)];
-	struct sockaddr_in *address_in;
-	struct sockaddr_in6 *address_in6;
+	struct sockaddr_in address_in;
+	struct sockaddr_in6 address_in6;
 	uint8_t *address_start;
 
@@ -300,9 +297,4 @@
 
 	int rc;
-
-	max_length = sizeof(address_data);
-	address = (struct sockaddr *) address_data;
-	address_in = (struct sockaddr_in *) address;
-	address_in6 = (struct sockaddr_in6 *) address;
 
 	sockets = 10;
@@ -334,18 +326,19 @@
 
 	/* Prepare the address buffer */
-	bzero(address_data, max_length);
 
 	switch (family) {
 	case PF_INET:
-		address_in->sin_family = AF_INET;
-		address_in->sin_port = htons(port);
-		address_start = (uint8_t *) &address_in->sin_addr.s_addr;
-		addrlen = sizeof(struct sockaddr_in);
+		address_in.sin_family = AF_INET;
+		address_in.sin_port = htons(port);
+		address = (struct sockaddr *) &address_in;
+		addrlen = sizeof(address_in);
+		address_start = (uint8_t *) &address_in.sin_addr.s_addr;
 		break;
 	case PF_INET6:
-		address_in6->sin6_family = AF_INET6;
-		address_in6->sin6_port = htons(port);
-		address_start = (uint8_t *) &address_in6->sin6_addr.s6_addr;
-		addrlen = sizeof(struct sockaddr_in6);
+		address_in6.sin6_family = AF_INET6;
+		address_in6.sin6_port = htons(port);
+		address = (struct sockaddr *) &address_in6;
+		addrlen = sizeof(address_in6);
+		address_start = (uint8_t *) &address_in6.sin6_addr.s6_addr;
 		break;
 	default:
Index: uspace/app/nettest2/nettest2.c
===================================================================
--- uspace/app/nettest2/nettest2.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/app/nettest2/nettest2.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -223,9 +223,7 @@
 int main(int argc, char *argv[])
 {
-	socklen_t max_length;
-	uint8_t address_data[sizeof(struct sockaddr_in6)];
 	struct sockaddr *address;
-	struct sockaddr_in *address_in;
-	struct sockaddr_in6 *address_in6;
+	struct sockaddr_in address_in;
+	struct sockaddr_in6 address_in6;
 	socklen_t addrlen;
 	uint8_t *address_start;
@@ -247,9 +245,4 @@
 	port = 7;
 
-	max_length = sizeof(address_data);
-	address = (struct sockaddr *) address_data;
-	address_in = (struct sockaddr_in *) address;
-	address_in6 = (struct sockaddr_in6 *) address;
-
 	/*
 	 * Parse the command line arguments.
@@ -279,18 +272,19 @@
 
 	/* Prepare the address buffer */
-	bzero(address_data, max_length);
 
 	switch (family) {
 	case PF_INET:
-		address_in->sin_family = AF_INET;
-		address_in->sin_port = htons(port);
-		address_start = (uint8_t *) &address_in->sin_addr.s_addr;
-		addrlen = sizeof(struct sockaddr_in);
+		address_in.sin_family = AF_INET;
+		address_in.sin_port = htons(port);
+		address = (struct sockaddr *) &address_in;
+		addrlen = sizeof(address_in);
+		address_start = (uint8_t *) &address_in.sin_addr.s_addr;
 		break;
 	case PF_INET6:
-		address_in6->sin6_family = AF_INET6;
-		address_in6->sin6_port = htons(port);
-		address_start = (uint8_t *) &address_in6->sin6_addr.s6_addr;
-		addrlen = sizeof(struct sockaddr_in6);
+		address_in6.sin6_family = AF_INET6;
+		address_in6.sin6_port = htons(port);
+		address = (struct sockaddr *) &address_in6;
+		addrlen = sizeof(address_in6);
+		address_start = (uint8_t *) &address_in6.sin6_addr.s6_addr;
 		break;
 	default:
Index: uspace/app/test_serial/test_serial.c
===================================================================
--- uspace/app/test_serial/test_serial.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/app/test_serial/test_serial.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -69,5 +69,5 @@
 	int res;
 	res = devman_get_phone(DEVMAN_CLIENT, IPC_FLAG_BLOCKING);
-	device_handle_t handle;
+	devman_handle_t handle;
 	
 	res = devman_device_get_handle("/hw/pci0/00:01.0/com1", &handle,
Index: uspace/lib/block/libblock.c
===================================================================
--- uspace/lib/block/libblock.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/lib/block/libblock.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -75,5 +75,5 @@
 typedef struct {
 	link_t link;
-	dev_handle_t dev_handle;
+	devmap_handle_t devmap_handle;
 	int dev_phone;
 	fibril_mutex_t comm_area_lock;
@@ -91,5 +91,5 @@
 static int get_num_blocks(int dev_phone, aoff64_t *nblocks);
 
-static devcon_t *devcon_search(dev_handle_t dev_handle)
+static devcon_t *devcon_search(devmap_handle_t devmap_handle)
 {
 	link_t *cur;
@@ -98,5 +98,5 @@
 	for (cur = dcl_head.next; cur != &dcl_head; cur = cur->next) {
 		devcon_t *devcon = list_get_instance(cur, devcon_t, link);
-		if (devcon->dev_handle == dev_handle) {
+		if (devcon->devmap_handle == devmap_handle) {
 			fibril_mutex_unlock(&dcl_lock);
 			return devcon;
@@ -107,5 +107,5 @@
 }
 
-static int devcon_add(dev_handle_t dev_handle, int dev_phone, size_t bsize,
+static int devcon_add(devmap_handle_t devmap_handle, int dev_phone, size_t bsize,
     void *comm_area, size_t comm_size)
 {
@@ -121,5 +121,5 @@
 	
 	link_initialize(&devcon->link);
-	devcon->dev_handle = dev_handle;
+	devcon->devmap_handle = devmap_handle;
 	devcon->dev_phone = dev_phone;
 	fibril_mutex_initialize(&devcon->comm_area_lock);
@@ -134,5 +134,5 @@
 	for (cur = dcl_head.next; cur != &dcl_head; cur = cur->next) {
 		devcon_t *d = list_get_instance(cur, devcon_t, link);
-		if (d->dev_handle == dev_handle) {
+		if (d->devmap_handle == devmap_handle) {
 			fibril_mutex_unlock(&dcl_lock);
 			free(devcon);
@@ -152,5 +152,5 @@
 }
 
-int block_init(dev_handle_t dev_handle, size_t comm_size)
+int block_init(devmap_handle_t devmap_handle, size_t comm_size)
 {
 	int rc;
@@ -165,5 +165,5 @@
 	}
 
-	dev_phone = devmap_device_connect(dev_handle, IPC_FLAG_BLOCKING);
+	dev_phone = devmap_device_connect(devmap_handle, IPC_FLAG_BLOCKING);
 	if (dev_phone < 0) {
 		munmap(comm_area, comm_size);
@@ -185,5 +185,5 @@
 	}
 	
-	rc = devcon_add(dev_handle, dev_phone, bsize, comm_area, comm_size);
+	rc = devcon_add(devmap_handle, dev_phone, bsize, comm_area, comm_size);
 	if (rc != EOK) {
 		munmap(comm_area, comm_size);
@@ -195,11 +195,11 @@
 }
 
-void block_fini(dev_handle_t dev_handle)
-{
-	devcon_t *devcon = devcon_search(dev_handle);
+void block_fini(devmap_handle_t devmap_handle)
+{
+	devcon_t *devcon = devcon_search(devmap_handle);
 	assert(devcon);
 	
 	if (devcon->cache)
-		(void) block_cache_fini(dev_handle);
+		(void) block_cache_fini(devmap_handle);
 
 	devcon_remove(devcon);
@@ -214,10 +214,10 @@
 }
 
-int block_bb_read(dev_handle_t dev_handle, aoff64_t ba)
+int block_bb_read(devmap_handle_t devmap_handle, aoff64_t ba)
 {
 	void *bb_buf;
 	int rc;
 
-	devcon_t *devcon = devcon_search(dev_handle);
+	devcon_t *devcon = devcon_search(devmap_handle);
 	if (!devcon)
 		return ENOENT;
@@ -244,7 +244,7 @@
 }
 
-void *block_bb_get(dev_handle_t dev_handle)
-{
-	devcon_t *devcon = devcon_search(dev_handle);
+void *block_bb_get(devmap_handle_t devmap_handle)
+{
+	devcon_t *devcon = devcon_search(devmap_handle);
 	assert(devcon);
 	return devcon->bb_buf;
@@ -272,8 +272,8 @@
 };
 
-int block_cache_init(dev_handle_t dev_handle, size_t size, unsigned blocks,
+int block_cache_init(devmap_handle_t devmap_handle, size_t size, unsigned blocks,
     enum cache_mode mode)
 {
-	devcon_t *devcon = devcon_search(dev_handle);
+	devcon_t *devcon = devcon_search(devmap_handle);
 	cache_t *cache;
 	if (!devcon)
@@ -305,7 +305,7 @@
 }
 
-int block_cache_fini(dev_handle_t dev_handle)
-{
-	devcon_t *devcon = devcon_search(dev_handle);
+int block_cache_fini(devmap_handle_t devmap_handle)
+{
+	devcon_t *devcon = devcon_search(devmap_handle);
 	cache_t *cache;
 	int rc;
@@ -374,5 +374,5 @@
  * @param block			Pointer to where the function will store the
  * 				block pointer on success.
- * @param dev_handle		Device handle of the block device.
+ * @param devmap_handle		Device handle of the block device.
  * @param boff			Block offset.
  * @param flags			If BLOCK_FLAGS_NOREAD is specified, block_get()
@@ -382,5 +382,5 @@
  * @return			EOK on success or a negative error code.
  */
-int block_get(block_t **block, dev_handle_t dev_handle, aoff64_t boff, int flags)
+int block_get(block_t **block, devmap_handle_t devmap_handle, aoff64_t boff, int flags)
 {
 	devcon_t *devcon;
@@ -391,5 +391,5 @@
 	int rc;
 	
-	devcon = devcon_search(dev_handle);
+	devcon = devcon_search(devmap_handle);
 
 	assert(devcon);
@@ -500,5 +500,5 @@
 
 		block_initialize(b);
-		b->dev_handle = dev_handle;
+		b->devmap_handle = devmap_handle;
 		b->size = cache->lblock_size;
 		b->boff = boff;
@@ -549,5 +549,5 @@
 int block_put(block_t *block)
 {
-	devcon_t *devcon = devcon_search(block->dev_handle);
+	devcon_t *devcon = devcon_search(block->devmap_handle);
 	cache_t *cache;
 	unsigned blocks_cached;
@@ -645,5 +645,5 @@
 /** Read sequential data from a block device.
  *
- * @param dev_handle	Device handle of the block device.
+ * @param devmap_handle	Device handle of the block device.
  * @param bufpos	Pointer to the first unread valid offset within the
  * 			communication buffer.
@@ -657,5 +657,5 @@
  * @return		EOK on success or a negative return code on failure.
  */
-int block_seqread(dev_handle_t dev_handle, size_t *bufpos, size_t *buflen,
+int block_seqread(devmap_handle_t devmap_handle, size_t *bufpos, size_t *buflen,
     aoff64_t *pos, void *dst, size_t size)
 {
@@ -665,5 +665,5 @@
 	devcon_t *devcon;
 
-	devcon = devcon_search(dev_handle);
+	devcon = devcon_search(devmap_handle);
 	assert(devcon);
 	block_size = devcon->pblock_size;
@@ -711,5 +711,5 @@
 /** Read blocks directly from device (bypass cache).
  *
- * @param dev_handle	Device handle of the block device.
+ * @param devmap_handle	Device handle of the block device.
  * @param ba		Address of first block.
  * @param cnt		Number of blocks.
@@ -718,10 +718,10 @@
  * @return		EOK on success or negative error code on failure.
  */
-int block_read_direct(dev_handle_t dev_handle, aoff64_t ba, size_t cnt, void *buf)
+int block_read_direct(devmap_handle_t devmap_handle, aoff64_t ba, size_t cnt, void *buf)
 {
 	devcon_t *devcon;
 	int rc;
 
-	devcon = devcon_search(dev_handle);
+	devcon = devcon_search(devmap_handle);
 	assert(devcon);
 	
@@ -739,5 +739,5 @@
 /** Write blocks directly to device (bypass cache).
  *
- * @param dev_handle	Device handle of the block device.
+ * @param devmap_handle	Device handle of the block device.
  * @param ba		Address of first block.
  * @param cnt		Number of blocks.
@@ -746,5 +746,5 @@
  * @return		EOK on success or negative error code on failure.
  */
-int block_write_direct(dev_handle_t dev_handle, aoff64_t ba, size_t cnt,
+int block_write_direct(devmap_handle_t devmap_handle, aoff64_t ba, size_t cnt,
     const void *data)
 {
@@ -752,5 +752,5 @@
 	int rc;
 
-	devcon = devcon_search(dev_handle);
+	devcon = devcon_search(devmap_handle);
 	assert(devcon);
 	
@@ -767,14 +767,14 @@
 /** Get device block size.
  *
- * @param dev_handle	Device handle of the block device.
+ * @param devmap_handle	Device handle of the block device.
  * @param bsize		Output block size.
  *
  * @return		EOK on success or negative error code on failure.
  */
-int block_get_bsize(dev_handle_t dev_handle, size_t *bsize)
+int block_get_bsize(devmap_handle_t devmap_handle, size_t *bsize)
 {
 	devcon_t *devcon;
 
-	devcon = devcon_search(dev_handle);
+	devcon = devcon_search(devmap_handle);
 	assert(devcon);
 	
@@ -784,14 +784,14 @@
 /** Get number of blocks on device.
  *
- * @param dev_handle	Device handle of the block device.
+ * @param devmap_handle	Device handle of the block device.
  * @param nblocks	Output number of blocks.
  *
  * @return		EOK on success or negative error code on failure.
  */
-int block_get_nblocks(dev_handle_t dev_handle, aoff64_t *nblocks)
+int block_get_nblocks(devmap_handle_t devmap_handle, aoff64_t *nblocks)
 {
 	devcon_t *devcon;
 
-	devcon = devcon_search(dev_handle);
+	devcon = devcon_search(devmap_handle);
 	assert(devcon);
 	
@@ -818,5 +818,5 @@
 		printf("Error %d reading %d blocks starting at block %" PRIuOFF64
 		    " from device handle %d\n", rc, cnt, ba,
-		    devcon->dev_handle);
+		    devcon->devmap_handle);
 #ifndef NDEBUG
 		stacktrace_print();
@@ -844,5 +844,5 @@
 	if (rc != EOK) {
 		printf("Error %d writing %d blocks starting at block %" PRIuOFF64
-		    " to device handle %d\n", rc, cnt, ba, devcon->dev_handle);
+		    " to device handle %d\n", rc, cnt, ba, devcon->devmap_handle);
 #ifndef NDEBUG
 		stacktrace_print();
Index: uspace/lib/block/libblock.h
===================================================================
--- uspace/lib/block/libblock.h	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/lib/block/libblock.h	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -72,5 +72,5 @@
 	fibril_rwlock_t contents_lock;
 	/** Handle of the device where the block resides. */
-	dev_handle_t dev_handle;
+	devmap_handle_t devmap_handle;
 	/** Block offset on the block device. Counted in 'size'-byte blocks. */
 	aoff64_t boff;
@@ -93,23 +93,23 @@
 };
 
-extern int block_init(dev_handle_t, size_t);
-extern void block_fini(dev_handle_t);
+extern int block_init(devmap_handle_t, size_t);
+extern void block_fini(devmap_handle_t);
 
-extern int block_bb_read(dev_handle_t, aoff64_t);
-extern void *block_bb_get(dev_handle_t);
+extern int block_bb_read(devmap_handle_t, aoff64_t);
+extern void *block_bb_get(devmap_handle_t);
 
-extern int block_cache_init(dev_handle_t, size_t, unsigned, enum cache_mode);
-extern int block_cache_fini(dev_handle_t);
+extern int block_cache_init(devmap_handle_t, size_t, unsigned, enum cache_mode);
+extern int block_cache_fini(devmap_handle_t);
 
-extern int block_get(block_t **, dev_handle_t, aoff64_t, int);
+extern int block_get(block_t **, devmap_handle_t, aoff64_t, int);
 extern int block_put(block_t *);
 
-extern int block_seqread(dev_handle_t, size_t *, size_t *, aoff64_t *, void *,
+extern int block_seqread(devmap_handle_t, size_t *, size_t *, aoff64_t *, void *,
     size_t);
 
-extern int block_get_bsize(dev_handle_t, size_t *);
-extern int block_get_nblocks(dev_handle_t, aoff64_t *);
-extern int block_read_direct(dev_handle_t, aoff64_t, size_t, void *);
-extern int block_write_direct(dev_handle_t, aoff64_t, size_t, const void *);
+extern int block_get_bsize(devmap_handle_t, size_t *);
+extern int block_get_nblocks(devmap_handle_t, aoff64_t *);
+extern int block_read_direct(devmap_handle_t, aoff64_t, size_t, void *);
+extern int block_write_direct(devmap_handle_t, aoff64_t, size_t, const void *);
 
 #endif
Index: uspace/lib/c/generic/adt/measured_strings.c
===================================================================
--- uspace/lib/c/generic/adt/measured_strings.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/lib/c/generic/adt/measured_strings.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -41,5 +41,4 @@
 #include <unistd.h>
 #include <errno.h>
-#include <err.h>
 #include <async.h>
 
@@ -135,6 +134,4 @@
     size_t count)
 {
-	ERROR_DECLARE;
-
 	size_t *lengths;
 	size_t index;
@@ -142,4 +139,5 @@
 	char *next;
 	ipc_callid_t callid;
+	int rc;
 
 	if ((!strings) || (!data) || (count <= 0))
@@ -155,8 +153,8 @@
 		return EINVAL;
 	}
-	if (ERROR_OCCURRED(async_data_write_finalize(callid, lengths,
-	    length))) {
-		free(lengths);
-		return ERROR_CODE;
+	rc = async_data_write_finalize(callid, lengths, length);
+	if (rc != EOK) {
+		free(lengths);
+		return rc;
 	}
 
@@ -187,10 +185,11 @@
 				return EINVAL;
 			}
-			if (ERROR_OCCURRED(async_data_write_finalize(callid,
-			    next, lengths[index]))) {
+			rc = async_data_write_finalize(callid, next,
+			    lengths[index]);
+			if (rc != EOK) {
 				free(*data);
 				free(*strings);
 				free(lengths);
-				return ERROR_CODE;
+				return rc;
 			}
 			(*strings)[index].value = next;
@@ -251,10 +250,9 @@
 int measured_strings_reply(const measured_string_ref strings, size_t count)
 {
-	ERROR_DECLARE;
-
 	size_t *lengths;
 	size_t index;
 	size_t length;
 	ipc_callid_t callid;
+	int rc;
 
 	if ((!strings) || (count <= 0))
@@ -270,7 +268,8 @@
 		return EINVAL;
 	}
-	if (ERROR_OCCURRED(async_data_read_finalize(callid, lengths, length))) {
-		free(lengths);
-		return ERROR_CODE;
+	rc = async_data_read_finalize(callid, lengths, length);
+	if (rc != EOK) {
+		free(lengths);
+		return rc;
 	}
 	free(lengths);
@@ -282,6 +281,8 @@
 				return EINVAL;
 			}
-			ERROR_PROPAGATE(async_data_read_finalize(callid,
-			    strings[index].value, strings[index].length));
+			rc = async_data_read_finalize(callid,
+			    strings[index].value, strings[index].length);
+			if (rc != EOK)
+				return rc;
 		}
 	}
@@ -313,9 +314,8 @@
     size_t count)
 {
-	ERROR_DECLARE;
-
 	size_t *lengths;
 	size_t index;
 	char *next;
+	int rc;
 
 	if ((phone < 0) || (!strings) || (!data) || (count <= 0))
@@ -326,8 +326,9 @@
 		return ENOMEM;
 
-	if (ERROR_OCCURRED(async_data_read_start(phone, lengths,
-	    sizeof(size_t) * (count + 1)))) {
-		free(lengths);
-		return ERROR_CODE;
+	rc = async_data_read_start(phone, lengths,
+	    sizeof(size_t) * (count + 1));
+	if (rc != EOK) {
+		free(lengths);
+		return rc;
 	}
 
@@ -350,10 +351,10 @@
 		(*strings)[index].length = lengths[index];
 		if (lengths[index] > 0) {
-			if (ERROR_OCCURRED(async_data_read_start(phone, next,
-			    lengths[index]))) {
+			rc = async_data_read_start(phone, next, lengths[index]);
+			if (rc != EOK) {
 			    	free(lengths);
 				free(data);
 				free(strings);
-				return ERROR_CODE;
+				return rc;
 			}
 			(*strings)[index].value = next;
@@ -387,8 +388,7 @@
     size_t count)
 {
-	ERROR_DECLARE;
-
 	size_t *lengths;
 	size_t index;
+	int rc;
 
 	if ((phone < 0) || (!strings) || (count <= 0))
@@ -399,8 +399,9 @@
 		return ENOMEM;
 
-	if (ERROR_OCCURRED(async_data_write_start(phone, lengths,
-	    sizeof(size_t) * (count + 1)))) {
-		free(lengths);
-		return ERROR_CODE;
+	rc = async_data_write_start(phone, lengths,
+	    sizeof(size_t) * (count + 1));
+	if (rc != EOK) {
+		free(lengths);
+		return rc;
 	}
 
@@ -409,6 +410,8 @@
 	for (index = 0; index < count; index++) {
 		if (strings[index].length > 0) {
-			ERROR_PROPAGATE(async_data_write_start(phone,
-			    strings[index].value, strings[index].length));
+			rc = async_data_write_start(phone, strings[index].value,
+			    strings[index].length);
+			if (rc != EOK)
+				return rc;
 		}
 	}
Index: uspace/lib/c/generic/devman.c
===================================================================
--- uspace/lib/c/generic/devman.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/lib/c/generic/devman.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -141,5 +141,5 @@
 
 int devman_child_device_register(
-	const char *name, match_id_list_t *match_ids, device_handle_t parent_handle, device_handle_t *handle)
+	const char *name, match_id_list_t *match_ids, devman_handle_t parent_handle, devman_handle_t *handle)
 {		
 	int phone = devman_get_phone(DEVMAN_DRIVER, IPC_FLAG_BLOCKING);
@@ -180,5 +180,5 @@
 }
 
-int devman_add_device_to_class(device_handle_t dev_handle, const char *class_name)
+int devman_add_device_to_class(devman_handle_t devman_handle, const char *class_name)
 {
 	int phone = devman_get_phone(DEVMAN_DRIVER, IPC_FLAG_BLOCKING);
@@ -189,5 +189,5 @@
 	async_serialize_start();
 	ipc_call_t answer;
-	aid_t req = async_send_1(phone, DEVMAN_ADD_DEVICE_TO_CLASS, dev_handle, &answer);
+	aid_t req = async_send_1(phone, DEVMAN_ADD_DEVICE_TO_CLASS, devman_handle, &answer);
 	
 	ipcarg_t retval = async_data_write_start(phone, class_name, str_size(class_name));
@@ -224,5 +224,5 @@
 }
 
-int devman_device_connect(device_handle_t handle, unsigned int flags)
+int devman_device_connect(devman_handle_t handle, unsigned int flags)
 {
 	int phone;
@@ -239,5 +239,5 @@
 }
 
-int devman_parent_device_connect(device_handle_t handle, unsigned int flags)
+int devman_parent_device_connect(devman_handle_t handle, unsigned int flags)
 {
 	int phone;
@@ -254,5 +254,5 @@
 }
 
-int devman_device_get_handle(const char *pathname, device_handle_t *handle, unsigned int flags)
+int devman_device_get_handle(const char *pathname, devman_handle_t *handle, unsigned int flags)
 {
 	int phone = devman_get_phone(DEVMAN_CLIENT, flags);
@@ -280,10 +280,10 @@
 	if (retval != EOK) {
 		if (handle != NULL)
-			*handle = (device_handle_t) -1;
+			*handle = (devman_handle_t) -1;
 		return retval;
 	}
 	
 	if (handle != NULL)
-		*handle = (device_handle_t) IPC_GET_ARG1(answer);
+		*handle = (devman_handle_t) IPC_GET_ARG1(answer);
 	
 	return retval;
Index: uspace/lib/c/generic/devmap.c
===================================================================
--- uspace/lib/c/generic/devmap.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/lib/c/generic/devmap.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -132,5 +132,5 @@
  *
  */
-int devmap_device_register(const char *fqdn, dev_handle_t *handle)
+int devmap_device_register(const char *fqdn, devmap_handle_t *handle)
 {
 	int phone = devmap_get_phone(DEVMAP_DRIVER, IPC_FLAG_BLOCKING);
@@ -163,10 +163,10 @@
 	
 	if (handle != NULL)
-		*handle = (dev_handle_t) IPC_GET_ARG1(answer);
+		*handle = (devmap_handle_t) IPC_GET_ARG1(answer);
 	
 	return retval;
 }
 
-int devmap_device_get_handle(const char *fqdn, dev_handle_t *handle, unsigned int flags)
+int devmap_device_get_handle(const char *fqdn, devmap_handle_t *handle, unsigned int flags)
 {
 	int phone = devmap_get_phone(DEVMAP_CLIENT, flags);
@@ -194,15 +194,15 @@
 	if (retval != EOK) {
 		if (handle != NULL)
-			*handle = (dev_handle_t) -1;
+			*handle = (devmap_handle_t) -1;
 		return retval;
 	}
 	
 	if (handle != NULL)
-		*handle = (dev_handle_t) IPC_GET_ARG1(answer);
+		*handle = (devmap_handle_t) IPC_GET_ARG1(answer);
 	
 	return retval;
 }
 
-int devmap_namespace_get_handle(const char *name, dev_handle_t *handle, unsigned int flags)
+int devmap_namespace_get_handle(const char *name, devmap_handle_t *handle, unsigned int flags)
 {
 	int phone = devmap_get_phone(DEVMAP_CLIENT, flags);
@@ -230,15 +230,15 @@
 	if (retval != EOK) {
 		if (handle != NULL)
-			*handle = (dev_handle_t) -1;
+			*handle = (devmap_handle_t) -1;
 		return retval;
 	}
 	
 	if (handle != NULL)
-		*handle = (dev_handle_t) IPC_GET_ARG1(answer);
+		*handle = (devmap_handle_t) IPC_GET_ARG1(answer);
 	
 	return retval;
 }
 
-devmap_handle_type_t devmap_handle_probe(dev_handle_t handle)
+devmap_handle_type_t devmap_handle_probe(devmap_handle_t handle)
 {
 	int phone = devmap_get_phone(DEVMAP_CLIENT, IPC_FLAG_BLOCKING);
@@ -255,5 +255,5 @@
 }
 
-int devmap_device_connect(dev_handle_t handle, unsigned int flags)
+int devmap_device_connect(devmap_handle_t handle, unsigned int flags)
 {
 	int phone;
@@ -305,5 +305,5 @@
 }
 
-static size_t devmap_count_devices_internal(int phone, dev_handle_t ns_handle)
+static size_t devmap_count_devices_internal(int phone, devmap_handle_t ns_handle)
 {
 	ipcarg_t count;
@@ -325,5 +325,5 @@
 }
 
-size_t devmap_count_devices(dev_handle_t ns_handle)
+size_t devmap_count_devices(devmap_handle_t ns_handle)
 {
 	int phone = devmap_get_phone(DEVMAP_CLIENT, IPC_FLAG_BLOCKING);
@@ -387,5 +387,5 @@
 }
 
-size_t devmap_get_devices(dev_handle_t ns_handle, dev_desc_t **data)
+size_t devmap_get_devices(devmap_handle_t ns_handle, dev_desc_t **data)
 {
 	int phone = devmap_get_phone(DEVMAP_CLIENT, IPC_FLAG_BLOCKING);
Index: uspace/lib/c/generic/net/modules.c
===================================================================
--- uspace/lib/c/generic/net/modules.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/lib/c/generic/net/modules.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -41,5 +41,5 @@
 #include <async.h>
 #include <malloc.h>
-#include <err.h>
+#include <errno.h>
 #include <sys/time.h>
 
@@ -137,5 +137,5 @@
     ipcarg_t arg3, async_client_conn_t client_receiver, suseconds_t timeout)
 {
-	ERROR_DECLARE;
+	int rc;
 	
 	/* Connect to the needed service */
@@ -144,8 +144,9 @@
 		/* Request the bidirectional connection */
 		ipcarg_t phonehash;
-		if (ERROR_OCCURRED(ipc_connect_to_me(phone, arg1, arg2, arg3,
-		    &phonehash))) {
+		
+		rc = ipc_connect_to_me(phone, arg1, arg2, arg3, &phonehash);
+		if (rc != EOK) {
 			ipc_hangup(phone);
-			return ERROR_CODE;
+			return rc;
 		}
 		async_new_connection(phonehash, 0, NULL, client_receiver);
@@ -212,7 +213,6 @@
 int data_receive(void **data, size_t *length)
 {
-	ERROR_DECLARE;
-
 	ipc_callid_t callid;
+	int rc;
 
 	if (!data || !length)
@@ -229,7 +229,8 @@
 
 	// fetch the data
-	if (ERROR_OCCURRED(async_data_write_finalize(callid, *data, *length))) {
+	rc = async_data_write_finalize(callid, *data, *length);
+	if (rc != EOK) {
 		free(data);
-		return ERROR_CODE;
+		return rc;
 	}
 
Index: uspace/lib/c/generic/net/packet.c
===================================================================
--- uspace/lib/c/generic/net/packet.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/lib/c/generic/net/packet.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -41,5 +41,4 @@
 #include <unistd.h>
 #include <errno.h>
-#include <err.h>
 
 #include <sys/mman.h>
@@ -91,11 +90,13 @@
 int pm_init(void)
 {
-	ERROR_DECLARE;
+	int rc;
 
 	fibril_rwlock_initialize(&pm_globals.lock);
+	
 	fibril_rwlock_write_lock(&pm_globals.lock);
-	ERROR_PROPAGATE(gpm_initialize(&pm_globals.packet_map));
+	rc = gpm_initialize(&pm_globals.packet_map);
 	fibril_rwlock_write_unlock(&pm_globals.lock);
-	return EOK;
+	
+	return rc;
 }
 
@@ -139,7 +140,6 @@
 int pm_add(packet_t packet)
 {
-	ERROR_DECLARE;
-
 	packet_map_ref map;
+	int rc;
 
 	if (!packet_is_valid(packet))
@@ -160,9 +160,9 @@
 			}
 			bzero(map, sizeof(packet_map_t));
-			if ((ERROR_CODE =
-			    gpm_add(&pm_globals.packet_map, map)) < 0) {
+			rc = gpm_add(&pm_globals.packet_map, map);
+			if (rc < 0) {
 				fibril_rwlock_write_unlock(&pm_globals.lock);
 				free(map);
-				return ERROR_CODE;
+				return rc;
 			}
 		} while (PACKET_MAP_PAGE(packet->packet_id) >=
Index: uspace/lib/c/generic/net/socket_client.c
===================================================================
--- uspace/lib/c/generic/net/socket_client.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/lib/c/generic/net/socket_client.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -43,5 +43,4 @@
 #include <stdlib.h>
 #include <errno.h>
-#include <err.h>
 
 #include <ipc/services.h>
@@ -212,9 +211,8 @@
 static void socket_connection(ipc_callid_t iid, ipc_call_t * icall)
 {
-	ERROR_DECLARE;
-
 	ipc_callid_t callid;
 	ipc_call_t call;
 	socket_ref socket;
+	int rc;
 
 loop:
@@ -231,5 +229,5 @@
 		    SOCKET_GET_SOCKET_ID(call));
 		if (!socket) {
-			ERROR_CODE = ENOTSOCK;
+			rc = ENOTSOCK;
 			fibril_rwlock_read_unlock(&socket_globals.lock);
 			break;
@@ -240,7 +238,8 @@
 			fibril_mutex_lock(&socket->receive_lock);
 			// push the number of received packet fragments
-			if (!ERROR_OCCURRED(dyn_fifo_push(&socket->received,
+			rc = dyn_fifo_push(&socket->received,
 			    SOCKET_GET_DATA_FRAGMENTS(call),
-			    SOCKET_MAX_RECEIVED_SIZE))) {
+			    SOCKET_MAX_RECEIVED_SIZE);
+			if (rc == EOK) {
 				// signal the received packet
 				fibril_condvar_signal(&socket->receive_signal);
@@ -252,6 +251,7 @@
 			// push the new socket identifier
 			fibril_mutex_lock(&socket->accept_lock);
-			if (!ERROR_OCCURRED(dyn_fifo_push(&socket->accepted,
-			    1, SOCKET_MAX_ACCEPTED_SIZE))) {
+			rc = dyn_fifo_push(&socket->accepted, 1,
+			    SOCKET_MAX_ACCEPTED_SIZE);
+			if (rc == EOK) {
 				// signal the accepted socket
 				fibril_condvar_signal(&socket->accept_signal);
@@ -261,5 +261,5 @@
 
 		default:
-			ERROR_CODE = ENOTSUP;
+			rc = ENOTSUP;
 		}
 
@@ -280,8 +280,8 @@
 
 	default:
-		ERROR_CODE = ENOTSUP;
-	}
-
-	ipc_answer_0(callid, (ipcarg_t) ERROR_CODE);
+		rc = ENOTSUP;
+	}
+
+	ipc_answer_0(callid, (ipcarg_t) rc);
 	goto loop;
 }
@@ -405,6 +405,4 @@
 int socket(int domain, int type, int protocol)
 {
-	ERROR_DECLARE;
-
 	socket_ref socket;
 	int phone;
@@ -413,4 +411,5 @@
 	ipcarg_t fragment_size;
 	ipcarg_t header_size;
+	int rc;
 
 	// find the appropriate service
@@ -479,9 +478,10 @@
 	}
 
-	if (ERROR_OCCURRED((int) async_req_3_3(phone, NET_SOCKET, socket_id, 0,
-	    service, NULL, &fragment_size, &header_size))) {
+	rc = (int) async_req_3_3(phone, NET_SOCKET, socket_id, 0, service, NULL,
+	    &fragment_size, &header_size);
+	if (rc != EOK) {
 		fibril_rwlock_write_unlock(&socket_globals.lock);
 		free(socket);
-		return ERROR_CODE;
+		return rc;
 	}
 
@@ -492,8 +492,8 @@
 	socket_initialize(socket, socket_id, phone, service);
 	// store the new socket
-	ERROR_CODE = sockets_add(socket_get_sockets(), socket_id, socket);
+	rc = sockets_add(socket_get_sockets(), socket_id, socket);
 
 	fibril_rwlock_write_unlock(&socket_globals.lock);
-	if (ERROR_CODE < 0) {
+	if (rc < 0) {
 		dyn_fifo_destroy(&socket->received);
 		dyn_fifo_destroy(&socket->accepted);
@@ -501,5 +501,5 @@
 		async_msg_3(phone, NET_SOCKET_CLOSE, (ipcarg_t) socket_id, 0,
 		    service);
-		return ERROR_CODE;
+		return rc;
 	}
 
@@ -770,7 +770,6 @@
 int closesocket(int socket_id)
 {
-	ERROR_DECLARE;
-
 	socket_ref socket;
+	int rc;
 
 	fibril_rwlock_write_lock(&socket_globals.lock);
@@ -787,6 +786,10 @@
 
 	// request close
-	ERROR_PROPAGATE((int) async_req_3_0(socket->phone, NET_SOCKET_CLOSE,
-	    (ipcarg_t) socket->socket_id, 0, socket->service));
+	rc = (int) async_req_3_0(socket->phone, NET_SOCKET_CLOSE,
+	    (ipcarg_t) socket->socket_id, 0, socket->service);
+	if (rc != EOK) {
+		fibril_rwlock_write_unlock(&socket_globals.lock);
+		return rc;
+	}
 	// free the socket structure
 	socket_destroy(socket);
Index: uspace/lib/c/generic/vfs/vfs.c
===================================================================
--- uspace/lib/c/generic/vfs/vfs.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/lib/c/generic/vfs/vfs.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -136,6 +136,6 @@
 	}
 	
-	dev_handle_t dev_handle;
-	int res = devmap_device_get_handle(fqdn, &dev_handle, flags);
+	devmap_handle_t devmap_handle;
+	int res = devmap_device_get_handle(fqdn, &devmap_handle, flags);
 	if (res != EOK) {
 		if (null_id != -1)
@@ -159,5 +159,5 @@
 	
 	ipcarg_t rc_orig;
-	aid_t req = async_send_2(vfs_phone, VFS_IN_MOUNT, dev_handle, flags, NULL);
+	aid_t req = async_send_2(vfs_phone, VFS_IN_MOUNT, devmap_handle, flags, NULL);
 	ipcarg_t rc = async_data_write_start(vfs_phone, (void *) mpa, mpa_size);
 	if (rc != EOK) {
@@ -328,5 +328,5 @@
 	ipc_call_t answer;
 	aid_t req = async_send_4(vfs_phone, VFS_IN_OPEN_NODE, node->fs_handle,
-	    node->dev_handle, node->index, oflag, &answer);
+	    node->devmap_handle, node->index, oflag, &answer);
 	
 	ipcarg_t rc;
@@ -797,5 +797,5 @@
 	if (rc == EOK) {
 		node->fs_handle = stat.fs_handle;
-		node->dev_handle = stat.dev_handle;
+		node->devmap_handle = stat.devmap_handle;
 		node->index = stat.index;
 	}
Index: uspace/lib/c/include/adt/generic_char_map.h
===================================================================
--- uspace/lib/c/include/adt/generic_char_map.h	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/lib/c/include/adt/generic_char_map.h	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -40,5 +40,4 @@
 #include <unistd.h>
 #include <errno.h>
-#include <err.h>
 
 #include <adt/char_map.h>
@@ -85,5 +84,5 @@
 	     type *value) \
 	{ \
-		ERROR_DECLARE; \
+		int rc; \
 		int index; \
 		if (!name##_is_valid(map)) \
@@ -92,8 +91,8 @@
 		if (index < 0) \
 			return index; \
-		if (ERROR_OCCURRED(char_map_add(&map->names, name, length, \
-		    index))) { \
+		rc = char_map_add(&map->names, name, length, index); \
+		if (rc != EOK) { \
 			name##_items_exclude_index(&map->values, index); \
-			return ERROR_CODE; \
+			return rc; \
 		} \
 		return EOK; \
@@ -141,11 +140,14 @@
 	int name##_initialize(name##_ref map) \
 	{ \
-		ERROR_DECLARE; \
+		int rc; \
 		if (!map) \
 			return EINVAL; \
-		ERROR_PROPAGATE(char_map_initialize(&map->names)); \
-		if (ERROR_OCCURRED(name##_items_initialize(&map->values))) { \
+		rc = char_map_initialize(&map->names); \
+		if (rc != EOK) \
+			return rc; \
+		rc = name##_items_initialize(&map->values); \
+		if (rc != EOK) { \
 			char_map_destroy(&map->names); \
-			return ERROR_CODE; \
+			return rc; \
 		} \
 		map->magic = GENERIC_CHAR_MAP_MAGIC_VALUE; \
Index: uspace/lib/c/include/devman.h
===================================================================
--- uspace/lib/c/include/devman.h	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/lib/c/include/devman.h	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -42,16 +42,18 @@
 
 
-int devman_get_phone(devman_interface_t, unsigned int);
-void devman_hangup_phone(devman_interface_t iface);
+extern int devman_get_phone(devman_interface_t, unsigned int);
+extern void devman_hangup_phone(devman_interface_t);
 
-int devman_driver_register(const char *, async_client_conn_t);
-int devman_child_device_register(const char *, match_id_list_t *, device_handle_t, device_handle_t *);
+extern int devman_driver_register(const char *, async_client_conn_t);
+extern int devman_child_device_register(const char *, match_id_list_t *,
+    devman_handle_t, devman_handle_t *);
 
-int devman_device_connect(device_handle_t handle, unsigned int flags);
-int devman_parent_device_connect(device_handle_t handle, unsigned int flags);
+extern int devman_device_connect(devman_handle_t, unsigned int);
+extern int devman_parent_device_connect(devman_handle_t, unsigned int);
 
-int devman_device_get_handle(const char *pathname, device_handle_t *handle, unsigned int flags);
+extern int devman_device_get_handle(const char *, devman_handle_t *,
+    unsigned int);
 
-int devman_add_device_to_class(device_handle_t dev_handle, const char *class_name);
+extern int devman_add_device_to_class(devman_handle_t, const char *);
 
 #endif
Index: uspace/lib/c/include/devmap.h
===================================================================
--- uspace/lib/c/include/devmap.h	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/lib/c/include/devmap.h	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -44,11 +44,11 @@
 
 extern int devmap_driver_register(const char *, async_client_conn_t);
-extern int devmap_device_register(const char *, dev_handle_t *);
+extern int devmap_device_register(const char *, devmap_handle_t *);
 
-extern int devmap_device_get_handle(const char *, dev_handle_t *, unsigned int);
-extern int devmap_namespace_get_handle(const char *, dev_handle_t *, unsigned int);
-extern devmap_handle_type_t devmap_handle_probe(dev_handle_t);
+extern int devmap_device_get_handle(const char *, devmap_handle_t *, unsigned int);
+extern int devmap_namespace_get_handle(const char *, devmap_handle_t *, unsigned int);
+extern devmap_handle_type_t devmap_handle_probe(devmap_handle_t);
 
-extern int devmap_device_connect(dev_handle_t, unsigned int);
+extern int devmap_device_connect(devmap_handle_t, unsigned int);
 
 extern int devmap_null_create(void);
@@ -56,8 +56,8 @@
 
 extern size_t devmap_count_namespaces(void);
-extern size_t devmap_count_devices(dev_handle_t);
+extern size_t devmap_count_devices(devmap_handle_t);
 
 extern size_t devmap_get_namespaces(dev_desc_t **);
-extern size_t devmap_get_devices(dev_handle_t, dev_desc_t **);
+extern size_t devmap_get_devices(devmap_handle_t, dev_desc_t **);
 
 #endif
Index: uspace/lib/c/include/err.h
===================================================================
--- uspace/lib/c/include/err.h	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/lib/c/include/err.h	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -37,9 +37,4 @@
 
 #include <stdio.h>
-#include <errno.h>
-
-#ifdef CONFIG_DEBUG
-#include <str_error.h>
-#endif
 
 #define errx(status, fmt, ...) { \
@@ -48,54 +43,7 @@
 }
 
-
-/** An actual stored error code.  */
-#define ERROR_CODE  error_check_return_value
-
-/** An error processing routines declaration.
- *
- * This has to be declared in the block where the error processing
- * is desired.
- */
-#define ERROR_DECLARE  int ERROR_CODE
-
-/** Store the value as an error code and checks if an error occurred.
- *
- * @param[in] value	The value to be checked. May be a function call.
- * @return		False if the value indicates success (EOK).
- * @return		True otherwise.
- */
-#ifdef CONFIG_DEBUG
-
-#define ERROR_OCCURRED(value) \
-	(((ERROR_CODE = (value)) != EOK) && \
-	({ \
-		fprintf(stderr, "libsocket error at %s:%d (%s)\n", \
-		__FILE__, __LINE__, str_error(ERROR_CODE)); \
-		1; \
-	}))
-
-#else
-
-#define ERROR_OCCURRED(value)	((ERROR_CODE = (value)) != EOK)
-
-#endif
-
-#define ERROR_NONE(value)	!ERROR_OCCURRED((value))
-
-/** Error propagation
- *
- * Check if an error occurred and immediately exit the actual
- * function returning the error code.
- *
- * @param[in] value	The value to be checked. May be a function call.
- *
- */
-
-#define ERROR_PROPAGATE(value) \
-	if (ERROR_OCCURRED(value)) \
-		return ERROR_CODE
-
 #endif
 
 /** @}
  */
+
Index: uspace/lib/c/include/ipc/devman.h
===================================================================
--- uspace/lib/c/include/ipc/devman.h	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/lib/c/include/ipc/devman.h	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -42,5 +42,5 @@
 #define DEVMAN_NAME_MAXLEN 256
 
-typedef ipcarg_t device_handle_t;
+typedef ipcarg_t devman_handle_t;
 
 /** Ids of device models used for device-to-driver matching.
Index: uspace/lib/c/include/ipc/devmap.h
===================================================================
--- uspace/lib/c/include/ipc/devmap.h	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/lib/c/include/ipc/devmap.h	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -40,5 +40,5 @@
 #define DEVMAP_NAME_MAXLEN  255
 
-typedef ipcarg_t dev_handle_t;
+typedef ipcarg_t devmap_handle_t;
 
 typedef enum {
@@ -81,5 +81,5 @@
 
 typedef struct {
-	dev_handle_t handle;
+	devmap_handle_t handle;
 	char name[DEVMAP_NAME_MAXLEN + 1];
 } dev_desc_t;
Index: pace/lib/c/include/ipc/serial.h
===================================================================
--- uspace/lib/c/include/ipc/serial.h	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ 	(revision )
@@ -1,14 +1,0 @@
-#ifndef LIBC_FB_H_
-#define LIBC_FB_H_
-
-#include <ipc/ipc.h>
-
-typedef enum {
-	SERIAL_PUTCHAR = IPC_FIRST_USER_METHOD,
-	SERIAL_GETCHAR,
-	SERIAL_READ,
-	SERIAL_WRITE,
-} serial_request_t;
-
-
-#endif
Index: uspace/lib/c/include/stdio.h
===================================================================
--- uspace/lib/c/include/stdio.h	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/lib/c/include/stdio.h	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -46,5 +46,5 @@
 #define BUFSIZ  4096
 
-#define DEBUG(fmt, ...)se\
+#define DEBUG(fmt, ...) \
 	{ \
 		char _buf[256]; \
Index: uspace/lib/c/include/sys/stat.h
===================================================================
--- uspace/lib/c/include/sys/stat.h	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/lib/c/include/sys/stat.h	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -43,5 +43,5 @@
 struct stat {
 	fs_handle_t fs_handle;
-	dev_handle_t dev_handle;
+	devmap_handle_t devmap_handle;
 	fs_index_t index;
 	unsigned int lnkcnt;
@@ -49,5 +49,5 @@
 	bool is_directory;
 	aoff64_t size;
-	dev_handle_t device;
+	devmap_handle_t device;
 };
 
Index: uspace/lib/c/include/unistd.h
===================================================================
--- uspace/lib/c/include/unistd.h	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/lib/c/include/unistd.h	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -41,5 +41,5 @@
 
 #ifndef NULL
-	#define NULL  0
+	#define NULL  0UL
 #endif
 
Index: uspace/lib/c/include/vfs/vfs.h
===================================================================
--- uspace/lib/c/include/vfs/vfs.h	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/lib/c/include/vfs/vfs.h	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -47,5 +47,5 @@
 typedef struct {
 	fs_handle_t fs_handle;
-	dev_handle_t dev_handle;
+	devmap_handle_t devmap_handle;
 	fs_index_t index;
 } fdi_node_t;
Index: uspace/lib/drv/generic/driver.c
===================================================================
--- uspace/lib/drv/generic/driver.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/lib/drv/generic/driver.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -139,5 +139,5 @@
 }
 
-static device_t * driver_get_device(link_t *devices, device_handle_t handle)
+static device_t * driver_get_device(link_t *devices, devman_handle_t handle)
 {
 	device_t *dev = NULL;
@@ -163,5 +163,5 @@
 	int res = EOK;
 	
-	device_handle_t dev_handle =  IPC_GET_ARG1(*icall);
+	devman_handle_t dev_handle =  IPC_GET_ARG1(*icall);
 	device_t *dev = create_device();
 	dev->handle = dev_handle;
@@ -221,5 +221,5 @@
 	 * the device to which the client connected.
 	 */
-	device_handle_t handle = IPC_GET_ARG2(*icall);
+	devman_handle_t handle = IPC_GET_ARG2(*icall);
 	device_t *dev = driver_get_device(&devices, handle);
 
Index: uspace/lib/drv/include/driver.h
===================================================================
--- uspace/lib/drv/include/driver.h	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/lib/drv/include/driver.h	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -118,5 +118,5 @@
 	 * device manager).
 	 */
-	device_handle_t handle;
+	devman_handle_t handle;
 	
 	/**
Index: uspace/lib/fs/libfs.c
===================================================================
--- uspace/lib/fs/libfs.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/lib/fs/libfs.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -150,8 +150,8 @@
     ipc_call_t *request)
 {
-	dev_handle_t mp_dev_handle = (dev_handle_t) IPC_GET_ARG1(*request);
+	devmap_handle_t mp_devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
 	fs_index_t mp_fs_index = (fs_index_t) IPC_GET_ARG2(*request);
 	fs_handle_t mr_fs_handle = (fs_handle_t) IPC_GET_ARG3(*request);
-	dev_handle_t mr_dev_handle = (dev_handle_t) IPC_GET_ARG4(*request);
+	devmap_handle_t mr_devmap_handle = (devmap_handle_t) IPC_GET_ARG4(*request);
 	int res;
 	ipcarg_t rc;
@@ -174,5 +174,5 @@
 	
 	fs_node_t *fn;
-	res = ops->node_get(&fn, mp_dev_handle, mp_fs_index);
+	res = ops->node_get(&fn, mp_devmap_handle, mp_fs_index);
 	if ((res != EOK) || (!fn)) {
 		ipc_hangup(mountee_phone);
@@ -201,10 +201,10 @@
 	ipc_call_t answer;
 	rc = async_data_write_forward_1_1(mountee_phone, VFS_OUT_MOUNTED,
-	    mr_dev_handle, &answer);
+	    mr_devmap_handle, &answer);
 	
 	if (rc == EOK) {
 		fn->mp_data.mp_active = true;
 		fn->mp_data.fs_handle = mr_fs_handle;
-		fn->mp_data.dev_handle = mr_dev_handle;
+		fn->mp_data.devmap_handle = mr_devmap_handle;
 		fn->mp_data.phone = mountee_phone;
 	}
@@ -219,10 +219,10 @@
 void libfs_unmount(libfs_ops_t *ops, ipc_callid_t rid, ipc_call_t *request)
 {
-	dev_handle_t mp_dev_handle = (dev_handle_t) IPC_GET_ARG1(*request);
+	devmap_handle_t mp_devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
 	fs_index_t mp_fs_index = (fs_index_t) IPC_GET_ARG2(*request);
 	fs_node_t *fn;
 	int res;
 
-	res = ops->node_get(&fn, mp_dev_handle, mp_fs_index);
+	res = ops->node_get(&fn, mp_devmap_handle, mp_fs_index);
 	if ((res != EOK) || (!fn)) {
 		ipc_answer_0(rid, combine_rc(res, ENOENT));
@@ -243,5 +243,5 @@
 	 */
 	res = async_req_1_0(fn->mp_data.phone, VFS_OUT_UNMOUNTED,
-	    fn->mp_data.dev_handle);
+	    fn->mp_data.devmap_handle);
 
 	/*
@@ -252,5 +252,5 @@
 		fn->mp_data.mp_active = false;
 		fn->mp_data.fs_handle = 0;
-		fn->mp_data.dev_handle = 0;
+		fn->mp_data.devmap_handle = 0;
 		fn->mp_data.phone = 0;
 		/* Drop the reference created in libfs_mount(). */
@@ -281,5 +281,5 @@
 	unsigned int last = IPC_GET_ARG2(*request);
 	unsigned int next = first;
-	dev_handle_t dev_handle = IPC_GET_ARG3(*request);
+	devmap_handle_t devmap_handle = IPC_GET_ARG3(*request);
 	int lflag = IPC_GET_ARG4(*request);
 	fs_index_t index = IPC_GET_ARG5(*request);
@@ -295,10 +295,10 @@
 	fs_node_t *tmp = NULL;
 	
-	rc = ops->root_get(&cur, dev_handle);
+	rc = ops->root_get(&cur, devmap_handle);
 	on_error(rc, goto out_with_answer);
 	
 	if (cur->mp_data.mp_active) {
 		ipc_forward_slow(rid, cur->mp_data.phone, VFS_OUT_LOOKUP,
-		    next, last, cur->mp_data.dev_handle, lflag, index,
+		    next, last, cur->mp_data.devmap_handle, lflag, index,
 		    IPC_FF_ROUTE_FROM_ME);
 		(void) ops->node_put(cur);
@@ -358,5 +358,5 @@
 			
 			ipc_forward_slow(rid, tmp->mp_data.phone,
-			    VFS_OUT_LOOKUP, next, last, tmp->mp_data.dev_handle,
+			    VFS_OUT_LOOKUP, next, last, tmp->mp_data.devmap_handle,
 			    lflag, index, IPC_FF_ROUTE_FROM_ME);
 			(void) ops->node_put(cur);
@@ -385,8 +385,8 @@
 				fs_node_t *fn;
 				if (lflag & L_CREATE)
-					rc = ops->create(&fn, dev_handle,
+					rc = ops->create(&fn, devmap_handle,
 					    lflag);
 				else
-					rc = ops->node_get(&fn, dev_handle,
+					rc = ops->node_get(&fn, devmap_handle,
 					    index);
 				on_error(rc, goto out_with_answer);
@@ -401,5 +401,5 @@
 						aoff64_t size = ops->size_get(fn);
 						ipc_answer_5(rid, fs_handle,
-						    dev_handle,
+						    devmap_handle,
 						    ops->index_get(fn),
 						    LOWER32(size),
@@ -469,7 +469,7 @@
 			fs_node_t *fn;
 			if (lflag & L_CREATE)
-				rc = ops->create(&fn, dev_handle, lflag);
+				rc = ops->create(&fn, devmap_handle, lflag);
 			else
-				rc = ops->node_get(&fn, dev_handle, index);
+				rc = ops->node_get(&fn, devmap_handle, index);
 			on_error(rc, goto out_with_answer);
 			
@@ -483,5 +483,5 @@
 					aoff64_t size = ops->size_get(fn);
 					ipc_answer_5(rid, fs_handle,
-					    dev_handle,
+					    devmap_handle,
 					    ops->index_get(fn),
 					    LOWER32(size),
@@ -509,5 +509,5 @@
 		if (rc == EOK) {
 			aoff64_t size = ops->size_get(cur);
-			ipc_answer_5(rid, fs_handle, dev_handle,
+			ipc_answer_5(rid, fs_handle, devmap_handle,
 			    ops->index_get(cur), LOWER32(size), UPPER32(size),
 			    old_lnkcnt);
@@ -547,5 +547,5 @@
 		if (rc == EOK) {
 			aoff64_t size = ops->size_get(cur);
-			ipc_answer_5(rid, fs_handle, dev_handle,
+			ipc_answer_5(rid, fs_handle, devmap_handle,
 			    ops->index_get(cur), LOWER32(size), UPPER32(size),
 			    ops->lnkcnt_get(cur));
@@ -571,9 +571,9 @@
     ipc_call_t *request)
 {
-	dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request);
+	devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
 	fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
 	
 	fs_node_t *fn;
-	int rc = ops->node_get(&fn, dev_handle, index);
+	int rc = ops->node_get(&fn, devmap_handle, index);
 	on_error(rc, answer_and_return(rid, rc));
 	
@@ -592,5 +592,5 @@
 	
 	stat.fs_handle = fs_handle;
-	stat.dev_handle = dev_handle;
+	stat.devmap_handle = devmap_handle;
 	stat.index = index;
 	stat.lnkcnt = ops->lnkcnt_get(fn);
@@ -617,9 +617,9 @@
     ipc_call_t *request)
 {
-	dev_handle_t dev_handle = IPC_GET_ARG1(*request);
+	devmap_handle_t devmap_handle = IPC_GET_ARG1(*request);
 	fs_index_t index = IPC_GET_ARG2(*request);
 	
 	fs_node_t *fn;
-	int rc = ops->node_get(&fn, dev_handle, index);
+	int rc = ops->node_get(&fn, devmap_handle, index);
 	on_error(rc, answer_and_return(rid, rc));
 	
Index: uspace/lib/fs/libfs.h
===================================================================
--- uspace/lib/fs/libfs.h	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/lib/fs/libfs.h	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -47,5 +47,5 @@
 	int phone;
 	fs_handle_t fs_handle;
-	dev_handle_t dev_handle;
+	devmap_handle_t devmap_handle;
 } mp_data_t;
 
@@ -61,10 +61,10 @@
 	 * argument holds the output argument.
 	 */
-	int (* root_get)(fs_node_t **, dev_handle_t);
+	int (* root_get)(fs_node_t **, devmap_handle_t);
 	int (* match)(fs_node_t **, fs_node_t *, const char *);
-	int (* node_get)(fs_node_t **, dev_handle_t, fs_index_t);
+	int (* node_get)(fs_node_t **, devmap_handle_t, fs_index_t);
 	int (* node_open)(fs_node_t *);
 	int (* node_put)(fs_node_t *);
-	int (* create)(fs_node_t **, dev_handle_t, int);
+	int (* create)(fs_node_t **, devmap_handle_t, int);
 	int (* destroy)(fs_node_t *);
 	int (* link)(fs_node_t *, fs_node_t *, const char *);
@@ -81,5 +81,5 @@
 	bool (* is_directory)(fs_node_t *);
 	bool (* is_file)(fs_node_t *);
-	dev_handle_t (* device_get)(fs_node_t *);
+	devmap_handle_t (* device_get)(fs_node_t *);
 } libfs_ops_t;
 
Index: uspace/lib/net/adt/module_map.c
===================================================================
--- uspace/lib/net/adt/module_map.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/lib/net/adt/module_map.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -38,5 +38,5 @@
 #include <task.h>
 #include <unistd.h>
-#include <err.h>
+#include <errno.h>
 
 #include <ipc/services.h>
@@ -67,7 +67,6 @@
     connect_module_t connect_module)
 {
-	ERROR_DECLARE;
-
 	module_ref tmp_module;
+	int rc;
 
 	tmp_module = (module_ref) malloc(sizeof(module_t));
@@ -83,8 +82,8 @@
 	tmp_module->connect_module = connect_module;
 
-	if (ERROR_OCCURRED(modules_add(modules, tmp_module->name, 0,
-	    tmp_module))) {
+	rc = modules_add(modules, tmp_module->name, 0, tmp_module);
+	if (rc != EOK) {
 		free(tmp_module);
-		return ERROR_CODE;
+		return rc;
 	}
 	if (module)
Index: uspace/lib/net/generic/packet_remote.c
===================================================================
--- uspace/lib/net/generic/packet_remote.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/lib/net/generic/packet_remote.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -38,5 +38,4 @@
 #include <async.h>
 #include <errno.h>
-#include <err.h>
 #include <ipc/ipc.h>
 #include <ipc/packet.h>
@@ -67,15 +66,22 @@
 packet_return(int phone, packet_ref packet, packet_id_t packet_id, size_t size)
 {
-	ERROR_DECLARE;
-	
 	ipc_call_t answer;
-	aid_t message = async_send_1(phone, NET_PACKET_GET, packet_id, &answer);
+	aid_t message;
+	int rc;
+	
+	message = async_send_1(phone, NET_PACKET_GET, packet_id, &answer);
 
 	*packet = (packet_t) as_get_mappable_page(size);
-	if (ERROR_OCCURRED(async_share_in_start_0_0(phone, *packet, size)) ||
-	    ERROR_OCCURRED(pm_add(*packet))) {
+	rc = async_share_in_start_0_0(phone, *packet, size);
+	if (rc != EOK) {
 		munmap(*packet, size);
 		async_wait_for(message, NULL);
-		return ERROR_CODE;
+		return rc;
+	}
+	rc = pm_add(*packet);
+	if (rc != EOK) {
+		munmap(*packet, size);
+		async_wait_for(message, NULL);
+		return rc;
 	}
 	
@@ -103,5 +109,5 @@
 int packet_translate_remote(int phone, packet_ref packet, packet_id_t packet_id)
 {
-	ERROR_DECLARE;
+	int rc;
 	
 	if (!packet)
@@ -112,7 +118,11 @@
 		ipcarg_t size;
 		
-		ERROR_PROPAGATE(async_req_1_1(phone, NET_PACKET_GET_SIZE,
-		    packet_id, &size));
-		ERROR_PROPAGATE(packet_return(phone, packet, packet_id, size));
+		rc = async_req_1_1(phone, NET_PACKET_GET_SIZE, packet_id,
+		    &size);
+		if (rc != EOK)
+			return rc;
+		rc = packet_return(phone, packet, packet_id, size);
+		if (rc != EOK)
+			return rc;
 	}
 	if ((*packet)->next) {
@@ -141,11 +151,11 @@
     size_t max_prefix, size_t max_suffix)
 {
-	ERROR_DECLARE;
-	
 	ipcarg_t packet_id;
 	ipcarg_t size;
-	
-	if (ERROR_OCCURRED(async_req_4_2(phone, NET_PACKET_CREATE_4,
-	    max_content, addr_len, max_prefix, max_suffix, &packet_id, &size)))
+	int rc;
+	
+	rc = async_req_4_2(phone, NET_PACKET_CREATE_4, max_content, addr_len,
+	    max_prefix, max_suffix, &packet_id, &size);
+	if (rc != EOK)
 		return NULL;
 	
@@ -153,6 +163,6 @@
 	packet_t packet = pm_find(packet_id);
 	if (!packet) {
-		if (ERROR_OCCURRED(packet_return(phone, &packet, packet_id,
-		    size)))
+		rc = packet_return(phone, &packet, packet_id, size);
+		if (rc != EOK)
 			return NULL;
 	}
@@ -172,17 +182,17 @@
 packet_t packet_get_1_remote(int phone, size_t content)
 {
-	ERROR_DECLARE;
-	
 	ipcarg_t packet_id;
 	ipcarg_t size;
-	
-	if (ERROR_OCCURRED(async_req_1_2(phone, NET_PACKET_CREATE_1, content,
-	    &packet_id, &size)))
+	int rc;
+	
+	rc = async_req_1_2(phone, NET_PACKET_CREATE_1, content, &packet_id,
+	    &size);
+	if (rc != EOK)
 		return NULL;
 	
 	packet_t packet = pm_find(packet_id);
 	if (!packet) {
-		if (ERROR_OCCURRED(packet_return(phone, &packet, packet_id,
-		    size)))
+		rc = packet_return(phone, &packet, packet_id, size);
+		if (rc != EOK)
 			return NULL;
 	}
Index: uspace/lib/net/netif/netif_local.c
===================================================================
--- uspace/lib/net/netif/netif_local.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/lib/net/netif/netif_local.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -43,5 +43,5 @@
 #include <ipc/services.h>
 #include <ipc/netif.h>
-#include <err.h>
+#include <errno.h>
 
 #include <generic.h>
@@ -113,12 +113,13 @@
 int netif_start_req_local(int netif_phone, device_id_t device_id)
 {
-	ERROR_DECLARE;
+	int rc;
 	
 	fibril_rwlock_write_lock(&netif_globals.lock);
 	
 	netif_device_t *device;
-	if (ERROR_OCCURRED(find_device(device_id, &device))) {
+	rc = find_device(device_id, &device);
+	if (rc != EOK) {
 		fibril_rwlock_write_unlock(&netif_globals.lock);
-		return ERROR_CODE;
+		return rc;
 	}
 	
@@ -148,12 +149,13 @@
 int netif_stop_req_local(int netif_phone, device_id_t device_id)
 {
-	ERROR_DECLARE;
+	int rc;
 	
 	fibril_rwlock_write_lock(&netif_globals.lock);
 	
 	netif_device_t *device;
-	if (ERROR_OCCURRED(find_device(device_id, &device))) {
+	rc = find_device(device_id, &device);
+	if (rc != EOK) {
 		fibril_rwlock_write_unlock(&netif_globals.lock);
-		return ERROR_CODE;
+		return rc;
 	}
 	
@@ -203,5 +205,5 @@
     measured_string_ref *address, char **data)
 {
-	ERROR_DECLARE;
+	int rc;
 	
 	if (!address || !data)
@@ -211,7 +213,8 @@
 	
 	measured_string_t translation;
-	if (!ERROR_OCCURRED(netif_get_addr_message(device_id, &translation))) {
+	rc = netif_get_addr_message(device_id, &translation);
+	if (rc == EOK) {
 		*address = measured_string_copy(&translation);
-		ERROR_CODE = (*address) ? EOK : ENOMEM;
+		rc = (*address) ? EOK : ENOMEM;
 	}
 	
@@ -220,5 +223,5 @@
 	*data = (**address).value;
 	
-	return ERROR_CODE;
+	return rc;
 }
 
@@ -264,5 +267,5 @@
 int netif_init_module(async_client_conn_t client_connection)
 {
-	ERROR_DECLARE;
+	int rc;
 	
 	async_set_client_connection(client_connection);
@@ -271,10 +274,14 @@
 	netif_device_map_initialize(&netif_globals.device_map);
 	
-	ERROR_PROPAGATE(pm_init());
+	rc = pm_init();
+	if (rc != EOK)
+		return rc;
 	
 	fibril_rwlock_initialize(&netif_globals.lock);
-	if (ERROR_OCCURRED(netif_initialize())) {
+	
+	rc = netif_initialize();
+	if (rc != EOK) {
 		pm_destroy();
-		return ERROR_CODE;
+		return rc;
 	}
 	
@@ -317,9 +324,12 @@
 static int register_message(const char *name, device_id_t device_id, int phone)
 {
-	ERROR_DECLARE;
-	
 	netif_device_t *device;
-	ERROR_PROPAGATE(find_device(device_id, &device));
-	if(device->nil_phone > 0)
+	int rc;
+	
+	rc = find_device(device_id, &device);
+	if (rc != EOK)
+		return rc;
+	
+	if (device->nil_phone > 0)
 		return ELIMIT;
 	
@@ -349,10 +359,9 @@
     ipc_call_t *call, ipc_call_t *answer, int *answer_count)
 {
-	ERROR_DECLARE;
-	
 	size_t length;
 	device_stats_t stats;
 	packet_t packet;
 	measured_string_t address;
+	int rc;
 	
 	*answer_count = 0;
@@ -367,15 +376,17 @@
 	case IPC_M_CONNECT_TO_ME:
 		fibril_rwlock_write_lock(&netif_globals.lock);
-		ERROR_CODE = register_message(name, IPC_GET_DEVICE(call),
+		rc = register_message(name, IPC_GET_DEVICE(call),
 		    IPC_GET_PHONE(call));
 		fibril_rwlock_write_unlock(&netif_globals.lock);
-		return ERROR_CODE;
+		return rc;
 		
 	case NET_NETIF_SEND:
-		ERROR_PROPAGATE(packet_translate_remote(netif_globals.net_phone,
-		    &packet, IPC_GET_PACKET(call)));
+		rc = packet_translate_remote(netif_globals.net_phone, &packet,
+		    IPC_GET_PACKET(call));
+		if (rc != EOK)
+			return rc;
 		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));
@@ -384,7 +395,8 @@
 		fibril_rwlock_read_lock(&netif_globals.lock);
 
-		if (ERROR_OCCURRED(async_data_read_receive(&callid, &length))) {
+		rc = async_data_read_receive(&callid, &length);
+		if (rc != EOK) {
 			fibril_rwlock_read_unlock(&netif_globals.lock);
-			return ERROR_CODE;
+			return rc;
 		}
 		if (length < sizeof(device_stats_t)) {
@@ -393,12 +405,12 @@
 		}
 
-		if (ERROR_NONE(netif_get_device_stats(IPC_GET_DEVICE(call),
-		    &stats))) {
-			ERROR_CODE = async_data_read_finalize(callid, &stats,
+		rc = netif_get_device_stats(IPC_GET_DEVICE(call), &stats);
+		if (rc == EOK) {
+			rc = async_data_read_finalize(callid, &stats,
 			    sizeof(device_stats_t));
 		}
 
 		fibril_rwlock_read_unlock(&netif_globals.lock);
-		return ERROR_CODE;
+		return rc;
 
 	case NET_NETIF_STOP:
@@ -407,9 +419,9 @@
 	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);
+		rc = netif_get_addr_message(IPC_GET_DEVICE(call), &address);
+		if (rc == EOK)
+			rc = measured_strings_reply(&address, 1);
 		fibril_rwlock_read_unlock(&netif_globals.lock);
-		return ERROR_CODE;
+		return rc;
 	}
 	
@@ -431,7 +443,9 @@
 int netif_module_start_standalone(async_client_conn_t client_connection)
 {
-	ERROR_DECLARE;
-	
-	ERROR_PROPAGATE(netif_init_module(client_connection));
+	int rc;
+	
+	rc = netif_init_module(client_connection);
+	if (rc != EOK)
+		return rc;
 	
 	async_manager();
Index: uspace/lib/net/tl/socket_core.c
===================================================================
--- uspace/lib/net/tl/socket_core.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/lib/net/tl/socket_core.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -48,5 +48,4 @@
 #include <stdlib.h>
 #include <errno.h>
-#include <err.h>
 
 #include <adt/dynamic_fifo.h>
@@ -164,7 +163,6 @@
     const char *key, size_t key_length)
 {
-	ERROR_DECLARE;
-
 	socket_core_ref *socket_ref;
+	int rc;
 
 	// create a wrapper
@@ -175,8 +173,9 @@
 	*socket_ref = socket;
 	// add the wrapper
-	if (ERROR_OCCURRED(socket_port_map_add(&socket_port->map, key,
-	    key_length, socket_ref))) {
+	rc = socket_port_map_add(&socket_port->map, key, key_length,
+	    socket_ref);
+	if (rc != EOK) {
 		free(socket_ref);
-		return ERROR_CODE;
+		return rc;
 	}
 	
@@ -204,7 +203,6 @@
     int port)
 {
-	ERROR_DECLARE;
-
 	socket_port_ref socket_port;
+	int rc;
 
 	// create a wrapper
@@ -214,22 +212,26 @@
 
 	socket_port->count = 0;
-	if (ERROR_OCCURRED(socket_port_map_initialize(&socket_port->map)) ||
-	    ERROR_OCCURRED(socket_port_add_core(socket_port, socket,
-	    SOCKET_MAP_KEY_LISTENING, 0))) {
-		socket_port_map_destroy(&socket_port->map);
-		free(socket_port);
-		return ERROR_CODE;
-	}
+	rc = socket_port_map_initialize(&socket_port->map);
+	if (rc != EOK)
+		goto fail;
+	
+	rc = socket_port_add_core(socket_port, socket, SOCKET_MAP_KEY_LISTENING,
+	    0);
+	if (rc != EOK)
+		goto fail;
 	
 	// register the incomming port
-	ERROR_CODE = socket_ports_add(global_sockets, port, socket_port);
-	if (ERROR_CODE < 0) {
-		socket_port_map_destroy(&socket_port->map);
-		free(socket_port);
-		return ERROR_CODE;
-	}
+	rc = socket_ports_add(global_sockets, port, socket_port);
+	if (rc < 0)
+		goto fail;
 	
 	socket->port = port;
 	return EOK;
+
+fail:
+	socket_port_map_destroy(&socket_port->map);
+	free(socket_port);
+	return rc;
+	
 }
 
@@ -416,9 +418,7 @@
     void *specific_data, int *socket_id)
 {
-	ERROR_DECLARE;
-
 	socket_core_ref socket;
-	int res;
 	int positive;
+	int rc;
 
 	if (!socket_id)
@@ -447,22 +447,23 @@
 	socket->key_length = 0;
 	socket->specific_data = specific_data;
-	if (ERROR_OCCURRED(dyn_fifo_initialize(&socket->received,
-	    SOCKET_INITIAL_RECEIVED_SIZE))) {
+	rc = dyn_fifo_initialize(&socket->received, SOCKET_INITIAL_RECEIVED_SIZE);
+	if (rc != EOK) {
 		free(socket);
-		return ERROR_CODE;
-	}
-	if (ERROR_OCCURRED(dyn_fifo_initialize(&socket->accepted,
-	    SOCKET_INITIAL_ACCEPTED_SIZE))) {
+		return rc;
+	}
+	
+	rc = dyn_fifo_initialize(&socket->accepted, SOCKET_INITIAL_ACCEPTED_SIZE);
+	if (rc != EOK) {
 		dyn_fifo_destroy(&socket->received);
 		free(socket);
-		return ERROR_CODE;
+		return rc;
 	}
 	socket->socket_id = *socket_id;
-	res = socket_cores_add(local_sockets, socket->socket_id, socket);
-	if (res < 0) {
+	rc = socket_cores_add(local_sockets, socket->socket_id, socket);
+	if (rc < 0) {
 		dyn_fifo_destroy(&socket->received);
 		dyn_fifo_destroy(&socket->accepted);
 		free(socket);
-		return res;
+		return rc;
 	}
 	
@@ -523,10 +524,9 @@
 int socket_reply_packets(packet_t packet, size_t *length)
 {
-	ERROR_DECLARE;
-
 	packet_t next_packet;
 	size_t fragments;
 	size_t *lengths;
 	size_t index;
+	int rc;
 
 	if (!length)
@@ -536,6 +536,8 @@
 	if (!next_packet) {
 		// write all if only one fragment
-		ERROR_PROPAGATE(data_reply(packet_get_data(packet),
-		    packet_get_data_length(packet)));
+		rc = data_reply(packet_get_data(packet),
+		    packet_get_data_length(packet));
+		if (rc != EOK)
+			return rc;
 		// store the total length
 		*length = packet_get_data_length(packet);
@@ -564,8 +566,8 @@
 		
 		// write the fragment lengths
-		if (ERROR_OCCURRED(data_reply(lengths,
-		    sizeof(int) * (fragments + 1)))) {
+		rc = data_reply(lengths, sizeof(int) * (fragments + 1));
+		if (rc != EOK) {
 			free(lengths);
-			return ERROR_CODE;
+			return rc;
 		}
 		next_packet = packet;
@@ -573,9 +575,9 @@
 		// write the fragments
 		for (index = 0; index < fragments; ++index) {
-			ERROR_CODE = data_reply(packet_get_data(next_packet),
+			rc = data_reply(packet_get_data(next_packet),
 			    lengths[index]);
-			if (ERROR_OCCURRED(ERROR_CODE)) {
+			if (rc != EOK) {
 				free(lengths);
-				return ERROR_CODE;
+				return rc;
 			}
 			next_packet = pq_next(next_packet);
@@ -680,7 +682,6 @@
     socket_core_ref socket, const char *key, size_t key_length)
 {
-	ERROR_DECLARE;
-
 	socket_port_ref socket_port;
+	int rc;
 
 	// find ports
@@ -690,6 +691,7 @@
 	
 	// add the socket
-	ERROR_PROPAGATE(socket_port_add_core(socket_port, socket, key,
-	    key_length));
+	rc = socket_port_add_core(socket_port, socket, key, key_length);
+	if (rc != EOK)
+		return rc;
 	
 	socket->port = port;
Index: uspace/lib/net/tl/tl_common.c
===================================================================
--- uspace/lib/net/tl/tl_common.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/lib/net/tl/tl_common.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -54,5 +54,4 @@
 #include <ipc/services.h>
 #include <errno.h>
-#include <err.h>
 
 DEVICE_MAP_IMPLEMENT(packet_dimensions, packet_dimension_t);
@@ -124,5 +123,5 @@
     packet_dimension_ref *packet_dimension)
 {
-	ERROR_DECLARE;
+	int rc;
 	
 	if (!packet_dimension)
@@ -137,15 +136,15 @@
 			return ENOMEM;
 		
-		if (ERROR_OCCURRED(ip_packet_size_req(ip_phone, device_id,
-		    *packet_dimension))) {
+		rc = ip_packet_size_req(ip_phone, device_id, *packet_dimension);
+		if (rc != EOK) {
 			free(*packet_dimension);
-			return ERROR_CODE;
+			return rc;
 		}
 		
-		ERROR_CODE = packet_dimensions_add(packet_dimensions, device_id,
+		rc = packet_dimensions_add(packet_dimensions, device_id,
 		    *packet_dimension);
-		if (ERROR_CODE < 0) {
+		if (rc < 0) {
 			free(*packet_dimension);
-			return ERROR_CODE;
+			return rc;
 		}
 	}
@@ -292,9 +291,8 @@
     socklen_t addrlen)
 {
-	ERROR_DECLARE;
-
 	ipc_callid_t callid;
 	size_t length;
-	void * data;
+	void *data;
+	int rc;
 
 	if (!dimension)
@@ -319,10 +317,15 @@
 
 	// read the data into the packet
-	if (ERROR_OCCURRED(async_data_write_finalize(callid, data, length)) ||
-	    // set the packet destination address
-	    ERROR_OCCURRED(packet_set_addr(*packet, NULL, (uint8_t *) addr,
-	    addrlen))) {
+	rc = async_data_write_finalize(callid, data, length);
+	if (rc != EOK) {
 		pq_release_remote(packet_phone, packet_get_id(*packet));
-		return ERROR_CODE;
+		return rc;
+	}
+	
+	// set the packet destination address
+	rc = packet_set_addr(*packet, NULL, (uint8_t *) addr, addrlen);
+	if (rc != EOK) {
+		pq_release_remote(packet_phone, packet_get_id(*packet));
+		return rc;
 	}
 
Index: uspace/lib/packet/generic/packet_server.c
===================================================================
--- uspace/lib/packet/generic/packet_server.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/lib/packet/generic/packet_server.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -42,5 +42,4 @@
 #include <async.h>
 #include <errno.h>
-#include <err.h>
 #include <fibril_synch.h>
 #include <unistd.h>
@@ -162,7 +161,6 @@
     size_t max_content, size_t max_suffix)
 {
-	ERROR_DECLARE;
-
 	packet_t packet;
+	int rc;
 
 	// already locked
@@ -177,5 +175,6 @@
 	packet_init(packet, addr_len, max_prefix, max_content, max_suffix);
 	packet->magic_value = PACKET_MAGIC_VALUE;
-	if (ERROR_OCCURRED(pm_add(packet))) {
+	rc = pm_add(packet);
+	if (rc != EOK) {
 		munmap(packet, packet->length);
 		return NULL;
Index: uspace/srv/bd/ata_bd/ata_bd.c
===================================================================
--- uspace/srv/bd/ata_bd/ata_bd.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/bd/ata_bd/ata_bd.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -139,5 +139,5 @@
 		
 		snprintf(name, 16, "%s/disk%d", NAMESPACE, i);
-		rc = devmap_device_register(name, &disk[i].dev_handle);
+		rc = devmap_device_register(name, &disk[i].devmap_handle);
 		if (rc != EOK) {
 			devmap_hangup_phone(DEVMAP_DRIVER);
@@ -229,5 +229,5 @@
 	ipc_call_t call;
 	ipcarg_t method;
-	dev_handle_t dh;
+	devmap_handle_t dh;
 	int flags;
 	int retval;
@@ -242,5 +242,5 @@
 	disk_id = -1;
 	for (i = 0; i < MAX_DISKS; i++)
-		if (disk[i].dev_handle == dh)
+		if (disk[i].devmap_handle == dh)
 			disk_id = i;
 
Index: uspace/srv/bd/ata_bd/ata_bd.h
===================================================================
--- uspace/srv/bd/ata_bd/ata_bd.h	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/bd/ata_bd/ata_bd.h	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -287,5 +287,5 @@
 
 	fibril_mutex_t lock;
-	dev_handle_t dev_handle;
+	devmap_handle_t devmap_handle;
 } disk_t;
 
Index: uspace/srv/bd/file_bd/file_bd.c
===================================================================
--- uspace/srv/bd/file_bd/file_bd.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/bd/file_bd/file_bd.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -60,5 +60,5 @@
 static FILE *img;
 
-static dev_handle_t dev_handle;
+static devmap_handle_t devmap_handle;
 static fibril_mutex_t dev_lock;
 
@@ -82,5 +82,5 @@
 		return -1;
 
-	rc = devmap_device_register(argv[2], &dev_handle);
+	rc = devmap_device_register(argv[2], &devmap_handle);
 	if (rc != EOK) {
 		devmap_hangup_phone(DEVMAP_DRIVER);
Index: uspace/srv/bd/gxe_bd/gxe_bd.c
===================================================================
--- uspace/srv/bd/gxe_bd/gxe_bd.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/bd/gxe_bd/gxe_bd.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -93,5 +93,5 @@
 static gxe_bd_t *dev;
 
-static dev_handle_t dev_handle[MAX_DISKS];
+static devmap_handle_t devmap_handle[MAX_DISKS];
 
 static fibril_mutex_t dev_lock[MAX_DISKS];
@@ -143,5 +143,5 @@
 	for (i = 0; i < MAX_DISKS; i++) {
 		snprintf(name, 16, "%s/disk%d", NAMESPACE, i);
-		rc = devmap_device_register(name, &dev_handle[i]);
+		rc = devmap_device_register(name, &devmap_handle[i]);
 		if (rc != EOK) {
 			devmap_hangup_phone(DEVMAP_DRIVER);
@@ -161,5 +161,5 @@
 	ipc_call_t call;
 	ipcarg_t method;
-	dev_handle_t dh;
+	devmap_handle_t dh;
 	int flags;
 	int retval;
@@ -174,5 +174,5 @@
 	disk_id = -1;
 	for (i = 0; i < MAX_DISKS; i++)
-		if (dev_handle[i] == dh)
+		if (devmap_handle[i] == dh)
 			disk_id = i;
 
Index: uspace/srv/bd/part/guid_part/guid_part.c
===================================================================
--- uspace/srv/bd/part/guid_part/guid_part.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/bd/part/guid_part/guid_part.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -83,5 +83,5 @@
 	aoff64_t length;
 	/** Device representing the partition (outbound device) */
-	dev_handle_t dev;
+	devmap_handle_t dev;
 	/** Points to next partition structure. */
 	struct part *next;
@@ -91,5 +91,5 @@
 
 /** Partitioned device (inbound device) */
-static dev_handle_t indev_handle;
+static devmap_handle_t indev_handle;
 
 /** List of partitions. This structure is an empty head. */
@@ -130,5 +130,5 @@
 	int i;
 	char *name;
-	dev_handle_t dev;
+	devmap_handle_t dev;
 	uint64_t size_mb;
 	part_t *part;
@@ -316,5 +316,5 @@
 	ipc_call_t call;
 	ipcarg_t method;
-	dev_handle_t dh;
+	devmap_handle_t dh;
 	int flags;
 	int retval;
Index: uspace/srv/bd/part/mbr_part/mbr_part.c
===================================================================
--- uspace/srv/bd/part/mbr_part/mbr_part.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/bd/part/mbr_part/mbr_part.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -101,5 +101,5 @@
 	aoff64_t length;
 	/** Device representing the partition (outbound device) */
-	dev_handle_t dev;
+	devmap_handle_t dev;
 	/** Points to next partition structure. */
 	struct part *next;
@@ -142,5 +142,5 @@
 
 /** Partitioned device (inbound device) */
-static dev_handle_t indev_handle;
+static devmap_handle_t indev_handle;
 
 /** List of partitions. This structure is an empty head. */
@@ -181,5 +181,5 @@
 	int i;
 	char *name;
-	dev_handle_t dev;
+	devmap_handle_t dev;
 	uint64_t size_mb;
 	part_t *part;
@@ -394,5 +394,5 @@
 	ipc_call_t call;
 	ipcarg_t method;
-	dev_handle_t dh;
+	devmap_handle_t dh;
 	int flags;
 	int retval;
Index: uspace/srv/bd/rd/rd.c
===================================================================
--- uspace/srv/bd/rd/rd.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/bd/rd/rd.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -238,6 +238,6 @@
 	}
 	
-	dev_handle_t dev_handle;
-	if (devmap_device_register("bd/initrd", &dev_handle) != EOK) {
+	devmap_handle_t devmap_handle;
+	if (devmap_device_register("bd/initrd", &devmap_handle) != EOK) {
 		devmap_hangup_phone(DEVMAP_DRIVER);
 		printf("%s: Unable to register device\n", NAME);
Index: uspace/srv/devman/devman.c
===================================================================
--- uspace/srv/devman/devman.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/devman/devman.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -52,5 +52,5 @@
 {
 	node_t *dev = hash_table_get_instance(item, node_t, devman_link);
-	return (dev->handle == (device_handle_t) key[0]);
+	return (dev->handle == (devman_handle_t) key[0]);
 }
 
@@ -59,5 +59,5 @@
 {
 	node_t *dev = hash_table_get_instance(item, node_t, devmap_link);
-	return (dev->devmap_handle == (dev_handle_t) key[0]);
+	return (dev->devmap_handle == (devmap_handle_t) key[0]);
 }
 
@@ -782,5 +782,5 @@
  * @return		The device node.
  */
-node_t *find_dev_node_no_lock(dev_tree_t *tree, device_handle_t handle)
+node_t *find_dev_node_no_lock(dev_tree_t *tree, devman_handle_t handle)
 {
 	unsigned long key = handle;
@@ -795,5 +795,5 @@
  * @return		The device node.
  */
-node_t *find_dev_node(dev_tree_t *tree, device_handle_t handle)
+node_t *find_dev_node(dev_tree_t *tree, devman_handle_t handle)
 {
 	node_t *node = NULL;
@@ -1106,5 +1106,5 @@
 /* Devmap devices */
 
-node_t *find_devmap_tree_device(dev_tree_t *tree, dev_handle_t devmap_handle)
+node_t *find_devmap_tree_device(dev_tree_t *tree, devmap_handle_t devmap_handle)
 {
 	node_t *dev = NULL;
@@ -1122,5 +1122,5 @@
 
 node_t *find_devmap_class_device(class_list_t *classes,
-    dev_handle_t devmap_handle)
+    devmap_handle_t devmap_handle)
 {
 	node_t *dev = NULL;
Index: uspace/srv/devman/devman.h
===================================================================
--- uspace/srv/devman/devman.h	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/devman/devman.h	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -121,5 +121,5 @@
 struct node {
 	/** The global unique identifier of the device. */
-	device_handle_t handle;
+	devman_handle_t handle;
 	/** The name of the device specified by its parent. */
 	char *name;
@@ -157,5 +157,5 @@
 	link_t classes;
 	/** Devmap handle if the device is registered by devmapper. */
-	dev_handle_t devmap_handle;
+	devmap_handle_t devmap_handle;
 	
 	/**
@@ -179,5 +179,5 @@
 	 * manner.
 	 */
-	device_handle_t current_handle;
+	devman_handle_t current_handle;
 	
 	/** Synchronize access to the device tree. */
@@ -248,5 +248,5 @@
 	char *dev_name;
 	/** The handle of the device by device mapper in the class namespace. */
-	dev_handle_t devmap_handle;
+	devmap_handle_t devmap_handle;
 	
 	/**
@@ -309,6 +309,6 @@
 extern void delete_dev_node(node_t *node);
 extern node_t *find_dev_node_no_lock(dev_tree_t *tree,
-    device_handle_t handle);
-extern node_t *find_dev_node(dev_tree_t *tree, device_handle_t handle);
+    devman_handle_t handle);
+extern node_t *find_dev_node(dev_tree_t *tree, devman_handle_t handle);
 extern node_t *find_dev_node_by_path(dev_tree_t *, char *);
 extern node_t *find_node_child(node_t *, const char *);
@@ -337,6 +337,6 @@
 /* Devmap devices */
 
-extern node_t *find_devmap_tree_device(dev_tree_t *, dev_handle_t);
-extern node_t *find_devmap_class_device(class_list_t *, dev_handle_t);
+extern node_t *find_devmap_tree_device(dev_tree_t *, devmap_handle_t);
+extern node_t *find_devmap_class_device(class_list_t *, devmap_handle_t);
 
 extern void class_add_devmap_device(class_list_t *, dev_class_info_t *);
Index: uspace/srv/devman/main.c
===================================================================
--- uspace/srv/devman/main.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/devman/main.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -202,5 +202,5 @@
 static void devman_add_child(ipc_callid_t callid, ipc_call_t *call)
 {
-	device_handle_t parent_handle = IPC_GET_ARG1(*call);
+	devman_handle_t parent_handle = IPC_GET_ARG1(*call);
 	ipcarg_t match_count = IPC_GET_ARG2(*call);
 	dev_tree_t *tree = &device_tree;
@@ -271,5 +271,5 @@
 static void devman_add_device_to_class(ipc_callid_t callid, ipc_call_t *call)
 {
-	device_handle_t handle = IPC_GET_ARG1(*call);
+	devman_handle_t handle = IPC_GET_ARG1(*call);
 	
 	/* Get class name. */
@@ -414,5 +414,5 @@
     bool drv_to_parent)
 {
-	device_handle_t handle = IPC_GET_ARG2(*icall);
+	devman_handle_t handle = IPC_GET_ARG2(*icall);
 	
 	node_t *dev = find_dev_node(&device_tree, handle);
@@ -464,5 +464,5 @@
 static void devman_connection_devmapper(ipc_callid_t iid, ipc_call_t *icall)
 {
-	dev_handle_t devmap_handle = IPC_GET_METHOD(*icall);
+	devmap_handle_t devmap_handle = IPC_GET_METHOD(*icall);
 	node_t *dev;
 
Index: uspace/srv/devmap/devmap.c
===================================================================
--- uspace/srv/devmap/devmap.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/devmap/devmap.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -75,5 +75,5 @@
 	link_t namespaces;
 	/** Unique namespace identifier */
-	dev_handle_t handle;
+	devmap_handle_t handle;
 	/** Namespace name */
 	char *name;
@@ -92,5 +92,5 @@
 	link_t driver_devices;
 	/** Unique device identifier */
-	dev_handle_t handle;
+	devmap_handle_t handle;
 	/** Device namespace */
 	devmap_namespace_t *namespace;
@@ -118,8 +118,8 @@
 static FIBRIL_MUTEX_INITIALIZE(null_devices_mutex);
 
-static dev_handle_t last_handle = 0;
+static devmap_handle_t last_handle = 0;
 static devmap_device_t *null_devices[NULL_DEVICES];
 
-static dev_handle_t devmap_create_handle(void)
+static devmap_handle_t devmap_create_handle(void)
 {
 	/* TODO: allow reusing old handles after their unregistration
@@ -233,5 +233,5 @@
  *
  */
-static devmap_namespace_t *devmap_namespace_find_handle(dev_handle_t handle)
+static devmap_namespace_t *devmap_namespace_find_handle(devmap_handle_t handle)
 {
 	link_t *item;
@@ -275,5 +275,5 @@
  *
  */
-static devmap_device_t *devmap_device_find_handle(dev_handle_t handle)
+static devmap_device_t *devmap_device_find_handle(devmap_handle_t handle)
 {
 	link_t *item;
@@ -608,5 +608,5 @@
 	 * Get handle from request
 	 */
-	dev_handle_t handle = IPC_GET_ARG2(*call);
+	devmap_handle_t handle = IPC_GET_ARG2(*call);
 	devmap_device_t *dev = devmap_device_find_handle(handle);
 	
Index: uspace/srv/fs/devfs/devfs_ops.c
===================================================================
--- uspace/srv/fs/devfs/devfs_ops.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/fs/devfs/devfs_ops.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -54,10 +54,10 @@
 typedef struct {
 	devmap_handle_type_t type;
-	dev_handle_t handle;
+	devmap_handle_t handle;
 } devfs_node_t;
 
 /** Opened devices structure */
 typedef struct {
-	dev_handle_t handle;
+	devmap_handle_t handle;
 	int phone;
 	size_t refcount;
@@ -84,5 +84,5 @@
 {
 	device_t *dev = hash_table_get_instance(item, device_t, link);
-	return (dev->handle == (dev_handle_t) key[DEVICES_KEY_HANDLE]);
+	return (dev->handle == (devmap_handle_t) key[DEVICES_KEY_HANDLE]);
 }
 
@@ -99,5 +99,5 @@
 
 static int devfs_node_get_internal(fs_node_t **rfn, devmap_handle_type_t type,
-    dev_handle_t handle)
+    devmap_handle_t handle)
 {
 	devfs_node_t *node = (devfs_node_t *) malloc(sizeof(devfs_node_t));
@@ -122,5 +122,5 @@
 }
 
-static int devfs_root_get(fs_node_t **rfn, dev_handle_t dev_handle)
+static int devfs_root_get(fs_node_t **rfn, devmap_handle_t devmap_handle)
 {
 	return devfs_node_get_internal(rfn, DEV_HANDLE_NONE, 0);
@@ -154,5 +154,5 @@
 		
 		/* Search root namespace */
-		dev_handle_t namespace;
+		devmap_handle_t namespace;
 		if (devmap_namespace_get_handle("", &namespace, 0) == EOK) {
 			count = devmap_get_devices(namespace, &devs);
@@ -200,5 +200,5 @@
 }
 
-static int devfs_node_get(fs_node_t **rfn, dev_handle_t dev_handle, fs_index_t index)
+static int devfs_node_get(fs_node_t **rfn, devmap_handle_t devmap_handle, fs_index_t index)
 {
 	return devfs_node_get_internal(rfn, devmap_handle_probe(index), index);
@@ -269,5 +269,5 @@
 }
 
-static int devfs_create_node(fs_node_t **rfn, dev_handle_t dev_handle, int lflag)
+static int devfs_create_node(fs_node_t **rfn, devmap_handle_t devmap_handle, int lflag)
 {
 	assert((lflag & L_FILE) ^ (lflag & L_DIRECTORY));
@@ -304,5 +304,5 @@
 		
 		/* Root namespace */
-		dev_handle_t namespace;
+		devmap_handle_t namespace;
 		if (devmap_namespace_get_handle("", &namespace, 0) == EOK) {
 			count = devmap_count_devices(namespace);
@@ -372,5 +372,5 @@
 }
 
-static dev_handle_t devfs_device_get(fs_node_t *fn)
+static devmap_handle_t devfs_device_get(fs_node_t *fn)
 {
 	devfs_node_t *node = (devfs_node_t *) fn->data;
@@ -501,5 +501,5 @@
 		
 		/* Search root namespace */
-		dev_handle_t namespace;
+		devmap_handle_t namespace;
 		if (devmap_namespace_get_handle("", &namespace, 0) == EOK) {
 			count = devmap_get_devices(namespace, &desc);
Index: uspace/srv/fs/fat/fat.h
===================================================================
--- uspace/srv/fs/fat/fat.h	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/fs/fat/fat.h	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -176,5 +176,5 @@
 
 	fibril_mutex_t	lock;
-	dev_handle_t	dev_handle;
+	devmap_handle_t	devmap_handle;
 	fs_index_t	index;
 	/**
@@ -242,7 +242,7 @@
 extern void fat_sync(ipc_callid_t, ipc_call_t *);
 
-extern int fat_idx_get_new(fat_idx_t **, dev_handle_t);
-extern fat_idx_t *fat_idx_get_by_pos(dev_handle_t, fat_cluster_t, unsigned);
-extern fat_idx_t *fat_idx_get_by_index(dev_handle_t, fs_index_t);
+extern int fat_idx_get_new(fat_idx_t **, devmap_handle_t);
+extern fat_idx_t *fat_idx_get_by_pos(devmap_handle_t, fat_cluster_t, unsigned);
+extern fat_idx_t *fat_idx_get_by_index(devmap_handle_t, fs_index_t);
 extern void fat_idx_destroy(fat_idx_t *);
 extern void fat_idx_hashin(fat_idx_t *);
@@ -251,6 +251,6 @@
 extern int fat_idx_init(void);
 extern void fat_idx_fini(void);
-extern int fat_idx_init_by_dev_handle(dev_handle_t);
-extern void fat_idx_fini_by_dev_handle(dev_handle_t);
+extern int fat_idx_init_by_devmap_handle(devmap_handle_t);
+extern void fat_idx_fini_by_devmap_handle(devmap_handle_t);
 
 #endif
Index: uspace/srv/fs/fat/fat_fat.c
===================================================================
--- uspace/srv/fs/fat/fat_fat.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/fs/fat/fat_fat.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -70,5 +70,5 @@
  *
  * @param bs		Buffer holding the boot sector for the file.
- * @param dev_handle	Device handle of the device with the file.
+ * @param devmap_handle	Device handle of the device with the file.
  * @param firstc	First cluster to start the walk with.
  * @param lastc		If non-NULL, output argument hodling the last cluster
@@ -81,5 +81,5 @@
  */
 int 
-fat_cluster_walk(fat_bs_t *bs, dev_handle_t dev_handle, fat_cluster_t firstc,
+fat_cluster_walk(fat_bs_t *bs, devmap_handle_t devmap_handle, fat_cluster_t firstc,
     fat_cluster_t *lastc, uint16_t *numc, uint16_t max_clusters)
 {
@@ -108,5 +108,5 @@
 		fidx = clst % (BPS(bs) / sizeof(fat_cluster_t));
 		/* read FAT1 */
-		rc = block_get(&b, dev_handle, RSCNT(bs) + fsec,
+		rc = block_get(&b, devmap_handle, RSCNT(bs) + fsec,
 		    BLOCK_FLAGS_NONE);
 		if (rc != EOK)
@@ -159,5 +159,5 @@
 		 * when fortunately we have the last cluster number cached.
 		 */
-		return block_get(block, nodep->idx->dev_handle,
+		return block_get(block, nodep->idx->devmap_handle,
 		    CLBN2PBN(bs, nodep->lastc_cached_value, bn), flags);
 	}
@@ -173,5 +173,5 @@
 
 fall_through:
-	rc = _fat_block_get(block, bs, nodep->idx->dev_handle, firstc,
+	rc = _fat_block_get(block, bs, nodep->idx->devmap_handle, firstc,
 	    &currc, relbn, flags);
 	if (rc != EOK)
@@ -192,5 +192,5 @@
  * @param block		Pointer to a block pointer for storing result.
  * @param bs		Buffer holding the boot sector of the file system.
- * @param dev_handle	Device handle of the file system.
+ * @param devmap_handle	Device handle of the file system.
  * @param fcl		First cluster used by the file. Can be zero if the file
  *			is empty.
@@ -204,5 +204,5 @@
  */
 int
-_fat_block_get(block_t **block, fat_bs_t *bs, dev_handle_t dev_handle,
+_fat_block_get(block_t **block, fat_bs_t *bs, devmap_handle_t devmap_handle,
     fat_cluster_t fcl, fat_cluster_t *clp, aoff64_t bn, int flags)
 {
@@ -221,5 +221,5 @@
 		/* root directory special case */
 		assert(bn < RDS(bs));
-		rc = block_get(block, dev_handle,
+		rc = block_get(block, devmap_handle,
 		    RSCNT(bs) + FATCNT(bs) * SF(bs) + bn, flags);
 		return rc;
@@ -227,10 +227,10 @@
 
 	max_clusters = bn / SPC(bs);
-	rc = fat_cluster_walk(bs, dev_handle, fcl, &c, &clusters, max_clusters);
+	rc = fat_cluster_walk(bs, devmap_handle, fcl, &c, &clusters, max_clusters);
 	if (rc != EOK)
 		return rc;
 	assert(clusters == max_clusters);
 
-	rc = block_get(block, dev_handle, CLBN2PBN(bs, c, bn), flags);
+	rc = block_get(block, devmap_handle, CLBN2PBN(bs, c, bn), flags);
 
 	if (clp)
@@ -280,5 +280,5 @@
 	/* zero out the initial part of the new cluster chain */
 	for (o = boundary; o < pos; o += BPS(bs)) {
-		rc = _fat_block_get(&b, bs, nodep->idx->dev_handle, mcl,
+		rc = _fat_block_get(&b, bs, nodep->idx->devmap_handle, mcl,
 		    NULL, (o - boundary) / BPS(bs), BLOCK_FLAGS_NOREAD);
 		if (rc != EOK)
@@ -297,5 +297,5 @@
  *
  * @param bs		Buffer holding the boot sector for the file system.
- * @param dev_handle	Device handle for the file system.
+ * @param devmap_handle	Device handle for the file system.
  * @param clst		Cluster which to get.
  * @param value		Output argument holding the value of the cluster.
@@ -304,5 +304,5 @@
  */
 int
-fat_get_cluster(fat_bs_t *bs, dev_handle_t dev_handle, unsigned fatno,
+fat_get_cluster(fat_bs_t *bs, devmap_handle_t devmap_handle, unsigned fatno,
     fat_cluster_t clst, fat_cluster_t *value)
 {
@@ -311,5 +311,5 @@
 	int rc;
 
-	rc = block_get(&b, dev_handle, RSCNT(bs) + SF(bs) * fatno +
+	rc = block_get(&b, devmap_handle, RSCNT(bs) + SF(bs) * fatno +
 	    (clst * sizeof(fat_cluster_t)) / BPS(bs), BLOCK_FLAGS_NONE);
 	if (rc != EOK)
@@ -326,5 +326,5 @@
  *
  * @param bs		Buffer holding the boot sector for the file system.
- * @param dev_handle	Device handle for the file system.
+ * @param devmap_handle	Device handle for the file system.
  * @param fatno		Number of the FAT instance where to make the change.
  * @param clst		Cluster which is to be set.
@@ -334,5 +334,5 @@
  */
 int
-fat_set_cluster(fat_bs_t *bs, dev_handle_t dev_handle, unsigned fatno,
+fat_set_cluster(fat_bs_t *bs, devmap_handle_t devmap_handle, unsigned fatno,
     fat_cluster_t clst, fat_cluster_t value)
 {
@@ -342,5 +342,5 @@
 
 	assert(fatno < FATCNT(bs));
-	rc = block_get(&b, dev_handle, RSCNT(bs) + SF(bs) * fatno +
+	rc = block_get(&b, devmap_handle, RSCNT(bs) + SF(bs) * fatno +
 	    (clst * sizeof(fat_cluster_t)) / BPS(bs), BLOCK_FLAGS_NONE);
 	if (rc != EOK)
@@ -357,5 +357,5 @@
  *
  * @param bs		Buffer holding the boot sector of the file system.
- * @param dev_handle	Device handle of the file system.
+ * @param devmap_handle	Device handle of the file system.
  * @param lifo		Chain of allocated clusters.
  * @param nclsts	Number of clusters in the lifo chain.
@@ -363,5 +363,5 @@
  * @return		EOK on success or a negative error code.
  */
-int fat_alloc_shadow_clusters(fat_bs_t *bs, dev_handle_t dev_handle,
+int fat_alloc_shadow_clusters(fat_bs_t *bs, devmap_handle_t devmap_handle,
     fat_cluster_t *lifo, unsigned nclsts)
 {
@@ -372,5 +372,5 @@
 	for (fatno = FAT1 + 1; fatno < bs->fatcnt; fatno++) {
 		for (c = 0; c < nclsts; c++) {
-			rc = fat_set_cluster(bs, dev_handle, fatno, lifo[c],
+			rc = fat_set_cluster(bs, devmap_handle, fatno, lifo[c],
 			    c == 0 ? FAT_CLST_LAST1 : lifo[c - 1]);
 			if (rc != EOK)
@@ -390,5 +390,5 @@
  *
  * @param bs		Buffer holding the boot sector of the file system.
- * @param dev_handle	Device handle of the file system.
+ * @param devmap_handle	Device handle of the file system.
  * @param nclsts	Number of clusters to allocate.
  * @param mcl		Output parameter where the first cluster in the chain
@@ -400,5 +400,5 @@
  */
 int
-fat_alloc_clusters(fat_bs_t *bs, dev_handle_t dev_handle, unsigned nclsts,
+fat_alloc_clusters(fat_bs_t *bs, devmap_handle_t devmap_handle, unsigned nclsts,
     fat_cluster_t *mcl, fat_cluster_t *lcl)
 {
@@ -418,5 +418,5 @@
 	fibril_mutex_lock(&fat_alloc_lock);
 	for (b = 0, cl = 0; b < SF(bs); b++) {
-		rc = block_get(&blk, dev_handle, RSCNT(bs) + b,
+		rc = block_get(&blk, devmap_handle, RSCNT(bs) + b,
 		    BLOCK_FLAGS_NONE);
 		if (rc != EOK)
@@ -457,5 +457,5 @@
 					/* update the shadow copies of FAT */
 					rc = fat_alloc_shadow_clusters(bs,
-					    dev_handle, lifo, nclsts);
+					    devmap_handle, lifo, nclsts);
 					if (rc != EOK)
 						goto error;
@@ -484,5 +484,5 @@
 	 */
 	while (found--) {
-		rc = fat_set_cluster(bs, dev_handle, FAT1, lifo[found],
+		rc = fat_set_cluster(bs, devmap_handle, FAT1, lifo[found],
 		    FAT_CLST_RES0);
 		if (rc != EOK) {
@@ -499,5 +499,5 @@
  *
  * @param bs		Buffer hodling the boot sector of the file system.
- * @param dev_handle	Device handle of the file system.
+ * @param devmap_handle	Device handle of the file system.
  * @param firstc	First cluster in the chain which is to be freed.
  *
@@ -505,5 +505,5 @@
  */
 int
-fat_free_clusters(fat_bs_t *bs, dev_handle_t dev_handle, fat_cluster_t firstc)
+fat_free_clusters(fat_bs_t *bs, devmap_handle_t devmap_handle, fat_cluster_t firstc)
 {
 	unsigned fatno;
@@ -514,9 +514,9 @@
 	while (firstc < FAT_CLST_LAST1) {
 		assert(firstc >= FAT_CLST_FIRST && firstc < FAT_CLST_BAD);
-		rc = fat_get_cluster(bs, dev_handle, FAT1, firstc, &nextc);
+		rc = fat_get_cluster(bs, devmap_handle, FAT1, firstc, &nextc);
 		if (rc != EOK)
 			return rc;
 		for (fatno = FAT1; fatno < bs->fatcnt; fatno++) {
-			rc = fat_set_cluster(bs, dev_handle, fatno, firstc,
+			rc = fat_set_cluster(bs, devmap_handle, fatno, firstc,
 			    FAT_CLST_RES0);
 			if (rc != EOK)
@@ -543,5 +543,5 @@
     fat_cluster_t lcl)
 {
-	dev_handle_t dev_handle = nodep->idx->dev_handle;
+	devmap_handle_t devmap_handle = nodep->idx->devmap_handle;
 	fat_cluster_t lastc;
 	uint8_t fatno;
@@ -557,5 +557,5 @@
 			nodep->lastc_cached_valid = false;
 		} else {
-			rc = fat_cluster_walk(bs, dev_handle, nodep->firstc,
+			rc = fat_cluster_walk(bs, devmap_handle, nodep->firstc,
 			    &lastc, NULL, (uint16_t) -1);
 			if (rc != EOK)
@@ -564,5 +564,5 @@
 
 		for (fatno = FAT1; fatno < bs->fatcnt; fatno++) {
-			rc = fat_set_cluster(bs, nodep->idx->dev_handle, fatno,
+			rc = fat_set_cluster(bs, nodep->idx->devmap_handle, fatno,
 			    lastc, mcl);
 			if (rc != EOK)
@@ -590,5 +590,5 @@
 {
 	int rc;
-	dev_handle_t dev_handle = nodep->idx->dev_handle;
+	devmap_handle_t devmap_handle = nodep->idx->devmap_handle;
 
 	/*
@@ -601,5 +601,5 @@
 	if (lcl == FAT_CLST_RES0) {
 		/* The node will have zero size and no clusters allocated. */
-		rc = fat_free_clusters(bs, dev_handle, nodep->firstc);
+		rc = fat_free_clusters(bs, devmap_handle, nodep->firstc);
 		if (rc != EOK)
 			return rc;
@@ -610,5 +610,5 @@
 		unsigned fatno;
 
-		rc = fat_get_cluster(bs, dev_handle, FAT1, lcl, &nextc);
+		rc = fat_get_cluster(bs, devmap_handle, FAT1, lcl, &nextc);
 		if (rc != EOK)
 			return rc;
@@ -616,5 +616,5 @@
 		/* Terminate the cluster chain in all copies of FAT. */
 		for (fatno = FAT1; fatno < bs->fatcnt; fatno++) {
-			rc = fat_set_cluster(bs, dev_handle, fatno, lcl,
+			rc = fat_set_cluster(bs, devmap_handle, fatno, lcl,
 			    FAT_CLST_LAST1);
 			if (rc != EOK)
@@ -623,5 +623,5 @@
 
 		/* Free all following clusters. */
-		rc = fat_free_clusters(bs, dev_handle, nextc);
+		rc = fat_free_clusters(bs, devmap_handle, nextc);
 		if (rc != EOK)
 			return rc;
@@ -638,5 +638,5 @@
 
 int
-fat_zero_cluster(struct fat_bs *bs, dev_handle_t dev_handle, fat_cluster_t c)
+fat_zero_cluster(struct fat_bs *bs, devmap_handle_t devmap_handle, fat_cluster_t c)
 {
 	int i;
@@ -645,5 +645,5 @@
 
 	for (i = 0; i < SPC(bs); i++) {
-		rc = _fat_block_get(&b, bs, dev_handle, c, NULL, i,
+		rc = _fat_block_get(&b, bs, devmap_handle, c, NULL, i,
 		    BLOCK_FLAGS_NOREAD);
 		if (rc != EOK)
@@ -665,5 +665,5 @@
  * does not contain a fat file system.
  */
-int fat_sanity_check(fat_bs_t *bs, dev_handle_t dev_handle)
+int fat_sanity_check(fat_bs_t *bs, devmap_handle_t devmap_handle)
 {
 	fat_cluster_t e0, e1;
@@ -706,9 +706,9 @@
 
 	for (fat_no = 0; fat_no < bs->fatcnt; fat_no++) {
-		rc = fat_get_cluster(bs, dev_handle, fat_no, 0, &e0);
+		rc = fat_get_cluster(bs, devmap_handle, fat_no, 0, &e0);
 		if (rc != EOK)
 			return EIO;
 
-		rc = fat_get_cluster(bs, dev_handle, fat_no, 1, &e1);
+		rc = fat_get_cluster(bs, devmap_handle, fat_no, 1, &e1);
 		if (rc != EOK)
 			return EIO;
Index: uspace/srv/fs/fat/fat_fat.h
===================================================================
--- uspace/srv/fs/fat/fat_fat.h	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/fs/fat/fat_fat.h	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -61,10 +61,10 @@
 #define fat_clusters_get(numc, bs, dh, fc) \
     fat_cluster_walk((bs), (dh), (fc), NULL, (numc), (uint16_t) -1)
-extern int fat_cluster_walk(struct fat_bs *, dev_handle_t, fat_cluster_t,
+extern int fat_cluster_walk(struct fat_bs *, devmap_handle_t, fat_cluster_t,
     fat_cluster_t *, uint16_t *, uint16_t);
 
 extern int fat_block_get(block_t **, struct fat_bs *, struct fat_node *,
     aoff64_t, int);
-extern int _fat_block_get(block_t **, struct fat_bs *, dev_handle_t,
+extern int _fat_block_get(block_t **, struct fat_bs *, devmap_handle_t,
     fat_cluster_t, fat_cluster_t *, aoff64_t, int);
 
@@ -73,17 +73,17 @@
 extern int fat_chop_clusters(struct fat_bs *, struct fat_node *,
     fat_cluster_t);
-extern int fat_alloc_clusters(struct fat_bs *, dev_handle_t, unsigned,
+extern int fat_alloc_clusters(struct fat_bs *, devmap_handle_t, unsigned,
     fat_cluster_t *, fat_cluster_t *);
-extern int fat_free_clusters(struct fat_bs *, dev_handle_t, fat_cluster_t);
-extern int fat_alloc_shadow_clusters(struct fat_bs *, dev_handle_t,
+extern int fat_free_clusters(struct fat_bs *, devmap_handle_t, fat_cluster_t);
+extern int fat_alloc_shadow_clusters(struct fat_bs *, devmap_handle_t,
     fat_cluster_t *, unsigned);
-extern int fat_get_cluster(struct fat_bs *, dev_handle_t, unsigned,
+extern int fat_get_cluster(struct fat_bs *, devmap_handle_t, unsigned,
     fat_cluster_t, fat_cluster_t *);
-extern int fat_set_cluster(struct fat_bs *, dev_handle_t, unsigned,
+extern int fat_set_cluster(struct fat_bs *, devmap_handle_t, unsigned,
     fat_cluster_t, fat_cluster_t);
 extern int fat_fill_gap(struct fat_bs *, struct fat_node *, fat_cluster_t,
     aoff64_t);
-extern int fat_zero_cluster(struct fat_bs *, dev_handle_t, fat_cluster_t);
-extern int fat_sanity_check(struct fat_bs *, dev_handle_t);
+extern int fat_zero_cluster(struct fat_bs *, devmap_handle_t, fat_cluster_t);
+extern int fat_sanity_check(struct fat_bs *, devmap_handle_t);
 
 #endif
Index: uspace/srv/fs/fat/fat_idx.c
===================================================================
--- uspace/srv/fs/fat/fat_idx.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/fs/fat/fat_idx.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -58,5 +58,5 @@
 typedef struct {
 	link_t		link;
-	dev_handle_t	dev_handle;
+	devmap_handle_t	devmap_handle;
 
 	/** Next unassigned index. */
@@ -75,8 +75,8 @@
 static LIST_INITIALIZE(unused_head);
 
-static void unused_initialize(unused_t *u, dev_handle_t dev_handle)
+static void unused_initialize(unused_t *u, devmap_handle_t devmap_handle)
 {
 	link_initialize(&u->link);
-	u->dev_handle = dev_handle;
+	u->devmap_handle = devmap_handle;
 	u->next = 0;
 	u->remaining = ((uint64_t)((fs_index_t)-1)) + 1;
@@ -84,5 +84,5 @@
 }
 
-static unused_t *unused_find(dev_handle_t dev_handle, bool lock)
+static unused_t *unused_find(devmap_handle_t devmap_handle, bool lock)
 {
 	unused_t *u;
@@ -93,5 +93,5 @@
 	for (l = unused_head.next; l != &unused_head; l = l->next) {
 		u = list_get_instance(l, unused_t, link);
-		if (u->dev_handle == dev_handle) 
+		if (u->devmap_handle == devmap_handle) 
 			return u;
 	}
@@ -106,5 +106,5 @@
 /**
  * Global hash table of all used fat_idx_t structures.
- * The index structures are hashed by the dev_handle, parent node's first
+ * The index structures are hashed by the devmap_handle, parent node's first
  * cluster and index within the parent directory.
  */ 
@@ -120,5 +120,5 @@
 static hash_index_t pos_hash(unsigned long key[])
 {
-	dev_handle_t dev_handle = (dev_handle_t)key[UPH_DH_KEY];
+	devmap_handle_t devmap_handle = (devmap_handle_t)key[UPH_DH_KEY];
 	fat_cluster_t pfc = (fat_cluster_t)key[UPH_PFC_KEY];
 	unsigned pdi = (unsigned)key[UPH_PDI_KEY];
@@ -140,5 +140,5 @@
 	h |= (pdi & ((1 << (UPH_BUCKETS_LOG / 4)) - 1)) <<
 	    (UPH_BUCKETS_LOG / 2); 
-	h |= (dev_handle & ((1 << (UPH_BUCKETS_LOG / 4)) - 1)) <<
+	h |= (devmap_handle & ((1 << (UPH_BUCKETS_LOG / 4)) - 1)) <<
 	    (3 * (UPH_BUCKETS_LOG / 4));
 
@@ -148,5 +148,5 @@
 static int pos_compare(unsigned long key[], hash_count_t keys, link_t *item)
 {
-	dev_handle_t dev_handle = (dev_handle_t)key[UPH_DH_KEY];
+	devmap_handle_t devmap_handle = (devmap_handle_t)key[UPH_DH_KEY];
 	fat_cluster_t pfc;
 	unsigned pdi;
@@ -155,9 +155,9 @@
 	switch (keys) {
 	case 1:
-		return (dev_handle == fidx->dev_handle);
+		return (devmap_handle == fidx->devmap_handle);
 	case 3:
 		pfc = (fat_cluster_t) key[UPH_PFC_KEY];
 		pdi = (unsigned) key[UPH_PDI_KEY];
-		return (dev_handle == fidx->dev_handle) && (pfc == fidx->pfc) &&
+		return (devmap_handle == fidx->devmap_handle) && (pfc == fidx->pfc) &&
 		    (pdi == fidx->pdi);
 	default:
@@ -181,5 +181,5 @@
 /**
  * Global hash table of all used fat_idx_t structures.
- * The index structures are hashed by the dev_handle and index.
+ * The index structures are hashed by the devmap_handle and index.
  */
 static hash_table_t ui_hash;
@@ -193,10 +193,10 @@
 static hash_index_t idx_hash(unsigned long key[])
 {
-	dev_handle_t dev_handle = (dev_handle_t)key[UIH_DH_KEY];
+	devmap_handle_t devmap_handle = (devmap_handle_t)key[UIH_DH_KEY];
 	fs_index_t index = (fs_index_t)key[UIH_INDEX_KEY];
 
 	hash_index_t h;
 
-	h = dev_handle & ((1 << (UIH_BUCKETS_LOG / 2)) - 1);
+	h = devmap_handle & ((1 << (UIH_BUCKETS_LOG / 2)) - 1);
 	h |= (index & ((1 << (UIH_BUCKETS_LOG / 2)) - 1)) <<
 	    (UIH_BUCKETS_LOG / 2);
@@ -207,5 +207,5 @@
 static int idx_compare(unsigned long key[], hash_count_t keys, link_t *item)
 {
-	dev_handle_t dev_handle = (dev_handle_t)key[UIH_DH_KEY];
+	devmap_handle_t devmap_handle = (devmap_handle_t)key[UIH_DH_KEY];
 	fs_index_t index;
 	fat_idx_t *fidx = list_get_instance(item, fat_idx_t, uih_link);
@@ -213,8 +213,8 @@
 	switch (keys) {
 	case 1:
-		return (dev_handle == fidx->dev_handle);
+		return (devmap_handle == fidx->devmap_handle);
 	case 2:
 		index = (fs_index_t) key[UIH_INDEX_KEY];
-		return (dev_handle == fidx->dev_handle) &&
+		return (devmap_handle == fidx->devmap_handle) &&
 		    (index == fidx->index);
 	default:
@@ -239,10 +239,10 @@
 
 /** Allocate a VFS index which is not currently in use. */
-static bool fat_index_alloc(dev_handle_t dev_handle, fs_index_t *index)
+static bool fat_index_alloc(devmap_handle_t devmap_handle, fs_index_t *index)
 {
 	unused_t *u;
 	
 	assert(index);
-	u = unused_find(dev_handle, true);
+	u = unused_find(devmap_handle, true);
 	if (!u)
 		return false;	
@@ -301,9 +301,9 @@
 
 /** Free a VFS index, which is no longer in use. */
-static void fat_index_free(dev_handle_t dev_handle, fs_index_t index)
+static void fat_index_free(devmap_handle_t devmap_handle, fs_index_t index)
 {
 	unused_t *u;
 
-	u = unused_find(dev_handle, true);
+	u = unused_find(devmap_handle, true);
 	assert(u);
 
@@ -363,5 +363,5 @@
 }
 
-static int fat_idx_create(fat_idx_t **fidxp, dev_handle_t dev_handle)
+static int fat_idx_create(fat_idx_t **fidxp, devmap_handle_t devmap_handle)
 {
 	fat_idx_t *fidx;
@@ -370,5 +370,5 @@
 	if (!fidx) 
 		return ENOMEM;
-	if (!fat_index_alloc(dev_handle, &fidx->index)) {
+	if (!fat_index_alloc(devmap_handle, &fidx->index)) {
 		free(fidx);
 		return ENOSPC;
@@ -378,5 +378,5 @@
 	link_initialize(&fidx->uih_link);
 	fibril_mutex_initialize(&fidx->lock);
-	fidx->dev_handle = dev_handle;
+	fidx->devmap_handle = devmap_handle;
 	fidx->pfc = FAT_CLST_RES0;	/* no parent yet */
 	fidx->pdi = 0;
@@ -387,5 +387,5 @@
 }
 
-int fat_idx_get_new(fat_idx_t **fidxp, dev_handle_t dev_handle)
+int fat_idx_get_new(fat_idx_t **fidxp, devmap_handle_t devmap_handle)
 {
 	fat_idx_t *fidx;
@@ -393,5 +393,5 @@
 
 	fibril_mutex_lock(&used_lock);
-	rc = fat_idx_create(&fidx, dev_handle);
+	rc = fat_idx_create(&fidx, devmap_handle);
 	if (rc != EOK) {
 		fibril_mutex_unlock(&used_lock);
@@ -400,5 +400,5 @@
 		
 	unsigned long ikey[] = {
-		[UIH_DH_KEY] = dev_handle,
+		[UIH_DH_KEY] = devmap_handle,
 		[UIH_INDEX_KEY] = fidx->index,
 	};
@@ -413,10 +413,10 @@
 
 fat_idx_t *
-fat_idx_get_by_pos(dev_handle_t dev_handle, fat_cluster_t pfc, unsigned pdi)
+fat_idx_get_by_pos(devmap_handle_t devmap_handle, fat_cluster_t pfc, unsigned pdi)
 {
 	fat_idx_t *fidx;
 	link_t *l;
 	unsigned long pkey[] = {
-		[UPH_DH_KEY] = dev_handle,
+		[UPH_DH_KEY] = devmap_handle,
 		[UPH_PFC_KEY] = pfc,
 		[UPH_PDI_KEY] = pdi,
@@ -430,5 +430,5 @@
 		int rc;
 
-		rc = fat_idx_create(&fidx, dev_handle);
+		rc = fat_idx_create(&fidx, devmap_handle);
 		if (rc != EOK) {
 			fibril_mutex_unlock(&used_lock);
@@ -437,5 +437,5 @@
 		
 		unsigned long ikey[] = {
-			[UIH_DH_KEY] = dev_handle,
+			[UIH_DH_KEY] = devmap_handle,
 			[UIH_INDEX_KEY] = fidx->index,
 		};
@@ -456,5 +456,5 @@
 {
 	unsigned long pkey[] = {
-		[UPH_DH_KEY] = idx->dev_handle,
+		[UPH_DH_KEY] = idx->devmap_handle,
 		[UPH_PFC_KEY] = idx->pfc,
 		[UPH_PDI_KEY] = idx->pdi,
@@ -469,5 +469,5 @@
 {
 	unsigned long pkey[] = {
-		[UPH_DH_KEY] = idx->dev_handle,
+		[UPH_DH_KEY] = idx->devmap_handle,
 		[UPH_PFC_KEY] = idx->pfc,
 		[UPH_PDI_KEY] = idx->pdi,
@@ -480,10 +480,10 @@
 
 fat_idx_t *
-fat_idx_get_by_index(dev_handle_t dev_handle, fs_index_t index)
+fat_idx_get_by_index(devmap_handle_t devmap_handle, fs_index_t index)
 {
 	fat_idx_t *fidx = NULL;
 	link_t *l;
 	unsigned long ikey[] = {
-		[UIH_DH_KEY] = dev_handle,
+		[UIH_DH_KEY] = devmap_handle,
 		[UIH_INDEX_KEY] = index,
 	};
@@ -507,8 +507,8 @@
 {
 	unsigned long ikey[] = {
-		[UIH_DH_KEY] = idx->dev_handle,
+		[UIH_DH_KEY] = idx->devmap_handle,
 		[UIH_INDEX_KEY] = idx->index,
 	};
-	dev_handle_t dev_handle = idx->dev_handle;
+	devmap_handle_t devmap_handle = idx->devmap_handle;
 	fs_index_t index = idx->index;
 
@@ -524,5 +524,5 @@
 	fibril_mutex_unlock(&used_lock);
 	/* Release the VFS index. */
-	fat_index_free(dev_handle, index);
+	fat_index_free(devmap_handle, index);
 	/* The index structure itself is freed in idx_remove_callback(). */
 }
@@ -546,5 +546,5 @@
 }
 
-int fat_idx_init_by_dev_handle(dev_handle_t dev_handle)
+int fat_idx_init_by_devmap_handle(devmap_handle_t devmap_handle)
 {
 	unused_t *u;
@@ -554,7 +554,7 @@
 	if (!u)
 		return ENOMEM;
-	unused_initialize(u, dev_handle);
+	unused_initialize(u, devmap_handle);
 	fibril_mutex_lock(&unused_lock);
-	if (!unused_find(dev_handle, false)) {
+	if (!unused_find(devmap_handle, false)) {
 		list_append(&u->link, &unused_head);
 	} else {
@@ -566,11 +566,11 @@
 }
 
-void fat_idx_fini_by_dev_handle(dev_handle_t dev_handle)
+void fat_idx_fini_by_devmap_handle(devmap_handle_t devmap_handle)
 {
 	unsigned long ikey[] = {
-		[UIH_DH_KEY] = dev_handle
+		[UIH_DH_KEY] = devmap_handle
 	};
 	unsigned long pkey[] = {
-		[UPH_DH_KEY] = dev_handle
+		[UPH_DH_KEY] = devmap_handle
 	};
 
@@ -588,5 +588,5 @@
 	 * Free the unused and freed structures for this instance.
 	 */
-	unused_t *u = unused_find(dev_handle, true);
+	unused_t *u = unused_find(devmap_handle, true);
 	assert(u);
 	list_remove(&u->link);
Index: uspace/srv/fs/fat/fat_ops.c
===================================================================
--- uspace/srv/fs/fat/fat_ops.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/fs/fat/fat_ops.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -72,10 +72,10 @@
  * Forward declarations of FAT libfs operations.
  */
-static int fat_root_get(fs_node_t **, dev_handle_t);
+static int fat_root_get(fs_node_t **, devmap_handle_t);
 static int fat_match(fs_node_t **, fs_node_t *, const char *);
-static int fat_node_get(fs_node_t **, dev_handle_t, fs_index_t);
+static int fat_node_get(fs_node_t **, devmap_handle_t, fs_index_t);
 static int fat_node_open(fs_node_t *);
 static int fat_node_put(fs_node_t *);
-static int fat_create_node(fs_node_t **, dev_handle_t, int);
+static int fat_create_node(fs_node_t **, devmap_handle_t, int);
 static int fat_destroy_node(fs_node_t *);
 static int fat_link(fs_node_t *, fs_node_t *, const char *);
@@ -88,5 +88,5 @@
 static bool fat_is_directory(fs_node_t *);
 static bool fat_is_file(fs_node_t *node);
-static dev_handle_t fat_device_get(fs_node_t *node);
+static devmap_handle_t fat_device_get(fs_node_t *node);
 
 /*
@@ -120,8 +120,8 @@
 	assert(node->dirty);
 
-	bs = block_bb_get(node->idx->dev_handle);
+	bs = block_bb_get(node->idx->devmap_handle);
 	
 	/* Read the block that contains the dentry of interest. */
-	rc = _fat_block_get(&b, bs, node->idx->dev_handle, node->idx->pfc,
+	rc = _fat_block_get(&b, bs, node->idx->devmap_handle, node->idx->pfc,
 	    NULL, (node->idx->pdi * sizeof(fat_dentry_t)) / BPS(bs),
 	    BLOCK_FLAGS_NONE);
@@ -145,5 +145,5 @@
 }
 
-static int fat_node_fini_by_dev_handle(dev_handle_t dev_handle)
+static int fat_node_fini_by_devmap_handle(devmap_handle_t devmap_handle)
 {
 	link_t *lnk;
@@ -170,5 +170,5 @@
 			goto restart;
 		}
-		if (nodep->idx->dev_handle != dev_handle) {
+		if (nodep->idx->devmap_handle != devmap_handle) {
 			fibril_mutex_unlock(&nodep->idx->lock);
 			fibril_mutex_unlock(&nodep->lock);
@@ -299,8 +299,8 @@
 		return rc;
 
-	bs = block_bb_get(idxp->dev_handle);
+	bs = block_bb_get(idxp->devmap_handle);
 
 	/* Read the block that contains the dentry of interest. */
-	rc = _fat_block_get(&b, bs, idxp->dev_handle, idxp->pfc, NULL,
+	rc = _fat_block_get(&b, bs, idxp->devmap_handle, idxp->pfc, NULL,
 	    (idxp->pdi * sizeof(fat_dentry_t)) / BPS(bs), BLOCK_FLAGS_NONE);
 	if (rc != EOK) {
@@ -323,5 +323,5 @@
 		 */
 		uint16_t clusters;
-		rc = fat_clusters_get(&clusters, bs, idxp->dev_handle,
+		rc = fat_clusters_get(&clusters, bs, idxp->devmap_handle,
 		    uint16_t_le2host(d->firstc));
 		if (rc != EOK) {
@@ -356,7 +356,7 @@
  */
 
-int fat_root_get(fs_node_t **rfn, dev_handle_t dev_handle)
-{
-	return fat_node_get(rfn, dev_handle, 0);
+int fat_root_get(fs_node_t **rfn, devmap_handle_t devmap_handle)
+{
+	return fat_node_get(rfn, devmap_handle, 0);
 }
 
@@ -369,13 +369,13 @@
 	unsigned blocks;
 	fat_dentry_t *d;
-	dev_handle_t dev_handle;
+	devmap_handle_t devmap_handle;
 	block_t *b;
 	int rc;
 
 	fibril_mutex_lock(&parentp->idx->lock);
-	dev_handle = parentp->idx->dev_handle;
+	devmap_handle = parentp->idx->devmap_handle;
 	fibril_mutex_unlock(&parentp->idx->lock);
 
-	bs = block_bb_get(dev_handle);
+	bs = block_bb_get(devmap_handle);
 	blocks = parentp->size / BPS(bs);
 	for (i = 0; i < blocks; i++) {
@@ -402,5 +402,5 @@
 				/* hit */
 				fat_node_t *nodep;
-				fat_idx_t *idx = fat_idx_get_by_pos(dev_handle,
+				fat_idx_t *idx = fat_idx_get_by_pos(devmap_handle,
 				    parentp->firstc, i * DPS(bs) + j);
 				if (!idx) {
@@ -435,5 +435,5 @@
 
 /** Instantiate a FAT in-core node. */
-int fat_node_get(fs_node_t **rfn, dev_handle_t dev_handle, fs_index_t index)
+int fat_node_get(fs_node_t **rfn, devmap_handle_t devmap_handle, fs_index_t index)
 {
 	fat_node_t *nodep;
@@ -441,5 +441,5 @@
 	int rc;
 
-	idxp = fat_idx_get_by_index(dev_handle, index);
+	idxp = fat_idx_get_by_index(devmap_handle, index);
 	if (!idxp) {
 		*rfn = NULL;
@@ -492,5 +492,5 @@
 }
 
-int fat_create_node(fs_node_t **rfn, dev_handle_t dev_handle, int flags)
+int fat_create_node(fs_node_t **rfn, devmap_handle_t devmap_handle, int flags)
 {
 	fat_idx_t *idxp;
@@ -500,14 +500,14 @@
 	int rc;
 
-	bs = block_bb_get(dev_handle);
+	bs = block_bb_get(devmap_handle);
 	if (flags & L_DIRECTORY) {
 		/* allocate a cluster */
-		rc = fat_alloc_clusters(bs, dev_handle, 1, &mcl, &lcl);
+		rc = fat_alloc_clusters(bs, devmap_handle, 1, &mcl, &lcl);
 		if (rc != EOK)
 			return rc;
 		/* populate the new cluster with unused dentries */
-		rc = fat_zero_cluster(bs, dev_handle, mcl);
+		rc = fat_zero_cluster(bs, devmap_handle, mcl);
 		if (rc != EOK) {
-			(void) fat_free_clusters(bs, dev_handle, mcl);
+			(void) fat_free_clusters(bs, devmap_handle, mcl);
 			return rc;
 		}
@@ -516,10 +516,10 @@
 	rc = fat_node_get_new(&nodep);
 	if (rc != EOK) {
-		(void) fat_free_clusters(bs, dev_handle, mcl);
+		(void) fat_free_clusters(bs, devmap_handle, mcl);
 		return rc;
 	}
-	rc = fat_idx_get_new(&idxp, dev_handle);
-	if (rc != EOK) {
-		(void) fat_free_clusters(bs, dev_handle, mcl);	
+	rc = fat_idx_get_new(&idxp, devmap_handle);
+	if (rc != EOK) {
+		(void) fat_free_clusters(bs, devmap_handle, mcl);	
 		(void) fat_node_put(FS_NODE(nodep));
 		return rc;
@@ -570,9 +570,9 @@
 	assert(!has_children);
 
-	bs = block_bb_get(nodep->idx->dev_handle);
+	bs = block_bb_get(nodep->idx->devmap_handle);
 	if (nodep->firstc != FAT_CLST_RES0) {
 		assert(nodep->size);
 		/* Free all clusters allocated to the node. */
-		rc = fat_free_clusters(bs, nodep->idx->dev_handle,
+		rc = fat_free_clusters(bs, nodep->idx->devmap_handle,
 		    nodep->firstc);
 	}
@@ -620,5 +620,5 @@
 	
 	fibril_mutex_lock(&parentp->idx->lock);
-	bs = block_bb_get(parentp->idx->dev_handle);
+	bs = block_bb_get(parentp->idx->devmap_handle);
 
 	blocks = parentp->size / BPS(bs);
@@ -659,12 +659,12 @@
 		return ENOSPC;
 	}
-	rc = fat_alloc_clusters(bs, parentp->idx->dev_handle, 1, &mcl, &lcl);
+	rc = fat_alloc_clusters(bs, parentp->idx->devmap_handle, 1, &mcl, &lcl);
 	if (rc != EOK) {
 		fibril_mutex_unlock(&parentp->idx->lock);
 		return rc;
 	}
-	rc = fat_zero_cluster(bs, parentp->idx->dev_handle, mcl);
-	if (rc != EOK) {
-		(void) fat_free_clusters(bs, parentp->idx->dev_handle, mcl);
+	rc = fat_zero_cluster(bs, parentp->idx->devmap_handle, mcl);
+	if (rc != EOK) {
+		(void) fat_free_clusters(bs, parentp->idx->devmap_handle, mcl);
 		fibril_mutex_unlock(&parentp->idx->lock);
 		return rc;
@@ -672,5 +672,5 @@
 	rc = fat_append_clusters(bs, parentp, mcl, lcl);
 	if (rc != EOK) {
-		(void) fat_free_clusters(bs, parentp->idx->dev_handle, mcl);
+		(void) fat_free_clusters(bs, parentp->idx->devmap_handle, mcl);
 		fibril_mutex_unlock(&parentp->idx->lock);
 		return rc;
@@ -789,7 +789,7 @@
 	assert(childp->lnkcnt == 1);
 	fibril_mutex_lock(&childp->idx->lock);
-	bs = block_bb_get(childp->idx->dev_handle);
-
-	rc = _fat_block_get(&b, bs, childp->idx->dev_handle, childp->idx->pfc,
+	bs = block_bb_get(childp->idx->devmap_handle);
+
+	rc = _fat_block_get(&b, bs, childp->idx->devmap_handle, childp->idx->pfc,
 	    NULL, (childp->idx->pdi * sizeof(fat_dentry_t)) / BPS(bs),
 	    BLOCK_FLAGS_NONE);
@@ -840,5 +840,5 @@
 	
 	fibril_mutex_lock(&nodep->idx->lock);
-	bs = block_bb_get(nodep->idx->dev_handle);
+	bs = block_bb_get(nodep->idx->devmap_handle);
 
 	blocks = nodep->size / BPS(bs);
@@ -914,5 +914,5 @@
 }
 
-dev_handle_t fat_device_get(fs_node_t *node)
+devmap_handle_t fat_device_get(fs_node_t *node)
 {
 	return 0;
@@ -946,5 +946,5 @@
 void fat_mounted(ipc_callid_t rid, ipc_call_t *request)
 {
-	dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request);
+	devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
 	enum cache_mode cmode;
 	fat_bs_t *bs;
@@ -968,5 +968,5 @@
 
 	/* initialize libblock */
-	rc = block_init(dev_handle, BS_SIZE);
+	rc = block_init(devmap_handle, BS_SIZE);
 	if (rc != EOK) {
 		ipc_answer_0(rid, rc);
@@ -975,7 +975,7 @@
 
 	/* prepare the boot block */
-	rc = block_bb_read(dev_handle, BS_BLOCK);
-	if (rc != EOK) {
-		block_fini(dev_handle);
+	rc = block_bb_read(devmap_handle, BS_BLOCK);
+	if (rc != EOK) {
+		block_fini(devmap_handle);
 		ipc_answer_0(rid, rc);
 		return;
@@ -983,8 +983,8 @@
 
 	/* get the buffer with the boot sector */
-	bs = block_bb_get(dev_handle);
+	bs = block_bb_get(devmap_handle);
 	
 	if (BPS(bs) != BS_SIZE) {
-		block_fini(dev_handle);
+		block_fini(devmap_handle);
 		ipc_answer_0(rid, ENOTSUP);
 		return;
@@ -992,7 +992,7 @@
 
 	/* Initialize the block cache */
-	rc = block_cache_init(dev_handle, BPS(bs), 0 /* XXX */, cmode);
-	if (rc != EOK) {
-		block_fini(dev_handle);
+	rc = block_cache_init(devmap_handle, BPS(bs), 0 /* XXX */, cmode);
+	if (rc != EOK) {
+		block_fini(devmap_handle);
 		ipc_answer_0(rid, rc);
 		return;
@@ -1000,16 +1000,16 @@
 
 	/* Do some simple sanity checks on the file system. */
-	rc = fat_sanity_check(bs, dev_handle);
-	if (rc != EOK) {
-		(void) block_cache_fini(dev_handle);
-		block_fini(dev_handle);
+	rc = fat_sanity_check(bs, devmap_handle);
+	if (rc != EOK) {
+		(void) block_cache_fini(devmap_handle);
+		block_fini(devmap_handle);
 		ipc_answer_0(rid, rc);
 		return;
 	}
 
-	rc = fat_idx_init_by_dev_handle(dev_handle);
-	if (rc != EOK) {
-		(void) block_cache_fini(dev_handle);
-		block_fini(dev_handle);
+	rc = fat_idx_init_by_devmap_handle(devmap_handle);
+	if (rc != EOK) {
+		(void) block_cache_fini(devmap_handle);
+		block_fini(devmap_handle);
 		ipc_answer_0(rid, rc);
 		return;
@@ -1019,7 +1019,7 @@
 	fs_node_t *rfn = (fs_node_t *)malloc(sizeof(fs_node_t));
 	if (!rfn) {
-		(void) block_cache_fini(dev_handle);
-		block_fini(dev_handle);
-		fat_idx_fini_by_dev_handle(dev_handle);
+		(void) block_cache_fini(devmap_handle);
+		block_fini(devmap_handle);
+		fat_idx_fini_by_devmap_handle(devmap_handle);
 		ipc_answer_0(rid, ENOMEM);
 		return;
@@ -1029,7 +1029,7 @@
 	if (!rootp) {
 		free(rfn);
-		(void) block_cache_fini(dev_handle);
-		block_fini(dev_handle);
-		fat_idx_fini_by_dev_handle(dev_handle);
+		(void) block_cache_fini(devmap_handle);
+		block_fini(devmap_handle);
+		fat_idx_fini_by_devmap_handle(devmap_handle);
 		ipc_answer_0(rid, ENOMEM);
 		return;
@@ -1037,11 +1037,11 @@
 	fat_node_initialize(rootp);
 
-	fat_idx_t *ridxp = fat_idx_get_by_pos(dev_handle, FAT_CLST_ROOTPAR, 0);
+	fat_idx_t *ridxp = fat_idx_get_by_pos(devmap_handle, FAT_CLST_ROOTPAR, 0);
 	if (!ridxp) {
 		free(rfn);
 		free(rootp);
-		(void) block_cache_fini(dev_handle);
-		block_fini(dev_handle);
-		fat_idx_fini_by_dev_handle(dev_handle);
+		(void) block_cache_fini(devmap_handle);
+		block_fini(devmap_handle);
+		fat_idx_fini_by_devmap_handle(devmap_handle);
 		ipc_answer_0(rid, ENOMEM);
 		return;
@@ -1072,10 +1072,10 @@
 void fat_unmounted(ipc_callid_t rid, ipc_call_t *request)
 {
-	dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request);
+	devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
 	fs_node_t *fn;
 	fat_node_t *nodep;
 	int rc;
 
-	rc = fat_root_get(&fn, dev_handle);
+	rc = fat_root_get(&fn, devmap_handle);
 	if (rc != EOK) {
 		ipc_answer_0(rid, rc);
@@ -1105,8 +1105,8 @@
 	 * stop using libblock for this instance.
 	 */
-	(void) fat_node_fini_by_dev_handle(dev_handle);
-	fat_idx_fini_by_dev_handle(dev_handle);
-	(void) block_cache_fini(dev_handle);
-	block_fini(dev_handle);
+	(void) fat_node_fini_by_devmap_handle(devmap_handle);
+	fat_idx_fini_by_devmap_handle(devmap_handle);
+	(void) block_cache_fini(devmap_handle);
+	block_fini(devmap_handle);
 
 	ipc_answer_0(rid, EOK);
@@ -1125,5 +1125,5 @@
 void fat_read(ipc_callid_t rid, ipc_call_t *request)
 {
-	dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request);
+	devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
 	fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
 	aoff64_t pos =
@@ -1136,5 +1136,5 @@
 	int rc;
 
-	rc = fat_node_get(&fn, dev_handle, index);
+	rc = fat_node_get(&fn, devmap_handle, index);
 	if (rc != EOK) {
 		ipc_answer_0(rid, rc);
@@ -1156,5 +1156,5 @@
 	}
 
-	bs = block_bb_get(dev_handle);
+	bs = block_bb_get(devmap_handle);
 
 	if (nodep->type == FAT_FILE) {
@@ -1262,5 +1262,5 @@
 void fat_write(ipc_callid_t rid, ipc_call_t *request)
 {
-	dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request);
+	devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
 	fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
 	aoff64_t pos =
@@ -1275,5 +1275,5 @@
 	int rc;
 	
-	rc = fat_node_get(&fn, dev_handle, index);
+	rc = fat_node_get(&fn, devmap_handle, index);
 	if (rc != EOK) {
 		ipc_answer_0(rid, rc);
@@ -1295,5 +1295,5 @@
 	}
 
-	bs = block_bb_get(dev_handle);
+	bs = block_bb_get(devmap_handle);
 
 	/*
@@ -1357,5 +1357,5 @@
 		nclsts = (ROUND_UP(pos + bytes, BPC(bs)) - boundary) / BPC(bs);
 		/* create an independent chain of nclsts clusters in all FATs */
-		rc = fat_alloc_clusters(bs, dev_handle, nclsts, &mcl, &lcl);
+		rc = fat_alloc_clusters(bs, devmap_handle, nclsts, &mcl, &lcl);
 		if (rc != EOK) {
 			/* could not allocate a chain of nclsts clusters */
@@ -1368,5 +1368,5 @@
 		rc = fat_fill_gap(bs, nodep, mcl, pos);
 		if (rc != EOK) {
-			(void) fat_free_clusters(bs, dev_handle, mcl);
+			(void) fat_free_clusters(bs, devmap_handle, mcl);
 			(void) fat_node_put(fn);
 			ipc_answer_0(callid, rc);
@@ -1374,8 +1374,8 @@
 			return;
 		}
-		rc = _fat_block_get(&b, bs, dev_handle, lcl, NULL,
+		rc = _fat_block_get(&b, bs, devmap_handle, lcl, NULL,
 		    (pos / BPS(bs)) % SPC(bs), flags);
 		if (rc != EOK) {
-			(void) fat_free_clusters(bs, dev_handle, mcl);
+			(void) fat_free_clusters(bs, devmap_handle, mcl);
 			(void) fat_node_put(fn);
 			ipc_answer_0(callid, rc);
@@ -1388,5 +1388,5 @@
 		rc = block_put(b);
 		if (rc != EOK) {
-			(void) fat_free_clusters(bs, dev_handle, mcl);
+			(void) fat_free_clusters(bs, devmap_handle, mcl);
 			(void) fat_node_put(fn);
 			ipc_answer_0(rid, rc);
@@ -1399,5 +1399,5 @@
 		rc = fat_append_clusters(bs, nodep, mcl, lcl);
 		if (rc != EOK) {
-			(void) fat_free_clusters(bs, dev_handle, mcl);
+			(void) fat_free_clusters(bs, devmap_handle, mcl);
 			(void) fat_node_put(fn);
 			ipc_answer_0(rid, rc);
@@ -1414,5 +1414,5 @@
 void fat_truncate(ipc_callid_t rid, ipc_call_t *request)
 {
-	dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request);
+	devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
 	fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
 	aoff64_t size =
@@ -1423,5 +1423,5 @@
 	int rc;
 
-	rc = fat_node_get(&fn, dev_handle, index);
+	rc = fat_node_get(&fn, devmap_handle, index);
 	if (rc != EOK) {
 		ipc_answer_0(rid, rc);
@@ -1434,5 +1434,5 @@
 	nodep = FAT_NODE(fn);
 
-	bs = block_bb_get(dev_handle);
+	bs = block_bb_get(devmap_handle);
 
 	if (nodep->size == size) {
@@ -1461,5 +1461,5 @@
 		} else {
 			fat_cluster_t lastc;
-			rc = fat_cluster_walk(bs, dev_handle, nodep->firstc,
+			rc = fat_cluster_walk(bs, devmap_handle, nodep->firstc,
 			    &lastc, NULL, (size - 1) / BPC(bs));
 			if (rc != EOK)
@@ -1486,10 +1486,10 @@
 void fat_destroy(ipc_callid_t rid, ipc_call_t *request)
 {
-	dev_handle_t dev_handle = (dev_handle_t)IPC_GET_ARG1(*request);
+	devmap_handle_t devmap_handle = (devmap_handle_t)IPC_GET_ARG1(*request);
 	fs_index_t index = (fs_index_t)IPC_GET_ARG2(*request);
 	fs_node_t *fn;
 	int rc;
 
-	rc = fat_node_get(&fn, dev_handle, index);
+	rc = fat_node_get(&fn, devmap_handle, index);
 	if (rc != EOK) {
 		ipc_answer_0(rid, rc);
@@ -1517,9 +1517,9 @@
 void fat_sync(ipc_callid_t rid, ipc_call_t *request)
 {
-	dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request);
+	devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
 	fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
 	
 	fs_node_t *fn;
-	int rc = fat_node_get(&fn, dev_handle, index);
+	int rc = fat_node_get(&fn, devmap_handle, index);
 	if (rc != EOK) {
 		ipc_answer_0(rid, rc);
Index: uspace/srv/fs/tmpfs/tmpfs.h
===================================================================
--- uspace/srv/fs/tmpfs/tmpfs.h	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/fs/tmpfs/tmpfs.h	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -62,5 +62,5 @@
 	fs_node_t *bp;		/**< Back pointer to the FS node. */
 	fs_index_t index;	/**< TMPFS node index. */
-	dev_handle_t dev_handle;/**< Device handle. */
+	devmap_handle_t devmap_handle;/**< Device handle. */
 	link_t nh_link;		/**< Nodes hash table link. */
 	tmpfs_dentry_type_t type;
@@ -91,5 +91,5 @@
 extern void tmpfs_sync(ipc_callid_t, ipc_call_t *);
 
-extern bool tmpfs_restore(dev_handle_t);
+extern bool tmpfs_restore(devmap_handle_t);
 
 #endif
Index: uspace/srv/fs/tmpfs/tmpfs_dump.c
===================================================================
--- uspace/srv/fs/tmpfs/tmpfs_dump.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/fs/tmpfs/tmpfs_dump.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -55,5 +55,5 @@
 
 static bool
-tmpfs_restore_recursion(dev_handle_t dev, size_t *bufpos, size_t *buflen,
+tmpfs_restore_recursion(devmap_handle_t dev, size_t *bufpos, size_t *buflen,
     aoff64_t *pos, fs_node_t *pfn)
 {
@@ -161,5 +161,5 @@
 }
 
-bool tmpfs_restore(dev_handle_t dev)
+bool tmpfs_restore(devmap_handle_t dev)
 {
 	libfs_ops_t *ops = &tmpfs_libfs_ops;
Index: uspace/srv/fs/tmpfs/tmpfs_ops.c
===================================================================
--- uspace/srv/fs/tmpfs/tmpfs_ops.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/fs/tmpfs/tmpfs_ops.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -70,8 +70,8 @@
 /* Forward declarations of static functions. */
 static int tmpfs_match(fs_node_t **, fs_node_t *, const char *);
-static int tmpfs_node_get(fs_node_t **, dev_handle_t, fs_index_t);
+static int tmpfs_node_get(fs_node_t **, devmap_handle_t, fs_index_t);
 static int tmpfs_node_open(fs_node_t *);
 static int tmpfs_node_put(fs_node_t *);
-static int tmpfs_create_node(fs_node_t **, dev_handle_t, int);
+static int tmpfs_create_node(fs_node_t **, devmap_handle_t, int);
 static int tmpfs_destroy_node(fs_node_t *);
 static int tmpfs_link_node(fs_node_t *, fs_node_t *, const char *);
@@ -79,7 +79,7 @@
 
 /* Implementation of helper functions. */
-static int tmpfs_root_get(fs_node_t **rfn, dev_handle_t dev_handle)
-{
-	return tmpfs_node_get(rfn, dev_handle, TMPFS_SOME_ROOT); 
+static int tmpfs_root_get(fs_node_t **rfn, devmap_handle_t devmap_handle)
+{
+	return tmpfs_node_get(rfn, devmap_handle, TMPFS_SOME_ROOT); 
 }
 
@@ -120,5 +120,5 @@
 }
 
-static dev_handle_t tmpfs_device_get(fs_node_t *fn)
+static devmap_handle_t tmpfs_device_get(fs_node_t *fn)
 {
 	return 0;
@@ -165,7 +165,7 @@
 	switch (keys) {
 	case 1:
-		return (nodep->dev_handle == key[NODES_KEY_DEV]);
+		return (nodep->devmap_handle == key[NODES_KEY_DEV]);
 	case 2:	
-		return ((nodep->dev_handle == key[NODES_KEY_DEV]) &&
+		return ((nodep->devmap_handle == key[NODES_KEY_DEV]) &&
 		    (nodep->index == key[NODES_KEY_INDEX]));
 	default:
@@ -209,5 +209,5 @@
 	nodep->bp = NULL;
 	nodep->index = 0;
-	nodep->dev_handle = 0;
+	nodep->devmap_handle = 0;
 	nodep->type = TMPFS_NONE;
 	nodep->lnkcnt = 0;
@@ -233,10 +233,10 @@
 }
 
-static bool tmpfs_instance_init(dev_handle_t dev_handle)
+static bool tmpfs_instance_init(devmap_handle_t devmap_handle)
 {
 	fs_node_t *rfn;
 	int rc;
 	
-	rc = tmpfs_create_node(&rfn, dev_handle, L_DIRECTORY);
+	rc = tmpfs_create_node(&rfn, devmap_handle, L_DIRECTORY);
 	if (rc != EOK || !rfn)
 		return false;
@@ -245,8 +245,8 @@
 }
 
-static void tmpfs_instance_done(dev_handle_t dev_handle)
+static void tmpfs_instance_done(devmap_handle_t devmap_handle)
 {
 	unsigned long key[] = {
-		[NODES_KEY_DEV] = dev_handle
+		[NODES_KEY_DEV] = devmap_handle
 	};
 	/*
@@ -279,8 +279,8 @@
 }
 
-int tmpfs_node_get(fs_node_t **rfn, dev_handle_t dev_handle, fs_index_t index)
+int tmpfs_node_get(fs_node_t **rfn, devmap_handle_t devmap_handle, fs_index_t index)
 {
 	unsigned long key[] = {
-		[NODES_KEY_DEV] = dev_handle,
+		[NODES_KEY_DEV] = devmap_handle,
 		[NODES_KEY_INDEX] = index
 	};
@@ -308,5 +308,5 @@
 }
 
-int tmpfs_create_node(fs_node_t **rfn, dev_handle_t dev_handle, int lflag)
+int tmpfs_create_node(fs_node_t **rfn, devmap_handle_t devmap_handle, int lflag)
 {
 	fs_node_t *rootfn;
@@ -327,5 +327,5 @@
 	nodep->bp->data = nodep;	/* link the FS and TMPFS nodes */
 
-	rc = tmpfs_root_get(&rootfn, dev_handle);
+	rc = tmpfs_root_get(&rootfn, devmap_handle);
 	assert(rc == EOK);
 	if (!rootfn)
@@ -333,5 +333,5 @@
 	else
 		nodep->index = tmpfs_next_index++;
-	nodep->dev_handle = dev_handle;
+	nodep->devmap_handle = devmap_handle;
 	if (lflag & L_DIRECTORY) 
 		nodep->type = TMPFS_DIRECTORY;
@@ -341,5 +341,5 @@
 	/* Insert the new node into the nodes hash table. */
 	unsigned long key[] = {
-		[NODES_KEY_DEV] = nodep->dev_handle,
+		[NODES_KEY_DEV] = nodep->devmap_handle,
 		[NODES_KEY_INDEX] = nodep->index
 	};
@@ -357,5 +357,5 @@
 
 	unsigned long key[] = {
-		[NODES_KEY_DEV] = nodep->dev_handle,
+		[NODES_KEY_DEV] = nodep->devmap_handle,
 		[NODES_KEY_INDEX] = nodep->index
 	};
@@ -442,5 +442,5 @@
 void tmpfs_mounted(ipc_callid_t rid, ipc_call_t *request)
 {
-	dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request);
+	devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
 	fs_node_t *rootfn;
 	int rc;
@@ -455,5 +455,5 @@
 
 	/* Check if this device is not already mounted. */
-	rc = tmpfs_root_get(&rootfn, dev_handle);
+	rc = tmpfs_root_get(&rootfn, devmap_handle);
 	if ((rc == EOK) && (rootfn)) {
 		(void) tmpfs_node_put(rootfn);
@@ -464,5 +464,5 @@
 
 	/* Initialize TMPFS instance. */
-	if (!tmpfs_instance_init(dev_handle)) {
+	if (!tmpfs_instance_init(devmap_handle)) {
 		free(opts);
 		ipc_answer_0(rid, ENOMEM);
@@ -470,9 +470,9 @@
 	}
 
-	rc = tmpfs_root_get(&rootfn, dev_handle);
+	rc = tmpfs_root_get(&rootfn, devmap_handle);
 	assert(rc == EOK);
 	tmpfs_node_t *rootp = TMPFS_NODE(rootfn);
 	if (str_cmp(opts, "restore") == 0) {
-		if (tmpfs_restore(dev_handle))
+		if (tmpfs_restore(devmap_handle))
 			ipc_answer_3(rid, EOK, rootp->index, rootp->size,
 			    rootp->lnkcnt);
@@ -493,7 +493,7 @@
 void tmpfs_unmounted(ipc_callid_t rid, ipc_call_t *request)
 {
-	dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request);
-
-	tmpfs_instance_done(dev_handle);
+	devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
+
+	tmpfs_instance_done(devmap_handle);
 	ipc_answer_0(rid, EOK);
 }
@@ -511,5 +511,5 @@
 void tmpfs_read(ipc_callid_t rid, ipc_call_t *request)
 {
-	dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request);
+	devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
 	fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
 	aoff64_t pos =
@@ -521,5 +521,5 @@
 	link_t *hlp;
 	unsigned long key[] = {
-		[NODES_KEY_DEV] = dev_handle,
+		[NODES_KEY_DEV] = devmap_handle,
 		[NODES_KEY_INDEX] = index
 	};
@@ -586,5 +586,5 @@
 void tmpfs_write(ipc_callid_t rid, ipc_call_t *request)
 {
-	dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request);
+	devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
 	fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
 	aoff64_t pos =
@@ -596,5 +596,5 @@
 	link_t *hlp;
 	unsigned long key[] = {
-		[NODES_KEY_DEV] = dev_handle,
+		[NODES_KEY_DEV] = devmap_handle,
 		[NODES_KEY_INDEX] = index
 	};
@@ -651,5 +651,5 @@
 void tmpfs_truncate(ipc_callid_t rid, ipc_call_t *request)
 {
-	dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request);
+	devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
 	fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
 	aoff64_t size =
@@ -660,5 +660,5 @@
 	 */
 	unsigned long key[] = {
-		[NODES_KEY_DEV] = dev_handle,
+		[NODES_KEY_DEV] = devmap_handle,
 		[NODES_KEY_INDEX] = index
 	};
@@ -704,5 +704,5 @@
 void tmpfs_destroy(ipc_callid_t rid, ipc_call_t *request)
 {
-	dev_handle_t dev_handle = (dev_handle_t)IPC_GET_ARG1(*request);
+	devmap_handle_t devmap_handle = (devmap_handle_t)IPC_GET_ARG1(*request);
 	fs_index_t index = (fs_index_t)IPC_GET_ARG2(*request);
 	int rc;
@@ -710,5 +710,5 @@
 	link_t *hlp;
 	unsigned long key[] = {
-		[NODES_KEY_DEV] = dev_handle,
+		[NODES_KEY_DEV] = devmap_handle,
 		[NODES_KEY_INDEX] = index
 	};
Index: uspace/srv/hid/adb_mouse/adb_mouse.c
===================================================================
--- uspace/srv/hid/adb_mouse/adb_mouse.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/hid/adb_mouse/adb_mouse.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -78,6 +78,6 @@
 	snprintf(dev_path, DEVMAP_NAME_MAXLEN, "%s/mouse", NAMESPACE);
 
-	dev_handle_t dev_handle;
-	if (devmap_device_register(dev_path, &dev_handle) != EOK) {
+	devmap_handle_t devmap_handle;
+	if (devmap_device_register(dev_path, &devmap_handle) != EOK) {
 		printf(NAME ": Unable to register device %s\n", dev_path);
 		return -1;
Index: uspace/srv/hid/char_mouse/char_mouse.c
===================================================================
--- uspace/srv/hid/char_mouse/char_mouse.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/hid/char_mouse/char_mouse.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -134,6 +134,6 @@
 	snprintf(dev_path, DEVMAP_NAME_MAXLEN, "%s/%s", NAMESPACE, NAME);
 
-	dev_handle_t dev_handle;
-	if (devmap_device_register(dev_path, &dev_handle) != EOK) {
+	devmap_handle_t devmap_handle;
+	if (devmap_device_register(dev_path, &devmap_handle) != EOK) {
 		printf(NAME ": Unable to register device %s\n", dev_path);
 		return -1;
Index: uspace/srv/hid/console/console.c
===================================================================
--- uspace/srv/hid/console/console.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/hid/console/console.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -82,5 +82,5 @@
 	size_t index;             /**< Console index */
 	size_t refcount;          /**< Connection reference count */
-	dev_handle_t dev_handle;  /**< Device handle */
+	devmap_handle_t devmap_handle;  /**< Device handle */
 	keybuffer_t keybuffer;    /**< Buffer for incoming keys. */
 	screenbuffer_t scr;       /**< Screenbuffer for saving screen
@@ -571,5 +571,5 @@
 			continue;
 		
-		if (consoles[i].dev_handle == (dev_handle_t) IPC_GET_ARG1(*icall)) {
+		if (consoles[i].devmap_handle == (devmap_handle_t) IPC_GET_ARG1(*icall)) {
 			cons = &consoles[i];
 			break;
@@ -815,5 +815,5 @@
 			snprintf(vc, DEVMAP_NAME_MAXLEN, "%s/vc%u", NAMESPACE, i);
 			
-			if (devmap_device_register(vc, &consoles[i].dev_handle) != EOK) {
+			if (devmap_device_register(vc, &consoles[i].devmap_handle) != EOK) {
 				devmap_hangup_phone(DEVMAP_DRIVER);
 				printf(NAME ": Unable to register device %s\n", vc);
Index: uspace/srv/hid/kbd/generic/kbd.c
===================================================================
--- uspace/srv/hid/kbd/generic/kbd.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/hid/kbd/generic/kbd.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -250,6 +250,6 @@
 	snprintf(kbd, DEVMAP_NAME_MAXLEN, "%s/%s", NAMESPACE, NAME);
 	
-	dev_handle_t dev_handle;
-	if (devmap_device_register(kbd, &dev_handle) != EOK) {
+	devmap_handle_t devmap_handle;
+	if (devmap_device_register(kbd, &devmap_handle) != EOK) {
 		printf("%s: Unable to register device %s\n", NAME, kbd);
 		return -1;
Index: uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c
===================================================================
--- uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -99,5 +99,5 @@
 		return -1;
 
-	rc = devmap_device_register(NAMESPACE "/mouse", &ts->dev_handle);
+	rc = devmap_device_register(NAMESPACE "/mouse", &ts->devmap_handle);
 	if (rc != EOK) {
 		devmap_hangup_phone(DEVMAP_DRIVER);
Index: uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.h
===================================================================
--- uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.h	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.h	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -125,5 +125,5 @@
 
 	/** Device handle */
-	dev_handle_t dev_handle;
+	devmap_handle_t devmap_handle;
 
 	/** Device/driver state */
Index: uspace/srv/hw/bus/cuda_adb/cuda_adb.c
===================================================================
--- uspace/srv/hw/bus/cuda_adb/cuda_adb.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/hw/bus/cuda_adb/cuda_adb.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -143,5 +143,5 @@
 int main(int argc, char *argv[])
 {
-	dev_handle_t dev_handle;
+	devmap_handle_t devmap_handle;
 	int rc;
 	int i;
@@ -151,5 +151,5 @@
 	for (i = 0; i < ADB_MAX_ADDR; ++i) {
 		adb_dev[i].client_phone = -1;
-		adb_dev[i].dev_handle = 0;
+		adb_dev[i].devmap_handle = 0;
 	}
 
@@ -160,5 +160,5 @@
 	}
 
-	rc = devmap_device_register("adb/kbd", &dev_handle);
+	rc = devmap_device_register("adb/kbd", &devmap_handle);
 	if (rc != EOK) {
 		devmap_hangup_phone(DEVMAP_DRIVER);
@@ -167,8 +167,8 @@
 	}
 
-	adb_dev[2].dev_handle = dev_handle;
-	adb_dev[8].dev_handle = dev_handle;
-
-	rc = devmap_device_register("adb/mouse", &dev_handle);
+	adb_dev[2].devmap_handle = devmap_handle;
+	adb_dev[8].devmap_handle = devmap_handle;
+
+	rc = devmap_device_register("adb/mouse", &devmap_handle);
 	if (rc != EOK) {
 		devmap_hangup_phone(DEVMAP_DRIVER);
@@ -177,5 +177,5 @@
 	}
 
-	adb_dev[9].dev_handle = dev_handle;
+	adb_dev[9].devmap_handle = devmap_handle;
 
 	if (cuda_init() < 0) {
@@ -196,5 +196,5 @@
 	ipc_call_t call;
 	ipcarg_t method;
-	dev_handle_t dh;
+	devmap_handle_t dh;
 	int retval;
 	int dev_addr, i;
@@ -206,5 +206,5 @@
 	dev_addr = -1;
 	for (i = 0; i < ADB_MAX_ADDR; i++) {
-		if (adb_dev[i].dev_handle == dh)
+		if (adb_dev[i].devmap_handle == dh)
 			dev_addr = i;
 	}
@@ -237,5 +237,5 @@
 			 */
 			for (i = 0; i < ADB_MAX_ADDR; ++i) {
-				if (adb_dev[i].dev_handle == dh) {
+				if (adb_dev[i].devmap_handle == dh) {
 					adb_dev[i].client_phone = IPC_GET_ARG5(call);
 				}
Index: uspace/srv/hw/bus/cuda_adb/cuda_adb.h
===================================================================
--- uspace/srv/hw/bus/cuda_adb/cuda_adb.h	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/hw/bus/cuda_adb/cuda_adb.h	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -104,5 +104,5 @@
 
 typedef struct {
-	dev_handle_t dev_handle;
+	devmap_handle_t devmap_handle;
 	int client_phone;
 } adb_dev_t;
Index: uspace/srv/hw/char/i8042/i8042.c
===================================================================
--- uspace/srv/hw/char/i8042/i8042.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/hw/char/i8042/i8042.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -145,5 +145,5 @@
 
 		snprintf(name, 16, "%s/ps2%c", NAMESPACE, dchar[i]);
-		rc = devmap_device_register(name, &i8042_port[i].dev_handle);
+		rc = devmap_device_register(name, &i8042_port[i].devmap_handle);
 		if (rc != EOK) {
 			devmap_hangup_phone(DEVMAP_DRIVER);
@@ -218,5 +218,5 @@
 	ipc_call_t call;
 	ipcarg_t method;
-	dev_handle_t dh;
+	devmap_handle_t dh;
 	int retval;
 	int dev_id, i;
@@ -230,5 +230,5 @@
 	dev_id = -1;
 	for (i = 0; i < MAX_DEVS; i++) {
-		if (i8042_port[i].dev_handle == dh)
+		if (i8042_port[i].devmap_handle == dh)
 			dev_id = i;
 	}
Index: uspace/srv/hw/char/i8042/i8042.h
===================================================================
--- uspace/srv/hw/char/i8042/i8042.h	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/hw/char/i8042/i8042.h	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -52,5 +52,5 @@
 /** Softstate structure, one for each serial port (primary and aux). */
 typedef struct {
-	dev_handle_t dev_handle;
+	devmap_handle_t devmap_handle;
 	int client_phone;
 } i8042_port_t;
Index: uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.c
===================================================================
--- uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -92,5 +92,5 @@
 		return -1;
 
-	rc = devmap_device_register(NAMESPACE "/" NAME, &uart->dev_handle);
+	rc = devmap_device_register(NAMESPACE "/" NAME, &uart->devmap_handle);
 	if (rc != EOK) {
 		devmap_hangup_phone(DEVMAP_DRIVER);
Index: uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.h
===================================================================
--- uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.h	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.h	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -88,5 +88,5 @@
 
 	/** Device handle */
-	dev_handle_t dev_handle;
+	devmap_handle_t devmap_handle;
 } s3c24xx_uart_t;
 
Index: uspace/srv/hw/netif/DRIVER_REMOVAL
===================================================================
--- uspace/srv/hw/netif/DRIVER_REMOVAL	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
+++ uspace/srv/hw/netif/DRIVER_REMOVAL	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -0,0 +1,5 @@
+The netif drivers in this directory are subject to removal / replacement by
+prospective new drivers that meet our criteria for portability, follow our
+coding style and integrate with our device driver framework.
+
+DO NOT ADD ANY NEW DRIVERS HERE OR BASE NEW DRIVERS ON THOSE FOUND HERE.
Index: uspace/srv/hw/netif/dp8390/dp8390.h
===================================================================
--- uspace/srv/hw/netif/dp8390/dp8390.h	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/hw/netif/dp8390/dp8390.h	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -43,5 +43,5 @@
 /** Input/output size.
  */
-#define DP8390_IO_SIZE	0x01f
+#define DP8390_IO_SIZE	0x020
 
 /*
Index: uspace/srv/hw/netif/dp8390/dp8390_module.c
===================================================================
--- uspace/srv/hw/netif/dp8390/dp8390_module.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/hw/netif/dp8390/dp8390_module.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -158,13 +158,14 @@
 
 int netif_get_device_stats(device_id_t device_id, device_stats_ref stats){
-	ERROR_DECLARE;
-
 	netif_device_t * device;
 	eth_stat_t * de_stat;
+	int rc;
 
 	if(! stats){
 		return EBADMEM;
 	}
-	ERROR_PROPAGATE(find_device(device_id, &device));
+	rc = find_device(device_id, &device);
+	if (rc != EOK)
+		return rc;
 	de_stat = &((dpeth_t *) device->specific)->de_stat;
 	null_device_stats(stats);
@@ -185,12 +186,13 @@
 
 int netif_get_addr_message(device_id_t device_id, measured_string_ref address){
-	ERROR_DECLARE;
-
-	netif_device_t * device;
+	netif_device_t * device;
+	int rc;
 
 	if(! address){
 		return EBADMEM;
 	}
-	ERROR_PROPAGATE(find_device(device_id, &device));
+	rc = find_device(device_id, &device);
+	if (rc != EOK)
+		return rc;
 	address->value = (char *) (&((dpeth_t *) device->specific)->de_address);
 	address->length = CONVERT_SIZE(ether_addr_t, char, 1);
@@ -201,8 +203,7 @@
 
 int netif_probe_message(device_id_t device_id, int irq, uintptr_t io){
-	ERROR_DECLARE;
-
-	netif_device_t * device;
-	dpeth_t * dep;
+	netif_device_t * device;
+	dpeth_t * dep;
+	int rc;
 
 	device = (netif_device_t *) malloc(sizeof(netif_device_t));
@@ -224,14 +225,21 @@
 	dep->de_mode = DEM_DISABLED;
 	//TODO address?
-	if(ERROR_OCCURRED(pio_enable((void *) io, DP8390_IO_SIZE, (void **) &dep->de_base_port))
-		|| ERROR_OCCURRED(do_probe(dep))){
+	rc = pio_enable((void *) io, DP8390_IO_SIZE, (void **) &dep->de_base_port);
+	if (rc != EOK) {
 		free(dep);
 		free(device);
-		return ERROR_CODE;
-	}
-	if(ERROR_OCCURRED(netif_device_map_add(&netif_globals.device_map, device->device_id, device))){
+		return rc;
+	}	
+	rc = do_probe(dep);
+	if (rc != EOK) {
 		free(dep);
 		free(device);
-		return ERROR_CODE;
+		return rc;
+	}
+	rc = netif_device_map_add(&netif_globals.device_map, device->device_id, device);
+	if (rc != EOK){
+		free(dep);
+		free(device);
+		return rc;
 	}
 	return EOK;
@@ -239,11 +247,12 @@
 
 int netif_send_message(device_id_t device_id, packet_t packet, services_t sender){
-	ERROR_DECLARE;
-
 	netif_device_t * device;
 	dpeth_t * dep;
 	packet_t next;
-
-	ERROR_PROPAGATE(find_device(device_id, &device));
+	int rc;
+
+	rc = find_device(device_id, &device);
+	if (rc != EOK)
+		return rc;
 	if(device->state != NETIF_ACTIVE){
 		netif_pq_release(packet_get_id(packet));
@@ -263,7 +272,6 @@
 
 int netif_start_message(netif_device_t * device){
-	ERROR_DECLARE;
-
-	dpeth_t * dep;
+	dpeth_t * dep;
+	int rc;
 
 	if(device->state != NETIF_ACTIVE){
@@ -271,8 +279,11 @@
 		dp8390_cmds[0].addr = (void *) (uintptr_t) (dep->de_dp8390_port + DP_ISR);
 		dp8390_cmds[2].addr = dp8390_cmds[0].addr;
-		ERROR_PROPAGATE(ipc_register_irq(dep->de_irq, device->device_id, device->device_id, &dp8390_code));
-		if(ERROR_OCCURRED(do_init(dep, DL_BROAD_REQ))){
+		rc = ipc_register_irq(dep->de_irq, device->device_id, device->device_id, &dp8390_code);
+		if (rc != EOK)
+			return rc;
+		rc = do_init(dep, DL_BROAD_REQ);
+		if (rc != EOK) {
 			ipc_unregister_irq(dep->de_irq, device->device_id);
-			return ERROR_CODE;
+			return rc;
 		}
 		return change_state(device, NETIF_ACTIVE);
@@ -350,11 +361,9 @@
 int main(int argc, char *argv[])
 {
-	ERROR_DECLARE;
+	int rc;
 	
 	/* Start the module */
-	if (ERROR_OCCURRED(netif_module_start(netif_client_connection)))
-		return ERROR_CODE;
-	
-	return EOK;
+	rc = netif_module_start(netif_client_connection);
+	return rc;
 }
 
Index: uspace/srv/net/il/arp/arp.c
===================================================================
--- uspace/srv/net/il/arp/arp.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/net/il/arp/arp.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -125,7 +125,6 @@
 }
 
-static int
-arp_clear_address_req(int arp_phone, device_id_t device_id, services_t protocol,
-    measured_string_ref address)
+static int arp_clear_address_req(int arp_phone, device_id_t device_id,
+    services_t protocol, measured_string_ref address)
 {
 	arp_device_ref device;
@@ -175,6 +174,5 @@
  * @returns		ENOMEM if there is not enough memory left.
  */
-static int
-arp_proto_create(arp_proto_ref *proto, services_t service,
+static int arp_proto_create(arp_proto_ref *proto, services_t service,
     measured_string_ref address)
 {
@@ -214,6 +212,5 @@
  *			measured_strings_return() function.
  */
-static int
-arp_device_message(device_id_t device_id, services_t service,
+static int arp_device_message(device_id_t device_id, services_t service,
     services_t protocol, measured_string_ref address)
 {
@@ -225,6 +222,8 @@
 
 	fibril_rwlock_write_lock(&arp_globals.lock);
-	// an existing device?
+
+	/* An existing device? */
 	device = arp_cache_find(&arp_globals.cache, device_id);
+
 	if (device) {
 		if (device->service != service) {
@@ -260,5 +259,5 @@
 			return ENOENT;
 		
-		// create a new device
+		/* Create a new device */
 		device = (arp_device_ref) malloc(sizeof(arp_device_t));
 		if (!device) {
@@ -289,5 +288,5 @@
 		device->service = service;
 		
-		// bind the new one
+		/* Bind the new one */
 		device->phone = nil_bind_service(device->service,
 		    (ipcarg_t) device->device_id, SERVICE_ARP,
@@ -300,5 +299,5 @@
 		}
 		
-		// get packet dimensions
+		/* Get packet dimensions */
 		rc = nil_packet_size_req(device->phone, device_id,
 		    &device->packet_dimension);
@@ -310,5 +309,5 @@
 		}
 		
-		// get hardware address
+		/* Get hardware address */
 		rc = nil_get_addr_req(device->phone, device_id, &device->addr,
 		    &device->addr_data);
@@ -320,5 +319,5 @@
 		}
 		
-		// get broadcast address
+		/* Get broadcast address */
 		rc = nil_get_broadcast_addr_req(device->phone, device_id,
 		    &device->broadcast_addr, &device->broadcast_data);
@@ -455,5 +454,5 @@
 	hw_source = arp_addr_find(&proto->addresses, (char *) src_proto,
 	    CONVERT_SIZE(uint8_t, char, header->protocol_length));
-	// exists?
+	/* Exists? */
 	if (hw_source) {
 		if (hw_source->length != CONVERT_SIZE(uint8_t, char,
@@ -463,5 +462,5 @@
 		memcpy(hw_source->value, src_hw, hw_source->length);
 	}
-	// is my protocol address?
+	/* Is my protocol address? */
 	if (proto->addr->length != CONVERT_SIZE(uint8_t, char,
 	    header->protocol_length)) {
@@ -470,5 +469,5 @@
 	if (!str_lcmp(proto->addr->value, (char *) des_proto,
 	    proto->addr->length)) {
-		// not already upadted?
+		/* Not already updated? */
 		if (!hw_source) {
 			hw_source = measured_string_create_bulk((char *) src_hw,
@@ -550,5 +549,5 @@
 		return addr;
 
-	// ARP packet content size = header + (address + translation) * 2
+	/* ARP packet content size = header + (address + translation) * 2 */
 	length = 8 + 2 * (CONVERT_SIZE(char, uint8_t, proto->addr->length) +
 	    CONVERT_SIZE(char, uint8_t, device->addr->length));
@@ -674,5 +673,5 @@
 	
 	case NET_IL_DEVICE_STATE:
-		// do nothing - keep the cache
+		/* Do nothing - keep the cache */
 		return EOK;
 	
Index: uspace/srv/net/il/arp/arp_module.c
===================================================================
--- uspace/srv/net/il/arp/arp_module.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/net/il/arp/arp_module.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -57,6 +57,5 @@
 extern arp_globals_t arp_globals;
 
-int
-il_module_message_standalone(ipc_callid_t callid, ipc_call_t *call,
+int il_module_message_standalone(ipc_callid_t callid, ipc_call_t *call,
     ipc_call_t *answer, int *answer_count)
 {
Index: uspace/srv/net/net/net.c
===================================================================
--- uspace/srv/net/net/net.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/net/net/net.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -42,5 +42,4 @@
 #include <ddi.h>
 #include <errno.h>
-#include <err.h>
 #include <malloc.h>
 #include <stdio.h>
@@ -92,5 +91,5 @@
     const char *value)
 {
-	ERROR_DECLARE;
+	int rc;
 	
 	measured_string_ref setting =
@@ -100,7 +99,8 @@
 	
 	/* Add the configuration setting */
-	if (ERROR_OCCURRED(measured_strings_add(configuration, name, 0, setting))) {
+	rc = measured_strings_add(configuration, name, 0, setting);
+	if (rc != EOK) {
 		free(setting);
-		return ERROR_CODE;
+		return rc;
 	}
 	
@@ -110,6 +110,5 @@
 /** Generate new system-unique device identifier.
  *
- * @returns The system-unique devic identifier.
- *
+ * @returns		The system-unique devic identifier.
  */
 static device_id_t generate_new_device_id(void)
@@ -120,5 +119,5 @@
 static int parse_line(measured_strings_ref configuration, char *line)
 {
-	ERROR_DECLARE;
+	int rc;
 	
 	/* From the beginning */
@@ -170,7 +169,8 @@
 	
 	/* Add the configuration setting */
-	if (ERROR_OCCURRED(measured_strings_add(configuration, name, 0, setting))) {
+	rc = measured_strings_add(configuration, name, 0, setting);
+	if (rc != EOK) {
 		free(setting);
-		return ERROR_CODE;
+		return rc;
 	}
 	
@@ -181,6 +181,4 @@
     measured_strings_ref configuration)
 {
-	ERROR_DECLARE;
-	
 	printf("%s: Reading configuration file %s/%s\n", NAME, directory, filename);
 	
@@ -206,21 +204,21 @@
 			if (index >= BUFFER_SIZE) {
 				line[BUFFER_SIZE - 1] = '\0';
-				fprintf(stderr, "%s: Configuration line %u too long: %s\n",
-				    NAME, line_number, line);
+				fprintf(stderr, "%s: Configuration line %u too "
+				    "long: %s\n", NAME, line_number, line);
 				
 				/* No space left in the line buffer */
 				return EOVERFLOW;
-			} else {
-				/* Append the character */
-				line[index] = (char) read;
-				index++;
 			}
+			/* Append the character */
+			line[index] = (char) read;
+			index++;
 		} else {
 			/* On error or new line */
 			line[index] = '\0';
 			line_number++;
-			if (ERROR_OCCURRED(parse_line(configuration, line)))
-				fprintf(stderr, "%s: Configuration error on line %u: %s\n",
-				    NAME, line_number, line);
+			if (parse_line(configuration, line) != EOK) {
+				fprintf(stderr, "%s: Configuration error on "
+				    "line %u: %s\n", NAME, line_number, line);
+			}
 			
 			index = 0;
@@ -270,5 +268,5 @@
 static int net_initialize(async_client_conn_t client_connection)
 {
-	ERROR_DECLARE;
+	int rc;
 	
 	netifs_initialize(&net_globals.netifs);
@@ -277,17 +275,25 @@
 	measured_strings_initialize(&net_globals.configuration);
 	
-	// TODO: dynamic configuration
-	ERROR_PROPAGATE(read_configuration());
-	
-	ERROR_PROPAGATE(add_module(NULL, &net_globals.modules,
-	    LO_NAME, LO_FILENAME, SERVICE_LO, 0, connect_to_service));
-	ERROR_PROPAGATE(add_module(NULL, &net_globals.modules,
-	    DP8390_NAME, DP8390_FILENAME, SERVICE_DP8390, 0, connect_to_service));
-	ERROR_PROPAGATE(add_module(NULL, &net_globals.modules,
-	    ETHERNET_NAME, ETHERNET_FILENAME, SERVICE_ETHERNET, 0,
-	    connect_to_service));
-	ERROR_PROPAGATE(add_module(NULL, &net_globals.modules,
-	    NILDUMMY_NAME, NILDUMMY_FILENAME, SERVICE_NILDUMMY, 0,
-	    connect_to_service));
+	/* TODO: dynamic configuration */
+	rc = read_configuration();
+	if (rc != EOK)
+		return rc;
+	
+	rc = add_module(NULL, &net_globals.modules, LO_NAME, LO_FILENAME,
+	    SERVICE_LO, 0, connect_to_service);
+	if (rc != EOK)
+		return rc;
+	rc = add_module(NULL, &net_globals.modules, DP8390_NAME,
+	    DP8390_FILENAME, SERVICE_DP8390, 0, connect_to_service);
+	if (rc != EOK)
+		return rc;
+	rc = add_module(NULL, &net_globals.modules, ETHERNET_NAME,
+	    ETHERNET_FILENAME, SERVICE_ETHERNET, 0, connect_to_service);
+	if (rc != EOK)
+		return rc;
+	rc = add_module(NULL, &net_globals.modules, NILDUMMY_NAME,
+	    NILDUMMY_FILENAME, SERVICE_NILDUMMY, 0, connect_to_service);
+	if (rc != EOK)
+		return rc;
 	
 	/* Build specific initialization */
@@ -314,21 +320,26 @@
 static int net_module_start(async_client_conn_t client_connection)
 {
-	ERROR_DECLARE;
+	ipcarg_t phonehash;
+	int rc;
 	
 	async_set_client_connection(client_connection);
-	ERROR_PROPAGATE(pm_init());
-	
-	ipcarg_t phonehash;
-	
-	if (ERROR_OCCURRED(net_initialize(client_connection)) ||
-	    ERROR_OCCURRED(REGISTER_ME(SERVICE_NETWORKING, &phonehash))) {
-		pm_destroy();
-		return ERROR_CODE;
-	}
+	rc = pm_init();
+	if (rc != EOK)
+		return rc;
+	
+	
+	rc = net_initialize(client_connection);
+	if (rc != EOK)
+		goto out;
+	
+	rc = REGISTER_ME(SERVICE_NETWORKING, &phonehash);
+	if (rc != EOK)
+		goto out;
 	
 	async_manager();
-	
+
+out:
 	pm_destroy();
-	return EOK;
+	return rc;
 }
 
@@ -336,5 +347,5 @@
  *
  * The network interface configuration is searched first.
- &
+ *
  * @param[in]  netif_conf    The network interface configuration setting.
  * @param[out] configuration The found configured values.
@@ -415,5 +426,5 @@
 static int start_device(netif_t *netif)
 {
-	ERROR_DECLARE;
+	int rc;
 	
 	/* Mandatory netif */
@@ -456,5 +467,7 @@
 	int io = setting ? strtol(setting->value, NULL, 16) : 0;
 	
-	ERROR_PROPAGATE(netif_probe_req_remote(netif->driver->phone, netif->id, irq, io));
+	rc = netif_probe_req_remote(netif->driver->phone, netif->id, irq, io);
+	if (rc != EOK)
+		return rc;
 	
 	/* Network interface layer startup */
@@ -468,6 +481,8 @@
 		int mtu = setting ? strtol(setting->value, NULL, 10) : 0;
 		
-		ERROR_PROPAGATE(nil_device_req(netif->nil->phone, netif->id, mtu,
-		    netif->driver->service));
+		rc = nil_device_req(netif->nil->phone, netif->id, mtu,
+		    netif->driver->service);
+		if (rc != EOK)
+			return rc;
 		
 		internet_service = netif->nil->service;
@@ -478,6 +493,8 @@
 	switch (netif->il->service) {
 	case SERVICE_IP:
-		ERROR_PROPAGATE(ip_device_req(netif->il->phone, netif->id,
-		    internet_service));
+		rc = ip_device_req(netif->il->phone, netif->id,
+		    internet_service);
+		if (rc != EOK)
+			return rc;
 		break;
 	default:
@@ -485,6 +502,5 @@
 	}
 	
-	ERROR_PROPAGATE(netif_start_req_remote(netif->driver->phone, netif->id));
-	return EOK;
+	return netif_start_req_remote(netif->driver->phone, netif->id);
 }
 
@@ -504,6 +520,4 @@
 static int startup(void)
 {
-	ERROR_DECLARE;
-	
 	const char *conf_files[] = {
 		"lo",
@@ -511,4 +525,5 @@
 	};
 	size_t count = sizeof(conf_files) / sizeof(char *);
+	int rc;
 	
 	size_t i;
@@ -522,11 +537,14 @@
 			return EXDEV;
 		
-		ERROR_PROPAGATE(measured_strings_initialize(&netif->configuration));
+		rc = measured_strings_initialize(&netif->configuration);
+		if (rc != EOK)
+			return rc;
 		
 		/* Read configuration files */
-		if (ERROR_OCCURRED(read_netif_configuration(conf_files[i], netif))) {
+		rc = read_netif_configuration(conf_files[i], netif);
+		if (rc != EOK) {
 			measured_strings_destroy(&netif->configuration);
 			free(netif);
-			return ERROR_CODE;
+			return rc;
 		}
 		
@@ -554,9 +572,17 @@
 		 * and needed modules.
 		 */
-		if ((ERROR_OCCURRED(char_map_add(&net_globals.netif_names,
-		    netif->name, 0, index))) || (ERROR_OCCURRED(start_device(netif)))) {
+		rc = char_map_add(&net_globals.netif_names, netif->name, 0,
+		    index);
+		if (rc != EOK) {
 			measured_strings_destroy(&netif->configuration);
 			netifs_exclude_index(&net_globals.netifs, index);
-			return ERROR_CODE;
+			return rc;
+		}
+		
+		rc = start_device(netif);
+		if (rc != EOK) {
+			measured_strings_destroy(&netif->configuration);
+			netifs_exclude_index(&net_globals.netifs, index);
+			return rc;
 		}
 		
@@ -594,8 +620,7 @@
     int *answer_count)
 {
-	ERROR_DECLARE;
-	
 	measured_string_ref strings;
 	char *data;
+	int rc;
 	
 	*answer_count = 0;
@@ -604,6 +629,8 @@
 		return EOK;
 	case NET_NET_GET_DEVICE_CONF:
-		ERROR_PROPAGATE(measured_strings_receive(&strings, &data,
-		    IPC_GET_COUNT(call)));
+		rc = measured_strings_receive(&strings, &data,
+		    IPC_GET_COUNT(call));
+		if (rc != EOK)
+			return rc;
 		net_get_device_conf_req(0, IPC_GET_DEVICE(call), &strings,
 		    IPC_GET_COUNT(call), NULL);
@@ -612,10 +639,12 @@
 		free(data);
 		
-		ERROR_CODE = measured_strings_reply(strings, IPC_GET_COUNT(call));
+		rc = measured_strings_reply(strings, IPC_GET_COUNT(call));
 		free(strings);
-		return ERROR_CODE;
+		return rc;
 	case NET_NET_GET_CONF:
-		ERROR_PROPAGATE(measured_strings_receive(&strings, &data,
-		    IPC_GET_COUNT(call)));
+		rc = measured_strings_receive(&strings, &data,
+		    IPC_GET_COUNT(call));
+		if (rc != EOK)
+			return rc;
 		net_get_conf_req(0, &strings, IPC_GET_COUNT(call), NULL);
 		
@@ -623,10 +652,11 @@
 		free(data);
 		
-		ERROR_CODE = measured_strings_reply(strings, IPC_GET_COUNT(call));
+		rc = measured_strings_reply(strings, IPC_GET_COUNT(call));
 		free(strings);
-		return ERROR_CODE;
+		return rc;
 	case NET_NET_STARTUP:
 		return startup();
 	}
+	
 	return ENOTSUP;
 }
@@ -670,9 +700,10 @@
 int main(int argc, char *argv[])
 {
-	ERROR_DECLARE;
-	
-	if (ERROR_OCCURRED(net_module_start(net_client_connection))) {
-		fprintf(stderr, "%s: net_module_start error %i\n", NAME, ERROR_CODE);
-		return ERROR_CODE;
+	int rc;
+	
+	rc = net_module_start(net_client_connection);
+	if (rc != EOK) {
+		fprintf(stderr, "%s: net_module_start error %i\n", NAME, rc);
+		return rc;
 	}
 	
Index: uspace/srv/net/net/net_standalone.c
===================================================================
--- uspace/srv/net/net/net_standalone.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/net/net/net_standalone.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -42,4 +42,5 @@
 #include <ipc/ipc.h>
 #include <ipc/net.h>
+#include <errno.h>
 
 #include <ip_interface.h>
@@ -60,5 +61,5 @@
 int net_initialize_build(async_client_conn_t client_connection)
 {
-	ERROR_DECLARE;
+	int rc;
 	
 	task_id_t task_id = spawn("/srv/ip");
@@ -66,6 +67,8 @@
 		return EINVAL;
 	
-	ERROR_PROPAGATE(add_module(NULL, &net_globals.modules, IP_NAME,
-	    IP_FILENAME, SERVICE_IP, task_id, ip_connect_module));
+	rc = add_module(NULL, &net_globals.modules, IP_NAME,
+	    IP_FILENAME, SERVICE_IP, task_id, ip_connect_module);
+	if (rc != EOK)
+		return rc;
 	
 	if (!spawn("/srv/icmp"))
Index: uspace/srv/net/netif/lo/lo.c
===================================================================
--- uspace/srv/net/netif/lo/lo.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/net/netif/lo/lo.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -64,6 +64,5 @@
 netif_globals_t	netif_globals;
 
-int
-netif_specific_message(ipc_callid_t callid, ipc_call_t *call,
+int netif_specific_message(ipc_callid_t callid, ipc_call_t *call,
     ipc_call_t *answer, int *answer_count)
 {
@@ -75,6 +74,8 @@
 	if (!address)
 		return EBADMEM;
+
 	address->value = str_dup(DEFAULT_ADDR);
 	address->length = DEFAULT_ADDR_LEN;
+
 	return EOK;
 }
@@ -87,9 +88,12 @@
 	if (!stats)
 		return EBADMEM;
+
 	rc = find_device(device_id, &device);
 	if (rc != EOK)
 		return rc;
+
 	memcpy(stats, (device_stats_ref) device->specific,
 	    sizeof(device_stats_t));
+
 	return EOK;
 }
@@ -134,4 +138,5 @@
 	if (!*device)
 		return ENOMEM;
+
 	(*device)->specific = (device_stats_t *) malloc(sizeof(device_stats_t));
 	if (!(*device)->specific) {
@@ -139,4 +144,5 @@
 		return ENOMEM;
 	}
+
 	null_device_stats((device_stats_ref) (*device)->specific);
 	(*device)->device_id = device_id;
@@ -145,4 +151,5 @@
 	index = netif_device_map_add(&netif_globals.device_map,
 	    (*device)->device_id, *device);
+
 	if (index < 0) {
 		free(*device);
@@ -167,10 +174,12 @@
 	int rc;
 
-	// create a new device
+	/* Create a new device */
 	rc = create(device_id, &device);
 	if (rc != EOK)
 		return rc;
-	// print the settings
+
+	/* Print the settings */
 	printf("%s: Device created (id: %d)\n", NAME, device->device_id);
+
 	return EOK;
 }
@@ -187,8 +196,10 @@
 	if (rc != EOK)
 		return EOK;
+
 	if (device->state != NETIF_ACTIVE) {
 		netif_pq_release(packet_get_id(packet));
 		return EFORWARD;
 	}
+
 	next = packet;
 	do {
@@ -200,4 +211,5 @@
 		next = pq_next(next);
 	} while(next);
+
 	phone = device->nil_phone;
 	fibril_rwlock_write_unlock(&netif_globals.lock);
Index: uspace/srv/net/nil/eth/eth.c
===================================================================
--- uspace/srv/net/nil/eth/eth.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/net/nil/eth/eth.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -204,4 +204,5 @@
 	fibril_rwlock_write_lock(&eth_globals.protos_lock);
 	eth_globals.net_phone = net_phone;
+
 	eth_globals.broadcast_addr =
 	    measured_string_create_bulk("\xFF\xFF\xFF\xFF\xFF\xFF",
@@ -211,4 +212,5 @@
 		goto out;
 	}
+
 	rc = eth_devices_initialize(&eth_globals.devices);
 	if (rc != EOK) {
@@ -216,4 +218,5 @@
 		goto out;
 	}
+
 	rc = eth_protos_initialize(&eth_globals.protos);
 	if (rc != EOK) {
@@ -280,6 +283,6 @@
  *			netif_get_addr_req() function.
  */
-static int
-eth_device_message(device_id_t device_id, services_t service, size_t mtu)
+static int eth_device_message(device_id_t device_id, services_t service,
+    size_t mtu)
 {
 	eth_device_ref device;
@@ -302,5 +305,5 @@
 
 	fibril_rwlock_write_lock(&eth_globals.devices_lock);
-	// an existing device?
+	/* An existing device? */
 	device = eth_devices_find(&eth_globals.devices, device_id);
 	if (device) {
@@ -311,5 +314,5 @@
 		}
 		
-		// update mtu
+		/* Update mtu */
 		if ((mtu > 0) && (mtu <= ETH_MAX_TAGGED_CONTENT(device->flags)))
 			device->mtu = mtu;
@@ -321,5 +324,5 @@
 		fibril_rwlock_write_unlock(&eth_globals.devices_lock);
 		
-		// notify all upper layer modules
+		/* Notify all upper layer modules */
 		fibril_rwlock_read_lock(&eth_globals.protos_lock);
 		for (index = 0; index < eth_protos_count(&eth_globals.protos);
@@ -333,9 +336,10 @@
 			}
 		}
+
 		fibril_rwlock_read_unlock(&eth_globals.protos_lock);
 		return EOK;
 	}
 	
-	// create a new device
+	/* Create a new device */
 	device = (eth_device_ref) malloc(sizeof(eth_device_t));
 	if (!device)
@@ -358,4 +362,5 @@
 		return rc;
 	}
+
 	if (configuration) {
 		if (!str_lcmp(configuration[0].value, "DIX",
@@ -378,5 +383,5 @@
 	}
 	
-	// bind the device driver
+	/* Bind the device driver */
 	device->phone = netif_bind_service(device->service, device->device_id,
 	    SERVICE_ETHERNET, eth_receiver);
@@ -387,5 +392,5 @@
 	}
 	
-	// get hardware address
+	/* Get hardware address */
 	rc = netif_get_addr_req(device->phone, device->device_id, &device->addr,
 	    &device->addr_data);
@@ -396,5 +401,5 @@
 	}
 	
-	// add to the cache
+	/* Add to the cache */
 	index = eth_devices_add(&eth_globals.devices, device->device_id,
 	    device);
@@ -453,5 +458,5 @@
 	
 	if (type >= ETH_MIN_PROTO) {
-		// DIX Ethernet
+		/* DIX Ethernet */
 		prefix = sizeof(eth_header_t);
 		suffix = 0;
@@ -459,14 +464,15 @@
 		length -= sizeof(eth_fcs_t);
 	} else if(type <= ETH_MAX_CONTENT) {
-		// translate "LSAP" values
+		/* Translate "LSAP" values */
 		if ((header->lsap.dsap == ETH_LSAP_GLSAP) &&
 		    (header->lsap.ssap == ETH_LSAP_GLSAP)) {
-			// raw packet
-			// discard
+			/* Raw packet -- discard */
 			return NULL;
 		} else if((header->lsap.dsap == ETH_LSAP_SNAP) &&
 		    (header->lsap.ssap == ETH_LSAP_SNAP)) {
-			// IEEE 802.3 + 802.2 + LSAP + SNAP
-			// organization code not supported
+			/*
+			 * IEEE 802.3 + 802.2 + LSAP + SNAP
+			 * organization code not supported
+			 */
 			type = ntohs(header->snap.ethertype);
 			prefix = sizeof(eth_header_t) +
@@ -474,9 +480,10 @@
 			    sizeof(eth_header_snap_t);
 		} else {
-			// IEEE 802.3 + 802.2 LSAP
+			/* IEEE 802.3 + 802.2 LSAP */
 			type = lsap_map(header->lsap.dsap);
 			prefix = sizeof(eth_header_t) +
 			    sizeof(eth_header_lsap_t);
 		}
+
 		suffix = (type < ETH_MIN_CONTENT) ? ETH_MIN_CONTENT - type : 0U;
 		fcs = (eth_fcs_ref) data + prefix + type + suffix;
@@ -484,5 +491,5 @@
 		length = prefix + type + suffix;
 	} else {
-		// invalid length/type, should not occurr
+		/* Invalid length/type, should not occur */
 		return NULL;
 	}
@@ -506,7 +513,6 @@
 }
 
-int
-nil_received_msg_local(int nil_phone, device_id_t device_id, packet_t packet,
-    services_t target)
+int nil_received_msg_local(int nil_phone, device_id_t device_id,
+    packet_t packet, services_t target)
 {
 	eth_proto_ref proto;
@@ -521,4 +527,5 @@
 		return ENOENT;
 	}
+
 	flags = device->flags;
 	fibril_rwlock_read_unlock(&eth_globals.devices_lock);
@@ -538,6 +545,6 @@
 		packet = next;
 	} while(packet);
+
 	fibril_rwlock_read_unlock(&eth_globals.protos_lock);
-	
 	return EOK;
 }
@@ -554,6 +561,5 @@
  * @returns		ENOENT if there is no such device.
  */
-static int
-eth_packet_space_message(device_id_t device_id, size_t *addr_len,
+static int eth_packet_space_message(device_id_t device_id, size_t *addr_len,
     size_t *prefix, size_t *content, size_t *suffix)
 {
@@ -569,4 +575,5 @@
 		return ENOENT;
 	}
+
 	*content = device->mtu;
 	fibril_rwlock_read_unlock(&eth_globals.devices_lock);
@@ -575,4 +582,5 @@
 	*prefix = ETH_PREFIX;
 	*suffix = ETH_MIN_CONTENT + ETH_SUFFIX;
+
 	return EOK;
 }
@@ -587,6 +595,5 @@
  * @returns		ENOENT if there no such device.
  */
-static int
-eth_addr_message(device_id_t device_id, eth_addr_type_t type,
+static int eth_addr_message(device_id_t device_id, eth_addr_type_t type,
     measured_string_ref *address)
 {
@@ -644,7 +651,9 @@
 			return ENOMEM;
 		}
+
 		proto->service = service;
 		proto->protocol = protocol;
 		proto->phone = phone;
+
 		index = eth_protos_add(&eth_globals.protos, protocol, proto);
 		if (index < 0) {
@@ -705,4 +714,5 @@
 		if (!padding)
 			return ENOMEM;
+
 		bzero(padding, ETH_MIN_TAGGED_CONTENT(flags) - length);
 	}
@@ -782,6 +792,6 @@
  * @returns		EINVAL if the service parameter is not known.
  */
-static int
-eth_send_message(device_id_t device_id, packet_t packet, services_t sender)
+static int eth_send_message(device_id_t device_id, packet_t packet,
+    services_t sender)
 {
 	eth_device_ref device;
@@ -804,5 +814,5 @@
 	}
 	
-	// process packet queue
+	/* Process packet queue */
 	next = packet;
 	do {
@@ -810,5 +820,5 @@
 		    (uint8_t *) device->addr->value, ethertype, device->mtu);
 		if (rc != EOK) {
-			// release invalid packet
+			/* Release invalid packet */
 			tmp = pq_detach(next);
 			if (next == packet)
@@ -822,17 +832,16 @@
 	} while(next);
 	
-	// send packet queue
+	/* Send packet queue */
 	if (packet) {
 		netif_send_msg(device->phone, device_id, packet,
 		    SERVICE_ETHERNET);
 	}
+
 	fibril_rwlock_read_unlock(&eth_globals.devices_lock);
-	
 	return EOK;
 }
 
-int
-nil_message_standalone(const char *name, ipc_callid_t callid, ipc_call_t *call,
-    ipc_call_t *answer, int *answer_count)
+int nil_message_standalone(const char *name, ipc_callid_t callid,
+    ipc_call_t *call, ipc_call_t *answer, int *answer_count)
 {
 	measured_string_ref address;
@@ -894,5 +903,4 @@
  * @param[in] iid	The initial message identifier.
  * @param[in] icall	The initial message call structure.
- *
  */
 static void nil_client_connection(ipc_callid_t iid, ipc_call_t *icall)
Index: uspace/srv/net/nil/eth/eth_module.c
===================================================================
--- uspace/srv/net/nil/eth/eth_module.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/net/nil/eth/eth_module.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -77,6 +77,5 @@
 }
 
-int
-nil_module_message_standalone(const char *name, ipc_callid_t callid,
+int nil_module_message_standalone(const char *name, ipc_callid_t callid,
     ipc_call_t *call, ipc_call_t *answer, int *answer_count)
 {
Index: uspace/srv/net/nil/nildummy/nildummy.c
===================================================================
--- uspace/srv/net/nil/nildummy/nildummy.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/net/nil/nildummy/nildummy.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -150,6 +150,6 @@
  *			netif_get_addr_req() function.
  */
-static int
-nildummy_device_message(device_id_t device_id, services_t service, size_t mtu)
+static int nildummy_device_message(device_id_t device_id, services_t service,
+    size_t mtu)
 {
 	nildummy_device_ref device;
@@ -159,5 +159,5 @@
 	fibril_rwlock_write_lock(&nildummy_globals.devices_lock);
 
-	// an existing device?
+	/* An existing device? */
 	device = nildummy_devices_find(&nildummy_globals.devices, device_id);
 	if (device) {
@@ -169,5 +169,5 @@
 		}
 		
-		// update mtu
+		/* Update MTU */
 		if (mtu > 0)
 			device->mtu = mtu;
@@ -179,5 +179,5 @@
 		fibril_rwlock_write_unlock(&nildummy_globals.devices_lock);
 		
-		// notify the upper layer module
+		/* Notify the upper layer module */
 		fibril_rwlock_read_lock(&nildummy_globals.protos_lock);
 		if (nildummy_globals.proto.phone) {
@@ -191,5 +191,5 @@
 	}
 	
-	// create a new device
+	/* Create a new device */
 	device = (nildummy_device_ref) malloc(sizeof(nildummy_device_t));
 	if (!device)
@@ -203,5 +203,5 @@
 		device->mtu = NET_DEFAULT_MTU;
 
-	// bind the device driver
+	/* Bind the device driver */
 	device->phone = netif_bind_service(device->service, device->device_id,
 	    SERVICE_ETHERNET, nildummy_receiver);
@@ -212,5 +212,5 @@
 	}
 	
-	// get hardware address
+	/* Get hardware address */
 	rc = netif_get_addr_req(device->phone, device->device_id, &device->addr,
 	    &device->addr_data);
@@ -221,5 +221,5 @@
 	}
 	
-	// add to the cache
+	/* Add to the cache */
 	index = nildummy_devices_add(&nildummy_globals.devices,
 	    device->device_id, device);
@@ -247,6 +247,6 @@
  *
  */
-static int
-nildummy_addr_message(device_id_t device_id, measured_string_ref *address)
+static int nildummy_addr_message(device_id_t device_id,
+    measured_string_ref *address)
 {
 	nildummy_device_ref device;
@@ -279,6 +279,5 @@
  *
  */
-static int
-nildummy_packet_space_message(device_id_t device_id, size_t *addr_len,
+static int nildummy_packet_space_message(device_id_t device_id, size_t *addr_len,
     size_t *prefix, size_t *content, size_t *suffix)
 {
@@ -294,4 +293,5 @@
 		return ENOENT;
 	}
+
 	*content = device->mtu;
 	fibril_rwlock_read_unlock(&nildummy_globals.devices_lock);
@@ -303,7 +303,6 @@
 }
 
-int
-nil_received_msg_local(int nil_phone, device_id_t device_id, packet_t packet,
-    services_t target)
+int nil_received_msg_local(int nil_phone, device_id_t device_id,
+    packet_t packet, services_t target)
 {
 	packet_t next;
@@ -355,6 +354,6 @@
  * @return		EINVAL if the service parameter is not known.
  */
-static int
-nildummy_send_message(device_id_t device_id, packet_t packet, services_t sender)
+static int nildummy_send_message(device_id_t device_id, packet_t packet,
+    services_t sender)
 {
 	nildummy_device_ref device;
@@ -366,5 +365,6 @@
 		return ENOENT;
 	}
-	// send packet queue
+
+	/* Send packet queue */
 	if (packet)
 		netif_send_msg(device->phone, device_id, packet,
@@ -374,7 +374,6 @@
 }
 
-int
-nil_message_standalone(const char *name, ipc_callid_t callid, ipc_call_t *call,
-    ipc_call_t *answer, int *answer_count)
+int nil_message_standalone(const char *name, ipc_callid_t callid,
+    ipc_call_t *call, ipc_call_t *answer, int *answer_count)
 {
 	measured_string_ref address;
Index: uspace/srv/net/nil/nildummy/nildummy_module.c
===================================================================
--- uspace/srv/net/nil/nildummy/nildummy_module.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/net/nil/nildummy/nildummy_module.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -78,6 +78,5 @@
 }
 
-int
-nil_module_message_standalone(const char *name, ipc_callid_t callid,
+int nil_module_message_standalone(const char *name, ipc_callid_t callid,
     ipc_call_t *call, ipc_call_t *answer, int *answer_count)
 {
Index: uspace/srv/net/tl/icmp/icmp.c
===================================================================
--- uspace/srv/net/tl/icmp/icmp.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/net/tl/icmp/icmp.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -155,6 +155,5 @@
  * @returns		EPERM if the error message is not allowed.
  */
-static int
-icmp_send_packet(icmp_type_t type, icmp_code_t code, packet_t packet,
+static int icmp_send_packet(icmp_type_t type, icmp_code_t code, packet_t packet,
     icmp_header_ref header, services_t error, ip_ttl_t ttl, ip_tos_t tos,
     int dont_fragment)
@@ -162,5 +161,5 @@
 	int rc;
 
-	// do not send an error if disabled
+	/* Do not send an error if disabled */
 	if (error && !icmp_globals.error_reporting)
 		return icmp_release_and_return(packet, EPERM);
@@ -204,5 +203,5 @@
 		return NULL;
 
-	// truncate if longer than 64 bits (without the IP header)
+	/* Truncate if longer than 64 bits (without the IP header) */
 	if ((total_length > header_length + ICMP_KEEP_LENGTH) &&
 	    (packet_trim(packet, 0,
@@ -244,6 +243,5 @@
  * @returns		EPARTY if there was an internal error.
  */
-static int
-icmp_echo(icmp_param_t id, icmp_param_t sequence, size_t size,
+static int icmp_echo(icmp_param_t id, icmp_param_t sequence, size_t size,
     mseconds_t timeout, ip_ttl_t ttl, ip_tos_t tos, int dont_fragment,
     const struct sockaddr * addr, socklen_t addrlen)
@@ -262,5 +260,5 @@
 
 	length = (size_t) addrlen;
-	// TODO do not ask all the time
+	/* TODO do not ask all the time */
 	rc = ip_packet_size_req(icmp_globals.ip_phone, -1,
 	    &icmp_globals.packet_dimension);
@@ -275,16 +273,15 @@
 		return ENOMEM;
 
-	// prepare the requesting packet
-	// set the destination address
+	/* Prepare the requesting packet, set the destination address. */
 	rc = packet_set_addr(packet, NULL, (const uint8_t *) addr, length);
 	if (rc != EOK)
 		return icmp_release_and_return(packet, rc);
 
-	// allocate space in the packet
+	/* Allocate space in the packet */
 	data = (uint8_t *) packet_suffix(packet, size);
 	if (!data)
 		return icmp_release_and_return(packet, ENOMEM);
 
-	// fill the data
+	/* Fill the data */
 	length = 0;
 	while (size > length + sizeof(ICMP_ECHO_TEXT)) {
@@ -294,5 +291,5 @@
 	memcpy(data + length, ICMP_ECHO_TEXT, size - length);
 
-	// prefix the header
+	/* Prefix the header */
 	header = PACKET_PREFIX(packet, icmp_header_t);
 	if (!header)
@@ -303,5 +300,5 @@
 	header->un.echo.sequence_number = sequence;
 
-	// prepare the reply structure
+	/* Prepare the reply structure */
 	reply = malloc(sizeof(*reply));
 	if (!reply)
@@ -319,13 +316,12 @@
 	}
 
-	// unlock the globals so that we can wait for the reply
+	/* Unlock the globals so that we can wait for the reply */
 	fibril_rwlock_write_unlock(&icmp_globals.lock);
 
-	// send the request
+	/* Send the request */
 	icmp_send_packet(ICMP_ECHO, 0, packet, header, 0, ttl, tos,
 	    dont_fragment);
 
-	// wait for the reply
-	// timeout in microseconds
+	/* Wait for the reply. Timeout in microseconds. */
 	rc = fibril_condvar_wait_timeout(&reply->condvar, &reply->mutex,
 	    timeout * 1000);
@@ -333,9 +329,9 @@
 		rc = reply->result;
 
-	// drop the reply mutex before locking the globals again
+	/* Drop the reply mutex before locking the globals again */
 	fibril_mutex_unlock(&reply->mutex);
 	fibril_rwlock_write_lock(&icmp_globals.lock);
 
-	// destroy the reply structure
+	/* Destroy the reply structure */
 	icmp_replies_exclude_index(&icmp_globals.replies, index);
 
@@ -343,7 +339,6 @@
 }
 
-static int
-icmp_destination_unreachable_msg_local(int icmp_phone, icmp_code_t code,
-    icmp_param_t mtu, packet_t packet)
+static int icmp_destination_unreachable_msg_local(int icmp_phone,
+    icmp_code_t code, icmp_param_t mtu, packet_t packet)
 {
 	icmp_header_ref header;
@@ -372,6 +367,6 @@
 }
 
-static int
-icmp_time_exceeded_msg_local(int icmp_phone, icmp_code_t code, packet_t packet)
+static int icmp_time_exceeded_msg_local(int icmp_phone, icmp_code_t code,
+    packet_t packet)
 {
 	icmp_header_ref header;
@@ -385,6 +380,5 @@
 }
 
-static int
-icmp_parameter_problem_msg_local(int icmp_phone, icmp_code_t code,
+static int icmp_parameter_problem_msg_local(int icmp_phone, icmp_code_t code,
     icmp_param_t pointer, packet_t packet)
 {
@@ -449,5 +443,5 @@
 	icmp_globals.echo_replying = NET_DEFAULT_ICMP_ECHO_REPLYING;
 
-	// get configuration
+	/* Get configuration */
 	configuration = &names[0];
 	rc = net_get_conf_req(icmp_globals.net_phone, &configuration, count,
@@ -485,6 +479,5 @@
  * @param[in] code	The received reply message code.
  */
-static void 
-icmp_process_echo_reply(packet_t packet, icmp_header_ref header,
+static void  icmp_process_echo_reply(packet_t packet, icmp_header_ref header,
     icmp_type_t type, icmp_code_t code)
 {
@@ -492,11 +485,11 @@
 	icmp_reply_ref reply;
 
-	// compute the reply key
+	/* Compute the reply key */
 	reply_key = ICMP_GET_REPLY_KEY(header->un.echo.identifier,
 	    header->un.echo.sequence_number);
 	pq_release_remote(icmp_globals.net_phone, packet_get_id(packet));
 
+	/* Find the pending reply */
 	fibril_rwlock_write_lock(&icmp_globals.lock);
-	// find the pending reply
 	reply = icmp_replies_find(&icmp_globals.replies, reply_key);
 	if (reply) {
@@ -541,5 +534,5 @@
 		break;
 	case SERVICE_ICMP:
-		// process error
+		/* Process error */
 		result = icmp_client_process_packet(packet, &type, &code, NULL,
 		    NULL);
@@ -547,5 +540,5 @@
 			return result;
 		length = (size_t) result;
-		// remove the error header
+		/* Remove the error header */
 		rc = packet_trim(packet, length, 0);
 		if (rc != EOK)
@@ -556,5 +549,5 @@
 	}
 
-	// get rid of the ip header
+	/* Get rid of the IP header */
 	length = ip_client_header_length(packet);
 	rc = packet_trim(packet, length, 0);
@@ -573,11 +566,13 @@
 		return EINVAL;
 
-	// get icmp header
+	/* Get ICMP header */
 	header = (icmp_header_ref) data;
 
 	if (header->checksum) {
 		while (ICMP_CHECKSUM(header, length) != IP_CHECKSUM_ZERO) {
-			// set the original message type on error notification
-			// type swap observed in Qemu
+			/*
+			 * Set the original message type on error notification.
+			 * Type swap observed in Qemu.
+			 */
 			if (error) {
 				switch (header->type) {
@@ -606,14 +601,16 @@
 		}
 		
-		// do not send a reply if disabled
+		/* Do not send a reply if disabled */
 		if (icmp_globals.echo_replying) {
 			addrlen = packet_get_addr(packet, &src, NULL);
 
-			// set both addresses to the source one (avoids the
-			// source address deletion before setting the
-			// destination one)
+			/*
+			 * Set both addresses to the source one (avoids the
+			 * source address deletion before setting the
+			 * destination one).
+			 */
 			if ((addrlen > 0) && (packet_set_addr(packet, src, src,
 			    (size_t) addrlen) == EOK)) {
-				// send the reply
+				/* Send the reply */
 				icmp_send_packet(ICMP_ECHOREPLY, 0, packet,
 				    header, 0, 0, 0, 0);
@@ -661,6 +658,5 @@
  *			icmp_process_packet() function.
  */
-static int
-icmp_received_msg_local(device_id_t device_id, packet_t packet,
+static int icmp_received_msg_local(device_id_t device_id, packet_t packet,
     services_t receiver, services_t error)
 {
@@ -746,17 +742,17 @@
 		return EBADMEM;
 
-	// from the last used one
+	/* From the last used one */
 	index = icmp_globals.last_used_id;
 	do {
 		index++;
-		// til the range end
+		/* til the range end */
 		if (index >= ICMP_FREE_IDS_END) {
-			// start from the range beginning
+			/* start from the range beginning */
 			index = ICMP_FREE_IDS_START - 1;
 			do {
 				index++;
-				// til the last used one
+				/* til the last used one */
 				if (index >= icmp_globals.last_used_id) {
-					// none found
+					/* none found */
 					return ENOTCONN;
 				}
@@ -764,5 +760,5 @@
 			    index) != NULL);
 
-			// found, break immediately
+			/* Found, break immediately */
 			break;
 		}
@@ -808,5 +804,5 @@
 		return ENOMEM;
 
-	// assign a new identifier
+	/* Assign a new identifier */
 	fibril_rwlock_write_lock(&icmp_globals.lock);
 	rc = icmp_bind_free_id(echo_data);
@@ -818,14 +814,14 @@
 
 	while (keep_on_going) {
-		// answer the call
+		/* Answer the call */
 		answer_call(callid, rc, &answer, answer_count);
 
-		// refresh data
+		/* Refresh data */
 		refresh_answer(&answer, &answer_count);
 
-		// get the next call
+		/* Get the next call */
 		callid = async_get_call(&call);
 
-		// process the call
+		/* Process the call */
 		switch (IPC_GET_METHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
@@ -876,5 +872,5 @@
 	}
 
-	// release the identifier
+	/* Release the identifier */
 	fibril_rwlock_write_lock(&icmp_globals.lock);
 	icmp_echo_data_exclude(&icmp_globals.echo_data, echo_data->identifier);
@@ -897,6 +893,5 @@
  * @see IS_NET_ICMP_MESSAGE()
  */
-int
-icmp_message_standalone(ipc_callid_t callid, ipc_call_t *call,
+int icmp_message_standalone(ipc_callid_t callid, ipc_call_t *call,
     ipc_call_t *answer, int *answer_count)
 {
Index: uspace/srv/net/tl/icmp/icmp_module.c
===================================================================
--- uspace/srv/net/tl/icmp/icmp_module.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/net/tl/icmp/icmp_module.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -85,6 +85,5 @@
 }
 
-int
-tl_module_message_standalone(ipc_callid_t callid, ipc_call_t *call,
+int tl_module_message_standalone(ipc_callid_t callid, ipc_call_t *call,
     ipc_call_t *answer, int *answer_count)
 {
Index: uspace/srv/net/tl/tcp/tcp.c
===================================================================
--- uspace/srv/net/tl/tcp/tcp.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/net/tl/tcp/tcp.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -44,5 +44,5 @@
 #include <fibril_synch.h>
 #include <malloc.h>
-//TODO remove stdio
+/* TODO remove stdio */
 #include <stdio.h>
 #include <errno.h>
@@ -267,7 +267,6 @@
 }
 
-int
-tcp_received_msg(device_id_t device_id, packet_t packet, services_t receiver,
-    services_t error)
+int tcp_received_msg(device_id_t device_id, packet_t packet,
+    services_t receiver, services_t error)
 {
 	int rc;
@@ -309,5 +308,5 @@
 		break;
 	case SERVICE_ICMP:
-		// process error
+		/* Process error */
 		result = icmp_client_process_packet(packet, &type, &code, NULL,
 		    NULL);
@@ -324,5 +323,5 @@
 	}
 
-	// TODO process received ipopts?
+	/* TODO process received ipopts? */
 	result = ip_client_process_packet(packet, NULL, NULL, NULL, NULL, NULL);
 	if (result < 0)
@@ -338,10 +337,10 @@
 		return tcp_release_and_return(packet, NO_DATA);
 
-	// trim all but TCP header
+	/* Trim all but TCP header */
 	rc = packet_trim(packet, offset, 0);
 	if (rc != EOK)
 		return tcp_release_and_return(packet, rc);
 
-	// get tcp header
+	/* Get tcp header */
 	header = (tcp_header_ref) packet_get_data(packet);
 	if (!header)
@@ -361,13 +360,14 @@
 		return tcp_release_and_return(packet, rc);
 	
-	// find the destination socket
+	/* Find the destination socket */
 	socket = socket_port_find(&tcp_globals.sockets,
 	    ntohs(header->destination_port), (const char *) src, addrlen);
 	if (!socket) {
-		// find the listening destination socket
+		/* Find the listening destination socket */
 		socket = socket_port_find(&tcp_globals.sockets,
 		    ntohs(header->destination_port), SOCKET_MAP_KEY_LISTENING,
 		    0);
 	}
+
 	if (!socket) {
 		if (tl_prepare_icmp_packet(tcp_globals.net_phone,
@@ -383,8 +383,8 @@
 	assert(socket_data);
 
-	// some data received, clear the timeout counter
+	/* Some data received, clear the timeout counter */
 	socket_data->timeout_count = 0;
 
-	// count the received packet fragments
+	/* Count the received packet fragments */
 	next_packet = packet;
 	fragments = 0;
@@ -399,5 +399,5 @@
 		total_length += length;
 
-		// add partial checksum if set
+		/* Add partial checksum if set */
 		if (!error) {
 			checksum = compute_checksum(checksum,
@@ -447,5 +447,5 @@
 		    tcp_globals.icmp_phone, packet, error);
 		if (rc == EOK) {
-			// checksum error ICMP
+			/* Checksum error ICMP */
 			icmp_parameter_problem_msg(tcp_globals.icmp_phone,
 			    ICMP_PARAM_POINTER,
@@ -460,5 +460,5 @@
 	fibril_rwlock_read_unlock(&tcp_globals.lock);
 
-	// TODO error reporting/handling
+	/* TODO error reporting/handling */
 	switch (socket_data->state) {
 	case TCP_SOCKET_LISTEN:
@@ -474,11 +474,11 @@
 		break;
 	case TCP_SOCKET_FIN_WAIT_1:
-		// ack changing the state to FIN_WAIT_2 gets processed later
+		/* ack changing the state to FIN_WAIT_2 gets processed later */
 	case TCP_SOCKET_FIN_WAIT_2:
-		// fin changing state to LAST_ACK gets processed later
+		/* fin changing state to LAST_ACK gets processed later */
 	case TCP_SOCKET_LAST_ACK:
-		// ack releasing the socket get processed later
+		/* ack releasing the socket get processed later */
 	case TCP_SOCKET_CLOSING:
-		// ack releasing the socket gets processed later
+		/* ack releasing the socket gets processed later */
 	case TCP_SOCKET_ESTABLISHED:
 		rc = tcp_process_established(socket, socket_data, header,
@@ -497,7 +497,7 @@
 }
 
-int
-tcp_process_established(socket_core_ref socket, tcp_socket_data_ref socket_data,
-    tcp_header_ref header, packet_t packet, int fragments, size_t total_length)
+int tcp_process_established(socket_core_ref socket, tcp_socket_data_ref
+    socket_data, tcp_header_ref header, packet_t packet, int fragments,
+    size_t total_length)
 {
 	packet_t next_packet;
@@ -523,9 +523,9 @@
 		socket_data->fin_incoming = new_sequence_number;
 
-	// trim begining if containing expected data
+	/* Trim begining if containing expected data */
 	if (IS_IN_INTERVAL_OVERFLOW(new_sequence_number,
 	    socket_data->next_incoming, new_sequence_number + total_length)) {
 
-		// get the acknowledged offset
+		/* Get the acknowledged offset */
 		if (socket_data->next_incoming < new_sequence_number) {
 			offset = new_sequence_number -
@@ -539,7 +539,8 @@
 		total_length -= offset;
 		length = packet_get_data_length(packet);
-		// trim the acknowledged data
+
+		/* Trim the acknowledged data */
 		while (length <= offset) {
-			// release the acknowledged packets
+			/* Release the acknowledged packets */
 			next_packet = pq_next(packet);
 			pq_release_remote(tcp_globals.net_phone,
@@ -559,5 +560,5 @@
 	}
 
-	// release if overflowing the window
+	/* Release if overflowing the window */
 /*
 	if (IS_IN_INTERVAL_OVERFLOW(socket_data->next_incoming +
@@ -609,11 +610,11 @@
 	}
 */
-	// the expected one arrived?
+	/* The expected one arrived? */
 	if (new_sequence_number == socket_data->next_incoming) {
 		printf("expected\n");
-		// process acknowledgement
+		/* Process acknowledgement */
 		tcp_process_acknowledgement(socket, socket_data, header);
 
-		// remove the header
+		/* Remove the header */
 		total_length -= TCP_HEADER_LENGTH(header);
 		rc = packet_trim(packet, TCP_HEADER_LENGTH(header), 0);
@@ -635,5 +636,5 @@
 			rc = pq_get_order(socket_data->incoming, &order, NULL);
 			if (rc != EOK) {
-				// remove the corrupted packet
+				/* Remove the corrupted packet */
 				next_packet = pq_detach(packet);
 				if (packet == socket_data->incoming)
@@ -648,18 +649,18 @@
 			if (IS_IN_INTERVAL_OVERFLOW(sequence_number,
 			    old_incoming, socket_data->next_incoming)) {
-				// move to the next
+				/* Move to the next */
 				packet = pq_next(packet);
-				// coninual data?
+				/* Coninual data? */
 			} else if (IS_IN_INTERVAL_OVERFLOW(old_incoming,
 			    sequence_number, socket_data->next_incoming)) {
-				// detach the packet
+				/* Detach the packet */
 				next_packet = pq_detach(packet);
 				if (packet == socket_data->incoming)
 					socket_data->incoming = next_packet;
-				// get data length
+				/* Get data length */
 				length = packet_get_data_length(packet);
 				new_sequence_number = sequence_number + length;
 				if (length <= 0) {
-					// remove the empty packet
+					/* Remove the empty packet */
 					pq_release_remote(tcp_globals.net_phone,
 					    packet_get_id(packet));
@@ -667,8 +668,8 @@
 					continue;
 				}
-				// exactly following
+				/* Exactly following */
 				if (sequence_number ==
 				    socket_data->next_incoming) {
-					// queue received data
+					/* Queue received data */
 					rc = tcp_queue_received_packet(socket,
 					    socket_data, packet, 1,
@@ -680,5 +681,5 @@
 					packet = next_packet;
 					continue;
-					// at least partly following data?
+					/* At least partly following data? */
 				}
 				if (IS_IN_INTERVAL_OVERFLOW(sequence_number,
@@ -695,5 +696,5 @@
 					rc = packet_trim(packet,length, 0);
 					if (rc == EOK) {
-						// queue received data
+						/* Queue received data */
 						rc = tcp_queue_received_packet(
 						    socket, socket_data, packet,
@@ -708,5 +709,5 @@
 					}
 				}
-				// remove the duplicit or corrupted packet
+				/* Remove the duplicit or corrupted packet */
 				pq_release_remote(tcp_globals.net_phone,
 				    packet_get_id(packet));
@@ -721,8 +722,8 @@
 	    socket_data->next_incoming + socket_data->window)) {
 		printf("in window\n");
-		// process acknowledgement
+		/* Process acknowledgement */
 		tcp_process_acknowledgement(socket, socket_data, header);
 
-		// remove the header
+		/* Remove the header */
 		total_length -= TCP_HEADER_LENGTH(header);
 		rc = packet_trim(packet, TCP_HEADER_LENGTH(header), 0);
@@ -735,5 +736,5 @@
 		    length);
 		if (rc != EOK) {
-			// remove the corrupted packets
+			/* Remove the corrupted packets */
 			pq_release_remote(tcp_globals.net_phone,
 			    packet_get_id(packet));
@@ -762,9 +763,9 @@
 	} else {
 		printf("unexpected\n");
-		// release duplicite or restricted
+		/* Release duplicite or restricted */
 		pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
 	}
 
-	// change state according to the acknowledging incoming fin
+	/* Change state according to the acknowledging incoming fin */
 	if (IS_IN_INTERVAL_OVERFLOW(old_incoming, socket_data->fin_incoming,
 	    socket_data->next_incoming)) {
@@ -775,5 +776,5 @@
 			socket_data->state = TCP_SOCKET_CLOSING;
 			break;
-			//case TCP_ESTABLISHED:
+		/*case TCP_ESTABLISHED:*/
 		default:
 			socket_data->state = TCP_SOCKET_CLOSE_WAIT;
@@ -784,5 +785,5 @@
 	packet = tcp_get_packets_to_send(socket, socket_data);
 	if (!packet) {
-		// create the notification packet
+		/* Create the notification packet */
 		rc = tcp_create_notification_packet(&packet, socket,
 		    socket_data, 0, 0);
@@ -798,5 +799,5 @@
 	fibril_rwlock_write_unlock(socket_data->local_lock);
 
-	// send the packet
+	/* Send the packet */
 	tcp_send_packets(socket_data->device_id, packet);
 
@@ -804,6 +805,5 @@
 }
 
-int
-tcp_queue_received_packet(socket_core_ref socket,
+int tcp_queue_received_packet(socket_core_ref socket,
     tcp_socket_data_ref socket_data, packet_t packet, int fragments,
     size_t total_length)
@@ -819,5 +819,5 @@
 	assert(socket_data->window > total_length);
 
-	// queue the received packet
+	/* Queue the received packet */
 	rc = dyn_fifo_push(&socket->received, packet_get_id(packet),
 	    SOCKET_MAX_RECEIVED_SIZE);
@@ -829,8 +829,8 @@
 		return tcp_release_and_return(packet, rc);
 
-	// decrease the window size
+	/* Decrease the window size */
 	socket_data->window -= total_length;
 
-	// notify the destination socket
+	/* Notify the destination socket */
 	async_msg_5(socket->phone, NET_SOCKET_RECEIVED,
 	    (ipcarg_t) socket->socket_id,
@@ -842,7 +842,6 @@
 }
 
-int
-tcp_process_syn_sent(socket_core_ref socket, tcp_socket_data_ref socket_data,
-    tcp_header_ref header, packet_t packet)
+int tcp_process_syn_sent(socket_core_ref socket, tcp_socket_data_ref
+    socket_data, tcp_header_ref header, packet_t packet)
 {
 	packet_t next_packet;
@@ -858,9 +857,10 @@
 		return tcp_release_and_return(packet, EINVAL);
 	
-	// process acknowledgement
+	/* Process acknowledgement */
 	tcp_process_acknowledgement(socket, socket_data, header);
 
 	socket_data->next_incoming = ntohl(header->sequence_number) + 1;
-	// release additional packets
+
+	/* Release additional packets */
 	next_packet = pq_detach(packet);
 	if (next_packet) {
@@ -868,5 +868,6 @@
 		    packet_get_id(next_packet));
 	}
-	// trim if longer than the header
+
+	/* Trim if longer than the header */
 	if (packet_get_data_length(packet) > sizeof(*header)) {
 		rc = packet_trim(packet, 0,
@@ -875,8 +876,10 @@
 			return tcp_release_and_return(packet, rc);
 	}
+
 	tcp_prepare_operation_header(socket, socket_data, header, 0, 0);
 	fibril_mutex_lock(&socket_data->operation.mutex);
 	socket_data->operation.result = tcp_queue_packet(socket, socket_data,
 	    packet, 1);
+
 	if (socket_data->operation.result == EOK) {
 		socket_data->state = TCP_SOCKET_ESTABLISHED;
@@ -884,7 +887,7 @@
 		if (packet) {
 			fibril_rwlock_write_unlock( socket_data->local_lock);
-			// send the packet
+			/* Send the packet */
 			tcp_send_packets(socket_data->device_id, packet);
-			// signal the result
+			/* Signal the result */
 			fibril_condvar_signal( &socket_data->operation.condvar);
 			fibril_mutex_unlock( &socket_data->operation.mutex);
@@ -892,10 +895,10 @@
 		}
 	}
+
 	fibril_mutex_unlock(&socket_data->operation.mutex);
 	return tcp_release_and_return(packet, EINVAL);
 }
 
-int
-tcp_process_listen(socket_core_ref listening_socket,
+int tcp_process_listen(socket_core_ref listening_socket,
     tcp_socket_data_ref listening_socket_data, tcp_header_ref header,
     packet_t packet, struct sockaddr *src, struct sockaddr *dest,
@@ -936,4 +939,5 @@
 		return tcp_release_and_return(packet, ENOMEM);
 	}
+
 	memcpy(socket_data->addr, src, socket_data->addrlen);
 	socket_data->dest_port = ntohs(header->source_port);
@@ -946,5 +950,5 @@
 	}
 
-	// create a socket
+	/* Create a socket */
 	socket_id = -1;
 	rc = socket_create(socket_data->local_sockets, listening_socket->phone,
@@ -965,5 +969,5 @@
 	fibril_rwlock_write_lock(&tcp_globals.lock);
 
-	// find the destination socket
+	/* Find the destination socket */
 	listening_socket = socket_port_find(&tcp_globals.sockets,
 	    listening_port, SOCKET_MAP_KEY_LISTENING, 0);
@@ -971,5 +975,5 @@
 	    (listening_socket->socket_id != listening_socket_id)) {
 		fibril_rwlock_write_unlock(&tcp_globals.lock);
-		// a shadow may remain until app hangs up
+		/* A shadow may remain until app hangs up */
 		return tcp_release_and_return(packet, EOK /*ENOTSOCK*/);
 	}
@@ -983,5 +987,5 @@
 	    socket_id);
 	if (!socket) {
-		// where is the socket?!?
+		/* Where is the socket?!? */
 		fibril_rwlock_write_unlock(&tcp_globals.lock);
 		return ENOTSOCK;
@@ -1010,5 +1014,5 @@
 	socket_data->next_incoming = ntohl(header->sequence_number) + 1;
 
-	// release additional packets
+	/* Release additional packets */
 	next_packet = pq_detach(packet);
 	if (next_packet) {
@@ -1017,5 +1021,5 @@
 	}
 
-	// trim if longer than the header
+	/* Trim if longer than the header */
 	if (packet_get_data_length(packet) > sizeof(*header)) {
 		rc = packet_trim(packet, 0,
@@ -1050,5 +1054,5 @@
 	fibril_rwlock_write_unlock(socket_data->local_lock);
 
-	// send the packet
+	/* Send the packet */
 	tcp_send_packets(socket_data->device_id, packet);
 
@@ -1056,6 +1060,5 @@
 }
 
-int
-tcp_process_syn_received(socket_core_ref socket,
+int tcp_process_syn_received(socket_core_ref socket,
     tcp_socket_data_ref socket_data, tcp_header_ref header, packet_t packet)
 {
@@ -1073,5 +1076,5 @@
 		return tcp_release_and_return(packet, EINVAL);
 
-	// process acknowledgement
+	/* Process acknowledgement */
 	tcp_process_acknowledgement(socket, socket_data, header);
 
@@ -1086,9 +1089,9 @@
 		assert(listening_socket_data);
 
-		// queue the received packet
+		/* Queue the received packet */
 		rc = dyn_fifo_push(&listening_socket->accepted,
 		    (-1 * socket->socket_id), listening_socket_data->backlog);
 		if (rc == EOK) {
-			// notify the destination socket
+			/* Notify the destination socket */
 			async_msg_5(socket->phone, NET_SOCKET_ACCEPTED,
 			    (ipcarg_t) listening_socket->socket_id,
@@ -1100,22 +1103,22 @@
 		}
 	}
-	// send FIN
+	/* Send FIN */
 	socket_data->state = TCP_SOCKET_FIN_WAIT_1;
 
-	// create the notification packet
+	/* Create the notification packet */
 	rc = tcp_create_notification_packet(&packet, socket, socket_data, 0, 1);
 	if (rc != EOK)
 		return rc;
 
-	// send the packet
+	/* Send the packet */
 	rc = tcp_queue_packet(socket, socket_data, packet, 1);
 	if (rc != EOK)
 		return rc;
 
-	// flush packets
+	/* Flush packets */
 	packet = tcp_get_packets_to_send(socket, socket_data);
 	fibril_rwlock_write_unlock(socket_data->local_lock);
 	if (packet) {
-		// send the packet
+		/* Send the packet */
 		tcp_send_packets(socket_data->device_id, packet);
 	}
@@ -1124,6 +1127,5 @@
 }
 
-void
-tcp_process_acknowledgement(socket_core_ref socket,
+void tcp_process_acknowledgement(socket_core_ref socket,
     tcp_socket_data_ref socket_data, tcp_header_ref header)
 {
@@ -1144,5 +1146,6 @@
 
 	number = ntohl(header->acknowledgement_number);
-	// if more data acknowledged
+
+	/* If more data acknowledged */
 	if (number != socket_data->expected) {
 		old = socket_data->expected;
@@ -1155,6 +1158,8 @@
 			case TCP_SOCKET_LAST_ACK:
 			case TCP_SOCKET_CLOSING:
-				// fin acknowledged - release the socket in
-				// another fibril
+				/*
+				 * FIN acknowledged - release the socket in
+				 * another fibril.
+				 */
 				tcp_prepare_timeout(tcp_release_after_timeout,
 				    socket, socket_data, 0,
@@ -1166,5 +1171,6 @@
 			}
 		}
-		// update the treshold if higher than set
+
+		/* Update the treshold if higher than set */
 		if (number + ntohs(header->window) >
 		    socket_data->expected + socket_data->treshold) {
@@ -1172,5 +1178,6 @@
 			    socket_data->expected;
 		}
-		// set new expected sequence number
+
+		/* Set new expected sequence number */
 		socket_data->expected = number;
 		socket_data->expected_count = 1;
@@ -1184,5 +1191,5 @@
 					socket_data->outgoing = next;
 
-				// add to acknowledged or release
+				/* Add to acknowledged or release */
 				if (pq_add(&acknowledged, packet, 0, 0) != EOK)
 					pq_release_remote(tcp_globals.net_phone,
@@ -1192,5 +1199,6 @@
 				break;
 		}
-		// release acknowledged
+
+		/* Release acknowledged */
 		if (acknowledged) {
 			pq_release_remote(tcp_globals.net_phone,
@@ -1198,12 +1206,13 @@
 		}
 		return;
-		// if the same as the previous time
-	}
+		/* If the same as the previous time */
+	}
+
 	if (number == socket_data->expected) {
-		// increase the counter
+		/* Increase the counter */
 		socket_data->expected_count++;
 		if (socket_data->expected_count == TCP_FAST_RETRANSMIT_COUNT) {
 			socket_data->expected_count = 1;
-			// TODO retransmit lock
+			/* TODO retransmit lock */
 			//tcp_retransmit_packet(socket, socket_data, number);
 		}
@@ -1311,12 +1320,12 @@
 	while (keep_on_going) {
 
-		// answer the call
+		/* Answer the call */
 		answer_call(callid, res, &answer, answer_count);
-		// refresh data
+		/* Refresh data */
 		refresh_answer(&answer, &answer_count);
-		// get the next call
+		/* Get the next call */
 		callid = async_get_call(&call);
 
-		// process the call
+		/* Process the call */
 		switch (IPC_GET_METHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
@@ -1401,6 +1410,8 @@
 			if (res != EOK)
 				break;
-			// the global lock may be released in the
-			// tcp_connect_message() function
+			/*
+			 * The global lock may be released in the
+			 * tcp_connect_message() function.
+			 */
 			fibril_rwlock_write_lock(&tcp_globals.lock);
 			fibril_rwlock_write_lock(&lock);
@@ -1516,9 +1527,9 @@
 	}
 
-	// release the application phone
+	/* Release the application phone */
 	ipc_hangup(app_phone);
 
 	printf("release\n");
-	// release all local sockets
+	/* Release all local sockets */
 	socket_cores_release(tcp_globals.net_phone, &local_sockets,
 	    &tcp_globals.sockets, tcp_free_socket_data);
@@ -1536,7 +1547,7 @@
 	assert(timeout);
 
-	// sleep the given timeout
+	/* Sleep the given timeout */
 	async_usleep(timeout->timeout);
-	// lock the globals
+	/* Lock the globals */
 	if (timeout->globals_read_only) 
 		fibril_rwlock_read_lock(&tcp_globals.lock);
@@ -1544,5 +1555,5 @@
 		fibril_rwlock_write_lock(&tcp_globals.lock);
 
-	// find the pending operation socket
+	/* Find the pending operation socket */
 	socket = socket_port_find(&tcp_globals.sockets, timeout->port,
 	    timeout->key, timeout->key_length);
@@ -1557,12 +1568,12 @@
 	fibril_rwlock_write_lock(socket_data->local_lock);
 	if (timeout->sequence_number) {
-		// increase the timeout counter;
+		/* Increase the timeout counter */
 		socket_data->timeout_count++;
 		if (socket_data->timeout_count == TCP_MAX_TIMEOUTS) {
-			// TODO release as connection lost
+			/* TODO release as connection lost */
 			//tcp_refresh_socket_data(socket_data);
 			fibril_rwlock_write_unlock(socket_data->local_lock);
 		} else {
-			// retransmit
+			/* Retransmit */
 //                      tcp_retransmit_packet(socket,
 //			    socket_data, timeout->sequence_number);
@@ -1571,16 +1582,19 @@
 	} else {
 		fibril_mutex_lock(&socket_data->operation.mutex);
-		// set the timeout operation result if state not
-		// changed
+		/* Set the timeout operation result if state not changed */
 		if (socket_data->state == timeout->state) {
 			socket_data->operation.result = ETIMEOUT;
-			// notify the main fibril
+
+			/* Notify the main fibril */
 			fibril_condvar_signal(&socket_data->operation.condvar);
-			// keep the global write lock
+
+			/* Keep the global write lock */
 			keep_write_lock = true;
 		} else {
-			// operation is ok, do nothing
-			// unlocking from now on, so the unlocki
-			// order does not matter...
+			/*
+			 * Operation is ok, do nothing.
+			 * Unlocking from now on, so the unlocking
+			 * order does not matter.
+			 */
 			fibril_rwlock_write_unlock(socket_data->local_lock);
 		}
@@ -1589,12 +1603,12 @@
 
 out:
-	// unlock only if no socket
+	/* Unlock only if no socket */
 	if (timeout->globals_read_only)
 		fibril_rwlock_read_unlock(&tcp_globals.lock);
 	else if (!keep_write_lock)
-		// release if not desired
+		/* Release if not desired */
 		fibril_rwlock_write_unlock(&tcp_globals.lock);
 	
-	// release the timeout structure
+	/* Release the timeout structure */
 	free(timeout);
 	return EOK;
@@ -1610,11 +1624,14 @@
 	assert(timeout);
 
-	// sleep the given timeout
+	/* Sleep the given timeout */
 	async_usleep(timeout->timeout);
-	// lock the globals
+
+	/* Lock the globals */
 	fibril_rwlock_write_lock(&tcp_globals.lock);
-	// find the pending operation socket
+
+	/* Find the pending operation socket */
 	socket = socket_port_find(&tcp_globals.sockets, timeout->port,
 	    timeout->key, timeout->key_length);
+
 	if (socket && (socket->socket_id == timeout->socket_id)) {
 		socket_data = (tcp_socket_data_ref) socket->specific_data;
@@ -1629,14 +1646,16 @@
 		}
 	}
-	// unlock the globals
+
+	/* Unlock the globals */
 	fibril_rwlock_write_unlock(&tcp_globals.lock);
-	// release the timeout structure
+
+	/* Release the timeout structure */
 	free(timeout);
+
 	return EOK;
 }
 
-void
-tcp_retransmit_packet(socket_core_ref socket, tcp_socket_data_ref socket_data,
-    size_t sequence_number)
+void tcp_retransmit_packet(socket_core_ref socket, tcp_socket_data_ref
+    socket_data, size_t sequence_number)
 {
 	packet_t packet;
@@ -1648,5 +1667,5 @@
 	assert(socket->specific_data == socket_data);
 
-	// sent packet?
+	/* Sent packet? */
 	packet = pq_find(socket_data->outgoing, sequence_number);
 	printf("retransmit %d\n", packet_get_id(packet));
@@ -1664,6 +1683,6 @@
 }
 
-int
-tcp_listen_message(socket_cores_ref local_sockets, int socket_id, int backlog)
+int tcp_listen_message(socket_cores_ref local_sockets, int socket_id,
+    int backlog)
 {
 	socket_core_ref socket;
@@ -1675,13 +1694,14 @@
 		return EINVAL;
 
-	// find the socket
+	/* Find the socket */
 	socket = socket_cores_find(local_sockets, socket_id);
 	if (!socket) 
 		return ENOTSOCK;
 	
-	// get the socket specific data
+	/* Get the socket specific data */
 	socket_data = (tcp_socket_data_ref) socket->specific_data;
 	assert(socket_data);
-	// set the backlog
+
+	/* Set the backlog */
 	socket_data->backlog = backlog;
 
@@ -1689,6 +1709,5 @@
 }
 
-int
-tcp_connect_message(socket_cores_ref local_sockets, int socket_id,
+int tcp_connect_message(socket_cores_ref local_sockets, int socket_id,
     struct sockaddr *addr, socklen_t addrlen)
 {
@@ -1700,5 +1719,5 @@
 	assert(addrlen > 0);
 
-	// find the socket
+	/* Find the socket */
 	socket = socket_cores_find(local_sockets, socket_id);
 	if (!socket)
@@ -1708,5 +1727,5 @@
 	if (rc != EOK) {
 		tcp_free_socket_data(socket);
-		// unbind if bound
+		/* Unbind if bound */
 		if (socket->port > 0) {
 			socket_ports_exclude(&tcp_globals.sockets,
@@ -1718,6 +1737,5 @@
 }
 
-int
-tcp_connect_core(socket_core_ref socket, socket_cores_ref local_sockets,
+int tcp_connect_core(socket_core_ref socket, socket_cores_ref local_sockets,
     struct sockaddr *addr, socklen_t addrlen)
 {
@@ -1730,5 +1748,5 @@
 	assert(addrlen > 0);
 
-	// get the socket specific data
+	/* Get the socket specific data */
 	socket_data = (tcp_socket_data_ref) socket->specific_data;
 	assert(socket_data);
@@ -1739,5 +1757,5 @@
 		return EINVAL;
 
-	// get the destination port
+	/* Get the destination port */
 	rc = tl_get_address_port(addr, addrlen, &socket_data->dest_port);
 	if (rc != EOK)
@@ -1745,5 +1763,5 @@
 	
 	if (socket->port <= 0) {
-		// try to find a free port
+		/* Try to find a free port */
 		rc = socket_bind_free_port(&tcp_globals.sockets, socket,
 		    TCP_FREE_PORTS_START, TCP_FREE_PORTS_END,
@@ -1751,5 +1769,5 @@
 		if (rc != EOK)
 			return rc;
-		// set the next port as the search starting port number
+		/* Set the next port as the search starting port number */
 		tcp_globals.last_used_port = socket->port;
 	}
@@ -1761,15 +1779,16 @@
 		return rc;
 
-	// create the notification packet
+	/* Create the notification packet */
 	rc = tcp_create_notification_packet(&packet, socket, socket_data, 1, 0);
 	if (rc != EOK)
 		return rc;
 
-	// unlock the globals and wait for an operation
+	/* Unlock the globals and wait for an operation */
 	fibril_rwlock_write_unlock(&tcp_globals.lock);
 
 	socket_data->addr = addr;
 	socket_data->addrlen = addrlen;
-	// send the packet
+
+	/* Send the packet */
 
 	if (((rc = tcp_queue_packet(socket, socket_data, packet, 1)) != EOK) ||
@@ -1785,9 +1804,10 @@
 			fibril_mutex_lock(&socket_data->operation.mutex);
 			fibril_rwlock_write_unlock(socket_data->local_lock);
-			// send the packet
+
+			/* Send the packet */
 			printf("connecting %d\n", packet_get_id(packet));
 			tcp_send_packets(socket_data->device_id, packet);
 
-			// wait for a reply
+			/* Wait for a reply */
 			fibril_condvar_wait(&socket_data->operation.condvar,
 			    &socket_data->operation.mutex);
@@ -1805,11 +1825,8 @@
 
 	fibril_mutex_unlock(&socket_data->operation.mutex);
-
-	// return the result
 	return rc;
 }
 
-int
-tcp_queue_prepare_packet(socket_core_ref socket,
+int tcp_queue_prepare_packet(socket_core_ref socket,
     tcp_socket_data_ref socket_data, packet_t packet, size_t data_length)
 {
@@ -1821,5 +1838,5 @@
 	assert(socket->specific_data == socket_data);
 
-	// get tcp header
+	/* Get TCP header */
 	header = (tcp_header_ref) packet_get_data(packet);
 	if (!header)
@@ -1835,5 +1852,5 @@
 		return tcp_release_and_return(packet, EINVAL);
 
-	// remember the outgoing FIN
+	/* Remember the outgoing FIN */
 	if (header->finalize) 
 		socket_data->fin_outgoing = socket_data->next_outgoing;
@@ -1842,6 +1859,5 @@
 }
 
-int
-tcp_queue_packet(socket_core_ref socket, tcp_socket_data_ref socket_data,
+int tcp_queue_packet(socket_core_ref socket, tcp_socket_data_ref socket_data,
     packet_t packet, size_t data_length)
 {
@@ -1865,6 +1881,6 @@
 }
 
-packet_t
-tcp_get_packets_to_send(socket_core_ref socket, tcp_socket_data_ref socket_data)
+packet_t tcp_get_packets_to_send(socket_core_ref socket, tcp_socket_data_ref
+    socket_data)
 {
 	packet_t packet;
@@ -1883,6 +1899,8 @@
 		pq_get_order(packet, NULL, &data_length);
 
-		// send only if fits into the window
-		// respecting the possible overflow
+		/*
+		 * Send only if fits into the window, respecting the possible
+		 * overflow.
+		 */
 		if (!IS_IN_INTERVAL_OVERFLOW(
 		    (uint32_t) socket_data->last_outgoing,
@@ -1909,9 +1927,10 @@
 		previous = copy;
 		packet = pq_next(packet);
-		// overflow occurred ?
+
+		/* Overflow occurred? */
 		if (!packet &&
 		    (socket_data->last_outgoing > socket_data->next_outgoing)) {
 			printf("gpts overflow\n");
-			// continue from the beginning
+			/* Continue from the beginning */
 			packet = socket_data->outgoing;
 		}
@@ -1922,7 +1941,6 @@
 }
 
-packet_t
-tcp_send_prepare_packet(socket_core_ref socket, tcp_socket_data_ref socket_data,
-    packet_t packet, size_t data_length, size_t sequence_number)
+packet_t tcp_send_prepare_packet(socket_core_ref socket, tcp_socket_data_ref
+    socket_data, packet_t packet, size_t data_length, size_t sequence_number)
 {
 	tcp_header_ref header;
@@ -1934,5 +1952,5 @@
 	assert(socket->specific_data == socket_data);
 
-	// adjust the pseudo header
+	/* Adjust the pseudo header */
 	rc = ip_client_set_pseudo_header_data_length(socket_data->pseudo_header,
 	    socket_data->headerlen, packet_get_data_length(packet));
@@ -1942,5 +1960,5 @@
 	}
 
-	// get the header
+	/* Get the header */
 	header = (tcp_header_ref) packet_get_data(packet);
 	if (!header) {
@@ -1950,5 +1968,5 @@
 	assert(ntohl(header->sequence_number) == sequence_number);
 
-	// adjust the header
+	/* Adjust the header */
 	if (socket_data->next_incoming) {
 		header->acknowledgement_number =
@@ -1958,5 +1976,5 @@
 	header->window = htons(socket_data->window);
 
-	// checksum
+	/* Checksum */
 	header->checksum = 0;
 	checksum = compute_checksum(0, socket_data->pseudo_header,
@@ -1967,5 +1985,5 @@
 	header->checksum = htons(flip_checksum(compact_checksum(checksum)));
 
-	// prepare the packet
+	/* Prepare the packet */
 	rc = ip_client_prepare_packet(packet, IPPROTO_TCP, 0, 0, 0, 0);
 	if (rc != EOK) {
@@ -1973,4 +1991,5 @@
 		return NULL;
 	}
+
 	rc = tcp_prepare_timeout(tcp_timeout, socket, socket_data,
 	    sequence_number, socket_data->state, socket_data->timeout, true);
@@ -1983,7 +2002,6 @@
 }
 
-packet_t
-tcp_prepare_copy(socket_core_ref socket, tcp_socket_data_ref socket_data,
-    packet_t packet, size_t data_length, size_t sequence_number)
+packet_t tcp_prepare_copy(socket_core_ref socket, tcp_socket_data_ref
+    socket_data, packet_t packet, size_t data_length, size_t sequence_number)
 {
 	packet_t copy;
@@ -1993,5 +2011,5 @@
 	assert(socket->specific_data == socket_data);
 
-	// make a copy of the packet
+	/* Make a copy of the packet */
 	copy = packet_get_copy(tcp_globals.net_phone, packet);
 	if (!copy)
@@ -2014,6 +2032,5 @@
 }
 
-void
-tcp_prepare_operation_header(socket_core_ref socket,
+void tcp_prepare_operation_header(socket_core_ref socket,
     tcp_socket_data_ref socket_data, tcp_header_ref header, int synchronize,
     int finalize)
@@ -2032,6 +2049,5 @@
 }
 
-int
-tcp_prepare_timeout(int (*timeout_function)(void *tcp_timeout_t),
+int tcp_prepare_timeout(int (*timeout_function)(void *tcp_timeout_t),
     socket_core_ref socket, tcp_socket_data_ref socket_data,
     size_t sequence_number, tcp_socket_state_t state, suseconds_t timeout,
@@ -2045,5 +2061,5 @@
 	assert(socket->specific_data == socket_data);
 
-	// prepare the timeout with key bundle structure
+	/* Prepare the timeout with key bundle structure */
 	operation_timeout = malloc(sizeof(*operation_timeout) +
 	    socket->key_length + 1);
@@ -2060,5 +2076,5 @@
 	operation_timeout->state = state;
 
-	// copy the key
+	/* Copy the key */
 	operation_timeout->key = ((char *) operation_timeout) +
 	    sizeof(*operation_timeout);
@@ -2067,5 +2083,5 @@
 	operation_timeout->key[operation_timeout->key_length] = '\0';
 
-	// prepare the timeouting thread
+	/* Prepare the timeouting thread */
 	fibril = fibril_create(timeout_function, operation_timeout);
 	if (!fibril) {
@@ -2074,5 +2090,5 @@
 	}
 //      fibril_mutex_lock(&socket_data->operation.mutex);
-	// start the timeouting fibril
+	/* Start the timeout fibril */
 	fibril_add_ready(fibril);
 	//socket_data->state = state;
@@ -2080,7 +2096,6 @@
 }
 
-int
-tcp_recvfrom_message(socket_cores_ref local_sockets, int socket_id, int flags,
-    size_t *addrlen)
+int tcp_recvfrom_message(socket_cores_ref local_sockets, int socket_id,
+    int flags, size_t *addrlen)
 {
 	socket_core_ref socket;
@@ -2093,10 +2108,10 @@
 	assert(local_sockets);
 
-	// find the socket
+	/* Find the socket */
 	socket = socket_cores_find(local_sockets, socket_id);
 	if (!socket)
 		return ENOTSOCK;
 
-	// get the socket specific data
+	/* Get the socket specific data */
 	if (!socket->specific_data)
 		return NO_DATA;
@@ -2104,10 +2119,10 @@
 	socket_data = (tcp_socket_data_ref) socket->specific_data;
 
-	// check state
+	/* Check state */
 	if ((socket_data->state != TCP_SOCKET_ESTABLISHED) &&
 	    (socket_data->state != TCP_SOCKET_CLOSE_WAIT))
 		return ENOTCONN;
 
-	// send the source address if desired
+	/* Send the source address if desired */
 	if (addrlen) {
 		rc = data_reply(socket_data->addr, socket_data->addrlen);
@@ -2117,5 +2132,5 @@
 	}
 
-	// get the next received packet
+	/* Get the next received packet */
 	packet_id = dyn_fifo_value(&socket->received);
 	if (packet_id < 0)
@@ -2126,19 +2141,19 @@
 		return rc;
 
-	// reply the packets
+	/* Reply the packets */
 	rc = socket_reply_packets(packet, &length);
 	if (rc != EOK)
 		return rc;
 
-	// release the packet
+	/* Release the packet */
 	dyn_fifo_pop(&socket->received);
 	pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
-	// return the total length
+
+	/* Return the total length */
 	return (int) length;
 }
 
-int
-tcp_send_message(socket_cores_ref local_sockets, int socket_id, int fragments,
-    size_t *data_fragment_size, int flags)
+int tcp_send_message(socket_cores_ref local_sockets, int socket_id,
+    int fragments, size_t *data_fragment_size, int flags)
 {
 	socket_core_ref socket;
@@ -2155,10 +2170,10 @@
 	assert(data_fragment_size);
 
-	// find the socket
+	/* Find the socket */
 	socket = socket_cores_find(local_sockets, socket_id);
 	if (!socket)
 		return ENOTSOCK;
 
-	// get the socket specific data
+	/* Get the socket specific data */
 	if (!socket->specific_data)
 		return NO_DATA;
@@ -2166,5 +2181,5 @@
 	socket_data = (tcp_socket_data_ref) socket->specific_data;
 
-	// check state
+	/* Check state */
 	if ((socket_data->state != TCP_SOCKET_ESTABLISHED) &&
 	    (socket_data->state != TCP_SOCKET_CLOSE_WAIT))
@@ -2181,5 +2196,5 @@
 
 	for (index = 0; index < fragments; index++) {
-		// read the data fragment
+		/* Read the data fragment */
 		result = tl_socket_read_packet_data(tcp_globals.net_phone,
 		    &packet, TCP_HEADER_SIZE, packet_dimension,
@@ -2189,5 +2204,6 @@
 
 		total_length = (size_t) result;
-		// prefix the tcp header
+
+		/* Prefix the TCP header */
 		header = PACKET_PREFIX(packet, tcp_header_t);
 		if (!header)
@@ -2200,5 +2216,5 @@
 	}
 
-	// flush packets
+	/* Flush packets */
 	packet = tcp_get_packets_to_send(socket, socket_data);
 	fibril_rwlock_write_unlock(socket_data->local_lock);
@@ -2206,5 +2222,5 @@
 
 	if (packet) {
-		// send the packet
+		/* Send the packet */
 		tcp_send_packets(socket_data->device_id, packet);
 	}
@@ -2221,14 +2237,14 @@
 	int rc;
 
-	// find the socket
+	/* Find the socket */
 	socket = socket_cores_find(local_sockets, socket_id);
 	if (!socket)
 		return ENOTSOCK;
 
-	// get the socket specific data
+	/* Get the socket specific data */
 	socket_data = (tcp_socket_data_ref) socket->specific_data;
 	assert(socket_data);
 
-	// check state
+	/* Check state */
 	switch (socket_data->state) {
 	case TCP_SOCKET_ESTABLISHED:
@@ -2243,5 +2259,5 @@
 
 	default:
-		// just destroy
+		/* Just destroy */
 		rc = socket_destroy(tcp_globals.net_phone, socket_id,
 		    local_sockets, &tcp_globals.sockets,
@@ -2254,18 +2270,20 @@
 	}
 
-	// send FIN
-	// TODO should I wait to complete?
-
-	// create the notification packet
+	/*
+	 * Send FIN.
+	 * TODO should I wait to complete?
+	 */
+
+	/* Create the notification packet */
 	rc = tcp_create_notification_packet(&packet, socket, socket_data, 0, 1);
 	if (rc != EOK)
 		return rc;
 
-	// send the packet
+	/* Send the packet */
 	rc = tcp_queue_packet(socket, socket_data, packet, 1);
 	if (rc != EOK)
 		return rc;
 
-	// flush packets
+	/* Flush packets */
 	packet = tcp_get_packets_to_send(socket, socket_data);
 	fibril_rwlock_write_unlock(socket_data->local_lock);
@@ -2273,5 +2291,5 @@
 
 	if (packet) {
-		// send the packet
+		/* Send the packet */
 		tcp_send_packets(socket_data->device_id, packet);
 	}
@@ -2280,6 +2298,5 @@
 }
 
-int
-tcp_create_notification_packet(packet_t *packet, socket_core_ref socket,
+int tcp_create_notification_packet(packet_t *packet, socket_core_ref socket,
     tcp_socket_data_ref socket_data, int synchronize, int finalize)
 {
@@ -2290,5 +2307,5 @@
 	assert(packet);
 
-	// get the device packet dimension
+	/* Get the device packet dimension */
 	rc = tl_get_ip_packet_dimension(tcp_globals.ip_phone,
 	    &tcp_globals.dimensions, socket_data->device_id, &packet_dimension);
@@ -2296,5 +2313,5 @@
 		return rc;
 
-	// get a new packet
+	/* Get a new packet */
 	*packet = packet_get_4_remote(tcp_globals.net_phone, TCP_HEADER_SIZE,
 	    packet_dimension->addr_len, packet_dimension->prefix,
@@ -2304,5 +2321,5 @@
 		return ENOMEM;
 
-	// allocate space in the packet
+	/* Allocate space in the packet */
 	header = PACKET_SUFFIX(*packet, tcp_header_t);
 	if (!header)
@@ -2315,6 +2332,5 @@
 }
 
-int
-tcp_accept_message(socket_cores_ref local_sockets, int socket_id,
+int tcp_accept_message(socket_cores_ref local_sockets, int socket_id,
     int new_socket_id, size_t *data_fragment_size, size_t *addrlen)
 {
@@ -2329,14 +2345,14 @@
 	assert(addrlen);
 
-	// find the socket
+	/* Find the socket */
 	socket = socket_cores_find(local_sockets, socket_id);
 	if (!socket)
 		return ENOTSOCK;
 
-	// get the socket specific data
+	/* Get the socket specific data */
 	socket_data = (tcp_socket_data_ref) socket->specific_data;
 	assert(socket_data);
 
-	// check state
+	/* Check state */
 	if (socket_data->state != TCP_SOCKET_LISTEN)
 		return EINVAL;
@@ -2352,8 +2368,8 @@
 			return ENOTSOCK;
 
-		// get the socket specific data
+		/* Get the socket specific data */
 		socket_data = (tcp_socket_data_ref) accepted->specific_data;
 		assert(socket_data);
-		// TODO can it be in another state?
+		/* TODO can it be in another state? */
 		if (socket_data->state == TCP_SOCKET_ESTABLISHED) {
 			rc = data_reply(socket_data->addr,
@@ -2389,6 +2405,5 @@
 }
 
-void
-tcp_free_socket_data(socket_core_ref socket)
+void tcp_free_socket_data(socket_core_ref socket)
 {
 	tcp_socket_data_ref socket_data;
@@ -2398,8 +2413,9 @@
 	printf("destroy_socket %d\n", socket->socket_id);
 
-	// get the socket specific data
+	/* Get the socket specific data */
 	socket_data = (tcp_socket_data_ref) socket->specific_data;
 	assert(socket_data);
-	//free the pseudo header
+
+	/* Free the pseudo header */
 	if (socket_data->pseudo_header) {
 		if (socket_data->headerlen) {
@@ -2410,6 +2426,8 @@
 		socket_data->pseudo_header = NULL;
 	}
+
 	socket_data->headerlen = 0;
-	// free the address
+
+	/* Free the address */
 	if (socket_data->addr) {
 		if (socket_data->addrlen) {
@@ -2473,5 +2491,5 @@
 
 		/*
-		   Answer the message 
+		 * Answer the message 
 		 */
 		answer_call(callid, res, &answer, answer_count);
Index: uspace/srv/net/tl/tcp/tcp_module.c
===================================================================
--- uspace/srv/net/tl/tcp/tcp_module.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/net/tl/tcp/tcp_module.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -86,6 +86,5 @@
 }
 
-int
-tl_module_message_standalone(ipc_callid_t callid, ipc_call_t *call,
+int tl_module_message_standalone(ipc_callid_t callid, ipc_call_t *call,
     ipc_call_t *answer, int *answer_count)
 {
Index: uspace/srv/net/tl/udp/udp.c
===================================================================
--- uspace/srv/net/tl/udp/udp.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/net/tl/udp/udp.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -130,5 +130,5 @@
 	}
 
-	// read default packet dimensions
+	/* Read default packet dimensions */
 	rc = ip_packet_size_req(udp_globals.ip_phone, -1,
 	    &udp_globals.packet_dimension);
@@ -158,5 +158,5 @@
 	udp_globals.autobinding = NET_DEFAULT_UDP_AUTOBINDING;
 
-	// get configuration
+	/* Get configuration */
 	configuration = &names[0];
 	rc = net_get_conf_req(udp_globals.net_phone, &configuration, count,
@@ -217,6 +217,6 @@
  *			ip_client_process_packet() function.
  */
-static int
-udp_process_packet(device_id_t device_id, packet_t packet, services_t error)
+static int udp_process_packet(device_id_t device_id, packet_t packet,
+    services_t error)
 {
 	size_t length;
@@ -242,7 +242,8 @@
 		break;
 	case SERVICE_ICMP:
-		// ignore error
+		/* Ignore error */
 		// length = icmp_client_header_length(packet);
-		// process error
+
+		/* Process error */
 		result = icmp_client_process_packet(packet, &type,
 		    &code, NULL, NULL);
@@ -258,5 +259,5 @@
 	}
 
-	// TODO process received ipopts?
+	/* TODO process received ipopts? */
 	result = ip_client_process_packet(packet, NULL, NULL, NULL, NULL, NULL);
 	if (result < 0)
@@ -270,15 +271,15 @@
 		return udp_release_and_return(packet, NO_DATA);
 
-	// trim all but UDP header
+	/* Trim all but UDP header */
 	rc = packet_trim(packet, offset, 0);
 	if (rc != EOK)
 		return udp_release_and_return(packet, rc);
 
-	// get udp header
+	/* Get UDP header */
 	header = (udp_header_ref) packet_get_data(packet);
 	if (!header)
 		return udp_release_and_return(packet, NO_DATA);
 
-	// find the destination socket
+	/* Find the destination socket */
 	socket = socket_port_find(&udp_globals.sockets,
 	ntohs(header->destination_port), SOCKET_MAP_KEY_LISTENING, 0);
@@ -292,10 +293,10 @@
 	}
 
-	// count the received packet fragments
+	/* Count the received packet fragments */
 	next_packet = packet;
 	fragments = 0;
 	total_length = ntohs(header->total_length);
 
-	// compute header checksum if set
+	/* Compute header checksum if set */
 	if (header->checksum && !error) {
 		result = packet_get_addr(packet, (uint8_t **) &src,
@@ -310,6 +311,8 @@
 		} else {
 			checksum = compute_checksum(0, ip_header, length);
-			// the udp header checksum will be added with the first
-			// fragment later
+			/*
+			 * The udp header checksum will be added with the first
+			 * fragment later.
+			 */
 			free(ip_header);
 		}
@@ -330,5 +333,5 @@
 				return udp_release_and_return(packet, rc);
 
-			// add partial checksum if set
+			/* Add partial checksum if set */
 			if (header->checksum) {
 				checksum = compute_checksum(checksum,
@@ -337,5 +340,5 @@
 			}
 
-			// relese the rest of the packet fragments
+			/* Relese the rest of the packet fragments */
 			tmp_packet = pq_next(next_packet);
 			while (tmp_packet) {
@@ -346,10 +349,10 @@
 			}
 
-			// exit the loop
+			/* Exit the loop */
 			break;
 		}
 		total_length -= length;
 
-		// add partial checksum if set
+		/* Add partial checksum if set */
 		if (header->checksum) {
 			checksum = compute_checksum(checksum,
@@ -360,5 +363,5 @@
 	} while ((next_packet = pq_next(next_packet)) && (total_length > 0));
 
-	// check checksum
+	/* Verify checksum */
 	if (header->checksum) {
 		if (flip_checksum(compact_checksum(checksum)) !=
@@ -366,5 +369,5 @@
 			if (tl_prepare_icmp_packet(udp_globals.net_phone,
 			    udp_globals.icmp_phone, packet, error) == EOK) {
-				// checksum error ICMP
+				/* Checksum error ICMP */
 				icmp_parameter_problem_msg(
 				    udp_globals.icmp_phone, ICMP_PARAM_POINTER,
@@ -376,5 +379,5 @@
 	}
 
-	// queue the received packet
+	/* Queue the received packet */
 	rc = dyn_fifo_push(&socket->received, packet_get_id(packet),
 	    SOCKET_MAX_RECEIVED_SIZE);
@@ -387,5 +390,5 @@
 		return udp_release_and_return(packet, rc);
 
-	// notify the destination socket
+	/* Notify the destination socket */
 	fibril_rwlock_write_unlock(&udp_globals.lock);
 	async_msg_5(socket->phone, NET_SOCKET_RECEIVED,
@@ -410,7 +413,6 @@
  *			udp_process_packet() function.
  */
-static int
-udp_received_msg(device_id_t device_id, packet_t packet, services_t receiver,
-    services_t error)
+static int udp_received_msg(device_id_t device_id, packet_t packet,
+    services_t receiver, services_t error)
 {
 	int result;
@@ -451,6 +453,5 @@
  *			function.
  */
-static int
-udp_sendto_message(socket_cores_ref local_sockets, int socket_id,
+static int udp_sendto_message(socket_cores_ref local_sockets, int socket_id,
     const struct sockaddr *addr, socklen_t addrlen, int fragments,
     size_t *data_fragment_size, int flags)
@@ -480,5 +481,5 @@
 
 	if ((socket->port <= 0) && udp_globals.autobinding) {
-		// bind the socket to a random free port if not bound
+		/* Bind the socket to a random free port if not bound */
 		rc = socket_bind_free_port(&udp_globals.sockets, socket,
 		    UDP_FREE_PORTS_START, UDP_FREE_PORTS_END,
@@ -486,5 +487,5 @@
 		if (rc != EOK)
 			return rc;
-		// set the next port as the search starting port number
+		/* Set the next port as the search starting port number */
 		udp_globals.last_used_port = socket->port;
 	}
@@ -495,5 +496,5 @@
 		if (rc != EOK)
 			return rc;
-		// get the device packet dimension
+		/* Get the device packet dimension */
 //		rc = tl_get_ip_packet_dimension(udp_globals.ip_phone,
 //		    &udp_globals.dimensions, device_id, &packet_dimension);
@@ -502,5 +503,5 @@
 	}
 //	} else {
-		// do not ask all the time
+		/* Do not ask all the time */
 		rc = ip_packet_size_req(udp_globals.ip_phone, -1,
 		    &udp_globals.packet_dimension);
@@ -510,5 +511,5 @@
 //	}
 
-	// read the first packet fragment
+	/* Read the first packet fragment */
 	result = tl_socket_read_packet_data(udp_globals.net_phone, &packet,
 	    UDP_HEADER_SIZE, packet_dimension, addr, addrlen);
@@ -523,5 +524,5 @@
 		checksum = 0;
 
-	// prefix the udp header
+	/* Prefix the UDP header */
 	header = PACKET_PREFIX(packet, udp_header_t);
 	if (!header)
@@ -529,5 +530,6 @@
 
 	bzero(header, sizeof(*header));
-	// read the rest of the packet fragments
+
+	/* Read the rest of the packet fragments */
 	for (index = 1; index < fragments; index++) {
 		result = tl_socket_read_packet_data(udp_globals.net_phone,
@@ -548,11 +550,12 @@
 	}
 
-	// set the udp header
+	/* Set the UDP header */
 	header->source_port = htons((socket->port > 0) ? socket->port : 0);
 	header->destination_port = htons(dest_port);
 	header->total_length = htons(total_length + sizeof(*header));
 	header->checksum = 0;
+
 	if (udp_globals.checksum_computing) {
-		// update the pseudo header
+		/* Update the pseudo header */
 		rc = ip_client_set_pseudo_header_data_length(ip_header,
 		    headerlen, total_length + UDP_HEADER_SIZE);
@@ -562,5 +565,5 @@
 		}
 
-		// finish the checksum computation
+		/* Finish the checksum computation */
 		checksum = compute_checksum(checksum, ip_header, headerlen);
 		checksum = compute_checksum(checksum, (uint8_t *) header,
@@ -573,5 +576,5 @@
 	}
 
-	// prepare the first packet fragment
+	/* Prepare the first packet fragment */
 	rc = ip_client_prepare_packet(packet, IPPROTO_UDP, 0, 0, 0, 0);
 	if (rc != EOK)
@@ -581,5 +584,5 @@
 	fibril_rwlock_write_unlock(&udp_globals.lock);
 
-	// send the packet
+	/* Send the packet */
 	ip_send_msg(udp_globals.ip_phone, device_id, packet, SERVICE_UDP, 0);
 
@@ -606,7 +609,6 @@
  *			function.
  */
-static int
-udp_recvfrom_message(socket_cores_ref local_sockets, int socket_id, int flags,
-    size_t *addrlen)
+static int udp_recvfrom_message(socket_cores_ref local_sockets, int socket_id,
+    int flags, size_t *addrlen)
 {
 	socket_core_ref socket;
@@ -620,10 +622,10 @@
 	int rc;
 
-	// find the socket
+	/* Find the socket */
 	socket = socket_cores_find(local_sockets, socket_id);
 	if (!socket)
 		return ENOTSOCK;
 
-	// get the next received packet
+	/* Get the next received packet */
 	packet_id = dyn_fifo_value(&socket->received);
 	if (packet_id < 0)
@@ -636,5 +638,5 @@
 	}
 
-	// get udp header
+	/* Get UDP header */
 	data = packet_get_data(packet);
 	if (!data) {
@@ -644,5 +646,5 @@
 	header = (udp_header_ref) data;
 
-	// set the source address port
+	/* Set the source address port */
 	result = packet_get_addr(packet, (uint8_t **) &addr, NULL);
 	rc = tl_set_address_port(addr, result, ntohs(header->source_port));
@@ -653,5 +655,5 @@
 	*addrlen = (size_t) result;
 
-	// send the source address
+	/* Send the source address */
 	rc = data_reply(addr, *addrlen);
 	switch (rc) {
@@ -665,5 +667,5 @@
 	}
 
-	// trim the header
+	/* Trim the header */
 	rc = packet_trim(packet, UDP_HEADER_SIZE, 0);
 	if (rc != EOK) {
@@ -672,5 +674,5 @@
 	}
 
-	// reply the packets
+	/* Reply the packets */
 	rc = socket_reply_packets(packet, &length);
 	switch (rc) {
@@ -686,5 +688,5 @@
 	(void) dyn_fifo_pop(&socket->received);
 
-	// release the packet and return the total length
+	/* Release the packet and return the total length */
 	return udp_release_and_return(packet, (int) length);
 }
@@ -721,6 +723,8 @@
 	answer_count = 0;
 
-	// The client connection is only in one fibril and therefore no
-	// additional locks are needed.
+	/*
+	 * The client connection is only in one fibril and therefore no
+	 * additional locks are needed.
+	 */
 
 	socket_cores_initialize(&local_sockets);
@@ -728,14 +732,14 @@
 	while (keep_on_going) {
 
-		// answer the call
+		/* Answer the call */
 		answer_call(callid, res, &answer, answer_count);
 
-		// refresh data
+		/* Refresh data */
 		refresh_answer(&answer, &answer_count);
 
-		// get the next call
+		/* Get the next call */
 		callid = async_get_call(&call);
 
-		// process the call
+		/* Process the call */
 		switch (IPC_GET_METHOD(call)) {
 		case IPC_M_PHONE_HUNGUP:
@@ -831,8 +835,8 @@
 	}
 
-	// release the application phone
+	/* Release the application phone */
 	ipc_hangup(app_phone);
 
-	// release all local sockets
+	/* Release all local sockets */
 	socket_cores_release(udp_globals.net_phone, &local_sockets,
 	    &udp_globals.sockets, NULL);
@@ -854,6 +858,5 @@
  * @see IS_NET_UDP_MESSAGE()
  */
-int
-udp_message_standalone(ipc_callid_t callid, ipc_call_t *call,
+int udp_message_standalone(ipc_callid_t callid, ipc_call_t *call,
     ipc_call_t *answer, int *answer_count)
 {
Index: uspace/srv/net/tl/udp/udp_module.c
===================================================================
--- uspace/srv/net/tl/udp/udp_module.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/net/tl/udp/udp_module.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -86,6 +86,5 @@
 }
 
-int
-tl_module_message_standalone(ipc_callid_t callid, ipc_call_t *call,
+int tl_module_message_standalone(ipc_callid_t callid, ipc_call_t *call,
     ipc_call_t *answer, int *answer_count)
 {
Index: uspace/srv/vfs/vfs.h
===================================================================
--- uspace/srv/vfs/vfs.h	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/vfs/vfs.h	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -62,5 +62,5 @@
 #define VFS_PAIR \
 	fs_handle_t fs_handle; \
-	dev_handle_t dev_handle;
+	devmap_handle_t devmap_handle;
 
 /**
@@ -68,5 +68,5 @@
  * doesn't contain any state. For a stateful structure, see vfs_node_t.
  *
- * @note	fs_handle, dev_handle and index are meant to be returned in one
+ * @note	fs_handle, devmap_handle and index are meant to be returned in one
  *		IPC reply.
  */
@@ -182,5 +182,5 @@
 extern void vfs_node_put(vfs_node_t *);
 extern void vfs_node_forget(vfs_node_t *);
-extern unsigned vfs_nodes_refcount_sum_get(fs_handle_t, dev_handle_t);
+extern unsigned vfs_nodes_refcount_sum_get(fs_handle_t, devmap_handle_t);
 
 
Index: uspace/srv/vfs/vfs_lookup.c
===================================================================
--- uspace/srv/vfs/vfs_lookup.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/vfs/vfs_lookup.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -163,5 +163,5 @@
 	aid_t req = async_send_5(phone, VFS_OUT_LOOKUP, (ipcarg_t) first,
 	    (ipcarg_t) (first + len - 1) % PLB_SIZE,
-	    (ipcarg_t) root->dev_handle, (ipcarg_t) lflag, (ipcarg_t) index,
+	    (ipcarg_t) root->devmap_handle, (ipcarg_t) lflag, (ipcarg_t) index,
 	    &answer);
 	
@@ -183,5 +183,5 @@
 	
 	result->triplet.fs_handle = (fs_handle_t) rc;
-	result->triplet.dev_handle = (dev_handle_t) IPC_GET_ARG1(answer);
+	result->triplet.devmap_handle = (devmap_handle_t) IPC_GET_ARG1(answer);
 	result->triplet.index = (fs_index_t) IPC_GET_ARG2(answer);
 	result->size =
@@ -210,5 +210,5 @@
 	ipc_call_t answer;
 	aid_t req = async_send_2(phone, VFS_OUT_OPEN_NODE,
-	    (ipcarg_t) result->triplet.dev_handle,
+	    (ipcarg_t) result->triplet.devmap_handle,
 	    (ipcarg_t) result->triplet.index, &answer);
 	
Index: uspace/srv/vfs/vfs_node.c
===================================================================
--- uspace/srv/vfs/vfs_node.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/vfs/vfs_node.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -113,5 +113,5 @@
 		unsigned long key[] = {
 			[KEY_FS_HANDLE] = node->fs_handle,
-			[KEY_DEV_HANDLE] = node->dev_handle,
+			[KEY_DEV_HANDLE] = node->devmap_handle,
 			[KEY_INDEX] = node->index
 		};
@@ -131,5 +131,5 @@
 		ipcarg_t rc;
 		rc = async_req_2_0(phone, VFS_OUT_DESTROY,
-		    (ipcarg_t)node->dev_handle, (ipcarg_t)node->index);
+		    (ipcarg_t)node->devmap_handle, (ipcarg_t)node->index);
 		assert(rc == EOK);
 		vfs_release_phone(node->fs_handle, phone);
@@ -151,5 +151,5 @@
 	unsigned long key[] = {
 		[KEY_FS_HANDLE] = node->fs_handle,
-		[KEY_DEV_HANDLE] = node->dev_handle,
+		[KEY_DEV_HANDLE] = node->devmap_handle,
 		[KEY_INDEX] = node->index
 	};
@@ -175,5 +175,5 @@
 	unsigned long key[] = {
 		[KEY_FS_HANDLE] = result->triplet.fs_handle,
-		[KEY_DEV_HANDLE] = result->triplet.dev_handle,
+		[KEY_DEV_HANDLE] = result->triplet.devmap_handle,
 		[KEY_INDEX] = result->triplet.index
 	};
@@ -191,5 +191,5 @@
 		memset(node, 0, sizeof(vfs_node_t));
 		node->fs_handle = result->triplet.fs_handle;
-		node->dev_handle = result->triplet.dev_handle;
+		node->devmap_handle = result->triplet.devmap_handle;
 		node->index = result->triplet.index;
 		node->size = result->size;
@@ -243,5 +243,5 @@
 	vfs_node_t *node = hash_table_get_instance(item, vfs_node_t, nh_link);
 	return (node->fs_handle == (fs_handle_t) key[KEY_FS_HANDLE]) &&
-	    (node->dev_handle == key[KEY_DEV_HANDLE]) &&
+	    (node->devmap_handle == key[KEY_DEV_HANDLE]) &&
 	    (node->index == key[KEY_INDEX]);
 }
@@ -255,5 +255,5 @@
 	unsigned refcnt;
 	fs_handle_t fs_handle;
-	dev_handle_t dev_handle;
+	devmap_handle_t devmap_handle;
 };
 
@@ -264,15 +264,15 @@
 
 	if ((node->fs_handle == rd->fs_handle) &&
-	    (node->dev_handle == rd->dev_handle))
+	    (node->devmap_handle == rd->devmap_handle))
 		rd->refcnt += node->refcnt;
 }
 
 unsigned
-vfs_nodes_refcount_sum_get(fs_handle_t fs_handle, dev_handle_t dev_handle)
+vfs_nodes_refcount_sum_get(fs_handle_t fs_handle, devmap_handle_t devmap_handle)
 {
 	struct refcnt_data rd = {
 		.refcnt = 0,
 		.fs_handle = fs_handle,
-		.dev_handle = dev_handle
+		.devmap_handle = devmap_handle
 	};
 
Index: uspace/srv/vfs/vfs_ops.c
===================================================================
--- uspace/srv/vfs/vfs_ops.c	(revision 69e0d6d76d229cc73c6c8a11802d5f2e93167ca4)
+++ uspace/srv/vfs/vfs_ops.c	(revision cb569e62113a2d98fcd62f99a984ae74d5329acf)
@@ -55,5 +55,5 @@
 
 /* Forward declarations of static functions. */
-static int vfs_truncate_internal(fs_handle_t, dev_handle_t, fs_index_t, aoff64_t);
+static int vfs_truncate_internal(fs_handle_t, devmap_handle_t, fs_index_t, aoff64_t);
 
 /**
@@ -65,8 +65,8 @@
 vfs_pair_t rootfs = {
 	.fs_handle = 0,
-	.dev_handle = 0
+	.devmap_handle = 0
 };
 
-static void vfs_mount_internal(ipc_callid_t rid, dev_handle_t dev_handle,
+static void vfs_mount_internal(ipc_callid_t rid, devmap_handle_t devmap_handle,
     fs_handle_t fs_handle, char *mp, char *opts)
 {
@@ -125,5 +125,5 @@
 			phone = vfs_grab_phone(fs_handle);
 			msg = async_send_1(phone, VFS_OUT_MOUNTED,
-			    (ipcarg_t) dev_handle, &answer);
+			    (ipcarg_t) devmap_handle, &answer);
 			/* send the mount options */
 			rc = async_data_write_start(phone, (void *)opts,
@@ -150,5 +150,5 @@
 			
 			mr_res.triplet.fs_handle = fs_handle;
-			mr_res.triplet.dev_handle = dev_handle;
+			mr_res.triplet.devmap_handle = devmap_handle;
 			mr_res.triplet.index = rindex;
 			mr_res.size = rsize;
@@ -157,5 +157,5 @@
 			
 			rootfs.fs_handle = fs_handle;
-			rootfs.dev_handle = dev_handle;
+			rootfs.devmap_handle = devmap_handle;
 			
 			/* Add reference to the mounted root. */
@@ -187,8 +187,8 @@
 	phone = vfs_grab_phone(mp_res.triplet.fs_handle);
 	msg = async_send_4(phone, VFS_OUT_MOUNT,
-	    (ipcarg_t) mp_res.triplet.dev_handle,
+	    (ipcarg_t) mp_res.triplet.devmap_handle,
 	    (ipcarg_t) mp_res.triplet.index,
 	    (ipcarg_t) fs_handle,
-	    (ipcarg_t) dev_handle, &answer);
+	    (ipcarg_t) devmap_handle, &answer);
 	
 	/* send connection */
@@ -229,5 +229,5 @@
 	
 		mr_res.triplet.fs_handle = fs_handle;
-		mr_res.triplet.dev_handle = dev_handle;
+		mr_res.triplet.devmap_handle = devmap_handle;
 		mr_res.triplet.index = rindex;
 		mr_res.size = rsize;
@@ -255,5 +255,5 @@
 	 * in the request.
 	 */
-	dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request);
+	devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
 	
 	/*
@@ -343,5 +343,5 @@
 	
 	/* Do the mount */
-	vfs_mount_internal(rid, dev_handle, fs_handle, mp, opts);
+	vfs_mount_internal(rid, devmap_handle, fs_handle, mp, opts);
 	free(mp);
 	free(fs_name);
@@ -402,5 +402,5 @@
 	 */
 	if (vfs_nodes_refcount_sum_get(mr_node->fs_handle,
-	    mr_node->dev_handle) != 2) {
+	    mr_node->devmap_handle) != 2) {
 		fibril_rwlock_write_unlock(&namespace_rwlock);
 		vfs_node_put(mr_node);
@@ -422,5 +422,5 @@
 		phone = vfs_grab_phone(mr_node->fs_handle);
 		rc = async_req_1_0(phone, VFS_OUT_UNMOUNTED,
-		    mr_node->dev_handle);
+		    mr_node->devmap_handle);
 		vfs_release_phone(mr_node->fs_handle, phone);
 		if (rc != EOK) {
@@ -431,5 +431,5 @@
 		}
 		rootfs.fs_handle = 0;
-		rootfs.dev_handle = 0;
+		rootfs.devmap_handle = 0;
 	} else {
 
@@ -458,5 +458,5 @@
 
 		phone = vfs_grab_phone(mp_node->fs_handle);
-		rc = async_req_2_0(phone, VFS_OUT_UNMOUNT, mp_node->dev_handle,
+		rc = async_req_2_0(phone, VFS_OUT_UNMOUNT, mp_node->devmap_handle,
 		    mp_node->index);
 		vfs_release_phone(mp_node->fs_handle, phone);
@@ -569,5 +569,5 @@
 		if (node->size) {
 			rc = vfs_truncate_internal(node->fs_handle,
-			    node->dev_handle, node->index, 0);
+			    node->devmap_handle, node->index, 0);
 			if (rc) {
 				fibril_rwlock_write_unlock(&node->contents_rwlock);
@@ -626,5 +626,5 @@
 	
 	lr.triplet.fs_handle = IPC_GET_ARG1(*request);
-	lr.triplet.dev_handle = IPC_GET_ARG2(*request);
+	lr.triplet.devmap_handle = IPC_GET_ARG2(*request);
 	lr.triplet.index = IPC_GET_ARG3(*request);
 	int oflag = IPC_GET_ARG4(*request);
@@ -647,5 +647,5 @@
 		if (node->size) {
 			rc = vfs_truncate_internal(node->fs_handle,
-			    node->dev_handle, node->index, 0);
+			    node->devmap_handle, node->index, 0);
 			if (rc) {
 				fibril_rwlock_write_unlock(&node->contents_rwlock);
@@ -709,5 +709,5 @@
 	aid_t msg;
 	ipc_call_t answer;
-	msg = async_send_2(fs_phone, VFS_OUT_SYNC, file->node->dev_handle,
+	msg = async_send_2(fs_phone, VFS_OUT_SYNC, file->node->devmap_handle,
 	    file->node->index, &answer);
 
@@ -740,5 +740,5 @@
 		aid_t msg;
 		ipc_call_t answer;
-		msg = async_send_2(fs_phone, VFS_OUT_CLOSE, file->node->dev_handle,
+		msg = async_send_2(fs_phone, VFS_OUT_CLOSE, file->node->devmap_handle,
 		    file->node->index, &answer);
 		
@@ -838,9 +838,9 @@
 		
 		rc = async_data_read_forward_3_1(fs_phone, VFS_OUT_READ,
-		    file->node->dev_handle, file->node->index, file->pos,
+		    file->node->devmap_handle, file->node->index, file->pos,
 		    &answer);
 	} else {
 		rc = async_data_write_forward_3_1(fs_phone, VFS_OUT_WRITE,
-		    file->node->dev_handle, file->node->index, file->pos,
+		    file->node->devmap_handle, file->node->index, file->pos,
 		    &answer);
 	}
@@ -961,5 +961,5 @@
 }
 
-int vfs_truncate_internal(fs_handle_t fs_handle, dev_handle_t dev_handle,
+int vfs_truncate_internal(fs_handle_t fs_handle, devmap_handle_t devmap_handle,
     fs_index_t index, aoff64_t size)
 {
@@ -968,5 +968,5 @@
 	
 	fs_phone = vfs_grab_phone(fs_handle);
-	rc = async_req_4_0(fs_phone, VFS_OUT_TRUNCATE, (ipcarg_t) dev_handle,
+	rc = async_req_4_0(fs_phone, VFS_OUT_TRUNCATE, (ipcarg_t) devmap_handle,
 	    (ipcarg_t) index, LOWER32(size), UPPER32(size));
 	vfs_release_phone(fs_handle, fs_phone);
@@ -990,5 +990,5 @@
 	fibril_rwlock_write_lock(&file->node->contents_rwlock);
 	rc = vfs_truncate_internal(file->node->fs_handle,
-	    file->node->dev_handle, file->node->index, size);
+	    file->node->devmap_handle, file->node->index, size);
 	if (rc == EOK)
 		file->node->size = size;
@@ -1022,5 +1022,5 @@
 	
 	aid_t msg;
-	msg = async_send_3(fs_phone, VFS_OUT_STAT, file->node->dev_handle,
+	msg = async_send_3(fs_phone, VFS_OUT_STAT, file->node->devmap_handle,
 	    file->node->index, true, NULL);
 	ipc_forward_fast(callid, fs_phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
@@ -1071,5 +1071,5 @@
 	int fs_phone = vfs_grab_phone(node->fs_handle);
 	aid_t msg;
-	msg = async_send_3(fs_phone, VFS_OUT_STAT, node->dev_handle,
+	msg = async_send_3(fs_phone, VFS_OUT_STAT, node->devmap_handle,
 	    node->index, false, NULL);
 	ipc_forward_fast(callid, fs_phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
@@ -1245,5 +1245,5 @@
 	/* Check whether linking to the same file system instance. */
 	if ((old_node->fs_handle != new_par_lr.triplet.fs_handle) ||
-	    (old_node->dev_handle != new_par_lr.triplet.dev_handle)) {
+	    (old_node->devmap_handle != new_par_lr.triplet.devmap_handle)) {
 		fibril_rwlock_write_unlock(&namespace_rwlock);
 		ipc_answer_0(rid, EXDEV);	/* different file systems */
