Index: uspace/drv/usbhub/main.c
===================================================================
--- uspace/drv/usbhub/main.c	(revision aec2ad462bb61ec47c424e5fb01a6dda11edbd56)
+++ uspace/drv/usbhub/main.c	(revision 103a36268784644d92fb6cc2e15a9ee181d31983)
@@ -37,4 +37,5 @@
 #include <usb/usbdrv.h>
 
+
 #include "usbhub.h"
 #include "usbhub_private.h"
@@ -64,5 +65,5 @@
 int main(int argc, char *argv[])
 {
-	usb_dprintf_enable(NAME, 0);
+	usb_dprintf_enable(NAME, USB_LOG_LEVEL_INFO);
 	
 	fibril_mutex_initialize(&usb_hub_list_lock);
Index: uspace/drv/usbhub/usbhub.c
===================================================================
--- uspace/drv/usbhub/usbhub.c	(revision aec2ad462bb61ec47c424e5fb01a6dda11edbd56)
+++ uspace/drv/usbhub/usbhub.c	(revision 103a36268784644d92fb6cc2e15a9ee181d31983)
@@ -70,5 +70,5 @@
 
 
-	//printf("[usb_hub] phone to hc = %d\n", hc);
+	dprintf(USB_LOG_LEVEL_DEBUG, "phone to hc = %d", hc);
 	if (hc < 0) {
 		return result;
@@ -76,5 +76,5 @@
 	//get some hub info
 	usb_address_t addr = usb_drv_get_my_address(hc, device);
-	dprintf(1, "address of newly created hub = %d", addr);
+	dprintf(USB_LOG_LEVEL_DEBUG, "address of newly created hub = %d", addr);
 	/*if(addr<0){
 		//return result;
@@ -87,10 +87,10 @@
 	// get hub descriptor
 
-	//printf("[usb_hub] creating serialized descriptor\n");
+	dprintf(USB_LOG_LEVEL_DEBUG, "creating serialized descripton");
 	void * serialized_descriptor = malloc(USB_HUB_MAX_DESCRIPTOR_SIZE);
 	usb_hub_descriptor_t * descriptor;
 	size_t received_size;
 	int opResult;
-	//printf("[usb_hub] starting control transaction\n");
+	dprintf(USB_LOG_LEVEL_DEBUG, "starting control transaction");
 	
 	opResult = usb_drv_req_get_descriptor(hc, addr,
@@ -100,16 +100,16 @@
 
 	if (opResult != EOK) {
-		dprintf(1, "failed when receiving hub descriptor, badcode = %d",opResult);
+		dprintf(USB_LOG_LEVEL_ERROR, "failed when receiving hub descriptor, badcode = %d",opResult);
 		free(serialized_descriptor);
 		return result;
 	}
-	//printf("[usb_hub] deserializing descriptor\n");
+	dprintf(USB_LOG_LEVEL_DEBUG2, "deserializing descriptor");
 	descriptor = usb_deserialize_hub_desriptor(serialized_descriptor);
 	if(descriptor==NULL){
-		dprintf(1, "could not deserialize descriptor ");
+		dprintf(USB_LOG_LEVEL_WARNING, "could not deserialize descriptor ");
 		result->port_count = 1;///\TODO this code is only for debug!!!
 		return result;
 	}
-	//printf("[usb_hub] setting port count to %d\n",descriptor->ports_count);
+	dprintf(USB_LOG_LEVEL_INFO, "setting port count to %d",descriptor->ports_count);
 	result->port_count = descriptor->ports_count;
 	result->attached_devs = (usb_hub_attached_device_t*)
@@ -120,5 +120,5 @@
 		result->attached_devs[i].address=0;
 	}
-	//printf("[usb_hub] freeing data\n");
+	dprintf(USB_LOG_LEVEL_DEBUG2, "freeing data");
 	free(serialized_descriptor);
 	free(descriptor->devices_removable);
@@ -127,5 +127,5 @@
 	//finish
 
-	dprintf(1, "hub info created");
+	dprintf(USB_LOG_LEVEL_INFO, "hub info created");
 
 	return result;
@@ -133,6 +133,5 @@
 
 int usb_add_hub_device(device_t *dev) {
-	dprintf(1, "add_hub_device(handle=%d)", (int) dev->handle);
-	dprintf(1, "hub device");
+	dprintf(USB_LOG_LEVEL_INFO, "add_hub_device(handle=%d)", (int) dev->handle);
 
 	/*
@@ -164,10 +163,10 @@
 	    &std_descriptor);
 	if(opResult!=EOK){
-		dprintf(1, "could not get device descriptor, %d",opResult);
+		dprintf(USB_LOG_LEVEL_ERROR, "could not get device descriptor, %d",opResult);
 		return opResult;
 	}
-	dprintf(1, "hub has %d configurations",std_descriptor.configuration_count);
+	dprintf(USB_LOG_LEVEL_INFO, "hub has %d configurations",std_descriptor.configuration_count);
 	if(std_descriptor.configuration_count<1){
-		dprintf(1, "THERE ARE NO CONFIGURATIONS AVAILABLE");
+		dprintf(USB_LOG_LEVEL_ERROR, "THERE ARE NO CONFIGURATIONS AVAILABLE");
 		//shouldn`t I return?
 	}
@@ -178,5 +177,5 @@
         &config_descriptor);
 	if(opResult!=EOK){
-		dprintf(1, "could not get configuration descriptor, %d",opResult);
+		dprintf(USB_LOG_LEVEL_ERROR, "could not get configuration descriptor, %d",opResult);
 		return opResult;
 	}
@@ -186,5 +185,5 @@
 
 	if (opResult != EOK) {
-		dprintf(1, "something went wrong when setting hub`s configuration, %d", opResult);
+		dprintf(USB_LOG_LEVEL_ERROR, "something went wrong when setting hub`s configuration, %d", opResult);
 	}
 
@@ -193,7 +192,7 @@
 		usb_hub_set_power_port_request(&request, port);
 		opResult = usb_drv_sync_control_write(hc, target, &request, NULL, 0);
-		dprintf(1, "powering port %d",port);
+		dprintf(USB_LOG_LEVEL_INFO, "powering port %d",port);
 		if (opResult != EOK) {
-			dprintf(1, "something went wrong when setting hub`s %dth port", port);
+			dprintf(USB_LOG_LEVEL_WARNING, "something went wrong when setting hub`s %dth port", port);
 		}
 	}
@@ -207,5 +206,5 @@
 	fibril_mutex_unlock(&usb_hub_list_lock);
 
-	dprintf(1, "hub info added to list");
+	dprintf(USB_LOG_LEVEL_DEBUG, "hub info added to list");
 	//(void)hub_info;
 	usb_hub_check_hub_changes();
@@ -213,9 +212,9 @@
 	
 
-	dprintf(1, "hub dev added");
-	dprintf(1, "\taddress %d, has %d ports ",
+	dprintf(USB_LOG_LEVEL_INFO, "hub dev added");
+	dprintf(USB_LOG_LEVEL_DEBUG, "\taddress %d, has %d ports ",
 			hub_info->usb_device->address,
 			hub_info->port_count);
-	dprintf(1, "\tused configuration %d",config_descriptor.configuration_number);
+	dprintf(USB_LOG_LEVEL_DEBUG, "\tused configuration %d",config_descriptor.configuration_number);
 
 	return EOK;
@@ -238,8 +237,8 @@
 inline static int usb_hub_release_default_address(int hc){
 	int opResult;
-	dprintf(1, "releasing default address");
+	dprintf(USB_LOG_LEVEL_INFO, "releasing default address");
 	opResult = usb_drv_release_default_address(hc);
 	if (opResult != EOK) {
-		dprintf(1, "failed to release default address");
+		dprintf(USB_LOG_LEVEL_WARNING, "failed to release default address");
 	}
 	return opResult;
@@ -255,9 +254,9 @@
 	usb_device_request_setup_packet_t request;
 	int opResult;
-	dprintf(1, "some connection changed");
+	dprintf(USB_LOG_LEVEL_INFO, "some connection changed");
 	//get default address
 	opResult = usb_drv_reserve_default_address(hc);
 	if (opResult != EOK) {
-		dprintf(1, "cannot assign default address, it is probably used");
+		dprintf(USB_LOG_LEVEL_WARNING, "cannot assign default address, it is probably used");
 		return;
 	}
@@ -270,5 +269,5 @@
 			);
 	if (opResult != EOK) {
-		dprintf(1, "something went wrong when reseting a port");
+		dprintf(USB_LOG_LEVEL_ERROR, "something went wrong when reseting a port");
 		usb_hub_release_default_address(hc);
 	}
@@ -285,9 +284,9 @@
 
 	int opResult;
-	dprintf(1, "finalizing add device");
+	dprintf(USB_LOG_LEVEL_INFO, "finalizing add device");
 	opResult = usb_hub_clear_port_feature(hc, target.address,
 	    port, USB_HUB_FEATURE_C_PORT_RESET);
 	if (opResult != EOK) {
-		dprintf(1, "failed to clear port reset feature");
+		dprintf(USB_LOG_LEVEL_ERROR, "failed to clear port reset feature");
 		usb_hub_release_default_address(hc);
 		return;
@@ -297,15 +296,15 @@
 	usb_address_t new_device_address = usb_drv_request_address(hc);
 	if (new_device_address < 0) {
-		dprintf(1, "failed to get free USB address");
+		dprintf(USB_LOG_LEVEL_ERROR, "failed to get free USB address");
 		opResult = new_device_address;
 		usb_hub_release_default_address(hc);
 		return;
 	}
-	dprintf(1, "setting new address");
+	dprintf(USB_LOG_LEVEL_INFO, "setting new address %d",new_device_address);
 	opResult = usb_drv_req_set_address(hc, USB_ADDRESS_DEFAULT,
 	    new_device_address);
 
 	if (opResult != EOK) {
-		dprintf(1, "could not set address for new device");
+		dprintf(USB_LOG_LEVEL_ERROR, "could not set address for new device");
 		usb_hub_release_default_address(hc);
 		return;
@@ -322,5 +321,5 @@
             new_device_address, &child_handle);
 	if (opResult != EOK) {
-		dprintf(1, "could not start driver for new device");
+		dprintf(USB_LOG_LEVEL_ERROR, "could not start driver for new device");
 		return;
 	}
@@ -330,8 +329,8 @@
 	opResult = usb_drv_bind_address(hc, new_device_address, child_handle);
 	if (opResult != EOK) {
-		dprintf(1, "could not assign address of device in hcd");
-		return;
-	}
-	dprintf(1, "new device address %d, handle %zu",
+		dprintf(USB_LOG_LEVEL_ERROR, "could not assign address of device in hcd");
+		return;
+	}
+	dprintf(USB_LOG_LEVEL_INFO, "new device address %d, handle %zu",
 	    new_device_address, child_handle);
 
@@ -358,10 +357,10 @@
 		opResult = usb_drv_release_address(hc,hub->attached_devs[port].address);
 		if(opResult != EOK) {
-			dprintf(1, "could not release address of " \
+			dprintf(USB_LOG_LEVEL_WARNING, "could not release address of " \
 			    "removed device: %d", opResult);
 		}
 		hub->attached_devs[port].address = 0;
 	}else{
-		dprintf(1, "this is strange, disconnected device had no address");
+		dprintf(USB_LOG_LEVEL_WARNING, "this is strange, disconnected device had no address");
 		//device was disconnected before it`s port was reset - return default address
 		usb_drv_release_default_address(hc);
@@ -377,5 +376,5 @@
 static void usb_hub_process_interrupt(usb_hub_info_t * hub, int hc,
         uint16_t port, usb_address_t address) {
-	dprintf(1, "interrupt at port %d", port);
+	dprintf(USB_LOG_LEVEL_DEBUG, "interrupt at port %d", port);
 	//determine type of change
 	usb_target_t target;
@@ -395,9 +394,9 @@
 			);
 	if (opResult != EOK) {
-		dprintf(1, "ERROR: could not get port status");
+		dprintf(USB_LOG_LEVEL_ERROR, "ERROR: could not get port status");
 		return;
 	}
 	if (rcvd_size != sizeof (usb_port_status_t)) {
-		dprintf(1, "ERROR: received status has incorrect size");
+		dprintf(USB_LOG_LEVEL_ERROR, "ERROR: received status has incorrect size");
 		return;
 	}
@@ -408,5 +407,5 @@
 		// TODO: check opResult
 		if (usb_port_dev_connected(&status)) {
-			dprintf(1, "some connection changed");
+			dprintf(USB_LOG_LEVEL_INFO, "some connection changed");
 			usb_hub_init_add_device(hc, port, target);
 		} else {
@@ -416,9 +415,9 @@
 	//port reset
 	if (usb_port_reset_completed(&status)) {
-		dprintf(1, "port reset complete");
+		dprintf(USB_LOG_LEVEL_INFO, "port reset complete");
 		if (usb_port_enabled(&status)) {
 			usb_hub_finalize_add_device(hub, hc, port, target);
 		} else {
-			dprintf(1, "ERROR: port reset, but port still not enabled");
+			dprintf(USB_LOG_LEVEL_WARNING, "ERROR: port reset, but port still not enabled");
 		}
 	}
@@ -429,5 +428,5 @@
 	usb_port_set_dev_connected(&status, false);
 	if (status>>16) {
-		dprintf(1, "there was some unsupported change on port %d: %X",port,status);
+		dprintf(USB_LOG_LEVEL_INFO, "there was some unsupported change on port %d: %X",port,status);
 
 	}
@@ -458,5 +457,5 @@
 		target.address = hub_info->usb_device->address;
 		target.endpoint = 1;/// \TODO get from endpoint descriptor
-		dprintf(1, "checking changes for hub at addr %d",
+		dprintf(USB_LOG_LEVEL_INFO, "checking changes for hub at addr %d",
 		    target.address);
 
@@ -489,5 +488,5 @@
 		if (opResult != EOK) {
 			free(change_bitmap);
-			dprintf(1, "something went wrong while getting status of hub");
+			dprintf(USB_LOG_LEVEL_WARNING, "something went wrong while getting status of hub");
 			continue;
 		}
Index: uspace/drv/usbhub/usbhub_private.h
===================================================================
--- uspace/drv/usbhub/usbhub_private.h	(revision aec2ad462bb61ec47c424e5fb01a6dda11edbd56)
+++ uspace/drv/usbhub/usbhub_private.h	(revision 103a36268784644d92fb6cc2e15a9ee181d31983)
@@ -61,9 +61,10 @@
 //************
 //
-// convenience debug printf
+// convenience debug printf for usb hub
 //
 //************
 #define dprintf(level, format, ...) \
 	usb_dprintf(NAME, (level), format "\n", ##__VA_ARGS__)
+
 
 /**
Index: uspace/drv/usbhub/utils.c
===================================================================
--- uspace/drv/usbhub/utils.c	(revision aec2ad462bb61ec47c424e5fb01a6dda11edbd56)
+++ uspace/drv/usbhub/utils.c	(revision 103a36268784644d92fb6cc2e15a9ee181d31983)
@@ -116,14 +116,14 @@
 
 int usb_drv_sync_control_read(
-		int phone, usb_target_t target,
-		usb_device_request_setup_packet_t * request,
-		void * rcvd_buffer, size_t rcvd_size, size_t * actual_size
-		) {
+    int phone, usb_target_t target,
+    usb_device_request_setup_packet_t * request,
+    void * rcvd_buffer, size_t rcvd_size, size_t * actual_size
+) {
 	usb_handle_t handle;
 	int opResult;
 	//setup
 	opResult = usb_drv_async_control_read_setup(phone, target,
-			request, sizeof (usb_device_request_setup_packet_t),
-			&handle);
+	    request, sizeof (usb_device_request_setup_packet_t),
+	    &handle);
 	if (opResult != EOK) {
 		return opResult;
@@ -158,14 +158,14 @@
 
 int usb_drv_sync_control_write(
-		int phone, usb_target_t target,
-		usb_device_request_setup_packet_t * request,
-		void * sent_buffer, size_t sent_size
-		) {
+    int phone, usb_target_t target,
+    usb_device_request_setup_packet_t * request,
+    void * sent_buffer, size_t sent_size
+) {
 	usb_handle_t handle;
 	int opResult;
 	//setup
 	opResult = usb_drv_async_control_write_setup(phone, target,
-			request, sizeof (usb_device_request_setup_packet_t),
-			&handle);
+	    request, sizeof (usb_device_request_setup_packet_t),
+	    &handle);
 	if (opResult != EOK) {
 		return opResult;
@@ -188,5 +188,5 @@
 	//finalize
 	opResult = usb_drv_async_control_write_status(phone, target,
-			&handle);
+	    &handle);
 	if (opResult != EOK) {
 		return opResult;
Index: uspace/lib/usb/include/usb/usbmem.h
===================================================================
--- uspace/lib/usb/include/usb/usbmem.h	(revision aec2ad462bb61ec47c424e5fb01a6dda11edbd56)
+++ uspace/lib/usb/include/usb/usbmem.h	(revision 103a36268784644d92fb6cc2e15a9ee181d31983)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2010 Matus Dekanek
+ * Copyright (c) 2011 Matus Dekanek
  * All rights reserved.
  *
@@ -35,5 +35,5 @@
  * @{
  */
-/** @file definitions of special memory management, used mostly in usb stack
+/** @file definitions of memory management with address translation, used mostly in usb stack
  *
  * USB HCD needs traslation between physical and virtual addresses. These
@@ -59,7 +59,7 @@
 
 extern void * mman_malloc(
-		size_t size,
-		size_t alignment,
-		unsigned long max_physical_address);
+    size_t size,
+    size_t alignment,
+    unsigned long max_physical_address);
 
 extern void * mman_getVA(void * addr);
Index: uspace/lib/usb/src/usbmem.c
===================================================================
--- uspace/lib/usb/src/usbmem.c	(revision aec2ad462bb61ec47c424e5fb01a6dda11edbd56)
+++ uspace/lib/usb/src/usbmem.c	(revision 103a36268784644d92fb6cc2e15a9ee181d31983)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2010 Matus Dekanek
+ * Copyright (c) 2011 Matus Dekanek
  * All rights reserved.
  *
@@ -69,5 +69,5 @@
 }
 
-static void addr_remove_callback(link_t *item)
+static void addr_remove_callback(link_t * item)
 {
 	//delete item
