Index: uspace/app/tmon/commands.h
===================================================================
--- uspace/app/tmon/commands.h	(revision f98f4b753dce6ceb3970b1e2db7e0882cbf5f04b)
+++ uspace/app/tmon/commands.h	(revision fd312d505127e9d7f9046c8ee961d3cb5c51249c)
@@ -38,5 +38,6 @@
 
 int tmon_list(int, char **);
-int tmon_test_bulk(int, char **);
+int tmon_stress_bulk_in(int, char **);
+int tmon_stress_bulk_out(int, char **);
 
 #endif /* TMON_COMMANDS_H_ */
Index: uspace/app/tmon/main.c
===================================================================
--- uspace/app/tmon/main.c	(revision f98f4b753dce6ceb3970b1e2db7e0882cbf5f04b)
+++ uspace/app/tmon/main.c	(revision fd312d505127e9d7f9046c8ee961d3cb5c51249c)
@@ -40,11 +40,4 @@
 #define NAME "tmon"
 
-static int fallback(int argc, char *argv[])
-{
-	// FIXME
-	printf(NAME ": Not implemented, lol!\n");
-	return 1;
-}
-
 typedef struct {
 	const char *name;
@@ -60,17 +53,12 @@
 	},
 	{
-		.name = "test-bulk",
-		.description = "Benchmark bulk endpoints of a diagnostic device.",
-		.action = tmon_test_bulk,
+		.name = "stress-bulk-in",
+		.description = "Stress benchmark bulk in endpoints of a diagnostic device.",
+		.action = tmon_stress_bulk_in,
 	},
 	{
-		.name = "test-intr",
-		.description = "Benchmark interrupt endpoints of a diagnostic device.",
-		.action = fallback,
-	},
-	{
-		.name = "test-isoch",
-		.description = "Benchmark isochronous endpoints of a diagnostic device.",
-		.action = fallback,
+		.name = "stress-bulk-out",
+		.description = "Benchmark bulk out endpoints of a diagnostic device.",
+		.action = tmon_stress_bulk_out,
 	},
 	{
Index: uspace/app/tmon/test.c
===================================================================
--- uspace/app/tmon/test.c	(revision f98f4b753dce6ceb3970b1e2db7e0882cbf5f04b)
+++ uspace/app/tmon/test.c	(revision fd312d505127e9d7f9046c8ee961d3cb5c51249c)
@@ -114,16 +114,14 @@
 }
 
-static int bulk_worker(devman_handle_t fun) {
+static int stress_bulk_in(devman_handle_t fun) {
 	async_sess_t *sess = usbdiag_connect(fun);
 	async_exch_t *exch = async_exchange_begin(sess);
 
-	// TODO: do some testing
-	int y;
-	int rc = usbdiag_test(exch, 4200, &y);
+	const int cycles = 1024;
+	const size_t size = 65432;
+	int rc = usbdiag_stress_bulk_in(exch, cycles, size);
 
 	if (rc) {
 		printf(NAME ": %s\n", str_error(rc));
-	} else {
-		printf("The number is %d.\n", y);
 	}
 
@@ -133,7 +131,29 @@
 }
 
-int tmon_test_bulk(int argc, char *argv[])
+static int stress_bulk_out(devman_handle_t fun) {
+	async_sess_t *sess = usbdiag_connect(fun);
+	async_exch_t *exch = async_exchange_begin(sess);
+
+	const int cycles = 1024;
+	const size_t size = 65432;
+	int rc = usbdiag_stress_bulk_out(exch, cycles, size);
+
+	if (rc) {
+		printf(NAME ": %s\n", str_error(rc));
+	}
+
+	async_exchange_end(exch);
+	usbdiag_disconnect(sess);
+	return 0;
+}
+
+int tmon_stress_bulk_in(int argc, char *argv[])
 {
-	return resolve_and_test(argc, argv, bulk_worker);
+	return resolve_and_test(argc, argv, stress_bulk_in);
+}
+
+int tmon_stress_bulk_out(int argc, char *argv[])
+{
+	return resolve_and_test(argc, argv, stress_bulk_out);
 }
 
Index: uspace/drv/bus/usb/usbdiag/Makefile
===================================================================
--- uspace/drv/bus/usb/usbdiag/Makefile	(revision f98f4b753dce6ceb3970b1e2db7e0882cbf5f04b)
+++ uspace/drv/bus/usb/usbdiag/Makefile	(revision fd312d505127e9d7f9046c8ee961d3cb5c51249c)
@@ -35,4 +35,5 @@
 SOURCES = \
 	device.c \
+	tests.c \
 	main.c \
 
Index: uspace/drv/bus/usb/usbdiag/device.c
===================================================================
--- uspace/drv/bus/usb/usbdiag/device.c	(revision f98f4b753dce6ceb3970b1e2db7e0882cbf5f04b)
+++ uspace/drv/bus/usb/usbdiag/device.c	(revision fd312d505127e9d7f9046c8ee961d3cb5c51249c)
@@ -41,51 +41,26 @@
 
 #include "device.h"
+#include "tests.h"
 
 #define NAME "usbdiag"
 
-
-static int some_test(ddf_fun_t *fun, int x, int *y)
-{
-	int rc = EOK;
-	usb_diag_dev_t *dev = ddf_fun_to_usb_diag_dev(fun);
-
-	const size_t size = min(dev->bulk_in->desc.max_packet_size, dev->bulk_out->desc.max_packet_size);
-	char *buffer = (char *) malloc(size);
-	memset(buffer, 42, sizeof(buffer));
-
-	// Write buffer to device.
-	if ((rc = usb_pipe_write(dev->bulk_out, buffer, size))) {
-		usb_log_error("Bulk OUT write failed. %s\n", str_error(rc));
+#define TRANSLATE_FUNC_NAME(fun) translate_##fun
+#define TRANSLATE_FUNC(fun) \
+	static int TRANSLATE_FUNC_NAME(fun)(ddf_fun_t *f, int cycles, size_t size)\
+	{\
+		usb_diag_dev_t *dev = ddf_fun_to_usb_diag_dev(f);\
+		return fun(dev, cycles, size);\
 	}
 
-	// Read device's response.
-	size_t remaining = size;
-	size_t transferred;
-	while (remaining > 0) {
-		if ((rc = usb_pipe_read(dev->bulk_in, buffer + size - remaining, remaining, &transferred))) {
-			usb_log_error("Bulk IN read failed. %s\n", str_error(rc));
-			break;
-		}
-
-		if (transferred > remaining) {
-			usb_log_error("Bulk IN read more than expected.\n");
-			rc = EINVAL;
-			break;
-		}
-
-		remaining -= transferred;
-	}
-
-	// TODO: Check output?
-
-	free(buffer);
-
-	*y = x + 42;
-	return rc;
-}
+TRANSLATE_FUNC(usb_diag_stress_bulk_out)
+TRANSLATE_FUNC(usb_diag_stress_bulk_in)
 
 static usbdiag_iface_t diag_interface = {
-	.test = some_test,
+	.stress_bulk_out = TRANSLATE_FUNC_NAME(usb_diag_stress_bulk_out),
+	.stress_bulk_in = TRANSLATE_FUNC_NAME(usb_diag_stress_bulk_in)
 };
+
+#undef TRANSLATE_FUNC_NAME
+#undef TRANSLATE_FUNC
 
 static ddf_dev_ops_t diag_ops = {
@@ -105,15 +80,22 @@
 	dev->fun = fun;
 
-	usb_endpoint_mapping_t *epm_out = usb_device_get_mapped_ep(dev->usb_dev, USB_DIAG_EP_BULK_OUT);
-	usb_endpoint_mapping_t *epm_in = usb_device_get_mapped_ep(dev->usb_dev, USB_DIAG_EP_BULK_IN);
+#define _MAP_EP(target, ep_no) do {\
+	usb_endpoint_mapping_t *epm = usb_device_get_mapped_ep(dev->usb_dev, USB_DIAG_EP_##ep_no);\
+	if (!epm || !epm->present) {\
+		usb_log_error("Failed to map endpoint: " #ep_no ".\n");\
+		rc = ENOENT;\
+		goto err_fun;\
+	}\
+	target = &epm->pipe;\
+	} while (0);
 
-	if (!epm_in || !epm_out || !epm_in->present || !epm_out->present) {
-		usb_log_error("Required EPs were not mapped.\n");
-		rc = ENOENT;
-		goto err_fun;
-	}
+	_MAP_EP(dev->intr_in, INTR_IN);
+	_MAP_EP(dev->intr_out, INTR_OUT);
+	_MAP_EP(dev->bulk_in, BULK_IN);
+	_MAP_EP(dev->bulk_out, BULK_OUT);
+	_MAP_EP(dev->isoch_in, ISOCH_IN);
+	_MAP_EP(dev->isoch_out, ISOCH_OUT);
 
-	dev->bulk_out = &epm_out->pipe;
-	dev->bulk_in = &epm_in->pipe;
+#undef _MAP_EP
 
 	return EOK;
Index: uspace/drv/bus/usb/usbdiag/device.h
===================================================================
--- uspace/drv/bus/usb/usbdiag/device.h	(revision f98f4b753dce6ceb3970b1e2db7e0882cbf5f04b)
+++ uspace/drv/bus/usb/usbdiag/device.h	(revision fd312d505127e9d7f9046c8ee961d3cb5c51249c)
@@ -52,6 +52,10 @@
 	usb_device_t *usb_dev;
 	ddf_fun_t *fun;
+	usb_pipe_t *intr_in;
+	usb_pipe_t *intr_out;
 	usb_pipe_t *bulk_in;
 	usb_pipe_t *bulk_out;
+	usb_pipe_t *isoch_in;
+	usb_pipe_t *isoch_out;
 } usb_diag_dev_t;
 
Index: uspace/drv/bus/usb/usbdiag/tests.c
===================================================================
--- uspace/drv/bus/usb/usbdiag/tests.c	(revision fd312d505127e9d7f9046c8ee961d3cb5c51249c)
+++ uspace/drv/bus/usb/usbdiag/tests.c	(revision fd312d505127e9d7f9046c8ee961d3cb5c51249c)
@@ -0,0 +1,111 @@
+/*
+ * 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 drvusbdiag
+ * @{
+ */
+/**
+ * @file
+ * Code for executing diagnostic tests.
+ */
+#include <errno.h>
+#include <str_error.h>
+#include <usb/debug.h>
+#include "tests.h"
+
+#define NAME "usbdiag"
+
+
+int usb_diag_stress_bulk_out(usb_diag_dev_t *dev, int cycles, size_t size)
+{
+	if (!dev)
+		return EBADMEM;
+
+	char *buffer = (char *) malloc(size);
+	if (!buffer)
+		return ENOMEM;
+
+	memset(buffer, 42, size);
+
+	// TODO: Are we sure that no other test is running on this endpoint?
+
+	usb_log_info("Performing bulk out stress test on device %s.", ddf_fun_get_name(dev->fun));
+	int rc = EOK;
+	for (int i = 0; i < cycles; ++i) {
+		// Write buffer to device.
+		if ((rc = usb_pipe_write(dev->bulk_out, buffer, size))) {
+			usb_log_error("Bulk OUT write failed. %s\n", str_error(rc));
+			break;
+		}
+	}
+
+	free(buffer);
+	return rc;
+}
+
+int usb_diag_stress_bulk_in(usb_diag_dev_t *dev, int cycles, size_t size)
+{
+	if (!dev)
+		return EBADMEM;
+
+	char *buffer = (char *) malloc(size);
+	if (!buffer)
+		return ENOMEM;
+
+	// TODO: Are we sure that no other test is running on this endpoint?
+
+	usb_log_info("Performing bulk in stress test on device %s.", ddf_fun_get_name(dev->fun));
+	int rc = EOK;
+	for (int i = 0; i < cycles; ++i) {
+		// Read device's response.
+		size_t remaining = size;
+		size_t transferred;
+
+		while (remaining > 0) {
+			if ((rc = usb_pipe_read(dev->bulk_in, buffer + size - remaining, remaining, &transferred))) {
+				usb_log_error("Bulk IN read failed. %s\n", str_error(rc));
+				break;
+			}
+
+			if (transferred > remaining) {
+				usb_log_error("Bulk IN read more than expected.\n");
+				rc = EINVAL;
+				break;
+			}
+
+			remaining -= transferred;
+		}
+	}
+
+	free(buffer);
+	return rc;
+}
+
+/**
+ * @}
+ */
Index: uspace/drv/bus/usb/usbdiag/tests.h
===================================================================
--- uspace/drv/bus/usb/usbdiag/tests.h	(revision fd312d505127e9d7f9046c8ee961d3cb5c51249c)
+++ uspace/drv/bus/usb/usbdiag/tests.h	(revision fd312d505127e9d7f9046c8ee961d3cb5c51249c)
@@ -0,0 +1,48 @@
+/*
+ * 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 drvusbdiag
+ * @{
+ */
+/** @file
+ * USB diagnostic tests.
+ */
+
+#ifndef USB_DIAG_TESTS_H_
+#define USB_DIAG_TESTS_H_
+
+#include "device.h"
+
+int usb_diag_stress_bulk_out(usb_diag_dev_t *, int, size_t);
+int usb_diag_stress_bulk_in(usb_diag_dev_t *, int, size_t);
+
+#endif /* USB_DIAG_TESTS_H_ */
+
+/**
+ * @}
+ */
Index: uspace/lib/drv/generic/remote_usbdiag.c
===================================================================
--- uspace/lib/drv/generic/remote_usbdiag.c	(revision f98f4b753dce6ceb3970b1e2db7e0882cbf5f04b)
+++ uspace/lib/drv/generic/remote_usbdiag.c	(revision fd312d505127e9d7f9046c8ee961d3cb5c51249c)
@@ -43,5 +43,6 @@
 
 typedef enum {
-	IPC_M_USBDIAG_TEST,
+	IPC_M_USBDIAG_STRESS_BULK_OUT,
+	IPC_M_USBDIAG_STRESS_BULK_IN
 } usb_iface_funcs_t;
 
@@ -57,23 +58,27 @@
 }
 
-int usbdiag_test(async_exch_t *exch, int x, int *y)
+int usbdiag_stress_bulk_out(async_exch_t *exch, int cycles, size_t size)
 {
 	if (!exch)
 		return EBADMEM;
 
-	sysarg_t y_;
-	const int ret = async_req_2_1(exch, DEV_IFACE_ID(USBDIAG_DEV_IFACE), IPC_M_USBDIAG_TEST, x, &y_);
-
-	if (y)
-		*y = (int) y_;
-
-	return ret;
+	return async_req_3_0(exch, DEV_IFACE_ID(USBDIAG_DEV_IFACE), IPC_M_USBDIAG_STRESS_BULK_OUT, cycles, size);
 }
 
-static void remote_usbdiag_test(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
+int usbdiag_stress_bulk_in(async_exch_t *exch, int cycles, size_t size)
+{
+	if (!exch)
+		return EBADMEM;
+
+	return async_req_3_0(exch, DEV_IFACE_ID(USBDIAG_DEV_IFACE), IPC_M_USBDIAG_STRESS_BULK_IN, cycles, size);
+}
+
+static void remote_usbdiag_stress_bulk_out(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
+static void remote_usbdiag_stress_bulk_in(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
 
 /** Remote USB diagnostic interface operations. */
 static const remote_iface_func_ptr_t remote_usbdiag_iface_ops [] = {
-	[IPC_M_USBDIAG_TEST] = remote_usbdiag_test,
+	[IPC_M_USBDIAG_STRESS_BULK_OUT] = remote_usbdiag_stress_bulk_out,
+	[IPC_M_USBDIAG_STRESS_BULK_IN] = remote_usbdiag_stress_bulk_in,
 };
 
@@ -84,21 +89,32 @@
 };
 
-void remote_usbdiag_test(ddf_fun_t *fun, void *iface, ipc_callid_t callid, ipc_call_t *call)
+void remote_usbdiag_stress_bulk_out(ddf_fun_t *fun, void *iface, ipc_callid_t callid, ipc_call_t *call)
 {
 	const usbdiag_iface_t *diag_iface = (usbdiag_iface_t *) iface;
 
-	if (diag_iface->test == NULL) {
+	if (diag_iface->stress_bulk_out == NULL) {
 		async_answer_0(callid, ENOTSUP);
 		return;
 	}
 
-	int x = DEV_IPC_GET_ARG1(*call);
-	int y;
-	const int ret = diag_iface->test(fun, x, &y);
-	if (ret != EOK) {
-		async_answer_0(callid, ret);
-	} else {
-		async_answer_1(callid, EOK, y);
+	int cycles = DEV_IPC_GET_ARG1(*call);
+	size_t size = DEV_IPC_GET_ARG2(*call);
+	const int ret = diag_iface->stress_bulk_out(fun, cycles, size);
+	async_answer_0(callid, ret);
+}
+
+void remote_usbdiag_stress_bulk_in(ddf_fun_t *fun, void *iface, ipc_callid_t callid, ipc_call_t *call)
+{
+	const usbdiag_iface_t *diag_iface = (usbdiag_iface_t *) iface;
+
+	if (diag_iface->stress_bulk_in == NULL) {
+		async_answer_0(callid, ENOTSUP);
+		return;
 	}
+
+	int cycles = DEV_IPC_GET_ARG1(*call);
+	size_t size = DEV_IPC_GET_ARG2(*call);
+	const int ret = diag_iface->stress_bulk_in(fun, cycles, size);
+	async_answer_0(callid, ret);
 }
 
Index: uspace/lib/drv/include/usbdiag_iface.h
===================================================================
--- uspace/lib/drv/include/usbdiag_iface.h	(revision f98f4b753dce6ceb3970b1e2db7e0882cbf5f04b)
+++ uspace/lib/drv/include/usbdiag_iface.h	(revision fd312d505127e9d7f9046c8ee961d3cb5c51249c)
@@ -45,9 +45,11 @@
 async_sess_t *usbdiag_connect(devman_handle_t);
 void usbdiag_disconnect(async_sess_t*);
-int usbdiag_test(async_exch_t*, int, int*);
+int usbdiag_stress_bulk_in(async_exch_t*, int, size_t);
+int usbdiag_stress_bulk_out(async_exch_t*, int, size_t);
 
 /** USB diagnostic device communication interface. */
 typedef struct {
-	int (*test)(ddf_fun_t*, int, int*);
+	int (*stress_bulk_in)(ddf_fun_t*, int, size_t);
+	int (*stress_bulk_out)(ddf_fun_t*, int, size_t);
 } usbdiag_iface_t;
 
