Index: uspace/drv/uhci-hcd/callback.c
===================================================================
--- uspace/drv/uhci-hcd/callback.c	(revision 7ce0fe353ce29538995c8bc73076b8da8ca5cde4)
+++ uspace/drv/uhci-hcd/callback.c	(revision afcd86e9f09edc94d52d75cd6c0f642518cdbc25)
@@ -1,4 +1,6 @@
 #include <errno.h>
 #include <mem.h>
+
+#include <usb/debug.h>
 
 #include "callback.h"
@@ -12,5 +14,5 @@
 		instance->new_buffer = malloc32(size);
 		if (!instance->new_buffer) {
-			uhci_print_error("Failed to allocate device acessible buffer.\n");
+			usb_log_error("Failed to allocate device acessible buffer.\n");
 			return ENOMEM;
 		}
@@ -46,5 +48,5 @@
 	if (instance->callback_in) {
 		assert(instance->callback_out == NULL);
-		uhci_print_verbose("Callback in: %p %x %d.\n",
+		usb_log_debug("Callback in: %p %x %d.\n",
 		  instance->callback_in, outcome, act_size);
 		instance->callback_in(
@@ -53,5 +55,5 @@
 		assert(instance->callback_out);
 		assert(instance->callback_in == NULL);
-		uhci_print_verbose("Callback out: %p %p %x %p .\n",
+		usb_log_debug("Callback out: %p %p %x %p .\n",
 		 instance->callback_out, instance->dev, outcome, instance->arg);
 		instance->callback_out(
Index: uspace/drv/uhci-hcd/callback.h
===================================================================
--- uspace/drv/uhci-hcd/callback.h	(revision 7ce0fe353ce29538995c8bc73076b8da8ca5cde4)
+++ uspace/drv/uhci-hcd/callback.h	(revision afcd86e9f09edc94d52d75cd6c0f642518cdbc25)
@@ -38,5 +38,4 @@
 #include <usb/usb.h>
 
-#include "debug.h"
 #include "utils/malloc32.h"
 
Index: uspace/drv/uhci-hcd/debug.h
===================================================================
--- uspace/drv/uhci-hcd/debug.h	(revision 7ce0fe353ce29538995c8bc73076b8da8ca5cde4)
+++ 	(revision )
@@ -1,72 +1,0 @@
-/*
- * Copyright (c) 2010 Jan Vesely
- * 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 usb
- * @{
- */
-/** @file
- * @brief UHCI driver
- */
-#ifndef DRV_UHCI_DEBUG_H
-#define DRV_UHCI_DEBUG_H
-
-#include <stdio.h>
-#include <usb/debug.h>
-
-#include "name.h"
-
-enum debug_levels {
-	DEBUG_LEVEL_FATAL_ERROR = 1,
-	DEBUG_LEVEL_ERROR = 2,
-	DEBUG_LEVEL_WARNING = 3,
-	DEBUG_LEVEL_INFO = 4,
-	DEBUG_LEVEL_VERBOSE = 5,
-	DEBUG_LEVEL_MAX = DEBUG_LEVEL_VERBOSE
-};
-
-#define uhci_printf( level, fmt, args...) \
-	usb_dprintf(NAME, level, fmt, ##args)
-
-#define uhci_print_fatal( fmt, args... ) \
-	fprintf(stderr, "[" NAME ":FATAL ERROR]: " fmt, ##args)
-
-#define uhci_print_error( fmt, args... ) \
-	fprintf(stderr, "[" NAME ":ERROR]: " fmt, ##args)
-
-#define uhci_print_warning( fmt, args... ) \
-	usb_dprintf( NAME, DEBUG_LEVEL_WARNING, fmt, ##args )
-
-#define uhci_print_info( fmt, args... ) \
-	usb_dprintf( NAME, DEBUG_LEVEL_INFO, fmt, ##args )
-
-#define uhci_print_verbose( fmt, args... ) \
-	usb_dprintf( NAME, DEBUG_LEVEL_VERBOSE, fmt, ##args )
-
-#endif
-/**
- * @}
- */
Index: uspace/drv/uhci-hcd/main.c
===================================================================
--- uspace/drv/uhci-hcd/main.c	(revision 7ce0fe353ce29538995c8bc73076b8da8ca5cde4)
+++ uspace/drv/uhci-hcd/main.c	(revision afcd86e9f09edc94d52d75cd6c0f642518cdbc25)
@@ -28,13 +28,14 @@
 #include <driver.h>
 #include <errno.h>
-#include <str_error.h>
 #include <usb_iface.h>
 
-#include "debug.h"
+#include <usb/debug.h>
+
 #include "iface.h"
-#include "name.h"
 #include "pci.h"
 #include "root_hub.h"
 #include "uhci.h"
+
+#define NAME "uhci-hcd"
 
 static int usb_iface_get_hc_handle(device_t *dev, devman_handle_t *handle)
@@ -58,5 +59,7 @@
 static int uhci_add_device(device_t *device)
 {
-	uhci_print_info( "uhci_add_device() called\n" );
+	assert(device);
+
+	usb_log_info("uhci_add_device() called\n");
 	device->ops = &uhci_ops;
 
@@ -69,10 +72,10 @@
 
 	if (rc != EOK) {
-		uhci_print_fatal("failed to get I/O registers addresses: %s.\n",
-		    str_error(rc));
+		usb_log_error("Failed(%d) to get I/O registers addresses for device:.\n",
+		    rc, device->handle);
 		return rc;
 	}
 
-	uhci_print_info("I/O regs at 0x%X (size %zu), IRQ %d.\n",
+	usb_log_info("I/O regs at 0x%X (size %zu), IRQ %d.\n",
 	    io_reg_base, io_reg_size, irq);
 
@@ -80,5 +83,5 @@
 
 	if (ret != EOK) {
-		uhci_print_error("Failed to init uhci-hcd.\n");
+		usb_log_error("Failed to init uhci-hcd.\n");
 		return ret;
 	}
@@ -87,5 +90,5 @@
 
 	if (ret != EOK) {
-		uhci_print_error("Failed to setup uhci root hub.\n");
+		usb_log_error("Failed to setup uhci root hub.\n");
 		/* TODO: destroy uhci here */
 		return ret;
@@ -94,5 +97,5 @@
 	ret = child_device_register(rh, device);
 	if (ret != EOK) {
-		uhci_print_error("Failed to register root hub.\n");
+		usb_log_error("Failed to register root hub.\n");
 		/* TODO: destroy uhci here */
 		return ret;
@@ -117,5 +120,5 @@
 	 */
 	sleep(5);
-	usb_dprintf_enable(NAME, DEBUG_LEVEL_INFO);
+	usb_log_enable(USB_LOG_LEVEL_INFO, NAME);
 
 	return driver_main(&uhci_driver);
Index: uspace/drv/uhci-hcd/name.h
===================================================================
--- uspace/drv/uhci-hcd/name.h	(revision 7ce0fe353ce29538995c8bc73076b8da8ca5cde4)
+++ 	(revision )
@@ -1,42 +1,0 @@
-/*
- * Copyright (c) 2010 Jan Vesely
- * 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 usb
- * @{
- */
-/** @file
- * @brief UHCI driver
- */
-#ifndef DRV_UHCI_NAME_H
-#define DRV_UHCI_NAME_H
-
-#define NAME "uhci-hcd"
-
-#endif
-/**
- * @}
- */
Index: uspace/drv/uhci-hcd/root_hub.c
===================================================================
--- uspace/drv/uhci-hcd/root_hub.c	(revision 7ce0fe353ce29538995c8bc73076b8da8ca5cde4)
+++ uspace/drv/uhci-hcd/root_hub.c	(revision afcd86e9f09edc94d52d75cd6c0f642518cdbc25)
@@ -2,7 +2,9 @@
 #include <errno.h>
 #include <stdio.h>
+
 #include <usb_iface.h>
 
-#include "debug.h"
+#include <usb/debug.h>
+
 #include "root_hub.h"
 /*----------------------------------------------------------------------------*/
@@ -27,5 +29,4 @@
 }
 /*----------------------------------------------------------------------------*/
-
 static usb_iface_t usb_iface = {
   .get_hc_handle = usb_iface_get_hc_handle
@@ -41,5 +42,5 @@
 	device_t *hub = create_device();
 	if (!hub) {
-		uhci_print_error("Failed to create root hub device structure.\n");
+		usb_log_error("Failed to create root hub device structure.\n");
 		return ENOMEM;
 	}
@@ -47,5 +48,5 @@
 	int ret = asprintf(&name, "UHCI Root Hub");
 	if (ret < 0) {
-		uhci_print_error("Failed to create root hub name.\n");
+		usb_log_error("Failed to create root hub name.\n");
 		free(hub);
 		return ENOMEM;
@@ -55,5 +56,5 @@
 	ret = asprintf(&match_str, "usb&uhci&root-hub");
 	if (ret < 0) {
-		uhci_print_error("Failed to create root hub match string.\n");
+		usb_log_error("Failed to create root hub match string.\n");
 		free(hub);
 		free(name);
@@ -63,5 +64,5 @@
 	match_id_t *match_id = create_match_id();
 	if (!match_id) {
-		uhci_print_error("Failed to create root hub match id.\n");
+		usb_log_error("Failed to create root hub match id.\n");
 		free(hub);
 		free(match_str);
Index: uspace/drv/uhci-hcd/transfer_list.c
===================================================================
--- uspace/drv/uhci-hcd/transfer_list.c	(revision 7ce0fe353ce29538995c8bc73076b8da8ca5cde4)
+++ uspace/drv/uhci-hcd/transfer_list.c	(revision afcd86e9f09edc94d52d75cd6c0f642518cdbc25)
@@ -1,3 +1,5 @@
 #include <errno.h>
+
+#include <usb/debug.h>
 
 #include "transfer_list.h"
@@ -10,5 +12,5 @@
 	instance->queue_head = malloc32(sizeof(queue_head_t));
 	if (!instance->queue_head) {
-		uhci_print_error("Failed to allocate queue head.\n");
+		usb_log_error("Failed to allocate queue head.\n");
 		return ENOMEM;
 	}
@@ -46,5 +48,5 @@
 		instance->queue_head->element = (pa & LINK_POINTER_ADDRESS_MASK);
 	}
-	uhci_print_verbose("Successfully added transfer to the hc queue %p.\n",
+	usb_log_debug("Successfully added transfer to the hc queue %p.\n",
 	  instance);
 	return EOK;
Index: uspace/drv/uhci-hcd/transfer_list.h
===================================================================
--- uspace/drv/uhci-hcd/transfer_list.h	(revision 7ce0fe353ce29538995c8bc73076b8da8ca5cde4)
+++ uspace/drv/uhci-hcd/transfer_list.h	(revision afcd86e9f09edc94d52d75cd6c0f642518cdbc25)
@@ -35,5 +35,4 @@
 #define DRV_UHCI_TRANSFER_LIST_H
 
-#include "debug.h"
 #include "uhci_struct/queue_head.h"
 #include "uhci_struct/transfer_descriptor.h"
Index: uspace/drv/uhci-hcd/uhci.c
===================================================================
--- uspace/drv/uhci-hcd/uhci.c	(revision 7ce0fe353ce29538995c8bc73076b8da8ca5cde4)
+++ uspace/drv/uhci-hcd/uhci.c	(revision afcd86e9f09edc94d52d75cd6c0f642518cdbc25)
@@ -1,10 +1,8 @@
 #include <errno.h>
+
 #include <usb/debug.h>
 #include <usb/usb.h>
 
 #include "utils/malloc32.h"
-
-#include "debug.h"
-#include "name.h"
 #include "uhci.h"
 
@@ -16,9 +14,9 @@
 {
 	assert(device);
-	uhci_print_info("Initializing device at address %p.\n", device);
+	usb_log_info("Initializing device at address %p.\n", device);
 
 #define CHECK_RET_FREE_INSTANCE(message...) \
 	if (ret != EOK) { \
-		uhci_print_error(message); \
+		usb_log_error(message); \
 		if (instance) { \
 			free(instance); \
@@ -36,5 +34,5 @@
 	/* init address keeper(libusb) */
 	usb_address_keeping_init(&instance->address_manager, USB11_ADDRESS_MAX);
-	uhci_print_verbose("Initialized address manager.\n");
+	usb_log_debug("Initialized address manager.\n");
 
 	/* allow access to hc control registers */
@@ -44,13 +42,13 @@
 	CHECK_RET_FREE_INSTANCE("Failed to gain access to registers at %p.\n", io);
 	instance->registers = io;
-	uhci_print_verbose("Device registers accessible.\n");
+	usb_log_debug("Device registers accessible.\n");
 
 	/* init transfer lists */
 	ret = uhci_init_transfer_lists(instance->transfers);
 	CHECK_RET_FREE_INSTANCE("Failed to initialize transfer lists.\n");
-	uhci_print_verbose("Transfer lists initialized.\n");
-
-
-	uhci_print_verbose("Initializing frame list.\n");
+	usb_log_debug("Transfer lists initialized.\n");
+
+
+	usb_log_debug("Initializing frame list.\n");
 	instance->frame_list = get_page();
 	ret = instance ? EOK : ENOMEM;
@@ -76,5 +74,5 @@
 	fibril_add_ready(instance->debug_checker);
 
-	uhci_print_verbose("Starting UHCI HC.\n");
+	usb_log_debug("Starting UHCI HC.\n");
 	pio_write_16(&instance->registers->usbcmd, UHCI_CMD_RUN_STOP);
 /*
@@ -96,5 +94,5 @@
 	ret = transfer_list_init(&transfers[USB_TRANSFER_BULK], NULL);
 	if (ret != EOK) {
-		uhci_print_error("Failed to initialize bulk queue.\n");
+		usb_log_error("Failed to initialize bulk queue.\n");
 		return ret;
 	}
@@ -103,5 +101,5 @@
 	  &transfers[USB_TRANSFER_CONTROL], &transfers[USB_TRANSFER_BULK]);
 	if (ret != EOK) {
-		uhci_print_error("Failed to initialize control queue.\n");
+		usb_log_error("Failed to initialize control queue.\n");
 		transfer_list_fini(&transfers[USB_TRANSFER_BULK]);
 		return ret;
@@ -111,5 +109,5 @@
 	  &transfers[USB_TRANSFER_INTERRUPT], &transfers[USB_TRANSFER_CONTROL]);
 	if (ret != EOK) {
-		uhci_print_error("Failed to initialize interrupt queue.\n");
+		usb_log_error("Failed to initialize interrupt queue.\n");
 		transfer_list_fini(&transfers[USB_TRANSFER_CONTROL]);
 		transfer_list_fini(&transfers[USB_TRANSFER_BULK]);
@@ -144,5 +142,5 @@
 #define CHECK_RET_TRANS_FREE_JOB_TD(message) \
 	if (ret != EOK) { \
-		uhci_print_error(message); \
+		usb_log_error(message); \
 		if (job) { \
 			callback_dispose(job); \
@@ -167,5 +165,5 @@
 	assert(instance);
 
-	uhci_print_verbose("Appending a new transfer to queue.\n");
+	usb_log_debug("Appending a new transfer to queue.\n");
 	ret = transfer_list_append(&instance->transfers[transfer_type], td);
 	CHECK_RET_TRANS_FREE_JOB_TD("Failed to append transfer descriptor.\n");
@@ -176,10 +174,10 @@
 int uhci_clean_finished(void* arg)
 {
-	uhci_print_verbose("Started cleaning fibril.\n");
+	usb_log_debug("Started cleaning fibril.\n");
 	uhci_t *instance = (uhci_t*)arg;
 	assert(instance);
 
 	while(1) {
-		uhci_print_verbose("Running cleaning fibril on: %p.\n", instance);
+		usb_log_debug("Running cleaning fibril on: %p.\n", instance);
 		/* iterate all transfer queues */
 		int i = 0;
@@ -189,9 +187,9 @@
 			volatile transfer_descriptor_t * it =
 				instance->transfers[i].first;
-			uhci_print_verbose("Running cleaning fibril on queue: %p (%s).\n",
+			usb_log_debug("Running cleaning fibril on queue: %p (%s).\n",
 				&instance->transfers[i], it ? "SOMETHING" : "EMPTY");
 
 		if (it)
-			uhci_print_verbose("First in queue: %p (%x).\n",
+			usb_log_debug("First in queue: %p (%x).\n",
 				it, it->status);
 
@@ -199,5 +197,5 @@
 			 !(instance->transfers[i].first->status & TD_STATUS_ERROR_ACTIVE)) {
 				transfer_descriptor_t *transfer = instance->transfers[i].first;
-				uhci_print_info("Inactive transfer calling callback with status %x.\n",
+				usb_log_info("Inactive transfer calling callback with status %x.\n",
 				  transfer->status);
 				instance->transfers[i].first = transfer->next_va;
@@ -219,21 +217,21 @@
 		uint16_t cmd = pio_read_16(&instance->registers->usbcmd);
 		uint16_t sts = pio_read_16(&instance->registers->usbsts);
-		uhci_print_verbose("Command register: %X Status register: %X\n", cmd, sts);
+		usb_log_debug("Command register: %X Status register: %X\n", cmd, sts);
 /*
 		uintptr_t frame_list = pio_read_32(&instance->registers->flbaseadd);
-		uhci_print_verbose("Framelist address: %p vs. %p.\n",
+		usb_log_debug("Framelist address: %p vs. %p.\n",
 			frame_list, addr_to_phys(instance->frame_list));
 		int frnum = pio_read_16(&instance->registers->frnum) & 0x3ff;
-		uhci_print_verbose("Framelist item: %d \n", frnum );
+		usb_log_debug("Framelist item: %d \n", frnum );
 
 		queue_head_t* qh = instance->transfers[USB_TRANSFER_INTERRUPT].queue_head;
-		uhci_print_verbose("Interrupt QH: %p vs. %p.\n",
+		usb_log_debug("Interrupt QH: %p vs. %p.\n",
 			instance->frame_list[frnum], addr_to_phys(qh));
 
-		uhci_print_verbose("Control QH: %p vs. %p.\n", qh->next_queue,
+		usb_log_debug("Control QH: %p vs. %p.\n", qh->next_queue,
 			addr_to_phys(instance->transfers[USB_TRANSFER_CONTROL].queue_head));
 		qh = instance->transfers[USB_TRANSFER_CONTROL].queue_head;
 
-		uhci_print_verbose("Bulk QH: %p vs. %p.\n", qh->next_queue,
+		usb_log_debug("Bulk QH: %p vs. %p.\n", qh->next_queue,
 			addr_to_phys(instance->transfers[USB_TRANSFER_BULK].queue_head));
 	uint16_t cmd = pio_read_16(&instance->registers->usbcmd);
Index: uspace/drv/uhci-hcd/uhci_struct/transfer_descriptor.c
===================================================================
--- uspace/drv/uhci-hcd/uhci_struct/transfer_descriptor.c	(revision 7ce0fe353ce29538995c8bc73076b8da8ca5cde4)
+++ uspace/drv/uhci-hcd/uhci_struct/transfer_descriptor.c	(revision afcd86e9f09edc94d52d75cd6c0f642518cdbc25)
@@ -1,2 +1,4 @@
+#include <usb/debug.h>
+
 #include "transfer_descriptor.h"
 
@@ -31,5 +33,5 @@
 	}
 
-	uhci_print_info("Created TD: %X:%X:%X:%X(%p).\n",
+	usb_log_info("Created TD: %X:%X:%X:%X(%p).\n",
 		instance->next, instance->status, instance->device,
 	  instance->buffer_ptr, buffer);
