Index: uspace/app/usbinfo/dev.c
===================================================================
--- uspace/app/usbinfo/dev.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/app/usbinfo/dev.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -77,11 +77,5 @@
 	}
 
-	rc = usb_pipe_start_long_transfer(&dev->ctrl_pipe);
-	if (rc != EOK) {
-		fprintf(stderr,
-		    NAME ": failed to start transfer on control pipe: %s.\n",
-		    str_error(rc));
-		goto leave;
-	}
+	usb_pipe_start_long_transfer(&dev->ctrl_pipe);
 	transfer_started = true;
 
Index: uspace/drv/ehci-hcd/main.c
===================================================================
--- uspace/drv/ehci-hcd/main.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/ehci-hcd/main.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -82,6 +82,7 @@
 	    pci_get_my_registers(device, &mem_reg_base, &mem_reg_size, &irq);
 	CHECK_RET_RETURN(ret,
-	    "Failed(%d) to get memory addresses:.\n", ret, device->handle);
-	usb_log_info("Memory mapped regs at 0x%X (size %zu), IRQ %d.\n",
+	    "Failed to get memory addresses for %" PRIun ": %s.\n",
+	    device->handle, str_error(ret));
+	usb_log_info("Memory mapped regs at 0x%" PRIxn " (size %zu), IRQ %d.\n",
 	    mem_reg_base, mem_reg_size, irq);
 
@@ -102,5 +103,5 @@
 	    str_error(ret));
 
-	usb_log_info("Controlling new EHCI device `%s' (handle %llu).\n",
+	usb_log_info("Controlling new EHCI device `%s' (handle %" PRIun ").\n",
 	    device->name, device->handle);
 
Index: uspace/drv/ehci-hcd/pci.c
===================================================================
--- uspace/drv/ehci-hcd/pci.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/ehci-hcd/pci.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -117,5 +117,5 @@
 				mem_address = res->res.mem_range.address;
 				mem_size = res->res.mem_range.size;
-				usb_log_debug2("Found mem: %llx %zu.\n",
+				usb_log_debug2("Found mem: %" PRIxn" %zu.\n",
 				    mem_address, mem_size);
 				mem_found = true;
@@ -186,9 +186,9 @@
 	CHECK_RET_HANGUP_RETURN(ret, "Failed(%d) to read PCI config space.\n",
 	    ret);
-	usb_log_info("Register space BAR at %p:%x.\n", address, value);
+	usb_log_info("Register space BAR at %p:%" PRIxn ".\n", (void *) address, value);
 
 	/* clear lower byte, it's not part of the BASE address */
 	uintptr_t registers = (value & 0xffffff00);
-	usb_log_info("Memory registers BASE address:%p.\n", registers);
+	usb_log_info("Memory registers BASE address:%p.\n", (void *) registers);
 
 	/* if nothing setup the hc, we don't need to turn it off */
@@ -201,5 +201,5 @@
 	    AS_AREA_READ | AS_AREA_WRITE);
 	CHECK_RET_HANGUP_RETURN(ret, "Failed(%d) to map registers %p:%p.\n",
-	    ret, regs, registers);
+	    ret, regs, (void *) registers);
 
 	/* calculate value of BASE */
@@ -221,5 +221,5 @@
 	    IPC_M_CONFIG_SPACE_READ_32, eecp + USBLEGCTLSTS_OFFSET, &value);
 	CHECK_RET_HANGUP_RETURN(ret, "Failed(%d) to read USBLEGCTLSTS.\n", ret);
-	usb_log_debug("USBLEGCTLSTS: %x.\n", value);
+	usb_log_debug("USBLEGCTLSTS: %" PRIxn ".\n", value);
 
 	/* Read the first EEC. i.e. Legacy Support register */
@@ -228,5 +228,5 @@
 	    IPC_M_CONFIG_SPACE_READ_32, eecp + USBLEGSUP_OFFSET, &value);
 	CHECK_RET_HANGUP_RETURN(ret, "Failed(%d) to read USBLEGSUP.\n", ret);
-	usb_log_debug2("USBLEGSUP: %x.\n", value);
+	usb_log_debug2("USBLEGSUP: %" PRIxn ".\n", value);
 
 	/* Request control from firmware/BIOS, by writing 1 to highest byte.
@@ -248,9 +248,9 @@
 
 	if ((value & USBLEGSUP_BIOS_CONTROL) == 0) {
-		usb_log_info("BIOS released control after %d usec.\n", wait);
+		usb_log_info("BIOS released control after %zu usec.\n", wait);
 	} else {
 		/* BIOS failed to hand over control, this should not happen. */
 		usb_log_warning( "BIOS failed to release control after "
-		    "%d usecs, force it.\n", wait);
+		    "%zu usecs, force it.\n", wait);
 		ret = async_req_3_0(parent_phone, DEV_IFACE_ID(PCI_DEV_IFACE),
 		    IPC_M_CONFIG_SPACE_WRITE_32, eecp + USBLEGSUP_OFFSET,
@@ -271,5 +271,5 @@
 	    IPC_M_CONFIG_SPACE_READ_32, eecp + USBLEGCTLSTS_OFFSET, &value);
 	CHECK_RET_HANGUP_RETURN(ret, "Failed(%d) to read USBLEGCTLSTS.\n", ret);
-	usb_log_debug2("USBLEGCTLSTS: %x.\n", value);
+	usb_log_debug2("USBLEGCTLSTS: %" PRIxn ".\n", value);
 
 	/* Read again Legacy Support register */
@@ -277,5 +277,5 @@
 	    IPC_M_CONFIG_SPACE_READ_32, eecp + USBLEGSUP_OFFSET, &value);
 	CHECK_RET_HANGUP_RETURN(ret, "Failed(%d) to read USBLEGSUP.\n", ret);
-	usb_log_debug2("USBLEGSUP: %x.\n", value);
+	usb_log_debug2("USBLEGSUP: %" PRIxn ".\n", value);
 
 	/*
Index: uspace/drv/ohci/batch.c
===================================================================
--- uspace/drv/ohci/batch.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/ohci/batch.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -141,5 +141,5 @@
 	assert(data);
 	size_t tds = data->td_count;
-	usb_log_debug("Batch(%p) checking %d td(s) for completion.\n",
+	usb_log_debug("Batch(%p) checking %zu td(s) for completion.\n",
 	    instance, tds);
 	usb_log_debug("ED: %x:%x:%x:%x.\n",
@@ -150,5 +150,5 @@
 	for (; i < tds; ++i) {
 		assert(data->tds[i] != NULL);
-		usb_log_debug("TD %d: %x:%x:%x:%x.\n", i,
+		usb_log_debug("TD %zu: %x:%x:%x:%x.\n", i,
 		    data->tds[i]->status, data->tds[i]->cbp, data->tds[i]->next,
 		    data->tds[i]->be);
@@ -158,5 +158,5 @@
 		instance->error = td_error(data->tds[i]);
 		if (instance->error != EOK) {
-			usb_log_debug("Batch(%p) found error TD(%d):%x.\n",
+			usb_log_debug("Batch(%p) found error TD(%zu):%x.\n",
 			    instance, i, data->tds[i]->status);
 			/* Make sure TD queue is empty (one TD),
Index: uspace/drv/ohci/endpoint_list.c
===================================================================
--- uspace/drv/ohci/endpoint_list.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/ohci/endpoint_list.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -55,5 +55,5 @@
 	}
 	instance->list_head_pa = addr_to_phys(instance->list_head);
-	usb_log_debug2("Transfer list %s setup with ED: %p(%p).\n",
+	usb_log_debug2("Transfer list %s setup with ED: %p(0x%0" PRIx32 ")).\n",
 	    name, instance->list_head, instance->list_head_pa);
 
@@ -121,5 +121,5 @@
 		hcd_ep, instance->name, first, first->ed);
 	if (last_ed == instance->list_head) {
-		usb_log_debug2("%s head ED(%p-%p): %x:%x:%x:%x.\n",
+		usb_log_debug2("%s head ED(%p-0x%0" PRIx32 "): %x:%x:%x:%x.\n",
 		    instance->name, last_ed, instance->list_head_pa,
 		    last_ed->status, last_ed->td_tail, last_ed->td_head,
Index: uspace/drv/ohci/hc.c
===================================================================
--- uspace/drv/ohci/hc.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/ohci/hc.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -113,10 +113,10 @@
 	    BANDWIDTH_AVAILABLE_USB11);
 	CHECK_RET_RETURN(ret, "Failed to initialize endpoint manager: %s.\n",
-	    ret, str_error(ret));
+	    str_error(ret));
 
 	hc_gain_control(instance);
 	ret = hc_init_memory(instance);
-	CHECK_RET_RETURN(ret, "Failed to create OHCI memory structures:%s.\n",
-	    ret, str_error(ret));
+	CHECK_RET_RETURN(ret, "Failed to create OHCI memory structures: %s.\n",
+	    str_error(ret));
 	hc_init_hw(instance);
 	fibril_mutex_initialize(&instance->guard);
@@ -294,7 +294,8 @@
 	if (status & IS_WDH) {
 		fibril_mutex_lock(&instance->guard);
-		usb_log_debug2("HCCA: %p-%p(%p).\n", instance->hcca,
-		    instance->registers->hcca, addr_to_phys(instance->hcca));
-		usb_log_debug2("Periodic current: %p.\n",
+		usb_log_debug2("HCCA: %p-%#" PRIx32 " (%p).\n", instance->hcca,
+		    instance->registers->hcca,
+		    (void *) addr_to_phys(instance->hcca));
+		usb_log_debug2("Periodic current: %#" PRIx32 ".\n",
 		    instance->registers->periodic_current);
 
@@ -405,5 +406,5 @@
 	instance->registers->bulk_head =
 	    instance->lists[USB_TRANSFER_BULK].list_head_pa;
-	usb_log_debug2("Bulk HEAD set to: %p(%p).\n",
+	usb_log_debug2("Bulk HEAD set to: %p (%#" PRIx32 ").\n",
 	    instance->lists[USB_TRANSFER_BULK].list_head,
 	    instance->lists[USB_TRANSFER_BULK].list_head_pa);
@@ -411,5 +412,5 @@
 	instance->registers->control_head =
 	    instance->lists[USB_TRANSFER_CONTROL].list_head_pa;
-	usb_log_debug2("Control HEAD set to: %p(%p).\n",
+	usb_log_debug2("Control HEAD set to: %p (%#" PRIx32 ").\n",
 	    instance->lists[USB_TRANSFER_CONTROL].list_head,
 	    instance->lists[USB_TRANSFER_CONTROL].list_head_pa);
@@ -487,5 +488,5 @@
 		    instance->lists[USB_TRANSFER_INTERRUPT].list_head_pa;
 	}
-	usb_log_debug2("Interrupt HEADs set to: %p(%p).\n",
+	usb_log_debug2("Interrupt HEADs set to: %p (%#" PRIx32 ").\n",
 	    instance->lists[USB_TRANSFER_INTERRUPT].list_head,
 	    instance->lists[USB_TRANSFER_INTERRUPT].list_head_pa);
Index: uspace/drv/ohci/iface.c
===================================================================
--- uspace/drv/ohci/iface.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/ohci/iface.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -118,5 +118,5 @@
 	hc_t *hc = fun_to_hc(fun);
 	assert(hc);
-	usb_log_debug("Address bind %d-%d.\n", address, handle);
+	usb_log_debug("Address bind %d-%" PRIun ".\n", address, handle);
 	usb_device_keeper_bind(&hc->manager, address, handle);
 	return EOK;
Index: uspace/drv/ohci/ohci.c
===================================================================
--- uspace/drv/ohci/ohci.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/ohci/ohci.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -148,7 +148,8 @@
 	    pci_get_my_registers(device, &mem_reg_base, &mem_reg_size, &irq);
 	CHECK_RET_DEST_FUN_RETURN(ret,
-	    "Failed(%d) to get memory addresses:.\n", ret, device->handle);
-	usb_log_debug("Memory mapped regs at 0x%X (size %zu), IRQ %d.\n",
-	    mem_reg_base, mem_reg_size, irq);
+	    "Failed to get memory addresses for %" PRIun ": %s.\n",
+	    device->handle, str_error(ret));
+	usb_log_debug("Memory mapped regs at %p (size %zu), IRQ %d.\n",
+	    (void *) mem_reg_base, mem_reg_size, irq);
 
 	ret = pci_disable_legacy(device);
Index: uspace/drv/ohci/pci.c
===================================================================
--- uspace/drv/ohci/pci.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/ohci/pci.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -117,6 +117,6 @@
 				mem_address = res->res.mem_range.address;
 				mem_size = res->res.mem_range.size;
-				usb_log_debug2("Found mem: %llx %zu.\n",
-				    mem_address, mem_size);
+				usb_log_debug2("Found mem: %p %zu.\n",
+				    (void *) mem_address, mem_size);
 				mem_found = true;
 				}
Index: uspace/drv/uhci-hcd/batch.c
===================================================================
--- uspace/drv/uhci-hcd/batch.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/uhci-hcd/batch.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -162,5 +162,5 @@
 	assert(data);
 
-	usb_log_debug2("Batch(%p) checking %d transfer(s) for completion.\n",
+	usb_log_debug2("Batch(%p) checking %zu transfer(s) for completion.\n",
 	    instance, data->td_count);
 	instance->transfered_size = 0;
@@ -173,5 +173,5 @@
 		instance->error = td_status(&data->tds[i]);
 		if (instance->error != EOK) {
-			usb_log_debug("Batch(%p) found error TD(%d):%x.\n",
+			usb_log_debug("Batch(%p) found error TD(%zu):%" PRIx32 ".\n",
 			    instance, i, data->tds[i].status);
 			td_print_status(&data->tds[i]);
Index: uspace/drv/uhci-hcd/hc.c
===================================================================
--- uspace/drv/uhci-hcd/hc.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/uhci-hcd/hc.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -101,5 +101,5 @@
 	    ret, io, str_error(ret));
 	instance->registers = io;
-	usb_log_debug("Device registers at %p(%u) accessible.\n",
+	usb_log_debug("Device registers at %p (%zuB) accessible.\n",
 	    io, reg_size);
 
@@ -330,5 +330,5 @@
 {
 	assert(instance);
-//	status |= 1; //Uncomment to work around qemu hang
+	status |= 1; //Uncomment to work around qemu hang
 	/* Lower 2 bits are transaction error and transaction complete */
 	if (status & (UHCI_STATUS_INTERRUPT | UHCI_STATUS_ERROR_INTERRUPT)) {
@@ -423,5 +423,6 @@
 		if (frame_list != addr_to_phys(instance->frame_list)) {
 			usb_log_debug("Framelist address: %p vs. %p.\n",
-			    frame_list, addr_to_phys(instance->frame_list));
+			    (void *) frame_list,
+			    (void *) addr_to_phys(instance->frame_list));
 		}
 
@@ -432,6 +433,6 @@
 		uintptr_t real_pa = addr_to_phys(QH(interrupt));
 		if (expected_pa != real_pa) {
-			usb_log_debug("Interrupt QH: %p(frame: %d) vs. %p.\n",
-			    expected_pa, frnum, real_pa);
+			usb_log_debug("Interrupt QH: %p (frame %d) vs. %p.\n",
+			    (void *) expected_pa, frnum, (void *) real_pa);
 		}
 
@@ -440,5 +441,5 @@
 		if (expected_pa != real_pa) {
 			usb_log_debug("Control Slow QH: %p vs. %p.\n",
-			    expected_pa, real_pa);
+			    (void *) expected_pa, (void *) real_pa);
 		}
 
@@ -447,5 +448,5 @@
 		if (expected_pa != real_pa) {
 			usb_log_debug("Control Full QH: %p vs. %p.\n",
-			    expected_pa, real_pa);
+			    (void *) expected_pa, (void *) real_pa);
 		}
 
@@ -454,5 +455,5 @@
 		if (expected_pa != real_pa ) {
 			usb_log_debug("Bulk QH: %p vs. %p.\n",
-			    expected_pa, real_pa);
+			    (void *) expected_pa, (void *) real_pa);
 		}
 		async_usleep(UHCI_DEBUGER_TIMEOUT);
Index: uspace/drv/uhci-hcd/hw_struct/transfer_descriptor.c
===================================================================
--- uspace/drv/uhci-hcd/hw_struct/transfer_descriptor.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/uhci-hcd/hw_struct/transfer_descriptor.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -154,5 +154,5 @@
 	assert(instance);
 	const uint32_t s = instance->status;
-	usb_log_debug2("TD(%p) status(%#x):%s %d,%s%s%s%s%s%s%s%s%s%s%s %d.\n",
+	usb_log_debug2("TD(%p) status(%#" PRIx32 "):%s %d,%s%s%s%s%s%s%s%s%s%s%s %zu.\n",
 	    instance, instance->status,
 	    (s & TD_STATUS_SPD_FLAG) ? " SPD," : "",
Index: uspace/drv/uhci-hcd/iface.c
===================================================================
--- uspace/drv/uhci-hcd/iface.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/uhci-hcd/iface.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -118,5 +118,5 @@
 	hc_t *hc = fun_to_hc(fun);
 	assert(hc);
-	usb_log_debug("Address bind %d-%d.\n", address, handle);
+	usb_log_debug("Address bind %d-%" PRIun ".\n", address, handle);
 	usb_device_keeper_bind(&hc->manager, address, handle);
 	return EOK;
Index: uspace/drv/uhci-hcd/main.c
===================================================================
--- uspace/drv/uhci-hcd/main.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/uhci-hcd/main.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -72,6 +72,6 @@
 	int ret = uhci_init(uhci, device);
 	if (ret != EOK) {
-		usb_log_error("Failed(%d) to initialize UHCI driver: %s.\n",
-		    ret, str_error(ret));
+		usb_log_error("Failed to initialize UHCI driver: %s.\n",
+		    str_error(ret));
 		return ret;
 	}
Index: uspace/drv/uhci-hcd/pci.c
===================================================================
--- uspace/drv/uhci-hcd/pci.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/uhci-hcd/pci.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -90,5 +90,5 @@
 			io_address = res->res.io_range.address;
 			io_size = res->res.io_range.size;
-			usb_log_debug2("Found io: %llx %zu.\n",
+			usb_log_debug2("Found io: %" PRIx64" %zu.\n",
 			    res->res.io_range.address, res->res.io_range.size);
 			io_found = true;
Index: uspace/drv/uhci-hcd/transfer_list.c
===================================================================
--- uspace/drv/uhci-hcd/transfer_list.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/uhci-hcd/transfer_list.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -58,5 +58,5 @@
 	}
 	uint32_t queue_head_pa = addr_to_phys(instance->queue_head);
-	usb_log_debug2("Transfer list %s setup with QH: %p(%p).\n",
+	usb_log_debug2("Transfer list %s setup with QH: %p (%#" PRIx32" ).\n",
 	    name, instance->queue_head, queue_head_pa);
 
Index: uspace/drv/uhci-hcd/uhci.c
===================================================================
--- uspace/drv/uhci-hcd/uhci.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/uhci-hcd/uhci.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -168,7 +168,8 @@
 	    pci_get_my_registers(device, &io_reg_base, &io_reg_size, &irq);
 	CHECK_RET_DEST_FUN_RETURN(ret,
-	    "Failed(%d) to get I/O addresses:.\n", ret, device->handle);
-	usb_log_debug("I/O regs at 0x%X (size %zu), IRQ %d.\n",
-	    io_reg_base, io_reg_size, irq);
+	    "Failed to get I/O addresses for %" PRIun ": %s.\n",
+	    device->handle, str_error(ret));
+	usb_log_debug("I/O regs at 0x%p (size %zu), IRQ %d.\n",
+	    (void *) io_reg_base, io_reg_size, irq);
 
 	ret = pci_disable_legacy(device);
Index: uspace/drv/uhci-rhd/main.c
===================================================================
--- uspace/drv/uhci-rhd/main.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/uhci-rhd/main.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2011 Vojtech Horky, Jan Vesely
+ * Copyright (c) 2011 Jan Vesely
  * All rights reserved.
  *
@@ -84,5 +84,6 @@
 		return EINVAL;
 
-	usb_log_debug2("%s called device %d\n", __FUNCTION__, device->handle);
+	usb_log_debug2("uhci_rh_add_device(handle=%" PRIun ")\n",
+	    device->handle);
 
 	uintptr_t io_regs = 0;
@@ -101,6 +102,7 @@
 	ret = hc_get_my_registers(device, &io_regs, &io_size);
 	CHECK_RET_FREE_RH_RETURN(ret,
-	    "Failed(%d) to get registers from HC: %s.\n", ret, str_error(ret));
-	usb_log_debug("I/O regs at %#x (size %zu).\n", io_regs, io_size);
+	    "Failed to get registers from HC: %s.\n", str_error(ret));
+	usb_log_debug("I/O regs at %p (size %zuB).\n",
+	    (void *) io_regs, io_size);
 
 	rh = malloc(sizeof(uhci_root_hub_t));
@@ -115,5 +117,5 @@
 
 	device->driver_data = rh;
-	usb_log_info("Controlling root hub '%s' (%llu).\n",
+	usb_log_info("Controlling root hub '%s' (%" PRIun ").\n",
 	    device->name, device->handle);
 	return EOK;
Index: uspace/drv/uhci-rhd/port.c
===================================================================
--- uspace/drv/uhci-rhd/port.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/uhci-rhd/port.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -89,5 +89,5 @@
 {
 	assert(port);
-	asprintf(&port->id_string, "Port (%p - %d)", port, number);
+	asprintf(&port->id_string, "Port (%p - %u)", port, number);
 	if (port->id_string == NULL) {
 		return ENOMEM;
@@ -115,5 +115,5 @@
 
 	fibril_add_ready(port->checker);
-	usb_log_debug("%s: Started polling fibril(%x).\n",
+	usb_log_debug("%s: Started polling fibril (%" PRIun ").\n",
 	    port->id_string, port->checker);
 	return EOK;
@@ -267,5 +267,5 @@
 	}
 
-	usb_log_info("New device at port %u, address %d (handle %llu).\n",
+	usb_log_info("New device at port %u, address %d (handle %" PRIun ").\n",
 	    port->number, dev_addr, port->attached_device);
 	return EOK;
@@ -283,5 +283,5 @@
 int uhci_port_remove_device(uhci_port_t *port)
 {
-	usb_log_error("%s: Don't know how to remove device %llu.\n",
+	usb_log_error("%s: Don't know how to remove device %" PRIun ".\n",
 	    port->id_string, port->attached_device);
 	return ENOTSUP;
Index: uspace/drv/usbflbk/main.c
===================================================================
--- uspace/drv/usbflbk/main.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/usbflbk/main.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -65,5 +65,5 @@
 
 	usb_log_info("Pretending to control %s `%s'" \
-	    " (node `%s', handle %llu).\n",
+	    " (node `%s', handle %" PRIun ").\n",
 	    dev->interface_no < 0 ? "device" : "interface",
 	    dev->ddf_dev->name, fun_name, dev->ddf_dev->handle);
Index: uspace/drv/usbhid/kbd/conv.c
===================================================================
--- uspace/drv/usbhid/kbd/conv.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/usbhid/kbd/conv.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -99,5 +99,6 @@
 	[0x30] = KC_RBRACKET,
 	[0x31] = KC_BACKSLASH,
-	//[0x32] = KC_,	// TODO: HASH??? maybe some as 0x31 - backslash
+	//[0x32] = KC_,	// TODO: HASH??? maybe same as 0x31 - backslash
+	[0x32] = KC_BACKSLASH,
 	[0x33] = KC_SEMICOLON,
 	[0x34] = KC_QUOTE,  // same as APOSTROPHE? (')
Index: uspace/drv/usbhid/kbd/kbddev.c
===================================================================
--- uspace/drv/usbhid/kbd/kbddev.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/usbhid/kbd/kbddev.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -177,10 +177,10 @@
 /*----------------------------------------------------------------------------*/
 
-static void usb_kbd_process_keycodes(const uint8_t *key_codes, size_t count,
-    uint8_t report_id, void *arg);
-
-static const usb_hid_report_in_callbacks_t usb_kbd_parser_callbacks = {
-	.keyboard = usb_kbd_process_keycodes
-};
+//static void usb_kbd_process_keycodes(const uint8_t *key_codes, size_t count,
+//    uint8_t report_id, void *arg);
+
+//static const usb_hid_report_in_callbacks_t usb_kbd_parser_callbacks = {
+//	.keyboard = usb_kbd_process_keycodes
+//};
 
 /*----------------------------------------------------------------------------*/
@@ -304,29 +304,33 @@
 	usb_log_debug("Creating output report:\n");
 
-	usb_hid_report_field_t *field = usb_hid_report_get_sibling (hid_dev->parser, NULL,
-                kbd_dev->led_path, 
-				USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY | USB_HID_PATH_COMPARE_END,
-				USB_HID_REPORT_TYPE_OUTPUT);
-	while(field != NULL) {
-
-		if((field->usage == USB_HID_LED_NUM_LOCK) && (kbd_dev->mods & KM_NUM_LOCK)){
+	usb_hid_report_field_t *field = usb_hid_report_get_sibling(
+	    hid_dev->report, NULL, kbd_dev->led_path, 
+	    USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY | USB_HID_PATH_COMPARE_END,
+	    USB_HID_REPORT_TYPE_OUTPUT);
+	
+	while (field != NULL) {
+
+		if ((field->usage == USB_HID_LED_NUM_LOCK) 
+		    && (kbd_dev->mods & KM_NUM_LOCK)){
 			field->value = 1;
 		}
 
-		if((field->usage == USB_HID_LED_CAPS_LOCK) && (kbd_dev->mods & KM_CAPS_LOCK)){
+		if ((field->usage == USB_HID_LED_CAPS_LOCK) 
+		    && (kbd_dev->mods & KM_CAPS_LOCK)){
 			field->value = 1;
 		}
 
-		if((field->usage == USB_HID_LED_SCROLL_LOCK) && (kbd_dev->mods & KM_SCROLL_LOCK)){
+		if ((field->usage == USB_HID_LED_SCROLL_LOCK) 
+		    && (kbd_dev->mods & KM_SCROLL_LOCK)){
 			field->value = 1;
 		}
 		
-		field = usb_hid_report_get_sibling (hid_dev->parser, field,
-                kbd_dev->led_path, 
-				USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY | USB_HID_PATH_COMPARE_END,
-				USB_HID_REPORT_TYPE_OUTPUT);
-	}
-		
-	int rc = usb_hid_report_output_translate(hid_dev->parser, 0,
+		field = usb_hid_report_get_sibling(hid_dev->report, field,
+		    kbd_dev->led_path, USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY 
+		    | USB_HID_PATH_COMPARE_END, USB_HID_REPORT_TYPE_OUTPUT);
+	}
+	
+	// TODO: what about the Report ID?
+	int rc = usb_hid_report_output_translate(hid_dev->report, 0,
 	    kbd_dev->output_buffer, kbd_dev->output_size);
 	
@@ -488,5 +492,5 @@
  */
 static void usb_kbd_check_key_changes(usb_hid_dev_t *hid_dev, 
-    usb_kbd_t *kbd_dev, const uint8_t *key_codes, size_t count)
+    usb_kbd_t *kbd_dev/*, const uint8_t *key_codes, size_t count*/)
 {
 	unsigned int key;
@@ -502,30 +506,27 @@
 	 */
 	i = 0;
-	while (i < count && key_codes[i] != ERROR_ROLLOVER) {
+	while (i < kbd_dev->key_count && kbd_dev->keys[i] != ERROR_ROLLOVER) {
 		++i;
 	}
-	if (i != count) {
+	if (i != kbd_dev->key_count) {
 		usb_log_debug("Phantom state occured.\n");
 		// phantom state, do nothing
 		return;
 	}
-	
-	/* TODO: quite dummy right now, think of better implementation */
-	assert(count == kbd_dev->key_count);
 	
 	/*
 	 * 1) Key releases
 	 */
-	for (j = 0; j < count; ++j) {
+	for (j = 0; j < kbd_dev->key_count; ++j) {
 		// try to find the old key in the new key list
 		i = 0;
 		while (i < kbd_dev->key_count
-		    && key_codes[i] != kbd_dev->keys[j]) {
+		    && kbd_dev->keys[i] != kbd_dev->keys_old[j]) {
 			++i;
 		}
 		
-		if (i == count) {
+		if (i == kbd_dev->key_count) {
 			// not found, i.e. the key was released
-			key = usbhid_parse_scancode(kbd_dev->keys[j]);
+			key = usbhid_parse_scancode(kbd_dev->keys_old[j]);
 			if (!usb_kbd_is_lock(key)) {
 				usb_kbd_repeat_stop(kbd_dev, key);
@@ -544,15 +545,15 @@
 		// try to find the new key in the old key list
 		j = 0;
-		while (j < count && kbd_dev->keys[j] != key_codes[i]) { 
+		while (j < kbd_dev->key_count 
+		    && kbd_dev->keys_old[j] != kbd_dev->keys[i]) { 
 			++j;
 		}
 		
-		if (j == count) {
+		if (j == kbd_dev->key_count) {
 			// not found, i.e. new key pressed
-			key = usbhid_parse_scancode(key_codes[i]);
+			key = usbhid_parse_scancode(kbd_dev->keys[i]);
 			usb_log_debug2("Key pressed: %d (keycode: %d)\n", key,
-			    key_codes[i]);
-			usb_kbd_push_ev(hid_dev, kbd_dev, KEY_PRESS, 
-			    key);
+			    kbd_dev->keys[i]);
+			usb_kbd_push_ev(hid_dev, kbd_dev, KEY_PRESS, key);
 			if (!usb_kbd_is_lock(key)) {
 				usb_kbd_repeat_start(kbd_dev, key);
@@ -563,8 +564,24 @@
 	}
 	
-	memcpy(kbd_dev->keys, key_codes, count);
-
-	usb_log_debug("New stored keycodes: %s\n", 
-	    usb_debug_str_buffer(kbd_dev->keys, kbd_dev->key_count, 0));
+//	usb_log_debug("Old keys: ");
+//	for (i = 0; i < kbd_dev->key_count; ++i) {
+//		usb_log_debug("%d ", kbd_dev->keys_old[i]);
+//	}
+//	usb_log_debug("\n");
+	
+	
+//	usb_log_debug("New keys: ");
+//	for (i = 0; i < kbd_dev->key_count; ++i) {
+//		usb_log_debug("%d ", kbd_dev->keys[i]);
+//	}
+//	usb_log_debug("\n");
+	
+	memcpy(kbd_dev->keys_old, kbd_dev->keys, kbd_dev->key_count * 4);
+	
+	usb_log_debug2("New stored keys: ");
+	for (i = 0; i < kbd_dev->key_count; ++i) {
+		usb_log_debug2("%d ", kbd_dev->keys_old[i]);
+	}
+	usb_log_debug2("\n");
 }
 
@@ -588,34 +605,34 @@
  * @sa usb_kbd_check_key_changes(), usb_kbd_check_modifier_changes()
  */
-static void usb_kbd_process_keycodes(const uint8_t *key_codes, size_t count,
-    uint8_t report_id, void *arg)
-{
-	if (arg == NULL) {
-		usb_log_warning("Missing argument in callback "
-		    "usbhid_process_keycodes().\n");
-		return;
-	}
-	
-	usb_hid_dev_t *hid_dev = (usb_hid_dev_t *)arg;
-	
-	if (hid_dev->data == NULL) {
-		usb_log_warning("Missing KBD device structure in callback.\n");
-		return;
-	}
-	
-	usb_kbd_t *kbd_dev = (usb_kbd_t *)hid_dev->data;
-
-	usb_log_debug("Got keys from parser (report id: %u): %s\n", 
-	    report_id, usb_debug_str_buffer(key_codes, count, 0));
-	
-	if (count != kbd_dev->key_count) {
-		usb_log_warning("Number of received keycodes (%d) differs from"
-		    " expected number (%d).\n", count, kbd_dev->key_count);
-		return;
-	}
-	
-	///usb_kbd_check_modifier_changes(kbd_dev, key_codes, count);
-	usb_kbd_check_key_changes(hid_dev, kbd_dev, key_codes, count);
-}
+//static void usb_kbd_process_keycodes(const uint8_t *key_codes, size_t count,
+//    uint8_t report_id, void *arg)
+//{
+//	if (arg == NULL) {
+//		usb_log_warning("Missing argument in callback "
+//		    "usbhid_process_keycodes().\n");
+//		return;
+//	}
+	
+//	usb_hid_dev_t *hid_dev = (usb_hid_dev_t *)arg;
+	
+//	if (hid_dev->data == NULL) {
+//		usb_log_warning("Missing KBD device structure in callback.\n");
+//		return;
+//	}
+	
+//	usb_kbd_t *kbd_dev = (usb_kbd_t *)hid_dev->data;
+
+//	usb_log_debug("Got keys from parser (report id: %u): %s\n", 
+//	    report_id, usb_debug_str_buffer(key_codes, count, 0));
+	
+//	if (count != kbd_dev->key_count) {
+//		usb_log_warning("Number of received keycodes (%zu) differs from"
+//		    " expected (%zu).\n", count, kbd_dev->key_count);
+//		return;
+//	}
+	
+//	///usb_kbd_check_modifier_changes(kbd_dev, key_codes, count);
+//	usb_kbd_check_key_changes(hid_dev, kbd_dev, key_codes, count);
+//}
 
 /*----------------------------------------------------------------------------*/
@@ -641,5 +658,9 @@
                                  uint8_t *buffer, size_t actual_size)
 {
-	assert(hid_dev->parser != NULL);
+	assert(hid_dev->report != NULL);
+	assert(hid_dev != NULL);
+	assert(hid_dev->data != NULL);
+	
+	usb_kbd_t *kbd_dev = (usb_kbd_t *)hid_dev->data;
 
 	usb_log_debug("Calling usb_hid_parse_report() with "
@@ -653,30 +674,52 @@
 
 	uint8_t report_id;
-	int rc = usb_hid_parse_report(hid_dev->parser, buffer, actual_size, &report_id);	
+	int rc = usb_hid_parse_report(hid_dev->report, buffer, actual_size, 
+	    &report_id);
+	
+	if (rc != EOK) {
+		usb_log_warning("Error in usb_hid_parse_report():"
+		    "%s\n", str_error(rc));
+	}
+	
 	usb_hid_report_path_set_report_id (path, report_id);
-	usb_hid_report_field_t *field = usb_hid_report_get_sibling(hid_dev->parser, 
-	                    NULL, path, USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 
-						USB_HID_REPORT_TYPE_INPUT);
-
-	unsigned i=0;
-	usb_kbd_t *kbd_dev = (usb_kbd_t *)hid_dev->data;
-
-	memset(kbd_dev->keys, 0, kbd_dev->key_count);
-	while(field != NULL) {
-		if((i < kbd_dev->key_count) && (field->value != 0)){
-			kbd_dev->keys[i++] = (uint8_t)field->usage;
-		}
-		field = usb_hid_report_get_sibling(hid_dev->parser, field, path, 
-		                                   USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 
-		                                   USB_HID_REPORT_TYPE_INPUT);
-	}
-	usb_kbd_process_keycodes(kbd_dev->keys, kbd_dev->key_count, report_id, hid_dev);
+	
+	// fill in the currently pressed keys
+	
+	usb_hid_report_field_t *field = usb_hid_report_get_sibling(
+	    hid_dev->report, NULL, path, 
+	    USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 
+	    USB_HID_REPORT_TYPE_INPUT);
+	unsigned i = 0;
+	
+	while (field != NULL) {
+		usb_log_debug2("FIELD (%p) - VALUE(%d) USAGE(%u)\n", 
+		    field, field->value, field->value);
+		
+		assert(i < kbd_dev->key_count);
+//		if (i == kbd_dev->key_count) {
+//			break;
+//		}
+		
+		// save the key usage
+		/* TODO: maybe it's not good to save value, nor usage
+		 *       as the value may be e.g. 1 for LEDs and usage may be
+		 *       value of the LED. On the other hand, in case of normal
+		 *       keys, the usage is more important and we must check
+		 *       that. One possible solution: distinguish between those
+		 *       two parts of the Report somehow.
+		 */
+		kbd_dev->keys[i] = field->value;
+		usb_log_debug2("Saved %u. key usage %d\n", i, kbd_dev->keys[i]);
+		
+		++i;
+		field = usb_hid_report_get_sibling(hid_dev->report, field, path, 
+		    USB_HID_PATH_COMPARE_END 
+		    | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 
+		    USB_HID_REPORT_TYPE_INPUT);
+	}
 	
 	usb_hid_report_path_free(path);
 	
-	if (rc != EOK) {
-		usb_log_warning("Error in usb_hid_boot_keyboard_input_report():"
-		    "%s\n", str_error(rc));
-	}
+	usb_kbd_check_key_changes(hid_dev, kbd_dev);
 }
 
@@ -766,5 +809,5 @@
 	
 	kbd_dev->key_count = usb_hid_report_input_length(
-	    hid_dev->parser, path, 
+	    hid_dev->report, path, 
 	    USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY);
 	usb_hid_report_path_free(path);
@@ -772,5 +815,5 @@
 	usb_log_debug("Size of the input report: %zu\n", kbd_dev->key_count);
 	
-	kbd_dev->keys = (uint8_t *)calloc(kbd_dev->key_count, sizeof(uint8_t));
+	kbd_dev->keys = (int32_t *)calloc(kbd_dev->key_count, sizeof(int32_t));
 	
 	if (kbd_dev->keys == NULL) {
@@ -780,10 +823,20 @@
 	}
 	
+	kbd_dev->keys_old = 
+		(int32_t *)calloc(kbd_dev->key_count, sizeof(int32_t));
+	
+	if (kbd_dev->keys_old == NULL) {
+		usb_log_fatal("No memory!\n");
+		free(kbd_dev->keys);
+		free(kbd_dev);
+		return ENOMEM;
+	}
+	
 	/*
 	 * Output report
 	 */
 	kbd_dev->output_size = 0;
-	kbd_dev->output_buffer = usb_hid_report_output(hid_dev->parser, 
-	    &kbd_dev->output_size, 0x00);
+	kbd_dev->output_buffer = usb_hid_report_output(hid_dev->report, 
+	    &kbd_dev->output_size, 0);
 	if (kbd_dev->output_buffer == NULL) {
 		usb_log_warning("Error creating output report buffer.\n");
@@ -798,5 +851,5 @@
 	    kbd_dev->led_path, USB_HIDUT_PAGE_LED, 0);
 	
-	kbd_dev->led_output_size = usb_hid_report_output_size(hid_dev->parser, 
+	kbd_dev->led_output_size = usb_hid_report_output_size(hid_dev->report, 
 	    kbd_dev->led_path, 
 	    USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY);
@@ -955,5 +1008,5 @@
 int usb_kbd_set_boot_protocol(usb_hid_dev_t *hid_dev)
 {
-	int rc = usb_hid_parse_report_descriptor(hid_dev->parser, 
+	int rc = usb_hid_parse_report_descriptor(hid_dev->report, 
 	    USB_KBD_BOOT_REPORT_DESCRIPTOR, 
 	    USB_KBD_BOOT_REPORT_DESCRIPTOR_SIZE);
Index: uspace/drv/usbhid/kbd/kbddev.h
===================================================================
--- uspace/drv/usbhid/kbd/kbddev.h	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/usbhid/kbd/kbddev.h	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -65,6 +65,8 @@
  */
 typedef struct usb_kbd_t {
+	/** Previously pressed keys (not translated to key codes). */
+	int32_t *keys_old;
 	/** Currently pressed keys (not translated to key codes). */
-	uint8_t *keys;
+	int32_t *keys;
 	/** Count of stored keys (i.e. number of keys in the report). */
 	size_t key_count;
Index: uspace/drv/usbhid/lgtch-ultrax/lgtch-ultrax.c
===================================================================
--- uspace/drv/usbhid/lgtch-ultrax/lgtch-ultrax.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/usbhid/lgtch-ultrax/lgtch-ultrax.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -83,10 +83,16 @@
 
 	uint8_t report_id;
-	int rc = usb_hid_parse_report(hid_dev->parser, buffer, buffer_size, &report_id);
+	
+	int rc = usb_hid_parse_report(hid_dev->report, buffer, buffer_size, 
+	    &report_id);
 	usb_hid_report_path_set_report_id(path, report_id);
 
-	usb_hid_report_field_t *field = usb_hid_report_get_sibling(hid_dev->parser, NULL, path, USB_HID_PATH_COMPARE_END , USB_HID_REPORT_TYPE_INPUT);
-	while(field != NULL) {
-		usb_log_debug("KEY VALUE(%X) USAGE(%X)\n", field->value, field->usage);
+	usb_hid_report_field_t *field = usb_hid_report_get_sibling(
+	    hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_END , 
+	    USB_HID_REPORT_TYPE_INPUT);
+	
+	while (field != NULL) {
+		usb_log_debug(NAME " KEY VALUE(%X) USAGE(%X)\n", field->value, 
+		    field->usage);
 	}
 	
@@ -95,5 +101,5 @@
 	
 	if (rc != EOK) {
-		usb_log_warning("Error in usb_hid_boot_keyboard_input_report():"
+		usb_log_warning(NAME "Error in usb_hid_boot_keyboard_input_report():"
 		    "%s\n", str_error(rc));
 	}
Index: uspace/drv/usbhid/mouse/mousedev.c
===================================================================
--- uspace/drv/usbhid/mouse/mousedev.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/usbhid/mouse/mousedev.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -296,5 +296,5 @@
 int usb_mouse_set_boot_protocol(usb_hid_dev_t *hid_dev)
 {
-	int rc = usb_hid_parse_report_descriptor(hid_dev->parser, 
+	int rc = usb_hid_parse_report_descriptor(hid_dev->report, 
 	    USB_MOUSE_BOOT_REPORT_DESCRIPTOR, 
 	    USB_MOUSE_BOOT_REPORT_DESCRIPTOR_SIZE);
Index: uspace/drv/usbhid/subdrivers.c
===================================================================
--- uspace/drv/usbhid/subdrivers.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/usbhid/subdrivers.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -55,6 +55,6 @@
 		USB_HID_PATH_COMPARE_END 
 		| USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
-		0,
-		0,
+		-1,
+		-1,
 		{
 			.init = usb_kbd_init,
@@ -79,5 +79,5 @@
 		}
 	},
-	{NULL, -1, 0, 0, 0, {NULL, NULL, NULL, NULL}}
+	{NULL, -1, 0, -1, -1, {NULL, NULL, NULL, NULL}}
 };
 
Index: uspace/drv/usbhid/subdrivers.h
===================================================================
--- uspace/drv/usbhid/subdrivers.h	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/usbhid/subdrivers.h	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -56,6 +56,6 @@
 	int report_id;
 	int compare;
-	uint16_t vendor_id;
-	uint16_t product_id;
+	int vendor_id;
+	int product_id;
 	usb_hid_subdriver_t subdriver;
 } usb_hid_subdriver_mapping_t;
Index: uspace/drv/usbhid/usbhid.c
===================================================================
--- uspace/drv/usbhid/usbhid.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/usbhid/usbhid.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -158,5 +158,11 @@
     const usb_hid_subdriver_mapping_t *mapping)
 {
-	return false;
+	assert(hid_dev != NULL);
+	assert(hid_dev->usb_dev != NULL);
+	
+	return (hid_dev->usb_dev->descriptors.device.vendor_id 
+	    == mapping->vendor_id
+	    && hid_dev->usb_dev->descriptors.device.product_id 
+	    == mapping->product_id);
 }
 
@@ -192,10 +198,10 @@
 	}
 	
-	assert(hid_dev->parser != NULL);
+	assert(hid_dev->report != NULL);
 	
 	usb_log_debug("Compare flags: %d\n", mapping->compare);
-	size_t size = usb_hid_report_input_length(hid_dev->parser, usage_path, 
+	size_t size = usb_hid_report_input_length(hid_dev->report, usage_path, 
 	    mapping->compare);
-	usb_log_debug("Size of the input report: %d\n", size);
+	usb_log_debug("Size of the input report: %zuB\n", size);
 	
 	usb_hid_report_path_free(usage_path);
@@ -251,13 +257,13 @@
 	while (count < USB_HID_MAX_SUBDRIVERS &&
 	    (mapping->usage_path != NULL
-	    || mapping->vendor_id != 0 || mapping->product_id != 0)) {
+	    || mapping->vendor_id >= 0 || mapping->product_id >= 0)) {
 		// check the vendor & product ID
-		if (mapping->vendor_id != 0 && mapping->product_id == 0) {
-			usb_log_warning("Missing Product ID for Vendor ID %u\n",
+		if (mapping->vendor_id >= 0 && mapping->product_id < 0) {
+			usb_log_warning("Missing Product ID for Vendor ID %d\n",
 			    mapping->vendor_id);
 			return EINVAL;
 		}
-		if (mapping->product_id != 0 && mapping->vendor_id == 0) {
-			usb_log_warning("Missing Vendor ID for Product ID %u\n",
+		if (mapping->product_id >= 0 && mapping->vendor_id < 0) {
+			usb_log_warning("Missing Vendor ID for Product ID %d\n",
 			    mapping->product_id);
 			return EINVAL;
@@ -267,6 +273,6 @@
 		matched = false;
 		
-		if (mapping->vendor_id != 0) {
-			assert(mapping->product_id != 0);
+		if (mapping->vendor_id >= 0) {
+			assert(mapping->product_id >= 0);
 			usb_log_debug("Comparing device against vendor ID %u"
 			    " and product ID %u.\n", mapping->vendor_id,
@@ -341,7 +347,7 @@
 	}
 	
-	hid_dev->parser = (usb_hid_report_t *)(malloc(sizeof(
+	hid_dev->report = (usb_hid_report_t *)(malloc(sizeof(
 	    usb_hid_report_t)));
-	if (hid_dev->parser == NULL) {
+	if (hid_dev->report == NULL) {
 		usb_log_fatal("No memory!\n");
 		free(hid_dev);
@@ -385,5 +391,5 @@
 	/* Get the report descriptor and parse it. */
 	rc = usb_hid_process_report_descriptor(hid_dev->usb_dev, 
-	    hid_dev->parser);
+	    hid_dev->report);
 	
 	bool fallback = false;
@@ -583,6 +589,6 @@
 
 	// destroy the parser
-	if ((*hid_dev)->parser != NULL) {
-		usb_hid_free_report((*hid_dev)->parser);
+	if ((*hid_dev)->report != NULL) {
+		usb_hid_free_report((*hid_dev)->report);
 	}
 
Index: uspace/drv/usbhid/usbhid.h
===================================================================
--- uspace/drv/usbhid/usbhid.h	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/usbhid/usbhid.h	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -91,5 +91,5 @@
 	
 	/** HID Report parser. */
-	usb_hid_report_t *parser;
+	usb_hid_report_t *report;
 	
 	/** Arbitrary data (e.g. a special structure for handling keyboard). */
Index: uspace/drv/usbhub/ports.c
===================================================================
--- uspace/drv/usbhub/ports.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/usbhub/ports.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -83,5 +83,5 @@
 void usb_hub_process_interrupt(usb_hub_info_t * hub,
 	uint16_t port) {
-	usb_log_debug("interrupt at port %d\n", port);
+	usb_log_debug("interrupt at port %zu\n", (size_t) port);
 	//determine type of change
 	//usb_pipe_t *pipe = hub->control_pipe;
@@ -93,5 +93,5 @@
 	if (opResult != EOK) {
 		usb_log_error("Failed to get port %zu status: %s.\n",
-		    port, str_error(opResult));
+		    (size_t) port, str_error(opResult));
 		return;
 	}
@@ -100,5 +100,6 @@
 		bool device_connected = usb_port_is_status(status,
 		    USB_HUB_FEATURE_PORT_CONNECTION);
-		usb_log_debug("Connection change on port %zu: %s.\n", port,
+		usb_log_debug("Connection change on port %zu: %s.\n",
+		    (size_t) port,
 		    device_connected ? "device attached" : "device removed");
 
@@ -109,5 +110,5 @@
 				usb_log_error(
 				    "Cannot handle change on port %zu: %s.\n",
-				    str_error(opResult));
+				    (size_t) port, str_error(opResult));
 			}
 		} else {
@@ -210,5 +211,5 @@
 static void usb_hub_port_reset_completed(usb_hub_info_t * hub,
 	uint16_t port, uint32_t status){
-	usb_log_debug("Port %zu reset complete.\n", port);
+	usb_log_debug("Port %zu reset complete.\n", (size_t) port);
 	if (usb_port_is_status(status, USB_HUB_FEATURE_PORT_ENABLE)) {
 		/* Finalize device adding. */
@@ -222,5 +223,5 @@
 		usb_log_warning(
 		    "Port %zu reset complete but port not enabled.\n",
-		    port);
+		    (size_t) port);
 	}
 }
Index: uspace/drv/usbhub/usbhub.c
===================================================================
--- uspace/drv/usbhub/usbhub.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/usbhub/usbhub.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -264,6 +264,6 @@
 				    port+1, USB_HUB_FEATURE_PORT_POWER);
 				if (opResult != EOK) {
-					usb_log_error("cannot power on port %d;  %d\n",
-					    port+1, opResult);
+					usb_log_error("cannot power on port %zu: %s.\n",
+					    port+1, str_error(opResult));
 				}
 			}
@@ -273,6 +273,6 @@
 			    USB_HUB_FEATURE_C_HUB_LOCAL_POWER);
 			if (opResult != EOK) {
-				usb_log_error("cannot power hub;  %d\n",
-				  opResult);
+				usb_log_error("cannot power hub: %s\n",
+				    str_error(opResult));
 			}
 		}
@@ -362,5 +362,5 @@
 	}
 
-	usb_log_info("Controlling hub `%s' (%d ports).\n",
+	usb_log_info("Controlling hub `%s' (%zu ports).\n",
 	    hub_info->usb_device->ddf_dev->name, hub_info->port_count);
 	return EOK;
@@ -430,6 +430,6 @@
 			    port, USB_HUB_FEATURE_PORT_POWER);
 			if (opResult != EOK) {
-				usb_log_error("cannot power on port %d;  %d\n",
-				    port, opResult);
+				usb_log_error("Cannot power on port %zu: %s.\n",
+				    port, str_error(opResult));
 			}
 		}
Index: uspace/drv/usbkbd/kbddev.c
===================================================================
--- uspace/drv/usbkbd/kbddev.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/usbkbd/kbddev.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -570,6 +570,6 @@
 	
 	if (count != kbd_dev->key_count) {
-		usb_log_warning("Number of received keycodes (%d) differs from"
-		    " expected number (%d).\n", count, kbd_dev->key_count);
+		usb_log_warning("Number of received keycodes (%zu) differs from"
+		    " expected (%zu).\n", count, kbd_dev->key_count);
 		return;
 	}
Index: uspace/drv/usbmid/main.c
===================================================================
--- uspace/drv/usbmid/main.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/usbmid/main.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -53,12 +53,5 @@
 	usb_log_info("Taking care of new MID `%s'.\n", dev->ddf_dev->name);
 
-	int rc;
-
-	rc = usb_pipe_start_long_transfer(&dev->ctrl_pipe);
-	if (rc != EOK) {
-		usb_log_error("Failed to start transfer on control pipe: %s.\n",
-		    str_error(rc));
-		return rc;
-	}
+	usb_pipe_start_long_transfer(&dev->ctrl_pipe);
 
 	bool accept = usbmid_explore_device(dev);
Index: uspace/drv/usbmouse/init.c
===================================================================
--- uspace/drv/usbmouse/init.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/usbmouse/init.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -125,10 +125,4 @@
 	}
 	
-	/* Open the control pipe. */
-	rc = usb_pipe_start_session(&dev->ctrl_pipe);
-	if (rc != EOK) {
-		goto leave;
-	}
-	
 	/* Set the boot protocol. */
 	rc = usb_control_request_set(&dev->ctrl_pipe,
@@ -140,9 +134,5 @@
 	}
 	
-	/* Close the control pipe (ignore errors). */
-	usb_pipe_end_session(&dev->ctrl_pipe);
-
-
-	/* Everything allright. */
+	/* Everything all right. */
 	dev->driver_data = mouse;
 	mouse->mouse_fun->driver_data = mouse;
Index: uspace/drv/usbmouse/main.c
===================================================================
--- uspace/drv/usbmouse/main.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/usbmouse/main.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -54,5 +54,6 @@
 	}
 
-	usb_log_debug("Polling pipe at endpoint %d.\n", dev->pipes[0].pipe->endpoint_no);
+	usb_log_debug("Polling pipe at endpoint %d.\n",
+	    dev->pipes[0].pipe->endpoint_no);
 
 	rc = usb_device_auto_poll(dev, 0,
@@ -66,5 +67,5 @@
 	}
 
-	usb_log_info("controlling new mouse (handle %llu).\n",
+	usb_log_info("controlling new mouse (handle %" PRIun ").\n",
 	    dev->ddf_dev->handle);
 
Index: uspace/drv/vhc/conndev.c
===================================================================
--- uspace/drv/vhc/conndev.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/drv/vhc/conndev.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -99,5 +99,5 @@
 		int rc = get_device_name(callback, devname, DEVICE_NAME_MAXLENGTH);
 
-		usb_log_info("New virtual device `%s' (id = %x).\n",
+		usb_log_info("New virtual device `%s' (id = %" PRIxn ").\n",
 		    rc == EOK ? devname : "<unknown>", dev->id);
 
@@ -122,5 +122,6 @@
 	}
 
-	usb_log_info("Virtual device disconnected (id = %x).\n", dev->id);
+	usb_log_info("Virtual device disconnected (id = %" PRIxn ").\n",
+	    dev->id);
 	virtdev_destroy_device(dev);
 }
Index: uspace/lib/usb/include/usb/debug.h
===================================================================
--- uspace/lib/usb/include/usb/debug.h	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/lib/usb/include/usb/debug.h	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -36,4 +36,5 @@
 #define LIBUSB_DEBUG_H_
 #include <stdio.h>
+#include <inttypes.h>
 #include <usb/usb.h>
 #include <assert.h>
@@ -85,5 +86,6 @@
 void usb_log_enable(usb_log_level_t, const char *);
 
-void usb_log_printf(usb_log_level_t, const char *, ...);
+void usb_log_printf(usb_log_level_t, const char *, ...)
+	PRINTF_ATTRIBUTE(2, 3);
 
 /** Log fatal error. */
Index: uspace/lib/usb/include/usb/pipes.h
===================================================================
--- uspace/lib/usb/include/usb/pipes.h	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/lib/usb/include/usb/pipes.h	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -99,4 +99,18 @@
 	/** Number of active transfers over the pipe. */
 	int refcount;
+	/** Number of failed attempts to open the HC phone.
+	 * When user requests usb_pipe_start_long_transfer() and the operation
+	 * fails, there is no way to report this to the user.
+	 * That the soft reference counter is increased to record the attempt.
+	 * When the user then request e.g. usb_pipe_read(), it will try to
+	 * add reference as well.
+	 * If that fails, it is reported to the user. If it is okay, the
+	 * real reference counter is incremented.
+	 * The problem might arise when ending the long transfer (since
+	 * the number of references would be only 1, but logically it shall be
+	 * two).
+	 * Decrementing the soft counter first shall solve this.
+	 */
+	int refcount_soft;
 
 	/** Whether to automatically reset halt on the endpoint.
@@ -163,9 +177,5 @@
 int usb_pipe_unregister(usb_pipe_t *, usb_hc_connection_t *);
 
-int usb_pipe_start_session(usb_pipe_t *);
-int usb_pipe_end_session(usb_pipe_t *);
-bool usb_pipe_is_session_started(usb_pipe_t *);
-
-int usb_pipe_start_long_transfer(usb_pipe_t *);
+void usb_pipe_start_long_transfer(usb_pipe_t *);
 void usb_pipe_end_long_transfer(usb_pipe_t *);
 
Index: uspace/lib/usb/src/devdrv.c
===================================================================
--- uspace/lib/usb/src/devdrv.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/lib/usb/src/devdrv.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -236,8 +236,5 @@
 
 	/* It is worth to start a long transfer. */
-	rc = usb_pipe_start_long_transfer(ctrl_pipe);
-	if (rc != EOK) {
-		return rc;
-	}
+	usb_pipe_start_long_transfer(ctrl_pipe);
 
 	/* Get the device descriptor. */
Index: uspace/lib/usb/src/devpoll.c
===================================================================
--- uspace/lib/usb/src/devpoll.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/lib/usb/src/devpoll.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -78,5 +78,5 @@
 		usb_endpoint_mapping_t *mapping
 		    = &polling_data->dev->pipes[polling_data->pipe_index];
-		usb_log_debug("Poll0x%x: started polling of `%s' - " \
+		usb_log_debug("Poll%p: started polling of `%s' - " \
 		    "interface %d (%s,%d,%d), %zuB/%zu.\n",
 		    polling_data,
@@ -100,5 +100,5 @@
 			if (rc == EOK) {
 				usb_log_debug(
-				    "Poll0x%x: received: '%s' (%zuB).\n",
+				    "Poll%p: received: '%s' (%zuB).\n",
 				    polling_data,
 				    usb_debug_str_buffer(polling_data->buffer,
@@ -107,5 +107,5 @@
 			} else {
 				usb_log_debug(
-				    "Poll0x%x: polling failed: %s.\n",
+				    "Poll%p: polling failed: %s.\n",
 				    polling_data, str_error(rc));
 			}
Index: uspace/lib/usb/src/hidreport.c
===================================================================
--- uspace/lib/usb/src/hidreport.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/lib/usb/src/hidreport.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -109,5 +109,5 @@
 	
 	if (*d != sizeof(usb_standard_hid_descriptor_t)) {
-		usb_log_error("HID descriptor hass wrong size (%u, expected %u"
+		usb_log_error("HID descriptor has wrong size (%u, expected %zu"
 		    ")\n", *d, sizeof(usb_standard_hid_descriptor_t));
 		return EINVAL;
@@ -149,5 +149,5 @@
 		free(*report_desc);
 		*report_desc = NULL;
-		usb_log_error("Report descriptor has wrong size (%u, expected "
+		usb_log_error("Report descriptor has wrong size (%zu, expected "
 		    "%u)\n", actual_size, length);
 		return EINVAL;
Index: uspace/lib/usb/src/pipepriv.c
===================================================================
--- uspace/lib/usb/src/pipepriv.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/lib/usb/src/pipepriv.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -77,10 +77,11 @@
  *
  * @param pipe The USB pipe.
+ * @param hide_failure Whether to hide failure when adding reference
+ *	(use soft refcount).
  * @return Error code.
  * @retval EOK Currently always.
  */
-int pipe_add_ref(usb_pipe_t *pipe)
+int pipe_add_ref(usb_pipe_t *pipe, bool hide_failure)
 {
-another_try:
 	pipe_acquire(pipe);
 
@@ -89,8 +90,10 @@
 		int phone = devman_device_connect(pipe->wire->hc_handle, 0);
 		if (phone < 0) {
-			// TODO: treat some error as non-recoverable
-			// and return error from here
+			if (hide_failure) {
+				pipe->refcount_soft++;
+				phone = EOK;
+			}
 			pipe_release(pipe);
-			goto another_try;
+			return phone;
 		}
 		/*
@@ -114,4 +117,9 @@
 {
 	pipe_acquire(pipe);
+	if (pipe->refcount_soft > 0) {
+		pipe->refcount_soft--;
+		pipe_release(pipe);
+		return;
+	}
 	assert(pipe->refcount > 0);
 	pipe->refcount--;
Index: uspace/lib/usb/src/pipepriv.h
===================================================================
--- uspace/lib/usb/src/pipepriv.h	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/lib/usb/src/pipepriv.h	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -37,4 +37,5 @@
 
 #include <usb/pipes.h>
+#include <bool.h>
 
 void pipe_acquire(usb_pipe_t *);
@@ -44,5 +45,5 @@
 void pipe_end_transaction(usb_pipe_t *);
 
-int pipe_add_ref(usb_pipe_t *);
+int pipe_add_ref(usb_pipe_t *, bool);
 void pipe_drop_ref(usb_pipe_t *);
 
Index: uspace/lib/usb/src/pipes.c
===================================================================
--- uspace/lib/usb/src/pipes.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/lib/usb/src/pipes.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -229,62 +229,4 @@
 }
 
-
-/** Start a session on the endpoint pipe.
- *
- * A session is something inside what any communication occurs.
- * It is expected that sessions would be started right before the transfer
- * and ended - see usb_pipe_end_session() - after the last
- * transfer.
- * The reason for this is that session actually opens some communication
- * channel to the host controller (or to the physical hardware if you
- * wish) and thus it involves acquiring kernel resources.
- * Since they are limited, sessions shall not be longer than strictly
- * necessary.
- *
- * @deprecated
- * Obsoleted with introduction of usb_pipe_start_long_transfer
- *
- * @param pipe Endpoint pipe to start the session on.
- * @return Error code.
- */
-int usb_pipe_start_session(usb_pipe_t *pipe)
-{
-	usb_log_warning("usb_pipe_start_session() was deprecated.\n");
-	return EOK;
-}
-
-
-/** Ends a session on the endpoint pipe.
- *
- * @deprecated
- * Obsoleted with introduction of usb_pipe_end_long_transfer
- *
- * @see usb_pipe_start_session
- *
- * @param pipe Endpoint pipe to end the session on.
- * @return Error code.
- */
-int usb_pipe_end_session(usb_pipe_t *pipe)
-{
-	usb_log_warning("usb_pipe_end_session() was deprecated.\n");
-	return EOK;
-}
-
-/** Tell whether a session is started (open) on the endpoint pipe.
- *
- * The expected usage of this function is in assertions for some
- * nested functions.
- *
- * @param pipe Endpoint pipe in question.
- * @return Whether @p pipe has opened a session.
- */
-bool usb_pipe_is_session_started(usb_pipe_t *pipe)
-{
-	pipe_acquire(pipe);
-	bool started = pipe->refcount > 0;
-	pipe_release(pipe);
-	return started;
-}
-
 /** Prepare pipe for a long transfer.
  *
@@ -297,7 +239,7 @@
  * @return Error code.
  */
-int usb_pipe_start_long_transfer(usb_pipe_t *pipe)
-{
-	return pipe_add_ref(pipe);
+void usb_pipe_start_long_transfer(usb_pipe_t *pipe)
+{
+	(void) pipe_add_ref(pipe, true);
 }
 
Index: uspace/lib/usb/src/pipesinit.c
===================================================================
--- uspace/lib/usb/src/pipesinit.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/lib/usb/src/pipesinit.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -365,4 +365,5 @@
 	pipe->direction = direction;
 	pipe->refcount = 0;
+	pipe->refcount_soft = 0;
 	pipe->auto_reset_halt = false;
 
@@ -419,9 +420,5 @@
 	int rc;
 
-	rc = usb_pipe_start_long_transfer(pipe);
-	if (rc != EOK) {
-		return rc;
-	}
-
+	usb_pipe_start_long_transfer(pipe);
 
 	uint8_t dev_descr_start[CTRL_PIPE_MIN_PACKET_SIZE];
Index: uspace/lib/usb/src/pipesio.c
===================================================================
--- uspace/lib/usb/src/pipesio.c	(revision 1553cbfd86b927d7ac7361cde758f8694492651d)
+++ uspace/lib/usb/src/pipesio.c	(revision cf2ccd4368b5ded2c44cf0c34588f91253ac78f9)
@@ -173,5 +173,5 @@
 
 	int rc;
-	rc = pipe_add_ref(pipe);
+	rc = pipe_add_ref(pipe, false);
 	if (rc != EOK) {
 		return rc;
@@ -296,5 +296,5 @@
 	int rc;
 
-	rc = pipe_add_ref(pipe);
+	rc = pipe_add_ref(pipe, false);
 	if (rc != EOK) {
 		return rc;
@@ -447,5 +447,5 @@
 	int rc;
 
-	rc = pipe_add_ref(pipe);
+	rc = pipe_add_ref(pipe, false);
 	if (rc != EOK) {
 		return rc;
@@ -579,5 +579,5 @@
 	int rc;
 
-	rc = pipe_add_ref(pipe);
+	rc = pipe_add_ref(pipe, false);
 	if (rc != EOK) {
 		return rc;
