Index: uspace/drv/usbhub/usbhub.c
===================================================================
--- uspace/drv/usbhub/usbhub.c	(revision 42a3a577fdefe029b1e5a02033455cef5832c014)
+++ uspace/drv/usbhub/usbhub.c	(revision b495a9356dcb0da34a18b3521c710e2fba5ac2a3)
@@ -78,6 +78,6 @@
 		async_usleep(1000 * 1000 );/// \TODO proper number once
 	}
-	dprintf(USB_LOG_LEVEL_ERROR,
-				"something in ctrl loop went wrong, errno %d",errorCode);
+	usb_log_error("something in ctrl loop went wrong, errno %d",errorCode);
+
 	return 0;
 }
@@ -104,6 +104,5 @@
 			hub->device);
 	if(opResult != EOK){
-		dprintf(USB_LOG_LEVEL_ERROR,
-				"could not initialize connection to hc, errno %d",opResult);
+		usb_log_error("could not initialize connection to hc, errno %d",opResult);
 		return opResult;
 	}
@@ -112,6 +111,6 @@
 			hub->device);
 	if(opResult != EOK){
-		dprintf(USB_LOG_LEVEL_ERROR,
-				"could not initialize connection to device, errno %d",opResult);
+		usb_log_error("could not initialize connection to device, errno %d",
+				opResult);
 		return opResult;
 	}
@@ -120,6 +119,6 @@
             &hub->device_connection);
 	if(opResult != EOK){
-		dprintf(USB_LOG_LEVEL_ERROR,
-				"could not initialize connection to device endpoint, errno %d",opResult);
+		usb_log_error("could not initialize connection to device endpoint, errno %d",
+				opResult);
 		return opResult;
 	}
@@ -127,5 +126,5 @@
 	opResult = usb_endpoint_pipe_probe_default_control(&hub->endpoints.control);
 	if (opResult != EOK) {
-		dprintf(USB_LOG_LEVEL_ERROR, "failed probing endpoint 0, %d", opResult);
+		usb_log_error("failed probing endpoint 0, %d", opResult);
 		return opResult;
 	}
@@ -151,11 +150,11 @@
 	    &std_descriptor);
 	if(opResult!=EOK){
-		dprintf(USB_LOG_LEVEL_ERROR, "could not get device descriptor, %d",opResult);
-		return opResult;
-	}
-	dprintf(USB_LOG_LEVEL_INFO, "hub has %d configurations",
+		usb_log_error("could not get device descriptor, %d",opResult);
+		return opResult;
+	}
+	usb_log_info("hub has %d configurations",
 			std_descriptor.configuration_count);
 	if(std_descriptor.configuration_count<1){
-		dprintf(USB_LOG_LEVEL_ERROR, "THERE ARE NO CONFIGURATIONS AVAILABLE");
+		usb_log_error("THERE ARE NO CONFIGURATIONS AVAILABLE");
 		//shouldn`t I return?
 	}
@@ -184,5 +183,5 @@
 		return opResult;
 	}
-	dprintf(USB_LOG_LEVEL_DEBUG, "\tused configuration %d",
+	usb_log_debug("\tused configuration %d",
 			config_descriptor->configuration_number);
 
@@ -200,11 +199,10 @@
 	    &hub->device_connection);
 	if (opResult != EOK) {
-		dprintf(USB_LOG_LEVEL_ERROR,
-				"Failed to initialize status change pipe: %s",
+		usb_log_error("Failed to initialize status change pipe: %s",
 		    str_error(opResult));
 		return opResult;
 	}
 	if (!endpoint_mapping[0].present) {
-		dprintf(USB_LOG_LEVEL_ERROR,"Not accepting device, " \
+		usb_log_error("Not accepting device, " \
 		    "cannot understand what is happenning");
 		return EREFUSED;
@@ -240,8 +238,8 @@
 
 	// get hub descriptor
-	dprintf(USB_LOG_LEVEL_DEBUG, "creating serialized descripton");
+	usb_log_debug("creating serialized descripton");
 	void * serialized_descriptor = malloc(USB_HUB_MAX_DESCRIPTOR_SIZE);
 	usb_hub_descriptor_t * descriptor;
-	dprintf(USB_LOG_LEVEL_DEBUG, "starting control transaction");
+	usb_log_debug("starting control transaction");
 	usb_endpoint_pipe_start_session(&result->endpoints.control);
 	opResult = usb_request_set_configuration(&result->endpoints.control, 1);
@@ -256,18 +254,19 @@
 
 	if (opResult != EOK) {
-		dprintf(USB_LOG_LEVEL_ERROR, "failed when receiving hub descriptor, badcode = %d",opResult);
+		usb_log_error("failed when receiving hub descriptor, badcode = %d",
+				opResult);
 		free(serialized_descriptor);
 		free(result);
 		return NULL;
 	}
-	dprintf(USB_LOG_LEVEL_DEBUG2, "deserializing descriptor");
+	usb_log_debug2("deserializing descriptor");
 	descriptor = usb_deserialize_hub_desriptor(serialized_descriptor);
 	if(descriptor==NULL){
-		dprintf(USB_LOG_LEVEL_WARNING, "could not deserialize descriptor ");
+		usb_log_warning("could not deserialize descriptor ");
 		free(result);
 		return NULL;
 	}
 
-	dprintf(USB_LOG_LEVEL_INFO, "setting port count to %d",descriptor->ports_count);
+	usb_log_info("setting port count to %d",descriptor->ports_count);
 	result->port_count = descriptor->ports_count;
 	result->attached_devs = (usb_hc_attached_device_t*)
@@ -278,5 +277,5 @@
 		result->attached_devs[i].address=0;
 	}
-	dprintf(USB_LOG_LEVEL_DEBUG2, "freeing data");
+	usb_log_debug2("freeing data");
 	free(serialized_descriptor);
 	free(descriptor->devices_removable);
@@ -285,5 +284,5 @@
 	//finish
 
-	dprintf(USB_LOG_LEVEL_INFO, "hub info created");
+	usb_log_info("hub info created");
 
 	return result;
@@ -296,5 +295,5 @@
  */
 int usb_add_hub_device(ddf_dev_t *dev) {
-	dprintf(USB_LOG_LEVEL_INFO, "add_hub_device(handle=%d)", (int) dev->handle);
+	usb_log_info("add_hub_device(handle=%d)", (int) dev->handle);
 
 	//dev->ops = &hub_device_ops;
@@ -313,5 +312,5 @@
 	opResult = usb_hub_process_configuration_descriptors(hub_info);
 	if(opResult != EOK){
-		dprintf(USB_LOG_LEVEL_ERROR,"could not get configuration descriptors, %d",
+		usb_log_error("could not get configuration descriptors, %d",
 				opResult);
 		return opResult;
@@ -324,7 +323,7 @@
 		opResult = usb_endpoint_pipe_control_write(&hub_info->endpoints.control,
 				&request,sizeof(usb_device_request_setup_packet_t), NULL, 0);
-		dprintf(USB_LOG_LEVEL_INFO, "powering port %d",port);
+		usb_log_info("powering port %d",port);
 		if (opResult != EOK) {
-			dprintf(USB_LOG_LEVEL_WARNING, "something went wrong when setting hub`s %dth port", port);
+			usb_log_warning("something went wrong when setting hub`s %dth port", port);
 		}
 	}
@@ -337,7 +336,7 @@
 	usb_lst_append(&usb_hub_list, hub_info);
 	fibril_mutex_unlock(&usb_hub_list_lock);
-	dprintf(USB_LOG_LEVEL_DEBUG, "hub info added to list");
-
-	dprintf(USB_LOG_LEVEL_DEBUG, "adding to ddf");
+	usb_log_debug("hub info added to list");
+
+	usb_log_debug("adding to ddf");
 	ddf_fun_t *hub_fun = ddf_fun_create(dev, fun_exposed, "hub");
 	assert(hub_fun != NULL);
@@ -351,17 +350,16 @@
 	fid_t fid = fibril_create(usb_hub_control_loop, hub_info);
 	if (fid == 0) {
-		dprintf(USB_LOG_LEVEL_ERROR, 
-				": failed to start monitoring fibril for new hub");
+		usb_log_error("failed to start monitoring fibril for new hub");
 		return ENOMEM;
 	}
 	fibril_add_ready(fid);
 
-	dprintf(USB_LOG_LEVEL_DEBUG, "hub fibril created");
+	usb_log_debug("hub fibril created");
 	//(void)hub_info;
 	//usb_hub_check_hub_changes();
 	
-	dprintf(USB_LOG_LEVEL_INFO, "hub dev added");
+	usb_log_info("hub dev added");
 	//address is lost...
-	dprintf(USB_LOG_LEVEL_DEBUG, "\taddress %d, has %d ports ",
+	usb_log_debug("\taddress %d, has %d ports ",
 			//hub_info->endpoints.control.,
 			hub_info->port_count);
@@ -388,5 +386,5 @@
 	usb_device_request_setup_packet_t request;
 	int opResult;
-	dprintf(USB_LOG_LEVEL_INFO, "some connection changed");
+	usb_log_info("some connection changed");
 	assert(hub->endpoints.control.hc_phone);
 	//get default address
@@ -395,6 +393,6 @@
 	
 	if (opResult != EOK) {
-		dprintf(USB_LOG_LEVEL_WARNING, 
-				"cannot assign default address, it is probably used %d",opResult);
+		usb_log_warning("cannot assign default address, it is probably used %d",
+				opResult);
 		return;
 	}
@@ -407,6 +405,5 @@
 			);
 	if (opResult != EOK) {
-		dprintf(USB_LOG_LEVEL_ERROR, 
-				"something went wrong when reseting a port %d",opResult);
+		usb_log_error("something went wrong when reseting a port %d",opResult);
 		//usb_hub_release_default_address(hc);
 		usb_hc_release_default_address(&hub->connection);
@@ -424,10 +421,10 @@
 
 	int opResult;
-	dprintf(USB_LOG_LEVEL_INFO, "finalizing add device");
+	usb_log_info("finalizing add device");
 	opResult = usb_hub_clear_port_feature(&hub->endpoints.control,
 	    port, USB_HUB_FEATURE_C_PORT_RESET);
 
 	if (opResult != EOK) {
-		dprintf(USB_LOG_LEVEL_ERROR, "failed to clear port reset feature");
+		usb_log_error("failed to clear port reset feature");
 		usb_hc_release_default_address(&hub->connection);
 		return;
@@ -454,10 +451,10 @@
 			);
 	if (new_device_address < 0) {
-		dprintf(USB_LOG_LEVEL_ERROR, "failed to get free USB address");
+		usb_log_error("failed to get free USB address");
 		opResult = new_device_address;
 		usb_hc_release_default_address(&hub->connection);
 		return;
 	}
-	dprintf(USB_LOG_LEVEL_INFO, "setting new address %d",new_device_address);
+	usb_log_info("setting new address %d",new_device_address);
 	//opResult = usb_drv_req_set_address(hc, USB_ADDRESS_DEFAULT,
 	//    new_device_address);
@@ -466,6 +463,5 @@
 	usb_endpoint_pipe_end_session(&new_device_pipe);
 	if (opResult != EOK) {
-		dprintf(USB_LOG_LEVEL_ERROR, 
-				"could not set address for new device %d",opResult);
+		usb_log_error("could not set address for new device %d",opResult);
 		usb_hc_release_default_address(&hub->connection);
 		return;
@@ -486,6 +482,5 @@
 
 	if (opResult != EOK) {
-		dprintf(USB_LOG_LEVEL_ERROR, 
-				"could not start driver for new device %d",opResult);
+		usb_log_error("could not start driver for new device %d",opResult);
 		return;
 	}
@@ -498,9 +493,8 @@
 			&hub->attached_devs[port]);
 	if (opResult != EOK) {
-		dprintf(USB_LOG_LEVEL_ERROR, 
-				"could not assign address of device in hcd %d",opResult);
-		return;
-	}
-	dprintf(USB_LOG_LEVEL_INFO, "new device address %d, handle %zu",
+		usb_log_error("could not assign address of device in hcd %d",opResult);
+		return;
+	}
+	usb_log_info("new device address %d, handle %zu",
 	    new_device_address, child_handle);
 
@@ -533,5 +527,5 @@
 		 */
 	}else{
-		dprintf(USB_LOG_LEVEL_WARNING, "this is strange, disconnected device had no address");
+		usb_log_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);
@@ -542,5 +536,5 @@
 
 /**
- *Process over current condition on port.
+ * Process over current condition on port.
  * 
  * Turn off the power on the port.
@@ -555,5 +549,5 @@
 	    port, USB_HUB_FEATURE_PORT_POWER);
 	if(opResult!=EOK){
-		dprintf(USB_LOG_LEVEL_ERROR, "cannot power off port %d;  %d",
+		usb_log_error("cannot power off port %d;  %d",
 				port, opResult);
 	}
@@ -568,5 +562,5 @@
 static void usb_hub_process_interrupt(usb_hub_info_t * hub, 
         uint16_t port) {
-	dprintf(USB_LOG_LEVEL_DEBUG, "interrupt at port %d", port);
+	usb_log_debug("interrupt at port %d", port);
 	//determine type of change
 	usb_endpoint_pipe_t *pipe = &hub->endpoints.control;
@@ -587,9 +581,9 @@
 			);
 	if (opResult != EOK) {
-		dprintf(USB_LOG_LEVEL_ERROR, "could not get port status");
+		usb_log_error("could not get port status");
 		return;
 	}
 	if (rcvd_size != sizeof (usb_port_status_t)) {
-		dprintf(USB_LOG_LEVEL_ERROR, "received status has incorrect size");
+		usb_log_error("received status has incorrect size");
 		return;
 	}
@@ -600,5 +594,5 @@
 		// TODO: check opResult
 		if (usb_port_dev_connected(&status)) {
-			dprintf(USB_LOG_LEVEL_INFO, "some connection changed");
+			usb_log_info("some connection changed");
 			usb_hub_init_add_device(hub, port, usb_port_low_speed(&status));
 		} else {
@@ -612,15 +606,15 @@
 			usb_hub_over_current(hub,port);
 		}else{
-			dprintf(USB_LOG_LEVEL_INFO,
-				"over current condition was auto-resolved on port %d",port);
+			usb_log_info("over current condition was auto-resolved on port %d",
+					port);
 		}
 	}
 	//port reset
 	if (usb_port_reset_completed(&status)) {
-		dprintf(USB_LOG_LEVEL_INFO, "port reset complete");
+		usb_log_info("port reset complete");
 		if (usb_port_enabled(&status)) {
 			usb_hub_finalize_add_device(hub, port, usb_port_low_speed(&status));
 		} else {
-			dprintf(USB_LOG_LEVEL_WARNING, "port reset, but port still not enabled");
+			usb_log_warning("port reset, but port still not enabled");
 		}
 	}
@@ -631,8 +625,9 @@
 	usb_port_set_dev_connected(&status, false);
 	if (status>>16) {
-		dprintf(USB_LOG_LEVEL_INFO, "there was some unsupported change on port %d: %X",port,status);
-
-	}
-	/// \TODO handle other changes
+		usb_log_info("there was some unsupported change on port %d: %X",
+				port,status);
+
+	}
+	/// \TODO handle other changes - is there any?
 }
 
@@ -647,6 +642,6 @@
 	opResult = usb_endpoint_pipe_start_session(&hub_info->endpoints.status_change);
 	if(opResult != EOK){
-		dprintf(USB_LOG_LEVEL_ERROR,
-				"could not initialize communication for hub; %d", opResult);
+		usb_log_error("could not initialize communication for hub; %d",
+				opResult);
 		return opResult;
 	}
@@ -669,5 +664,5 @@
 	if (opResult != EOK) {
 		free(change_bitmap);
-		dprintf(USB_LOG_LEVEL_WARNING, "something went wrong while getting status of hub");
+		usb_log_warning("something went wrong while getting status of hub");
 		usb_endpoint_pipe_end_session(&hub_info->endpoints.status_change);
 		return opResult;
@@ -676,6 +671,5 @@
 	opResult = usb_endpoint_pipe_start_session(&hub_info->endpoints.control);
 	if(opResult!=EOK){
-		dprintf(USB_LOG_LEVEL_ERROR, "could not start control pipe session %d",
-				opResult);
+		usb_log_error("could not start control pipe session %d", opResult);
 		usb_endpoint_pipe_end_session(&hub_info->endpoints.status_change);
 		return opResult;
@@ -683,5 +677,5 @@
 	opResult = usb_hc_connection_open(&hub_info->connection);
 	if(opResult!=EOK){
-		dprintf(USB_LOG_LEVEL_ERROR, "could not start host controller session %d",
+		usb_log_error("could not start host controller session %d",
 				opResult);
 		usb_endpoint_pipe_end_session(&hub_info->endpoints.control);
