Index: uspace/Makefile
===================================================================
--- uspace/Makefile	(revision b7e14584b4e20939996e7e6c14f2582bcbac580e)
+++ uspace/Makefile	(revision 59b8639770a9a2516c04adff534be36c0274ee07)
@@ -241,4 +241,5 @@
 	lib/usbhost \
 	lib/usbdev \
+	lib/usbdiag \
 	lib/usbhid \
 	lib/usbvirt \
Index: uspace/app/tmon/Makefile
===================================================================
--- uspace/app/tmon/Makefile	(revision b7e14584b4e20939996e7e6c14f2582bcbac580e)
+++ uspace/app/tmon/Makefile	(revision 59b8639770a9a2516c04adff534be36c0274ee07)
@@ -30,5 +30,5 @@
 BINARY = tmon
 
-LIBS =
+LIBS = usbdiag
 
 SOURCES = \
Index: uspace/app/tmon/main.c
===================================================================
--- uspace/app/tmon/main.c	(revision b7e14584b4e20939996e7e6c14f2582bcbac580e)
+++ uspace/app/tmon/main.c	(revision 59b8639770a9a2516c04adff534be36c0274ee07)
@@ -36,4 +36,5 @@
 
 #include <stdio.h>
+#include <usb/diag/diag.h>
 
 #define NAME "tmon"
@@ -51,4 +52,6 @@
 	}
 
+	printf("The number is %d.\n", usb_diag_test(0));
+
 	return 0;
 }
Index: uspace/lib/usbdiag/Makefile
===================================================================
--- uspace/lib/usbdiag/Makefile	(revision 59b8639770a9a2516c04adff534be36c0274ee07)
+++ uspace/lib/usbdiag/Makefile	(revision 59b8639770a9a2516c04adff534be36c0274ee07)
@@ -0,0 +1,36 @@
+#
+# 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.
+#
+
+USPACE_PREFIX = ../..
+LIBRARY = libusbdiag
+LIBS = usb
+
+SOURCES = \
+	src/test.c
+
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/lib/usbdiag/include/usb/diag/diag.h
===================================================================
--- uspace/lib/usbdiag/include/usb/diag/diag.h	(revision 59b8639770a9a2516c04adff534be36c0274ee07)
+++ uspace/lib/usbdiag/include/usb/diag/diag.h	(revision 59b8639770a9a2516c04adff534be36c0274ee07)
@@ -0,0 +1,44 @@
+/*
+ * 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 libusbdiag
+ * @{
+ */
+/** @file
+ * @brief USB diagnostic device related types.
+ */
+#ifndef LIBUSBDIAG_DIAG_H_
+#define LIBUSBDIAG_DIAG_H_
+
+/** Just a dummy symbol to make compiler happy. TODO: remove it */
+int usb_diag_test(int);
+
+#endif
+/**
+ * @}
+ */
Index: uspace/lib/usbdiag/src/test.c
===================================================================
--- uspace/lib/usbdiag/src/test.c	(revision 59b8639770a9a2516c04adff534be36c0274ee07)
+++ uspace/lib/usbdiag/src/test.c	(revision 59b8639770a9a2516c04adff534be36c0274ee07)
@@ -0,0 +1,45 @@
+/*
+ * 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 libusbdiag
+ * @{
+ */
+/** @file
+ * Testing stuff
+ */
+
+#include <usb/diag/diag.h>
+
+int usb_diag_test(int x)
+{
+	return x + 42;
+}
+
+/**
+ * @}
+ */
