Index: uspace/app/tmon/Makefile
===================================================================
--- uspace/app/tmon/Makefile	(revision 80f7c542f46cabfa62d4645700e924a848e61074)
+++ uspace/app/tmon/Makefile	(revision 290338bf7224f502808b23e82d98306208962b97)
@@ -30,5 +30,5 @@
 BINARY = tmon
 
-LIBS = drv
+LIBS = drv usb
 
 SOURCES = \
@@ -36,5 +36,5 @@
 	list.c\
 	tf.c\
-	burst_tests.c\
+	tests.c\
 	resolve.c
 
Index: uspace/app/tmon/burst_tests.c
===================================================================
--- uspace/app/tmon/burst_tests.c	(revision 80f7c542f46cabfa62d4645700e924a848e61074)
+++ 	(revision )
@@ -1,445 +1,0 @@
-/*
- * Copyright (c) 2017 Petr Manek
- * 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 tmon
- * @{
- */
-/**
- * @file
- * USB burst tests.
- */
-
-#include <stdio.h>
-#include <errno.h>
-#include <str_error.h>
-#include <getopt.h>
-#include <usbdiag_iface.h>
-#include <macros.h>
-#include "commands.h"
-#include "tf.h"
-
-#define NAME   "tmon"
-#define INDENT "      "
-
-/** Generic burst test parameters. */
-typedef struct tmon_burst_test_params {
-	/** Inherited base. */
-	tmon_test_params_t base;
-	/** The count of reads/writes to perform. */
-	uint32_t cycles;
-	/** Size of single read/write. */
-	size_t size;
-} tmon_burst_test_params_t;
-
-/** Static array of long options, from which test parameters are parsed. */
-static struct option long_options[] = {
-	{"cycles", required_argument, NULL, 'n'},
-	{"size", required_argument, NULL, 's'},
-	{0, 0, NULL, 0}
-};
-
-/** String of short options, from which test parameters are parsed. */
-static const char *short_options = "n:s:";
-
-/** Common option parser for all burst tests.
- * @param[in] argc Number of arguments.
- * @param[in] argv Argument values. Must point to exactly `argc` strings.
- * @param[out] params Parsed test parameters (if successful).
- *
- * @return EOK if successful (in such case caller becomes the owner of `params`).
- */
-static int read_params(int argc, char *argv[], tmon_test_params_t **params)
-{
-	int rc;
-	tmon_burst_test_params_t *p = (tmon_burst_test_params_t *) malloc(sizeof(tmon_burst_test_params_t));
-	if (!p)
-		return ENOMEM;
-
-	// Default values.
-	p->cycles = 256;
-	p->size = 1024;
-
-	// Parse other than default values.
-	int c;
-	for (c = 0, optreset = 1, optind = 0; c != -1;) {
-		c = getopt_long(argc, argv, short_options, long_options, NULL);
-		switch (c) {
-		case -1:
-			break;
-		case 'n':
-			if (!optarg || str_uint32_t(optarg, NULL, 10, false, &p->cycles) != EOK) {
-				puts(NAME ": Invalid number of cycles.\n");
-				rc = EINVAL;
-				goto err_malloc;
-			}
-			break;
-		case 's':
-			if (!optarg || str_size_t(optarg, NULL, 10, false, &p->size) != EOK) {
-				puts(NAME ": Invalid data size.\n");
-				rc = EINVAL;
-				goto err_malloc;
-			}
-			break;
-		}
-	}
-
-	*params = (tmon_test_params_t *) p;
-	return EOK;
-
-err_malloc:
-	free(p);
-	*params = NULL;
-	return rc;
-}
-
-/** Unit of quantity used for pretty formatting. */
-typedef struct tmon_unit {
-	/** Prefix letter, which is printed before the actual unit. */
-	char prefix;
-	/** Factor of the unit. */
-	uint64_t factor;
-} tmon_unit_t;
-
-/** Static array of units with decreasing factors. */
-static const tmon_unit_t units[] = {
-	{ .prefix = 'E', .factor = ((uint64_t) 1) << 60 },
-	{ .prefix = 'P', .factor = ((uint64_t) 1) << 50 },
-	{ .prefix = 'T', .factor = ((uint64_t) 1) << 40 },
-	{ .prefix = 'G', .factor = ((uint64_t) 1) << 30 },
-	{ .prefix = 'M', .factor = ((uint64_t) 1) << 20 },
-	{ .prefix = 'k', .factor = ((uint64_t) 1) << 10 }
-};
-
-/** Format size in bytes for human reading.
- * @param[in] size The size to format.
- * @param[in] fmt Format string. Must include one double and char.
- *
- * @return Heap-allocated string if successful (caller becomes its owner), NULL otherwise.
- */
-static char * format_size(double size, const char *fmt)
-{
-	// Figure out the "tightest" unit.
-	unsigned i;
-	for (i = 0; i < ARRAY_SIZE(units); ++i) {
-		if (units[i].factor <= size)
-			break;
-	}
-
-	char prefix[] = { '\0', '\0' };
-	double factor = 1;
-
-	if (i < ARRAY_SIZE(units)) {
-		prefix[0] = units[i].prefix;
-		factor = units[i].factor;
-	}
-
-	// Format the size.
-	const double div_size = size / factor;
-
-	char *out = NULL;
-	asprintf(&out, fmt, div_size, prefix);
-
-	return out;
-}
-
-/** Print burst test parameters.
- * @param[in] params Test parameters to print.
- */
-static void print_params(const tmon_burst_test_params_t *params)
-{
-	printf(INDENT "Number of cycles: %d\n", params->cycles);
-
-	char *str_size = format_size(params->size, "%.3f %sB");
-	printf(INDENT "Data size: %s\n", str_size);
-	free(str_size);
-}
-
-/** Print burst test results.
- * @param[in] params Test parameters.
- * @param[in] duration Duration of the burst test.
- */
-static void print_results(const tmon_burst_test_params_t *params, usbdiag_dur_t duration)
-{
-	printf(INDENT "Total duration: %ld ms\n", duration);
-
-	const double dur_per_cycle = (double) duration / (double) params->cycles;
-	printf(INDENT "Duration per cycle: %.3f ms\n", dur_per_cycle);
-
-	const size_t total_size = params->size * params->cycles;
-	char *str_total_size = format_size(total_size, "%.3f %sB");
-	printf(INDENT "Total size: %s\n", str_total_size);
-	free(str_total_size);
-
-	const double speed = 1000.0 * (double) total_size / (double) duration;
-	char *str_speed = format_size(speed, "%.3f %sB/s");
-	printf(INDENT "Average speed: %s\n", str_speed);
-	free(str_speed);
-}
-
-/** Run "interrupt in" burst test.
- * @param[in] exch Open async exchange with the diagnostic device.
- * @param[in] generic_params Test parameters. Must point to 'tmon_burst_test_params_t'.
- *
- * @return Exit code
- */
-static int run_intr_in(async_exch_t *exch, const tmon_test_params_t *generic_params)
-{
-	const tmon_burst_test_params_t *params = (tmon_burst_test_params_t *) generic_params;
-	puts("Reading data from interrupt endpoint.\n");
-	print_params(params);
-
-	usbdiag_dur_t duration;
-	int rc = usbdiag_burst_intr_in(exch, params->cycles, params->size, &duration);
-	if (rc) {
-		printf(NAME ": Test failed with error: %s\n", str_error(rc));
-		return 1;
-	}
-
-	puts("Test succeeded.\n");
-	print_results(params, duration);
-	return 0;
-}
-
-/** Run "interrupt out" burst test.
- * @param[in] exch Open async exchange with the diagnostic device.
- * @param[in] generic_params Test parameters. Must point to 'tmon_burst_test_params_t'.
- *
- * @return Exit code
- */
-static int run_intr_out(async_exch_t *exch, const tmon_test_params_t *generic_params)
-{
-	const tmon_burst_test_params_t *params = (tmon_burst_test_params_t *) generic_params;
-	puts("Writing data to interrupt endpoint.\n");
-	print_params(params);
-
-	usbdiag_dur_t duration;
-	int rc = usbdiag_burst_intr_out(exch, params->cycles, params->size, &duration);
-	if (rc) {
-		printf(NAME ": Test failed with error: %s\n", str_error(rc));
-		return 1;
-	}
-
-	puts("Test succeeded.\n");
-	print_results(params, duration);
-	return 0;
-}
-
-/** Run "bulk in" burst test.
- * @param[in] exch Open async exchange with the diagnostic device.
- * @param[in] generic_params Test parameters. Must point to 'tmon_burst_test_params_t'.
- *
- * @return Exit code
- */
-static int run_bulk_in(async_exch_t *exch, const tmon_test_params_t *generic_params)
-{
-	const tmon_burst_test_params_t *params = (tmon_burst_test_params_t *) generic_params;
-	puts("Reading data from bulk endpoint.\n");
-	print_params(params);
-
-	usbdiag_dur_t duration;
-	int rc = usbdiag_burst_bulk_in(exch, params->cycles, params->size, &duration);
-	if (rc) {
-		printf(NAME ": Test failed with error: %s\n", str_error(rc));
-		return 1;
-	}
-
-	puts("Test succeeded.\n");
-	print_results(params, duration);
-	return 0;
-}
-
-/** Run "bulk out" burst test.
- * @param[in] exch Open async exchange with the diagnostic device.
- * @param[in] generic_params Test parameters. Must point to 'tmon_burst_test_params_t'.
- *
- * @return Exit code
- */
-static int run_bulk_out(async_exch_t *exch, const tmon_test_params_t *generic_params)
-{
-	const tmon_burst_test_params_t *params = (tmon_burst_test_params_t *) generic_params;
-	puts("Writing data to bulk endpoint.\n");
-	print_params(params);
-
-	usbdiag_dur_t duration;
-	int rc = usbdiag_burst_bulk_out(exch, params->cycles, params->size, &duration);
-	if (rc) {
-		printf(NAME ": Test failed with error: %s\n", str_error(rc));
-		return 1;
-	}
-
-	puts("Test succeeded.\n");
-	print_results(params, duration);
-	return 0;
-}
-
-/** Run "isochronous in" burst test.
- * @param[in] exch Open async exchange with the diagnostic device.
- * @param[in] generic_params Test parameters. Must point to 'tmon_burst_test_params_t'.
- *
- * @return Exit code
- */
-static int run_isoch_in(async_exch_t *exch, const tmon_test_params_t *generic_params)
-{
-	const tmon_burst_test_params_t *params = (tmon_burst_test_params_t *) generic_params;
-	puts("Reading data from isochronous endpoint.\n");
-	print_params(params);
-
-	usbdiag_dur_t duration;
-	int rc = usbdiag_burst_isoch_in(exch, params->cycles, params->size, &duration);
-	if (rc) {
-		printf(NAME ": Test failed with error: %s\n", str_error(rc));
-		return 1;
-	}
-
-	puts("Test succeeded.\n");
-	print_results(params, duration);
-	return 0;
-}
-
-/** Run "isochronous out" burst test.
- * @param[in] exch Open async exchange with the diagnostic device.
- * @param[in] generic_params Test parameters. Must point to 'tmon_burst_test_params_t'.
- *
- * @return Exit code
- */
-static int run_isoch_out(async_exch_t *exch, const tmon_test_params_t *generic_params)
-{
-	const tmon_burst_test_params_t *params = (tmon_burst_test_params_t *) generic_params;
-	puts("Writing data to isochronous endpoint.\n");
-	print_params(params);
-
-	usbdiag_dur_t duration;
-	int rc = usbdiag_burst_isoch_out(exch, params->cycles, params->size, &duration);
-	if (rc) {
-		printf(NAME ": Test failed with error: %s\n", str_error(rc));
-		return 1;
-	}
-
-	puts("Test succeeded.\n");
-	print_results(params, duration);
-	return 0;
-}
-
-/** Interrupt in burst test command handler.
- * @param[in] argc Number of arguments.
- * @param[in] argv Argument values. Must point to exactly `argc` strings.
- *
- * @return Exit code
- */
-int tmon_burst_intr_in(int argc, char *argv[])
-{
-	static const tmon_test_ops_t ops = {
-		.run = run_intr_in,
-		.read_params = read_params
-	};
-
-	return tmon_test_main(argc, argv, &ops);
-}
-
-/** Interrupt out burst test command handler.
- * @param[in] argc Number of arguments.
- * @param[in] argv Argument values. Must point to exactly `argc` strings.
- *
- * @return Exit code
- */
-int tmon_burst_intr_out(int argc, char *argv[])
-{
-	static const tmon_test_ops_t ops = {
-		.run = run_intr_out,
-		.read_params = read_params
-	};
-
-	return tmon_test_main(argc, argv, &ops);
-}
-
-/** Interrupt bulk burst test command handler.
- * @param[in] argc Number of arguments.
- * @param[in] argv Argument values. Must point to exactly `argc` strings.
- *
- * @return Exit code
- */
-int tmon_burst_bulk_in(int argc, char *argv[])
-{
-	static const tmon_test_ops_t ops = {
-		.run = run_bulk_in,
-		.read_params = read_params
-	};
-
-	return tmon_test_main(argc, argv, &ops);
-}
-
-/** Bulk out burst test command handler.
- * @param[in] argc Number of arguments.
- * @param[in] argv Argument values. Must point to exactly `argc` strings.
- *
- * @return Exit code
- */
-int tmon_burst_bulk_out(int argc, char *argv[])
-{
-	static const tmon_test_ops_t ops = {
-		.run = run_bulk_out,
-		.read_params = read_params
-	};
-
-	return tmon_test_main(argc, argv, &ops);
-}
-
-/** Isochronous in burst test command handler.
- * @param[in] argc Number of arguments.
- * @param[in] argv Argument values. Must point to exactly `argc` strings.
- *
- * @return Exit code
- */
-int tmon_burst_isoch_in(int argc, char *argv[])
-{
-	static const tmon_test_ops_t ops = {
-		.run = run_isoch_in,
-		.read_params = read_params
-	};
-
-	return tmon_test_main(argc, argv, &ops);
-}
-
-/** Isochronous out burst test command handler.
- * @param[in] argc Number of arguments.
- * @param[in] argv Argument values. Must point to exactly `argc` strings.
- *
- * @return Exit code
- */
-int tmon_burst_isoch_out(int argc, char *argv[])
-{
-	static const tmon_test_ops_t ops = {
-		.run = run_isoch_out,
-		.read_params = read_params
-	};
-
-	return tmon_test_main(argc, argv, &ops);
-}
-
-/** @}
- */
Index: uspace/app/tmon/commands.h
===================================================================
--- uspace/app/tmon/commands.h	(revision 80f7c542f46cabfa62d4645700e924a848e61074)
+++ uspace/app/tmon/commands.h	(revision 290338bf7224f502808b23e82d98306208962b97)
@@ -42,11 +42,11 @@
 int tmon_list(int, char **);
 
-/* Burst tests read/write into endpoints as fast as possible. */
-int tmon_burst_intr_in(int, char **);
-int tmon_burst_intr_out(int, char **);
-int tmon_burst_bulk_in(int, char **);
-int tmon_burst_bulk_out(int, char **);
-int tmon_burst_isoch_in(int, char **);
-int tmon_burst_isoch_out(int, char **);
+/* Tests commands differ by endpoint types. */
+int tmon_test_intr_in(int, char **);
+int tmon_test_intr_out(int, char **);
+int tmon_test_bulk_in(int, char **);
+int tmon_test_bulk_out(int, char **);
+int tmon_test_isoch_in(int, char **);
+int tmon_test_isoch_out(int, char **);
 
 #endif /* TMON_COMMANDS_H_ */
Index: uspace/app/tmon/main.c
===================================================================
--- uspace/app/tmon/main.c	(revision 80f7c542f46cabfa62d4645700e924a848e61074)
+++ uspace/app/tmon/main.c	(revision 290338bf7224f502808b23e82d98306208962b97)
@@ -62,31 +62,31 @@
 		.name = "test-intr-in",
 		.description = "Read from interrupt endpoint as fast as possible.",
-		.action = tmon_burst_intr_in,
+		.action = tmon_test_intr_in,
 	},
 	{
 		.name = "test-intr-out",
 		.description = "Write to interrupt endpoint as fast as possible.",
-		.action = tmon_burst_intr_out,
+		.action = tmon_test_intr_out,
 	},
 	{
 		.name = "test-bulk-in",
 		.description = "Read from bulk endpoint as fast as possible.",
-		.action = tmon_burst_bulk_in,
+		.action = tmon_test_bulk_in,
 	},
 	{
 		.name = "test-bulk-out",
 		.description = "Write to bulk endpoint as fast as possible.",
-		.action = tmon_burst_bulk_out,
+		.action = tmon_test_bulk_out,
 	},
 	{
 		.name = "test-isoch-in",
 		.description = "Read from isochronous endpoint as fast as possible.",
-		.action = tmon_burst_isoch_in,
+		.action = tmon_test_isoch_in,
 	},
 	{
 		.name = "test-isoch-out",
 		.description = "Write to isochronous endpoint as fast as possible.",
-		.action = tmon_burst_isoch_out,
-	}
+		.action = tmon_test_isoch_out,
+	},
 };
 
@@ -104,13 +104,18 @@
 static tmon_opt_t options[] = {
 	{
-		.long_name = "cycles",
-		.short_name = 'n',
-		.description = "Set the number of read/write cycles."
+		.long_name = "duration",
+		.short_name = 't',
+		.description = "Set the minimum test duration (in seconds)."
 	},
 	{
 		.long_name = "size",
 		.short_name = 's',
-		.description = "Set the data size transferred in a single cycle."
-	}
+		.description = "Set the data size (in bytes) transferred in a single cycle."
+	},
+	{
+		.long_name = "validate",
+		.short_name = 'v',
+		.description = "Validate the correctness of transferred data (impacts performance)."
+	},
 };
 
Index: uspace/app/tmon/tests.c
===================================================================
--- uspace/app/tmon/tests.c	(revision 290338bf7224f502808b23e82d98306208962b97)
+++ uspace/app/tmon/tests.c	(revision 290338bf7224f502808b23e82d98306208962b97)
@@ -0,0 +1,337 @@
+/*
+ * Copyright (c) 2017 Petr Manek
+ * 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 tmon
+ * @{
+ */
+/**
+ * @file
+ * USB tests.
+ */
+
+#include <stdio.h>
+#include <errno.h>
+#include <str_error.h>
+#include <getopt.h>
+#include <usb/usb.h>
+#include <usbdiag_iface.h>
+#include "commands.h"
+#include "tf.h"
+
+#define NAME   "tmon"
+#define INDENT "      "
+
+/** Static array of long options, from which test parameters are parsed. */
+static struct option long_options[] = {
+	{"duration", required_argument, NULL, 't'},
+	{"size", required_argument, NULL, 's'},
+	{"validate", required_argument, NULL, 'v'},
+	{0, 0, NULL, 0}
+};
+
+/** String of short options, from which test parameters are parsed. */
+static const char *short_options = "t:s:v";
+
+/** Common option parser for all tests.
+ * @param[in] argc Number of arguments.
+ * @param[in] argv Argument values. Must point to exactly `argc` strings.
+ * @param[out] params Parsed test parameters (if successful).
+ *
+ * @return EOK if successful (in such case caller becomes the owner of `params`).
+ */
+static int read_params(int argc, char *argv[], void **params)
+{
+	int rc;
+	usbdiag_test_params_t *p = (usbdiag_test_params_t *) malloc(sizeof(usbdiag_test_params_t));
+	if (!p)
+		return ENOMEM;
+
+	// Default values.
+	p->transfer_size = 0;
+	p->min_duration = 5000;
+	p->validate_data = false;
+
+	// Parse other than default values.
+	int c;
+	uint32_t duration_uint;
+	for (c = 0, optreset = 1, optind = 0; c != -1;) {
+		c = getopt_long(argc, argv, short_options, long_options, NULL);
+		switch (c) {
+		case -1:
+			break;
+		case 'v':
+			p->validate_data = true;
+			break;
+		case 't':
+			if (!optarg || str_uint32_t(optarg, NULL, 10, false, &duration_uint) != EOK) {
+				puts(NAME ": Invalid duration.\n");
+				rc = EINVAL;
+				goto err_malloc;
+			}
+			p->min_duration = (usbdiag_dur_t) duration_uint * 1000;
+			break;
+		case 's':
+			if (!optarg || str_size_t(optarg, NULL, 10, false, &p->transfer_size) != EOK) {
+				puts(NAME ": Invalid data size.\n");
+				rc = EINVAL;
+				goto err_malloc;
+			}
+			break;
+		}
+	}
+
+	*params = (void *) p;
+	return EOK;
+
+err_malloc:
+	free(p);
+	*params = NULL;
+	return rc;
+}
+
+/** Print test parameters.
+ * @param[in] params Test parameters to print.
+ */
+static void print_params(const usbdiag_test_params_t *params)
+{
+	printf("Endpoint type: %s\n", usb_str_transfer_type(params->transfer_type));
+	char *str_min_duration = tmon_format_duration(params->min_duration, "%.3f %s");
+	printf("Min. duration: %s\n", str_min_duration);
+	free(str_min_duration);
+
+	if (params->transfer_size) {
+		char *str_size = tmon_format_size(params->transfer_size, "%.3f %s");
+		printf("Transfer size: %s\n", str_size);
+		free(str_size);
+	} else {
+		printf("Transfer size: (max. transfer size)\n");
+	}
+
+	printf("Validate data: %s\n", params->validate_data ? "yes" : "no");
+}
+
+/** Print test results.
+ * @param[in] params Test parameters.
+ * @param[in] results Test results.
+ */
+static void print_results(const usbdiag_test_params_t *params, const usbdiag_test_results_t *results)
+{
+	printf("Transfers performed: %u\n", results->transfer_count);
+
+	char *str_total_duration = tmon_format_duration(results->act_duration, "%.3f %s");
+	printf("Total duration: %s\n", str_total_duration);
+	free(str_total_duration);
+
+	char *str_size_per_transfer = tmon_format_size(results->transfer_size, "%.3f %s");
+	printf("Transfer size: %s\n", str_size_per_transfer);
+	free(str_size_per_transfer);
+
+	const size_t total_size = results->transfer_size * results->transfer_count;
+	char *str_total_size = tmon_format_size(total_size, "%.3f %s");
+	printf("Total size: %s\n", str_total_size);
+	free(str_total_size);
+
+	const double dur_per_transfer = (double) results->act_duration / (double) results->transfer_count;
+	char *str_dur_per_transfer = tmon_format_duration(dur_per_transfer, "%.3f %s");
+	printf("Avg. transfer duration: %s\n", str_dur_per_transfer);
+	free(str_dur_per_transfer);
+
+	const double speed = 1000.0 * (double) total_size / (double) results->act_duration;
+	char *str_speed = tmon_format_size(speed, "%.3f %s/s");
+	printf("Avg. speed: %s\n", str_speed);
+	free(str_speed);
+}
+
+/** Run test on "in" endpoint.
+ * @param[in] exch Open async exchange with the diagnostic device.
+ * @param[in] generic_params Test parameters. Must point to 'usbdiag_test_params_t'.
+ *
+ * @return Exit code
+ */
+static int test_in(async_exch_t *exch, const void *generic_params)
+{
+	const usbdiag_test_params_t *params = (usbdiag_test_params_t *) generic_params;
+	print_params(params);
+	puts("\nTesting... ");
+
+	usbdiag_test_results_t results;
+	int rc = usbdiag_test_in(exch, params, &results);
+	if (rc != EOK) {
+		puts("failed\n");
+		printf(NAME ": %s\n", str_error(rc));
+		return 1;
+	}
+
+	puts("succeeded\n\n");
+	print_results(params, &results);
+	return 0;
+}
+
+/** Run test on "out" endpoint.
+ * @param[in] exch Open async exchange with the diagnostic device.
+ * @param[in] generic_params Test parameters. Must point to 'usbdiag_test_params_t'.
+ *
+ * @return Exit code
+ */
+static int test_out(async_exch_t *exch, const void *generic_params)
+{
+	const usbdiag_test_params_t *params = (usbdiag_test_params_t *) generic_params;
+	print_params(params);
+	puts("\nTesting... ");
+
+	usbdiag_test_results_t results;
+	int rc = usbdiag_test_out(exch, params, &results);
+	if (rc) {
+		puts("failed\n");
+		printf(NAME ": %s\n", str_error(rc));
+		return 1;
+	}
+
+	puts("succeeded\n\n");
+	print_results(params, &results);
+	return 0;
+}
+
+#define GEN_PRE_RUN(FN, TYPE) \
+	static int pre_run_##FN(void *generic_params) \
+	{ \
+		usbdiag_test_params_t *params = (usbdiag_test_params_t *) generic_params; \
+		params->transfer_type = USB_TRANSFER_##TYPE; \
+		return EOK; \
+	}
+
+GEN_PRE_RUN(intr, INTERRUPT)
+GEN_PRE_RUN(bulk, BULK)
+GEN_PRE_RUN(isoch, ISOCHRONOUS)
+
+#undef GEN_PRE_RUN
+
+/** Interrupt in test command handler.
+ * @param[in] argc Number of arguments.
+ * @param[in] argv Argument values. Must point to exactly `argc` strings.
+ *
+ * @return Exit code
+ */
+int tmon_test_intr_in(int argc, char *argv[])
+{
+	static const tmon_test_ops_t ops = {
+		.pre_run = pre_run_intr,
+		.run = test_in,
+		.read_params = read_params
+	};
+
+	return tmon_test_main(argc, argv, &ops);
+}
+
+/** Interrupt out test command handler.
+ * @param[in] argc Number of arguments.
+ * @param[in] argv Argument values. Must point to exactly `argc` strings.
+ *
+ * @return Exit code
+ */
+int tmon_test_intr_out(int argc, char *argv[])
+{
+	static const tmon_test_ops_t ops = {
+		.pre_run = pre_run_intr,
+		.run = test_out,
+		.read_params = read_params
+	};
+
+	return tmon_test_main(argc, argv, &ops);
+}
+
+/** Interrupt bulk test command handler.
+ * @param[in] argc Number of arguments.
+ * @param[in] argv Argument values. Must point to exactly `argc` strings.
+ *
+ * @return Exit code
+ */
+int tmon_test_bulk_in(int argc, char *argv[])
+{
+	static const tmon_test_ops_t ops = {
+		.pre_run = pre_run_bulk,
+		.run = test_in,
+		.read_params = read_params
+	};
+
+	return tmon_test_main(argc, argv, &ops);
+}
+
+/** Bulk out test command handler.
+ * @param[in] argc Number of arguments.
+ * @param[in] argv Argument values. Must point to exactly `argc` strings.
+ *
+ * @return Exit code
+ */
+int tmon_test_bulk_out(int argc, char *argv[])
+{
+	static const tmon_test_ops_t ops = {
+		.pre_run = pre_run_bulk,
+		.run = test_out,
+		.read_params = read_params
+	};
+
+	return tmon_test_main(argc, argv, &ops);
+}
+
+/** Isochronous in test command handler.
+ * @param[in] argc Number of arguments.
+ * @param[in] argv Argument values. Must point to exactly `argc` strings.
+ *
+ * @return Exit code
+ */
+int tmon_test_isoch_in(int argc, char *argv[])
+{
+	static const tmon_test_ops_t ops = {
+		.pre_run = pre_run_isoch,
+		.run = test_in,
+		.read_params = read_params
+	};
+
+	return tmon_test_main(argc, argv, &ops);
+}
+
+/** Isochronous out test command handler.
+ * @param[in] argc Number of arguments.
+ * @param[in] argv Argument values. Must point to exactly `argc` strings.
+ *
+ * @return Exit code
+ */
+int tmon_test_isoch_out(int argc, char *argv[])
+{
+	static const tmon_test_ops_t ops = {
+		.pre_run = pre_run_isoch,
+		.run = test_out,
+		.read_params = read_params
+	};
+
+	return tmon_test_main(argc, argv, &ops);
+}
+
+/** @}
+ */
Index: uspace/app/tmon/tf.c
===================================================================
--- uspace/app/tmon/tf.c	(revision 80f7c542f46cabfa62d4645700e924a848e61074)
+++ uspace/app/tmon/tf.c	(revision 290338bf7224f502808b23e82d98306208962b97)
@@ -36,4 +36,5 @@
 
 #include <stdio.h>
+#include <macros.h>
 #include <devman.h>
 #include <str_error.h>
@@ -74,10 +75,15 @@
 	}
 
-	printf("Using device: %s\n", path);
+	printf("Device: %s\n", path);
 
 	// Read test parameters from options.
-	tmon_test_params_t *params = NULL;
+	void *params = NULL;
 	if ((rc = ops->read_params(argc, argv, &params))) {
 		printf(NAME ": Reading test parameters failed. %s\n", str_error(rc));
+		return 1;
+	}
+
+	if ((rc = ops->pre_run(params))) {
+		printf(NAME ": Pre-run hook failed. %s\n", str_error(rc));
 		return 1;
 	}
@@ -106,4 +112,73 @@
 }
 
+/** Unit of quantity used for pretty formatting. */
+typedef struct tmon_unit {
+	/** Prefix letter, which is printed before the actual unit. */
+	const char *unit;
+	/** Factor of the unit. */
+	double factor;
+} tmon_unit_t;
+
+/** Format a value for human reading.
+ * @param[in] val The value to format.
+ * @param[in] fmt Format string. Must include one double and char.
+ *
+ * @return Heap-allocated string if successful (caller becomes its owner), NULL otherwise.
+ */
+static char *format_unit(double val, const char *fmt, const tmon_unit_t *units, size_t len)
+{
+	// Figure out the "tightest" unit.
+	unsigned i;
+	for (i = 0; i < len; ++i) {
+		if (units[i].factor <= val)
+			break;
+	}
+
+	if (i == len) --i;
+	const char *unit = units[i].unit;
+	double factor = units[i].factor;
+
+	// Format the size.
+	const double div_size = val / factor;
+
+	char *out = NULL;
+	asprintf(&out, fmt, div_size, unit);
+
+	return out;
+}
+
+/** Static array of size units with decreasing factors. */
+static const tmon_unit_t size_units[] = {
+	{ .unit = "EB", .factor = 1ULL << 60 },
+	{ .unit = "PB", .factor = 1ULL << 50 },
+	{ .unit = "TB", .factor = 1ULL << 40 },
+	{ .unit = "GB", .factor = 1ULL << 30 },
+	{ .unit = "MB", .factor = 1ULL << 20 },
+	{ .unit = "kB", .factor = 1ULL << 10 },
+	{ .unit = "B",  .factor = 1ULL },
+};
+
+char *tmon_format_size(double val, const char *fmt)
+{
+	return format_unit(val, fmt, size_units, ARRAY_SIZE(size_units));
+}
+
+/** Static array of duration units with decreasing factors. */
+static const tmon_unit_t dur_units[] = {
+	{ .unit = "d",   .factor = 60 * 60 * 24 },
+	{ .unit = "h",   .factor = 60 * 60 },
+	{ .unit = "min", .factor = 60 },
+	{ .unit = "s",   .factor = 1 },
+	{ .unit = "ms",  .factor = 1e-3 },
+	{ .unit = "us",  .factor = 1e-6 },
+	{ .unit = "ns",  .factor = 1e-9 },
+	{ .unit = "ps",  .factor = 1e-12 },
+};
+
+char *tmon_format_duration(usbdiag_dur_t val, const char *fmt)
+{
+	return format_unit(val / 1000.0, fmt, dur_units, ARRAY_SIZE(dur_units));
+}
+
 /** @}
  */
Index: uspace/app/tmon/tf.h
===================================================================
--- uspace/app/tmon/tf.h	(revision 80f7c542f46cabfa62d4645700e924a848e61074)
+++ uspace/app/tmon/tf.h	(revision 290338bf7224f502808b23e82d98306208962b97)
@@ -38,17 +38,17 @@
 
 #include <async.h>
-
-/** Parameters common for all tests. */
-typedef struct tmon_test_params {
-	/* Nothing here. */
-} tmon_test_params_t;
+#include <usbdiag_iface.h>
 
 /** Operations to implement by all tests. */
 typedef struct tmon_test_ops {
-	int (*run)(async_exch_t *, const tmon_test_params_t *);
-	int (*read_params)(int, char **, tmon_test_params_t **);
+	int (*pre_run)(void *);
+	int (*run)(async_exch_t *, const void *);
+	int (*read_params)(int, char **, void **);
 } tmon_test_ops_t;
 
 int tmon_test_main(int, char **, const tmon_test_ops_t *);
+
+char *tmon_format_size(double, const char *);
+char *tmon_format_duration(usbdiag_dur_t, const char *);
 
 #endif /* TMON_TF_H_ */
