Index: uspace/drv/usbhid/generic/hiddev.c
===================================================================
--- uspace/drv/usbhid/generic/hiddev.c	(revision 78dbf5b288c54a2122817843bf8aa6ed13c36b21)
+++ uspace/drv/usbhid/generic/hiddev.c	(revision 6c6a95d279d3b6dc66db477ee34aa127ededb6c8)
@@ -39,5 +39,4 @@
 #include <errno.h>
 #include <str_error.h>
-#include <bool.h>
 
 #include <usbhid_iface.h>
@@ -65,6 +64,4 @@
     size_t size, size_t *act_size, unsigned int flags);
 
-static int usb_generic_hid_client_connected(ddf_fun_t *fun);
-
 /*----------------------------------------------------------------------------*/
 
@@ -75,6 +72,5 @@
 
 static ddf_dev_ops_t usb_generic_hid_ops = {
-	.interfaces[USBHID_DEV_IFACE] = &usb_generic_iface,
-	.open = usb_generic_hid_client_connected
+	.interfaces[USBHID_DEV_IFACE] = &usb_generic_iface
 };
 
@@ -108,25 +104,10 @@
 	
 	/*! @todo This should probably be atomic. */
-	if (usb_hid_report_ready()) {
-		memcpy(buffer, hid_dev->input_report, 
-		    hid_dev->input_report_size);
-		*act_size = hid_dev->input_report_size;
-		usb_hid_report_received();
-	}
+	memcpy(buffer, hid_dev->input_report, hid_dev->input_report_size);
+	*act_size = hid_dev->input_report_size;
 	
 	// clear the buffer so that it will not be received twice
-	//memset(hid_dev->input_report, 0, hid_dev->input_report_size);
+	memset(hid_dev->input_report, 0, hid_dev->input_report_size);
 	
-	// note that we already received this report
-//	report_received = true;
-	
-	return EOK;
-}
-
-/*----------------------------------------------------------------------------*/
-
-static int usb_generic_hid_client_connected(ddf_fun_t *fun)
-{
-	usb_hid_report_received();
 	return EOK;
 }
Index: uspace/drv/usbhid/kbd/kbddev.c
===================================================================
--- uspace/drv/usbhid/kbd/kbddev.c	(revision 78dbf5b288c54a2122817843bf8aa6ed13c36b21)
+++ uspace/drv/usbhid/kbd/kbddev.c	(revision 6c6a95d279d3b6dc66db477ee34aa127ededb6c8)
@@ -255,6 +255,4 @@
 	
 	if (hid_dev == NULL || hid_dev->data == NULL) {
-		usb_log_debug("default_connection_handler: "
-		    "Missing parameter.\n");
 		async_answer_0(icallid, EINVAL);
 		return;
@@ -269,6 +267,4 @@
 
 		if (kbd_dev->console_phone != -1) {
-			usb_log_debug("default_connection_handler: "
-			    "console phone already set\n");
 			async_answer_0(icallid, ELIMIT);
 			return;
@@ -276,11 +272,8 @@
 
 		kbd_dev->console_phone = callback;
-		
-		usb_log_debug("default_connection_handler: OK\n");
 		async_answer_0(icallid, EOK);
 		return;
 	}
 	
-	usb_log_debug("default_connection_handler: Wrong function.\n");
 	async_answer_0(icallid, EINVAL);
 }
Index: uspace/drv/usbhid/mouse/mousedev.c
===================================================================
--- uspace/drv/usbhid/mouse/mousedev.c	(revision 78dbf5b288c54a2122817843bf8aa6ed13c36b21)
+++ uspace/drv/usbhid/mouse/mousedev.c	(revision 6c6a95d279d3b6dc66db477ee34aa127ededb6c8)
@@ -43,8 +43,4 @@
 #include <str_error.h>
 #include <ipc/mouse.h>
-#include <io/console.h>
-
-#include <ipc/kbd.h>
-#include <io/keycode.h>
 
 #include "mousedev.h"
@@ -65,7 +61,5 @@
 
 const char *HID_MOUSE_FUN_NAME = "mouse";
-const char *HID_MOUSE_WHEEL_FUN_NAME = "mouse-wheel";
 const char *HID_MOUSE_CLASS_NAME = "mouse";
-const char *HID_MOUSE_WHEEL_CLASS_NAME = "keyboard";
 
 /** Default idle rate for mouses. */
@@ -125,6 +119,4 @@
 	
 	if (hid_dev == NULL || hid_dev->data == NULL) {
-		usb_log_debug("default_connection_handler: Missing "
-		    "parameters.\n");
 		async_answer_0(icallid, EINVAL);
 		return;
@@ -135,19 +127,13 @@
 	usb_mouse_t *mouse_dev = (usb_mouse_t *)hid_dev->data;
 	
-	int *phone = (str_cmp(fun->name, HID_MOUSE_FUN_NAME) == 0) 
-		     ? &mouse_dev->mouse_phone : &mouse_dev->wheel_phone;
-	
 	if (method == IPC_M_CONNECT_TO_ME) {
 		int callback = IPC_GET_ARG5(*icall);
 
-		if (*phone != -1) {
-			usb_log_debug("default_connection_handler: Console "
-			    "phone to mouse already set.\n");
+		if (mouse_dev->console_phone != -1) {
 			async_answer_0(icallid, ELIMIT);
-			//async_answer_0(icallid, EOK);
 			return;
 		}
 
-		*phone = callback;
+		mouse_dev->console_phone = callback;
 		usb_log_debug("Console phone to mouse set ok (%d).\n", callback);
 		async_answer_0(icallid, EOK);
@@ -155,5 +141,4 @@
 	}
 
-	usb_log_debug("default_connection_handler: Invalid function.\n");
 	async_answer_0(icallid, EINVAL);
 }
@@ -167,6 +152,5 @@
 		return NULL;
 	}
-	mouse->mouse_phone = -1;
-	mouse->wheel_phone = -1;
+	mouse->console_phone = -1;
 	
 	return mouse;
@@ -180,10 +164,6 @@
 	
 	// hangup phone to the console
-	if ((*mouse_dev)->mouse_phone >= 0) {
-		async_hangup((*mouse_dev)->mouse_phone);
-	}
-	
-	if ((*mouse_dev)->wheel_phone >= 0) {
-		async_hangup((*mouse_dev)->wheel_phone);
+	if ((*mouse_dev)->console_phone >= 0) {
+		async_hangup((*mouse_dev)->console_phone);
 	}
 	
@@ -194,36 +174,6 @@
 /*----------------------------------------------------------------------------*/
 
-static void usb_mouse_send_wheel(const usb_mouse_t *mouse_dev, int wheel)
-{
-	console_event_t ev;
-	
-	ev.type = KEY_PRESS;
-	ev.key = (wheel > 0) ? KC_UP : (wheel < 0) ? KC_DOWN : 0;
-	ev.mods = 0;
-	ev.c = 0;
-
-	if (mouse_dev->wheel_phone < 0) {
-		usb_log_warning(
-		    "Connection to console not ready, key discarded.\n");
-		return;
-	}
-	
-	int count = (wheel < 0) ? -wheel : wheel;
-	int i;
-	
-	for (i = 0; i < count * 3; ++i) {
-		usb_log_debug2("Sending key %d to the console\n", ev.key);
-		async_msg_4(mouse_dev->wheel_phone, KBD_EVENT, ev.type, 
-		    ev.key, ev.mods, ev.c);
-		// send key release right away
-		async_msg_4(mouse_dev->wheel_phone, KBD_EVENT, KEY_RELEASE, 
-		    ev.key, ev.mods, ev.c);
-	}
-}
-
-/*----------------------------------------------------------------------------*/
-
-static bool usb_mouse_process_report(usb_hid_dev_t *hid_dev, uint8_t *buffer,
-    size_t buffer_size)
+static bool usb_mouse_process_boot_report(usb_hid_dev_t *hid_dev,
+    uint8_t *buffer, size_t buffer_size)
 {
 	usb_mouse_t *mouse_dev = (usb_mouse_t *)hid_dev->data;
@@ -232,5 +182,5 @@
 	    usb_debug_str_buffer(buffer, buffer_size, 0));
 	
-	if (mouse_dev->mouse_phone < 0) {
+	if (mouse_dev->console_phone < 0) {
 		usb_log_error(NAME " No console phone.\n");
 		return false;	// ??
@@ -302,35 +252,7 @@
 	
 	if ((shift_x != 0) || (shift_y != 0)) {
-		async_req_2_0(mouse_dev->mouse_phone,
+		async_req_2_0(mouse_dev->console_phone,
 		    MEVENT_MOVE, shift_x, shift_y);
 	}
-	
-	/*
-	 * Wheel
-	 */
-	int wheel;
-	
-	path = usb_hid_report_path();
-	usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_GENERIC_DESKTOP, 
-	    USB_HIDUT_USAGE_GENERIC_DESKTOP_WHEEL);
-
-	usb_hid_report_path_set_report_id(path, report_id);
-	
-	field = usb_hid_report_get_sibling(
-	    hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_END, 
-	    USB_HID_REPORT_TYPE_INPUT);
-
-	if (field != NULL) {
-		usb_log_debug(NAME " VALUE(%X) USAGE(%X)\n", field->value, 
-		    field->usage);
-		wheel = field->value;
-	}
-
-	usb_hid_report_path_free(path);
-	
-	// send arrow up for positive direction and arrow down for negative
-	// direction; three arrows for difference of 1
-	usb_mouse_send_wheel(mouse_dev, wheel);
-	
 	
 	/*
@@ -352,5 +274,5 @@
 		if (mouse_dev->buttons[field->usage - field->usage_minimum] == 0
 		    && field->value != 0) {
-			async_req_2_0(mouse_dev->mouse_phone,
+			async_req_2_0(mouse_dev->console_phone,
 			    MEVENT_BUTTON, field->usage, 1);
 			mouse_dev->buttons[field->usage - field->usage_minimum]
@@ -359,5 +281,5 @@
 		    mouse_dev->buttons[field->usage - field->usage_minimum] != 0
 		    && field->value == 0) {
-		       async_req_2_0(mouse_dev->mouse_phone,
+		       async_req_2_0(mouse_dev->console_phone,
 			   MEVENT_BUTTON, field->usage, 0);
 		       mouse_dev->buttons[field->usage - field->usage_minimum]
@@ -415,42 +337,4 @@
 	}
 	
-	/*
-	 * Special function for acting as keyboard (wheel)
-	 */
-	usb_log_debug("Creating DDF function %s...\n", 
-	              HID_MOUSE_WHEEL_FUN_NAME);
-	fun = ddf_fun_create(hid_dev->usb_dev->ddf_dev, fun_exposed, 
-	    HID_MOUSE_WHEEL_FUN_NAME);
-	if (fun == NULL) {
-		usb_log_error("Could not create DDF function node.\n");
-		return ENOMEM;
-	}
-	
-	/*
-	 * Store the initialized HID device and HID ops
-	 * to the DDF function.
-	 */
-	fun->ops = &hid_dev->ops;
-	fun->driver_data = hid_dev;   // TODO: maybe change to hid_dev->data
-
-	rc = ddf_fun_bind(fun);
-	if (rc != EOK) {
-		usb_log_error("Could not bind DDF function: %s.\n",
-		    str_error(rc));
-		ddf_fun_destroy(fun);
-		return rc;
-	}
-	
-	usb_log_debug("Adding DDF function to class %s...\n", 
-	    HID_MOUSE_WHEEL_CLASS_NAME);
-	rc = ddf_fun_add_to_class(fun, HID_MOUSE_WHEEL_CLASS_NAME);
-	if (rc != EOK) {
-		usb_log_error(
-		    "Could not add DDF function to class %s: %s.\n",
-		    HID_MOUSE_WHEEL_CLASS_NAME, str_error(rc));
-		ddf_fun_destroy(fun);
-		return rc;
-	}
-	
 	return EOK;
 }
@@ -523,5 +407,5 @@
 	}
 	
-	return usb_mouse_process_report(hid_dev, buffer, buffer_size);
+	return usb_mouse_process_boot_report(hid_dev, buffer, buffer_size);
 }
 
Index: uspace/drv/usbhid/mouse/mousedev.h
===================================================================
--- uspace/drv/usbhid/mouse/mousedev.h	(revision 78dbf5b288c54a2122817843bf8aa6ed13c36b21)
+++ uspace/drv/usbhid/mouse/mousedev.h	(revision 6c6a95d279d3b6dc66db477ee34aa127ededb6c8)
@@ -48,6 +48,5 @@
 	//suseconds_t poll_interval_us;
 	/** IPC phone to console (consumer). */
-	int mouse_phone;
-	int wheel_phone;
+	int console_phone;
 	
 	int32_t *buttons;
Index: uspace/drv/usbhid/subdrivers.c
===================================================================
--- uspace/drv/usbhid/subdrivers.c	(revision 78dbf5b288c54a2122817843bf8aa6ed13c36b21)
+++ uspace/drv/usbhid/subdrivers.c	(revision 6c6a95d279d3b6dc66db477ee34aa127ededb6c8)
@@ -36,23 +36,9 @@
 #include "subdrivers.h"
 #include "usb/classes/hidut.h"
-#include "usb/classes/hidpath.h"
 
 #include "lgtch-ultrax/lgtch-ultrax.h"
-#include "mouse/mousedev.h"
 
 static usb_hid_subdriver_usage_t path_kbd[] = {
 	{USB_HIDUT_PAGE_KEYBOARD, 0}, 
-	{0, 0}
-};
-
-static usb_hid_subdriver_usage_t path_mouse[] = {
-	{USB_HIDUT_PAGE_GENERIC_DESKTOP, USB_HIDUT_USAGE_GENERIC_DESKTOP_MOUSE},
-	{USB_HIDUT_PAGE_GENERIC_DESKTOP, 
-	 USB_HIDUT_USAGE_GENERIC_DESKTOP_POINTER},
-	{0, 0}
-};
-
-static usb_hid_subdriver_usage_t path_mouse2[] = {
-	{USB_HIDUT_PAGE_GENERIC_DESKTOP, USB_HIDUT_USAGE_GENERIC_DESKTOP_X},
 	{0, 0}
 };
@@ -93,31 +79,4 @@
 		}
 	},
-	{
-		path_mouse,
-		-1,
-		USB_HID_PATH_COMPARE_COLLECTION_ONLY,
-		-1,
-		-1,
-		{
-			.init = usb_mouse_init,
-			.deinit = usb_mouse_deinit,
-			.poll = usb_mouse_polling_callback,
-			.poll_end = NULL
-		}
-	},
-	{
-		path_mouse2,
-		-1,
-		USB_HID_PATH_COMPARE_END 
-		| USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
-		-1,
-		-1,
-		{
-			.init = usb_mouse_init,
-			.deinit = usb_mouse_deinit,
-			.poll = usb_mouse_polling_callback,
-			.poll_end = NULL
-		}
-	},
 	{NULL, -1, 0, -1, -1, {NULL, NULL, NULL, NULL}}
 };
Index: uspace/drv/usbhid/usbhid.c
===================================================================
--- uspace/drv/usbhid/usbhid.c	(revision 78dbf5b288c54a2122817843bf8aa6ed13c36b21)
+++ uspace/drv/usbhid/usbhid.c	(revision 6c6a95d279d3b6dc66db477ee34aa127ededb6c8)
@@ -63,6 +63,4 @@
 static const int USB_HID_MAX_SUBDRIVERS = 10;
 
-static fibril_local bool report_received;
-
 /*----------------------------------------------------------------------------*/
 
@@ -414,5 +412,7 @@
 	}
 	
-	if (fallback) {
+	// TODO: remove the mouse hack
+	if (hid_dev->poll_pipe_index == USB_HID_MOUSE_POLL_EP_NO ||
+	    fallback) {
 		// fall back to boot protocol
 		switch (hid_dev->poll_pipe_index) {
@@ -509,5 +509,4 @@
 				free(input_old);
 			}
-			usb_hid_new_report();
 		}
 	}
@@ -590,25 +589,4 @@
 /*----------------------------------------------------------------------------*/
 
-void usb_hid_new_report(void)
-{
-	report_received = false;
-}
-
-/*----------------------------------------------------------------------------*/
-
-void usb_hid_report_received(void)
-{
-	report_received = true;
-}
-
-/*----------------------------------------------------------------------------*/
-
-bool usb_hid_report_ready(void)
-{
-	return !report_received;
-}
-
-/*----------------------------------------------------------------------------*/
-
 void usb_hid_free(usb_hid_dev_t **hid_dev)
 {
Index: uspace/drv/usbhid/usbhid.h
===================================================================
--- uspace/drv/usbhid/usbhid.h	(revision 78dbf5b288c54a2122817843bf8aa6ed13c36b21)
+++ uspace/drv/usbhid/usbhid.h	(revision 6c6a95d279d3b6dc66db477ee34aa127ededb6c8)
@@ -44,5 +44,4 @@
 #include <usb/devdrv.h>
 #include <usb/classes/hid.h>
-#include <bool.h>
 
 struct usb_hid_dev;
@@ -129,10 +128,4 @@
 //const char *usb_hid_get_class_name(const usb_hid_dev_t *hid_dev);
 
-void usb_hid_new_report(void);
-
-void usb_hid_report_received(void);
-
-bool usb_hid_report_ready(void);
-
 void usb_hid_free(usb_hid_dev_t **hid_dev);
 
Index: uspace/lib/usb/include/usb/classes/hiddescriptor.h
===================================================================
--- uspace/lib/usb/include/usb/classes/hiddescriptor.h	(revision 78dbf5b288c54a2122817843bf8aa6ed13c36b21)
+++ uspace/lib/usb/include/usb/classes/hiddescriptor.h	(revision 6c6a95d279d3b6dc66db477ee34aa127ededb6c8)
@@ -78,5 +78,4 @@
 uint32_t usb_hid_report_tag_data_uint32(const uint8_t *data, size_t size);
 
-usb_hid_report_path_t *usb_hid_report_path_try_insert(usb_hid_report_t *report, usb_hid_report_path_t *cmp_path);
 #endif
 /**
Index: uspace/lib/usb/include/usb/classes/hidpath.h
===================================================================
--- uspace/lib/usb/include/usb/classes/hidpath.h	(revision 78dbf5b288c54a2122817843bf8aa6ed13c36b21)
+++ uspace/lib/usb/include/usb/classes/hidpath.h	(revision 6c6a95d279d3b6dc66db477ee34aa127ededb6c8)
@@ -43,14 +43,8 @@
  * Description of path of usage pages and usages in report descriptor
  */
-/** Wanted usage path must be exactly the same as the searched one */
-#define USB_HID_PATH_COMPARE_STRICT		0
-/** Wanted usage path must be the suffix in the searched one */
-#define USB_HID_PATH_COMPARE_END		1
-/** */
-#define USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY	2
-/** Searched usage page must be prefix of the other one */
-#define USB_HID_PATH_COMPARE_BEGIN		4
-/** Searched couple of usage page and usage can be anywhere in usage path */
-#define USB_HID_PATH_COMPARE_ANYWHERE		8
+#define USB_HID_PATH_COMPARE_STRICT				0
+#define USB_HID_PATH_COMPARE_END				1
+#define USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY	4
+#define USB_HID_PATH_COMPARE_COLLECTION_ONLY	2 /* porovnava jenom cestu z Kolekci */
 
 
Index: uspace/lib/usb/include/usb/classes/hidtypes.h
===================================================================
--- uspace/lib/usb/include/usb/classes/hidtypes.h	(revision 78dbf5b288c54a2122817843bf8aa6ed13c36b21)
+++ uspace/lib/usb/include/usb/classes/hidtypes.h	(revision 6c6a95d279d3b6dc66db477ee34aa127ededb6c8)
@@ -165,6 +165,4 @@
 	/** */	
 	link_t link;
-
-	int in_delimiter;
 } usb_hid_report_item_t;
 
Index: uspace/lib/usb/src/hiddescriptor.c
===================================================================
--- uspace/lib/usb/src/hiddescriptor.c	(revision 78dbf5b288c54a2122817843bf8aa6ed13c36b21)
+++ uspace/lib/usb/src/hiddescriptor.c	(revision 6c6a95d279d3b6dc66db477ee34aa127ededb6c8)
@@ -41,9 +41,4 @@
 #include <assert.h>
 
-
-#define OUTSIDE_DELIMITER_SET	0
-#define START_DELIMITER_SET	1
-#define INSIDE_DELIMITER_SET	2
-	
 /** The new report item flag. Used to determine when the item is completly
  * configured and should be added to the report structure
@@ -61,6 +56,31 @@
 #define USB_HID_UNKNOWN_TAG		-99
 
-usb_hid_report_path_t *usb_hid_report_path_try_insert(usb_hid_report_t *report, usb_hid_report_path_t *cmp_path)
-{
+
+/**
+ * Initialize the report descriptor parser structure
+ *
+ * @param parser Report descriptor parser structure
+ * @return Error code
+ */
+int usb_hid_report_init(usb_hid_report_t *report)
+{
+	if(report == NULL) {
+		return EINVAL;
+	}
+
+	memset(report, 0, sizeof(usb_hid_report_t));
+	list_initialize(&report->reports);
+	list_initialize(&report->collection_paths);
+
+	report->use_report_ids = 0;
+    return EOK;   
+}
+
+int usb_hid_report_append_fields(usb_hid_report_t *report, usb_hid_report_item_t *report_item)
+{
+	usb_hid_report_field_t *field;
+	int i;
+
+
 	/* find or append current collection path to the list */
 	link_t *path_it = report->collection_paths.next;
@@ -69,5 +89,5 @@
 		path = list_get_instance(path_it, usb_hid_report_path_t, link);
 		
-		if(usb_hid_report_compare_usage_path(path, cmp_path, USB_HID_PATH_COMPARE_STRICT) == EOK){
+		if(usb_hid_report_compare_usage_path(path, report_item->usage_path, USB_HID_PATH_COMPARE_STRICT) == EOK){
 			break;
 		}			
@@ -75,44 +95,8 @@
 	}
 	if(path_it == &report->collection_paths) {
-		path = usb_hid_report_path_clone(cmp_path);			
+		path = usb_hid_report_path_clone(report_item->usage_path);			
 		list_append(&path->link, &report->collection_paths);					
 		report->collection_paths_count++;
-
-		return path;
-	}
-	else {
-		return list_get_instance(path_it, usb_hid_report_path_t, link);
-	}
-}
-
-/**
- * Initialize the report descriptor parser structure
- *
- * @param parser Report descriptor parser structure
- * @return Error code
- */
-int usb_hid_report_init(usb_hid_report_t *report)
-{
-	if(report == NULL) {
-		return EINVAL;
-	}
-
-	memset(report, 0, sizeof(usb_hid_report_t));
-	list_initialize(&report->reports);
-	list_initialize(&report->collection_paths);
-
-	report->use_report_ids = 0;
-    return EOK;   
-}
-
-
-/*
- *
- *
- */
-int usb_hid_report_append_fields(usb_hid_report_t *report, usb_hid_report_item_t *report_item)
-{
-	usb_hid_report_field_t *field;
-	int i;
+	}
 
 	for(i=0; i<report_item->usages_count; i++){
@@ -120,5 +104,5 @@
 	}
 
-	usb_hid_report_path_t *path = report_item->usage_path;	
+	
 	for(i=0; i<report_item->count; i++){
 
@@ -128,4 +112,5 @@
 
 		/* fill the attributes */		
+		field->collection_path = path;
 		field->logical_minimum = report_item->logical_minimum;
 		field->logical_maximum = report_item->logical_maximum;
@@ -144,9 +129,19 @@
 		if(report_item->usages_count > 0 && ((report_item->usage_minimum == 0) && (report_item->usage_maximum == 0))) {
 			uint32_t usage;
-			if(i < report_item->usages_count){
-				usage = report_item->usages[i];
+			if(report_item->type != USB_HID_REPORT_TYPE_OUTPUT) {
+				if(i < report_item->usages_count){
+					usage = report_item->usages[i];
+				}
+				else {
+					usage = report_item->usages[report_item->usages_count - 1];
+				}
 			}
 			else {
-				usage = report_item->usages[report_item->usages_count - 1];
+				if((report_item->count - i - 1) < report_item->usages_count){
+					usage = report_item->usages[(report_item->count - i - 1)];
+				}
+				else {
+					usage = report_item->usages[report_item->usages_count - 1];
+				}
 			}
 
@@ -164,18 +159,15 @@
 
 		if((USB_HID_ITEM_FLAG_VARIABLE(report_item->item_flags) != 0) && (!((report_item->usage_minimum == 0) && (report_item->usage_maximum == 0)))) {
-			field->usage = report_item->usage_minimum + i;					
-		}
-		
-		usb_hid_report_set_last_item(path, USB_HID_TAG_CLASS_GLOBAL, field->usage_page);
-		usb_hid_report_set_last_item(path, USB_HID_TAG_CLASS_LOCAL, field->usage);
-
-		field->collection_path = usb_hid_report_path_try_insert(report, path);
-
+			if(report_item->type == USB_HID_REPORT_TYPE_INPUT) {
+				field->usage = report_item->usage_maximum - i;
+			}
+			else {
+				field->usage = report_item->usage_minimum + i;					
+			}
+
+		}
+		
 		field->size = report_item->size;
-		
-		size_t offset_byte = (report_item->offset + (i * report_item->size)) / 8;
-		size_t offset_bit = 8 - ((report_item->offset + (i * report_item->size)) % 8) - report_item->size;
-
-		field->offset = 8 * offset_byte + offset_bit;
+		field->offset = report_item->offset + (i * report_item->size);
 		if(report_item->id != 0) {
 			field->offset += 8;
@@ -272,5 +264,4 @@
 		return ENOMEM;
 	}
-	usb_hid_report_path_append_item(usage_path, 0, 0);	
 	
 	while(i<size){	
@@ -358,6 +349,5 @@
 					tmp_usage_path = list_get_instance(report_item->usage_path->link.prev, usb_hid_report_usage_path_t, link);
 					
-					usb_hid_report_set_last_item(usage_path, USB_HID_TAG_CLASS_GLOBAL, tmp_usage_path->usage_page);
-					usb_hid_report_set_last_item(usage_path, USB_HID_TAG_CLASS_LOCAL, tmp_usage_path->usage);
+					usb_hid_report_set_last_item(usage_path, tmp_usage_path->usage_page, tmp_usage_path->usage);
 
 					usb_hid_report_path_free(report_item->usage_path);
@@ -437,7 +427,5 @@
 int usb_hid_report_parse_main_tag(uint8_t tag, const uint8_t *data, size_t item_size,
                              usb_hid_report_item_t *report_item, usb_hid_report_path_t *usage_path)
-{
-	usb_hid_report_usage_path_t *path_item;
-	
+{		
 	switch(tag)
 	{
@@ -450,15 +438,6 @@
 			
 		case USB_HID_REPORT_TAG_COLLECTION:
-			// store collection atributes
-			path_item = list_get_instance(usage_path->head.prev, usb_hid_report_usage_path_t, link);
-			path_item->flags = *data;	
-			
-			// set last item
-			usb_hid_report_set_last_item(usage_path, USB_HID_TAG_CLASS_GLOBAL, report_item->usage_page);
-			usb_hid_report_set_last_item(usage_path, USB_HID_TAG_CLASS_LOCAL, report_item->usages[report_item->usages_count-1]);
-			
-			// append the new one which will be set by common
-			// usage/usage page
-			usb_hid_report_path_append_item(usage_path, report_item->usage_page, report_item->usages[report_item->usages_count-1]);	
+			// TODO usage_path->flags = *data;
+			usb_hid_report_path_append_item(usage_path, report_item->usage_page, report_item->usages[report_item->usages_count-1]);						
 			usb_hid_report_reset_local_items (report_item);
 			return USB_HID_NO_ACTION;
@@ -551,17 +530,9 @@
                              usb_hid_report_item_t *report_item, usb_hid_report_path_t *usage_path)
 {
-	switch(tag) {
+	switch(tag)
+	{
 		case USB_HID_REPORT_TAG_USAGE:
-			switch(report_item->in_delimiter) {
-				case INSIDE_DELIMITER_SET:
-					// nothing to do
-					break;
-				case START_DELIMITER_SET:
-					report_item->in_delimiter = INSIDE_DELIMITER_SET;
-				case OUTSIDE_DELIMITER_SET:
-					report_item->usages[report_item->usages_count] = usb_hid_report_tag_data_uint32(data,item_size);
-					report_item->usages_count++;
-					break;
-			}
+			report_item->usages[report_item->usages_count] = usb_hid_report_tag_data_uint32(data,item_size);
+			report_item->usages_count++;
 			break;
 		case USB_HID_REPORT_TAG_USAGE_MINIMUM:
@@ -604,11 +575,13 @@
 			break;			
 		case USB_HID_REPORT_TAG_DELIMITER:
-			report_item->in_delimiter = usb_hid_report_tag_data_uint32(data,item_size);
-			break;
-
+			//report_item->delimiter = usb_hid_report_tag_data_uint32(data,item_size);
+			//TODO: 
+			//	DELIMITER STUFF
+			break;
+		
 		default:
 			return USB_HID_NO_ACTION;
 	}
-
+	
 	return EOK;
 }
@@ -656,5 +629,5 @@
 
 		usb_log_debug("\t\tOFFSET: %X\n", report_item->offset);
-		usb_log_debug("\t\tSIZE: %X\n", report_item->size);				
+		usb_log_debug("\t\tSIZE: %zu\n", report_item->size);
 		usb_log_debug("\t\tLOGMIN: %d\n", report_item->logical_minimum);
 		usb_log_debug("\t\tLOGMAX: %d\n", report_item->logical_maximum);		
@@ -667,8 +640,6 @@
 		usb_log_debug("\t\ttUSAGE: %X\n", report_item->usage);
 		usb_log_debug("\t\tUSAGE PAGE: %X\n", report_item->usage_page);
-		
-		//usb_hid_print_usage_path(report_item->collection_path);
-
-		usb_log_debug("\n");		
+						
+//		usb_log_debug("\n");		
 
 	}
@@ -695,6 +666,6 @@
 		usb_log_debug("Report ID: %d\n", report_des->report_id);
 		usb_log_debug("\tType: %d\n", report_des->type);
-		usb_log_debug("\tLength: %d\n", report_des->bit_length);		
-		usb_log_debug("\tItems: %d\n", report_des->item_length);		
+		usb_log_debug("\tLength: %zu\n", report_des->bit_length);
+		usb_log_debug("\tItems: %zu\n", report_des->item_length);
 
 		usb_hid_descriptor_print_list(&report_des->report_items);
Index: uspace/lib/usb/src/hidparser.c
===================================================================
--- uspace/lib/usb/src/hidparser.c	(revision 78dbf5b288c54a2122817843bf8aa6ed13c36b21)
+++ uspace/lib/usb/src/hidparser.c	(revision 6c6a95d279d3b6dc66db477ee34aa127ededb6c8)
@@ -405,5 +405,5 @@
 				}
 
-				size_t shift = 8 - offset%8 - length;
+				size_t shift = offset%8;
 
 				value = value << shift;							
Index: uspace/lib/usb/src/hidpath.c
===================================================================
--- uspace/lib/usb/src/hidpath.c	(revision 78dbf5b288c54a2122817843bf8aa6ed13c36b21)
+++ uspace/lib/usb/src/hidpath.c	(revision 6c6a95d279d3b6dc66db477ee34aa127ededb6c8)
@@ -149,5 +149,5 @@
 		usb_log_debug("\tFLAGS: %d\n", path_item->flags);		
 		
-       		item = item->next;
+		item = item->next;
 	}
 }
@@ -156,6 +156,7 @@
  * Compares two usage paths structures
  *
- *
- * @param report_path usage path structure to compare with @path 
+ * If USB_HID_PATH_COMPARE_COLLECTION_ONLY flag is given, the last item in report_path structure is forgotten
+ *
+ * @param report_path usage path structure to compare
  * @param path usage patrh structure to compare
  * @param flags Flags determining the mode of comparison
@@ -178,5 +179,4 @@
 	}
 
-	// Empty path match all others
 	if(path->depth == 0){
 		return EOK;
@@ -189,43 +189,10 @@
 	
 	switch(flags){
-		/* path is somewhere in report_path */
-		case USB_HID_PATH_COMPARE_ANYWHERE:
-			if(path->depth != 1){
-				return 1;
-			}
-
-			// projit skrz cestu a kdyz nekde sedi tak vratim EOK
-			// dojduli az za konec tak nnesedi
-			report_link = report_path->head.next;
-			path_link = path->head.next;
-			path_item = list_get_instance(path_link, usb_hid_report_usage_path_t, link);
-
-			while(report_link != &report_path->head) {
-				report_item = list_get_instance(report_link, usb_hid_report_usage_path_t, link);
-				if(report_item->usage_page == path_item->usage_page){
-					if(only_page == 0){
-						if(report_item->usage == path_item->usage) {
-							return EOK;
-						}
-					}
-					else {
-						return EOK;
-					}
-				}
-
-				report_link = report_link->next;
-			}
-
-			return 1;
-			break;
-		/* the paths must be identical */
+		/* path must be completly identical */
 		case USB_HID_PATH_COMPARE_STRICT:
 				if(report_path->depth != path->depth){
 					return 1;
 				}
-		
-		/* path is prefix of the report_path */
-		case USB_HID_PATH_COMPARE_BEGIN:
-	
+
 				report_link = report_path->head.next;
 				path_link = path->head.next;
@@ -254,6 +221,8 @@
 				}
 
-				if((((flags & USB_HID_PATH_COMPARE_BEGIN) != 0) && (path_link == &path->head)) || 
-				   ((report_link == &report_path->head) && (path_link == &path->head))) {
+				if(((report_link == &report_path->head) && (path_link == &path->head)) || 
+				   (((flags & USB_HID_PATH_COMPARE_COLLECTION_ONLY) != 0) && 
+				    (path_link = &path->head) && 
+				    (report_link == report_path->head.prev))) {
 					return EOK;
 				}
@@ -263,8 +232,13 @@
 			break;
 
-		/* path is suffix of report_path */
+		/* compare with only the end of path*/
 		case USB_HID_PATH_COMPARE_END:
 
-				report_link = report_path->head.prev;
+				if((flags & USB_HID_PATH_COMPARE_COLLECTION_ONLY) != 0) {
+					report_link = report_path->head.prev->prev;
+				}
+				else {
+					report_link = report_path->head.prev;
+				}
 				path_link = path->head.prev;
 
